4require_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
    5require_once 
"./Services/Style/Content/classes/class.ilObjStyleSheet.php";
 
   47    public function __construct($a_data, $a_id, $a_call_by_reference, $a_prep = 
true)
 
   51        $this->tpl = 
$DIC[
"tpl"];
 
   52        $this->rbacsystem = 
$DIC->rbac()->system();
 
   53        $this->help = 
$DIC[
"ilHelp"];
 
   54        $this->tabs = 
$DIC->tabs();
 
   55        $this->toolbar = 
$DIC->toolbar();
 
   56        $this->locator = 
$DIC[
"ilLocator"];
 
   57        $this->tree = 
$DIC->repositoryTree();
 
   58        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   65        $this->lng->loadLanguageModule(
"style");
 
   66        $ilCtrl->saveParameter($this, array(
"tag", 
"style_type", 
"temp_type"));
 
   67        if (
$_GET[
"style_type"] != 
"") {
 
   72        parent::__construct($a_data, $a_id, $a_call_by_reference, 
false);
 
   80        $next_class = $this->ctrl->getNextClass($this);
 
   81        $cmd = $this->ctrl->getCmd(
"edit");
 
   89        switch ($next_class) {
 
  117        $ilHelp->setScreenIdComponent(
"sty");
 
  122        include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  124        $form->setFormAction($this->ctrl->getFormAction($this));
 
  125        $form->setTitle($this->lng->txt(
"sty_create_new_stylesheet"));
 
  128        $ti = 
new ilTextInputGUI($this->lng->txt(
"title"), 
"style_title");
 
  129        $ti->setMaxLength(128);
 
  131        $ti->setRequired(
true);
 
  140        $form->addCommandButton(
"save", $this->lng->txt(
"save"));
 
  141        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  148        include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  150        $form->setFormAction($this->ctrl->getFormAction($this));
 
  151        $form->setTitle($this->lng->txt(
"sty_import_stylesheet"));
 
  154        $ti = 
new ilFileInputGUI($this->lng->txt(
"import_file"), 
"importfile");
 
  155        $ti->setRequired(
true);
 
  158        $form->addCommandButton(
"importStyle", $this->lng->txt(
"import"));
 
  159        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  166        include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  168        $form->setFormAction($this->ctrl->getFormAction($this));
 
  169        $form->setTitle($this->lng->txt(
"sty_copy_other_stylesheet"));
 
  173        $ti->setRequired(
true);
 
  177        $form->addCommandButton(
"copyStyle", $this->lng->txt(
"copy"));
 
  178        $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  192        $this->tpl->setCurrentBlock(
"ContentStyle");
 
  193        $this->tpl->setVariable(
 
  194            "LOCATION_CONTENT_STYLESHEET",
 
  197        $this->tpl->parseCurrentBlock();
 
  232        $ctpl = 
new ilTemplate(
"tpl.sty_classes.html", 
true, 
true, 
"Services/Style/Content");
 
  235        $chars = $this->
object->getCharacteristics();
 
  237        $style_type = ($this->super_type != 
"")
 
  240        $ilCtrl->setParameter($this, 
"style_type", $style_type);
 
  241        $ilTabs->setSubTabActive(
"sty_" . $style_type . 
"_char");
 
  244        if ($this->super_type == 
"rte") {
 
  245            $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
 
  246            include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
 
  247            $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
 
  252        $subtypes = $all_super_types[$style_type];
 
  254        foreach ($subtypes as 
$t) {
 
  260            $ilToolbar->addButton(
 
  261                $lng->txt(
"sty_add_characteristic"),
 
  262                $ilCtrl->getLinkTarget($this, 
"addCharacteristicForm")
 
  267            $style_cp = explode(
":::", 
$_SESSION[
"sty_copy"]);
 
  268            if ($style_cp[1] == $style_type) {
 
  270                    $ilToolbar->addSeparator();
 
  272                $ilToolbar->addButton(
 
  273                    $lng->txt(
"sty_paste_style_classes"),
 
  274                    $ilCtrl->getLinkTarget($this, 
"pasteCharacteristicsOverview")
 
  279        include_once(
"./Services/Style/Content/classes/class.ilStyleTableGUI.php");
 
  288        $ctpl->setCurrentBlock(
"style_table");
 
  289        $ctpl->setVariable(
"STYLE_TABLE", $table_gui->getHTML());
 
  290        $ctpl->parseCurrentBlock();
 
  292        $this->tpl->setContent($ctpl->get());
 
  305        $this->tpl->setCurrentBlock(
"ContentStyle");
 
  306        $this->tpl->setVariable(
 
  307            "LOCATION_CONTENT_STYLESHEET",
 
  310        $this->tpl->parseCurrentBlock();
 
  313        $ilToolbar->addButton(
 
  314            $this->lng->txt(
"export"),
 
  315            $this->ctrl->getLinkTarget($this, 
"exportStyle")
 
  320        $this->tpl->setContent($this->form->getHTML());
 
  331        $values[
"style_title"] = $this->
object->getTitle();
 
  332        $values[
"style_description"] = $this->
object->getDescription();
 
  333        $values[
"disable_auto_margins"] = (int) $this->object->lookupStyleSetting(
"disable_auto_margins");
 
  335        $this->form->setValuesByArray($values);
 
  348        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  352        $ti = 
new ilTextInputGUI($this->lng->txt(
"title"), 
"style_title");
 
  353        $ti->setMaxLength(128);
 
  355        $ti->setRequired(
true);
 
  356        $this->form->addItem($ti);
 
  362        $this->form->addItem($ta);
 
  365        $cb = 
new ilCheckboxInputGUI($this->lng->txt(
"sty_disable_auto_margins"), 
"disable_auto_margins");
 
  366        $cb->setInfo($this->lng->txt(
"sty_disable_auto_margins_info"));
 
  367        $this->form->addItem($cb);
 
  371        if ($a_mode == 
"create") {
 
  372            $this->form->addCommandButton(
"save", 
$lng->txt(
"save"));
 
  373            $this->form->addCommandButton(
"cancelSave", 
$lng->txt(
"cancel"));
 
  376                $this->form->addCommandButton(
"update", 
$lng->txt(
"save"));
 
  380        $this->form->setTitle(
$lng->txt(
"edit_stylesheet"));
 
  381        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  394        if ($this->form->checkInput()) {
 
  395            $this->
object->setTitle($this->form->getInput(
"style_title"));
 
  396            $this->
object->setDescription($this->form->getInput(
"style_description"));
 
  397            $this->
object->writeStyleSetting(
 
  398                "disable_auto_margins",
 
  399                $this->form->getInput(
"disable_auto_margins")
 
  401            $this->
object->update();
 
  403            $ilCtrl->redirect($this, 
"properties");
 
  405            $this->form->setValuesByPost();
 
  406            $tpl->setContent($this->form->getHtml());
 
  417        $cur = explode(
".", 
$_GET[
"tag"]);
 
  419        $cur_class = $cur[1];
 
  423        if ($this->form_gui->checkInput()) {
 
  425            $ilCtrl->redirect($this, 
"editTagStyle");
 
  427            $this->form_gui->setValuesByPost();
 
  439        $cur = explode(
".", 
$_GET[
"tag"]);
 
  441        $cur_class = $cur[1];
 
  444        if ($this->form_gui->checkInput()) {
 
  446            $ilCtrl->redirect($this, 
"edit");
 
  448            $this->form_gui->setValuesByPost();
 
  458        $cur = explode(
".", 
$_GET[
"tag"]);
 
  460        $cur_class = $cur[1];
 
  462        foreach ($avail_pars as $par => $v) {
 
  463            $var = str_replace(
"-", 
"_", $par);
 
  464            $basepar_arr = explode(
".", $par);
 
  465            $basepar = $basepar_arr[0];
 
  466            if ($basepar_arr[1] != 
"" && $basepar_arr[1] != $cur_tag) {
 
  470            switch ($v[
"input"]) {
 
  472                case "numeric_no_perc":
 
  474                case "background_image":
 
  475                    $in = $this->form_gui->getItemByPostVar($basepar);
 
  481                    $color = trim(
$_POST[$basepar]);
 
  482                    if ($color != 
"" && trim(substr($color, 0, 1) != 
"!")) {
 
  483                        $color = 
"#" . $color;
 
  491                    $in = $this->form_gui->getItemByPostVar($basepar);
 
  495                    $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][3], 
$in->getBottomValue(), 
$_GET[
"style_type"], (
int) 
$_GET[
"mq_id"]);
 
  500                    $in = $this->form_gui->getItemByPostVar($basepar);
 
  501                    $tblr_p = array(0 => 
"getAllValue", 1 => 
"getTopValue", 2 => 
"getRightValue",
 
  502                        3 => 
"getBottomValue", 4 => 
"getLeftValue");
 
  503                    foreach ($tblr_p as $k => $func) {
 
  504                        $val = trim(
$in->$func());
 
  505                        $val = ((
$in->getAcceptNamedColors() && substr($val, 0, 1) == 
"!")
 
  513                case "background_position":
 
  514                    $in = $this->form_gui->getItemByPostVar($basepar);
 
  525        $this->
object->deleteCustomStylePars($cur_tag, $cur_class, 
$_GET[
"style_type"], (
int) 
$_GET[
"mq_id"]);
 
  526        if (is_array(
$_POST[
"custom_par"])) {
 
  527            foreach (
$_POST[
"custom_par"] as $cpar) {
 
  528                $par_arr = explode(
":", $cpar);
 
  529                if (count($par_arr) == 2) {
 
  530                    $par = trim($par_arr[0]);
 
  531                    $val = trim(str_replace(
";", 
"", $par_arr[1]));
 
  537        $this->
object->update();
 
  549            $this->
object->replaceStylePar($cur_tag, $cur_class, $par, $value, 
$a_type, $a_mq_id, $a_custom);
 
  551            $this->
object->deleteStylePar($cur_tag, $cur_class, $par, 
$a_type, $a_mq_id, $a_custom);
 
  567        $mqs = $this->
object->getMediaQueries();
 
  568        if (count($mqs) > 0) {
 
  571                "" => 
$lng->txt(
"sty_default"),
 
  573            foreach ($mqs as $mq) {
 
  574                $options[$mq[
"id"]] = $mq[
"mquery"];
 
  576            include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  579            $si->setValue((
int) 
$_GET[
"mq_id"]);
 
  580            $ilToolbar->addInputItem(
$si, 
true);
 
  581            $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
  582            $ilToolbar->addFormButton(
$lng->txt(
"sty_switch"), 
"switchMQuery");
 
  587        if ($this->super_type == 
"rte") {
 
  588            $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
 
  589            include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
 
  590            $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
 
  593        $cur = explode(
".", 
$_GET[
"tag"]);
 
  595        $cur_class = $cur[1];
 
  612        $ilCtrl->setParameter($this, 
"mq_id", (
int) 
$_POST[
"mq_id"]);
 
  613        $ilCtrl->redirect($this, 
"editTagStyle");
 
  627        $tpl->setCurrentBlock(
"ContentStyle");
 
  629            "LOCATION_CONTENT_STYLESHEET",
 
  633        $ts_tpl = 
new ilTemplate(
"tpl.style_tag_edit.html", 
true, 
true, 
"Services/Style/Content");
 
  635        $cur = explode(
".", 
$_GET[
"tag"]);
 
  637        $cur_class = $cur[1];
 
  639        $ts_tpl->setVariable(
 
  644        $ts_tpl->setVariable(
 
  646            $this->form_gui->getHtml()
 
  649        $tpl->setTitle($cur_class . 
" (" . 
$lng->txt(
"sty_type_" . 
$_GET[
"style_type"]) . 
")");
 
  651        $tpl->setContent($ts_tpl->get());
 
  665        $ilCtrl->saveParameter($this, array(
"mq_id"));
 
  667        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  670        $avail_pars = $this->
object->getAvailableParameters();
 
  671        $groups = $this->
object->getStyleParameterGroups();
 
  674        foreach ($groups as $k => $group) {
 
  678            if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k])) {
 
  683            $sh->setTitle(
$lng->txt(
"sty_" . $k));
 
  684            $this->form_gui->addItem($sh);
 
  686            foreach ($group as $par) {
 
  687                $basepar = explode(
".", $par);
 
  688                $basepar = $basepar[0];
 
  690                $var = str_replace(
"-", 
"_", $basepar);
 
  691                $up_par = strtoupper($var);
 
  697                        foreach ($avail_pars[$par] as $p) {
 
  701                        $this->form_gui->addItem($sel_input);
 
  706                        $text_input->setMaxLength(200);
 
  707                        $text_input->setSize(20);
 
  708                        $this->form_gui->addItem($text_input);
 
  712                        include_once(
"./Services/Style/Content/classes/class.ilFontSizeInputGUI.php");
 
  714                        $this->form_gui->addItem($fs_input);
 
  717                    case "numeric_no_perc":
 
  719                        include_once(
"./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
 
  722                            $num_input->setAllowPercentage(
false);
 
  724                        $this->form_gui->addItem($num_input);
 
  729                        $per_input->setMinValue(0);
 
  730                        $per_input->setMaxValue(100);
 
  731                        $per_input->setMaxLength(3);
 
  732                        $per_input->setSize(3);
 
  733                        $this->form_gui->addItem($per_input);
 
  739                        $col_input->setDefaultColor(
"");
 
  740                        $col_input->setAcceptNamedColors(
true);
 
  741                        $this->form_gui->addItem($col_input);
 
  745                        include_once(
"./Services/Style/Content/classes/class.ilTRBLNumericStyleValueInputGUI.php");
 
  748                            $num_input->setAllowPercentage(
false);
 
  750                        $this->form_gui->addItem($num_input);
 
  754                        include_once(
"./Services/Style/Content/classes/class.ilTRBLBorderWidthInputGUI.php");
 
  756                        $this->form_gui->addItem($bw_input);
 
  760                        include_once(
"./Services/Style/Content/classes/class.ilTRBLBorderStyleInputGUI.php");
 
  762                        $this->form_gui->addItem($bw_input);
 
  766                        include_once(
"./Services/Style/Content/classes/class.ilTRBLColorPickerInputGUI.php");
 
  768                        $col_input->setAcceptNamedColors(
true);
 
  769                        $this->form_gui->addItem($col_input);
 
  772                    case "background_image":
 
  773                        include_once(
"./Services/Style/Content/classes/class.ilBackgroundImageInputGUI.php");
 
  776                        foreach ($this->object->getImages() as $entry) {
 
  777                            $imgs[] = $entry[
"entry"];
 
  779                        $im_input->setImages($imgs);
 
  780                        $this->form_gui->addItem($im_input);
 
  783                    case "background_position":
 
  784                        include_once(
"./Services/Style/Content/classes/class.ilBackgroundPositionInputGUI.php");
 
  786                        $this->form_gui->addItem($im_input);
 
  794        $sh->setTitle(
$lng->txt(
"sty_custom"));
 
  795        $this->form_gui->addItem($sh);
 
  798        $ti = 
new ilTextInputGUI($this->lng->txt(
"sty_custom_par"), 
"custom_par");
 
  799        $ti->setMaxLength(300);
 
  802        $ti->setInfo($this->lng->txt(
"sty_custom_par_info"));
 
  803        $this->form_gui->addItem($ti);
 
  807        $this->form_gui->addCommandButton(
"updateTagStyle", 
$lng->txt(
"save_return"));
 
  808        $this->form_gui->addCommandButton(
"refreshTagStyle", 
$lng->txt(
"save_refresh"));
 
  811        $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
 
  820        $style = $this->
object->getStyle();
 
  821        $cur = explode(
".", 
$_GET[
"tag"]);
 
  823        $cur_class = $cur[1];
 
  829            (
int) 
$_GET[
"mq_id"],
 
  833        foreach ($parameters as $p => $v) {
 
  835            if (is_array($filtered_groups[$v[
"group"]]) && !in_array($cur_tag, $filtered_groups[$v[
"group"]])) {
 
  838            $p = explode(
".", $p);
 
  840            $input = $this->form_gui->getItemByPostVar($p);
 
  841            switch ($v[
"input"]) {
 
  849                    $input->setAllValue($cur_parameters[$v[
"subpar"][0]]);
 
  850                    $input->setTopValue($cur_parameters[$v[
"subpar"][1]]);
 
  851                    $input->setRightValue($cur_parameters[$v[
"subpar"][2]]);
 
  852                    $input->setBottomValue($cur_parameters[$v[
"subpar"][3]]);
 
  853                    $input->setLeftValue($cur_parameters[$v[
"subpar"][4]]);
 
  857                    $input->setValue($cur_parameters[$p]);
 
  867            (
int) 
$_GET[
"mq_id"],
 
  871        foreach ($cust_parameters as $k => $c) {
 
  872            $vals[] = $k . 
": " . $c;
 
  874        $input = $this->form_gui->getItemByPostVar(
"custom_par");
 
  875        $input->setValue($vals);
 
  883        include_once(
"./Services/Export/classes/class.ilExport.php");
 
  885        $r = $exp->exportObject($this->object->getType(), $this->object->getId());
 
  892        $parameters = array();
 
  893        foreach ($a_style as 
$tag) {
 
  894            foreach (
$tag as $par) {
 
  895                if ($par[
"tag"] == $a_tag && $par[
"class"] == $a_class
 
  896                    && $par[
"type"] == 
$a_type && (
int) $a_mq_id == (
int) $par[
"mq_id"]
 
  897                    && (
int) $a_custom == (
int) $par[
"custom"]) {
 
  898                    $parameters[$par[
"parameter"]] = $par[
"value"];
 
  910        $this->
object->addParameter(
$_POST[
"tag"], 
$_POST[
"parameter"]);
 
  919        $this->
object->setTitle(
$_POST[
"style_title"]);
 
  920        $this->
object->setDescription(
$_POST[
"style_description"]);
 
  922        foreach (
$_POST[
"styval"] as 
$id => $value) {
 
  923            $this->
object->updateStyleParameter(
$id, $value);
 
  925        $this->
object->update();
 
  939        include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  941        $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  942        $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
 
  943        $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelDelete");
 
  944        $cgui->setConfirm($this->lng->txt(
"confirm"), 
"confirmedDelete");
 
  949        $cgui->addItem(
"id[]", 
"", $caption);
 
  951        $this->tpl->setContent($cgui->getHTML());
 
  960        $this->ctrl->returnToParent($this);
 
  968        $this->
object->delete();
 
  970        $this->ctrl->returnToParent($this);
 
  978        if (is_array(
$_POST[
"sty_select"])) {
 
  979            foreach (
$_POST[
"sty_select"] as 
$id => $dummy) {
 
  980                $this->
object->deleteParameter(
$id);
 
  983        $this->
object->read();
 
  984        $this->
object->writeCSSFile();
 
  993        if (!trim(
$_POST[
"style_title"])) {
 
  994            $this->ctrl->redirect($this, 
"create");
 
  998        $class_name = 
"ilObjStyleSheet";
 
  999        require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 1001        $newObj->setTitle(
"-");
 
 1009        if (
$_GET[
"ref_id"] > 0) {
 
 1011            if ($fold->getType() == 
"stys") {
 
 1012                include_once(
"./Services/Style/Content/classes/class.ilContentStyleSettings.php");
 
 1014                $cont_style_settings->addStyle($newObj->getId());
 
 1015                $cont_style_settings->update();
 
 1018                $this->ctrl->returnToParent($this);
 
 1022        return $newObj->getId();
 
 1030        if (
$_POST[
"source_style"] > 0) {
 
 1032            $new_id = $style_obj->ilClone();
 
 1037        if (
$_GET[
"ref_id"] > 0) {
 
 1039            if ($fold->getType() == 
"stys") {
 
 1040                include_once(
"./Services/Style/Content/classes/class.ilContentStyleSettings.php");
 
 1042                $cont_style_settings->addStyle($new_id);
 
 1043                $cont_style_settings->update();
 
 1045                $this->ctrl->returnToParent($this);
 
 1058        $source = $_FILES[
"importfile"][
"tmp_name"];
 
 1060            $this->
ilias->raiseError(
"No file selected!", $this->
ilias->error_obj->MESSAGE);
 
 1064        $info = pathinfo($_FILES[
"importfile"][
"name"]);
 
 1065        if (strtolower(
$info[
"extension"]) != 
"zip" && strtolower(
$info[
"extension"]) != 
"xml") {
 
 1066            $this->
ilias->raiseError(
"File must be a zip or xml file!", $this->
ilias->error_obj->MESSAGE);
 
 1070        $fname = explode(
"_", $_FILES[
"importfile"][
"name"]);
 
 1071        if (strtolower(
$info[
"extension"]) == 
"zip" && $fname[4] == 
"sty") {
 
 1072            include_once(
"./Services/Export/classes/class.ilImport.php");
 
 1074            $new_id = $imp->importObject(
 
 1076                $_FILES[
"importfile"][
"tmp_name"],
 
 1077                $_FILES[
"importfile"][
"name"],
 
 1084            require_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 1086            $newObj->import($_FILES[
"importfile"]);
 
 1091        if (
$_GET[
"ref_id"] > 0) {
 
 1093            if ($fold->getType() == 
"stys") {
 
 1094                include_once(
"./Services/Style/Content/classes/class.ilContentStyleSettings.php");
 
 1096                $cont_style_settings->addStyle($newObj->getId());
 
 1097                $cont_style_settings->update();
 
 1099                $this->ctrl->returnToParent($this);
 
 1102        return $newObj->getId();
 
 1124        $this->ctrl->returnToParent($this);
 
 1142        $this->
getTabs($this->tabs_gui);
 
 1144        if (strtolower(get_class($this->
object)) == 
"ilobjstylesheet") {
 
 1145            $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
 
 1147            $this->tpl->setVariable(
"HEADER", 
$lng->txt(
"create_stylesheet"));
 
 1163        $ilHelp->setScreenIdComponent(
"sty");
 
 1165        if (
$ilCtrl->getCmd() == 
"editTagStyle") {
 
 1167            $this->tabs_gui->setBackTarget(
 
 1169                $ilCtrl->getLinkTarget($this, 
"edit")
 
 1172            $t = explode(
".", 
$_GET[
"tag"]);
 
 1173            $t2 = explode(
":", 
$t[1]);
 
 1174            $pc = $this->
object->_getPseudoClasses(
$t[0]);
 
 1175            if (is_array($pc) && count($pc) > 0) {
 
 1177                $ilCtrl->setParameter($this, 
"tag", 
$t[0] . 
"." . $t2[0]);
 
 1178                $this->tabs_gui->addTarget(
 
 1180                    $this->ctrl->getLinkTarget($this, 
"editTagStyle"),
 
 1181                    array(
"editTagStyle", 
""),
 
 1185                    $ilTabs->setTabActive(
"sty_tag_normal");
 
 1188                foreach ($pc as $p) {
 
 1190                    $ilCtrl->setParameter($this, 
"tag", 
$t[0] . 
"." . $t2[0] . 
":" . $p);
 
 1191                    $this->tabs_gui->addTarget(
 
 1193                        $this->ctrl->getLinkTarget($this, 
"editTagStyle"),
 
 1194                        array(
"editTagStyle", 
""),
 
 1198                        $ilTabs->setTabActive(
"sty_tag_" . $p);
 
 1205            $this->tabs_gui->setBackTarget(
 
 1207                $this->ctrl->getLinkTarget($this, 
"returnToUpperContext")
 
 1211            $this->tabs_gui->addTarget(
 
 1213                $this->ctrl->getLinkTarget($this, 
"edit"),
 
 1219            $this->tabs_gui->addTarget(
 
 1221                $this->ctrl->getLinkTarget($this, 
"listColors"),
 
 1227            $this->tabs_gui->addTarget(
 
 1228                "sty_media_queries",
 
 1229                $this->ctrl->getLinkTarget($this, 
"listMediaQueries"),
 
 1235            $this->tabs_gui->addTarget(
 
 1237                $this->ctrl->getLinkTarget($this, 
"listImages"),
 
 1243            $this->tabs_gui->addTarget(
 
 1245                $this->ctrl->getLinkTarget($this, 
"listTemplates"),
 
 1251            $this->tabs_gui->addTarget(
 
 1253                $this->ctrl->getLinkTarget($this, 
"properties"),
 
 1279        foreach ($types as $super_type => $types) {
 
 1281            $ilCtrl->setParameter($this, 
"style_type", $super_type);
 
 1282            $ilTabs->addSubTabTarget(
 
 1283                "sty_" . $super_type . 
"_char",
 
 1284                $this->ctrl->getLinkTarget($this, 
"edit"),
 
 1290        $ilCtrl->setParameter($this, 
"style_type", 
$_GET[
"style_type"]);
 
 1306        foreach ($types as 
$t => $c) {
 
 1307            $ilCtrl->setParameter($this, 
"temp_type", 
$t);
 
 1308            $ilTabs->addSubTabTarget(
 
 1309                "sty_" . 
$t . 
"_templates",
 
 1310                $this->ctrl->getLinkTarget($this, 
"listTemplates"),
 
 1311                array(
"listTemplates", 
""),
 
 1316        $ilCtrl->setParameter($this, 
"temp_type", 
$_GET[
"temp_type"]);
 
 1327        if (
$_GET[
"admin_mode"] == 
"settings") {        
 
 1328            parent::addAdminLocatorItems(
true);
 
 1330            $ilLocator->addItem(
 
 1334                $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui", 
"")
 
 1337            if (
$_GET[
"obj_id"] > 0) {
 
 1338                $ilLocator->addItem(
 
 1339                    $this->object->getTitle(),
 
 1340                    $this->ctrl->getLinkTarget($this, 
"edit")
 
 1354        if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui") {
 
 1356                $this->ctrl->getLinkTargetByClass(
 
 1357                    "ilcontentstylesettings",
 
 1378            $ilToolbar->addButton(
 
 1379                $lng->txt(
"sty_add_image"),
 
 1380                $ilCtrl->getLinkTarget($this, 
"addImage")
 
 1384        include_once(
"./Services/Style/Content/classes/class.ilStyleImageTableGUI.php");
 
 1390        $tpl->setContent($table_gui->getHTML());
 
 1401        $tpl->setContent($this->form_gui->getHTML());
 
 1411        $ilCtrl->redirect($this, 
"listImages");
 
 1424        if ($this->form_gui->checkInput()) {
 
 1425            $this->
object->uploadImage($_FILES[
"image_file"]);
 
 1426            $ilCtrl->redirect($this, 
"listImages");
 
 1429            $tpl->setContent($this->form_gui->getHTML());
 
 1441        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1444        $this->form_gui->setTitle(
$lng->txt(
"sty_add_image"));
 
 1447        $file_input->setRequired(
true);
 
 1448        $this->form_gui->addItem($file_input);
 
 1450        $this->form_gui->addCommandButton(
"uploadImage", 
$lng->txt(
"upload"));
 
 1451        $this->form_gui->addCommandButton(
"cancelUpload", 
$lng->txt(
"cancel"));
 
 1452        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
 1462        $images = $this->
object->getImages();
 
 1464        foreach ($images as $image) {
 
 1465            if (is_array(
$_POST[
"file"]) && in_array($image[
"entry"], 
$_POST[
"file"])) {
 
 1466                $this->
object->deleteImage($image[
"entry"]);
 
 1469        $ilCtrl->redirect($this, 
"listImages");
 
 1483        if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0) {
 
 1485            $ilCtrl->redirect($this, 
"edit");
 
 1489            foreach (
$_POST[
"char"] as $char) {
 
 1490                if (!empty($core_styles[$char])) {
 
 1496            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1498            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
 1499            $cgui->setHeaderText(
$lng->txt(
"sty_confirm_char_deletion"));
 
 1500            $cgui->setCancel(
$lng->txt(
"cancel"), 
"cancelCharacteristicDeletion");
 
 1501            $cgui->setConfirm(
$lng->txt(
"delete"), 
"deleteCharacteristic");
 
 1503            foreach (
$_POST[
"char"] as $char) {
 
 1504                $char_comp = explode(
".", $char);
 
 1505                $cgui->addItem(
"char[]", $char, $char_comp[2]);
 
 1508            $tpl->setContent($cgui->getHTML());
 
 1524        include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1526        $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
 1531        foreach (
$_POST[
"char"] as $char) {
 
 1532            if (!empty($core_styles[$char])) {
 
 1534                $char_comp = explode(
".", $char);
 
 1535                $cgui->addItem(
"", 
"", $char_comp[2]);
 
 1537                $cgui->addHiddenItem(
"char[]", $char);
 
 1540        $all_core_styles = ($cnt == count(
$_POST[
"char"]))
 
 1544        if ($all_core_styles) {
 
 1545            $cgui->setHeaderText(
$lng->txt(
"sty_all_styles_obligatory"));
 
 1546            $cgui->setCancel(
$lng->txt(
"back"), 
"cancelCharacteristicDeletion");
 
 1548            $cgui->setHeaderText(
$lng->txt(
"sty_some_styles_obligatory_delete_rest"));
 
 1549            $cgui->setCancel(
$lng->txt(
"cancel"), 
"cancelCharacteristicDeletion");
 
 1550            $cgui->setConfirm(
$lng->txt(
"sty_delete_other_selected"), 
"deleteCharacteristicConfirmation");
 
 1553        $tpl->setContent($cgui->getHTML());
 
 1565        $ilCtrl->redirect($this, 
"edit");
 
 1575        if (is_array(
$_POST[
"char"])) {
 
 1576            foreach (
$_POST[
"char"] as $char) {
 
 1577                $char_comp = explode(
".", $char);
 
 1578                $type = $char_comp[0];
 
 1579                $tag = $char_comp[1];
 
 1580                $class = $char_comp[2];
 
 1582                $this->
object->deleteCharacteristic(
$type, 
$tag, $class);
 
 1586        $ilCtrl->redirect($this, 
"edit");
 
 1597        $tpl->setContent($this->form_gui->getHTML());
 
 1611        if ($this->form_gui->checkInput()) {
 
 1612            if ($this->object->characteristicExists(
$_POST[
"new_characteristic"], 
$_GET[
"style_type"])) {
 
 1613                $char_input = $this->form_gui->getItemByPostVar(
"new_characteristic");
 
 1614                $char_input->setAlert(
$lng->txt(
"sty_characteristic_already_exists"));
 
 1616                $this->
object->addCharacteristic(
$_POST[
"type"], 
$_POST[
"new_characteristic"]);
 
 1624                $ilCtrl->redirect($this, 
"editTagStyle");
 
 1627        $this->form_gui->setValuesByPost();
 
 1628        $tpl->setContent($this->form_gui->getHTML());
 
 1641        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1646        $txt_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 1647        $txt_input->setNoMatchMessage(
$lng->txt(
"sty_msg_characteristic_must_only_include") . 
" A-Z, a-z, 0-9");
 
 1648        $txt_input->setRequired(
true);
 
 1649        $this->form_gui->addItem($txt_input);
 
 1653        $types = $all_super_types[$this->super_type];
 
 1654        $exp_types = array();
 
 1655        foreach ($types as 
$t) {
 
 1657                $exp_types[
$t] = 
$lng->txt(
"sty_type_" . 
$t);
 
 1660        if (count($exp_types) > 1) {
 
 1662            $type_input->setOptions($exp_types);
 
 1663            $type_input->setValue(key($exp_types));
 
 1664            $this->form_gui->addItem($type_input);
 
 1665        } elseif (count($exp_types) == 1) {
 
 1667            $hid_input->setValue(key($exp_types));
 
 1668            $this->form_gui->addItem($hid_input);
 
 1671        $this->form_gui->setTitle(
$lng->txt(
"sty_add_characteristic"));
 
 1672        $this->form_gui->addCommandButton(
"saveCharacteristic", 
$lng->txt(
"save"));
 
 1673        $this->form_gui->addCommandButton(
"edit", 
$lng->txt(
"cancel"));
 
 1674        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
 1686        $c = explode(
":", $a_class);
 
 1689        $ex_tpl = 
new ilTemplate(
"tpl.style_example.html", 
true, 
true, 
"Services/Style/Content");
 
 1691        if ($ex_tpl->blockExists(
"Example_" . 
$a_type)) {
 
 1692            $ex_tpl->setCurrentBlock(
"Example_" . 
$a_type);
 
 1694            $ex_tpl->setCurrentBlock(
"Example_default");
 
 1696        $ex_tpl->setVariable(
"EX_CLASS", 
"ilc_" . 
$a_type . 
"_" . $a_class);
 
 1697        $ex_tpl->setVariable(
"EX_TEXT", 
"ABC abc 123");
 
 1698        if (in_array(
$a_type, array(
"media_cont", 
"qimg"))) {
 
 1701        if (in_array(
$a_type, array(
"table", 
"table_caption"))) {
 
 1702            $ex_tpl->setVariable(
"TXT_CAPTION", 
$lng->txt(
"sty_caption"));
 
 1704        if (in_array($a_class, array(
"OrderListItemHorizontal", 
"OrderListHorizontal"))) {
 
 1705            $ex_tpl->setVariable(
"HOR", 
"Horizontal");
 
 1707        $ex_tpl->parseCurrentBlock();
 
 1709        return $ex_tpl->get();
 
 1722        foreach (
$_POST[
"all_chars"] as $char) {
 
 1723            $ca = explode(
".", $char);
 
 1724            $this->
object->saveHideStatus(
 
 1727                (is_array(
$_POST[
"hide"]) && in_array($char, 
$_POST[
"hide"]))
 
 1732        $ilCtrl->redirect($this, 
"edit");
 
 1746        if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0) {
 
 1749            $style_cp = implode(
"::", 
$_POST[
"char"]);
 
 1750            $style_cp = $this->
object->getId() . 
":::" . 
$_GET[
"style_type"] . 
":::" . $style_cp;
 
 1754        $ilCtrl->redirect($this, 
"edit");
 
 1768        $ilTabs->clearTargets();
 
 1770        include_once(
"./Services/Style/Content/classes/class.ilPasteStyleCharacteristicTableGUI.php");
 
 1787        if (is_array(
$_POST[
"title"])) {
 
 1788            foreach (
$_POST[
"title"] as $from_char => $to_title) {
 
 1789                $fc = explode(
".", $from_char);
 
 1791                if (
$_POST[
"conflict_action"][$from_char] == 
"overwrite" ||
 
 1792                    !$this->object->characteristicExists($to_title, $fc[0])) {
 
 1793                    $this->
object->copyCharacteristic(
 
 1806        $ilCtrl->redirect($this, 
"edit");
 
 1824            $ilToolbar->addButton(
 
 1825                $this->lng->txt(
"sty_add_color"),
 
 1826                $ilCtrl->getLinkTarget($this, 
"addColor")
 
 1830        include_once(
"./Services/Style/Content/classes/class.ilStyleColorTableGUI.php");
 
 1836        $tpl->setContent($table_gui->getHTML());
 
 1847        $tpl->setContent($this->form_gui->getHTML());
 
 1858        $ilCtrl->setParameter($this, 
"c_name", 
$_GET[
"c_name"]);
 
 1861        $tpl->setContent($this->form_gui->getHTML());
 
 1873        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1876        $this->form_gui->setTitle(
$lng->txt(
"sty_add_color"));
 
 1880        $name_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 1881        $name_input->setNoMatchMessage(
$lng->txt(
"sty_msg_color_must_only_include") . 
" A-Z, a-z, 1-9");
 
 1882        $name_input->setRequired(
true);
 
 1883        $name_input->setSize(15);
 
 1884        $name_input->setMaxLength(15);
 
 1885        $this->form_gui->addItem($name_input);
 
 1889        $color_input->setRequired(
true);
 
 1890        $color_input->setDefaultColor(
"");
 
 1891        $this->form_gui->addItem($color_input);
 
 1893        if ($a_mode == 
"create") {
 
 1894            $this->form_gui->addCommandButton(
"saveColor", 
$lng->txt(
"save"));
 
 1895            $this->form_gui->addCommandButton(
"cancelColorSaving", 
$lng->txt(
"cancel"));
 
 1897            $this->form_gui->addCommandButton(
"updateColor", 
$lng->txt(
"save"));
 
 1898            $this->form_gui->addCommandButton(
"cancelColorSaving", 
$lng->txt(
"cancel"));
 
 1900        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
 1908        if (
$_GET[
"c_name"] != 
"") {
 
 1909            $values[
"color_name"] = 
$_GET[
"c_name"];
 
 1910            $values[
"color_code"] = $this->
object->getColorCodeForName(
$_GET[
"c_name"]);
 
 1911            $this->form_gui->setValuesByArray($values);
 
 1922        $ilCtrl->redirect($this, 
"listColors");
 
 1936        if ($this->form_gui->checkInput()) {
 
 1937            if ($this->object->colorExists(
$_POST[
"color_name"])) {
 
 1938                $col_input = $this->form_gui->getItemByPostVar(
"color_name");
 
 1939                $col_input->setAlert(
$lng->txt(
"sty_color_already_exists"));
 
 1941                $this->
object->addColor(
 
 1945                $ilCtrl->redirect($this, 
"listColors");
 
 1948        $this->form_gui->setValuesByPost();
 
 1949        $tpl->setContent($this->form_gui->getHTML());
 
 1963        if ($this->form_gui->checkInput()) {
 
 1964            if ($this->object->colorExists(
$_POST[
"color_name"]) &&
 
 1966                $col_input = $this->form_gui->getItemByPostVar(
"color_name");
 
 1967                $col_input->setAlert(
$lng->txt(
"sty_color_already_exists"));
 
 1969                $this->
object->updateColor(
 
 1974                $ilCtrl->redirect($this, 
"listColors");
 
 1977        $ilCtrl->setParameter($this, 
"c_name", 
$_GET[
"c_name"]);
 
 1978        $this->form_gui->setValuesByPost();
 
 1979        $tpl->setContent($this->form_gui->getHTML());
 
 1991        if (!is_array(
$_POST[
"color"]) || count(
$_POST[
"color"]) == 0) {
 
 1993            $ilCtrl->redirect($this, 
"listColors");
 
 1995            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1997            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
 1998            $cgui->setHeaderText(
$lng->txt(
"sty_confirm_color_deletion"));
 
 1999            $cgui->setCancel(
$lng->txt(
"cancel"), 
"cancelColorDeletion");
 
 2000            $cgui->setConfirm(
$lng->txt(
"delete"), 
"deleteColor");
 
 2002            foreach (
$_POST[
"color"] as $c) {
 
 2006            $tpl->setContent($cgui->getHTML());
 
 2017        $ilCtrl->redirect($this, 
"listColors");
 
 2027        if (is_array(
$_POST[
"color"])) {
 
 2028            foreach (
$_POST[
"color"] as $c) {
 
 2029                $this->
object->removeColor($c);
 
 2033        $ilCtrl->redirect($this, 
"listColors");
 
 2051            $ilToolbar->addButton(
 
 2052                $this->lng->txt(
"sty_add_media_query"),
 
 2053                $ilCtrl->getLinkTarget($this, 
"addMediaQuery")
 
 2057        include_once(
"./Services/Style/Content/classes/class.ilStyleMediaQueryTableGUI.php");
 
 2063        $tpl->setContent($table_gui->getHTML());
 
 2074        $tpl->setContent($this->form_gui->getHTML());
 
 2088        $tpl->setContent($this->form_gui->getHTML());
 
 2100        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2103        $this->form_gui->setTitle(
$lng->txt(
"sty_add_media_query"));
 
 2107        $ti->setMaxLength(2000);
 
 2108        $this->form_gui->addItem($ti);
 
 2111        if ($a_mode == 
"create") {
 
 2112            $this->form_gui->addCommandButton(
"saveMediaQuery", 
$lng->txt(
"save"));
 
 2113            $this->form_gui->addCommandButton(
"listMediaQueries", 
$lng->txt(
"cancel"));
 
 2115            $this->form_gui->addCommandButton(
"updateMediaQuery", 
$lng->txt(
"save"));
 
 2116            $this->form_gui->addCommandButton(
"listMediaQueries", 
$lng->txt(
"cancel"));
 
 2118        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
 2126        if (
$_GET[
"mq_id"] != 
"") {
 
 2127            foreach ($this->object->getMediaQueries() as $mq) {
 
 2128                if ($mq[
"id"] == (
int) 
$_GET[
"mq_id"]) {
 
 2129                    $values[
"mquery"] = $mq[
"mquery"];
 
 2132            $this->form_gui->setValuesByArray($values);
 
 2147        if ($this->form_gui->checkInput()) {
 
 2148            $this->
object->addMediaQuery(
$_POST[
"mquery"]);
 
 2149            $ilCtrl->redirect($this, 
"listMediaQueries");
 
 2151        $this->form_gui->setValuesByPost();
 
 2152        $tpl->setContent($this->form_gui->getHTML());
 
 2166        if ($this->form_gui->checkInput()) {
 
 2167            $this->
object->updateMediaQuery((
int) 
$_GET[
"mq_id"], 
$_POST[
"mquery"]);
 
 2168            $ilCtrl->redirect($this, 
"listMediaQueries");
 
 2171        $this->form_gui->setValuesByPost();
 
 2172        $tpl->setContent($this->form_gui->getHTML());
 
 2184        if (!is_array(
$_POST[
"mq_id"]) || count(
$_POST[
"mq_id"]) == 0) {
 
 2186            $ilCtrl->redirect($this, 
"listMediaQueries");
 
 2188            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2190            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
 2191            $cgui->setHeaderText(
$lng->txt(
"sty_sure_del_mqueries"));
 
 2192            $cgui->setCancel(
$lng->txt(
"cancel"), 
"listMediaQueries");
 
 2193            $cgui->setConfirm(
$lng->txt(
"delete"), 
"deleteMediaQueries");
 
 2196                $mq = $this->
object->getMediaQueryForId($i);
 
 2197                $cgui->addItem(
"mq_id[]", 
$i, $mq[
"mquery"]);
 
 2200            $tpl->setContent($cgui->getHTML());
 
 2217                $this->
object->deleteMediaQuery($id);
 
 2220        $ilCtrl->redirect($this, 
"listMediaQueries");
 
 2233        if (is_array(
$_POST[
"order"])) {
 
 2234            $this->
object->saveMediaQueryOrder(
$_POST[
"order"]);
 
 2236        $ilCtrl->redirect($this, 
"listMediaQueries");
 
 2254        $ctype = 
$_GET[
"temp_type"];
 
 2257            $ilCtrl->setParameter($this, 
"temp_type", $ctype);
 
 2258            $_GET[
"temp_type"] = $ctype;
 
 2262        $ilTabs->setSubTabActive(
"sty_" . $ctype . 
"_templates");
 
 2266            if ($ctype == 
"table") {
 
 2267                $ilToolbar->addButton(
 
 2268                    $this->lng->txt(
"sty_generate_template"),
 
 2269                    $ilCtrl->getLinkTarget($this, 
"generateTemplate")
 
 2272            $ilToolbar->addButton(
 
 2273                $this->lng->txt(
"sty_add_template"),
 
 2274                $ilCtrl->getLinkTarget($this, 
"addTemplate")
 
 2281        include_once(
"./Services/Style/Content/classes/class.ilTableTemplatesTableGUI.php");
 
 2288        $tpl->setContent($table_gui->getHTML());
 
 2299        $tpl->setContent($this->form_gui->getHTML());
 
 2341        if ($a_small_mode) {
 
 2346        $ts = $a_style->getTemplate($a_t_id);
 
 2347        $t = $ts[
"classes"];
 
 2351            $p_content = 
'<PageContent><Table DataTable="y"';
 
 2352            if (
$t[
"row_head"] != 
"") {
 
 2353                $p_content.= 
' HeaderRows="1"';
 
 2355            if (
$t[
"row_foot"] != 
"") {
 
 2356                $p_content.= 
' FooterRows="1"';
 
 2358            if (
$t[
"col_head"] != 
"") {
 
 2359                $p_content.= 
' HeaderCols="1"';
 
 2361            if (
$t[
"col_foot"] != 
"") {
 
 2362                $p_content.= 
' FooterCols="1"';
 
 2364            $p_content.= 
' Template="' . $a_style->lookupTemplateName($a_t_id) . 
'">';
 
 2365            if (!$a_small_mode) {
 
 2366                $p_content.= 
'<Caption>' . 
$lng->txt(
"sty_caption") . 
'</Caption>';
 
 2368            for (
$i = 1; 
$i<=$kr; 
$i++) {
 
 2369                $p_content.= 
'<TableRow>';
 
 2370                for ($j = 1; $j<=$kc; $j++) {
 
 2371                    if ($a_small_mode) {
 
 2372                        $cell = 
'<div style="height:2px;"></div>';
 
 2376                    $p_content.= 
'<TableData><PageContent><Paragraph Characteristic="TableContent">' . $cell . 
'</Paragraph></PageContent></TableData>';
 
 2378                $p_content.= 
'</TableRow>';
 
 2380            $p_content.= 
'</Table></PageContent>';
 
 2384            include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
 2387            if ($a_small_mode) {
 
 2394            if (
$a_type == 
"vaccordion") {
 
 2395                $p_content = 
'<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
 
 2396                if ($a_small_mode) {
 
 2397                    $p_content.= 
' ContentWidth="70"';
 
 2399            } elseif (
$a_type == 
"haccordion") {
 
 2400                $p_content = 
'<PageContent><Tabs Type="HorizontalAccordion"';
 
 2401                if ($a_small_mode) {
 
 2402                    $p_content.= 
' ContentHeight="40"';
 
 2403                    $p_content.= 
' ContentWidth="70"';
 
 2404                    $c = 
'&nbsp;&nbsp;&nbsp;&nbsp;';
 
 2406                    $p_content.= 
' ContentHeight="40"';
 
 2408            } elseif (
$a_type == 
"carousel") {
 
 2409                $p_content = 
'<PageContent><Tabs HorizontalAlign="Left" Type="Carousel" ';
 
 2410                if ($a_small_mode) {
 
 2411                    $p_content.= 
' ContentWidth="70"';
 
 2416            $p_content.= 
' Template="' . $a_style->lookupTemplateName($a_t_id) . 
'">';
 
 2417            $p_content.= 
'<Tab><PageContent><Paragraph>' . $c . 
'</Paragraph></PageContent>';
 
 2418            $p_content.= 
'<TabCaption>' . 
$h . 
'</TabCaption>';
 
 2419            $p_content.= 
'</Tab>';
 
 2420            $p_content.= 
'</Tabs></PageContent>';
 
 2423        $txml = $a_style->getTemplateXML();
 
 2426        include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
 
 2431            $r_content.= 
"<style>.owl-carousel{ display:block !important; }</style>";
 
 2446        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2449        if ($a_mode == 
"create") {
 
 2450            $this->form_gui->setTitle(
$lng->txt(
"sty_add_template"));
 
 2452            $this->form_gui->setTitle(
$lng->txt(
"sty_edit_template"));
 
 2457        $name_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 2458        $name_input->setNoMatchMessage(
$lng->txt(
"sty_msg_color_must_only_include") . 
" A-Z, a-z, 1-9");
 
 2459        $name_input->setRequired(
true);
 
 2460        $name_input->setSize(30);
 
 2461        $name_input->setMaxLength(30);
 
 2462        $this->form_gui->addItem($name_input);
 
 2466        foreach ($scs as 
$sc => $st) {
 
 2468            $chars = $this->
object->getCharacteristics($st);
 
 2470            foreach ($chars as $char) {
 
 2474            $this->form_gui->addItem($sc_input);
 
 2477        if ($a_mode == 
"create") {
 
 2478            $this->form_gui->addCommandButton(
"saveTemplate", 
$lng->txt(
"save"));
 
 2479            $this->form_gui->addCommandButton(
"cancelTemplateSaving", 
$lng->txt(
"cancel"));
 
 2481            $this->form_gui->addCommandButton(
"refreshTemplate", 
$lng->txt(
"save_refresh"));
 
 2482            $this->form_gui->addCommandButton(
"updateTemplate", 
$lng->txt(
"save_return"));
 
 2483            $this->form_gui->addCommandButton(
"cancelTemplateSaving", 
$lng->txt(
"cancel"));
 
 2485        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
 2495        $ilCtrl->redirect($this, 
"listTemplates");
 
 2510        if ($this->form_gui->checkInput()) {
 
 2511            if ($this->object->templateExists(
$_POST[
"name"])) {
 
 2512                $name_input = $this->form_gui->getItemByPostVar(
"name");
 
 2513                $name_input->setAlert(
$lng->txt(
"sty_table_template_already_exists"));
 
 2517                    $classes[$tct] = 
$_POST[$tct . 
"_class"];
 
 2519                $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"], 
$_POST[
"name"], $classes);
 
 2520                $this->
object->writeTemplatePreview(
 
 2524                $ilCtrl->redirect($this, 
"listTemplates");
 
 2527        $this->form_gui->setValuesByPost();
 
 2528        $tpl->setContent($this->form_gui->getHTML());
 
 2543        if ($this->form_gui->checkInput()) {
 
 2544            if ($this->object->templateExists(
$_POST[
"name"]) &&
 
 2546                $name_input = $this->form_gui->getItemByPostVar(
"name");
 
 2547                $name_input->setAlert(
$lng->txt(
"sty_template_already_exists"));
 
 2551                    $classes[$tct] = 
$_POST[$tct . 
"_class"];
 
 2554                $this->
object->updateTemplate(
 
 2559                $this->
object->writeTemplatePreview(
 
 2564                    $ilCtrl->redirect($this, 
"listTemplates");
 
 2569        $this->form_gui->setValuesByPost();
 
 2581            "tpl.template_edit.html",
 
 2584            "Services/Style/Content" 
 2587        $a_tpl->setVariable(
"FORM", $this->form_gui->getHTML());
 
 2589        $tpl->setContent($a_tpl->get());
 
 2605        if (
$_GET[
"t_id"] > 0) {
 
 2606            $t = $this->
object->getTemplate(
$_GET[
"t_id"]);
 
 2608            $values[
"name"] = 
$t[
"name"];
 
 2610            foreach ($scs as $k => 
$type) {
 
 2611                $values[$k . 
"_class"] = 
$t[
"classes"][$k];
 
 2613            $this->form_gui->setValuesByArray($values);
 
 2626        if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0) {
 
 2628            $ilCtrl->redirect($this, 
"listTemplates");
 
 2630            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2632            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
 2633            $cgui->setHeaderText(
$lng->txt(
"sty_confirm_template_deletion"));
 
 2634            $cgui->setCancel(
$lng->txt(
"cancel"), 
"cancelTemplateDeletion");
 
 2635            $cgui->setConfirm(
$lng->txt(
"sty_del_template"), 
"deleteTemplate");
 
 2637            foreach (
$_POST[
"tid"] as $tid) {
 
 2638                $classes = $this->
object->getTemplateClasses($tid);
 
 2641                foreach ($classes as $cl) {
 
 2642                    if ($cl != 
"" && !$listed[$cl]) {
 
 2643                        $cl_str.= 
'<div>- ' .
 
 2645                        $listed[$cl]  = 
true;
 
 2648                if ($cl_str != 
"") {
 
 2649                    $cl_str = 
'<div style="padding-left:30px;" class="small">' .
 
 2650                        "<div><i>" . 
$lng->txt(
"sty_style_class") . 
"</i></div>" . $cl_str . 
"</div>";
 
 2652                $cgui->addItem(
"tid[]", $tid, $this->object->lookupTemplateName($tid) . $cl_str);
 
 2655            $cgui->addButton(
$lng->txt(
"sty_del_template_keep_classes"), 
"deleteTemplateKeepClasses");
 
 2657            $tpl->setContent($cgui->getHTML());
 
 2668        $ilCtrl->redirect($this, 
"listTemplates");
 
 2678        if (is_array(
$_POST[
"tid"])) {
 
 2679            foreach (
$_POST[
"tid"] as $tid) {
 
 2680                $this->
object->removeTemplate($tid);
 
 2684        $ilCtrl->redirect($this, 
"listTemplates");
 
 2694        if (is_array(
$_POST[
"tid"])) {
 
 2695            foreach (
$_POST[
"tid"] as $tid) {
 
 2696                $cls = $this->
object->getTemplateClasses($tid);
 
 2697                foreach ($cls as $k => $cls) {
 
 2698                    $ty = $this->
object->determineTemplateStyleClassType(
$_GET[
"temp_type"], $k);
 
 2700                    $this->
object->deleteCharacteristic($ty, $ta, $cls);
 
 2702                $this->
object->removeTemplate($tid);
 
 2706        $ilCtrl->redirect($this, 
"listTemplates");
 
 2717        $tpl->setContent($this->form_gui->getHTML());
 
 2728        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2731        $this->form_gui->setTitle(
$lng->txt(
"sty_generate_template"));
 
 2735        $name_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 2736        $name_input->setNoMatchMessage(
$lng->txt(
"sty_msg_color_must_only_include") . 
" A-Z, a-z, 1-9");
 
 2737        $name_input->setRequired(
true);
 
 2738        $name_input->setSize(30);
 
 2739        $name_input->setMaxLength(30);
 
 2740        $this->form_gui->addItem($name_input);
 
 2745            "coloredZebra" => 
$lng->txt(
"sty_table_template_colored_zebra"),
 
 2746            "bwZebra" => 
$lng->txt(
"sty_table_template_bw_zebra"),
 
 2747            "noZebra" => 
$lng->txt(
"sty_table_template_no_zebra")
 
 2750        $this->form_gui->addItem($bl_input);
 
 2753        include_once(
"./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
 
 2755        $num_input->setAllowPercentage(
false);
 
 2756        $num_input->setValue(
"3px");
 
 2757        $this->form_gui->addItem($num_input);
 
 2761        $num_input->setAllowPercentage(
false);
 
 2762        $num_input->setValue(
"10px");
 
 2763        $this->form_gui->addItem($num_input);
 
 2767        $cs = $this->
object->getColors();
 
 2769        foreach ($cs as $c) {
 
 2773        $this->form_gui->addItem($bc_input);
 
 2776        $lss = array(
"border" => 90, 
"header_text" => 70, 
"header_bg" => 0,
 
 2777            "cell1_text" => -60, 
"cell1_bg" => 90, 
"cell2_text" => -60, 
"cell2_bg" => 75);
 
 2778        foreach ($lss as $ls => $v) {
 
 2780            $l_input->setMaxValue(100);
 
 2781            $l_input->setMinValue(-100);
 
 2782            $l_input->setValue($v);
 
 2783            $l_input->setSize(4);
 
 2784            $l_input->setMaxLength(4);
 
 2785            $this->form_gui->addItem($l_input);
 
 2788        $this->form_gui->addCommandButton(
"templateGeneration", 
$lng->txt(
"generate"));
 
 2789        $this->form_gui->addCommandButton(
"cancelTemplateSaving", 
$lng->txt(
"cancel"));
 
 2790        $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
 
 2804        if ($this->form_gui->checkInput()) {
 
 2805            if ($this->object->templateExists(
$_POST[
"name"])) {
 
 2806                $name_input = $this->form_gui->getItemByPostVar(
"name");
 
 2807                $name_input->setAlert(
$lng->txt(
"sty_table_template_already_exists"));
 
 2812                $cells = array(
"H" => 
"header", 
"C1" => 
"cell1", 
"C2" => 
"cell2");
 
 2813                $tb_p = $this->form_gui->getItemByPostVar(
"tb_padding");
 
 2814                $tb_padding = $tb_p->getValue();
 
 2815                $lr_p = $this->form_gui->getItemByPostVar(
"lr_padding");
 
 2816                $lr_padding = $lr_p->getValue();
 
 2817                $cell_color = 
$_POST[
"base_color"];
 
 2820                if (
$_POST[
"layout"] == 
"bwZebra") {
 
 2821                    $cell_color = 
"MidGray";
 
 2822                    if (!$this->object->colorExists($cell_color)) {
 
 2823                        $this->
object->addColor($cell_color, 
"7F7F7F");
 
 2825                    $this->
object->updateColor($cell_color, $cell_color, 
"7F7F7F");
 
 2828                foreach ($cells as $k => $cell) {
 
 2829                    $cell_class[$k] = 
$_POST[
"name"] . $k;
 
 2830                    if (!$this->object->characteristicExists($cell_class[$k], 
"table_cell")) {
 
 2831                        $this->
object->addCharacteristic(
"table_cell", $cell_class[$k], 
true);
 
 2833                    if (
$_POST[
"layout"] == 
"bwZebra" && $k == 
"H") {
 
 2834                        $this->
object->replaceStylePar(
 
 2838                            "!" . 
$_POST[
"base_color"] . 
"(" . 
$_POST[
"lightness_" . $cell . 
"_text"] . 
")",
 
 2841                        $this->
object->replaceStylePar(
 
 2845                            "!" . 
$_POST[
"base_color"] . 
"(" . 
$_POST[
"lightness_" . $cell . 
"_bg"] . 
")",
 
 2849                        $this->
object->replaceStylePar(
 
 2853                            "!" . $cell_color . 
"(" . 
$_POST[
"lightness_" . $cell . 
"_text"] . 
")",
 
 2856                        $this->
object->replaceStylePar(
 
 2860                            "!" . $cell_color . 
"(" . 
$_POST[
"lightness_" . $cell . 
"_bg"] . 
")",
 
 2864                    $this->
object->replaceStylePar(
 
 2871                    $this->
object->replaceStylePar(
 
 2878                    $this->
object->replaceStylePar(
 
 2885                    $this->
object->replaceStylePar(
 
 2892                    $this->
object->replaceStylePar(
 
 2899                    $this->
object->replaceStylePar(
 
 2906                    $this->
object->replaceStylePar(
 
 2910                        "!" . $cell_color . 
"(" . 
$_POST[
"lightness_border"] . 
")",
 
 2913                    $this->
object->replaceStylePar(
 
 2923                $classes[
"table"] = 
$_POST[
"name"] . 
"T";
 
 2924                if (!$this->object->characteristicExists($classes[
"table"], 
"table")) {
 
 2925                    $this->
object->addCharacteristic(
"table", $classes[
"table"], 
true);
 
 2927                $this->
object->replaceStylePar(
 
 2934                $this->
object->replaceStylePar(
 
 2941                $this->
object->replaceStylePar(
 
 2948                $this->
object->replaceStylePar(
 
 2955                if (
$_POST[
"layout"] == 
"bwZebra") {
 
 2956                    $this->
object->replaceStylePar(
 
 2959                        "border-bottom-color",
 
 2960                        "!" . 
$_POST[
"base_color"],
 
 2963                    $this->
object->replaceStylePar(
 
 2966                        "border-bottom-style",
 
 2970                    $this->
object->replaceStylePar(
 
 2973                        "border-bottom-width",
 
 2977                    $sb = array(
"left", 
"right", 
"top");
 
 2978                    foreach ($sb as $b) {
 
 2979                        $this->
object->replaceStylePar(
 
 2982                            "border-" . $b . 
"-width",
 
 2989                switch (
$_POST[
"layout"]) {
 
 2990                    case "coloredZebra":
 
 2991                        $classes[
"row_head"] = $cell_class[
"H"];
 
 2992                        $classes[
"odd_row"] = $cell_class[
"C1"];
 
 2993                        $classes[
"even_row"] = $cell_class[
"C2"];
 
 2997                        $classes[
"row_head"] = $cell_class[
"H"];
 
 2998                        $classes[
"odd_row"] = $cell_class[
"C1"];
 
 2999                        $classes[
"even_row"] = $cell_class[
"C2"];
 
 3003                        $classes[
"row_head"] = $cell_class[
"H"];
 
 3004                        $classes[
"odd_row"] = $cell_class[
"C1"];
 
 3005                        $classes[
"even_row"] = $cell_class[
"C1"];
 
 3006                        $classes[
"col_head"] = $cell_class[
"C2"];
 
 3011                $t_id = $this->
object->addTemplate(
 
 3016                $this->
object->writeTemplatePreview(
 
 3020                $ilCtrl->redirect($this, 
"listTemplates");
 
 3023        $this->form_gui->setValuesByPost();
 
 3024        $tpl->setContent($this->form_gui->getHTML());
 
 3031        include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
 3034        $acc->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
 
 3035        $acc->addItem(
"Header 2", str_repeat(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
 
 3039        $ac2->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
 
 3040        $ac2->addItem(
"Header 2", $acc->getHTML());
 
 3043        $tpl->setContent($ac2->getHTML());
 
 3057        $ilCtrl->returnToParent($this);
 
if(php_sapi_name() !='cli') $in
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
Accordion user interface class.
static addCss()
Add required css.
Confirmation screen class.
Class ilObjStyleSheetGUI.
editTemplateObject()
Edit table template.
listImagesObject()
List images of style.
updateMediaQueryObject()
Update media query.
saveMediaQueryOrderObject()
Save media query order.
__construct($a_data, $a_id, $a_call_by_reference, $a_prep=true)
Constructor @access public.
cancelCharacteristicDeletionObject()
Cancel characteristic deletion.
generateTemplateObject()
Generate table template.
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
getAdminTabs()
admin and normal tabs are equal for roles
templateGenerationObject()
Table template generation.
getValues()
FORM: Get current values from persistent object.
refreshObject()
refresh style sheet
cancelUploadObject()
Cancel Upload.
cancelObject()
update style sheet
deleteImageObject()
Delete images.
exportStyleObject()
export style
deleteMediaQueryConfirmationObject()
Confirm media query deletion.
listMediaQueriesObject()
List media queries of style.
deleteCharacteristicConfirmationObject()
Characteristic deletion confirmation screen.
cancelTemplateDeletionObject()
Cancel table template deletion.
deleteColorObject()
Delete colors.
getPropertiesValues()
Get current values for properties from.
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
newStyleParameterObject()
add style parameter
afterImport(ilObject $a_new_obj)
After import.
addCharacteristicFormObject()
Add characteristic.
pasteCharacteristicsObject()
Paste characteristics.
editObject()
edit style sheet
deleteObject($a_error=false)
display deletion confirmation screen
refreshTemplateObject()
Refresh table template.
deleteTemplateObject()
Delete table template.
deleteColorConfirmationObject()
Delete color confirmation.
cancelColorDeletionObject()
Cancel color deletion.
deleteTemplateKeepClassesObject()
Delete table template.
getColorFormValues()
Set values for color editing.
getTemplateFormValues()
Set values for table template editing.
updateTagStyleObject()
save and refresh tag editing
initTemplateGenerationForm()
Init table template generation form.
deleteTemplateConfirmationObject()
Delete table template confirmation.
pasteCharacteristicsOverviewObject()
Paste characteristics overview.
saveHideStatusObject()
Save hide status for characteristics.
writeStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom=false)
initColorForm($a_mode="create")
Init color form.
cancelColorSavingObject()
Cancel color saving.
copyStyleObject()
save style sheet
outputTagStyleEditScreen()
Output tag style edit screen.
switchMQueryObject()
Switch media query.
addMediaQueryObject()
Add a media query.
updateObject()
Update properties.
addColorObject()
Add a color.
initTemplateForm($a_mode="create")
Init table template form.
deleteStyleParameterObject()
delete style parameters
displayTemplateEditForm()
Display table tempalte edit form.
updateTemplateObject($a_refresh=false)
Update table template.
static _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
addTemplateObject()
Add template.
importStyleObject()
import style sheet
deleteMediaQueriesObject()
Delete Media Queries.
initMediaQueryForm($a_mode="create")
Init media query form.
saveCharacteristicObject()
Save Characteristic.
copyCharacteristicsObject()
Copy style classes.
cancelDeleteObject()
cancel oobject deletion
refreshTagStyleObject()
save and refresh tag editing
saveTagStyle()
Save tag style.
editMediaQueryObject()
Edit media query.
executeCommand()
execute command
initImageForm()
Init image form.
editTagStyleObject()
Edit tag style.
confirmedDeleteObject()
delete selected style objects
saveObject()
save style sheet
saveColorObject()
Save color.
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
listColorsObject()
List colors of style.
setTemplatesSubTabs()
adds tabs to tab gui object
saveTemplateObject()
Save table template.
updateColorObject()
Update color.
getMediaQueryFormValues()
Set values for media query editing.
static getStyleExampleHTML($a_type, $a_class)
Get style example HTML.
viewObject()
list childs of current object
deleteCoreCharMessage()
Message that appears, when user tries to delete core characteristics.
addAdminLocatorItems($a_do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded)
uploadImageObject()
Upload image.
includeCSS()
Include CSS in output.
returnToUpperContextObject()
return to upper context
initCharacteristicForm($a_mode)
Init tag style editing form.
extractParametersOfTag($a_tag, $a_class, $a_style, $a_type, $a_mq_id=0, $a_custom=false)
propertiesObject()
Properties.
getTabs()
adds tabs to tab gui object
setSubTabs()
adds tabs to tab gui object
saveMediaQueryObject()
Save media query.
addImageObject()
Add an image.
listTemplatesObject()
List templates.
editColorObject()
Edit color.
cancelTemplateSavingObject()
Cancel color saving.
deleteCharacteristicObject()
Delete one or multiple style characteristic.
static _getStyleParameterInputType($par)
static _getTemplateClassTypes($a_template_type="")
Get template class types.
static _getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
static _getFilteredGroups()
static _getStyleParameters($a_tag="")
static _writeStandard($a_id, $a_std)
Write standard flag.
static _isExpandable($a_type)
static _determineTag($a_type)
static _getStyleSuperTypeForType($a_type)
static _lookupTemplateName($a_t_id)
Lookup table template name for template ID.
static _writeUpToDate($a_id, $a_up_to_date)
Write up to date.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static _getStyleSuperTypes()
static _getCoreStyles()
Get core styles.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _renderTable($content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true)
Static render table function.
Paste style overview table.
TableGUI class for style editor (image list)
TableGUI class for style editor (image list)
TableGUI class for style editor.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
if(!array_key_exists('StateId', $_REQUEST)) $id
if(function_exists( 'posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
redirection script todo: (a better solution should control the processing via a xml file)
if(empty($password)) $table
if(isset($_POST['submit'])) $form