39 include_once
"./classes/class.ilObjectGUI.php";
50 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
83 global $rbacsystem,
$ilias;
85 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
87 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
90 include_once
"./Services/Table/classes/class.ilTableGUI.php";
93 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
96 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.styf_row.html");
106 $tbl->setTitle($this->object->getTitle(),
"icon_styf.gif",
107 $this->lng->txt(
"obj_".$this->object->getType()));
112 $header_names = array(
"", $this->lng->txt(
"title"),
113 $this->lng->txt(
"purpose"));
114 $tbl->setHeaderNames($header_names);
116 $header_params = array(
"ref_id" => $this->ref_id);
117 $tbl->setHeaderVars(array(
"",
"title",
"purpose"), $header_params);
118 $tbl->setColumnWidth(array(
"0%",
"80%",
"20%"));
121 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
122 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
123 $tbl->setLimit(
$_GET[
"limit"]);
124 $tbl->setOffset(
$_GET[
"offset"]);
127 $style_entries = array();
128 $styles = $this->
object->getStyles();
129 foreach($styles as $style)
131 $style_entries[$style[
"title"].
":".$style[
"id"]]
134 ksort($style_entries);
137 $tbl->setMaxCount(count($style_entries));
139 $this->tpl->setVariable(
"COLUMN_COUNTS", 3);
142 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
146 include_once (
"./Services/Style/classes/class.ilObjStyleSheet.php");
148 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
149 $default_style = $ilias->getSetting(
"default_content_style_id");
151 foreach ($style_entries as $style)
153 $this->tpl->setCurrentBlock(
"style_row");
156 $css_row = ($css_row ==
"tblrow2")
160 $this->tpl->setVariable(
"CHECKBOX_ID", $style[
"id"]);
161 $this->tpl->setVariable(
"TXT_TITLE", $style[
"title"]);
166 $this->tpl->setVariable(
"ROWCOL", $css_row);
167 if ($style[
"id"] == $fixed_style)
169 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_fixed"));
171 if ($style[
"id"] == $default_style)
173 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_default"));
175 $this->tpl->parseCurrentBlock();
177 $this->tpl->setCurrentBlock(
"tbl_content");
178 $this->tpl->parseCurrentBlock();
182 if (count($style_entries) == 0)
184 $tbl->disable(
"header");
185 $tbl->disable(
"footer");
187 $this->tpl->setCurrentBlock(
"text");
188 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"obj_not_found"));
189 $this->tpl->parseCurrentBlock();
191 $this->tpl->setCurrentBlock(
"tbl_content");
192 $this->tpl->parseCurrentBlock();
208 if (!isset($_POST[
"id"]))
210 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
216 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
227 $this->tpl->setCurrentBlock(
"table_header");
228 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
229 $this->tpl->parseCurrentBlock();
236 foreach ($_POST[
"id"] as $id)
238 $this->tpl->setCurrentBlock(
"table_row");
242 $this->tpl->parseCurrentBlock();
248 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
249 "cancelDelete" => $this->lng->txt(
"cancel"));
250 foreach ($buttons as $name => $value)
252 $this->tpl->setCurrentBlock(
"operation_btn");
254 $this->tpl->setVariable(
"BTN_NAME",$name);
255 $this->tpl->setVariable(
"BTN_VALUE",$value);
256 $this->tpl->parseCurrentBlock();
270 $this->
object->removeStyle($id);
271 $style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
272 $style_obj->delete();
274 $this->
object->update();
289 if (!isset($_POST[
"id"]))
291 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
293 if(count($_POST[
"id"]) > 1)
295 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
298 $ilias->deleteSetting(
"fixed_content_style_id");
299 $def_style = $ilias->getSetting(
"default_content_style_id");
301 if ($def_style != $_POST[
"id"][0])
303 $ilias->setSetting(
"default_content_style_id", $_POST[
"id"][0]);
307 $ilias->deleteSetting(
"default_content_style_id");
322 if (!isset($_POST[
"id"]))
324 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
326 if(count($_POST[
"id"]) > 1)
328 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
331 $ilias->deleteSetting(
"default_content_style_id");
332 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
333 if ($fixed_style == $_POST[
"id"][0])
335 $ilias->deleteSetting(
"fixed_content_style_id");
339 $ilias->setSetting(
"fixed_content_style_id", $_POST[
"id"][0]);
355 $this->tpl->setCurrentBlock(
"tbl_action_btn");
356 $this->tpl->setVariable(
"BTN_NAME",
"deleteStyle");
357 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
358 $this->tpl->parseCurrentBlock();
361 $this->tpl->setCurrentBlock(
"tbl_action_btn");
362 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalDefault");
363 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalDefault"));
364 $this->tpl->parseCurrentBlock();
367 $this->tpl->setCurrentBlock(
"tbl_action_btn");
368 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalFixed");
369 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalFixed"));
370 $this->tpl->parseCurrentBlock();
372 if ($with_subobjects ===
true)
377 $this->tpl->setCurrentBlock(
"tbl_action_row");
379 $this->tpl->parseCurrentBlock();