ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjStyleSettingsGUI Class Reference

Style settings GUI class. More...

+ Inheritance diagram for ilObjStyleSettingsGUI:
+ Collaboration diagram for ilObjStyleSettingsGUI:

Public Member Functions

 ilObjStyleSettingsGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 saveObject ()
 Save object. More...
 
 editContentStylesObject ()
 view list of styles More...
 
 moveLMStylesObject ()
 move learning modules from one style to another More...
 
 moveIndividualStylesObject ()
 move all learning modules with individual styles to new style More...
 
 confirmDeleteIndividualStyles ()
 
 editSystemStylesObject ()
 edit system styles More...
 
 saveStyleSettingsObject ()
 save skin and style settings More...
 
 moveUserStylesObject ()
 Move user styles. More...
 
 deleteStyleObject ($a_error=false)
 display deletion confirmation screen More...
 
 confirmedDeleteObject ()
 delete selected style objects More...
 
 toggleGlobalDefaultObject ()
 Toggle global default style. More...
 
 toggleGlobalFixedObject ()
 Toggle global fixed style. More...
 
 saveActiveStylesObject ()
 Save active styles. More...
 
 showActions ($with_subobjects=false)
 show possible action (form buttons) More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 setScopeObject ()
 Set scope. More...
 
 saveScopeObject ()
 Save scope for style. More...
 
 viewPageLayoutsObject ()
 view list of page layouts More...
 
 activateObject ($a_activate=true)
 
 deactivateObject ()
 
 deletePglObject ()
 display deletion confirmation screen More...
 
 cancelDeletePgObject ()
 cancel deletion of Page Layout More...
 
 confirmedDeletePgObject ()
 conform deletion of Page Layout More...
 
 addPageLayoutObject ($a_form=null)
 
 initAddPageLayoutForm ()
 
 createPgObject ()
 
 cancelCreateObject ()
 
 editPgObject ()
 
 setTabs ()
 set admin tabs @access public More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getTabs (&$tabs_gui)
 get tabs @access public More...
 
 createStyleObject ()
 Create new style. More...
 
 savePageLayoutTypesObject ()
 Save page layout types. More...
 
 exportLayoutObject ()
 Export page layout template object. More...
 
 importPageLayoutFormObject ()
 Import page layout. More...
 
 initPageLayoutImportForm ()
 Init page layout import form. More...
 
 importPageLayoutObject ()
 Import page layout. More...
 
 assignStylesToCatsObject ()
 Assign styles to cats. More...
 
 addStyleCatAssignmentObject ()
 Add style category assignment. More...
 
 saveStyleCatAssignmentObject ()
 Save style category assignment. More...
 
 deleteSysStyleCatAssignmentsObject ()
 Delete system style to category assignments. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $peditor_active = false
 
 $pg_id = null
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Style settings GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilObjStyleSettingsGUI: ilPermissionGUI, ilPageLayoutGUI

Definition at line 17 of file class.ilObjStyleSettingsGUI.php.

Member Function Documentation

◆ activateObject()

ilObjStyleSettingsGUI::activateObject (   $a_activate = true)

Definition at line 632 of file class.ilObjStyleSettingsGUI.php.

632 {
633 if (!isset($_POST["pglayout"]))
634 {
635 ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
636 } else {
637 ilUtil::sendSuccess($this->lng->txt("sty_opt_saved"),true);
638 foreach ($_POST["pglayout"] as $item)
639 {
640 $pg_layout = new ilPageLayout($item);
641 $pg_layout->activate($a_activate);
642 }
643 }
644 $this->ctrl->redirect($this, "viewPageLayouts");
645 }
Class ilPageLayout.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_POST, ilUtil\sendInfo(), and ilUtil\sendSuccess().

Referenced by deactivateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPageLayoutObject()

ilObjStyleSettingsGUI::addPageLayoutObject (   $a_form = null)

Definition at line 713 of file class.ilObjStyleSettingsGUI.php.

714 {
715 global $ilTabs;
716
717 $ilTabs->setTabActive('page_layouts');
718
719 if(!$a_form)
720 {
721 $a_form = $this->initAddPageLayoutForm();
722 }
723
724 $this->tpl->setContent($a_form->getHTML());
725 }

References initAddPageLayoutForm().

Referenced by createPgObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStyleCatAssignmentObject()

ilObjStyleSettingsGUI::addStyleCatAssignmentObject ( )

Add style category assignment.

Parameters

return

Definition at line 1107 of file class.ilObjStyleSettingsGUI.php.

1108 {
1109 global $ilCtrl, $ilTabs, $lng, $tree, $tpl, $rbacsystem;
1110
1111 if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1112 {
1113 return;
1114 }
1115
1116 $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1117 $ilCtrl->setParameter($this, "substyle", urlencode($_REQUEST["substyle"]));
1118
1119 include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
1120 $exp = new ilSearchRootSelector(
1121 $ilCtrl->getLinkTarget($this,'addStyleCatAssignment'));
1122 $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
1123 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,'addStyleCatAssignment'));
1124 $exp->setTargetClass(get_class($this));
1125 $exp->setCmd('saveStyleCatAssignment');
1126 $exp->setClickableTypes(array("cat"));
1127
1128 // build html-output
1129 $exp->setOutput(0);
1130 $tpl->setContent($exp->getOutput());
1131 }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_GET, $_REQUEST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObjectGUI\$tree.

◆ assignStylesToCatsObject()

ilObjStyleSettingsGUI::assignStylesToCatsObject ( )

Assign styles to cats.

Parameters

return

Definition at line 1062 of file class.ilObjStyleSettingsGUI.php.

1063 {
1064 global $ilToolbar, $ilCtrl, $tpl, $lng, $rbacsystem;
1065
1066 $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1067
1068 if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1069 {
1070 return;
1071 }
1072
1074 $sel_style = $all_styles[$_GET["style_id"]];
1075
1076 $options = array();
1077 if (is_array($sel_style["substyle"]))
1078 {
1079 foreach ($sel_style["substyle"] as $subst)
1080 {
1081 $options[$subst["id"]] = $subst["name"];
1082 }
1083 }
1084
1085 // substyle
1086 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1087 $si = new ilSelectInputGUI($this->lng->txt("sty_substyle"), "substyle");
1088 $si->setOptions($options);
1089 $ilToolbar->addInputItem($si, true);
1090
1091 $ilToolbar->addFormButton($lng->txt("sty_add_assignment"), "addStyleCatAssignment");
1092 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1093
1094 include_once("./Services/Style/classes/class.ilSysStyleCatAssignmentTableGUI.php");
1095 $tab = new ilSysStyleCatAssignmentTableGUI($this, "assignStylesToCats");
1096
1097 $tpl->setContent($tab->getHTML());
1098 }
This class represents a selection list property in a property form.
static getAllSkinStyles()
Get all skins/styles.
TableGUI class for system style to category assignments.
if(!is_array($argv)) $options

References $_GET, $ilCtrl, ilObjectGUI\$lng, $options, $si, $tab, ilObjectGUI\$tpl, and ilStyleDefinition\getAllSkinStyles().

+ Here is the call graph for this function:

◆ cancelCreateObject()

ilObjStyleSettingsGUI::cancelCreateObject ( )

Definition at line 852 of file class.ilObjStyleSettingsGUI.php.

852 {
853 $this->viewPageLayoutsObject();
854 }
viewPageLayoutsObject()
view list of page layouts

References viewPageLayoutsObject().

+ Here is the call graph for this function:

◆ cancelDeleteObject()

ilObjStyleSettingsGUI::cancelDeleteObject ( )

cancel deletion of object

@access public

Reimplemented from ilObjectGUI.

Definition at line 556 of file class.ilObjStyleSettingsGUI.php.

557 {
558 ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
559 $this->ctrl->redirect($this, "editContentStyles");
560
561 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ cancelDeletePgObject()

ilObjStyleSettingsGUI::cancelDeletePgObject ( )

cancel deletion of Page Layout

Definition at line 693 of file class.ilObjStyleSettingsGUI.php.

694 {
695 ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
696 $this->ctrl->redirect($this, "viewPageLayouts");
697 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmDeleteIndividualStyles()

ilObjStyleSettingsGUI::confirmDeleteIndividualStyles ( )

Definition at line 222 of file class.ilObjStyleSettingsGUI.php.

223 {
224 global $ilCtrl, $tpl, $lng;
225
226 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
227
228 $ilCtrl->setParameter($this, "to_style", $_POST["to_style"]);
229
230 $cgui = new ilConfirmationGUI();
231 $cgui->setFormAction($ilCtrl->getFormAction($this));
232 $cgui->setHeaderText($lng->txt("sty_confirm_del_ind_styles").": ".
233 sprintf($this->lng->txt("sty_confirm_del_ind_styles_desc"),
234 ilObject::_lookupTitle($_POST["to_style"])));
235 $cgui->setCancel($lng->txt("cancel"), "editContentStyles");
236 $cgui->setConfirm($lng->txt("ok"), "moveIndividualStyles");
237 $tpl->setContent($cgui->getHTML());
238 }
Confirmation screen class.
static _lookupTitle($a_id)
lookup object title

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObject\_lookupTitle().

Referenced by moveLMStylesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmedDeleteObject()

ilObjStyleSettingsGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

Definition at line 414 of file class.ilObjStyleSettingsGUI.php.

415 {
416 global $ilias;
417
418 foreach($_POST["id"] as $id)
419 {
420 $this->object->removeStyle($id);
421 $style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
422 $style_obj->delete();
423 }
424 $this->object->update();
425
426 ilUtil::redirect($this->getReturnLocation("delete",
427 $this->ctrl->getLinkTarget($this,"editContentStyles","",false,false)));
428 }
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
static redirect($a_script)
http redirect to other script

References $_POST, ilObjectGUI\$ilias, ilObjectGUI\getReturnLocation(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ confirmedDeletePgObject()

ilObjStyleSettingsGUI::confirmedDeletePgObject ( )

conform deletion of Page Layout

Definition at line 702 of file class.ilObjStyleSettingsGUI.php.

703 {
704 foreach ($_POST["pglayout"] as $id)
705 {
706 $pg_obj = new ilPageLayout($id);
707 $pg_obj->delete();
708 }
709
710 $this->ctrl->redirect($this, "viewPageLayouts");
711 }

References $_POST.

◆ createPgObject()

ilObjStyleSettingsGUI::createPgObject ( )

Definition at line 807 of file class.ilObjStyleSettingsGUI.php.

808 {
809 global $ilCtrl;
810
811 $form_gui = $this->initAddPageLayoutForm();
812 if(!$form_gui->checkInput())
813 {
814 $form_gui->setValuesByPost();
815 return $this->addPageLayoutObject($form_gui);
816 }
817
818 //create Page-Layout-Object first
819 $pg_object = new ilPageLayout();
820 $pg_object->setTitle($form_gui->getInput('pgl_title'));
821 $pg_object->setDescription($form_gui->getInput('pgl_desc'));
822 $pg_object->setSpecialPage($form_gui->getInput('special_page'));
823 $pg_object->setModules($form_gui->getInput('module'));
824 $pg_object->update();
825
826 include_once("./Services/Style/classes/class.ilPageLayoutPage.php");
827
828 //create Page
829 if(!is_object($pg_content))
830 {
831 $this->pg_content = new ilPageLayoutPage();
832 }
833
834 $this->pg_content->setId($pg_object->getId());
835
836 $tmpl = $form_gui->getInput('pgl_template');
837 if ($tmpl != "-1")
838 {
839 $layout_obj = new ilPageLayout($tmpl);
840 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
841 $this->pg_content->create(false);
842 }
843 else
844 {
845 $this->pg_content->create(false);
846 }
847
848 $ilCtrl->setParameterByClass("ilpagelayoutgui", "obj_id", $pg_object->getId());
849 $ilCtrl->redirectByClass("ilpagelayoutgui", "edit");
850 }
Page layout page object.

References $ilCtrl, addPageLayoutObject(), and initAddPageLayoutForm().

+ Here is the call graph for this function:

◆ createStyleObject()

ilObjStyleSettingsGUI::createStyleObject ( )

Create new style.

Definition at line 919 of file class.ilObjStyleSettingsGUI.php.

920 {
921 global $ilCtrl;
922
923 $ilCtrl->setParameter($this, "new_type", "sty");
924 $ilCtrl->redirect($this, "create");
925 }

References $ilCtrl.

◆ deactivateObject()

ilObjStyleSettingsGUI::deactivateObject ( )

Definition at line 647 of file class.ilObjStyleSettingsGUI.php.

647 {
648 $this->activateObject(false);
649 }

References activateObject().

+ Here is the call graph for this function:

◆ deletePglObject()

ilObjStyleSettingsGUI::deletePglObject ( )

display deletion confirmation screen

Definition at line 656 of file class.ilObjStyleSettingsGUI.php.

657 {
658 global $ilTabs;
659
660 if(!isset($_POST["pglayout"]))
661 {
662 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
663 }
664
665 $ilTabs->setTabActive('page_layouts');
666 unset($this->data);
667
668 // display confirmation message
669 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
670 $cgui = new ilConfirmationGUI();
671 $cgui->setFormAction($this->ctrl->getFormAction($this));
672 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
673 $cgui->setCancel($this->lng->txt("cancel"), "cancelDeletePg");
674 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeletePg");
675
676 foreach($_POST["pglayout"] as $id)
677 {
678 $pg_obj = new ilPageLayout($id);
679 $pg_obj->readObject();
680
681 $caption = ilUtil::getImageTagByType("stys", $this->tpl->tplPath).
682 " ".$pg_obj->getTitle();
683
684 $cgui->addItem("pglayout[]", $id, $caption);
685 }
686
687 $this->tpl->setContent($cgui->getHTML());
688 }
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
redirection script todo: (a better solution should control the processing via a xml file)

References $_POST, and ilUtil\getImageTagByType().

+ Here is the call graph for this function:

◆ deleteStyleObject()

ilObjStyleSettingsGUI::deleteStyleObject (   $a_error = false)

display deletion confirmation screen

@access public

Definition at line 384 of file class.ilObjStyleSettingsGUI.php.

385 {
386 if (!isset($_POST["id"]))
387 {
388 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
389 }
390
391 // display confirmation message
392 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
393 $cgui = new ilConfirmationGUI();
394 $cgui->setFormAction($this->ctrl->getFormAction($this));
395 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
396 $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
397 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
398
399 foreach ($_POST["id"] as $id)
400 {
401 $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath).
402 " ".ilObject::_lookupTitle($id);
403
404 $cgui->addItem("id[]", $id, $caption);
405 }
406
407 $this->tpl->setContent($cgui->getHTML());
408 }

References $_POST, and ilUtil\getImageTagByType().

+ Here is the call graph for this function:

◆ deleteSysStyleCatAssignmentsObject()

ilObjStyleSettingsGUI::deleteSysStyleCatAssignmentsObject ( )

Delete system style to category assignments.

Definition at line 1162 of file class.ilObjStyleSettingsGUI.php.

1163 {
1164 global $ilCtrl, $lng, $rbacsystem;
1165
1166 if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1167 {
1168 return;
1169 }
1170
1171 $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1172 $style_arr = explode(":", $_GET["style_id"]);
1173 if (is_array($_POST["id"]))
1174 {
1175 foreach ($_POST["id"] as $id)
1176 {
1177 $id_arr = explode(":", $id);
1178 ilStyleDefinition::deleteSystemStyleCategoryAssignment($style_arr[0], $style_arr[1],
1179 $id_arr[0], $id_arr[1]);
1180 }
1181 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1182 }
1183
1184 $ilCtrl->redirect($this, "assignStylesToCats");
1185 }
deleteSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Delete category style assignment.

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, ilStyleDefinition\deleteSystemStyleCategoryAssignment(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ editContentStylesObject()

ilObjStyleSettingsGUI::editContentStylesObject ( )

view list of styles

Definition at line 115 of file class.ilObjStyleSettingsGUI.php.

116 {
117 global $rbacsystem, $ilias, $tpl, $ilToolbar, $ilCtrl, $lng;
118
119 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
120 {
121 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
122 }
123
124 // this may not be cool, if styles are organised as (independent) Service
125 include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
126 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
127
128 $from_styles = $to_styles = $data = array();
129 $styles = $this->object->getStyles();
130 foreach($styles as $style)
131 {
134 $data[$style["title"].":".$style["id"]]
135 = $style;
136 if ($style["lm_nr"] > 0)
137 {
138 $from_styles[$style["id"]] = $style["title"];
139 }
140 if ($style["active"] > 0)
141 {
142 $to_styles[$style["id"]] = $style["title"];
143 }
144 }
145
146 // number of individual styles
147 if ($fixed_style <= 0)
148 {
149 $data[-1] =
150 array("title" => $this->lng->txt("sty_individual_styles"),
151 "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsIndividualStyles());
152 $from_styles[-1] = $this->lng->txt("sty_individual_styles");
153 }
154
155 // number of default style (fallback default style)
156 if ($default_style <= 0 && $fixed_style <= 0)
157 {
158 $data[0] =
159 array("title" => $this->lng->txt("sty_default_style"),
160 "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsNoStyle());
161 $from_styles[0] = $this->lng->txt("sty_default_style");
162 $to_styles[0] = $this->lng->txt("sty_default_style");
163 }
164
165 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
166 {
167 $ilToolbar->addButton($lng->txt("sty_add_content_style"),
168 $ilCtrl->getLinkTarget($this, "createStyle"));
169 $ilToolbar->addSeparator();
170 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
171
172 // from styles selector
173 $si = new ilSelectInputGUI($lng->txt("sty_move_lm_styles").": ".$lng->txt("sty_from"), "from_style");
174 $si->setOptions($from_styles);
175 $ilToolbar->addInputItem($si, true);
176
177 // from styles selector
178 $si = new ilSelectInputGUI($lng->txt("sty_to"), "to_style");
179 $si->setOptions($to_styles);
180 $ilToolbar->addInputItem($si, true);
181 $ilToolbar->addFormButton($lng->txt("sty_move_style"), "moveLMStyles");
182
183 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
184 }
185
186 include_once("./Services/Style/classes/class.ilContentStylesTableGUI.php");
187 $table = new ilContentStylesTableGUI($this, "editContentStyles", $data, $this->object);
188 $tpl->setContent($table->getHTML());
189
190 }
_getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
_getNrLMsNoStyle()
get number of learning modules assigned no style
_getNrLMsIndividualStyles()
get number of learning modules with individual styles
_lookupActive($a_id)
Lookup active flag.
$style
Definition: example_012.php:70

References ilObjectGUI\$data, $ilCtrl, ilObjectGUI\$ilias, ilObjectGUI\$lng, $si, $style, ilObjectGUI\$tpl, ilObjContentObject\_getNrLMsIndividualStyles(), ilObjContentObject\_getNrLMsNoStyle(), ilObjContentObject\_getNrOfAssignedLMs(), and ilObjStyleSheet\_lookupActive().

+ Here is the call graph for this function:

◆ editPgObject()

ilObjStyleSettingsGUI::editPgObject ( )

Definition at line 856 of file class.ilObjStyleSettingsGUI.php.

857 {
858 global $ilCtrl, $rbacsystem;
859
860 if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
861 {
862 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
863 }
864
865 $ilCtrl->setCmdClass("ilpagelayoutgui");
866 $ilCtrl->setCmd("edit");
867 $this->executeCommand();
868 }

References $ilCtrl, and executeCommand().

+ Here is the call graph for this function:

◆ editSystemStylesObject()

ilObjStyleSettingsGUI::editSystemStylesObject ( )

edit system styles

Definition at line 243 of file class.ilObjStyleSettingsGUI.php.

244 {
245 global $rbacsystem, $ilias, $styleDefinition, $ilToolbar, $ilCtrl, $lng, $tpl;
246
247 if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
248 {
249 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
250 }
251
252 // toolbar
253
254 // default skin/style
255 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
256 {
257 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
258
259 $options = array();
260 foreach (ilStyleDefinition::getAllSkinStyles() as $st)
261 {
262 $options[$st["id"]] = $st["title"];
263 }
264
265 // from styles selector
266 $si = new ilSelectInputGUI($lng->txt("sty_move_user_styles").": ".$lng->txt("sty_from"), "from_style");
267 $si->setOptions($options + array("other" => $lng->txt("other")));
268 $ilToolbar->addInputItem($si, true);
269
270 // from styles selector
271 $si = new ilSelectInputGUI($lng->txt("sty_to"), "to_style");
272 $si->setOptions($options);
273 $ilToolbar->addInputItem($si, true);
274 $ilToolbar->addFormButton($lng->txt("sty_move_style"), "moveUserStyles");
275
276 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
277 }
278
279 include_once("./Services/Style/classes/class.ilSystemStylesTableGUI.php");
280 $tab = new ilSystemStylesTableGUI($this, "editSystemStyles");
281 $tpl->setContent($tab->getHTML());
282
283 }
TableGUI class for system styles.

References $ilCtrl, ilObjectGUI\$ilias, ilObjectGUI\$lng, $options, $si, $tab, ilObjectGUI\$tpl, and ilStyleDefinition\getAllSkinStyles().

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjStyleSettingsGUI::executeCommand ( )

Execute command.

Reimplemented from ilObjectGUI.

Definition at line 46 of file class.ilObjStyleSettingsGUI.php.

47 {
48 $next_class = $this->ctrl->getNextClass($this);
49 $cmd = $this->ctrl->getCmd();
50
51 if ($next_class == "ilpagelayoutgui" || $cmd =="createPg") {
52 $this->peditor_active =true;
53 }
54
55 $this->prepareOutput();
56
57 switch($next_class)
58 {
59 case 'ilpermissiongui':
60 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
61 $perm_gui =& new ilPermissionGUI($this);
62 $ret =& $this->ctrl->forwardCommand($perm_gui);
63 break;
64
65 case 'ilpagelayoutgui':
66 include_once("./Services/Style/classes/class.ilPageLayoutGUI.php");
67 $this->tpl->getStandardTemplate();
68 $this->ctrl->setReturn($this, "edit");
69 if ($this->pg_id!=null) {
70 $layout_gui =& new ilPageLayoutGUI($this->type,$this->pg_id);
71 } else {
72 $layout_gui =& new ilPageLayoutGUI($this->type,$_GET["obj_id"]);
73 }
74 $layout_gui->setTabs();
75 $layout_gui->setEditPreview(true);
76 $this->ctrl->saveParameter($this, "obj_id");
77 $ret =& $this->ctrl->forwardCommand($layout_gui);
78 $this->tpl->setContent($ret);
79 break;
80
81 default:
82 if ($cmd == "" || $cmd == "view")
83 {
84 $cmd = "editSystemStyles";
85 }
86 $cmd .= "Object";
87 $this->$cmd();
88
89 break;
90 }
91 return true;
92 }
prepareOutput()
prepare output
Class ilPageLayoutGUI GUI class.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ret, and ilObjectGUI\prepareOutput().

Referenced by editPgObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportLayoutObject()

ilObjStyleSettingsGUI::exportLayoutObject ( )

Export page layout template object.

Definition at line 967 of file class.ilObjStyleSettingsGUI.php.

968 {
969 include_once("./Services/Export/classes/class.ilExport.php");
970 $exp = new ilExport();
971
972 $tmpdir = ilUtil::ilTempnam();
973 ilUtil::makeDir($tmpdir);
974
975 $succ = $exp->exportEntity("pgtp", (int) $_GET["layout_id"], "4.2.0",
976 "Services/COPage", "Title", $tmpdir);
977
978 if ($succ["success"])
979 {
980 ilUtil::deliverFile($succ["directory"]."/".$succ["file"], $succ["file"],
981 "", false, false, false);
982 }
983 if (is_file($succ["directory"]."/".$succ["file"]))
984 {
985 unlink($succ["directory"]."/".$succ["file"]);
986 }
987 if (is_dir($succ["directory"]))
988 {
989 unlink($succ["directory"]);
990 }
991 }
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References $_GET, ilUtil\deliverFile(), ilUtil\ilTempnam(), and ilUtil\makeDir().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSettingsGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 876 of file class.ilObjStyleSettingsGUI.php.

877 {
878 $this->getTabs($tabs_gui);
879 }
getTabs(&$tabs_gui)
get tabs @access public

References getTabs().

+ Here is the call graph for this function:

◆ getTabs()

ilObjStyleSettingsGUI::getTabs ( $tabs_gui)

get tabs @access public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 886 of file class.ilObjStyleSettingsGUI.php.

887 {
888 global $rbacsystem, $lng, $ilTabs;
889
890 if ($this->peditor_active) {
891 $tabs_gui->setBackTarget($this->lng->txt("page_layouts"),
892 $this->ctrl->getLinkTarget($this, "viewPageLayouts"));
893 }
894
895 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()) && !$this->peditor_active)
896 {
897 $tabs_gui->addTarget("system_styles",
898 $this->ctrl->getLinkTarget($this, "editSystemStyles"), array("editSystemStyles", "", "view"), "", "");
899
900 $tabs_gui->addTarget("content_styles",
901 $this->ctrl->getLinkTarget($this, "editContentStyles"), "editContentStyles", "", "");
902
903 $tabs_gui->addTarget("page_layouts",
904 $this->ctrl->getLinkTarget($this, "viewPageLayouts"), "viewPageLayouts", "", "");
905
906 }
907
908
909 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()) && !$this->peditor_active)
910 {
911 $tabs_gui->addTarget("perm_settings",
912 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
913 }
914 }

References ilObjectGUI\$lng.

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ ilObjStyleSettingsGUI()

ilObjStyleSettingsGUI::ilObjStyleSettingsGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor.

Definition at line 26 of file class.ilObjStyleSettingsGUI.php.

27 {
28 global $lng,$ilCtrl;
29
30 $this->type = "stys";
31
32 $cmd = $ilCtrl->getCmd();
33
34 if ($cmd == "editPg") {
35 $this->peditor_active = true;
36 }
37
38 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
39
40 $lng->loadLanguageModule("style");
41 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References $cmd, $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ importPageLayoutFormObject()

ilObjStyleSettingsGUI::importPageLayoutFormObject ( )

Import page layout.

Definition at line 996 of file class.ilObjStyleSettingsGUI.php.

997 {
998 global $tpl, $ilTabs;
999
1000 $ilTabs->setTabActive('page_layouts');
1001 $form = $this->initPageLayoutImportForm();
1002 $tpl->setContent($form->getHTML());
1003 }
initPageLayoutImportForm()
Init page layout import form.

References ilObjectGUI\$tpl, and initPageLayoutImportForm().

+ Here is the call graph for this function:

◆ importPageLayoutObject()

ilObjStyleSettingsGUI::importPageLayoutObject ( )

Import page layout.

Definition at line 1033 of file class.ilObjStyleSettingsGUI.php.

1034 {
1035 global $tpl, $lng, $ilCtrl, $ilTabs;
1036
1037 $form = $this->initPageLayoutImportForm();
1038 if ($form->checkInput())
1039 {
1040 include_once("./Services/Style/classes/class.ilPageLayout.php");
1041 $pg = ilPageLayout::import($_FILES["file"]["name"], $_FILES["file"]["tmp_name"]);
1042 if ($pg > 0)
1043 {
1044 ilUtil::sendSuccess($lng->txt("sty_imported_layout"), true);
1045 }
1046 $ilCtrl->redirect($this, "viewPageLayouts");
1047 }
1048 else
1049 {
1050 $ilTabs->setTabActive('page_layouts');
1051 $form->setValuesByPost();
1052 $tpl->setContent($form->getHtml());
1053 }
1054 }
static import($a_filename, $a_filepath)
Import page layout.

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilPageLayout\import(), initPageLayoutImportForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ initAddPageLayoutForm()

ilObjStyleSettingsGUI::initAddPageLayoutForm ( )

Definition at line 727 of file class.ilObjStyleSettingsGUI.php.

728 {
729 global $lng, $ilCtrl;
730
731 $lng->loadLanguageModule("content");
732
733 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
734 $form_gui = new ilPropertyFormGUI();
735 $form_gui->setFormAction($ilCtrl->getFormAction($this));
736 $form_gui->setTitle($lng->txt("sty_create_pgl"));
737
738 $title_input = new ilTextInputGUI($lng->txt("title"),"pgl_title");
739 $title_input->setSize(50);
740 $title_input->setMaxLength(128);
741 $title_input->setValue($this->layout_object->title);
742 $title_input->setTitle($lng->txt("title"));
743 $title_input->setRequired(true);
744
745 $desc_input = new ilTextAreaInputGUI($lng->txt("description"),"pgl_desc");
746 $desc_input->setValue($this->layout_object->description);
747 $desc_input->setRows(3);
748 $desc_input->setCols(37);
749
750 // special page?
751 $options = array(
752 "0" => $lng->txt("cont_layout_template"),
753 "1" => $lng->txt("cont_special_page"),
754 );
755 $si = new ilSelectInputGUI($this->lng->txt("type"), "special_page");
756 $si->setOptions($options);
757
758 // modules
759 $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
760 // $mods->setRequired(true);
761 foreach(ilPageLayout::getAvailableModules() as $mod_id => $mod_caption)
762 {
763 $mod = new ilCheckboxOption($mod_caption, $mod_id);
764 $mods->addOption($mod);
765 }
766
767 $ttype_input = new ilSelectInputGUI($lng->txt("sty_based_on"), "pgl_template");
768
769 $arr_templates = ilPageLayout::getLayouts();
770 $arr_templates1 = ilPageLayout::getLayouts(false, true);
771 foreach ($arr_templates1 as $v)
772 {
773 $arr_templates[] = $v;
774 }
775
776 $options = array();
777 $options['-1'] = $lng->txt("none");
778
779 foreach ($arr_templates as $templ) {
780 $templ->readObject();
781 $key = $templ->getId();
782 $value = $templ->getTitle();
783 $options[$key] = $value;
784 }
785
786 $ttype_input->setOptions($options);
787 $ttype_input->setValue(-1);
788 $ttype_input->setRequired(true);
789
790 $desc_input->setTitle($lng->txt("description"));
791 $desc_input->setRequired(false);
792
793 $form_gui->addItem($title_input);
794 $form_gui->addItem($desc_input);
795 $form_gui->addItem($si);
796 $form_gui->addItem($mods);
797 $form_gui->addItem($ttype_input);
798
799
800 $form_gui->addCommandButton("createPg", $lng->txt("save"));
801 $form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
802
803 return $form_gui;
804 }
This class represents a property in a property form.
This class represents an option in a checkbox group.
static getAvailableModules()
static getLayouts($a_active=false, $a_special_page=false, $a_module=null)
Get layouts.
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $ilCtrl, ilObjectGUI\$lng, $options, $si, ilPageLayout\getAvailableModules(), and ilPageLayout\getLayouts().

Referenced by addPageLayoutObject(), and createPgObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPageLayoutImportForm()

ilObjStyleSettingsGUI::initPageLayoutImportForm ( )

Init page layout import form.

Definition at line 1008 of file class.ilObjStyleSettingsGUI.php.

1009 {
1010 global $lng, $ilCtrl;
1011
1012 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1013 $form = new ilPropertyFormGUI();
1014
1015 // template file
1016 $fi = new ilFileInputGUI($lng->txt("file"), "file");
1017 $fi->setSuffixes(array("zip"));
1018 $fi->setRequired(true);
1019 $form->addItem($fi);
1020
1021 $form->addCommandButton("importPageLayout", $lng->txt("import"));
1022 $form->addCommandButton("viewPageLayouts", $lng->txt("cancel"));
1023
1024 $form->setTitle($lng->txt("sty_import_page_layout"));
1025 $form->setFormAction($ilCtrl->getFormAction($this));
1026
1027 return $form;
1028 }
This class represents a file property in a property form.

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by importPageLayoutFormObject(), and importPageLayoutObject().

+ Here is the caller graph for this function:

◆ moveIndividualStylesObject()

ilObjStyleSettingsGUI::moveIndividualStylesObject ( )

move all learning modules with individual styles to new style

Definition at line 212 of file class.ilObjStyleSettingsGUI.php.

213 {
214 include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
216 $this->ctrl->redirect($this, "editContentStyles");
217 }
_moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another

References $_GET, and ilObjContentObject\_moveLMStyles().

+ Here is the call graph for this function:

◆ moveLMStylesObject()

ilObjStyleSettingsGUI::moveLMStylesObject ( )

move learning modules from one style to another

Definition at line 195 of file class.ilObjStyleSettingsGUI.php.

196 {
197 if ($_POST["from_style"] == -1)
198 {
200 return;
201 }
202
203 include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
204 ilObjContentObject::_moveLMStyles($_POST["from_style"], $_POST["to_style"]);
205 $this->ctrl->redirect($this, "editContentStyles");
206 }

References $_POST, ilObjContentObject\_moveLMStyles(), and confirmDeleteIndividualStyles().

+ Here is the call graph for this function:

◆ moveUserStylesObject()

ilObjStyleSettingsGUI::moveUserStylesObject ( )

Move user styles.

Parameters

return

Definition at line 345 of file class.ilObjStyleSettingsGUI.php.

346 {
347 global $ilCtrl, $lng;
348
349 $to = explode(":", $_POST["to_style"]);
350
351 if ($_POST["from_style"] != "other")
352 {
353 $from = explode(":", $_POST["from_style"]);
354 ilObjUser::_moveUsersToStyle($from[0],$from[1],$to[0],$to[1]);
355 }
356 else
357 {
358 // get all user assigned styles
359 $all_user_styles = ilObjUser::_getAllUserAssignedStyles();
360
361 // move users that are not assigned to
362 // currently existing style
363 foreach($all_user_styles as $style)
364 {
365 if (!in_array($style, $all_styles))
366 {
367 $style_arr = explode(":", $style);
368 ilObjUser::_moveUsersToStyle($style_arr[0],$style_arr[1],$to[0],$to[1]);
369 }
370 }
371 }
372
373 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
374 $ilCtrl->redirect($this , "editSystemStyles");
375 }
_moveUsersToStyle($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
skins and styles
_getAllUserAssignedStyles()
skins and styles

References $_POST, $ilCtrl, ilObjectGUI\$lng, $style, ilObjUser\_getAllUserAssignedStyles(), ilObjUser\_moveUsersToStyle(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveActiveStylesObject()

ilObjStyleSettingsGUI::saveActiveStylesObject ( )

Save active styles.

Definition at line 484 of file class.ilObjStyleSettingsGUI.php.

485 {
486 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
487 $styles = $this->object->getStyles();
488 foreach($styles as $style)
489 {
490 if ($_POST["std_".$style["id"]] == 1)
491 {
493 }
494 else
495 {
497 }
498 }
499 ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
500 }
_writeActive($a_id, $a_active)
Write active flag.

References $_POST, $style, ilObjStyleSheet\_writeActive(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ saveObject()

ilObjStyleSettingsGUI::saveObject ( )

Save object.

Reimplemented from ilObjectGUI.

Definition at line 97 of file class.ilObjStyleSettingsGUI.php.

98 {
99 global $rbacadmin;
100
101 // create and insert forum in objecttree
102 $newObj = parent::saveObject();
103
104 // put here object specific stuff
105
106 // always send a message
107 ilUtil::sendInfo($this->lng->txt("object_added"),true);
108
109 ilUtil::redirect($this->getReturnLocation("save",$this->ctrl->getLinkTarget($this,"","",false,false)));
110 }

References ilObjectGUI\getReturnLocation(), ilUtil\redirect(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ savePageLayoutTypesObject()

ilObjStyleSettingsGUI::savePageLayoutTypesObject ( )

Save page layout types.

Definition at line 930 of file class.ilObjStyleSettingsGUI.php.

931 {
932 global $lng, $ilCtrl;
933
934 include_once("./Services/Style/classes/class.ilPageLayout.php");
935
936 if (is_array($_POST["type"]))
937 {
938 foreach($_POST["type"] as $id => $t)
939 {
940 if ($id > 0)
941 {
942 $l = new ilPageLayout($id);
943 $l->readObject();
944 $l->setSpecialPage($t);
945 if(is_array($_POST["module"][$id]))
946 {
947 $l->setModules(array_keys($_POST["module"][$id]));
948 }
949 else
950 {
951 $l->setModules();
952 }
953 $l->update();
954 }
955 }
956
957 ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
958 }
959
960 $ilCtrl->redirect($this, "viewPageLayouts");
961 }
global $l
Definition: afr.php:30

References $_POST, $ilCtrl, $l, ilObjectGUI\$lng, $t, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveScopeObject()

ilObjStyleSettingsGUI::saveScopeObject ( )

Save scope for style.

Definition at line 587 of file class.ilObjStyleSettingsGUI.php.

588 {
589 global $tree;
590
591 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
592 if ($_GET["cat"] == $tree->readRootId())
593 {
594 $_GET["cat"] = "";
595 }
597
598 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
599
600 ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
601 }
_writeScope($a_id, $a_scope)
Write scope.

References $_GET, ilObjectGUI\$tree, ilObjStyleSheet\_writeScope(), ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveStyleCatAssignmentObject()

ilObjStyleSettingsGUI::saveStyleCatAssignmentObject ( )

Save style category assignment.

Parameters

return

Definition at line 1140 of file class.ilObjStyleSettingsGUI.php.

1141 {
1142 global $lng, $ilCtrl, $rbacsystem;
1143
1144 if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1145 {
1146 return;
1147 }
1148
1149 $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1150
1151 $style_arr = explode(":", $_GET["style_id"]);
1152 ilStyleDefinition::writeSystemStyleCategoryAssignment($style_arr[0], $style_arr[1],
1153 $_GET["substyle"], $_GET["root_id"]);
1154 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1155
1156 $ilCtrl->redirect($this, "assignStylesToCats");
1157 }
writeSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Write category assignment.

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilUtil\sendSuccess(), and ilStyleDefinition\writeSystemStyleCategoryAssignment().

+ Here is the call graph for this function:

◆ saveStyleSettingsObject()

ilObjStyleSettingsGUI::saveStyleSettingsObject ( )

save skin and style settings

Definition at line 289 of file class.ilObjStyleSettingsGUI.php.

290 {
291 global $styleDefinition, $ilCtrl;
292
293 // check if one style is activated
294 if (count($_POST["st_act"]) < 1)
295 {
296 $this->ilias->raiseError($this->lng->txt("at_least_one_style"), $this->ilias->error_obj->MESSAGE);
297 }
298
299 //set default skin and style
300 if ($_POST["default_skin_style"] != "")
301 {
302 $sknst = explode(":", $_POST["default_skin_style"]);
303
304 if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
305 $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
306 {
307 $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
308 $this->ilias->ini->setVariable("layout","style",$sknst[1]);
309 }
310 $this->ilias->ini->write();
311 }
312
313 // check if a style should be deactivated, that still has
314 // a user assigned to
316 foreach ($all_styles as $st)
317 {
318 if (!isset($_POST["st_act"][$st["id"]]))
319 {
320 if (ilObjUser::_getNumberOfUsersForStyle($st["template_id"], $st["style_id"]) > 1)
321 {
322 $this->ilias->raiseError($this->lng->txt("cant_deactivate_if_users_assigned"), $this->ilias->error_obj->MESSAGE);
323 }
324 else
325 {
326 ilObjStyleSettings::_deactivateStyle($st["template_id"], $st["style_id"]);
327 }
328 }
329 else
330 {
331 ilObjStyleSettings::_activateStyle($st["template_id"], $st["style_id"]);
332 }
333 }
334
335 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
336 $ilCtrl->redirect($this , "editSystemStyles");
337 }
_deactivateStyle($a_skin, $a_style)
deactivate style
_activateStyle($a_skin, $a_style)
activate style
_getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles

References $_POST, $ilCtrl, ilObjStyleSettings\_activateStyle(), ilObjStyleSettings\_deactivateStyle(), ilObjUser\_getNumberOfUsersForStyle(), ilStyleDefinition\getAllSkinStyles(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setScopeObject()

ilObjStyleSettingsGUI::setScopeObject ( )

Set scope.

Parameters

return

Definition at line 569 of file class.ilObjStyleSettingsGUI.php.

570 {
571 global $tpl, $ilCtrl;
572
573 $ilCtrl->saveParameter($this, "id");
574 include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
575 $exp = new ilRepositorySelectorExplorerGUI($this, "setScope",
576 $this, "saveScope", "cat");
577 $exp->setTypeWhiteList(array("root", "cat"));
578 if (!$exp->handleCommand())
579 {
580 $tpl->setContent($exp->getHTML());
581 }
582 }
Explorer for selecting repository items.

References $ilCtrl, and ilObjectGUI\$tpl.

◆ setTabs()

ilObjStyleSettingsGUI::setTabs ( )

set admin tabs @access public

Reimplemented from ilObjectGUI.

Definition at line 871 of file class.ilObjStyleSettingsGUI.php.

872 {
873 echo "settings_setTabs";
874 }

◆ showActions()

ilObjStyleSettingsGUI::showActions (   $with_subobjects = false)

show possible action (form buttons)

Parameters
boolean@access public

Definition at line 508 of file class.ilObjStyleSettingsGUI.php.

509 {
510
511 // delete
512 $this->tpl->setCurrentBlock("tbl_action_btn");
513 $this->tpl->setVariable("BTN_NAME", "deleteStyle");
514 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
515 $this->tpl->parseCurrentBlock();
516
517 // set global default
518 $this->tpl->setCurrentBlock("tbl_action_btn");
519 $this->tpl->setVariable("BTN_NAME", "toggleGlobalDefault");
520 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalDefault"));
521 $this->tpl->parseCurrentBlock();
522
523 // set global default
524 $this->tpl->setCurrentBlock("tbl_action_btn");
525 $this->tpl->setVariable("BTN_NAME", "toggleGlobalFixed");
526 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalFixed"));
527 $this->tpl->parseCurrentBlock();
528
529 // set global default
530 $this->tpl->setCurrentBlock("tbl_action_btn");
531 $this->tpl->setVariable("BTN_NAME", "setScope");
532 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("sty_set_scope"));
533 $this->tpl->parseCurrentBlock();
534
535 // save active styles
536 $this->tpl->setCurrentBlock("tbl_action_btn");
537 $this->tpl->setVariable("BTN_NAME", "saveActiveStyles");
538 $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("sty_save_active_styles"));
539 $this->tpl->parseCurrentBlock();
540
541 if ($with_subobjects === true)
542 {
543 $this->showPossibleSubObjects();
544 }
545
546 $this->tpl->setCurrentBlock("tbl_action_row");
547 $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
548 $this->tpl->parseCurrentBlock();
549 }
showPossibleSubObjects()
show possible subobjects (pulldown menu)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath(), and ilObjectGUI\showPossibleSubObjects().

+ Here is the call graph for this function:

◆ toggleGlobalDefaultObject()

ilObjStyleSettingsGUI::toggleGlobalDefaultObject ( )

Toggle global default style.

Definition at line 434 of file class.ilObjStyleSettingsGUI.php.

435 {
436 global $ilSetting, $lng;
437
438 if ($_GET["id"] > 0)
439 {
440 $ilSetting->delete("fixed_content_style_id");
441 $def_style = $ilSetting->get("default_content_style_id");
442
443 if ($def_style != $_GET["id"])
444 {
445 $ilSetting->set("default_content_style_id", (int) $_GET["id"]);
446 }
447 else
448 {
449 $ilSetting->delete("default_content_style_id");
450 }
451 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
452 }
453 ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
454 }
global $ilSetting
Definition: privfeed.php:40

References $_GET, $ilSetting, ilObjectGUI\$lng, ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ toggleGlobalFixedObject()

ilObjStyleSettingsGUI::toggleGlobalFixedObject ( )

Toggle global fixed style.

Definition at line 459 of file class.ilObjStyleSettingsGUI.php.

460 {
461 global $ilSetting, $lng;
462
463 if ($_GET["id"] > 0)
464 {
465 $ilSetting->delete("default_content_style_id");
466 $fixed_style = $ilSetting->get("fixed_content_style_id");
467 if ($fixed_style == (int) $_GET["id"])
468 {
469 $ilSetting->delete("fixed_content_style_id");
470 }
471 else
472 {
473 $ilSetting->set("fixed_content_style_id", (int) $_GET["id"]);
474 }
475 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
476 }
477 ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
478 }

References $_GET, $ilSetting, ilObjectGUI\$lng, ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ viewPageLayoutsObject()

ilObjStyleSettingsGUI::viewPageLayoutsObject ( )

view list of page layouts

Definition at line 607 of file class.ilObjStyleSettingsGUI.php.

608 {
609 global $tpl, $lng, $ilCtrl, $ilTabs, $ilToolbar, $rbacsystem;
610
611 $ilTabs->setTabActive('page_layouts');
612
613 // show toolbar, if write permission is given
614 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
615 {
616 $ilToolbar->addButton($lng->txt("sty_add_pgl"),
617 $ilCtrl->getLinkTarget($this, "addPageLayout"));
618 $ilToolbar->addButton($lng->txt("sty_import_page_layout"),
619 $ilCtrl->getLinkTarget($this, "importPageLayoutForm"));
620 }
621
622 $oa_tpl = new ilTemplate("tpl.stys_pglayout.html", true, true, "Services/Style");
623
624 include_once("./Services/Style/classes/class.ilPageLayoutTableGUI.php");
625 $pglayout_table = new ilPageLayoutTableGUI($this, "viewPageLayouts");
626 $oa_tpl->setVariable("PGLAYOUT_TABLE", $pglayout_table->getHTML());
627 $tpl->setContent($oa_tpl->get());
628
629 }
TableGUI class for page layouts.
special template class to simplify handling of ITX/PEAR

References $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\$tpl.

Referenced by cancelCreateObject().

+ Here is the caller graph for this function:

Field Documentation

◆ $peditor_active

ilObjStyleSettingsGUI::$peditor_active = false

Definition at line 20 of file class.ilObjStyleSettingsGUI.php.

◆ $pg_id

ilObjStyleSettingsGUI::$pg_id = null

Definition at line 21 of file class.ilObjStyleSettingsGUI.php.


The documentation for this class was generated from the following file: