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 require_once("content/classes/class.ilStructureObject.php");
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class ilTableOfContentsExplorer extends ilLMExplorer
00036 {
00037
00043 var $root_id;
00044 var $output;
00045 var $offline;
00046
00053 function ilTableOfContentsExplorer($a_target,&$a_lm_obj, $a_export_format = "")
00054 {
00055 parent::ilLMExplorer($a_target, $a_lm_obj);
00056 $this->setExpandTarget("lm_presentation.php?cmd=".$_GET["cmd"]."&ref_id=".$this->lm_obj->getRefId());
00057 $this->setSessionExpandVariable("lmtocexpand");
00058 $this->export_format = $a_export_format;
00059 $this->lm_obj =& $a_lm_obj;
00060
00061 $this->addFilter("du");
00062 $this->addFilter("st");
00063 if ($a_lm_obj->getTOCMode() == "pages")
00064 {
00065 $this->addFilter("pg");
00066 }
00067 $this->setFiltered(true);
00068 $this->setFilterMode(IL_FM_POSITIVE);
00069
00070
00071
00072
00073 $showViewInFrameset = true;
00074
00075 if ($showViewInFrameset)
00076 {
00077 $this->setFrameTarget(ilFrameTargetInfo::_getFrame("MainContent"));
00078 }
00079 else
00080 {
00081 $this->setFrameTarget("_top");
00082 }
00083
00084 }
00085
00089 function setOfflineMode($a_offline = true)
00090 {
00091 $this->offline = $a_offline;
00092
00093 if ($a_offline)
00094 {
00095 if ($this->export_format == "scorm")
00096 {
00097 $this->setFrameTarget("");
00098 }
00099 }
00100
00101 }
00102
00106 function offlineMode()
00107 {
00108 return $this->offline;
00109 }
00110
00114 function buildTitle($a_title, $a_id, $a_type)
00115 {
00116 global $lng;
00117
00118 include_once("content/classes/class.ilObjContentObject.php");
00119 $access_str = "";
00120 if (!ilObjContentObject::_checkPreconditionsOfPage(
00121 ilObject::_lookupObjId($_GET["ref_id"]), $a_id))
00122 {
00123 $access_str = " (".$lng->txt("cont_no_access").")";
00124 }
00125
00126 if ($a_type == "st")
00127 {
00128 return ilStructureObject::_getPresentationTitle($a_id,
00129 $this->lm_obj->isActiveNumbering()).$access_str;
00130 }
00131
00132 if ($this->lm_obj->getTOCMode() == "chapters" || $a_type != "pg")
00133 {
00134 return $a_title.$access_str;
00135 }
00136 else
00137 {
00138 if ($a_type == "pg")
00139 {
00140 return ilLMPageObject::_getPresentationTitle($a_id,
00141 $this->lm_obj->getPageHeader(), $this->lm_obj->isActiveNumbering()).$access_str;
00142 }
00143 }
00144
00145 }
00146
00150 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00151 {
00152
00153
00154
00155 $showViewInFrameset = true;
00156
00157 if ($this->offlineMode() &&
00158 $this->export_format == "scorm")
00159 {
00160 return "";
00161 }
00162
00163 if ($showViewInFrameset && !$this->offlineMode())
00164 {
00165 return ilFrameTargetInfo::_getFrame("MainContent");
00166 }
00167 else
00168 {
00169 return "_top";
00170 }
00171 }
00172
00176 function buildLinkTarget($a_node_id, $a_type)
00177 {
00178 if (!$this->offlineMode())
00179 {
00180 return parent::buildLinkTarget($a_node_id, $a_type);
00181 }
00182 else
00183 {
00184 if ($a_node_id < 1)
00185 {
00186 $a_node_id = $this->tree->getRootId();
00187 }
00188 if ($a_type != "pg")
00189 {
00190 $a_node = $this->tree->fetchSuccessorNode($a_node_id, "pg");
00191 $a_node_id = $a_node["child"];
00192 }
00193
00194 if ($nid = ilLMObject::_lookupNID($this->lm_obj->getId(), $a_node_id, "pg"))
00195 {
00196 return "lm_pg_".$nid.".html";
00197 }
00198 else
00199 {
00200 return "lm_pg_".$a_node_id.".html";
00201 }
00202 }
00203 }
00204
00205
00206
00207
00208
00209
00213 function getImage($a_name)
00214 {
00215 return ilUtil::getImagePath($a_name, false, "output", $this->offlineMode());
00216 }
00217
00221 function forceExpanded($a_obj_id)
00222 {
00223 if ($this->offlineMode())
00224 {
00225 return true;
00226 }
00227 else
00228 {
00229 return true;
00230 }
00231 }
00232
00233 function isVisible($a_id, $a_type)
00234 {
00235 if(!ilLMObject::_lookupActive($a_id))
00236 {
00237 return false;
00238 }
00239 else
00240 {
00241 return true;
00242 }
00243 }
00244
00245 }
00246 ?>