ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 getAdminTabs (&$tabs_gui)
 
 getTabs (&$tabs_gui)
 get tabs 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 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 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...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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)
 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...
 

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$

ilObjStyleSettingsGUI: ilPermissionGUI, ilPageLayoutGUI

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

Member Function Documentation

◆ activateObject()

ilObjStyleSettingsGUI::activateObject (   $a_activate = true)

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

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

Referenced by deactivateObject().

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

References initAddPageLayoutForm().

Referenced by createPgObject().

715  {
716  global $ilTabs;
717 
718  $ilTabs->setTabActive('page_layouts');
719 
720  if(!$a_form)
721  {
722  $a_form = $this->initAddPageLayoutForm();
723  }
724 
725  $this->tpl->setContent($a_form->getHTML());
726  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStyleCatAssignmentObject()

ilObjStyleSettingsGUI::addStyleCatAssignmentObject ( )

Add style category assignment.

Parameters

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

References $_GET, $_REQUEST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\$tree, and ilExplorer\setExpand().

1109  {
1110  global $ilCtrl, $ilTabs, $lng, $tree, $tpl, $rbacsystem;
1111 
1112  if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1113  {
1114  return;
1115  }
1116 
1117  $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1118  $ilCtrl->setParameter($this, "substyle", urlencode($_REQUEST["substyle"]));
1119 
1120  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
1121  $exp = new ilSearchRootSelector(
1122  $ilCtrl->getLinkTarget($this,'addStyleCatAssignment'));
1123  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
1124  $exp->setExpandTarget($ilCtrl->getLinkTarget($this,'addStyleCatAssignment'));
1125  $exp->setTargetClass(get_class($this));
1126  $exp->setCmd('saveStyleCatAssignment');
1127  $exp->setClickableTypes(array("cat"));
1128 
1129  // build html-output
1130  $exp->setOutput(0);
1131  $tpl->setContent($exp->getOutput());
1132  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
+ Here is the call graph for this function:

◆ assignStylesToCatsObject()

ilObjStyleSettingsGUI::assignStylesToCatsObject ( )

Assign styles to cats.

Parameters

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

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

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

◆ cancelCreateObject()

ilObjStyleSettingsGUI::cancelCreateObject ( )

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

References viewPageLayoutsObject().

853  {
854  $this->viewPageLayoutsObject();
855  }
viewPageLayoutsObject()
view list of page layouts
+ Here is the call graph for this function:

◆ cancelDeleteObject()

ilObjStyleSettingsGUI::cancelDeleteObject ( )

cancel deletion of object

public

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

References ilUtil\sendInfo().

558  {
559  ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
560  $this->ctrl->redirect($this, "editContentStyles");
561 
562  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ cancelDeletePgObject()

ilObjStyleSettingsGUI::cancelDeletePgObject ( )

cancel deletion of Page Layout

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

References ilUtil\sendInfo().

695  {
696  ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
697  $this->ctrl->redirect($this, "viewPageLayouts");
698  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ confirmDeleteIndividualStyles()

ilObjStyleSettingsGUI::confirmDeleteIndividualStyles ( )

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

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

Referenced by moveLMStylesObject().

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

◆ confirmedDeleteObject()

ilObjStyleSettingsGUI::confirmedDeleteObject ( )

delete selected style objects

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

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

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

◆ confirmedDeletePgObject()

ilObjStyleSettingsGUI::confirmedDeletePgObject ( )

conform deletion of Page Layout

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

References $_POST.

704  {
705  foreach ($_POST["pglayout"] as $id)
706  {
707  $pg_obj = new ilPageLayout($id);
708  $pg_obj->delete();
709  }
710 
711  $this->ctrl->redirect($this, "viewPageLayouts");
712  }
$_POST['username']
Definition: cron.php:12
Class ilPageLayout.

◆ createPgObject()

ilObjStyleSettingsGUI::createPgObject ( )

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

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

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

◆ createStyleObject()

ilObjStyleSettingsGUI::createStyleObject ( )

Create new style.

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

References $ilCtrl.

921  {
922  global $ilCtrl;
923 
924  $ilCtrl->setParameter($this, "new_type", "sty");
925  $ilCtrl->redirect($this, "create");
926  }
global $ilCtrl
Definition: ilias.php:18

◆ deactivateObject()

ilObjStyleSettingsGUI::deactivateObject ( )

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

References activateObject().

648  {
649  $this->activateObject(false);
650  }
+ Here is the call graph for this function:

◆ deletePglObject()

ilObjStyleSettingsGUI::deletePglObject ( )

display deletion confirmation screen

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

References $_POST, and ilUtil\getImageTagByType().

658  {
659  global $ilTabs;
660 
661  if(!isset($_POST["pglayout"]))
662  {
663  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
664  }
665 
666  $ilTabs->setTabActive('page_layouts');
667  unset($this->data);
668 
669  // display confirmation message
670  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
671  $cgui = new ilConfirmationGUI();
672  $cgui->setFormAction($this->ctrl->getFormAction($this));
673  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
674  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeletePg");
675  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeletePg");
676 
677  foreach($_POST["pglayout"] as $id)
678  {
679  $pg_obj = new ilPageLayout($id);
680  $pg_obj->readObject();
681 
682  $caption = ilUtil::getImageTagByType("stys", $this->tpl->tplPath).
683  " ".$pg_obj->getTitle();
684 
685  $cgui->addItem("pglayout[]", $id, $caption);
686  }
687 
688  $this->tpl->setContent($cgui->getHTML());
689  }
$_POST['username']
Definition: cron.php:12
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...
Class ilPageLayout.
redirection script todo: (a better solution should control the processing via a xml file) ...
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteStyleObject()

ilObjStyleSettingsGUI::deleteStyleObject (   $a_error = false)

display deletion confirmation screen

public

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

References $_POST, and ilUtil\getImageTagByType().

386  {
387  if (!isset($_POST["id"]))
388  {
389  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
390  }
391 
392  // display confirmation message
393  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
394  $cgui = new ilConfirmationGUI();
395  $cgui->setFormAction($this->ctrl->getFormAction($this));
396  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
397  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
398  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
399 
400  foreach ($_POST["id"] as $id)
401  {
402  $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath).
403  " ".ilObject::_lookupTitle($id);
404 
405  $cgui->addItem("id[]", $id, $caption);
406  }
407 
408  $this->tpl->setContent($cgui->getHTML());
409  }
$_POST['username']
Definition: cron.php:12
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) ...
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteSysStyleCatAssignmentsObject()

ilObjStyleSettingsGUI::deleteSysStyleCatAssignmentsObject ( )

Delete system style to category assignments.

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

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

1164  {
1165  global $ilCtrl, $lng, $rbacsystem;
1166 
1167  if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1168  {
1169  return;
1170  }
1171 
1172  $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1173  $style_arr = explode(":", $_GET["style_id"]);
1174  if (is_array($_POST["id"]))
1175  {
1176  foreach ($_POST["id"] as $id)
1177  {
1178  $id_arr = explode(":", $id);
1179  ilStyleDefinition::deleteSystemStyleCategoryAssignment($style_arr[0], $style_arr[1],
1180  $id_arr[0], $id_arr[1]);
1181  }
1182  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1183  }
1184 
1185  $ilCtrl->redirect($this, "assignStylesToCats");
1186  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
deleteSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Delete category style assignment.
+ Here is the call graph for this function:

◆ editContentStylesObject()

ilObjStyleSettingsGUI::editContentStylesObject ( )

view list of styles

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

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

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 
131  foreach($styles as $style)
132  {
133  $style["active"] = ilObjStyleSheet::_lookupActive($style["id"]);
134  $style["lm_nr"] = ilObjContentObject::_getNrOfAssignedLMs($style["id"]);
135  $data[$style["title"].":".$style["id"]]
136  = $style;
137  if ($style["lm_nr"] > 0)
138  {
139  $from_styles[$style["id"]] = $style["title"];
140  }
141  if ($style["active"] > 0)
142  {
143  $to_styles[$style["id"]] = $style["title"];
144  }
145  }
146 
147  // number of individual styles
148  if ($fixed_style <= 0)
149  {
150  $data[-1] =
151  array("title" => $this->lng->txt("sty_individual_styles"),
152  "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsIndividualStyles());
153  $from_styles[-1] = $this->lng->txt("sty_individual_styles");
154  }
155 
156  // number of default style (fallback default style)
157  if ($default_style <= 0 && $fixed_style <= 0)
158  {
159  $data[0] =
160  array("title" => $this->lng->txt("sty_default_style"),
161  "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsNoStyle());
162  $from_styles[0] = $this->lng->txt("sty_default_style");
163  $to_styles[0] = $this->lng->txt("sty_default_style");
164  }
165 
166  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
167  {
168  $ilToolbar->addButton($lng->txt("sty_add_content_style"),
169  $ilCtrl->getLinkTarget($this, "createStyle"));
170  $ilToolbar->addSeparator();
171  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
172 
173  // from styles selector
174  $si = new ilSelectInputGUI($lng->txt("sty_move_lm_styles").": ".$lng->txt("sty_from"), "from_style");
175  $si->setOptions($from_styles);
176  $ilToolbar->addInputItem($si, true);
177 
178  // from styles selector
179  $si = new ilSelectInputGUI($lng->txt("sty_to"), "to_style");
180  $si->setOptions($to_styles);
181  $ilToolbar->addInputItem($si, true);
182  $ilToolbar->addFormButton($lng->txt("sty_move_style"), "moveLMStyles");
183 
184  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
185  }
186 
187  include_once("./Services/Style/classes/class.ilContentStylesTableGUI.php");
188  $table = new ilContentStylesTableGUI($this, "editContentStyles", $data, $this->object);
189  $tpl->setContent($table->getHTML());
190 
191  }
This class represents a selection list property in a property form.
_lookupActive($a_id)
Lookup active flag.
global $ilCtrl
Definition: ilias.php:18
_getNrLMsIndividualStyles()
get number of learning modules with individual styles
redirection script todo: (a better solution should control the processing via a xml file) ...
_getNrLMsNoStyle()
get number of learning modules assigned no style
_getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
+ Here is the call graph for this function:

◆ editPgObject()

ilObjStyleSettingsGUI::editPgObject ( )

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

References $ilCtrl, and executeCommand().

858  {
859  global $ilCtrl, $rbacsystem;
860 
861  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
862  {
863  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
864  }
865 
866  $ilCtrl->setCmdClass("ilpagelayoutgui");
867  $ilCtrl->setCmd("edit");
868  $this->executeCommand();
869  }
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
& executeCommand()
Execute command.
+ Here is the call graph for this function:

◆ editSystemStylesObject()

ilObjStyleSettingsGUI::editSystemStylesObject ( )

edit system styles

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

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

245  {
246  global $rbacsystem, $ilias, $styleDefinition, $ilToolbar, $ilCtrl, $lng, $tpl;
247 
248  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
249  {
250  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
251  }
252 
253  // toolbar
254 
255  // default skin/style
256  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
257  {
258  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
259 
260  $options = array();
261  foreach (ilStyleDefinition::getAllSkinStyles() as $st)
262  {
263  $options[$st["id"]] = $st["title"];
264  }
265 
266  // from styles selector
267  $si = new ilSelectInputGUI($lng->txt("sty_move_user_styles").": ".$lng->txt("sty_from"), "from_style");
268  $si->setOptions($options + array("other" => $lng->txt("other")));
269  $ilToolbar->addInputItem($si, true);
270 
271  // from styles selector
272  $si = new ilSelectInputGUI($lng->txt("sty_to"), "to_style");
273  $si->setOptions($options);
274  $ilToolbar->addInputItem($si, true);
275  $ilToolbar->addFormButton($lng->txt("sty_move_style"), "moveUserStyles");
276 
277  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
278  }
279 
280  include_once("./Services/Style/classes/class.ilSystemStylesTableGUI.php");
281  $tab = new ilSystemStylesTableGUI($this, "editSystemStyles");
282  $tpl->setContent($tab->getHTML());
283 
284  }
This class represents a selection list property in a property form.
global $ilCtrl
Definition: ilias.php:18
static getAllSkinStyles()
Get all skins/styles.
if(!is_array($argv)) $options
redirection script todo: (a better solution should control the processing via a xml file) ...
TableGUI class for system styles.
+ Here is the call graph for this function:

◆ executeCommand()

& ilObjStyleSettingsGUI::executeCommand ( )

Execute command.

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

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

Referenced by editPgObject().

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  }
$_GET["client_id"]
Class ilPageLayoutGUI GUI class.
$cmd
Definition: sahs_server.php:35
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ 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 968 of file class.ilObjStyleSettingsGUI.php.

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

969  {
970  include_once("./Services/Export/classes/class.ilExport.php");
971  $exp = new ilExport();
972 
973  $tmpdir = ilUtil::ilTempnam();
974  ilUtil::makeDir($tmpdir);
975 
976  $succ = $exp->exportEntity("pgtp", (int) $_GET["layout_id"], "4.2.0",
977  "Services/COPage", "Title", $tmpdir);
978 
979  if ($succ["success"])
980  {
981  ilUtil::deliverFile($succ["directory"]."/".$succ["file"], $succ["file"],
982  "", false, false, false);
983  }
984  if (is_file($succ["directory"]."/".$succ["file"]))
985  {
986  unlink($succ["directory"]."/".$succ["file"]);
987  }
988  if (is_dir($succ["directory"]))
989  {
990  unlink($succ["directory"]);
991  }
992  }
$_GET["client_id"]
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 ...
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSettingsGUI::getAdminTabs ( $tabs_gui)

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

References getTabs().

878  {
879  $this->getTabs($tabs_gui);
880  }
getTabs(&$tabs_gui)
get tabs public
+ Here is the call graph for this function:

◆ getTabs()

ilObjStyleSettingsGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

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

References ilObjectGUI\$lng.

Referenced by getAdminTabs().

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

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

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  }
$cmd
Definition: sahs_server.php:35
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ importPageLayoutFormObject()

ilObjStyleSettingsGUI::importPageLayoutFormObject ( )

Import page layout.

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

References ilObjectGUI\$tpl, and initPageLayoutImportForm().

998  {
999  global $tpl, $ilTabs;
1000 
1001  $ilTabs->setTabActive('page_layouts');
1002  $form = $this->initPageLayoutImportForm();
1003  $tpl->setContent($form->getHTML());
1004  }
initPageLayoutImportForm()
Init page layout import form.
+ Here is the call graph for this function:

◆ importPageLayoutObject()

ilObjStyleSettingsGUI::importPageLayoutObject ( )

Import page layout.

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

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

1035  {
1036  global $tpl, $lng, $ilCtrl, $ilTabs;
1037 
1038  $form = $this->initPageLayoutImportForm();
1039  if ($form->checkInput())
1040  {
1041  include_once("./Services/Style/classes/class.ilPageLayout.php");
1042  $pg = ilPageLayout::import($_FILES["file"]["name"], $_FILES["file"]["tmp_name"]);
1043  if ($pg > 0)
1044  {
1045  ilUtil::sendSuccess($lng->txt("sty_imported_layout"), true);
1046  }
1047  $ilCtrl->redirect($this, "viewPageLayouts");
1048  }
1049  else
1050  {
1051  $ilTabs->setTabActive('page_layouts');
1052  $form->setValuesByPost();
1053  $tpl->setContent($form->getHtml());
1054  }
1055  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static import($a_filename, $a_filepath)
Import page layout.
initPageLayoutImportForm()
Init page layout import form.
+ Here is the call graph for this function:

◆ initAddPageLayoutForm()

ilObjStyleSettingsGUI::initAddPageLayoutForm ( )

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

References $ilCtrl, ilObjectGUI\$lng, $options, $si, ilPageLayout\getAvailableModules(), ilPageLayout\getLayouts(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setSize(), and ilTextAreaInputGUI\setValue().

Referenced by addPageLayoutObject(), and createPgObject().

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

References $ilCtrl, ilObjectGUI\$lng, and ilFileInputGUI\setSuffixes().

Referenced by importPageLayoutFormObject(), and importPageLayoutObject().

1010  {
1011  global $lng, $ilCtrl;
1012 
1013  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1014  $form = new ilPropertyFormGUI();
1015 
1016  // template file
1017  $fi = new ilFileInputGUI($lng->txt("file"), "file");
1018  $fi->setSuffixes(array("zip"));
1019  $fi->setRequired(true);
1020  $form->addItem($fi);
1021 
1022  $form->addCommandButton("importPageLayout", $lng->txt("import"));
1023  $form->addCommandButton("viewPageLayouts", $lng->txt("cancel"));
1024 
1025  $form->setTitle($lng->txt("sty_import_page_layout"));
1026  $form->setFormAction($ilCtrl->getFormAction($this));
1027 
1028  return $form;
1029  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $ilCtrl
Definition: ilias.php:18
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveIndividualStylesObject()

ilObjStyleSettingsGUI::moveIndividualStylesObject ( )

move all learning modules with individual styles to new style

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

References $_GET, and ilObjContentObject\_moveLMStyles().

214  {
215  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
216  ilObjContentObject::_moveLMStyles(-1, $_GET["to_style"]);
217  $this->ctrl->redirect($this, "editContentStyles");
218  }
$_GET["client_id"]
_moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
+ Here is the call graph for this function:

◆ moveLMStylesObject()

ilObjStyleSettingsGUI::moveLMStylesObject ( )

move learning modules from one style to another

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

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

197  {
198  if ($_POST["from_style"] == -1)
199  {
201  return;
202  }
203 
204  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
205  ilObjContentObject::_moveLMStyles($_POST["from_style"], $_POST["to_style"]);
206  $this->ctrl->redirect($this, "editContentStyles");
207  }
$_POST['username']
Definition: cron.php:12
_moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
+ Here is the call graph for this function:

◆ moveUserStylesObject()

ilObjStyleSettingsGUI::moveUserStylesObject ( )

Move user styles.

Parameters

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

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

347  {
348  global $ilCtrl, $lng;
349 
350  $to = explode(":", $_POST["to_style"]);
351 
352  if ($_POST["from_style"] != "other")
353  {
354  $from = explode(":", $_POST["from_style"]);
355  ilObjUser::_moveUsersToStyle($from[0],$from[1],$to[0],$to[1]);
356  }
357  else
358  {
359  // get all user assigned styles
360  $all_user_styles = ilObjUser::_getAllUserAssignedStyles();
361 
362  // move users that are not assigned to
363  // currently existing style
364  foreach($all_user_styles as $style)
365  {
366  if (!in_array($style, $all_styles))
367  {
368  $style_arr = explode(":", $style);
369  ilObjUser::_moveUsersToStyle($style_arr[0],$style_arr[1],$to[0],$to[1]);
370  }
371  }
372  }
373 
374  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
375  $ilCtrl->redirect($this , "editSystemStyles");
376  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
_moveUsersToStyle($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
skins and styles
global $ilCtrl
Definition: ilias.php:18
_getAllUserAssignedStyles()
skins and styles
+ Here is the call graph for this function:

◆ saveActiveStylesObject()

ilObjStyleSettingsGUI::saveActiveStylesObject ( )

Save active styles.

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

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

486  {
487  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
488  $styles = $this->object->getStyles();
489  foreach($styles as $style)
490  {
491  if ($_POST["std_".$style["id"]] == 1)
492  {
493  ilObjStyleSheet::_writeActive((int) $style["id"], 1);
494  }
495  else
496  {
497  ilObjStyleSheet::_writeActive((int) $style["id"], 0);
498  }
499  }
500  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
501  }
$_POST['username']
Definition: cron.php:12
_writeActive($a_id, $a_active)
Write active flag.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ saveObject()

ilObjStyleSettingsGUI::saveObject ( )

Save object.

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

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

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  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static redirect($a_script)
http redirect to other script
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
+ Here is the call graph for this function:

◆ savePageLayoutTypesObject()

ilObjStyleSettingsGUI::savePageLayoutTypesObject ( )

Save page layout types.

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

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

932  {
933  global $lng, $ilCtrl;
934 
935  include_once("./Services/Style/classes/class.ilPageLayout.php");
936 
937  if (is_array($_POST["type"]))
938  {
939  foreach($_POST["type"] as $id => $t)
940  {
941  if ($id > 0)
942  {
943  $l = new ilPageLayout($id);
944  $l->readObject();
945  $l->setSpecialPage($t);
946  if(is_array($_POST["module"][$id]))
947  {
948  $l->setModules(array_keys($_POST["module"][$id]));
949  }
950  else
951  {
952  $l->setModules();
953  }
954  $l->update();
955  }
956  }
957 
958  ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
959  }
960 
961  $ilCtrl->redirect($this, "viewPageLayouts");
962  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
Class ilPageLayout.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveScopeObject()

ilObjStyleSettingsGUI::saveScopeObject ( )

Save scope for style.

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

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

589  {
590  global $tree;
591 
592  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
593  if ($_GET["cat"] == $tree->readRootId())
594  {
595  $_GET["cat"] = "";
596  }
598 
599  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
600 
601  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
602  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
_writeScope($a_id, $a_scope)
Write scope.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ saveStyleCatAssignmentObject()

ilObjStyleSettingsGUI::saveStyleCatAssignmentObject ( )

Save style category assignment.

Parameters

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

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

1142  {
1143  global $lng, $ilCtrl, $rbacsystem;
1144 
1145  if (!$rbacsystem->checkAccess("write", $this->object->getRefId()))
1146  {
1147  return;
1148  }
1149 
1150  $ilCtrl->setParameter($this, "style_id", urlencode($_GET["style_id"]));
1151 
1152  $style_arr = explode(":", $_GET["style_id"]);
1153  ilStyleDefinition::writeSystemStyleCategoryAssignment($style_arr[0], $style_arr[1],
1154  $_GET["substyle"], $_GET["root_id"]);
1155  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1156 
1157  $ilCtrl->redirect($this, "assignStylesToCats");
1158  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
writeSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Write category assignment.
+ Here is the call graph for this function:

◆ saveStyleSettingsObject()

ilObjStyleSettingsGUI::saveStyleSettingsObject ( )

save skin and style settings

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

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

291  {
292  global $styleDefinition, $ilCtrl;
293 
294  // check if one style is activated
295  if (count($_POST["st_act"]) < 1)
296  {
297  $this->ilias->raiseError($this->lng->txt("at_least_one_style"), $this->ilias->error_obj->MESSAGE);
298  }
299 
300  //set default skin and style
301  if ($_POST["default_skin_style"] != "")
302  {
303  $sknst = explode(":", $_POST["default_skin_style"]);
304 
305  if ($this->ilias->ini->readVariable("layout","style") != $sknst[1] ||
306  $this->ilias->ini->readVariable("layout","skin") != $sknst[0])
307  {
308  $this->ilias->ini->setVariable("layout","skin", $sknst[0]);
309  $this->ilias->ini->setVariable("layout","style",$sknst[1]);
310  }
311  $this->ilias->ini->write();
312  }
313 
314  // check if a style should be deactivated, that still has
315  // a user assigned to
316  $all_styles = ilStyleDefinition::getAllSkinStyles();
317  foreach ($all_styles as $st)
318  {
319  if (!isset($_POST["st_act"][$st["id"]]))
320  {
321  if (ilObjUser::_getNumberOfUsersForStyle($st["template_id"], $st["style_id"]) > 1)
322  {
323  $this->ilias->raiseError($this->lng->txt("cant_deactivate_if_users_assigned"), $this->ilias->error_obj->MESSAGE);
324  }
325  else
326  {
327  ilObjStyleSettings::_deactivateStyle($st["template_id"], $st["style_id"]);
328  }
329  }
330  else
331  {
332  ilObjStyleSettings::_activateStyle($st["template_id"], $st["style_id"]);
333  }
334  }
335 
336  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
337  $ilCtrl->redirect($this , "editSystemStyles");
338  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
_getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
global $ilCtrl
Definition: ilias.php:18
static getAllSkinStyles()
Get all skins/styles.
_activateStyle($a_skin, $a_style)
activate style
redirection script todo: (a better solution should control the processing via a xml file) ...
_deactivateStyle($a_skin, $a_style)
deactivate style
+ Here is the call graph for this function:

◆ setScopeObject()

ilObjStyleSettingsGUI::setScopeObject ( )

Set scope.

Parameters

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

References $ilCtrl, and ilObjectGUI\$tpl.

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

◆ setTabs()

ilObjStyleSettingsGUI::setTabs ( )

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

873  {
874  echo "settings_setTabs";
875  }

◆ showActions()

ilObjStyleSettingsGUI::showActions (   $with_subobjects = false)

show possible action (form buttons)

Parameters
booleanpublic

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

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

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

◆ toggleGlobalDefaultObject()

ilObjStyleSettingsGUI::toggleGlobalDefaultObject ( )

Toggle global default style.

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

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

436  {
437  global $ilSetting, $lng;
438 
439  if ($_GET["id"] > 0)
440  {
441  $ilSetting->delete("fixed_content_style_id");
442  $def_style = $ilSetting->get("default_content_style_id");
443 
444  if ($def_style != $_GET["id"])
445  {
446  $ilSetting->set("default_content_style_id", (int) $_GET["id"]);
447  }
448  else
449  {
450  $ilSetting->delete("default_content_style_id");
451  }
452  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
453  }
454  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
455  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilSetting
Definition: privfeed.php:40
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ toggleGlobalFixedObject()

ilObjStyleSettingsGUI::toggleGlobalFixedObject ( )

Toggle global fixed style.

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

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

461  {
462  global $ilSetting, $lng;
463 
464  if ($_GET["id"] > 0)
465  {
466  $ilSetting->delete("default_content_style_id");
467  $fixed_style = $ilSetting->get("fixed_content_style_id");
468  if ($fixed_style == (int) $_GET["id"])
469  {
470  $ilSetting->delete("fixed_content_style_id");
471  }
472  else
473  {
474  $ilSetting->set("fixed_content_style_id", (int) $_GET["id"]);
475  }
476  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
477  }
478  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editContentStyles", "", false, false));
479  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilSetting
Definition: privfeed.php:40
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ viewPageLayoutsObject()

ilObjStyleSettingsGUI::viewPageLayoutsObject ( )

view list of page layouts

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

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

Referenced by cancelCreateObject().

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