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
00036 require_once "class.ilObjectGUI.php";
00037
00038 class ilObjObjectFolderGUI extends ilObjectGUI
00039 {
00048 function ilObjObjectFolderGUI($a_data,$a_id,$a_call_by_reference)
00049 {
00050 $this->type = "objf";
00051 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
00052 }
00053
00059 function viewObject()
00060 {
00061 global $rbacsystem;
00062
00063 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
00064 {
00065 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00066 }
00067
00068
00069 $this->data = array();
00070 $this->data["data"] = array();
00071 $this->data["ctrl"] = array();
00072
00073 $this->data["cols"] = array("type","title","last_change");
00074
00075 $this->maxcount = count($this->data["data"]);
00076
00077
00078 foreach ($this->data["data"] as $key => $val)
00079 {
00080 $this->data["ctrl"][$key] = array(
00081 "ref_id" => $this->id,
00082 "obj_id" => $val["obj_id"],
00083 "type" => $val["type"],
00084 );
00085
00086 unset($this->data["data"][$key]["obj_id"]);
00087 $this->data["data"][$key]["last_change"] = ilFormat::formatDate($this->data["data"][$key]["last_change"]);
00088 }
00089
00090 $this->displayList();
00091 }
00092
00098 function displayList()
00099 {
00100 include_once "./Services/Table/classes/class.ilTableGUI.php";
00101 return;
00102
00103
00104 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
00105
00106
00107 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");
00108
00109 $num = 0;
00110
00111 $obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id;
00112 $this->tpl->setVariable("FORMACTION",
00113 $this->ctrl->getFormAction($this));
00114
00115
00116 $tbl = new ilTableGUI();
00117
00118
00119 $tbl->setTitle($this->object->getTitle(),"icon_".$this->object->getType()."_b.gif",$this->lng->txt("obj_".$this->object->getType()));
00120 $tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
00121
00122 foreach ($this->data["cols"] as $val)
00123 {
00124 $header_names[] = $this->lng->txt($val);
00125 }
00126
00127 $tbl->setHeaderNames($header_names);
00128
00129
00130 $header_params = $this->ctrl->getParameterArray($this, "view");
00131 $tbl->setHeaderVars($this->data["cols"],$header_params);
00132 $tbl->setColumnWidth(array("15","75%","25%"));
00133
00134
00135 $tbl->setOrderColumn($_GET["sort_by"]);
00136 $tbl->setOrderDirection($_GET["sort_order"]);
00137 $tbl->setLimit($_GET["limit"]);
00138 $tbl->setOffset($_GET["offset"]);
00139 $tbl->setMaxCount($this->maxcount);
00140
00141
00142 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
00143
00144
00145
00146 $tbl->render();
00147
00148 if (is_array($this->data["data"][0]))
00149 {
00150
00151 for ($i=0; $i < count($this->data["data"]); $i++)
00152 {
00153 $data = $this->data["data"][$i];
00154 $ctrl = $this->data["ctrl"][$i];
00155
00156
00157 $css_row = ilUtil::switchColor($i+1,"tblrow1","tblrow2");
00158
00159 $this->tpl->setCurrentBlock("table_cell");
00160 $this->tpl->setVariable("CELLSTYLE", "tblrow1");
00161 $this->tpl->parseCurrentBlock();
00162
00163 foreach ($data as $key => $val)
00164 {
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 }
00221
00222 $this->tpl->setCurrentBlock("tbl_content");
00223 $this->tpl->setVariable("CSS_ROW", $css_row);
00224 $this->tpl->parseCurrentBlock();
00225 }
00226
00227 }
00228 else
00229 {
00230 $this->tpl->setCurrentBlock("notfound");
00231 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
00232 $this->tpl->setVariable("NUM_COLS", $num);
00233 $this->tpl->parseCurrentBlock();
00234 }
00235 }
00236
00237 function &executeCommand()
00238 {
00239 $next_class = $this->ctrl->getNextClass($this);
00240 $cmd = $this->ctrl->getCmd();
00241 $this->prepareOutput();
00242
00243 switch($next_class)
00244 {
00245 case 'ilpermissiongui':
00246 include_once("./classes/class.ilPermissionGUI.php");
00247 $perm_gui =& new ilPermissionGUI($this);
00248 $ret =& $this->ctrl->forwardCommand($perm_gui);
00249 break;
00250
00251 default:
00252 if(!$cmd)
00253 {
00254 $cmd = "view";
00255 }
00256 $cmd .= "Object";
00257 $this->$cmd();
00258
00259 break;
00260 }
00261 return true;
00262 }
00263
00269 function getTabs(&$tabs_gui)
00270 {
00271 global $rbacsystem;
00272
00273 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
00274 {
00275 $tabs_gui->addTarget("settings",
00276 $this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
00277
00278 $tabs_gui->addTarget("perm_settings",
00279 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
00280 }
00281 }
00282 }
00283 ?>