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
00034 class ilForumLocatorGUI
00035 {
00036 var $mode;
00037 var $temp_var;
00038 var $tree;
00039 var $obj;
00040 var $lng;
00041 var $tpl;
00042 var $frm;
00043 var $thread_id;
00044 var $thread_subject;
00045 var $show_user;
00046
00047 function ilForumLocatorGUI()
00048 {
00049 global $lng, $tpl, $tree;
00050
00051 $this->tree =& $tree;
00052 $this->mode = "std";
00053 $this->temp_var = "LOCATOR";
00054 $this->lng =& $lng;
00055 $this->tpl =& $tpl;
00056 $this->show_user = false;
00057 }
00058
00059
00060 function setTemplateVariable($a_temp_var)
00061 {
00062 $this->temp_var = $a_temp_var;
00063 }
00064
00065 function setRefId($a_ref_id)
00066 {
00067 $this->ref_id = $a_ref_id;
00068 }
00069
00070 function setThread($a_id, $a_subject)
00071 {
00072 $this->thread_id = $a_id;
00073 $this->thread_subject = $a_subject;
00074 }
00075
00076 function setForum(&$a_frm)
00077 {
00078 $this->frm =& $a_frm;
00079 }
00080
00081 function showUser($a_show)
00082 {
00083 $this->show_user = $a_show;
00084 }
00085
00089 function display()
00090 {
00091 global $lng;
00092
00093 $this->tpl->addBlockFile($this->temp_var, "locator", "tpl.locator.html");
00094
00095 $path = $this->tree->getPathFull($this->ref_id);
00096
00097 $modifier = 1;
00098
00099
00100
00101
00102 foreach ($path as $key => $row)
00103 {
00104 if ($this->ref_id == $row["child"] && is_object($this->frm))
00105 {
00106 if (!is_array($topicData = $this->frm->getOneTopic()))
00107 {
00108 continue;
00109 }
00110 }
00111
00112
00113
00114
00115
00116
00117
00118 if (($key < count($path)-$modifier) || (!empty($this->thread_id))
00119 || $this->show_user)
00120 {
00121 $this->tpl->touchBlock("locator_separator");
00122
00123 }
00124
00125 $this->tpl->setCurrentBlock("locator_item");
00126 if ($row["child"] == $this->tree->getRootId())
00127 {
00128 $title = $this->lng->txt("repository");
00129 $link = "repository.php?ref_id=".$row["child"]
00130 ."&cmd=frameset";
00131 }
00132 else if (($this->ref_id == $row["child"]) && (is_object($this->frm)))
00133 {
00134 $title = $row["title"];
00135 #$link = "forums_threads_liste.php?ref_id=".$row["child"];
00136 $link = "repository.php?ref_id=".$row["child"];
00137 }
00138 else
00139 {
00140 $title = $row["title"];
00141 if ($row["type"] == "frm")
00142 {
00143 $link = "repository.php?ref_id=".$row["child"];
00144 }
00145 else
00146 {
00147 $link = "repository.php?ref_id=".$row["child"]
00148 ."&cmd=frameset";
00149 }
00150 }
00151 $this->tpl->setVariable("ITEM", $title);
00152 $this->tpl->setVariable("LINK_ITEM", $link);
00153 $t_frame = ilFrameTargetInfo::_getFrame("MainContent");
00154 $this->tpl->setVariable("LINK_TARGET", "target=\"$t_frame\"");
00155 $this->tpl->parseCurrentBlock();
00156 }
00157
00158 if (!empty($this->thread_id))
00159 {
00160 if ($this->show_user)
00161 {
00162 $this->tpl->touchBlock("locator_separator");
00163 }
00164 $this->tpl->setCurrentBlock("locator_item");
00165 $this->tpl->setVariable("ITEM", $this->thread_subject);
00166 $this->tpl->setVariable("LINK_ITEM", "forums_threads_view.php?thr_pk=".
00167 $this->thread_id."&ref_id=".$this->ref_id);
00168 $this->tpl->parseCurrentBlock();
00169 }
00170
00171 if ($this->show_user)
00172 {
00173 $this->tpl->setCurrentBlock("locator_item");
00174 $this->tpl->setVariable("ITEM", $lng->txt("userdata"));
00175 $this->tpl->setVariable("LINK_ITEM", "");
00176
00177
00178 $this->tpl->parseCurrentBlock();
00179 }
00180
00181 $this->tpl->setCurrentBlock("locator");
00182 $this->tpl->setVariable("TXT_LOCATOR",$debug.$this->lng->txt("locator"));
00183 $this->tpl->parseCurrentBlock();
00184 }
00185
00186
00187 }