Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 require_once("content/classes/class.ilLMExplorer.php");
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class ilLMEditorExplorer extends ilLMExplorer
00035 {
00042 function ilLMEditorExplorer($a_target, &$a_lm_obj, $a_gui_class)
00043 {
00044 global $ilCtrl;
00045
00046 $this->ctrl =& $ilCtrl;
00047 $this->gui_class = $a_gui_class;
00048
00049 parent::ilLMExplorer($a_target, $a_lm_obj);
00050
00051 }
00052
00060 function formatHeader(&$tpl, $a_obj_id,$a_option)
00061 {
00062 global $lng, $ilias;
00063
00064 $tpl->setCurrentBlock("icon");
00065 $tpl->setVariable("ICON_IMAGE" , ilUtil::getImagePath("icon_lm.gif"));
00066 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("obj_".$this->lm_obj->getType()));
00067 $tpl->parseCurrentBlock();
00068
00069
00070 $tpl->setCurrentBlock("link");
00071 $tpl->setVariable("TITLE", ilUtil::shortenText($this->lm_obj->getTitle(), $this->textwidth, true));
00072
00073 if ($this->lm_obj->getType() == "lm")
00074 {
00075 $this->ctrl->setParameterByClass("ilObjLearningModuleGUI",
00076 "obj_id", "");
00077 $link = $this->ctrl->getLinkTargetByClass("ilObjLearningModuleGUI",
00078 "properties");
00079 }
00080 else
00081 {
00082 $this->ctrl->setParameterByClass("ilObjDlBookGUI",
00083 "obj_id", "");
00084 $link = $this->ctrl->getLinkTargetByClass("ilObjDlBookGUI",
00085 "properties");
00086 }
00087 $tpl->setVariable("LINK_TARGET", $link);
00088
00089 $tpl->setVariable("TARGET", " target=\"".$this->frame_target."\"");
00090 $tpl->parseCurrentBlock();
00091
00092
00093
00094
00095 $tpl->touchBlock("element");
00096 }
00097
00101 function buildTitle($a_title, $a_id, $a_type)
00102 {
00103
00104 if ($a_type == "st")
00105 {
00106 return ilStructureObject::_getPresentationTitle($a_id,
00107 $this->lm_obj->isActiveNumbering());
00108 }
00109
00110 return $a_title;
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124 }
00125
00126
00130 function buildLinkTarget($a_node_id, $a_type)
00131 {
00132 switch($a_type)
00133 {
00134 case "pg":
00135 $this->ctrl->setParameterByClass("ilLMPageObjectGUI", "obj_id", $a_node_id);
00136 return $this->ctrl->getLinkTargetByClass("ilLMPageObjectGUI",
00137 "view", array($this->gui_class));
00138 break;
00139
00140 case "st":
00141 $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $a_node_id);
00142 return $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
00143 "view", array($this->gui_class));
00144 break;
00145 }
00146 }
00147
00148
00152 function getNodeStyleClass($a_id, $a_type)
00153 {
00154 include_once("content/classes/class.ilLMObject.php");
00155
00156 $active = ilLMObject::_lookupActive($a_id);
00157 if (!$active)
00158 {
00159 return "il_PageDisabled";
00160 }
00161 else
00162 {
00163 include_once("content/classes/Pages/class.ilPageObject.php");
00164 $contains_dis = ilPageObject::_lookupContainsDeactivatedElements($a_id,
00165 $this->lm_obj->getType());
00166 if ($contains_dis)
00167 {
00168 return "il_PageDeactivatedElements";
00169 }
00170 }
00171 return "";
00172 }
00173
00174 }
00175 ?>