47 protected $move = array(
"left" =>
false,
"right" =>
false,
"up" =>
false,
"down" =>
false);
60 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
62 $tpl->addJavaScript(
"./Services/Block/js/ilblockcallback.js");
64 $this->
setLimit($ilUser->getPref(
"hits_per_page"));
69 $this->header_links[] =
70 array(
'href' => $a_href,
'text' => $a_text,
'status' => (
bool)$status);
85 $this->data = $a_data;
105 $this->bigmode = $a_bigmode;
125 $this->block_id = $a_block_id;
146 $this->detail_min = $a_min;
147 $this->detail_max = $a_max;
158 $this->currentdetaillevel = $a_currentdetaillevel;
170 $this->gui_object = $a_gui_object;
180 return $this->gui_object;
190 return $this->currentdetaillevel;
200 $this->title = $a_title;
220 $this->image = $a_image;
240 $this->offset = $a_offset;
250 return $this->offset;
255 if (!($this->offset < $this->max_count))
268 $this->limit = $a_limit;
288 $this->enableedit = $a_enableedit;
298 return $this->enableedit;
308 $this->repositorymode = $a_repositorymode;
318 return $this->repositorymode;
328 if ($a_hide_and_icon)
330 $this->footerinfo_icon = $a_footerinfo;
334 $this->footerinfo = $a_footerinfo;
345 if ($a_hide_and_icon)
347 return $this->footerinfo_icon;
351 return $this->footerinfo;
362 $this->subtitle = $a_subtitle;
372 return $this->subtitle;
382 $this->refid = $a_refid;
402 $this->admincommands = $a_admincommands;
412 return $this->admincommands;
422 $this->colspan = $a_colspan;
442 $this->enabledetailrow = $a_enabledetailrow;
463 $this->enablenuminfo = $a_enablenuminfo;
484 $this->
property = $a_properties;
489 return $this->
property[$a_property];
494 $this->
property[$a_property] = $a_value;
504 $this->rowtemplatename = $a_rowtemplatename;
505 $this->rowtemplatedir = $a_rowtemplatedir;
535 return $this->rowtemplatename;
545 return $this->rowtemplatedir;
554 function addBlockCommand($a_href, $a_text, $a_target =
"", $a_img =
"", $a_right_aligned =
false)
556 return $this->block_commands[] =
557 array(
"href" => $a_href,
558 "text" => $a_text,
"target" => $a_target,
"img" => $a_img,
559 "right" => $a_right_aligned);
569 return $this->block_commands;
582 $this->close_command = $a_href;
586 $this->header_commands[] =
587 array(
"href" => $a_href,
605 function addFooterLink($a_text, $a_href =
"", $a_onclick =
"", $a_block_id =
"",
606 $a_top =
false, $a_omit_separator =
false)
608 $this->footer_links[] = array(
611 "onclick" => $a_onclick,
612 "block_id" => $a_block_id,
614 "omit_separator" => $a_omit_separator);
630 $this->footer_links = array();
649 if ($this->detail_max > $this->detail_min)
651 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
699 $this->config_mode = $a_configmode;
709 return $this->config_mode;
721 if (!$ilAccess->checkAccess(
"visible",
"", $this->getRefId()))
727 $this->tpl =
new ilTemplate(
"tpl.block.html",
true,
true,
"Services/Block");
736 $this->tpl->setCurrentBlock(
"block_check");
737 $this->tpl->setVariable(
"BL_REF_ID", $this->
getRefId());
738 $this->tpl->parseCurrentBlock();
740 if ($ilAccess->checkAccess(
"delete",
"", $this->getRefId()))
743 "repository.php?ref_id=".
$_GET[
"ref_id"].
"&cmd=delete".
745 $lng->txt(
"delete"));
752 $this->tpl->setCurrentBlock(
"footer_information");
753 $this->tpl->setVariable(
"FOOTER_INFO", $this->
getFooterInfo());
754 $this->tpl->setVariable(
"FICOLSPAN", $this->
getColSpan());
755 $this->tpl->parseCurrentBlock();
764 if ($command[
"target"] !=
"")
766 $this->tpl->setCurrentBlock(
"bc_target");
767 $this->tpl->setVariable(
"CMD_TARGET", $command[
"target"]);
768 $this->tpl->parseCurrentBlock();
771 if ($command[
"img"] !=
"")
773 $this->tpl->setCurrentBlock(
"bc_image");
774 $this->tpl->setVariable(
"SRC_BC", $command[
"img"]);
775 $this->tpl->setVariable(
"ALT_BC", $command[
"text"]);
776 $this->tpl->parseCurrentBlock();
777 $this->tpl->setCurrentBlock(
"block_command");
781 $this->tpl->setCurrentBlock(
"block_command");
782 $this->tpl->setVariable(
"CMD_TEXT", $command[
"text"]);
783 $this->tpl->setVariable(
"BC_CLASS",
'class="il_ContainerItemCommand"');
786 $this->tpl->setVariable(
"CMD_HREF", $command[
"href"]);
787 $this->tpl->parseCurrentBlock();
789 $this->tpl->setCurrentBlock(
"block_commands");
790 $this->tpl->setVariable(
"CCOLSPAN", $this->
getColSpan());
791 $this->tpl->parseCurrentBlock();
804 if ($this->allow_moving)
817 $this->tpl->setCurrentBlock(
'head_delim');
818 $this->tpl->touchBlock(
'head_delim');
819 $this->tpl->parseCurrentBlock();
821 if($command[
'status'] ==
true)
823 $this->tpl->setCurrentBlock(
'head_link');
824 $this->tpl->setVariable(
'HHREF', $command[
'href']);
825 $this->tpl->setVariable(
'HLINK', $command[
'text']);
826 $this->tpl->parseCurrentBlock();
830 $this->tpl->setCurrentBlock(
'head_text');
831 $this->tpl->setVariable(
'HTEXT', $command[
'text']);
832 $this->tpl->parseCurrentBlock();
835 $this->tpl->setCurrentBlock(
'head_item');
836 $this->tpl->parseCurrentBlock();
841 $this->tpl->setCurrentBlock(
'header_links');
842 $this->tpl->parseCurrentBlock();
849 if (is_object($ilUser) && $ilUser->prefs[
"screen_reader_optimization"])
860 $this->tpl->setVariable(
"COLSPAN", $this->
getColSpan());
863 $this->tpl->touchBlock(
"hclassb");
867 $this->tpl->touchBlock(
"hclass");
870 if ($ilCtrl->isAsynch())
873 echo $this->tpl->getAsynch();
878 return '<div id="'.
"block_".$this->
getBlockType().
"_".$this->block_id.
'">'.
879 $this->tpl->get().
'</div>';
892 ($this->detail_max > $this->detail_min && $this->detail_min == 0) ||
893 $this->close_command !=
"" || $this->allow_moving)
898 $this->tpl->setCurrentBlock(
"header_command");
899 $this->tpl->setVariable(
"HREF_HCOMM", $command[
"href"]);
900 $this->tpl->setVariable(
"TXT_HCOMM", $command[
"text"]);
901 $this->tpl->parseCurrentBlock();
905 if (($this->detail_max > $this->detail_min && $this->detail_min == 0 &&
908 $this->close_command !=
"")
910 $this->tpl->setCurrentBlock(
"header_close");
911 $this->tpl->setVariable(
"ALT_CLOSE",
912 strip_tags(str_replace(array(
"'",
'"'),
"", $this->
getTitle())).
913 " (".$lng->txt(
"block").
"): ".$lng->txt(
"close")
923 if ($this->close_command !=
"")
925 $this->tpl->setVariable(
"HREF_CLOSE",
926 $this->close_command);
930 $ilCtrl->setParameterByClass(
"ilcolumngui",
932 $this->tpl->setVariable(
"HREF_CLOSE",
933 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
935 $ilCtrl->setParameterByClass(
"ilcolumngui",
938 $this->tpl->parseCurrentBlock();
941 $this->tpl->setCurrentBlock(
"header_commands");
942 $this->tpl->parseCurrentBlock();
945 $this->tpl->setCurrentBlock(
"hitem");
946 $this->tpl->parseCurrentBlock();
960 $this->tpl->setCurrentBlock(
"block_img");
961 $this->tpl->setVariable(
"IMG_BLOCK", $this->
getImage());
962 $this->tpl->setVariable(
"IMID",
964 $this->tpl->setVariable(
"IMG_ALT",
965 str_replace(array(
"'",
'"'),
"", strip_tags($lng->txt(
"icon").
" ".$this->
getTitle())));
966 $this->tpl->parseCurrentBlock();
970 $this->tpl->setCurrentBlock(
"header_title");
971 $this->tpl->setVariable(
"BTID",
973 $this->tpl->setVariable(
"BLOCK_TITLE",
975 $this->tpl->setVariable(
"TXT_BLOCK",
977 $this->tpl->parseCurrentBlock();
979 $this->tpl->setCurrentBlock(
"hitem");
980 $this->tpl->parseCurrentBlock();
989 $this->tpl->setCurrentBlock(
"data_section");
990 $this->tpl->setVariable(
"DATA", $a_content);
991 $this->tpl->parseCurrentBlock();
1003 $this->nav_value = ($this->nav_value ==
"")
1009 $nav = explode(
":", $this->nav_value);
1017 $this->max_count = count(
$data);
1021 foreach(
$data as $record)
1023 $this->tpl->setCurrentBlock(
"block_row");
1026 $this->tpl->setCurrentBlock(
"block_row");
1027 $this->tpl->parseCurrentBlock();
1033 foreach ($a_set as
$key => $value)
1035 $this->tpl->setVariable(
"VAL_".strtoupper(
$key), $value);
1045 $this->css_row = ($this->css_row !=
"ilBlockRow1")
1048 $this->tpl->setVariable($a_placeholder, $this->css_row);
1067 if ($end > $this->max_count or $this->
getLimit() == 0)
1069 $end = $this->max_count;
1072 $numinfo =
"(".$start.
"-".$end.
" ".strtolower($lng->txt(
"of")).
" ".$this->max_count.
")";
1099 $ilCtrl->setParameterByClass(
"ilcolumngui",
1103 $ilCtrl->setParameterByClass(
"ilcolumngui",
1104 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1106 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1107 "updateBlock",
"",
true);
1108 $ilCtrl->setParameterByClass(
"ilcolumngui",
1112 $href = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1113 $text = $lng->txt(
"previous");
1119 $pages = intval($this->max_count / $this->
getLimit());
1122 if (($this->max_count % $this->
getLimit()))
1130 $ilCtrl->setParameterByClass(
"ilcolumngui",
1134 $ilCtrl->setParameterByClass(
"ilcolumngui",
1135 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1138 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1139 "updateBlock",
"",
true);
1142 $ilCtrl->setParameterByClass(
"ilcolumngui",
1146 $href = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1147 $text = $lng->txt(
"next");
1151 $ilCtrl->setParameterByClass(
"ilcolumngui",
1173 $prefix = ($a_top) ?
"top" :
"foot";
1175 $omit_separator =
false;
1176 foreach($flinks as $flink)
1178 if ($flink[
"top"] != $a_top)
1183 if (!$first && !$omit_separator)
1185 $this->tpl->touchBlock($prefix.
"_delim");
1186 $this->tpl->touchBlock($prefix.
"_item");
1190 if ($flink[
"onclick"] !=
"")
1192 $this->tpl->setCurrentBlock($prefix.
"_onclick");
1193 $this->tpl->setVariable(
"OC_BLOCK_ID",
1194 $flink[
"block_id"]);
1195 $this->tpl->setVariable(
"OC_HREF",
1197 $this->tpl->parseCurrentBlock();
1201 if ($flink[
"href"] !=
"")
1204 $this->tpl->setCurrentBlock($prefix.
"_link");
1205 $this->tpl->setVariable(
"FHREF",
1207 $this->tpl->setVariable(
"FLINK", $flink[
"text"]);
1208 $this->tpl->parseCurrentBlock();
1209 $this->tpl->touchBlock($prefix.
"_item");
1213 $this->tpl->setCurrentBlock($prefix.
"_text");
1214 $this->tpl->setVariable(
"FTEXT", $flink[
"text"]);
1215 $this->tpl->parseCurrentBlock();
1216 $this->tpl->touchBlock($prefix.
"_item");
1219 $omit_separator = $flink[
"omit_separator"];
1222 if ($a_numinfo !=
"")
1224 $this->tpl->setVariable(
"NUMINFO", $a_numinfo);
1230 $this->tpl->setVariable(
"PCOLSPAN", $this->
getColSpan());
1231 $this->tpl->setCurrentBlock($prefix.
"_row");
1232 $this->tpl->parseCurrentBlock();
1243 if ($this->enabledetailrow ==
false)
1248 $start = ($this->detail_min < 1)
1250 : $this->detail_min;
1254 : $this->detail_max;
1256 $settings = array();
1257 for ($i =
$start; $i <= $end; $i++)
1264 foreach ($settings as $i)
1266 if (($i >
$start && $i > 1))
1273 $ilCtrl->setParameterByClass(
"ilcolumngui",
1279 $ilCtrl->setParameterByClass(
"ilcolumngui",
1280 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1281 $this->tpl->setCurrentBlock(
"onclick");
1282 $this->tpl->setVariable(
"OC_BLOCK_ID",
1284 $this->tpl->setVariable(
"OC_HREF",
1285 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1286 "updateBlock",
"",
true));
1287 $this->tpl->parseCurrentBlock();
1288 $ilCtrl->setParameterByClass(
"ilcolumngui",
1293 $this->tpl->setCurrentBlock(
"det_link");
1295 $this->tpl->setVariable(
"SRC_LINK",
1297 $this->tpl->setVariable(
"ALT_LINK",
1298 strip_tags(str_replace(array(
"'",
'"'),
"", $this->
getTitle())).
1299 " (".$lng->txt(
"block").
"): ".$lng->txt(
"details").
" ".$i
1301 $this->tpl->setVariable(
"DHREF",
1302 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1304 $this->tpl->parseCurrentBlock();
1305 $this->tpl->touchBlock(
"det_item");
1309 $this->tpl->setCurrentBlock(
"det_text");
1311 $this->tpl->setVariable(
"ALT_NO_LINK",
1312 strip_tags(str_replace(array(
"'",
'"'),
"", $this->
getTitle())).
1313 " (".$lng->txt(
"block").
"): ".$lng->txt(
"details").
" ".$i.
1314 " (".$lng->txt(
"selected").
")");
1315 $this->tpl->setVariable(
"SRC_NO_LINK",
1317 $this->tpl->parseCurrentBlock();
1318 $this->tpl->touchBlock(
"det_item");
1325 $this->tpl->setCurrentBlock(
"det_info");
1326 $this->tpl->setVariable(
"INFO_TEXT", $this->
getFooterInfo(
true));
1327 $this->tpl->setVariable(
"ALT_DET_INFO", $lng->txt(
"info_short"));
1330 $this->tpl->parseCurrentBlock();
1333 $this->tpl->setCurrentBlock(
"detail_setting");
1334 $this->tpl->setVariable(
"TXT_DETAILS", $lng->txt(
"details"));
1335 $this->tpl->setVariable(
"DCOLSPAN", $this->
getColSpan());
1336 $this->tpl->parseCurrentBlock();
1338 $ilCtrl->setParameterByClass(
"ilcolumngui",
1350 if ($this->config_mode)
1354 $this->
fillMoveLink(
"left",
"icon_left_s.gif", $lng->txt(
"move_left"));
1358 $this->
fillMoveLink(
"up",
"icon_up_s.gif", $lng->txt(
"move_up"));
1362 $this->
fillMoveLink(
"down",
"icon_down_s.gif", $lng->txt(
"move_down"));
1366 $this->
fillMoveLink(
"right",
"icon_right_s.gif", $lng->txt(
"move_right"));
1370 $this->tpl->setCurrentBlock(
"move");
1371 $this->tpl->parseCurrentBlock();
1377 return $this->move[$a_direction];
1382 $this->move[$a_direction] = $a_allow;
1390 $ilCtrl->setParameterByClass(
"ilcolumngui",
"block_id",
1392 $ilCtrl->setParameterByClass(
"ilcolumngui",
"move_dir",
1394 $this->tpl->setCurrentBlock(
"move_link");
1396 $this->tpl->setVariable(
"ALT_MOVE", $a_txt);
1397 $this->tpl->setVariable(
"HREF_MOVE",
1398 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1400 $this->tpl->parseCurrentBlock();