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
00033 class ilTabsGUI
00034 {
00035 var $target_script;
00036 var $obj_type;
00037 var $tpl;
00038 var $lng;
00039 var $tabs;
00040 var $objDefinition;
00041 var $target = array();
00042
00047 function ilTabsGUI()
00048 {
00049 global $tpl, $objDefinition, $lng;
00050
00051 $this->tpl =& $tpl;
00052 $this->lng =& $lng;
00053 $this->objDefinition =& $objDefinition;
00054
00055 $this->temp_var = "TABS";
00056 }
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 function getTargetsByObjectType(&$a_gui_obj, $a_type)
00150 {
00151 global $ilCtrl;
00152
00153 $d = $this->objDefinition->getProperties($a_type);
00154
00155 foreach ($d as $key => $row)
00156 {
00157 $this->addTarget($row["lng"],
00158 $ilCtrl->getLinkTarget($a_gui_obj, $row["name"]),
00159 $row["name"], get_class($a_gui_obj));
00160 }
00161 }
00162
00163 function addTarget($a_text, $a_link, $a_cmd = "", $a_cmdClass = "", $a_frame = "")
00164 {
00165 $a_cmdClass = strtolower($a_cmdClass);
00166
00167 $this->target[] = array("text" => $a_text, "link" => $a_link,
00168 "cmd" => $a_cmd, "cmdClass" => $a_cmdClass);
00169
00170 }
00171
00172 function getHTML()
00173 {
00174 global $ilCtrl, $lng;
00175
00176 $cmd = $ilCtrl->getCmd();
00177 $cmdClass = $ilCtrl->getCmdClass();
00178
00179 $tpl = new ilTemplate("tpl.tabs.html", true, true);
00180
00181 foreach ($this->target as $target)
00182 {
00183 $i++;
00184 if ($target["cmd"] == $cmd &&
00185 ($target["cmdClass"] == $cmdClass))
00186 {
00187 $tabtype = "tabactive";
00188 }
00189 else
00190 {
00191 $tabtype = "tabinactive";
00192 }
00193
00194 $tpl->setCurrentBlock("tab");
00195 $tpl->setVariable("TAB_TYPE", $tabtype);
00196 $tpl->setVariable("TAB_LINK", $target["link"]);
00197 $tpl->setVariable("TAB_TEXT", $lng->txt($target["text"]));
00198 $tpl->setVariable("TAB_TARGET", $target["frame"]);
00199 $tpl->parseCurrentBlock();
00200 }
00201
00202 return $tpl->get();
00203 }
00204
00205
00206
00207
00208 }
00209 ?>