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,
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);
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");
653 $ilCtrl->redirectByClass(
"ilcolumngui",
"");
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"));
733 $this->tpl->setCurrentBlock(
"footer_information");
734 $this->tpl->setVariable(
"FOOTER_INFO", $this->
getFooterInfo());
735 $this->tpl->setVariable(
"FICOLSPAN", $this->
getColSpan());
736 $this->tpl->parseCurrentBlock();
739 $this->dropdown = array();
744 $has_block_command =
false;
750 $this->dropdown[] = $command;
754 $has_block_command =
true;
756 if ($command[
"target"] !=
"")
758 $this->tpl->setCurrentBlock(
"bc_target");
759 $this->tpl->setVariable(
"CMD_TARGET", $command[
"target"]);
760 $this->tpl->parseCurrentBlock();
763 if ($command[
"img"] !=
"")
765 $this->tpl->setCurrentBlock(
"bc_image");
766 $this->tpl->setVariable(
"SRC_BC", $command[
"img"]);
767 $this->tpl->setVariable(
"ALT_BC", $command[
"text"]);
768 $this->tpl->parseCurrentBlock();
769 $this->tpl->setCurrentBlock(
"block_command");
773 $this->tpl->setCurrentBlock(
"block_command");
774 $this->tpl->setVariable(
"CMD_TEXT", $command[
"text"]);
775 $this->tpl->setVariable(
"BC_CLASS",
'class="il_ContainerItemCommand"');
778 $this->tpl->setVariable(
"CMD_HREF", $command[
"href"]);
779 $this->tpl->parseCurrentBlock();
782 if($has_block_command)
784 $this->tpl->setCurrentBlock(
"block_commands");
785 $this->tpl->setVariable(
"CCOLSPAN", $this->
getColSpan());
786 $this->tpl->parseCurrentBlock();
807 $this->tpl->setCurrentBlock(
'head_delim');
808 $this->tpl->touchBlock(
'head_delim');
809 $this->tpl->parseCurrentBlock();
811 if($command[
'status'] ==
true)
813 $this->tpl->setCurrentBlock(
'head_link');
814 $this->tpl->setVariable(
'HHREF', $command[
'href']);
815 $this->tpl->setVariable(
'HLINK', $command[
'text']);
816 $this->tpl->parseCurrentBlock();
820 $this->tpl->setCurrentBlock(
'head_text');
821 $this->tpl->setVariable(
'HTEXT', $command[
'text']);
822 $this->tpl->parseCurrentBlock();
825 $this->tpl->setCurrentBlock(
'head_item');
826 $this->tpl->parseCurrentBlock();
831 $this->tpl->setCurrentBlock(
'header_links');
832 $this->tpl->parseCurrentBlock();
839 if (is_object($ilUser) && $ilUser->getPref(
"screen_reader_optimization"))
852 include_once
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
857 foreach($this->dropdown as $item)
859 if($item[
"href"] || $item[
"onclick"])
861 if ($item[
"checked"])
865 $dropdown->addItem($item[
"text"],
"", $item[
"href"], $item[
"image"],
866 $item[
"text"],
"",
"",
false, $item[
"onclick"]);
870 $this->tpl->setVariable(
"ADV_DROPDOWN",
$dropdown);
873 $this->tpl->setVariable(
"COLSPAN", $this->
getColSpan());
876 $this->tpl->touchBlock(
"hclassb");
880 $this->tpl->touchBlock(
"hclass");
883 if ($ilCtrl->isAsynch())
886 echo $this->tpl->getAsynch();
891 return '<div id="'.
"block_".$this->
getBlockType().
"_".$this->block_id.
'">'.
892 $this->tpl->get().
'</div>';
905 ($this->detail_max > $this->detail_min && $this->detail_min == 0) ||
906 $this->close_command !=
"")
911 $this->tpl->setCurrentBlock(
"header_command");
912 $this->tpl->setVariable(
"HREF_HCOMM", $command[
"href"]);
913 $this->tpl->setVariable(
"TXT_HCOMM", $command[
"text"]);
914 $this->tpl->parseCurrentBlock();
918 if (($this->detail_max > $this->detail_min && $this->detail_min == 0 &&
921 $this->close_command !=
"")
923 $alt = $lng->txt(
"hide");
924 if ($this->close_command !=
"")
930 $ilCtrl->setParameterByClass(
"ilcolumngui",
932 $url = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
933 $ilCtrl->setParameterByClass(
"ilcolumngui",
937 $this->dropdown[] = array(
"text" => $alt,
942 $this->tpl->setCurrentBlock(
"header_commands");
943 $this->tpl->parseCurrentBlock();
946 $this->tpl->setCurrentBlock(
"hitem");
947 $this->tpl->parseCurrentBlock();
961 $this->tpl->setCurrentBlock(
"block_img");
962 $this->tpl->setVariable(
"IMG_BLOCK", $this->
getImage());
963 $this->tpl->setVariable(
"IMID",
965 $this->tpl->setVariable(
"IMG_ALT",
966 str_replace(array(
"'",
'"'),
"", strip_tags($lng->txt(
"icon").
" ".$this->
getTitle())));
967 $this->tpl->parseCurrentBlock();
971 $this->tpl->setCurrentBlock(
"header_title");
972 $this->tpl->setVariable(
"BTID",
974 $this->tpl->setVariable(
"BLOCK_TITLE",
976 $this->tpl->setVariable(
"TXT_BLOCK",
978 $this->tpl->parseCurrentBlock();
980 $this->tpl->setCurrentBlock(
"hitem");
981 $this->tpl->parseCurrentBlock();
990 $this->tpl->setCurrentBlock(
"data_section");
991 $this->tpl->setVariable(
"DATA", $a_content);
992 $this->tpl->parseCurrentBlock();
1010 $nav = explode(
":", $this->nav_value);
1025 $this->max_count = count(
$data);
1031 foreach(
$data as $record)
1033 $this->tpl->setCurrentBlock(
"block_row");
1036 $this->tpl->setCurrentBlock(
"block_row");
1037 $this->tpl->parseCurrentBlock();
1043 foreach ($a_set as $key => $value)
1045 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
1055 $this->css_row = ($this->css_row !=
"ilBlockRow1")
1058 $this->tpl->setVariable($a_placeholder, $this->css_row);
1077 if ($end > $this->max_count or $this->
getLimit() == 0)
1082 $numinfo =
"(".$start.
"-".$end.
" ".strtolower($lng->txt(
"of")).
" ".$this->max_count.
")";
1109 $ilCtrl->setParameterByClass(
"ilcolumngui",
1113 $ilCtrl->setParameterByClass(
"ilcolumngui",
1114 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1116 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1117 "updateBlock",
"",
true);
1118 $ilCtrl->setParameterByClass(
"ilcolumngui",
1122 $href = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1123 $text = $lng->txt(
"previous");
1129 $pages = intval($this->max_count / $this->
getLimit());
1132 if (($this->max_count % $this->
getLimit()))
1140 $ilCtrl->setParameterByClass(
"ilcolumngui",
1144 $ilCtrl->setParameterByClass(
"ilcolumngui",
1145 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1148 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1149 "updateBlock",
"",
true);
1152 $ilCtrl->setParameterByClass(
"ilcolumngui",
1156 $href = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1157 $text = $lng->txt(
"next");
1161 $ilCtrl->setParameterByClass(
"ilcolumngui",
1183 $prefix = ($a_top) ?
"top" :
"foot";
1187 $omit_separator =
false;
1188 foreach($flinks as $flink)
1190 if ($flink[
"top"] != $a_top)
1197 if($flink[
"onclick"])
1199 $flink[
"onclick"] =
"ilBlockJSHandler('".$flink[
"block_id"].
1200 "','".$flink[
"onclick"].
"')";
1202 $this->dropdown[] = $flink;
1208 if (!$first && !$omit_separator)
1210 $this->tpl->touchBlock($prefix.
"_delim");
1211 $this->tpl->touchBlock($prefix.
"_item");
1215 if ($flink[
"onclick"] !=
"")
1217 $this->tpl->setCurrentBlock($prefix.
"_onclick");
1218 $this->tpl->setVariable(
"OC_BLOCK_ID",
1219 $flink[
"block_id"]);
1220 $this->tpl->setVariable(
"OC_HREF",
1222 $this->tpl->parseCurrentBlock();
1226 if ($flink[
"href"] !=
"")
1229 $this->tpl->setCurrentBlock($prefix.
"_link");
1230 $this->tpl->setVariable(
"FHREF",
1232 $this->tpl->setVariable(
"FLINK", $flink[
"text"]);
1233 $this->tpl->parseCurrentBlock();
1234 $this->tpl->touchBlock($prefix.
"_item");
1238 $this->tpl->setCurrentBlock($prefix.
"_text");
1239 $this->tpl->setVariable(
"FTEXT", $flink[
"text"]);
1240 $this->tpl->parseCurrentBlock();
1241 $this->tpl->touchBlock($prefix.
"_item");
1245 $omit_separator = $flink[
"omit_separator"];
1248 if ($a_numinfo !=
"" && $has_link)
1250 $this->tpl->setVariable(
"NUMINFO", $a_numinfo);
1271 if ($this->enabledetailrow ==
false)
1276 $start = ($this->detail_min < 1)
1278 : $this->detail_min;
1282 : $this->detail_max;
1284 $settings = array();
1285 for ($i = $start; $i <= $end; $i++)
1292 foreach ($settings as $i)
1294 if (($i > $start && $i > 1))
1301 $ilCtrl->setParameterByClass(
"ilcolumngui",
1304 $onclick = $onclick_id =
"";
1309 $ilCtrl->setParameterByClass(
"ilcolumngui",
1310 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1311 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1312 "updateBlock",
"",
true);
1314 $ilCtrl->setParameterByClass(
"ilcolumngui",
1320 $text = $lng->txt(
"details").
" ".$i;
1321 $url = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1325 $onclick =
"ilBlockJSHandler('".$onclick_id.
"','".$onclick.
"')";
1329 $this->dropdown[] = array(
"text" => $text,
1332 "onclick" => $onclick,
1333 "checked" => $checked);
1340 $this->tpl->setCurrentBlock(
"det_info");
1341 $this->tpl->setVariable(
"INFO_TEXT", $this->
getFooterInfo(
true));
1342 $this->tpl->setVariable(
"ALT_DET_INFO", $lng->txt(
"info_short"));
1345 $this->tpl->parseCurrentBlock();
1355 $ilCtrl->setParameterByClass(
"ilcolumngui",