39 include_once
"./classes/class.ilObjectGUI.php";
50 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
77 global $rbacsystem,
$ilias;
79 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
81 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
84 include_once
"./Services/Table/classes/class.ilTableGUI.php";
87 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
90 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.styf_row.html");
100 $tbl->setTitle($this->object->getTitle(),
"icon_styf.gif",
101 $this->lng->txt(
"obj_".$this->object->getType()));
106 $header_names = array(
"", $this->lng->txt(
"title"),
107 $this->lng->txt(
"purpose"));
108 $tbl->setHeaderNames($header_names);
110 $header_params = array(
"ref_id" => $this->ref_id);
111 $tbl->setHeaderVars(array(
"",
"title",
"purpose"), $header_params);
112 $tbl->setColumnWidth(array(
"0%",
"80%",
"20%"));
115 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
116 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
117 $tbl->setLimit(
$_GET[
"limit"]);
118 $tbl->setOffset(
$_GET[
"offset"]);
121 $style_entries = array();
122 $styles = $this->
object->getStyles();
123 foreach($styles as $style)
125 $style_entries[$style[
"title"].
":".$style[
"id"]]
128 ksort($style_entries);
131 $tbl->setMaxCount(count($style_entries));
133 $this->tpl->setVariable(
"COLUMN_COUNTS", 3);
136 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
140 include_once (
"./Services/Style/classes/class.ilObjStyleSheet.php");
142 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
143 $default_style = $ilias->getSetting(
"default_content_style_id");
145 foreach ($style_entries as $style)
147 $this->tpl->setCurrentBlock(
"style_row");
150 $css_row = ($css_row ==
"tblrow2")
154 $this->tpl->setVariable(
"CHECKBOX_ID", $style[
"id"]);
155 $this->tpl->setVariable(
"TXT_TITLE", $style[
"title"]);
160 $this->tpl->setVariable(
"ROWCOL", $css_row);
161 if ($style[
"id"] == $fixed_style)
163 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_fixed"));
165 if ($style[
"id"] == $default_style)
167 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_default"));
169 $this->tpl->parseCurrentBlock();
171 $this->tpl->setCurrentBlock(
"tbl_content");
172 $this->tpl->parseCurrentBlock();
176 if (count($style_entries) == 0)
178 $tbl->disable(
"header");
179 $tbl->disable(
"footer");
181 $this->tpl->setCurrentBlock(
"text");
182 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"obj_not_found"));
183 $this->tpl->parseCurrentBlock();
185 $this->tpl->setCurrentBlock(
"tbl_content");
186 $this->tpl->parseCurrentBlock();
204 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
210 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
221 $this->tpl->setCurrentBlock(
"table_header");
222 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
223 $this->tpl->parseCurrentBlock();
230 foreach (
$_POST[
"id"] as $id)
232 $this->tpl->setCurrentBlock(
"table_row");
236 $this->tpl->parseCurrentBlock();
242 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
243 "cancelDelete" => $this->lng->txt(
"cancel"));
244 foreach ($buttons as
$name => $value)
246 $this->tpl->setCurrentBlock(
"operation_btn");
248 $this->tpl->setVariable(
"BTN_NAME",
$name);
249 $this->tpl->setVariable(
"BTN_VALUE",$value);
250 $this->tpl->parseCurrentBlock();
264 $this->
object->removeStyle($id);
265 $style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
266 $style_obj->delete();
268 $this->
object->update();
285 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
287 if(count(
$_POST[
"id"]) > 1)
289 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
292 $ilias->deleteSetting(
"fixed_content_style_id");
293 $def_style = $ilias->getSetting(
"default_content_style_id");
295 if ($def_style !=
$_POST[
"id"][0])
297 $ilias->setSetting(
"default_content_style_id",
$_POST[
"id"][0]);
301 $ilias->deleteSetting(
"default_content_style_id");
318 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
320 if(count(
$_POST[
"id"]) > 1)
322 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
325 $ilias->deleteSetting(
"default_content_style_id");
326 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
327 if ($fixed_style ==
$_POST[
"id"][0])
329 $ilias->deleteSetting(
"fixed_content_style_id");
333 $ilias->setSetting(
"fixed_content_style_id",
$_POST[
"id"][0]);
349 $this->tpl->setCurrentBlock(
"tbl_action_btn");
350 $this->tpl->setVariable(
"BTN_NAME",
"deleteStyle");
351 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
352 $this->tpl->parseCurrentBlock();
355 $this->tpl->setCurrentBlock(
"tbl_action_btn");
356 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalDefault");
357 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalDefault"));
358 $this->tpl->parseCurrentBlock();
361 $this->tpl->setCurrentBlock(
"tbl_action_btn");
362 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalFixed");
363 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalFixed"));
364 $this->tpl->parseCurrentBlock();
366 if ($with_subobjects ===
true)
371 $this->tpl->setCurrentBlock(
"tbl_action_row");
373 $this->tpl->parseCurrentBlock();