16 require_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   17 require_once 
"./Services/Style/classes/class.ilObjStyleSheet.php";
 
   36                 $this->lng->loadLanguageModule(
"style");
 
   37                 $ilCtrl->saveParameter($this, array(
"tag", 
"style_type", 
"temp_type"));
 
   38                 if (
$_GET[
"style_type"] != 
"")
 
   44                 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference, 
false);
 
   52                 $next_class = $this->ctrl->getNextClass($this);
 
   53                 $cmd = $this->ctrl->getCmd(
"edit");
 
   83                 global $rbacsystem, 
$lng, 
$tpl, $ilHelp;
 
   88                 $ilHelp->setScreenIdComponent(
"sty");
 
   93                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
   95                 $form->setFormAction($this->ctrl->getFormAction($this));
 
   96                 $form->setTitle($this->lng->txt(
"sty_create_new_stylesheet"));
 
  102                 $ti->setRequired(
true);
 
  111                 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
 
  112                 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  119                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  121                 $form->setFormAction($this->ctrl->getFormAction($this));
 
  122                 $form->setTitle($this->lng->txt(
"sty_import_stylesheet"));
 
  125                 $ti = 
new ilFileInputGUI($this->lng->txt(
"import_file"), 
"stylefile");
 
  129                 $form->addCommandButton(
"importStyle", $this->lng->txt(
"import"));
 
  130                 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  137                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  139                 $form->setFormAction($this->ctrl->getFormAction($this));
 
  140                 $form->setTitle($this->lng->txt(
"sty_copy_other_stylesheet"));
 
  148                 $form->addCommandButton(
"copyStyle", $this->lng->txt(
"copy"));
 
  149                 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  163                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  164                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  165                         $this->object->getContentStylePath($this->object->getId()));
 
  166                 $this->tpl->parseCurrentBlock();
 
  180                 $ctpl = 
new ilTemplate(
"tpl.sty_classes.html", 
true, 
true, 
"Services/Style");
 
  183                 $chars = $this->
object->getCharacteristics();
 
  185                 $style_type = ($this->super_type != 
"")
 
  188                 $ilCtrl->setParameter($this, 
"style_type", $style_type);
 
  189                 $ilTabs->setSubTabActive(
"sty_".$style_type.
"_char");
 
  192                 if ($this->super_type == 
"rte")
 
  194                         $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
 
  195                         include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
 
  196                         $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
 
  201                 $subtypes = $all_super_types[$style_type];
 
  203                 foreach ($subtypes as 
$t)
 
  210                 if ($expandable && $rbacsystem->checkAccess(
"write", (
int) 
$_GET[
"ref_id"]))
 
  212                         $ilToolbar->addButton($lng->txt(
"sty_add_characteristic"),
 
  213                                 $ilCtrl->getLinkTarget($this, 
"addCharacteristicForm"));
 
  218                         $style_cp = explode(
":::", 
$_SESSION[
"sty_copy"]);
 
  219                         if ($style_cp[1] == $_GET[
"style_type"])
 
  223                                         $ilToolbar->addSeparator();
 
  225                                 $ilToolbar->addButton($lng->txt(
"sty_paste_style_classes"),
 
  226                                         $ilCtrl->getLinkTarget($this, 
"pasteCharacteristicsOverview"));
 
  230                 include_once(
"./Services/Style/classes/class.ilStyleTableGUI.php");
 
  234                 $ctpl->setCurrentBlock(
"style_table");
 
  235                 $ctpl->setVariable(
"STYLE_TABLE", $table_gui->getHTML());
 
  236                 $ctpl->parseCurrentBlock();
 
  238                 $this->tpl->setContent($ctpl->get());
 
  246                 global $rbacsystem, 
$lng, $ilToolbar;
 
  249                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  250                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  251                         $this->object->getContentStylePath($this->object->getId()));
 
  252                 $this->tpl->parseCurrentBlock();
 
  255                 $ilToolbar->addButton($this->lng->txt(
"export"),
 
  256                         $this->ctrl->getLinkTarget($this, 
"exportStyle"));
 
  260                 $this->tpl->setContent($this->form->getHTML());
 
  271                 $values[
"style_title"] = $this->
object->getTitle();
 
  272                 $values[
"style_description"] = $this->
object->getDescription();
 
  273                 $values[
"disable_auto_margins"] = (int) $this->object->lookupStyleSetting(
"disable_auto_margins");
 
  275                 $this->form->setValuesByArray($values);
 
  285                 global 
$lng, $rbacsystem;
 
  287                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  291                 $ti = 
new ilTextInputGUI($this->lng->txt(
"title"), 
"style_title");
 
  294                 $ti->setRequired(
true);
 
  295                 $this->form->addItem($ti);
 
  301                 $this->form->addItem($ta);
 
  304                 $cb = 
new ilCheckboxInputGUI($this->lng->txt(
"sty_disable_auto_margins"), 
"disable_auto_margins");
 
  305                 $cb->
setInfo($this->lng->txt(
"sty_disable_auto_margins_info"));
 
  306                 $this->form->addItem($cb);
 
  310                 if ($a_mode == 
"create")
 
  312                         $this->form->addCommandButton(
"save", $lng->txt(
"save"));
 
  313                         $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
 
  317                         if ($rbacsystem->checkAccess(
"write", (
int) 
$_GET[
"ref_id"]))
 
  319                                 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
 
  323                 $this->form->setTitle($lng->txt(
"edit_stylesheet"));
 
  324                 $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  336                 if ($this->form->checkInput())
 
  338                         $this->
object->setTitle($this->form->getInput(
"style_title"));
 
  339                         $this->
object->setDescription($this->form->getInput(
"style_description"));
 
  340                         $this->
object->writeStyleSetting(
"disable_auto_margins",
 
  341                                 $this->form->getInput(
"disable_auto_margins"));
 
  342                         $this->
object->update();
 
  344                         $ilCtrl->redirect($this, 
"properties");
 
  348                         $this->form->setValuesByPost();
 
  349                         $tpl->setContent($this->form->getHtml());
 
  360                 $cur = explode(
".",
$_GET[
"tag"]);
 
  362                 $cur_class = $cur[1];
 
  366                 if ($this->form_gui->checkInput())
 
  369                         $ilCtrl->redirect($this, 
"editTagStyle");
 
  373                         $this->form_gui->setValuesByPost();
 
  385                 $cur = explode(
".",
$_GET[
"tag"]);
 
  387                 $cur_class = $cur[1];
 
  390                 if ($this->form_gui->checkInput())
 
  393                         $ilCtrl->redirect($this, 
"edit");
 
  397                         $this->form_gui->setValuesByPost();
 
  407                 $cur = explode(
".", 
$_GET[
"tag"]);
 
  409                 $cur_class = $cur[1];
 
  411                 foreach ($avail_pars as $par => $v)
 
  413                         $var = str_replace(
"-", 
"_", $par);
 
  414                         $basepar_arr = explode(
".", $par);
 
  415                         $basepar = $basepar_arr[0];
 
  416                         if ($basepar_arr[1] != 
"" && $basepar_arr[1] != $cur_tag)
 
  424                                 case "numeric_no_perc":
 
  426                                 case "background_image":
 
  427                                         $in = $this->form_gui->getItemByPostVar($basepar);
 
  433                                         $color = trim(
$_POST[$basepar]);
 
  434                                         if ($color != 
"" && trim(substr($color,0,1) != 
"!"))
 
  444                                         $in = $this->form_gui->getItemByPostVar($basepar);
 
  445                                         $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][0], 
$in->getAllValue(), 
$_GET[
"style_type"]);
 
  446                                         $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][1], 
$in->getTopValue(), 
$_GET[
"style_type"]);
 
  447                                         $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][2], 
$in->getRightValue(), 
$_GET[
"style_type"]);
 
  448                                         $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][3], 
$in->getBottomValue(), 
$_GET[
"style_type"]);
 
  449                                         $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][4], 
$in->getLeftValue(), 
$_GET[
"style_type"]);
 
  453                                         $in = $this->form_gui->getItemByPostVar($basepar);
 
  454                                         $tblr_p = array (0 => 
"getAllValue", 1 => 
"getTopValue", 2 => 
"getRightValue", 
 
  455                                                 3 => 
"getBottomValue", 4 => 
"getLeftValue");
 
  456                                         foreach ($tblr_p as $k => $func)
 
  458                                                 $val = trim(
$in->$func());
 
  459                                                 $val = ((
$in->getAcceptNamedColors() && substr($val, 0, 1) == 
"!")
 
  463                                                 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][$k], $val, 
$_GET[
"style_type"]);
 
  478                                 case "background_position":
 
  479                                         $in = $this->form_gui->getItemByPostVar($basepar);
 
  489                 $this->
object->update();
 
  501                         $this->
object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type);
 
  505                         $this->
object->deleteStylePar($cur_tag, $cur_class, $par, $a_type);
 
  519                 if ($this->super_type == 
"rte")
 
  521                         $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
 
  522                         include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
 
  523                         $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
 
  526                 $cur = explode(
".",
$_GET[
"tag"]);
 
  528                 $cur_class = $cur[1];
 
  543                 $tpl->setCurrentBlock(
"ContentStyle");
 
  544                 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  545                         $this->object->getContentStylePath($this->object->getId()));
 
  547                 $ts_tpl = 
new ilTemplate(
"tpl.style_tag_edit.html", 
true, 
true, 
"Services/Style");
 
  549                 $cur = explode(
".",
$_GET[
"tag"]);
 
  551                 $cur_class = $cur[1];
 
  553                 $ts_tpl->setVariable(
"EXAMPLE",
 
  556                 $ts_tpl->setVariable(
"FORM",
 
  557                         $this->form_gui->getHtml());
 
  559                 $tpl->setTitle($cur_class.
" (".$lng->txt(
"sty_type_".$_GET[
"style_type"]).
")");
 
  561                 $tpl->setContent($ts_tpl->get());
 
  574                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  577                 $avail_pars = $this->
object->getAvailableParameters();
 
  578                 $groups = $this->
object->getStyleParameterGroups();
 
  581                 foreach ($groups as $k => $group)
 
  586                         if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
 
  592                         $sh->setTitle($lng->txt(
"sty_".$k));
 
  593                         $this->form_gui->addItem($sh);
 
  595                         foreach ($group as $par)
 
  597                                 $basepar = explode(
".", $par);
 
  598                                 $basepar = $basepar[0];
 
  600                                 $var = str_replace(
"-", 
"_", $basepar);
 
  601                                 $up_par = strtoupper($var);
 
  607                                                 $options = array(
"" => 
"");
 
  608                                                 foreach ($avail_pars[$par] as $p)
 
  613                                                 $this->form_gui->addItem($sel_input);
 
  617                                                 $text_input = 
new ilTextInputGUI($lng->txt(
"sty_".$var), $basepar);
 
  619                                                 $text_input->setSize(20);
 
  620                                                 $this->form_gui->addItem($text_input);
 
  624                                                 include_once(
"./Services/Style/classes/class.ilFontSizeInputGUI.php");
 
  626                                                 $this->form_gui->addItem($fs_input);
 
  629                                         case "numeric_no_perc":
 
  631                                                 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
 
  637                                                 $this->form_gui->addItem($num_input);
 
  643                                                 $per_input->setMaxValue(100);
 
  644                                                 $per_input->setMaxLength(3);
 
  645                                                 $per_input->setSize(3);
 
  646                                                 $this->form_gui->addItem($per_input);
 
  653                                                 $col_input->setAcceptNamedColors(
true);
 
  654                                                 $this->form_gui->addItem($col_input);
 
  658                                                 include_once(
"./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
 
  664                                                 $this->form_gui->addItem($num_input);
 
  668                                                 include_once(
"./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
 
  670                                                 $this->form_gui->addItem($bw_input);
 
  674                                                 include_once(
"./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
 
  676                                                 $this->form_gui->addItem($bw_input);
 
  680                                                 include_once(
"./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
 
  683                                                 $this->form_gui->addItem($col_input);
 
  686                                         case "background_image":
 
  687                                                 include_once(
"./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
 
  690                                                 foreach ($this->object->getImages() as $entry)
 
  692                                                         $imgs[] = $entry[
"entry"];
 
  695                                                 $this->form_gui->addItem($im_input);
 
  698                                         case "background_position":
 
  699                                                 include_once(
"./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
 
  701                                                 $this->form_gui->addItem($im_input);
 
  708                 $this->form_gui->addCommandButton(
"updateTagStyle", $lng->txt(
"save_return"));
 
  709                 $this->form_gui->addCommandButton(
"refreshTagStyle", $lng->txt(
"save_refresh"));
 
  712                 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
 
  721                 $style = $this->
object->getStyle();
 
  722                 $cur = explode(
".",
$_GET[
"tag"]);
 
  724                 $cur_class = $cur[1];
 
  728                 foreach($parameters as $p => $v)
 
  731                         if (is_array($filtered_groups[$v[
"group"]]) && !in_array($cur_tag, $filtered_groups[$v[
"group"]]))
 
  735                         $p = explode(
".", $p);
 
  737                         $input = $this->form_gui->getItemByPostVar($p);
 
  747                                         $input->setAllValue($cur_parameters[$v[
"subpar"][0]]);
 
  748                                         $input->setTopValue($cur_parameters[$v[
"subpar"][1]]);
 
  749                                         $input->setRightValue($cur_parameters[$v[
"subpar"][2]]);
 
  750                                         $input->setBottomValue($cur_parameters[$v[
"subpar"][3]]);
 
  751                                         $input->setLeftValue($cur_parameters[$v[
"subpar"][4]]);
 
  755                                         $input->setValue($cur_parameters[$p]);
 
  766                 $file = $this->
object->export();
 
  773                 $parameters = array();
 
  774                 foreach($a_style as $tag)
 
  776                         foreach($tag as $par)
 
  778                                 if ($par[
"tag"] == $a_tag && $par[
"class"] == $a_class
 
  779                                         && $par[
"type"] == $a_type)
 
  781                                         $parameters[$par[
"parameter"]] = $par[
"value"]; 
 
  793                 $this->
object->addParameter(
$_POST[
"tag"], 
$_POST[
"parameter"]);
 
  802                 $this->
object->setTitle(
$_POST[
"style_title"]);
 
  803                 $this->
object->setDescription(
$_POST[
"style_description"]);
 
  805                 foreach(
$_POST[
"styval"] as $id => $value)
 
  807                         $this->
object->updateStyleParameter($id, $value);
 
  809                 $this->
object->update();
 
  823                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  825                 $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  826                 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
 
  827                 $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelDelete");
 
  828                 $cgui->setConfirm($this->lng->txt(
"confirm"), 
"confirmedDelete");
 
  831                                         " ".ilObject::_lookupTitle($this->object->getId());             
 
  833                 $cgui->addItem(
"id[]", 
"", $caption);
 
  835                 $this->tpl->setContent($cgui->getHTML());
 
  844                 $this->ctrl->returnToParent($this);
 
  854                 $this->
object->delete();
 
  856                 $this->ctrl->returnToParent($this);
 
  864                 if (is_array(
$_POST[
"sty_select"]))
 
  866                         foreach(
$_POST[
"sty_select"] as $id => $dummy)
 
  868                                 $this->
object->deleteParameter($id);
 
  871                 $this->
object->read();
 
  872                 $this->
object->writeCSSFile();
 
  881                 if(!trim(
$_POST[
"style_title"]))
 
  883                         $this->ctrl->redirect($this, 
"create");
 
  887                 $class_name = 
"ilObjStyleSheet";
 
  888                 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
  890                 $newObj->setTitle(
"-");
 
  898                 if (
$_GET[
"ref_id"] > 0)
 
  902                         if ($fold->getType() == 
"stys")
 
  904                                 $fold->addStyle($newObj->getId());
 
  907                                 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui", 
"editContentStyles");
 
  911                 return $newObj->getId();
 
  921                 if (
$_POST[
"source_style"] > 0)
 
  922                 $style_obj =& $ilias->obj_factory->getInstanceByObjId(
$_POST[
"source_style"]);
 
  923                 $new_id = $style_obj->ilClone();
 
  927                 if (
$_GET[
"ref_id"] > 0)
 
  931                         if ($fold->getType() == 
"stys")
 
  933                                 $fold->addStyle($new_id);
 
  936                                 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui", 
"editContentStyles");
 
  949                 $source = $_FILES[
"stylefile"][
"tmp_name"];
 
  950                 if (($source == 
'none') || (!$source))
 
  952                         $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
 
  956                 $info = pathinfo($_FILES[
"stylefile"][
"name"]);
 
  957                 if (strtolower($info[
"extension"]) != 
"zip" && strtolower($info[
"extension"]) != 
"xml")
 
  959                         $this->ilias->raiseError(
"File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
 
  962                 $class_name = 
"ilObjStyleSheet";
 
  963                 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
  967                 $newObj->import($_FILES[
"stylefile"]);
 
  972                 if (
$_GET[
"ref_id"] > 0)
 
  976                         if ($fold->getType() == 
"stys")
 
  978                                 $fold->addStyle($newObj->getId());
 
  981                                 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui", 
"editContentStyles");
 
  985                 return $newObj->getId();
 
  996                 $this->ctrl->returnToParent($this);
 
 1014                 $this->
getTabs($this->tabs_gui);
 
 1016                 if (strtolower(get_class($this->
object)) == 
"ilobjstylesheet")
 
 1018                         $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
 
 1022                         $this->tpl->setVariable(
"HEADER", $lng->txt(
"create_stylesheet"));
 
 1035                 $ilHelp->setScreenIdComponent(
"sty");
 
 1037                 if ($ilCtrl->getCmd() == 
"editTagStyle")
 
 1040                         $tabs_gui->setBackTarget($lng->txt(
"back"),
 
 1041                                 $ilCtrl->getLinkTarget($this, 
"edit"));
 
 1043                         $t = explode(
".", 
$_GET[
"tag"]);
 
 1044                         $t2 = explode(
":", 
$t[1]);
 
 1045                         $pc = $this->
object->_getPseudoClasses(
$t[0]);
 
 1046                         if (is_array($pc) && count($pc) > 0)
 
 1049                                 $ilCtrl->setParameter($this, 
"tag", 
$t[0].
".".$t2[0]);
 
 1050                                 $tabs_gui->addTarget(
"sty_tag_normal",
 
 1051                                         $this->ctrl->getLinkTarget($this, 
"editTagStyle"), array(
"editTagStyle", 
""),
 
 1055                                         $ilTabs->setTabActive(
"sty_tag_normal");
 
 1061                                         $ilCtrl->setParameter($this, 
"tag", 
$t[0].
".".$t2[0].
":".$p);
 
 1062                                         $tabs_gui->addTarget(
"sty_tag_".$p,
 
 1063                                                 $this->ctrl->getLinkTarget($this, 
"editTagStyle"), array(
"editTagStyle", 
""),
 
 1067                                                 $ilTabs->setTabActive(
"sty_tag_".$p);
 
 1070                                 $ilCtrl->setParameter($this, 
"tag", 
$_GET[
"tag"]);
 
 1076                         $tabs_gui->setBackTarget($lng->txt(
"back"),
 
 1077                                 $this->ctrl->getLinkTarget($this, 
"returnToUpperContext"));
 
 1080                         $tabs_gui->addTarget(
"sty_style_chars",
 
 1081                                 $this->ctrl->getLinkTarget($this, 
"edit"), array(
"edit", 
""),
 
 1085                         $tabs_gui->addTarget(
"sty_colors",
 
 1086                                 $this->ctrl->getLinkTarget($this, 
"listColors"), 
"listColors",
 
 1090                         $tabs_gui->addTarget(
"sty_images",
 
 1091                                 $this->ctrl->getLinkTarget($this, 
"listImages"), 
"listImages",
 
 1095                         $tabs_gui->addTarget(
"sty_templates",
 
 1096                                 $this->ctrl->getLinkTarget($this, 
"listTemplates"), 
"listTemplates",
 
 1100                         $tabs_gui->addTarget(
"settings",
 
 1101                                 $this->ctrl->getLinkTarget($this, 
"properties"), 
"properties",
 
 1124                 foreach ($types as $super_type => $types)
 
 1127                         $ilCtrl->setParameter($this, 
"style_type", $super_type);
 
 1128                         $ilTabs->addSubTabTarget(
"sty_".$super_type.
"_char",
 
 1129                                 $this->ctrl->getLinkTarget($this, 
"edit"), array(
"edit", 
""),
 
 1133                 $ilCtrl->setParameter($this, 
"style_type", 
$_GET[
"style_type"]);
 
 1147                 foreach ($types as 
$t => $c)
 
 1149                         $ilCtrl->setParameter($this, 
"temp_type", 
$t);
 
 1150                         $ilTabs->addSubTabTarget(
"sty_".
$t.
"_templates",
 
 1151                                 $this->ctrl->getLinkTarget($this, 
"listTemplates"), array(
"listTemplates", 
""),
 
 1155                 $ilCtrl->setParameter($this, 
"temp_type", 
$_GET[
"temp_type"]);
 
 1166                 if (
$_GET[
"admin_mode"] == 
"settings")  
 
 1168                         $ilLocator->addItem($this->lng->txt(
"administration"),
 
 1169                                 $this->ctrl->getLinkTargetByClass(
"iladministrationgui", 
"frameset"),
 
 1174                                 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui", 
"view"));
 
 1176                         if (
$_GET[
"obj_id"] > 0)
 
 1178                                 $ilLocator->addItem($this->object->getTitle(),
 
 1179                                         $this->ctrl->getLinkTarget($this, 
"edit"));
 
 1193                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui")
 
 1196                                         $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
 
 1197                                                 "editContentStyles"));
 
 1212                 if ($rbacsystem->checkAccess(
"write", (
int) 
$_GET[
"ref_id"]))
 
 1214                         $ilToolbar->addButton($lng->txt(
"sty_add_image"),
 
 1215                                 $ilCtrl->getLinkTarget($this, 
"addImage"));
 
 1218                 include_once(
"./Services/Style/classes/class.ilStyleImageTableGUI.php");
 
 1221                 $tpl->setContent($table_gui->getHTML());
 
 1233                 $tpl->setContent($this->form_gui->getHTML());
 
 1243                 $ilCtrl->redirect($this, 
"listImages");
 
 1255                 if ($this->form_gui->checkInput())
 
 1257                         $this->
object->uploadImage($_FILES[
"image_file"]);
 
 1258                         $ilCtrl->redirect($this, 
"listImages");
 
 1263                         $tpl->setContent($this->form_gui->getHTML());
 
 1275                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1278                 $this->form_gui->setTitle($lng->txt(
"sty_add_image"));
 
 1282                 $this->form_gui->addItem($file_input);
 
 1284                 $this->form_gui->addCommandButton(
"uploadImage", $lng->txt(
"upload"));
 
 1285                 $this->form_gui->addCommandButton(
"cancelUpload", $lng->txt(
"cancel"));
 
 1286                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
 1296                 $images = $this->
object->getImages();
 
 1298                 foreach ($images as $image)
 
 1300                         if (is_array(
$_POST[
"file"]) && in_array($image[
"entry"], 
$_POST[
"file"]))
 
 1302                                 $this->
object->deleteImage($image[
"entry"]);
 
 1305                 $ilCtrl->redirect($this, 
"listImages");
 
 1317                 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
 
 1320                         $ilCtrl->redirect($this, 
"edit");
 
 1326                         foreach (
$_POST[
"char"] as $char)
 
 1328                                 if (!empty($core_styles[$char]))
 
 1335                         include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1337                         $cgui->setFormAction($ilCtrl->getFormAction($this));
 
 1338                         $cgui->setHeaderText($lng->txt(
"sty_confirm_char_deletion"));
 
 1339                         $cgui->setCancel($lng->txt(
"cancel"), 
"cancelCharacteristicDeletion");
 
 1340                         $cgui->setConfirm($lng->txt(
"delete"), 
"deleteCharacteristic");
 
 1342                         foreach (
$_POST[
"char"] as $char)
 
 1344                                 $char_comp = explode(
".", $char);
 
 1345                                 $cgui->addItem(
"char[]", $char, $char_comp[2]);
 
 1348                         $tpl->setContent($cgui->getHTML());
 
 1362                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1364                 $cgui->setFormAction($ilCtrl->getFormAction($this));
 
 1369                 foreach (
$_POST[
"char"] as $char)
 
 1371                         if (!empty($core_styles[$char]))
 
 1374                                 $char_comp = explode(
".", $char);
 
 1375                                 $cgui->addItem(
"", 
"", $char_comp[2]);
 
 1379                                 $cgui->addHiddenItem(
"char[]", $char);
 
 1382                 $all_core_styles = ($cnt == count(
$_POST[
"char"]))
 
 1386                 if ($all_core_styles)
 
 1388                         $cgui->setHeaderText($lng->txt(
"sty_all_styles_obligatory"));
 
 1389                         $cgui->setCancel($lng->txt(
"back"), 
"cancelCharacteristicDeletion");
 
 1393                         $cgui->setHeaderText($lng->txt(
"sty_some_styles_obligatory_delete_rest"));
 
 1394                         $cgui->setCancel($lng->txt(
"cancel"), 
"cancelCharacteristicDeletion");
 
 1395                         $cgui->setConfirm($lng->txt(
"sty_delete_other_selected"), 
"deleteCharacteristicConfirmation");
 
 1398                 $tpl->setContent($cgui->getHTML());
 
 1409                 $ilCtrl->redirect($this, 
"edit");
 
 1419                 if (is_array(
$_POST[
"char"]))
 
 1421                         foreach(
$_POST[
"char"] as $char)
 
 1423                                 $char_comp = explode(
".", $char);
 
 1424                                 $type = $char_comp[0];
 
 1425                                 $tag = $char_comp[1];
 
 1426                                 $class = $char_comp[2];
 
 1428                                 $this->
object->deleteCharacteristic($type, $tag, $class);
 
 1432                 $ilCtrl->redirect($this, 
"edit");
 
 1443                 $tpl->setContent($this->form_gui->getHTML());
 
 1455                 if ($this->form_gui->checkInput())
 
 1457                         if ($this->object->characteristicExists(
$_POST[
"new_characteristic"], 
$_GET[
"style_type"]))
 
 1459                                 $char_input = $this->form_gui->getItemByPostVar(
"new_characteristic");
 
 1460                                 $char_input->setAlert($lng->txt(
"sty_characteristic_already_exists"));
 
 1464                                 $this->
object->addCharacteristic(
$_POST[
"type"], 
$_POST[
"new_characteristic"]);
 
 1466                                 $ilCtrl->setParameter($this, 
"tag",
 
 1468                                 $ilCtrl->setParameter($this, 
"style_type", $_POST[
"type"]);
 
 1469                                 $ilCtrl->redirect($this, 
"editTagStyle");
 
 1472                 $this->form_gui->setValuesByPost();
 
 1473                 $tpl->setContent($this->form_gui->getHTML());
 
 1485                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1489                 $txt_input = 
new ilRegExpInputGUI($lng->txt(
"title"), 
"new_characteristic");
 
 1490                 $txt_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 1491                 $txt_input->setNoMatchMessage($lng->txt(
"sty_msg_characteristic_must_only_include").
" A-Z, a-z, 1-9");
 
 1492                 $txt_input->setRequired(
true);
 
 1493                 $this->form_gui->addItem($txt_input);
 
 1497                 $types = $all_super_types[$this->super_type];
 
 1498                 $exp_types = array();
 
 1499                 foreach($types as 
$t)
 
 1503                                 $exp_types[
$t] = $lng->txt(
"sty_type_".$t);
 
 1506                 if (count($exp_types) > 1)
 
 1510                         $type_input->setValue(key($exp_types));
 
 1511                         $this->form_gui->addItem($type_input);
 
 1513                 else if (count($exp_types) == 1)
 
 1516                         $hid_input->setValue(key($exp_types));
 
 1517                         $this->form_gui->addItem($hid_input);
 
 1520                 $this->form_gui->setTitle($lng->txt(
"sty_add_characteristic"));
 
 1521                 $this->form_gui->addCommandButton(
"saveCharacteristic", $lng->txt(
"save"));
 
 1522                 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"cancel"));
 
 1523                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
 1533                 $c = explode(
":", $a_class);
 
 1536                 $ex_tpl = 
new ilTemplate(
"tpl.style_example.html", 
true, 
true, 
"Services/Style");
 
 1538                 $ex_tpl->setCurrentBlock(
"Example_".$a_type);
 
 1539                 $ex_tpl->setVariable(
"EX_CLASS", 
"ilc_".$a_type.
"_".$a_class);
 
 1540                 $ex_tpl->setVariable(
"EX_TEXT", 
"ABC abc 123");
 
 1541                 if (in_array($a_type, array(
"media_cont", 
"qimg")))
 
 1545                 if (in_array($a_type, array(
"table", 
"table_caption")))
 
 1547                         $ex_tpl->setVariable(
"TXT_CAPTION", $lng->txt(
"sty_caption"));
 
 1549                 if (in_array($a_class, array(
"OrderListItemHorizontal", 
"OrderListHorizontal")))
 
 1551                         $ex_tpl->setVariable(
"HOR", 
"Horizontal");
 
 1553                 $ex_tpl->parseCurrentBlock();
 
 1555                 return $ex_tpl->get();
 
 1567                 foreach (
$_POST[
"all_chars"] as $char)
 
 1569                         $ca = explode(
".", $char);
 
 1570                         $this->
object->saveHideStatus($ca[0], $ca[2],
 
 1571                                 (is_array(
$_POST[
"hide"]) && in_array($char, 
$_POST[
"hide"])));
 
 1575                 $ilCtrl->redirect($this, 
"edit");
 
 1588                 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
 
 1594                         $style_cp = implode(
"::", 
$_POST[
"char"]);
 
 1595                         $style_cp = $this->
object->getId().
":::".
$_GET[
"style_type"].
":::".$style_cp;
 
 1599                 $ilCtrl->redirect($this, 
"edit");
 
 1610                 global 
$tpl, $ilTabs;
 
 1612                 $ilTabs->clearTargets();
 
 1614                 include_once(
"./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
 
 1617                 $tpl->setContent($table->getHTML());
 
 1630                 if (is_array(
$_POST[
"title"]))
 
 1632                         foreach (
$_POST[
"title"] as $from_char => $to_title)
 
 1634                                 $fc = explode(
".", $from_char);
 
 1636                                 if (
$_POST[
"conflict_action"][$from_char] == 
"overwrite" ||
 
 1637                                         !$this->object->characteristicExists($to_title, $fc[0]))
 
 1639                                         $this->
object->copyCharacteristic(
$_POST[
"from_style_id"],
 
 1640                                                 $fc[0], $fc[2], $to_title);
 
 1648                 $ilCtrl->redirect($this, 
"edit");
 
 1662                 if ($rbacsystem->checkAccess(
"write", (
int) 
$_GET[
"ref_id"]))
 
 1664                         $ilToolbar->addButton($this->lng->txt(
"sty_add_color"),
 
 1665                                 $ilCtrl->getLinkTarget($this, 
"addColor"));
 
 1668                 include_once(
"./Services/Style/classes/class.ilStyleColorTableGUI.php");
 
 1671                 $tpl->setContent($table_gui->getHTML());
 
 1683                 $tpl->setContent($this->form_gui->getHTML());
 
 1693                 $ilCtrl->setParameter($this, 
"c_name", 
$_GET[
"c_name"]);
 
 1696                 $tpl->setContent($this->form_gui->getHTML());
 
 1707                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1710                 $this->form_gui->setTitle($lng->txt(
"sty_add_color"));
 
 1713                 $name_input = 
new ilRegExpInputGUI($lng->txt(
"sty_color_name"), 
"color_name");
 
 1714                 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 1715                 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
 
 1716                 $name_input->setRequired(
true);
 
 1717                 $name_input->setSize(15);
 
 1718                 $name_input->setMaxLength(15);
 
 1719                 $this->form_gui->addItem($name_input);
 
 1724                 $color_input->setDefaultColor(
"");
 
 1725                 $this->form_gui->addItem($color_input);
 
 1727                 if ($a_mode == 
"create")
 
 1729                         $this->form_gui->addCommandButton(
"saveColor", $lng->txt(
"save"));
 
 1730                         $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
 
 1734                         $this->form_gui->addCommandButton(
"updateColor", $lng->txt(
"save"));
 
 1735                         $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
 
 1737                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
 1745                 if (
$_GET[
"c_name"] != 
"")
 
 1747                         $values[
"color_name"] = 
$_GET[
"c_name"];
 
 1748                         $values[
"color_code"] = $this->
object->getColorCodeForName(
$_GET[
"c_name"]);
 
 1749                         $this->form_gui->setValuesByArray($values);
 
 1760                 $ilCtrl->redirect($this, 
"listColors");
 
 1772                 if ($this->form_gui->checkInput())
 
 1774                         if ($this->object->colorExists(
$_POST[
"color_name"]))
 
 1776                                 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
 
 1777                                 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
 
 1781                                 $this->
object->addColor(
$_POST[
"color_name"],
 
 1783                                 $ilCtrl->redirect($this, 
"listColors");
 
 1786                 $this->form_gui->setValuesByPost();
 
 1787                 $tpl->setContent($this->form_gui->getHTML());
 
 1799                 if ($this->form_gui->checkInput())
 
 1801                         if ($this->object->colorExists(
$_POST[
"color_name"]) &&
 
 1804                                 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
 
 1805                                 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
 
 1809                                 $this->
object->updateColor(
$_GET[
"c_name"], 
$_POST[
"color_name"],
 
 1811                                 $ilCtrl->redirect($this, 
"listColors");
 
 1814                 $ilCtrl->setParameter($this, 
"c_name", 
$_GET[
"c_name"]);
 
 1815                 $this->form_gui->setValuesByPost();
 
 1816                 $tpl->setContent($this->form_gui->getHTML());
 
 1826                 if (!is_array(
$_POST[
"color"]) || count(
$_POST[
"color"]) == 0)
 
 1829                         $ilCtrl->redirect($this, 
"listColors");
 
 1833                         include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1835                         $cgui->setFormAction($ilCtrl->getFormAction($this));
 
 1836                         $cgui->setHeaderText($lng->txt(
"sty_confirm_color_deletion"));
 
 1837                         $cgui->setCancel($lng->txt(
"cancel"), 
"cancelColorDeletion");
 
 1838                         $cgui->setConfirm($lng->txt(
"delete"), 
"deleteColor");
 
 1840                         foreach (
$_POST[
"color"] as $c)
 
 1845                         $tpl->setContent($cgui->getHTML());
 
 1856                 $ilCtrl->redirect($this, 
"listColors");
 
 1866                 if (is_array(
$_POST[
"color"]))
 
 1868                         foreach (
$_POST[
"color"] as $c)
 
 1870                                 $this->
object->removeColor($c);
 
 1874                 $ilCtrl->redirect($this, 
"listColors");
 
 1888                 $ctype = 
$_GET[
"temp_type"];
 
 1892                         $ilCtrl->setParameter($this, 
"temp_type", $ctype);
 
 1893                         $_GET[
"temp_type"] = $ctype;
 
 1897                 $ilTabs->setSubTabActive(
"sty_".$ctype.
"_templates");
 
 1900                 include_once(
"./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
 
 1903                 $tpl->setContent($table_gui->getHTML());
 
 1915                 $tpl->setContent($this->form_gui->getHTML());
 
 1925                 $ilCtrl->setParameter($this, 
"t_id", 
$_GET[
"t_id"]);
 
 1938                         $this->
object, $a_type, $a_t_id, $a_small_mode);
 
 1955                 $ts = $a_style->getTemplate($a_t_id);
 
 1956                 $t = $ts[
"classes"];
 
 1959                 if ($a_type == 
"table")
 
 1961                         $p_content = 
'<PageContent><Table DataTable="y"';
 
 1962                         if (
$t[
"row_head"] != 
"")
 
 1964                                 $p_content.= 
' HeaderRows="1"';
 
 1966                         if (
$t[
"row_foot"] != 
"")
 
 1968                                 $p_content.= 
' FooterRows="1"';
 
 1970                         if (
$t[
"col_head"] != 
"")
 
 1972                                 $p_content.= 
' HeaderCols="1"';
 
 1974                         if (
$t[
"col_foot"] != 
"")
 
 1976                                 $p_content.= 
' FooterCols="1"';
 
 1978                         $p_content.= 
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
 
 1981                                 $p_content.= 
'<Caption>'.$lng->txt(
"sty_caption").
'</Caption>';
 
 1983                         for($i = 1; $i<=$kr; $i++)
 
 1985                                 $p_content.= 
'<TableRow>';
 
 1986                                 for($j = 1; $j<=$kc; $j++)
 
 1990                                                 $cell = 
'<div style="height:2px;"></div>';
 
 1996                                         $p_content.= 
'<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.
'</Paragraph></PageContent></TableData>';
 
 1998                                 $p_content.= 
'</TableRow>';
 
 2000                         $p_content.= 
'</Table></PageContent>';
 
 2003                 if ($a_type == 
"vaccordion" || $a_type == 
"haccordion")
 
 2005                         include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
 2018                         if ($a_type == 
"vaccordion")
 
 2020                                 $p_content = 
'<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
 
 2023                                         $p_content.= 
' ContentWidth="70"';
 
 2028                                 $p_content = 
'<PageContent><Tabs Type="HorizontalAccordion"';
 
 2031                                         $p_content.= 
' ContentHeight="40"';
 
 2032                                         $p_content.= 
' ContentWidth="70"';
 
 2033                                         $c = 
'&nbsp;&nbsp;&nbsp;&nbsp;';
 
 2037                                         $p_content.= 
' ContentHeight="40"';
 
 2040                         $p_content.= 
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
 
 2041                         $p_content.= 
'<Tab><PageContent><Paragraph>'.$c.
'</Paragraph></PageContent>';
 
 2042                         $p_content.= 
'<TabCaption>'.$h.
'</TabCaption>';
 
 2043                         $p_content.= 
'</Tab>';
 
 2044                         $p_content.= 
'</Tabs></PageContent>';
 
 2047                 $txml = $a_style->getTemplateXML();
 
 2050                 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
 
 2063                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2066                 if ($a_mode == 
"create")
 
 2068                         $this->form_gui->setTitle($lng->txt(
"sty_add_template"));
 
 2072                         $this->form_gui->setTitle($lng->txt(
"sty_edit_template"));
 
 2076                 $name_input = 
new ilRegExpInputGUI($lng->txt(
"sty_template_name"), 
"name");
 
 2077                 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 2078                 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
 
 2079                 $name_input->setRequired(
true);
 
 2080                 $name_input->setSize(30);
 
 2081                 $name_input->setMaxLength(30);
 
 2082                 $this->form_gui->addItem($name_input);
 
 2086                 foreach ($scs as $sc => $st)
 
 2088                         $sc_input = 
new ilSelectInputGUI($lng->txt(
"sty_".$sc.
"_class"), $sc.
"_class");
 
 2089                         $chars = $this->
object->getCharacteristics($st);
 
 2090                         $options = array(
"" => 
"");
 
 2091                         foreach($chars as $char)
 
 2093                                 $options[$char] = $char;
 
 2095                         $sc_input->setOptions($options);
 
 2096                         $this->form_gui->addItem($sc_input);
 
 2099                 if ($a_mode == 
"create")
 
 2101                         $this->form_gui->addCommandButton(
"saveTemplate", $lng->txt(
"save"));
 
 2102                         $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
 
 2106                         $this->form_gui->addCommandButton(
"refreshTemplate", $lng->txt(
"save_refresh"));
 
 2107                         $this->form_gui->addCommandButton(
"updateTemplate", $lng->txt(
"save_return"));
 
 2108                         $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
 
 2110                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
 2120                 $ilCtrl->redirect($this, 
"listTemplates");
 
 2133                 if ($this->form_gui->checkInput())
 
 2135                         if ($this->object->templateExists(
$_POST[
"name"]))
 
 2137                                 $name_input = $this->form_gui->getItemByPostVar(
"name");
 
 2138                                 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
 
 2145                                         $classes[$tct] = 
$_POST[$tct.
"_class"];
 
 2147                                 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"], 
$_POST[
"name"], $classes);
 
 2148                                 $this->
object->writeTemplatePreview($t_id,
 
 2150                                 $ilCtrl->redirect($this, 
"listTemplates");
 
 2153                 $this->form_gui->setValuesByPost();
 
 2154                 $tpl->setContent($this->form_gui->getHTML());
 
 2164                 $ilCtrl->setParameter($this, 
"t_id", 
$_GET[
"t_id"]);
 
 2167                 if ($this->form_gui->checkInput())
 
 2169                         if ($this->object->templateExists(
$_POST[
"name"]) &&
 
 2172                                 $name_input = $this->form_gui->getItemByPostVar(
"name");
 
 2173                                 $name_input->setAlert($lng->txt(
"sty_template_already_exists"));
 
 2180                                         $classes[$tct] = 
$_POST[$tct.
"_class"];
 
 2183                                 $this->
object->updateTemplate(
$_GET[
"t_id"],
 
 2184                                         $_POST[
"name"], $classes);
 
 2185                                 $this->
object->writeTemplatePreview(
$_GET[
"t_id"],
 
 2189                                         $ilCtrl->redirect($this, 
"listTemplates");
 
 2194                 $this->form_gui->setValuesByPost();
 
 2205                 $a_tpl = 
new ilTemplate(
"tpl.template_edit.html", 
true, 
true,
 
 2208                 $a_tpl->setVariable(
"FORM", $this->form_gui->getHTML());
 
 2210                 $tpl->setContent($a_tpl->get());
 
 2226                 if (
$_GET[
"t_id"] > 0)
 
 2228                         $t = $this->
object->getTemplate(
$_GET[
"t_id"]);
 
 2230                         $values[
"name"] = 
$t[
"name"];
 
 2232                         foreach ($scs as $k => $type)
 
 2234                                 $values[$k.
"_class"] = 
$t[
"classes"][$k];
 
 2236                         $this->form_gui->setValuesByArray($values);
 
 2247                 if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0)
 
 2250                         $ilCtrl->redirect($this, 
"listTemplates");
 
 2254                         include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2256                         $cgui->setFormAction($ilCtrl->getFormAction($this));
 
 2257                         $cgui->setHeaderText($lng->txt(
"sty_confirm_template_deletion"));
 
 2258                         $cgui->setCancel($lng->txt(
"cancel"), 
"cancelTemplateDeletion");
 
 2259                         $cgui->setConfirm($lng->txt(
"sty_del_template"), 
"deleteTemplate");
 
 2261                         foreach (
$_POST[
"tid"] as $tid)
 
 2263                                 $classes = $this->
object->getTemplateClasses($tid);
 
 2266                                 foreach ($classes as $cl)
 
 2268                                         if ($cl != 
"" && !$listed[$cl])
 
 2270                                                 $cl_str.= 
'<div>- '.
 
 2272                                                 $listed[$cl]  = 
true;
 
 2277                                         $cl_str = 
'<div style="padding-left:30px;" class="small">'.
 
 2278                                                 "<div><i>".$lng->txt(
"sty_style_class").
"</i></div>".$cl_str.
"</div>";
 
 2280                                 $cgui->addItem(
"tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
 
 2283                         $cgui->addButton($lng->txt(
"sty_del_template_keep_classes"), 
"deleteTemplateKeepClasses");
 
 2285                         $tpl->setContent($cgui->getHTML());
 
 2296                 $ilCtrl->redirect($this, 
"listTemplates");
 
 2306                 if (is_array(
$_POST[
"tid"]))
 
 2308                         foreach (
$_POST[
"tid"] as $tid)
 
 2310                                 $this->
object->removeTemplate($tid);
 
 2314                 $ilCtrl->redirect($this, 
"listTemplates");
 
 2324                 if (is_array(
$_POST[
"tid"]))
 
 2326                         foreach (
$_POST[
"tid"] as $tid)
 
 2328                                 $cls = $this->
object->getTemplateClasses($tid);
 
 2329                                 foreach ($cls as $k => $cls)
 
 2331                                         $ty = $this->
object->determineTemplateStyleClassType(
$_GET[
"temp_type"], $k);
 
 2333                                         $this->
object->deleteCharacteristic($ty, $ta, $cls);
 
 2335                                 $this->
object->removeTemplate($tid);
 
 2339                 $ilCtrl->redirect($this, 
"listTemplates");
 
 2350                 $tpl->setContent($this->form_gui->getHTML());
 
 2360                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2363                 $this->form_gui->setTitle($lng->txt(
"sty_generate_template"));
 
 2366                 $name_input = 
new ilRegExpInputGUI($lng->txt(
"sty_template_name"), 
"name");
 
 2367                 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
 
 2368                 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
 
 2369                 $name_input->setRequired(
true);
 
 2370                 $name_input->setSize(30);
 
 2371                 $name_input->setMaxLength(30);
 
 2372                 $this->form_gui->addItem($name_input);
 
 2375                 $bl_input = 
new ilSelectInputGUI($lng->txt(
"sty_template_layout"), 
"layout");
 
 2377                         "coloredZebra" => $lng->txt(
"sty_table_template_colored_zebra"),
 
 2378                         "bwZebra" => $lng->txt(
"sty_table_template_bw_zebra"),
 
 2379                         "noZebra" => $lng->txt(
"sty_table_template_no_zebra")
 
 2382                 $this->form_gui->addItem($bl_input);
 
 2385                 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
 
 2388                 $num_input->setValue(
"3px");
 
 2389                 $this->form_gui->addItem($num_input);
 
 2394                 $num_input->setValue(
"10px");
 
 2395                 $this->form_gui->addItem($num_input);
 
 2398                 $bc_input = 
new ilSelectInputGUI($lng->txt(
"sty_base_color"), 
"base_color");
 
 2399                 $cs = $this->
object->getColors();
 
 2403                         $options[$c[
"name"]] = $c[
"name"];
 
 2406                 $this->form_gui->addItem($bc_input);
 
 2409                 $lss = array(
"border" => 90, 
"header_text" => 70, 
"header_bg" => 0,
 
 2410                         "cell1_text" => -60, 
"cell1_bg" => 90, 
"cell2_text" => -60, 
"cell2_bg" => 75);
 
 2411                 foreach ($lss as $ls => $v)
 
 2413                         $l_input = 
new ilNumberInputGUI($lng->txt(
"sty_lightness_".$ls), 
"lightness_".$ls);
 
 2415                         $l_input->setMinValue(-100);
 
 2416                         $l_input->setValue($v);
 
 2417                         $l_input->setSize(4);
 
 2418                         $l_input->setMaxLength(4);
 
 2419                         $this->form_gui->addItem($l_input);
 
 2422                 $this->form_gui->addCommandButton(
"templateGeneration", $lng->txt(
"generate"));
 
 2423                 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
 
 2424                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
 2436                 if ($this->form_gui->checkInput())
 
 2438                         if ($this->object->templateExists(
$_POST[
"name"]))
 
 2440                                 $name_input = $this->form_gui->getItemByPostVar(
"name");
 
 2441                                 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
 
 2448                                 $cells = array(
"H" => 
"header", 
"C1" => 
"cell1", 
"C2" => 
"cell2");
 
 2449                                 $tb_p = $this->form_gui->getItemByPostVar(
"tb_padding");
 
 2450                                 $tb_padding = $tb_p->getValue();
 
 2451                                 $lr_p = $this->form_gui->getItemByPostVar(
"lr_padding");
 
 2452                                 $lr_padding = $lr_p->getValue();
 
 2453                                 $cell_color = 
$_POST[
"base_color"];
 
 2456                                 if (
$_POST[
"layout"] == 
"bwZebra")
 
 2458                                         $cell_color = 
"MidGray";
 
 2459                                         if (!$this->object->colorExists($cell_color))
 
 2461                                                 $this->
object->addColor($cell_color, 
"7F7F7F");
 
 2463                                         $this->
object->updateColor($cell_color, $cell_color, 
"7F7F7F");
 
 2466                                 foreach ($cells as $k => $cell)
 
 2468                                         $cell_class[$k] = 
$_POST[
"name"].$k;
 
 2469                                         if (!$this->object->characteristicExists($cell_class[$k], 
"table_cell"))
 
 2471                                                 $this->
object->addCharacteristic(
"table_cell", $cell_class[$k], 
true);
 
 2473                                         if (
$_POST[
"layout"] == 
"bwZebra" && $k == 
"H")
 
 2475                                                 $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"color",
 
 2476                                                         "!".
$_POST[
"base_color"].
"(".
$_POST[
"lightness_".$cell.
"_text"].
")", 
"table_cell");
 
 2477                                                 $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"background-color",
 
 2478                                                         "!".$_POST[
"base_color"].
"(".$_POST[
"lightness_".$cell.
"_bg"].
")", 
"table_cell");
 
 2482                                                 $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"color",
 
 2483                                                         "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_text"].
")", 
"table_cell");
 
 2484                                                 $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"background-color",
 
 2485                                                         "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_bg"].
")", 
"table_cell");
 
 2487                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"padding-top",
 
 2488                                                 $tb_padding, 
"table_cell");
 
 2489                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"padding-bottom",
 
 2490                                                 $tb_padding, 
"table_cell");
 
 2491                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"padding-left",
 
 2492                                                 $lr_padding, 
"table_cell");
 
 2493                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"padding-right",
 
 2494                                                 $lr_padding, 
"table_cell");
 
 2495                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"border-width",
 
 2496                                                 "1px", 
"table_cell");
 
 2497                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"border-style",
 
 2498                                                 "solid", 
"table_cell");
 
 2499                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"border-color",
 
 2500                                                 "!".$cell_color.
"(".
$_POST[
"lightness_border"].
")", 
"table_cell");
 
 2501                                         $this->
object->replaceStylePar(
"td", $cell_class[$k], 
"font-weight",
 
 2502                                                 "normal", 
"table_cell");
 
 2506                                 $classes[
"table"] = 
$_POST[
"name"].
"T";
 
 2507                                 if (!$this->object->characteristicExists($classes[
"table"], 
"table"))
 
 2509                                                 $this->
object->addCharacteristic(
"table", $classes[
"table"], 
true);
 
 2511                                 $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"caption-side",
 
 2513                                 $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"border-collapse",
 
 2514                                         "collapse", 
"table");
 
 2515                                 $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"margin-top",
 
 2517                                 $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"margin-bottom",
 
 2519                                 if (
$_POST[
"layout"] == 
"bwZebra")
 
 2521                                         $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"border-bottom-color",
 
 2522                                                 "!".
$_POST[
"base_color"], 
"table");
 
 2523                                         $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"border-bottom-style",
 
 2525                                         $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"border-bottom-width",
 
 2527                                         $sb = array(
"left", 
"right", 
"top");
 
 2530                                                 $this->
object->replaceStylePar(
"table", $classes[
"table"], 
"border-".$b.
"-width",
 
 2535                                 switch (
$_POST[
"layout"])
 
 2537                                         case "coloredZebra":
 
 2538                                                 $classes[
"row_head"] = $cell_class[
"H"];
 
 2539                                                 $classes[
"odd_row"] = $cell_class[
"C1"];
 
 2540                                                 $classes[
"even_row"] = $cell_class[
"C2"];
 
 2544                                                 $classes[
"row_head"] = $cell_class[
"H"];
 
 2545                                                 $classes[
"odd_row"] = $cell_class[
"C1"];
 
 2546                                                 $classes[
"even_row"] = $cell_class[
"C2"];
 
 2550                                                 $classes[
"row_head"] = $cell_class[
"H"];
 
 2551                                                 $classes[
"odd_row"] = $cell_class[
"C1"];
 
 2552                                                 $classes[
"even_row"] = $cell_class[
"C1"];
 
 2553                                                 $classes[
"col_head"] = $cell_class[
"C2"];
 
 2558                                 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
 
 2559                                         $_POST[
"name"], $classes);
 
 2560                                 $this->
object->writeTemplatePreview($t_id,
 
 2562                                 $ilCtrl->redirect($this, 
"listTemplates");
 
 2565                 $this->form_gui->setValuesByPost();
 
 2566                 $tpl->setContent($this->form_gui->getHTML());
 
 2573                 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
 
 2576                 $acc->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
 
 2577                 $acc->addItem(
"Header 2", str_repeat(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
 
 2581                 $ac2->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
 
 2582                 $ac2->addItem(
"Header 2", $acc->getHTML());
 
 2585                 $tpl->setContent($ac2->getHTML());
 
 2595                 if (
$_GET[
"baseClass"] == 
"ilAdministrationGUI")
 
 2597                         $ilCtrl->redirectByClass(
"ilobjstylesettingsgui", 
"editContentStyles");
 
 2599                 $ilCtrl->returnToParent($this);