57                $this->parent_gui = $a_parent_gui;
 
   59                $this->ctrl = 
$DIC->ctrl();
 
   60                $this->rbacsystem = 
$DIC->rbac()->system();
 
   61                $this->toolbar = 
$DIC->toolbar();
 
   62                $this->lng = 
$DIC->language();
 
   63                $this->tpl = 
$DIC[
"tpl"];
 
   64                $this->ref_id = (int) 
$_GET[
"ref_id"];
 
   65                $this->obj_id = (int) 
$_GET[
"obj_id"];          
 
   68                include_once(
"./Services/Style/Content/classes/class.ilContentStyleSettings.php");
 
   77                $next_class = $this->ctrl->getNextClass($this);
 
   78                $cmd = $this->ctrl->getCmd(
"edit");
 
   82                        case "ilobjstylesheetgui":
 
   83                                $this->ctrl->setReturn($this, 
"edit");
 
   84                                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
 
   86                                $this->ctrl->forwardCommand($style_gui);
 
   90                                $this->parent_gui->prepareOutput();
 
   91                                if (in_array(
$cmd, array(
"edit", 
"delete", 
"toggleGlobalDefault", 
"toggleGlobalFixed", 
"setScope", 
"saveScope", 
"saveActiveStyles",
 
   92                                        "createStyle", 
"moveLMStyles", 
"moveIndividualStyles", 
"deleteStyle", 
"cancelDelete", 
"confirmedDelete")))
 
   98                                        die(
"Unknown command ".
$cmd);
 
  112                if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id))
 
  116                                include_once 
"Services/Object/exceptions/class.ilObjectException.php";
 
  132                $ilCtrl->redirectByClass(
"ilobjstylesheetgui", 
"create");
 
  143                include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
 
  144                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  146                $from_styles = $to_styles = 
$data = array();
 
  165                if ($fixed_style <= 0)
 
  168                                array(
"title" => $this->lng->txt(
"sty_individual_styles"),
 
  170                        $from_styles[-1] = $this->lng->txt(
"sty_individual_styles");
 
  174                if ($default_style <= 0 && $fixed_style <= 0)
 
  177                                array(
"title" => $this->lng->txt(
"sty_default_style"),
 
  179                        $from_styles[0] = $this->lng->txt(
"sty_default_style");
 
  180                        $to_styles[0] = $this->lng->txt(
"sty_default_style");
 
  185                        $this->toolbar->addButton($this->lng->txt(
"sty_add_content_style"),
 
  186                                $this->ctrl->getLinkTarget($this, 
"createStyle"));
 
  187                        $this->toolbar->addSeparator();
 
  188                        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  191                        $si = 
new ilSelectInputGUI($this->lng->txt(
"sty_move_lm_styles").
": ".$this->lng->txt(
"sty_from"), 
"from_style");
 
  192                        $si->setOptions($from_styles);
 
  193                        $this->toolbar->addInputItem(
$si, 
true);
 
  197                        $si->setOptions($to_styles);
 
  198                        $this->toolbar->addInputItem(
$si, 
true);
 
  199                        $this->toolbar->addFormButton($this->lng->txt(
"sty_move_style"), 
"moveLMStyles");
 
  201                        $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
 
  204                include_once(
"./Services/Style/Content/classes/class.ilContentStylesTableGUI.php");
 
  206                $this->tpl->setContent($table->getHTML());
 
  217                if (
$_POST[
"from_style"] == -1)
 
  223                include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
 
  225                $this->ctrl->redirect($this, 
"edit");
 
  236                include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
 
  238                $this->ctrl->redirect($this, 
"edit");
 
  248                include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  250                $this->ctrl->setParameter($this, 
"to_style", 
$_POST[
"to_style"]);
 
  253                $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  254                $cgui->setHeaderText($this->lng->txt(
"sty_confirm_del_ind_styles").
": ".
 
  255                        sprintf($this->lng->txt(
"sty_confirm_del_ind_styles_desc"),
 
  257                $cgui->setCancel($this->lng->txt(
"cancel"), 
"edit");
 
  258                $cgui->setConfirm($this->lng->txt(
"ok"), 
"moveIndividualStyles");
 
  259                $this->tpl->setContent($cgui->getHTML());
 
  274                        $this->ctrl->redirect($this, 
"edit");
 
  278                include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  280                $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  281                $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
 
  282                $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelDelete");
 
  283                $cgui->setConfirm($this->lng->txt(
"confirm"), 
"confirmedDelete");
 
  285                foreach (
$_POST[
"id"] as $id)
 
  288                                " ".ilObject::_lookupTitle($id);
 
  290                        $cgui->addItem(
"id[]", $id, $caption);
 
  293                $this->tpl->setContent($cgui->getHTML());
 
  306                foreach(
$_POST[
"id"] as $id)
 
  308                        include_once(
"./Services/Style/Content/classes/class.ilContentStyleSettings.php");
 
  310                        $set->removeStyle($id);
 
  312                        $style_obj = $ilias->obj_factory->getInstanceByObjId($id);
 
  313                        $style_obj->delete();
 
  316                $this->ctrl->redirect($this, 
"edit");
 
  331                        $ilSetting->delete(
"fixed_content_style_id");
 
  332                        $def_style = 
$ilSetting->get(
"default_content_style_id");
 
  334                        if ($def_style != 
$_GET[
"id"])
 
  340                                $ilSetting->delete(
"default_content_style_id");
 
  344                ilUtil::redirect($this->ctrl->getLinkTarget($this, 
"edit", 
"", 
false, 
false));
 
  358                        $ilSetting->delete(
"default_content_style_id");
 
  359                        $fixed_style = 
$ilSetting->get(
"fixed_content_style_id");
 
  360                        if ($fixed_style == (
int) 
$_GET[
"id"])
 
  370                ilUtil::redirect($this->ctrl->getLinkTarget($this, 
"edit", 
"", 
false, 
false));
 
  379                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  392                ilUtil::redirect($this->ctrl->getLinkTarget($this, 
"edit", 
"", 
false, 
false));
 
  405                $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
  406                $this->tpl->setVariable(
"BTN_NAME", 
"deleteStyle");
 
  407                $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
 
  408                $this->tpl->parseCurrentBlock();
 
  411                $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
  412                $this->tpl->setVariable(
"BTN_NAME", 
"toggleGlobalDefault");
 
  413                $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalDefault"));
 
  414                $this->tpl->parseCurrentBlock();
 
  417                $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
  418                $this->tpl->setVariable(
"BTN_NAME", 
"toggleGlobalFixed");
 
  419                $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalFixed"));
 
  420                $this->tpl->parseCurrentBlock();
 
  423                $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
  424                $this->tpl->setVariable(
"BTN_NAME", 
"setScope");
 
  425                $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_set_scope"));
 
  426                $this->tpl->parseCurrentBlock();
 
  429                $this->tpl->setCurrentBlock(
"tbl_action_btn");
 
  430                $this->tpl->setVariable(
"BTN_NAME", 
"saveActiveStyles");
 
  431                $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_save_active_styles"));
 
  432                $this->tpl->parseCurrentBlock();
 
  434                if ($with_subobjects === 
true)
 
  436                        $this->showPossibleSubObjects();
 
  439                $this->tpl->setCurrentBlock(
"tbl_action_row");
 
  441                $this->tpl->parseCurrentBlock();
 
  452                $this->ctrl->redirect($this, 
"edit");
 
  465                $ilCtrl->saveParameter($this, 
"id");
 
  466                include_once(
"./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
 
  468                        $this, 
"saveScope", 
"cat");
 
  469                $exp->setTypeWhiteList(array(
"root", 
"cat"));
 
  470                if (!$exp->handleCommand())
 
  472                        $tpl->setContent($exp->getHTML());
 
  485                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  486                if (
$_GET[
"cat"] == $tree->readRootId())
 
  494                ilUtil::redirect($this->ctrl->getLinkTarget($this, 
"edit", 
"", 
false, 
false));
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
Settings UI class for system styles.
moveIndividualStyles()
move all learning modules with individual styles to new style
showActions($with_subobjects=false)
show possible action (form buttons)
confirmDeleteIndividualStyles()
deleteStyle()
display deletion confirmation screen
toggleGlobalFixed()
Toggle global fixed style.
moveLMStyles()
move learning modules from one style to another
createStyle()
Create new style.
saveActiveStyles()
Save active styles.
checkPermission($a_perm, $a_throw_exc=true)
Check permission.
toggleGlobalDefault()
Toggle global default style.
__construct(ilObjStyleSettingsGUI $a_parent_gui)
Constructor.
confirmedDelete()
delete selected style objects
saveScope()
Save scope for style.
executeCommand()
Execute command.
cancelDelete()
cancel deletion of object
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
static _getNrLMsNoStyle()
get number of learning modules assigned no style
static _getNrOfAssignedLMs($a_style_id)
gets the number of learning modules assigned to a content style
static _moveLMStyles($a_from_style, $a_to_style)
move learning modules from one style to another
Style settings GUI class.
Class ilObjStyleSheetGUI.
static _lookupActive($a_id)
Lookup active flag.
static _writeActive($a_id, $a_active)
Write active flag.
static _writeScope($a_id, $a_scope)
Write scope.
Base exception class for object service.
static _lookupTitle($a_id)
lookup object title
Explorer for selecting repository items.
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...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)