28 protected $move = array(
"left" =>
false,
"right" =>
false,
"up" =>
false,
"down" =>
false);
52 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
54 $tpl->addJavaScript(
"./Services/Block/js/ilblockcallback.js");
56 $this->
setLimit($ilUser->getPref(
"hits_per_page"));
61 $this->header_links[] =
62 array(
'href' => $a_href,
'text' => $a_text,
'status' => (
bool)$status);
77 $this->data = $a_data;
97 $this->bigmode = $a_bigmode;
117 $this->block_id = $a_block_id;
138 $this->detail_min = $a_min;
139 $this->detail_max = $a_max;
150 $this->currentdetaillevel = $a_currentdetaillevel;
162 $this->gui_object = $a_gui_object;
172 return $this->gui_object;
182 return $this->currentdetaillevel;
192 $this->title = $a_title;
212 $this->image = $a_image;
232 $this->offset = $a_offset;
242 return $this->offset;
247 if (!($this->offset < $this->max_count))
260 $this->limit = $a_limit;
280 $this->enableedit = $a_enableedit;
290 return $this->enableedit;
300 $this->repositorymode = $a_repositorymode;
310 return $this->repositorymode;
320 if ($a_hide_and_icon)
322 $this->footerinfo_icon = $a_footerinfo;
326 $this->footerinfo = $a_footerinfo;
337 if ($a_hide_and_icon)
354 $this->subtitle = $a_subtitle;
364 return $this->subtitle;
374 $this->refid = $a_refid;
394 $this->admincommands = $a_admincommands;
404 return $this->admincommands;
414 $this->colspan = $a_colspan;
434 $this->enabledetailrow = $a_enabledetailrow;
455 $this->enablenuminfo = $a_enablenuminfo;
476 $this->
property = $a_properties;
481 return $this->
property[$a_property];
486 $this->
property[$a_property] = $a_value;
496 $this->rowtemplatename = $a_rowtemplatename;
497 $this->rowtemplatedir = $a_rowtemplatedir;
527 return $this->rowtemplatename;
537 return $this->rowtemplatedir;
546 function addBlockCommand($a_href, $a_text, $a_target =
"", $a_img =
"", $a_right_aligned =
false,
547 $a_checked =
false, $a_html =
"")
549 return $this->block_commands[] =
550 array(
"href" => $a_href,
551 "text" => $a_text,
"target" => $a_target,
"img" => $a_img,
552 "right" => $a_right_aligned,
"checked" => $a_checked,
"html" => $a_html);
575 $this->close_command = $a_href;
579 $this->header_commands[] =
580 array(
"href" => $a_href,
598 function addFooterLink($a_text, $a_href =
"", $a_onclick =
"", $a_block_id =
"",
599 $a_top =
false, $a_omit_separator =
false, $a_checked =
false)
601 $this->footer_links[] = array(
604 "onclick" => $a_onclick,
605 "block_id" => $a_block_id,
607 "omit_separator" => $a_omit_separator,
608 "checked" => $a_checked);
624 $this->footer_links = array();
643 if ($this->detail_max > $this->detail_min)
645 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
649 $ilUser->getId(), $this->block_id);
653 $ilCtrl->redirectByClass(
"ilcolumngui",
"");
659 $ilUser->getId(), $this->block_id));
699 if (!$ilAccess->checkAccess(
"read",
"", $this->getRefId()))
705 $this->tpl =
new ilTemplate(
"tpl.block.html",
true,
true,
"Services/Block");
716 $this->tpl->setCurrentBlock(
"block_check");
717 $this->tpl->setVariable(
"BL_REF_ID", $this->
getRefId());
718 $this->tpl->parseCurrentBlock();
721 if ($ilAccess->checkAccess(
"delete",
"", $this->getRefId()))
724 "ilias.php?baseClass=ilRepositoryGUI&ref_id=".
$_GET[
"ref_id"].
"&cmd=delete".
726 $lng->txt(
"delete"));
730 "ilias.php?baseClass=ilRepositoryGUI&ref_id=".
$_GET[
"ref_id"].
"&cmd=cut".
736 if ($ilAccess->checkAccess(
"copy",
"", $this->getRefId()))
738 global $objDefinition;
740 $parent_gui =
"ilObj".$objDefinition->getClassName($parent_type).
"GUI";
742 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_id", $this->
getRefId());
743 $copy_cmd =
$ilCtrl->getLinkTargetByClass(
744 array(
"ilrepositorygui", $parent_gui,
"ilobjectcopygui"),
745 "initTargetSelection");
757 $this->tpl->setCurrentBlock(
"footer_information");
758 $this->tpl->setVariable(
"FOOTER_INFO", $this->
getFooterInfo());
759 $this->tpl->setVariable(
"FICOLSPAN", $this->
getColSpan());
760 $this->tpl->parseCurrentBlock();
763 $this->dropdown = array();
768 $has_block_command =
false;
772 if(!$command[
"img"] && !$command[
"html"])
774 $this->dropdown[] = $command;
778 $has_block_command =
true;
780 if ($command[
"target"] !=
"")
782 $this->tpl->setCurrentBlock(
"bc_target");
783 $this->tpl->setVariable(
"CMD_TARGET", $command[
"target"]);
784 $this->tpl->parseCurrentBlock();
787 if ($command[
"img"] !=
"")
789 $this->tpl->setCurrentBlock(
"bc_image");
790 $this->tpl->setVariable(
"SRC_BC", $command[
"img"]);
791 $this->tpl->setVariable(
"ALT_BC", $command[
"text"]);
792 $this->tpl->parseCurrentBlock();
793 $this->tpl->setCurrentBlock(
"block_command");
795 else if ($command[
"html"] !=
"")
797 $this->tpl->setCurrentBlock(
"bc_html");
798 $this->tpl->setVariable(
"HTML", $command[
"html"]);
799 $this->tpl->parseCurrentBlock();
800 $this->tpl->setCurrentBlock(
"block_command");
804 $this->tpl->setCurrentBlock(
"block_command");
805 $this->tpl->setVariable(
"CMD_TEXT", $command[
"text"]);
806 $this->tpl->setVariable(
"BC_CLASS",
'class="il_ContainerItemCommand"');
809 $this->tpl->setVariable(
"CMD_HREF", $command[
"href"]);
810 $this->tpl->parseCurrentBlock();
813 if($has_block_command)
815 $this->tpl->setCurrentBlock(
"block_commands");
816 $this->tpl->setVariable(
"CCOLSPAN", $this->
getColSpan());
817 $this->tpl->parseCurrentBlock();
838 $this->tpl->setCurrentBlock(
'head_delim');
839 $this->tpl->touchBlock(
'head_delim');
840 $this->tpl->parseCurrentBlock();
842 if($command[
'status'] ==
true)
844 $this->tpl->setCurrentBlock(
'head_link');
845 $this->tpl->setVariable(
'HHREF', $command[
'href']);
846 $this->tpl->setVariable(
'HLINK', $command[
'text']);
847 $this->tpl->parseCurrentBlock();
851 $this->tpl->setCurrentBlock(
'head_text');
852 $this->tpl->setVariable(
'HTEXT', $command[
'text']);
853 $this->tpl->parseCurrentBlock();
856 $this->tpl->setCurrentBlock(
'head_item');
857 $this->tpl->parseCurrentBlock();
862 $this->tpl->setCurrentBlock(
'header_links');
863 $this->tpl->parseCurrentBlock();
870 if (is_object(
$ilUser) &&
$ilUser->getPref(
"screen_reader_optimization"))
881 $this->tpl->setVariable(
"COLSPAN", $this->
getColSpan());
884 $this->tpl->touchBlock(
"hclassb");
888 $this->tpl->touchBlock(
"hclass");
894 echo $this->tpl->getAsynch();
899 return '<div id="'.
"block_".$this->
getBlockType().
"_".$this->block_id.
'">'.
900 $this->tpl->get().
'</div>';
913 ($this->detail_max > $this->detail_min && $this->detail_min == 0) ||
914 $this->close_command !=
"")
919 $this->tpl->setCurrentBlock(
"header_command");
920 $this->tpl->setVariable(
"HREF_HCOMM", $command[
"href"]);
921 $this->tpl->setVariable(
"TXT_HCOMM", $command[
"text"]);
922 $this->tpl->parseCurrentBlock();
926 if (($this->detail_max > $this->detail_min && $this->detail_min == 0 &&
929 $this->close_command !=
"")
931 $alt =
$lng->txt(
"hide");
932 if ($this->close_command !=
"")
938 $ilCtrl->setParameterByClass(
"ilcolumngui",
940 $url = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
941 $ilCtrl->setParameterByClass(
"ilcolumngui",
945 $this->dropdown[] = array(
"text" => $alt,
950 $this->tpl->setCurrentBlock(
"header_commands");
951 $this->tpl->parseCurrentBlock();
955 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
961 foreach($this->dropdown as $item)
963 if($item[
"href"] || $item[
"onclick"])
965 if ($item[
"checked"])
969 $dropdown->addItem($item[
"text"],
"", $item[
"href"], $item[
"image"],
970 $item[
"text"],
"",
"",
false, $item[
"onclick"]);
974 $this->tpl->setCurrentBlock(
"header_dropdown");
975 $this->tpl->setVariable(
"ADV_DROPDOWN",
$dropdown);
976 $this->tpl->parseCurrentBlock();
978 $this->tpl->setCurrentBlock(
"hitem");
979 $this->tpl->parseCurrentBlock();
993 $this->tpl->setCurrentBlock(
"block_img");
994 $this->tpl->setVariable(
"IMG_BLOCK", $this->
getImage());
995 $this->tpl->setVariable(
"IMID",
997 $this->tpl->setVariable(
"IMG_ALT",
998 str_replace(array(
"'",
'"'),
"", strip_tags(
$lng->txt(
"icon").
" ".$this->getTitle())));
999 $this->tpl->parseCurrentBlock();
1003 $this->tpl->setCurrentBlock(
"header_title");
1004 $this->tpl->setVariable(
"BTID",
1006 $this->tpl->setVariable(
"BLOCK_TITLE",
1008 $this->tpl->setVariable(
"TXT_BLOCK",
1009 $lng->txt(
"block"));
1010 $this->tpl->parseCurrentBlock();
1012 $this->tpl->setCurrentBlock(
"hitem");
1013 $this->tpl->parseCurrentBlock();
1022 $this->tpl->setCurrentBlock(
"data_section");
1023 $this->tpl->setVariable(
"DATA", $a_content);
1024 $this->tpl->parseCurrentBlock();
1025 $this->tpl->setVariable(
"BLOCK_ROW",
"");
1043 $nav = explode(
":", $this->nav_value);
1058 $this->max_count = count(
$data);
1064 foreach(
$data as $record)
1066 $this->tpl->setCurrentBlock(
"block_row");
1069 $this->tpl->setCurrentBlock(
"block_row");
1070 $this->tpl->parseCurrentBlock();
1076 foreach ($a_set as $key => $value)
1078 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
1088 $this->css_row = ($this->css_row !=
"ilBlockRow1")
1091 $this->tpl->setVariable($a_placeholder, $this->css_row);
1110 if ($end > $this->max_count or $this->
getLimit() == 0)
1115 $numinfo =
"(".$start.
"-".$end.
" ".strtolower(
$lng->txt(
"of")).
" ".$this->max_count.
")";
1142 $ilCtrl->setParameterByClass(
"ilcolumngui",
1146 $ilCtrl->setParameterByClass(
"ilcolumngui",
1147 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1149 $onclick =
$ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1150 "updateBlock",
"",
true);
1151 $ilCtrl->setParameterByClass(
"ilcolumngui",
1155 $href =
$ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1162 $pages = intval($this->max_count / $this->
getLimit());
1165 if (($this->max_count % $this->
getLimit()))
1173 $ilCtrl->setParameterByClass(
"ilcolumngui",
1177 $ilCtrl->setParameterByClass(
"ilcolumngui",
1178 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1181 $onclick =
$ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1182 "updateBlock",
"",
true);
1185 $ilCtrl->setParameterByClass(
"ilcolumngui",
1189 $href =
$ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1194 $ilCtrl->setParameterByClass(
"ilcolumngui",
1216 $prefix = ($a_top) ?
"top" :
"foot";
1220 $omit_separator =
false;
1221 foreach($flinks as $flink)
1223 if ($flink[
"top"] != $a_top)
1230 if($flink[
"onclick"])
1232 $flink[
"onclick"] =
"ilBlockJSHandler('".$flink[
"block_id"].
1233 "','".$flink[
"onclick"].
"')";
1235 $this->dropdown[] = $flink;
1241 if (!$first && !$omit_separator)
1243 $this->tpl->touchBlock($prefix.
"_delim");
1244 $this->tpl->touchBlock($prefix.
"_item");
1248 if ($flink[
"onclick"] !=
"")
1250 $this->tpl->setCurrentBlock($prefix.
"_onclick");
1251 $this->tpl->setVariable(
"OC_BLOCK_ID",
1252 $flink[
"block_id"]);
1253 $this->tpl->setVariable(
"OC_HREF",
1255 $this->tpl->parseCurrentBlock();
1259 if ($flink[
"href"] !=
"")
1262 $this->tpl->setCurrentBlock($prefix.
"_link");
1263 $this->tpl->setVariable(
"FHREF",
1265 $this->tpl->setVariable(
"FLINK", $flink[
"text"]);
1266 $this->tpl->parseCurrentBlock();
1267 $this->tpl->touchBlock($prefix.
"_item");
1271 $this->tpl->setCurrentBlock($prefix.
"_text");
1272 $this->tpl->setVariable(
"FTEXT", $flink[
"text"]);
1273 $this->tpl->parseCurrentBlock();
1274 $this->tpl->touchBlock($prefix.
"_item");
1278 $omit_separator = $flink[
"omit_separator"];
1281 if ($a_numinfo !=
"" && $has_link)
1283 $this->tpl->setVariable(
"NUMINFO", $a_numinfo);
1304 if ($this->enabledetailrow ==
false)
1309 $start = ($this->detail_min < 1)
1311 : $this->detail_min;
1315 : $this->detail_max;
1317 $settings = array();
1318 for ($i = $start; $i <= $end; $i++)
1325 foreach ($settings as $i)
1327 if (($i > $start && $i > 1))
1334 $ilCtrl->setParameterByClass(
"ilcolumngui",
1337 $onclick = $onclick_id =
"";
1342 $ilCtrl->setParameterByClass(
"ilcolumngui",
1343 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1344 $onclick =
$ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1345 "updateBlock",
"",
true);
1347 $ilCtrl->setParameterByClass(
"ilcolumngui",
1354 $url =
$ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1358 $onclick =
"ilBlockJSHandler('".$onclick_id.
"','".$onclick.
"')";
1362 $this->dropdown[] = array(
"text" =>
$text,
1365 "onclick" => $onclick,
1366 "checked" => $checked);
1373 $this->tpl->setCurrentBlock(
"det_info");
1374 $this->tpl->setVariable(
"INFO_TEXT", $this->
getFooterInfo(
true));
1375 $this->tpl->setVariable(
"ALT_DET_INFO",
$lng->txt(
"info_short"));
1378 $this->tpl->parseCurrentBlock();
1388 $ilCtrl->setParameterByClass(
"ilcolumngui",
User interface class for advanced drop-down selection lists.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
getBlockCommands()
Get Block commands.
setImage($a_image)
Set Image.
fillHeaderCommands()
Fill header commands block.
setFooterInfo($a_footerinfo, $a_hide_and_icon=false)
Set Footer Info.
getCurrentDetailLevel()
Get Current Detail Level.
getEnableDetailRow()
Get EnableDetailRow.
getBlockId()
Get Block Id.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setEnableDetailRow($a_enabledetailrow)
Set EnableDetailRow.
setSubtitle($a_subtitle)
Set Subtitle.
static isRepositoryObject()
setData($a_data)
Set Data.
setRefId($a_refid)
Set Ref Id (only used if isRepositoryObject() is true).
fillDetailRow()
Fill Detail Setting Row.
getRepositoryMode()
Get RepositoryMode.
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getAdminCommands()
Get Administration Commmands.
getHeaderCommands()
Get Header Block commands.
addHeaderCommand($a_href, $a_text, $a_as_close=false)
Add Header Block Command.
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
preloadData(array $data)
Can be overwritten in subclasses.
fillHeaderTitleBlock()
Fill header title block (title and.
fillDataSection()
Standard implementation for row based data.
static getScreenMode()
Get Screen Mode for current command.
getBigMode()
Get Big Mode.
setOffset($a_offset)
Set Offset.
addFooterLink($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
Add a footer text/link.
setBigMode($a_bigmode)
Set Big Mode.
getRowTemplateDir()
Get Row Template Directory.
getGuiObject()
Get GuiObject.
fillRowColor($a_placeholder="CSS_ROW")
getFooterLinks()
Get footer links.
getFooterInfo($a_hide_and_icon=false)
Get Footer Info.
addHeaderLink($a_href, $a_text, $status=true)
getRowTemplateName()
Get Row Template Name.
getEnableEdit()
Get EnableEdit.
setEnableEdit($a_enableedit)
Set EnableEdit.
setColSpan($a_colspan)
Set Columns Span.
setTitle($a_title)
Set Title.
setAdminCommands($a_admincommands)
Set Administration Commmands.
setBlockId($a_block_id=0)
Set Block Id.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
getColSpan()
Get Columns Span.
handleDetailLevel()
Handle read/write current detail level.
getEnableNumInfo()
Get Enable Item Number Info.
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
getRefId()
Get Ref Id (only used if isRepositoryObject() is true).
fillPreviousNext()
Fill previous/next row.
setGuiObject(&$a_gui_object)
Set GuiObject.
clearFooterLinks()
Clear footer links.
setProperties($a_properties)
This function is supposed to be used for block type specific properties, that should be inherited thr...
setRepositoryMode($a_repositorymode)
Set RepositoryMode.
getHTML()
Handle config status.
setPreviousNextLinks()
Get previous/next linkbar.
setProperty($a_property, $a_value)
getSubtitle()
Get Subtitle.
static _writeDetailLevel($a_type, $a_value, $a_user=0, $a_block_id=0)
Write detail level to database.
static _lookupDetailLevel($a_type, $a_user=0, $a_block_id=0)
Lookup detail level.
static _lookupType($a_id, $a_reference=false)
lookup object type
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static initConnection()
Init YUI Connection module.