00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00031 abstract class ilBlockGUI
00032 {
00033 abstract static function getBlockType();
00034 abstract static function isRepositoryObject();
00035
00036
00037 protected $data = array();
00038 protected $colspan = 1;
00039 protected $enablenuminfo = true;
00040 protected $detail_min = 0;
00041 protected $detail_max = 0;
00042 protected $bigmode = false;
00043 protected $footer_links = array();
00044 protected $block_id = 0;
00045 protected $header_commands = array();
00046 protected $allow_moving = true;
00047 protected $move = array("left" => false, "right" => false, "up" => false, "down" => false);
00048 protected $enabledetailrow = true;
00049
00055 function ilBlockGUI()
00056 {
00057 global $ilUser, $tpl, $ilCtrl;
00058
00059 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
00060 ilYuiUtil::initConnection();
00061 $tpl->addJavaScript("./Services/Block/js/ilblockcallback.js");
00062
00063 $this->setLimit($ilUser->getPref("hits_per_page"));
00064 }
00065
00071 function setData($a_data)
00072 {
00073 $this->data = $a_data;
00074 }
00075
00081 function getData()
00082 {
00083 return $this->data;
00084 }
00085
00091 function setBigMode($a_bigmode)
00092 {
00093 $this->bigmode = $a_bigmode;
00094 }
00095
00101 function getBigMode()
00102 {
00103 return $this->bigmode;
00104 }
00105
00111 function setBlockId($a_block_id = 0)
00112 {
00113 $this->block_id = $a_block_id;
00114 }
00115
00121 function getBlockId()
00122 {
00123 return $this->block_id;
00124 }
00125
00132 function setAvailableDetailLevels($a_max, $a_min = 0)
00133 {
00134 $this->detail_min = $a_min;
00135 $this->detail_max = $a_max;
00136 $this->handleDetailLevel();
00137 }
00138
00144 function setCurrentDetailLevel($a_currentdetaillevel)
00145 {
00146 $this->currentdetaillevel = $a_currentdetaillevel;
00147 }
00148
00156 public function setGuiObject(&$a_gui_object)
00157 {
00158 $this->gui_object = $a_gui_object;
00159 }
00160
00166 public function getGuiObject()
00167 {
00168 return $this->gui_object;
00169 }
00170
00176 function getCurrentDetailLevel()
00177 {
00178 return $this->currentdetaillevel;
00179 }
00180
00186 function setTitle($a_title)
00187 {
00188 $this->title = $a_title;
00189 }
00190
00196 function getTitle()
00197 {
00198 return $this->title;
00199 }
00200
00206 function setImage($a_image)
00207 {
00208 $this->image = $a_image;
00209 }
00210
00216 function getImage()
00217 {
00218 return $this->image;
00219 }
00220
00226 function setOffset($a_offset)
00227 {
00228 $this->offset = $a_offset;
00229 }
00230
00236 function getOffset()
00237 {
00238 return $this->offset;
00239 }
00240
00241 function correctOffset()
00242 {
00243 if (!($this->offset < $this->max_count))
00244 {
00245 $this->setOffset(0);
00246 }
00247 }
00248
00254 function setLimit($a_limit)
00255 {
00256 $this->limit = $a_limit;
00257 }
00258
00264 function getLimit()
00265 {
00266 return $this->limit;
00267 }
00268
00274 function setEnableEdit($a_enableedit)
00275 {
00276 $this->enableedit = $a_enableedit;
00277 }
00278
00284 function getEnableEdit()
00285 {
00286 return $this->enableedit;
00287 }
00288
00294 function setRepositoryMode($a_repositorymode)
00295 {
00296 $this->repositorymode = $a_repositorymode;
00297 }
00298
00304 function getRepositoryMode()
00305 {
00306 return $this->repositorymode;
00307 }
00308
00314 function setFooterInfo($a_footerinfo, $a_hide_and_icon = false)
00315 {
00316 if ($a_hide_and_icon)
00317 {
00318 $this->footerinfo_icon = $a_footerinfo;
00319 }
00320 else
00321 {
00322 $this->footerinfo = $a_footerinfo;
00323 }
00324 }
00325
00331 function getFooterInfo($a_hide_and_icon = false)
00332 {
00333 if ($a_hide_and_icon)
00334 {
00335 return $this->footerinfo_icon;
00336 }
00337 else
00338 {
00339 return $this->footerinfo;
00340 }
00341 }
00342
00348 function setSubtitle($a_subtitle)
00349 {
00350 $this->subtitle = $a_subtitle;
00351 }
00352
00358 function getSubtitle()
00359 {
00360 return $this->subtitle;
00361 }
00362
00368 function setRefId($a_refid)
00369 {
00370 $this->refid = $a_refid;
00371 }
00372
00378 function getRefId()
00379 {
00380 return $this->refid;
00381 }
00382
00388 function setAdminCommands($a_admincommands)
00389 {
00390 $this->admincommands = $a_admincommands;
00391 }
00392
00398 function getAdminCommands()
00399 {
00400 return $this->admincommands;
00401 }
00402
00408 function setColSpan($a_colspan)
00409 {
00410 $this->colspan = $a_colspan;
00411 }
00412
00418 function getColSpan()
00419 {
00420 return $this->colspan;
00421 }
00422
00428 function setEnableDetailRow($a_enabledetailrow)
00429 {
00430 $this->enabledetailrow = $a_enabledetailrow;
00431 }
00432
00438 function getEnableDetailRow()
00439 {
00440 return $this->enabledetailrow;
00441 }
00442
00443
00449 function setEnableNumInfo($a_enablenuminfo)
00450 {
00451 $this->enablenuminfo = $a_enablenuminfo;
00452 }
00453
00459 function getEnableNumInfo()
00460 {
00461 return $this->enablenuminfo;
00462 }
00463
00470 function setProperties($a_properties)
00471 {
00472 $this->property = $a_properties;
00473 }
00474
00475 function getProperty($a_property)
00476 {
00477 return $this->property[$a_property];
00478 }
00479
00480 function setProperty($a_property, $a_value)
00481 {
00482 $this->property[$a_property] = $a_value;
00483 }
00484
00490 function setRowTemplate($a_rowtemplatename, $a_rowtemplatedir = "")
00491 {
00492 $this->rowtemplatename = $a_rowtemplatename;
00493 $this->rowtemplatedir = $a_rowtemplatedir;
00494 }
00495
00496 final public function getNavParameter()
00497 {
00498 return $this->getBlockType()."_".$this->getBlockId()."_blnav";
00499 }
00500
00501 final public function getDetailParameter()
00502 {
00503 return $this->getBlockType()."_".$this->getBlockId()."_bldet";
00504 }
00505
00506 final public function getConfigParameter()
00507 {
00508 return $this->getBlockType()."_".$this->getBlockId()."_blconf";
00509 }
00510
00511 final public function getMoveParameter()
00512 {
00513 return $this->getBlockType()."_".$this->getBlockId()."_blmove";
00514 }
00515
00521 function getRowTemplateName()
00522 {
00523 return $this->rowtemplatename;
00524 }
00525
00531 function getRowTemplateDir()
00532 {
00533 return $this->rowtemplatedir;
00534 }
00535
00542 function addBlockCommand($a_href, $a_text, $a_target = "", $a_img = "", $a_right_aligned = false)
00543 {
00544 return $this->block_commands[] =
00545 array("href" => $a_href,
00546 "text" => $a_text, "target" => $a_target, "img" => $a_img,
00547 "right" => $a_right_aligned);
00548 }
00549
00555 function getBlockCommands()
00556 {
00557 return $this->block_commands;
00558 }
00559
00566 function addHeaderCommand($a_href, $a_text, $a_as_close = false)
00567 {
00568 if ($a_as_close)
00569 {
00570 $this->close_command = $a_href;
00571 }
00572 else
00573 {
00574 $this->header_commands[] =
00575 array("href" => $a_href,
00576 "text" => $a_text);
00577 }
00578 }
00579
00585 function getHeaderCommands()
00586 {
00587 return $this->header_commands;
00588 }
00589
00593 function addFooterLink($a_text, $a_href = "", $a_onclick = "", $a_block_id = "",
00594 $a_top = false, $a_omit_separator = false)
00595 {
00596 $this->footer_links[] = array(
00597 "text" => $a_text,
00598 "href" => $a_href,
00599 "onclick" => $a_onclick,
00600 "block_id" => $a_block_id,
00601 "top" => $a_top,
00602 "omit_separator" => $a_omit_separator);
00603 }
00604
00608 function getFooterLinks()
00609 {
00610 return $this->footer_links;
00611 }
00612
00616 function clearFooterLinks()
00617 {
00618 $this->footer_links = array();
00619 }
00620
00624 static function getScreenMode()
00625 {
00626 return IL_SCREEN_SIDE;
00627 }
00628
00632 function handleDetailLevel()
00633 {
00634 global $ilUser;
00635
00636
00637 if ($this->detail_max > $this->detail_min)
00638 {
00639 include_once("Services/Block/classes/class.ilBlockSetting.php");
00640 if (isset($_GET[$this->getDetailParameter()]))
00641 {
00642 ilBlockSetting::_writeDetailLevel($this->getBlockType(), $_GET[$this->getDetailParameter()],
00643 $ilUser->getId(), $this->block_id);
00644 $this->setCurrentDetailLevel($_GET[$this->getDetailParameter()]);
00645 }
00646 else
00647 {
00648 $this->setCurrentDetailLevel(ilBlockSetting::_lookupDetailLevel($this->getBlockType(),
00649 $ilUser->getId(), $this->block_id));
00650 }
00651 }
00652 }
00653
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00685 function setConfigMode($a_configmode)
00686 {
00687 $this->config_mode = $a_configmode;
00688 }
00689
00695 function getConfigMode()
00696 {
00697 return $this->config_mode;
00698 }
00699
00703 function getHTML()
00704 {
00705 global $ilCtrl, $lng, $ilAccess;
00706
00707 if ($this->isRepositoryObject())
00708 {
00709 if (!$ilAccess->checkAccess("visible", "", $this->getRefId()))
00710 {
00711 return "";
00712 }
00713 }
00714
00715 $this->tpl = new ilTemplate("tpl.block.html", true, true, "Services/Block");
00716
00717
00718
00719 $this->fillDataSection();
00720
00721 if ($this->getRepositoryMode() && $this->isRepositoryObject()
00722 && $this->getAdminCommands())
00723 {
00724 $this->tpl->setCurrentBlock("block_check");
00725 $this->tpl->setVariable("BL_REF_ID", $this->getRefId());
00726 $this->tpl->parseCurrentBlock();
00727
00728 if ($ilAccess->checkAccess("delete", "", $this->getRefId()))
00729 {
00730 $this->addBlockCommand(
00731 "repository.php?ref_id=".$_GET["ref_id"]."&cmd=delete".
00732 "&item_ref_id=".$this->getRefId(),
00733 $lng->txt("delete"));
00734 }
00735 }
00736
00737
00738 if ($this->getFooterInfo() != "")
00739 {
00740 $this->tpl->setCurrentBlock("footer_information");
00741 $this->tpl->setVariable("FOOTER_INFO", $this->getFooterInfo());
00742 $this->tpl->setVariable("FICOLSPAN", $this->getColSpan());
00743 $this->tpl->parseCurrentBlock();
00744 }
00745
00746
00747 if (count($this->getBlockCommands()) > 0)
00748 {
00749
00750 foreach($this->getBlockCommands() as $command)
00751 {
00752 if ($command["target"] != "")
00753 {
00754 $this->tpl->setCurrentBlock("bc_target");
00755 $this->tpl->setVariable("CMD_TARGET", $command["target"]);
00756 $this->tpl->parseCurrentBlock();
00757 }
00758
00759 if ($command["img"] != "")
00760 {
00761 $this->tpl->setCurrentBlock("bc_image");
00762 $this->tpl->setVariable("SRC_BC", $command["img"]);
00763 $this->tpl->setVariable("ALT_BC", $command["text"]);
00764 $this->tpl->parseCurrentBlock();
00765 $this->tpl->setCurrentBlock("block_command");
00766 }
00767 else
00768 {
00769 $this->tpl->setCurrentBlock("block_command");
00770 $this->tpl->setVariable("CMD_TEXT", $command["text"]);
00771 $this->tpl->setVariable("BC_CLASS", 'class="il_ContainerItemCommand"');
00772 }
00773
00774 $this->tpl->setVariable("CMD_HREF", $command["href"]);
00775 $this->tpl->parseCurrentBlock();
00776 }
00777 $this->tpl->setCurrentBlock("block_commands");
00778 $this->tpl->setVariable("CCOLSPAN", $this->getColSpan());
00779 $this->tpl->parseCurrentBlock();
00780 }
00781
00782
00783 if ($this->getImage() != "")
00784 {
00785 $this->tpl->setCurrentBlock("block_img");
00786 $this->tpl->setVariable("IMG_BLOCK", $this->getImage());
00787 $this->tpl->parseCurrentBlock();
00788 }
00789
00790
00791 $this->fillPreviousNext();
00792
00793
00794 $this->fillFooter();
00795
00796
00797 $this->fillDetailRow();
00798
00799
00800 if ($this->allow_moving)
00801 {
00802 $this->fillMoveRow();
00803 }
00804
00805
00806 if (count($this->getHeaderCommands()) > 0 ||
00807 ($this->detail_max > $this->detail_min && $this->detail_min == 0) ||
00808 $this->close_command != "" || $this->allow_moving)
00809 {
00810
00811 foreach($this->getHeaderCommands() as $command)
00812 {
00813 $this->tpl->setCurrentBlock("header_command");
00814 $this->tpl->setVariable("HREF_HCOMM", $command["href"]);
00815 $this->tpl->setVariable("TXT_HCOMM", $command["text"]);
00816 $this->tpl->parseCurrentBlock();
00817 }
00818
00819
00820 if (($this->detail_max > $this->detail_min && $this->detail_min == 0 &&
00821 !$this->getRepositoryMode())
00822 ||
00823 $this->close_command != "")
00824 {
00825 $this->tpl->setCurrentBlock("header_close");
00826 $this->tpl->setVariable("ALT_CLOSE", $lng->txt("close"));
00827 if ($this->getBigMode())
00828 {
00829 $this->tpl->setVariable("IMG_CLOSE", ilUtil::getImagePath("icon_close2.gif"));
00830 }
00831 else
00832 {
00833 $this->tpl->setVariable("IMG_CLOSE", ilUtil::getImagePath("icon_close2_s.gif"));
00834 }
00835 if ($this->close_command != "")
00836 {
00837 $this->tpl->setVariable("HREF_CLOSE",
00838 $this->close_command);
00839 }
00840 else
00841 {
00842 $ilCtrl->setParameterByClass("ilcolumngui",
00843 $this->getDetailParameter(), "0");
00844 $this->tpl->setVariable("HREF_CLOSE",
00845 $ilCtrl->getLinkTargetByClass("ilcolumngui",
00846 ""));
00847 $ilCtrl->setParameterByClass("ilcolumngui",
00848 $this->getDetailParameter(), "");
00849 }
00850 $this->tpl->parseCurrentBlock();
00851 }
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885 $this->tpl->setCurrentBlock("header_commands");
00886 $this->tpl->parseCurrentBlock();
00887 }
00888
00889
00890 $this->tpl->setVariable("BLOCK_TITLE",
00891 $this->getTitle());
00892 $this->tpl->setVariable("COLSPAN", $this->getColSpan());
00893 if ($this->getBigMode())
00894 {
00895 $this->tpl->touchBlock("hclassb");
00896 }
00897 else
00898 {
00899 $this->tpl->touchBlock("hclass");
00900 }
00901
00902 if ($ilCtrl->isAsynch())
00903 {
00904
00905 echo $this->tpl->getAsynch();
00906 }
00907 else
00908 {
00909
00910 return '<div id="'."block_".$this->getBlockType()."_".$this->block_id.'">'.
00911 $this->tpl->get().'</div>';
00912 }
00913 }
00914
00918 function setDataSection($a_content)
00919 {
00920 $this->tpl->setCurrentBlock("data_section");
00921 $this->tpl->setVariable("DATA", $a_content);
00922 $this->tpl->parseCurrentBlock();
00923 }
00924
00929 function fillDataSection()
00930 {
00931 $this->nav_value = ($_POST[$this->getNavParameter()] != "")
00932 ? $_POST[$this->getNavParameter()]
00933 : $_GET[$this->getNavParameter()];
00934 $this->nav_value = ($this->nav_value == "")
00935 ? $_SESSION[$this->getNavParameter()]
00936 : $this->nav_value;
00937
00938 $_SESSION[$this->getNavParameter()] = $this->nav_value;
00939
00940 $nav = explode(":", $this->nav_value);
00941 $this->setOffset($nav[2]);
00942
00943
00944 $this->tpl->addBlockFile("BLOCK_ROW", "block_row", $this->getRowTemplateName(),
00945 $this->getRowTemplateDir());
00946
00947 $data = $this->getData();
00948 $this->max_count = count($data);
00949 $this->correctOffset();
00950 $data = array_slice($data, $this->getOffset(), $this->getLimit());
00951
00952 foreach($data as $record)
00953 {
00954 $this->tpl->setCurrentBlock("block_row");
00955 $this->fillRowColor();
00956 $this->fillRow($record);
00957 $this->tpl->setCurrentBlock("block_row");
00958 $this->tpl->parseCurrentBlock();
00959 }
00960 }
00961
00962 function fillRow($a_set)
00963 {
00964 foreach ($a_set as $key => $value)
00965 {
00966 $this->tpl->setVariable("VAL_".strtoupper($key), $value);
00967 }
00968 }
00969
00970 function fillFooter()
00971 {
00972 }
00973
00974 final protected function fillRowColor($a_placeholder = "CSS_ROW")
00975 {
00976 $this->css_row = ($this->css_row != "tblrow1")
00977 ? "tblrow1"
00978 : "tblrow2";
00979 $this->tpl->setVariable($a_placeholder, $this->css_row);
00980 }
00981
00985 function fillPreviousNext()
00986 {
00987 global $lng, $ilCtrl;
00988
00989 $pn = false;
00990
00991
00992 $numinfo = "";
00993 if ($this->getEnableNumInfo() && $this->max_count > 0)
00994 {
00995 $start = $this->getOffset() + 1;
00996 $end = $this->getOffset() + $this->getLimit();
00997
00998 if ($end > $this->max_count or $this->getLimit() == 0)
00999 {
01000 $end = $this->max_count;
01001 }
01002
01003 $numinfo = "(".$start."-".$end." ".strtolower($lng->txt("of"))." ".$this->max_count.")";
01004 }
01005
01006 $this->setPreviousNextLinks();
01007 $this->fillFooterLinks(true, $numinfo);
01008
01009 }
01010
01018 function setPreviousNextLinks()
01019 {
01020 global $ilCtrl, $lng;
01021
01022
01023 if ($this->max_count > $this->getLimit() && ($this->getLimit() != 0))
01024 {
01025
01026 if ($this->getOffset() >= 1)
01027 {
01028 $prevoffset = $this->getOffset() - $this->getLimit();
01029
01030 $ilCtrl->setParameterByClass("ilcolumngui",
01031 $this->getNavParameter(), "::".$prevoffset);
01032
01033
01034 $ilCtrl->setParameterByClass("ilcolumngui",
01035 "block_id", "block_".$this->getBlockType()."_".$this->block_id);
01036 $block_id = "block_".$this->getBlockType()."_".$this->block_id;
01037 $onclick = $ilCtrl->getLinkTargetByClass("ilcolumngui",
01038 "updateBlock", "", true);
01039 $ilCtrl->setParameterByClass("ilcolumngui",
01040 "block_id", "");
01041
01042
01043 $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "");
01044 $text = $lng->txt("previous");
01045
01046 $this->addFooterLink($text, $href, $onclick, $block_id, true);
01047 }
01048
01049
01050 $pages = intval($this->max_count / $this->getLimit());
01051
01052
01053 if (($this->max_count % $this->getLimit()))
01054 $pages++;
01055
01056
01057 if (! ( ($this->getOffset() / $this->getLimit())==($pages-1) ) && ($pages!=1) )
01058 {
01059 $newoffset = $this->getOffset() + $this->getLimit();
01060
01061 $ilCtrl->setParameterByClass("ilcolumngui",
01062 $this->getNavParameter(), "::".$newoffset);
01063
01064
01065 $ilCtrl->setParameterByClass("ilcolumngui",
01066 "block_id", "block_".$this->getBlockType()."_".$this->block_id);
01067
01068 $block_id = "block_".$this->getBlockType()."_".$this->block_id;
01069 $onclick = $ilCtrl->getLinkTargetByClass("ilcolumngui",
01070 "updateBlock", "", true);
01071
01072
01073 $ilCtrl->setParameterByClass("ilcolumngui",
01074 "block_id", "");
01075
01076
01077 $href = $ilCtrl->getLinkTargetByClass("ilcolumngui", "");
01078 $text = $lng->txt("next");
01079
01080 $this->addFooterLink($text, $href, $onclick, $block_id, true);
01081 }
01082 $ilCtrl->setParameterByClass("ilcolumngui",
01083 $this->getNavParameter(), "");
01084 return true;
01085 }
01086 else
01087 {
01088 return false;
01089 }
01090 }
01091
01097 function fillFooterLinks($a_top = false, $a_numinfo = "")
01098 {
01099 global $ilCtrl, $lng;
01100
01101 $first = true;
01102 $flinks = $this->getFooterLinks();
01103
01104 $prefix = ($a_top) ? "top" : "foot";
01105
01106 $omit_separator = false;
01107 foreach($flinks as $flink)
01108 {
01109 if ($flink["top"] != $a_top)
01110 {
01111 continue;
01112 }
01113
01114 if (!$first && !$omit_separator)
01115 {
01116 $this->tpl->touchBlock($prefix."_delim");
01117 $this->tpl->touchBlock($prefix."_item");
01118 }
01119
01120
01121 if ($flink["onclick"] != "")
01122 {
01123 $this->tpl->setCurrentBlock($prefix."_onclick");
01124 $this->tpl->setVariable("OC_BLOCK_ID",
01125 $flink["block_id"]);
01126 $this->tpl->setVariable("OC_HREF",
01127 $flink["onclick"]);
01128 $this->tpl->parseCurrentBlock();
01129 }
01130
01131
01132 if ($flink["href"] != "")
01133 {
01134
01135 $this->tpl->setCurrentBlock($prefix."_link");
01136 $this->tpl->setVariable("FHREF",
01137 $flink["href"]);
01138 $this->tpl->setVariable("FLINK", $flink["text"]);
01139 $this->tpl->parseCurrentBlock();
01140 $this->tpl->touchBlock($prefix."_item");
01141 }
01142 else
01143 {
01144 $this->tpl->setCurrentBlock($prefix."_text");
01145 $this->tpl->setVariable("FTEXT", $flink["text"]);
01146 $this->tpl->parseCurrentBlock();
01147 $this->tpl->touchBlock($prefix."_item");
01148 }
01149 $first = false;
01150 $omit_separator = $flink["omit_separator"];
01151 }
01152
01153 if ($a_numinfo != "")
01154 {
01155 $this->tpl->setVariable("NUMINFO", $a_numinfo);
01156 $first = false;
01157 }
01158
01159 if (!$first)
01160 {
01161 $this->tpl->setVariable("PCOLSPAN", $this->getColSpan());
01162 $this->tpl->setCurrentBlock($prefix."_row");
01163 $this->tpl->parseCurrentBlock();
01164 }
01165 }
01166
01170 function fillDetailRow()
01171 {
01172 global $ilCtrl, $lng;
01173
01174 if ($this->enabledetailrow == false)
01175 {
01176 return;
01177 }
01178
01179 $start = ($this->detail_min < 1)
01180 ? $start = 1
01181 : $this->detail_min;
01182
01183 $end = ($this->detail_max < $this->detail_min)
01184 ? $this->detail_min
01185 : $this->detail_max;
01186
01187 $settings = array();
01188 for ($i = $start; $i <= $end; $i++)
01189 {
01190 $settings[] = $i;
01191 }
01192
01193 if ($end > $start)
01194 {
01195 foreach ($settings as $i)
01196 {
01197 if (($i > $start && $i > 1))
01198 {
01199
01200
01201 }
01202 if ($i != $this->getCurrentDetailLevel())
01203 {
01204 $ilCtrl->setParameterByClass("ilcolumngui",
01205 $this->getDetailParameter(), $i);
01206
01207
01208 if ($i > 0)
01209 {
01210 $ilCtrl->setParameterByClass("ilcolumngui",
01211 "block_id", "block_".$this->getBlockType()."_".$this->block_id);
01212 $this->tpl->setCurrentBlock("onclick");
01213 $this->tpl->setVariable("OC_BLOCK_ID",
01214 "block_".$this->getBlockType()."_".$this->block_id);
01215 $this->tpl->setVariable("OC_HREF",
01216 $ilCtrl->getLinkTargetByClass("ilcolumngui",
01217 "updateBlock", "", true));
01218 $this->tpl->parseCurrentBlock();
01219 $ilCtrl->setParameterByClass("ilcolumngui",
01220 "block_id", "");
01221 }
01222
01223
01224 $this->tpl->setCurrentBlock("det_link");
01225
01226 $this->tpl->setVariable("SRC_LINK",
01227 ilUtil::getImagePath("details".$i.".gif"));
01228 $this->tpl->setVariable("ALT_LINK",
01229 $lng->txt("details_".$i));
01230 $this->tpl->setVariable("DHREF",
01231 $ilCtrl->getLinkTargetByClass("ilcolumngui",
01232 ""));
01233 $this->tpl->parseCurrentBlock();
01234 $this->tpl->touchBlock("det_item");
01235 }
01236 else
01237 {
01238 $this->tpl->setCurrentBlock("det_text");
01239
01240 $this->tpl->setVariable("ALT_NO_LINK",
01241 $lng->txt("details_".$i));
01242 $this->tpl->setVariable("SRC_NO_LINK",
01243 ilUtil::getImagePath("details".$i."off.gif"));
01244 $this->tpl->parseCurrentBlock();
01245 $this->tpl->touchBlock("det_item");
01246 }
01247 }
01248
01249
01250 if ($this->getFooterInfo(true) != "")
01251 {
01252 $this->tpl->setCurrentBlock("det_info");
01253 $this->tpl->setVariable("INFO_TEXT", $this->getFooterInfo(true));
01254 $this->tpl->setVariable("ALT_DET_INFO", $lng->txt("info_short"));
01255 $this->tpl->setVariable("DI_BLOCK_ID", $this->getBlockType()."_".$this->getBlockId());
01256 $this->tpl->setVariable("IMG_DET_INFO", ilUtil::getImagePath("icon_info_s.gif"));
01257 $this->tpl->parseCurrentBlock();
01258 }
01259
01260 $this->tpl->setCurrentBlock("detail_setting");
01261 $this->tpl->setVariable("TXT_DETAILS", $lng->txt("details"));
01262 $this->tpl->setVariable("DCOLSPAN", $this->getColSpan());
01263 $this->tpl->parseCurrentBlock();
01264
01265 $ilCtrl->setParameterByClass("ilcolumngui",
01266 $this->getDetailParameter(), "");
01267 }
01268 }
01269
01273 function fillMoveRow()
01274 {
01275 global $ilCtrl, $lng;
01276
01277 if ($this->config_mode)
01278 {
01279 if ($this->getAllowMove("left"))
01280 {
01281 $this->fillMoveLink("left", "icon_left_s.gif", $lng->txt("move_left"));
01282 }
01283 if ($this->getAllowMove("up"))
01284 {
01285 $this->fillMoveLink("up", "icon_up_s.gif", $lng->txt("move_up"));
01286 }
01287 if ($this->getAllowMove("down"))
01288 {
01289 $this->fillMoveLink("down", "icon_down_s.gif", $lng->txt("move_down"));
01290 }
01291 if ($this->getAllowMove("right"))
01292 {
01293 $this->fillMoveLink("right", "icon_right_s.gif", $lng->txt("move_right"));
01294 }
01295 $ilCtrl->setParameter($this, $this->getMoveParameter(), "");
01296
01297 $this->tpl->setCurrentBlock("move");
01298 $this->tpl->parseCurrentBlock();
01299 }
01300 }
01301
01302 function getAllowMove($a_direction)
01303 {
01304 return $this->move[$a_direction];
01305 }
01306
01307 function setAllowMove($a_direction, $a_allow = true)
01308 {
01309 $this->move[$a_direction] = $a_allow;
01310
01311 }
01312
01313 function fillMoveLink($a_value, $a_img, $a_txt)
01314 {
01315 global $ilCtrl, $lng;
01316
01317 $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
01318 $this->getBlockType()."_".$this->getBlockId());
01319 $ilCtrl->setParameterByClass("ilcolumngui", "move_dir",
01320 $a_value);
01321 $this->tpl->setCurrentBlock("move_link");
01322 $this->tpl->setVariable("IMG_MOVE", ilUtil::getImagePath($a_img));
01323 $this->tpl->setVariable("ALT_MOVE", $a_txt);
01324 $this->tpl->setVariable("HREF_MOVE",
01325 $ilCtrl->getLinkTargetByClass("ilcolumngui",
01326 "moveBlock"));
01327 $this->tpl->parseCurrentBlock();
01328 }
01329 }