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();
797 $this->tpl->setCurrentBlock(
"block_img");
798 $this->tpl->setVariable(
"IMG_BLOCK", $this->
getImage());
799 $this->tpl->parseCurrentBlock();
812 if ($this->allow_moving)
819 ($this->detail_max > $this->detail_min && $this->detail_min == 0) ||
820 $this->close_command !=
"" || $this->allow_moving)
825 $this->tpl->setCurrentBlock(
"header_command");
826 $this->tpl->setVariable(
"HREF_HCOMM", $command[
"href"]);
827 $this->tpl->setVariable(
"TXT_HCOMM", $command[
"text"]);
828 $this->tpl->parseCurrentBlock();
832 if (($this->detail_max > $this->detail_min && $this->detail_min == 0 &&
835 $this->close_command !=
"")
837 $this->tpl->setCurrentBlock(
"header_close");
838 $this->tpl->setVariable(
"ALT_CLOSE", $lng->txt(
"close"));
847 if ($this->close_command !=
"")
849 $this->tpl->setVariable(
"HREF_CLOSE",
850 $this->close_command);
854 $ilCtrl->setParameterByClass(
"ilcolumngui",
856 $this->tpl->setVariable(
"HREF_CLOSE",
857 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
859 $ilCtrl->setParameterByClass(
"ilcolumngui",
862 $this->tpl->parseCurrentBlock();
897 $this->tpl->setCurrentBlock(
"header_commands");
898 $this->tpl->parseCurrentBlock();
909 $this->tpl->setCurrentBlock(
'head_delim');
910 $this->tpl->touchBlock(
'head_delim');
911 $this->tpl->parseCurrentBlock();
913 if($command[
'status'] ==
true)
915 $this->tpl->setCurrentBlock(
'head_link');
916 $this->tpl->setVariable(
'HHREF', $command[
'href']);
917 $this->tpl->setVariable(
'HLINK', $command[
'text']);
918 $this->tpl->parseCurrentBlock();
922 $this->tpl->setCurrentBlock(
'head_text');
923 $this->tpl->setVariable(
'HTEXT', $command[
'text']);
924 $this->tpl->parseCurrentBlock();
927 $this->tpl->setCurrentBlock(
'head_item');
928 $this->tpl->parseCurrentBlock();
933 $this->tpl->setCurrentBlock(
'header_links');
934 $this->tpl->parseCurrentBlock();
938 $this->tpl->setVariable(
"BLOCK_TITLE",
940 $this->tpl->setVariable(
"COLSPAN", $this->
getColSpan());
943 $this->tpl->touchBlock(
"hclassb");
947 $this->tpl->touchBlock(
"hclass");
950 if ($ilCtrl->isAsynch())
953 echo $this->tpl->getAsynch();
958 return '<div id="'.
"block_".$this->
getBlockType().
"_".$this->block_id.
'">'.
959 $this->tpl->get().
'</div>';
968 $this->tpl->setCurrentBlock(
"data_section");
969 $this->tpl->setVariable(
"DATA", $a_content);
970 $this->tpl->parseCurrentBlock();
982 $this->nav_value = ($this->nav_value ==
"")
988 $nav = explode(
":", $this->nav_value);
996 $this->max_count = count(
$data);
1000 foreach(
$data as $record)
1002 $this->tpl->setCurrentBlock(
"block_row");
1005 $this->tpl->setCurrentBlock(
"block_row");
1006 $this->tpl->parseCurrentBlock();
1012 foreach ($a_set as $key => $value)
1014 $this->tpl->setVariable(
"VAL_".strtoupper($key), $value);
1024 $this->css_row = ($this->css_row !=
"tblrow1")
1027 $this->tpl->setVariable($a_placeholder, $this->css_row);
1046 if ($end > $this->max_count or $this->
getLimit() == 0)
1048 $end = $this->max_count;
1051 $numinfo =
"(".$start.
"-".$end.
" ".strtolower($lng->txt(
"of")).
" ".$this->max_count.
")";
1078 $ilCtrl->setParameterByClass(
"ilcolumngui",
1082 $ilCtrl->setParameterByClass(
"ilcolumngui",
1083 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1085 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1086 "updateBlock",
"",
true);
1087 $ilCtrl->setParameterByClass(
"ilcolumngui",
1091 $href = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1092 $text = $lng->txt(
"previous");
1098 $pages = intval($this->max_count / $this->
getLimit());
1101 if (($this->max_count % $this->
getLimit()))
1109 $ilCtrl->setParameterByClass(
"ilcolumngui",
1113 $ilCtrl->setParameterByClass(
"ilcolumngui",
1114 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1117 $onclick = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1118 "updateBlock",
"",
true);
1121 $ilCtrl->setParameterByClass(
"ilcolumngui",
1125 $href = $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"");
1126 $text = $lng->txt(
"next");
1130 $ilCtrl->setParameterByClass(
"ilcolumngui",
1152 $prefix = ($a_top) ?
"top" :
"foot";
1154 $omit_separator =
false;
1155 foreach($flinks as $flink)
1157 if ($flink[
"top"] != $a_top)
1162 if (!$first && !$omit_separator)
1164 $this->tpl->touchBlock($prefix.
"_delim");
1165 $this->tpl->touchBlock($prefix.
"_item");
1169 if ($flink[
"onclick"] !=
"")
1171 $this->tpl->setCurrentBlock($prefix.
"_onclick");
1172 $this->tpl->setVariable(
"OC_BLOCK_ID",
1173 $flink[
"block_id"]);
1174 $this->tpl->setVariable(
"OC_HREF",
1176 $this->tpl->parseCurrentBlock();
1180 if ($flink[
"href"] !=
"")
1183 $this->tpl->setCurrentBlock($prefix.
"_link");
1184 $this->tpl->setVariable(
"FHREF",
1186 $this->tpl->setVariable(
"FLINK", $flink[
"text"]);
1187 $this->tpl->parseCurrentBlock();
1188 $this->tpl->touchBlock($prefix.
"_item");
1192 $this->tpl->setCurrentBlock($prefix.
"_text");
1193 $this->tpl->setVariable(
"FTEXT", $flink[
"text"]);
1194 $this->tpl->parseCurrentBlock();
1195 $this->tpl->touchBlock($prefix.
"_item");
1198 $omit_separator = $flink[
"omit_separator"];
1201 if ($a_numinfo !=
"")
1203 $this->tpl->setVariable(
"NUMINFO", $a_numinfo);
1209 $this->tpl->setVariable(
"PCOLSPAN", $this->
getColSpan());
1210 $this->tpl->setCurrentBlock($prefix.
"_row");
1211 $this->tpl->parseCurrentBlock();
1222 if ($this->enabledetailrow ==
false)
1227 $start = ($this->detail_min < 1)
1229 : $this->detail_min;
1233 : $this->detail_max;
1235 $settings = array();
1236 for ($i = $start; $i <= $end; $i++)
1243 foreach ($settings as $i)
1245 if (($i > $start && $i > 1))
1252 $ilCtrl->setParameterByClass(
"ilcolumngui",
1258 $ilCtrl->setParameterByClass(
"ilcolumngui",
1259 "block_id",
"block_".$this->
getBlockType().
"_".$this->block_id);
1260 $this->tpl->setCurrentBlock(
"onclick");
1261 $this->tpl->setVariable(
"OC_BLOCK_ID",
1263 $this->tpl->setVariable(
"OC_HREF",
1264 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1265 "updateBlock",
"",
true));
1266 $this->tpl->parseCurrentBlock();
1267 $ilCtrl->setParameterByClass(
"ilcolumngui",
1272 $this->tpl->setCurrentBlock(
"det_link");
1274 $this->tpl->setVariable(
"SRC_LINK",
1276 $this->tpl->setVariable(
"ALT_LINK",
1277 $lng->txt(
"details_".$i));
1278 $this->tpl->setVariable(
"DHREF",
1279 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1281 $this->tpl->parseCurrentBlock();
1282 $this->tpl->touchBlock(
"det_item");
1286 $this->tpl->setCurrentBlock(
"det_text");
1288 $this->tpl->setVariable(
"ALT_NO_LINK",
1289 $lng->txt(
"details_".$i));
1290 $this->tpl->setVariable(
"SRC_NO_LINK",
1292 $this->tpl->parseCurrentBlock();
1293 $this->tpl->touchBlock(
"det_item");
1300 $this->tpl->setCurrentBlock(
"det_info");
1301 $this->tpl->setVariable(
"INFO_TEXT", $this->
getFooterInfo(
true));
1302 $this->tpl->setVariable(
"ALT_DET_INFO", $lng->txt(
"info_short"));
1305 $this->tpl->parseCurrentBlock();
1308 $this->tpl->setCurrentBlock(
"detail_setting");
1309 $this->tpl->setVariable(
"TXT_DETAILS", $lng->txt(
"details"));
1310 $this->tpl->setVariable(
"DCOLSPAN", $this->
getColSpan());
1311 $this->tpl->parseCurrentBlock();
1313 $ilCtrl->setParameterByClass(
"ilcolumngui",
1325 if ($this->config_mode)
1329 $this->
fillMoveLink(
"left",
"icon_left_s.gif", $lng->txt(
"move_left"));
1333 $this->
fillMoveLink(
"up",
"icon_up_s.gif", $lng->txt(
"move_up"));
1337 $this->
fillMoveLink(
"down",
"icon_down_s.gif", $lng->txt(
"move_down"));
1341 $this->
fillMoveLink(
"right",
"icon_right_s.gif", $lng->txt(
"move_right"));
1345 $this->tpl->setCurrentBlock(
"move");
1346 $this->tpl->parseCurrentBlock();
1352 return $this->move[$a_direction];
1357 $this->move[$a_direction] = $a_allow;
1365 $ilCtrl->setParameterByClass(
"ilcolumngui",
"block_id",
1367 $ilCtrl->setParameterByClass(
"ilcolumngui",
"move_dir",
1369 $this->tpl->setCurrentBlock(
"move_link");
1371 $this->tpl->setVariable(
"ALT_MOVE", $a_txt);
1372 $this->tpl->setVariable(
"HREF_MOVE",
1373 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
1375 $this->tpl->parseCurrentBlock();