ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

+ Inheritance diagram for ilObjStyleSheetGUI:
+ Collaboration diagram for ilObjStyleSheetGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prep=true)
 Constructor public. More...
 
 enableWrite ($a_write)
 Enable writing. More...
 
 executeCommand ()
 execute command More...
 
 viewObject ()
 
 createObject ()
 create More...
 
 includeCSS ()
 Include CSS in output. More...
 
 checkWrite ()
 Check write. More...
 
 editObject ()
 edit style sheet More...
 
 propertiesObject ()
 Properties. More...
 
 getPropertiesValues ()
 Get current values for properties from. More...
 
 initPropertiesForm ($a_mode="edit")
 FORM: Init properties form. More...
 
 updateObject ()
 Update properties. More...
 
 refreshTagStyleObject ()
 save and refresh tag editing More...
 
 updateTagStyleObject ()
 save and refresh tag editing More...
 
 saveTagStyle ()
 Save tag style. More...
 
 writeStylePar ($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom=false)
 
 editTagStyleObject ()
 Edit tag style. More...
 
 switchMQueryObject ()
 Switch media query. More...
 
 outputTagStyleEditScreen ()
 Output tag style edit screen. More...
 
 initTagStyleForm ($a_mode, $a_cur_tag)
 Init tag style editing form. More...
 
 getValues ()
 FORM: Get current values from persistent object. More...
 
 exportStyleObject ()
 export style More...
 
 extractParametersOfTag ($a_tag, $a_class, $a_style, $a_type, $a_mq_id=0, $a_custom=false)
 
 newStyleParameterObject ()
 add style parameter More...
 
 refreshObject ()
 refresh style sheet More...
 
 deleteObject ($a_error=false)
 display deletion confirmation screen More...
 
 cancelDeleteObject ()
 cancel oobject deletion More...
 
 confirmedDeleteObject ()
 delete selected style objects More...
 
 deleteStyleParameterObject ()
 delete style parameters More...
 
 saveObject ()
 save style sheet More...
 
 copyStyleObject ()
 save style sheet More...
 
 importStyleObject ()
 import style sheet More...
 
 afterImport (ilObject $a_new_obj)
 After import. More...
 
 cancelObject ()
 update style sheet More...
 
 getAdminTabs ()
 admin and normal tabs are equal for roles More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 setSubTabs ()
 adds tabs to tab gui object More...
 
 setTemplatesSubTabs ()
 adds tabs to tab gui object More...
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 listImagesObject ()
 List images of style. More...
 
 addImageObject ()
 Add an image. More...
 
 cancelUploadObject ()
 Cancel Upload. More...
 
 uploadImageObject ()
 Upload image. More...
 
 initImageForm ()
 Init image form. More...
 
 deleteImageObject ()
 Delete images. More...
 
 deleteCharacteristicConfirmationObject ()
 Characteristic deletion confirmation screen. More...
 
 deleteCoreCharMessage ()
 Message that appears, when user tries to delete core characteristics. More...
 
 cancelCharacteristicDeletionObject ()
 Cancel characteristic deletion. More...
 
 deleteCharacteristicObject ()
 Delete one or multiple style characteristic. More...
 
 addCharacteristicFormObject ()
 Add characteristic. More...
 
 saveCharacteristicObject ()
 Save Characteristic. More...
 
 initCharacteristicForm ($a_mode)
 Init tag style editing form. More...
 
 saveHideStatusObject ()
 Save hide status for characteristics. More...
 
 copyCharacteristicsObject ()
 Copy style classes. More...
 
 pasteCharacteristicsOverviewObject ()
 Paste characteristics overview. More...
 
 pasteCharacteristicsObject ()
 Paste characteristics. More...
 
 listColorsObject ()
 List colors of style. More...
 
 addColorObject ()
 Add a color. More...
 
 editColorObject ()
 Edit color. More...
 
 initColorForm ($a_mode="create")
 Init color form. More...
 
 getColorFormValues ()
 Set values for color editing. More...
 
 cancelColorSavingObject ()
 Cancel color saving. More...
 
 saveColorObject ()
 Save color. More...
 
 updateColorObject ()
 Update color. More...
 
 deleteColorConfirmationObject ()
 Delete color confirmation. More...
 
 cancelColorDeletionObject ()
 Cancel color deletion. More...
 
 deleteColorObject ()
 Delete colors. More...
 
 listMediaQueriesObject ()
 List media queries of style. More...
 
 addMediaQueryObject ()
 Add a media query. More...
 
 editMediaQueryObject ()
 Edit media query. More...
 
 initMediaQueryForm ($a_mode="create")
 Init media query form. More...
 
 getMediaQueryFormValues ()
 Set values for media query editing. More...
 
 saveMediaQueryObject ()
 Save media query. More...
 
 updateMediaQueryObject ()
 Update media query. More...
 
 deleteMediaQueryConfirmationObject ()
 Confirm media query deletion. More...
 
 deleteMediaQueriesObject ()
 Delete Media Queries. More...
 
 saveMediaQueryOrderObject ()
 Save media query order. More...
 
 listTemplatesObject ()
 List templates. More...
 
 addTemplateObject ()
 Add template. More...
 
 editTemplateObject ()
 Edit table template. More...
 
 getTemplatePreview ($a_type, $a_t_id, $a_small_mode=false)
 Get table template preview. More...
 
 initTemplateForm ($a_mode="create")
 Init table template form. More...
 
 cancelTemplateSavingObject ()
 Cancel color saving. More...
 
 saveTemplateObject ()
 Save table template. More...
 
 updateTemplateObject ($a_refresh=false)
 Update table template. More...
 
 displayTemplateEditForm ()
 Display table tempalte edit form. More...
 
 refreshTemplateObject ()
 Refresh table template. More...
 
 getTemplateFormValues ()
 Set values for table template editing. More...
 
 deleteTemplateConfirmationObject ()
 Delete table template confirmation. More...
 
 cancelTemplateDeletionObject ()
 Cancel table template deletion. More...
 
 deleteTemplateKeepClassesObject ()
 Delete table template. More...
 
 deleteTemplateObject ()
 Delete table template. More...
 
 generateTemplateObject ()
 Generate table template. More...
 
 initTemplateGenerationForm ()
 Init table template generation form. More...
 
 templateGenerationObject ()
 Table template generation. More...
 
 accordiontestObject ()
 
 returnToUpperContextObject ()
 return to upper context More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static getStyleExampleHTML ($a_type, $a_class)
 Get style example HTML. More...
 
static _getTemplatePreview ($a_style, $a_type, $a_t_id, $a_small_mode=false)
 Get table template preview. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $cmd_update
 
 $cmd_new_par
 
 $cmd_refresh
 
 $cmd_delete
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Attributes

 $rbacsystem
 
 $help
 
 $tabs
 
 $obj_definition
 
 $enable_write = false
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStyleSheetGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prep = true 
)

Constructor public.

Definition at line 49 of file class.ilObjStyleSheetGUI.php.

References $_GET, $DIC, ilObjectGUI\$lng, ilObjectGUI\$tpl, ILIAS\GlobalScreen\Provider\__construct(), ilObjStyleSheet\_getStyleSuperTypeForType(), and help().

50  {
51  global $DIC;
52 
53  $this->tpl = $DIC["tpl"];
54  $this->rbacsystem = $DIC->rbac()->system();
55  $this->help = $DIC["ilHelp"];
56  $this->tabs = $DIC->tabs();
57  $this->toolbar = $DIC->toolbar();
58  $this->locator = $DIC["ilLocator"];
59  $this->tree = $DIC->repositoryTree();
60  $this->obj_definition = $DIC["objDefinition"];
61  $ilCtrl = $DIC->ctrl();
62  $lng = $DIC->language();
63  $tpl = $DIC["tpl"];
64 
65  $this->ctrl = $ilCtrl;
66  $this->lng = $lng;
67  $this->lng->loadLanguageModule("style");
68  $ilCtrl->saveParameter($this, array("tag", "style_type", "temp_type"));
69  if ($_GET["style_type"] != "") {
70  $this->super_type = ilObjStyleSheet::_getStyleSuperTypeForType($_GET["style_type"]);
71  }
72  $this->type = "sty";
73  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
74  }
$_GET["client_id"]
static _getStyleSuperTypeForType($a_type)
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getTemplatePreview()

static ilObjStyleSheetGUI::_getTemplatePreview (   $a_style,
  $a_type,
  $a_t_id,
  $a_small_mode = false 
)
static

Get table template preview.

Definition at line 2325 of file class.ilObjStyleSheetGUI.php.

References $c, $DIC, $i, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilPCTableGUI\_renderTable(), and ilAccordionGUI\addCss().

Referenced by ilObjStyleSheet\addTemplate(), and getTemplatePreview().

2326  {
2327  global $DIC;
2328 
2329  $lng = $DIC->language();
2330  $tpl = $DIC["tpl"];
2331 
2332  $kr = $kc = 7;
2333  if ($a_small_mode) {
2334  $kr = 6;
2335  $kc = 5;
2336  }
2337 
2338  $ts = $a_style->getTemplate($a_t_id);
2339  $t = $ts["classes"];
2340 
2341  // preview
2342  if ($a_type == "table") {
2343  $p_content = '<PageContent><Table DataTable="y"';
2344  if ($t["row_head"] != "") {
2345  $p_content .= ' HeaderRows="1"';
2346  }
2347  if ($t["row_foot"] != "") {
2348  $p_content .= ' FooterRows="1"';
2349  }
2350  if ($t["col_head"] != "") {
2351  $p_content .= ' HeaderCols="1"';
2352  }
2353  if ($t["col_foot"] != "") {
2354  $p_content .= ' FooterCols="1"';
2355  }
2356  $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
2357  if (!$a_small_mode) {
2358  $p_content .= '<Caption>' . $lng->txt("sty_caption") . '</Caption>';
2359  }
2360  for ($i = 1; $i <= $kr; $i++) {
2361  $p_content .= '<TableRow>';
2362  for ($j = 1; $j <= $kc; $j++) {
2363  if ($a_small_mode) {
2364  $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
2365  } else {
2366  $cell = 'xxx';
2367  }
2368  $p_content .= '<TableData><PageContent><Paragraph Characteristic="TableContent">' . $cell . '</Paragraph></PageContent></TableData>';
2369  }
2370  $p_content .= '</TableRow>';
2371  }
2372  $p_content .= '</Table></PageContent>';
2373  }
2374 
2375  if ($a_type == "vaccordion" || $a_type == "haccordion" || $a_type == "carousel") {
2376  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2378 
2379  if ($a_small_mode) {
2380  $c = '&amp;nbsp;';
2381  $h = '&amp;nbsp;';
2382  } else {
2383  $c = 'xxx';
2384  $h = 'head';
2385  }
2386  if ($a_type == "vaccordion") {
2387  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2388  if ($a_small_mode) {
2389  $p_content .= ' ContentWidth="70"';
2390  }
2391  } elseif ($a_type == "haccordion") {
2392  $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
2393  if ($a_small_mode) {
2394  $p_content .= ' ContentHeight="40"';
2395  $p_content .= ' ContentWidth="70"';
2396  $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
2397  } else {
2398  $p_content .= ' ContentHeight="40"';
2399  }
2400  } elseif ($a_type == "carousel") {
2401  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="Carousel" ';
2402  if ($a_small_mode) {
2403  $p_content .= ' ContentWidth="70"';
2404  }
2405  }
2406 
2407 
2408  $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
2409  $p_content .= '<Tab><PageContent><Paragraph>' . $c . '</Paragraph></PageContent>';
2410  $p_content .= '<TabCaption>' . $h . '</TabCaption>';
2411  $p_content .= '</Tab>';
2412  $p_content .= '</Tabs></PageContent>';
2413  }
2414  //echo htmlentities($p_content);
2415  $txml = $a_style->getTemplateXML();
2416  //echo htmlentities($txml); exit;
2417  $p_content .= $txml;
2418  include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
2419  $r_content = ilPCTableGUI::_renderTable($p_content, "");
2420 
2421  // fix carousel template visibility
2422  if ($a_type == "carousel") {
2423  $r_content .= "<style>.owl-carousel{ display:block !important; }</style>";
2424  }
2425 
2426  //echo htmlentities($r_content); exit;
2427  return $r_content;
2428  }
$c
Definition: cli.php:37
static _renderTable( $content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true, $page_object=null)
Static render table function.
static addCss()
Add required css.
global $DIC
Definition: goto.php:24
$i
Definition: metadata.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accordiontestObject()

ilObjStyleSheetGUI::accordiontestObject ( )

Definition at line 3019 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, ilAccordionGUI\HORIZONTAL, and ilAccordionGUI\VERTICAL.

3020  {
3021  $tpl = $this->tpl;
3022 
3023  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
3024 
3025  $acc = new ilAccordionGUI();
3026  $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
3027  $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
3028  $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
3029 
3030  $ac2 = new ilAccordionGUI();
3031  $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
3032  $ac2->addItem("Header 2", $acc->getHTML());
3033  $ac2->setOrientation(ilAccordionGUI::VERTICAL);
3034 
3035  $tpl->setContent($ac2->getHTML());
3036  }
Accordion user interface class.

◆ addAdminLocatorItems()

ilObjStyleSheetGUI::addAdminLocatorItems (   $a_do_not_add_object = false)

should be overwritten to add object specific items (repository items are preloaded)

Definition at line 1331 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$locator, ilObject\_lookupObjId(), and ilObject\_lookupTitle().

1332  {
1333  $ilLocator = $this->locator;
1334 
1335  if ($_GET["admin_mode"] == "settings") { // system settings
1336  parent::addAdminLocatorItems(true);
1337 
1338  $ilLocator->addItem(
1340  ilObject::_lookupObjId($_GET["ref_id"])
1341  ),
1342  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "")
1343  );
1344 
1345  if ($_GET["obj_id"] > 0) {
1346  $ilLocator->addItem(
1347  $this->object->getTitle(),
1348  $this->ctrl->getLinkTarget($this, "edit")
1349  );
1350  }
1351  } else { // repository administration
1352  //?
1353  }
1354  }
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ addCharacteristicFormObject()

ilObjStyleSheetGUI::addCharacteristicFormObject ( )

Add characteristic.

Definition at line 1583 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initCharacteristicForm().

1584  {
1585  $tpl = $this->tpl;
1586 
1587  $this->initCharacteristicForm("create");
1588  $tpl->setContent($this->form_gui->getHTML());
1589  }
initCharacteristicForm($a_mode)
Init tag style editing form.
+ Here is the call graph for this function:

◆ addColorObject()

ilObjStyleSheetGUI::addColorObject ( )

Add a color.

Definition at line 1833 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initColorForm().

1834  {
1835  $tpl = $this->tpl;
1836 
1837  $this->initColorForm();
1838  $tpl->setContent($this->form_gui->getHTML());
1839  }
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ addImageObject()

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

Definition at line 1386 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initImageForm().

1387  {
1388  $tpl = $this->tpl;
1389 
1390  $this->initImageForm();
1391  $tpl->setContent($this->form_gui->getHTML());
1392  }
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

Definition at line 2060 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initMediaQueryForm().

2061  {
2062  $tpl = $this->tpl;
2063 
2064  $this->initMediaQueryForm();
2065  $tpl->setContent($this->form_gui->getHTML());
2066  }
initMediaQueryForm($a_mode="create")
Init media query form.
+ Here is the call graph for this function:

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

Definition at line 2286 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initTemplateForm().

2287  {
2288  $tpl = $this->tpl;
2289 
2290  $this->initTemplateForm();
2291  $tpl->setContent($this->form_gui->getHTML());
2292  }
initTemplateForm($a_mode="create")
Init table template form.
+ Here is the call graph for this function:

◆ afterImport()

ilObjStyleSheetGUI::afterImport ( ilObject  $a_new_obj)

After import.

Parameters

Definition at line 1134 of file class.ilObjStyleSheetGUI.php.

1135  {
1136  }

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

Definition at line 1550 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, and ilUtil\sendInfo().

1551  {
1552  $ilCtrl = $this->ctrl;
1553  $lng = $this->lng;
1554 
1555  ilUtil::sendInfo($lng->txt("action_aborted"), true);
1556  $ilCtrl->redirect($this, "edit");
1557  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ cancelColorDeletionObject()

ilObjStyleSheetGUI::cancelColorDeletionObject ( )

Cancel color deletion.

Definition at line 2004 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl.

2005  {
2006  $ilCtrl = $this->ctrl;
2007 
2008  $ilCtrl->redirect($this, "listColors");
2009  }

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

Definition at line 1909 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl.

1910  {
1911  $ilCtrl = $this->ctrl;
1912 
1913  $ilCtrl->redirect($this, "listColors");
1914  }

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

Definition at line 964 of file class.ilObjStyleSheetGUI.php.

965  {
966  $this->ctrl->returnToParent($this);
967  }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

Definition at line 1142 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, and ilUtil\sendInfo().

1143  {
1144  $lng = $this->lng;
1145 
1146  ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1147  $this->ctrl->returnToParent($this);
1148  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ cancelTemplateDeletionObject()

ilObjStyleSheetGUI::cancelTemplateDeletionObject ( )

Cancel table template deletion.

Definition at line 2656 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl.

2657  {
2658  $ilCtrl = $this->ctrl;
2659 
2660  $ilCtrl->redirect($this, "listTemplates");
2661  }

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

Definition at line 2483 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl.

2484  {
2485  $ilCtrl = $this->ctrl;
2486 
2487  $ilCtrl->redirect($this, "listTemplates");
2488  }

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

Definition at line 1397 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl.

1398  {
1399  $ilCtrl = $this->ctrl;
1400 
1401  $ilCtrl->redirect($this, "listImages");
1402  }

◆ checkWrite()

ilObjStyleSheetGUI::checkWrite ( )

Check write.

Parameters

Definition at line 217 of file class.ilObjStyleSheetGUI.php.

References $_GET, and $rbacsystem.

Referenced by deleteMediaQueriesObject(), editObject(), initPropertiesForm(), listColorsObject(), listImagesObject(), listMediaQueriesObject(), and listTemplatesObject().

218  {
220 
221  return ($this->enable_write || $rbacsystem->checkAccess("write", (int) $_GET["ref_id"])
222  || $rbacsystem->checkAccess("sty_write_content", (int) $_GET["ref_id"]));
223  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

Definition at line 972 of file class.ilObjStyleSheetGUI.php.

973  {
974  $this->object->delete();
975 
976  $this->ctrl->returnToParent($this);
977  }

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

Definition at line 1732 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI\$ctrl, ilObjectGUI\$lng, and ilUtil\sendFailure().

1733  {
1734  $ilCtrl = $this->ctrl;
1735  $lng = $this->lng;
1736 
1737  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1738  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1739  } else {
1740  $style_cp = implode("::", $_POST["char"]);
1741  $style_cp = $this->object->getId() . ":::" . $_GET["style_type"] . ":::" . $style_cp;
1742  $_SESSION["sty_copy"] = $style_cp;
1743  ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1744  }
1745  $ilCtrl->redirect($this, "edit");
1746  }
$_SESSION["AccountId"]
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ copyStyleObject()

ilObjStyleSheetGUI::copyStyleObject ( )

save style sheet

Definition at line 1051 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjStyleSheet\_writeStandard(), ilObjectFactory\getInstanceByObjId(), and ilObjectFactory\getInstanceByRefId().

1052  {
1053  if ($_POST["source_style"] > 0) {
1054  $style_obj = ilObjectFactory::getInstanceByObjId($_POST["source_style"]);
1055  $new_id = $style_obj->ilClone();
1056  }
1057 
1058  // assign style to style sheet folder,
1059  // if parent is style sheet folder
1060  if ($_GET["ref_id"] > 0) {
1061  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1062  if ($fold->getType() == "stys") {
1063  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1064  $cont_style_settings = new ilContentStyleSettings();
1065  $cont_style_settings->addStyle($new_id);
1066  $cont_style_settings->update();
1067  ilObjStyleSheet::_writeStandard($new_id, "1");
1068  $this->ctrl->returnToParent($this);
1069  }
1070  }
1071 
1072  return $new_id;
1073  }
$_GET["client_id"]
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _writeStandard($a_id, $a_std)
Write standard flag.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_POST["username"]
+ Here is the call graph for this function:

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

create

Definition at line 117 of file class.ilObjStyleSheetGUI.php.

References $help, ilObjectGUI\$lng, $rbacsystem, ilObjectGUI\$tpl, ilObjStyleSheet\_getClonableContentStyles(), ilObjectGUI\getCreationFormsHTML(), ilHelpGUI\ID_PART_SCREEN, ilTextAreaInputGUI\setCols(), and ilFormPropertyGUI\setRequired().

118  {
120  $lng = $this->lng;
121  $tpl = $this->tpl;
122  $ilHelp = $this->help;
123 
124  $forms = array();
125 
126 
127  $ilHelp->setScreenIdComponent("sty");
128  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
129 
130  // --- create
131 
132  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
133  $form = new ilPropertyFormGUI();
134  $form->setFormAction($this->ctrl->getFormAction($this));
135  $form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
136 
137  // title
138  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
139  $ti->setMaxLength(128);
140  $ti->setSize(40);
141  $ti->setRequired(true);
142  $form->addItem($ti);
143 
144  // description
145  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
146  $ta->setCols(40);
147  $ta->setRows(2);
148  $form->addItem($ta);
149 
150  $form->addCommandButton("save", $this->lng->txt("save"));
151  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
152 
153  $forms[] = $form;
154 
155 
156  // --- import
157 
158  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
159  $form = new ilPropertyFormGUI();
160  $form->setFormAction($this->ctrl->getFormAction($this));
161  $form->setTitle($this->lng->txt("sty_import_stylesheet"));
162 
163  // title
164  $ti = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
165  $ti->setRequired(true);
166  $form->addItem($ti);
167 
168  $form->addCommandButton("importStyle", $this->lng->txt("import"));
169  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
170 
171  $forms[] = $form;
172 
173 
174  // --- clone
175 
176  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
177  $form = new ilPropertyFormGUI();
178  $form->setFormAction($this->ctrl->getFormAction($this));
179  $form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
180 
181  // source
182  $ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
183  $ti->setRequired(true);
185  $form->addItem($ti);
186 
187  $form->addCommandButton("copyStyle", $this->lng->txt("copy"));
188  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
189 
190  $forms[] = $form;
191 
192 
193  $this->tpl->setContent($this->getCreationFormsHTML($forms));
194  }
This class represents a property form user interface.
This class represents a file property in a property form.
static _getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
This class represents a text area property in a property form.
const ID_PART_SCREEN
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ deleteCharacteristicConfirmationObject()

ilObjStyleSheetGUI::deleteCharacteristicConfirmationObject ( )

Characteristic deletion confirmation screen.

Definition at line 1466 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_getCoreStyles(), deleteCoreCharMessage(), and ilUtil\sendInfo().

1467  {
1468  $ilCtrl = $this->ctrl;
1469  $tpl = $this->tpl;
1470  $lng = $this->lng;
1471 
1472  //var_dump($_POST);
1473 
1474  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1475  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1476  $ilCtrl->redirect($this, "edit");
1477  } else {
1478  // check whether there are any core style classes included
1479  $core_styles = ilObjStyleSheet::_getCoreStyles();
1480  foreach ($_POST["char"] as $char) {
1481  if (!empty($core_styles[$char])) {
1482  $this->deleteCoreCharMessage();
1483  return;
1484  }
1485  }
1486 
1487  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1488  $cgui = new ilConfirmationGUI();
1489  $cgui->setFormAction($ilCtrl->getFormAction($this));
1490  $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1491  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1492  $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1493 
1494  foreach ($_POST["char"] as $char) {
1495  $char_comp = explode(".", $char);
1496  $cgui->addItem("char[]", $char, $char_comp[2]);
1497  }
1498 
1499  $tpl->setContent($cgui->getHTML());
1500  }
1501  }
deleteCoreCharMessage()
Message that appears, when user tries to delete core characteristics.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getCoreStyles()
Get core styles.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteCharacteristicObject()

ilObjStyleSheetGUI::deleteCharacteristicObject ( )

Delete one or multiple style characteristic.

Definition at line 1562 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, and $type.

1563  {
1564  $ilCtrl = $this->ctrl;
1565 
1566  if (is_array($_POST["char"])) {
1567  foreach ($_POST["char"] as $char) {
1568  $char_comp = explode(".", $char);
1569  $type = $char_comp[0];
1570  $tag = $char_comp[1];
1571  $class = $char_comp[2];
1572 
1573  $this->object->deleteCharacteristic($type, $tag, $class);
1574  }
1575  }
1576 
1577  $ilCtrl->redirect($this, "edit");
1578  }
$type
$_POST["username"]

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

Definition at line 1976 of file class.ilObjStyleSheetGUI.php.

References $_POST, $c, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

1977  {
1978  $ilCtrl = $this->ctrl;
1979  $tpl = $this->tpl;
1980  $lng = $this->lng;
1981 
1982  if (!is_array($_POST["color"]) || count($_POST["color"]) == 0) {
1983  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1984  $ilCtrl->redirect($this, "listColors");
1985  } else {
1986  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1987  $cgui = new ilConfirmationGUI();
1988  $cgui->setFormAction($ilCtrl->getFormAction($this));
1989  $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
1990  $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
1991  $cgui->setConfirm($lng->txt("delete"), "deleteColor");
1992 
1993  foreach ($_POST["color"] as $c) {
1994  $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
1995  }
1996 
1997  $tpl->setContent($cgui->getHTML());
1998  }
1999  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$c
Definition: cli.php:37
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteColorObject()

ilObjStyleSheetGUI::deleteColorObject ( )

Delete colors.

Definition at line 2014 of file class.ilObjStyleSheetGUI.php.

References $_POST, $c, and ilObjectGUI\$ctrl.

2015  {
2016  $ilCtrl = $this->ctrl;
2017 
2018  if (is_array($_POST["color"])) {
2019  foreach ($_POST["color"] as $c) {
2020  $this->object->removeColor($c);
2021  }
2022  }
2023 
2024  $ilCtrl->redirect($this, "listColors");
2025  }
$c
Definition: cli.php:37
$_POST["username"]

◆ deleteCoreCharMessage()

ilObjStyleSheetGUI::deleteCoreCharMessage ( )

Message that appears, when user tries to delete core characteristics.

Parameters

Definition at line 1509 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObjStyleSheet\_getCoreStyles().

Referenced by deleteCharacteristicConfirmationObject().

1510  {
1511  $ilCtrl = $this->ctrl;
1512  $tpl = $this->tpl;
1513  $lng = $this->lng;
1514 
1515  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1516  $cgui = new ilConfirmationGUI();
1517  $cgui->setFormAction($ilCtrl->getFormAction($this));
1518 
1519 
1520  $core_styles = ilObjStyleSheet::_getCoreStyles();
1521  $cnt = 0;
1522  foreach ($_POST["char"] as $char) {
1523  if (!empty($core_styles[$char])) {
1524  $cnt++;
1525  $char_comp = explode(".", $char);
1526  $cgui->addItem("", "", $char_comp[2]);
1527  } else {
1528  $cgui->addHiddenItem("char[]", $char);
1529  }
1530  }
1531  $all_core_styles = ($cnt == count($_POST["char"]))
1532  ? true
1533  : false;
1534 
1535  if ($all_core_styles) {
1536  $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1537  $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1538  } else {
1539  $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1540  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1541  $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1542  }
1543 
1544  $tpl->setContent($cgui->getHTML());
1545  }
static _getCoreStyles()
Get core styles.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteImageObject()

ilObjStyleSheetGUI::deleteImageObject ( )

Delete images.

Definition at line 1449 of file class.ilObjStyleSheetGUI.php.

References $_POST, and ilObjectGUI\$ctrl.

1450  {
1451  $ilCtrl = $this->ctrl;
1452 
1453  $images = $this->object->getImages();
1454 
1455  foreach ($images as $image) {
1456  if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"])) {
1457  $this->object->deleteImage($image["entry"]);
1458  }
1459  }
1460  $ilCtrl->redirect($this, "listImages");
1461  }
$_POST["username"]

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters

Definition at line 2202 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, $rbacsystem, and checkWrite().

2203  {
2204  $ilCtrl = $this->ctrl;
2206 
2207  if ($this->checkWrite() && is_array($_POST["mq_id"])) {
2208  foreach ($_POST["mq_id"] as $id) {
2209  $this->object->deleteMediaQuery($id);
2210  }
2211  }
2212  $ilCtrl->redirect($this, "listMediaQueries");
2213  }
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

Confirm media query deletion.

Definition at line 2170 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, $i, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilUtil\sendInfo().

2171  {
2172  $ilCtrl = $this->ctrl;
2173  $tpl = $this->tpl;
2174  $lng = $this->lng;
2175 
2176  if (!is_array($_POST["mq_id"]) || count($_POST["mq_id"]) == 0) {
2177  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2178  $ilCtrl->redirect($this, "listMediaQueries");
2179  } else {
2180  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2181  $cgui = new ilConfirmationGUI();
2182  $cgui->setFormAction($ilCtrl->getFormAction($this));
2183  $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
2184  $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
2185  $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
2186 
2187  foreach ($_POST["mq_id"] as $i) {
2188  $mq = $this->object->getMediaQueryForId($i);
2189  $cgui->addItem("mq_id[]", $i, $mq["mquery"]);
2190  }
2191 
2192  $tpl->setContent($cgui->getHTML());
2193  }
2194  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

public

Definition at line 942 of file class.ilObjStyleSheetGUI.php.

References ilObject\_lookupTitle(), and ilUtil\getImageTagByType().

943  {
944  // display confirmation message
945  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
946  $cgui = new ilConfirmationGUI();
947  $cgui->setFormAction($this->ctrl->getFormAction($this));
948  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
949  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
950  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
951 
952  $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath) .
953  " " . ilObject::_lookupTitle($this->object->getId());
954 
955  $cgui->addItem("id[]", "", $caption);
956 
957  $this->tpl->setContent($cgui->getHTML());
958  }
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 _lookupTitle($a_id)
lookup object title
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteStyleParameterObject()

ilObjStyleSheetGUI::deleteStyleParameterObject ( )

delete style parameters

Definition at line 982 of file class.ilObjStyleSheetGUI.php.

References $_POST, and editObject().

983  {
984  if (is_array($_POST["sty_select"])) {
985  foreach ($_POST["sty_select"] as $id => $dummy) {
986  $this->object->deleteParameter($id);
987  }
988  }
989  $this->object->read();
990  $this->object->writeCSSFile();
991  $this->editObject();
992  }
editObject()
edit style sheet
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

Definition at line 2612 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilUtil\sendInfo().

2613  {
2614  $ilCtrl = $this->ctrl;
2615  $tpl = $this->tpl;
2616  $lng = $this->lng;
2617 
2618  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0) {
2619  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2620  $ilCtrl->redirect($this, "listTemplates");
2621  } else {
2622  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2623  $cgui = new ilConfirmationGUI();
2624  $cgui->setFormAction($ilCtrl->getFormAction($this));
2625  $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2626  $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2627  $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2628 
2629  foreach ($_POST["tid"] as $tid) {
2630  $classes = $this->object->getTemplateClasses($tid);
2631  $cl_str = "";
2632  $listed = array();
2633  foreach ($classes as $cl) {
2634  if ($cl != "" && !$listed[$cl]) {
2635  $cl_str .= '<div>- ' .
2636  $cl . "</div>";
2637  $listed[$cl] = true;
2638  }
2639  }
2640  if ($cl_str != "") {
2641  $cl_str = '<div style="padding-left:30px;" class="small">' .
2642  "<div><i>" . $lng->txt("sty_style_class") . "</i></div>" . $cl_str . "</div>";
2643  }
2644  $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid) . $cl_str);
2645  }
2646 
2647  $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2648 
2649  $tpl->setContent($cgui->getHTML());
2650  }
2651  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteTemplateKeepClassesObject()

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

Delete table template.

Definition at line 2666 of file class.ilObjStyleSheetGUI.php.

References $_POST, and ilObjectGUI\$ctrl.

2667  {
2668  $ilCtrl = $this->ctrl;
2669 
2670  if (is_array($_POST["tid"])) {
2671  foreach ($_POST["tid"] as $tid) {
2672  $this->object->removeTemplate($tid);
2673  }
2674  }
2675 
2676  $ilCtrl->redirect($this, "listTemplates");
2677  }
$_POST["username"]

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

Definition at line 2682 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, and ilObjStyleSheet\_determineTag().

2683  {
2684  $ilCtrl = $this->ctrl;
2685 
2686  if (is_array($_POST["tid"])) {
2687  foreach ($_POST["tid"] as $tid) {
2688  $cls = $this->object->getTemplateClasses($tid);
2689  foreach ($cls as $k => $cls) {
2690  $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2691  $ta = ilObjStyleSheet::_determineTag($ty);
2692  $this->object->deleteCharacteristic($ty, $ta, $cls);
2693  }
2694  $this->object->removeTemplate($tid);
2695  }
2696  }
2697 
2698  $ilCtrl->redirect($this, "listTemplates");
2699  }
static _determineTag($a_type)
$_GET["client_id"]
$_POST["username"]
+ Here is the call graph for this function:

◆ displayTemplateEditForm()

ilObjStyleSheetGUI::displayTemplateEditForm ( )

Display table tempalte edit form.

Definition at line 2568 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$tpl, getTemplatePreview(), and includeCSS().

Referenced by editTemplateObject(), and updateTemplateObject().

2569  {
2570  $tpl = $this->tpl;
2571 
2572  $a_tpl = new ilTemplate(
2573  "tpl.template_edit.html",
2574  true,
2575  true,
2576  "Services/Style/Content"
2577  );
2578  $this->includeCSS();
2579  $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2580  $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2581  $tpl->setContent($a_tpl->get());
2582  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$_GET["client_id"]
includeCSS()
Include CSS in output.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editColorObject()

ilObjStyleSheetGUI::editColorObject ( )

Edit color.

Definition at line 1844 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$tpl, getColorFormValues(), and initColorForm().

1845  {
1846  $tpl = $this->tpl;
1847  $ilCtrl = $this->ctrl;
1848 
1849  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1850  $this->initColorForm("edit");
1851  $this->getColorFormValues();
1852  $tpl->setContent($this->form_gui->getHTML());
1853  }
$_GET["client_id"]
getColorFormValues()
Set values for color editing.
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ editMediaQueryObject()

ilObjStyleSheetGUI::editMediaQueryObject ( )

Edit media query.

Definition at line 2071 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$tpl, getMediaQueryFormValues(), and initMediaQueryForm().

2072  {
2073  $tpl = $this->tpl;
2074  $ilCtrl = $this->ctrl;
2075 
2076  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2077  $this->initMediaQueryForm("edit");
2078  $this->getMediaQueryFormValues();
2079  $tpl->setContent($this->form_gui->getHTML());
2080  }
$_GET["client_id"]
initMediaQueryForm($a_mode="create")
Init media query form.
getMediaQueryFormValues()
Set values for media query editing.
+ Here is the call graph for this function:

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

edit style sheet

Definition at line 229 of file class.ilObjStyleSheetGUI.php.

References $_SESSION, ilObjectGUI\$ctrl, ilObjectGUI\$lng, $rbacsystem, $tabs, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilObjStyleSheet\_getStyleSuperTypes(), ilObjStyleSheet\_isExpandable(), checkWrite(), includeCSS(), and setSubTabs().

Referenced by deleteStyleParameterObject(), newStyleParameterObject(), refreshObject(), and viewObject().

230  {
232  $lng = $this->lng;
233  $ilTabs = $this->tabs;
234  $ilCtrl = $this->ctrl;
235  $ilToolbar = $this->toolbar;
236  $tpl = $this->tpl;
237 
238  $this->setSubTabs();
239 
240  $this->includeCSS();
241 
242  $ctpl = new ilTemplate("tpl.sty_classes.html", true, true, "Services/Style/Content");
243 
244  // output characteristics
245  $chars = $this->object->getCharacteristics();
246 
247  $style_type = ($this->super_type != "")
248  ? $this->super_type
249  : "text_block";
250  $ilCtrl->setParameter($this, "style_type", $style_type);
251  $ilTabs->setSubTabActive("sty_" . $style_type . "_char");
252 
253  // workaround to include default rte styles
254  if ($this->super_type == "rte") {
255  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
256  $tpl->addInlineCss(ilSCORM13PlayerGUI::getInlineCss());
257  }
258 
259  // add new style?
260  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
261  $subtypes = $all_super_types[$style_type];
262  $expandable = false;
263  foreach ($subtypes as $t) {
265  $expandable = true;
266  }
267  }
268  if ($expandable && $this->checkWrite()) {
269  $ilToolbar->addButton(
270  $lng->txt("sty_add_characteristic"),
271  $ilCtrl->getLinkTarget($this, "addCharacteristicForm")
272  );
273  }
274 
275  if ($_SESSION["sty_copy"] != "") {
276  $style_cp = explode(":::", $_SESSION["sty_copy"]);
277  if ($style_cp[1] == $style_type) {
278  if ($expandable) {
279  $ilToolbar->addSeparator();
280  }
281  $ilToolbar->addButton(
282  $lng->txt("sty_paste_style_classes"),
283  $ilCtrl->getLinkTarget($this, "pasteCharacteristicsOverview")
284  );
285  }
286  }
287 
288  include_once("./Services/Style/Content/classes/class.ilStyleTableGUI.php");
289  $table_gui = new ilStyleTableGUI(
290  $this,
291  "edit",
292  $chars,
293  $style_type,
294  $this->object
295  );
296 
297  $ctpl->setCurrentBlock("style_table");
298  $ctpl->setVariable("STYLE_TABLE", $table_gui->getHTML());
299  $ctpl->parseCurrentBlock();
300 
301  $this->tpl->setContent($ctpl->get());
302  }
setSubTabs()
adds tabs to tab gui object
$_SESSION["AccountId"]
static _isExpandable($a_type)
TableGUI class for style editor.
includeCSS()
Include CSS in output.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editTagStyleObject()

ilObjStyleSheetGUI::editTagStyleObject ( )

Edit tag style.

Definition at line 568 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, $si, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, getValues(), initTagStyleForm(), and outputTagStyleEditScreen().

569  {
570  $tpl = $this->tpl;
571  $ilToolbar = $this->toolbar;
572  $lng = $this->lng;
573  $ilCtrl = $this->ctrl;
574 
575  // media query selector
576  $mqs = $this->object->getMediaQueries();
577  if (count($mqs) > 0) {
578  //
579  $options = array(
580  "" => $lng->txt("sty_default"),
581  );
582  foreach ($mqs as $mq) {
583  $options[$mq["id"]] = $mq["mquery"];
584  }
585  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
586  $si = new ilSelectInputGUI("@media", "mq_id");
587  $si->setOptions($options);
588  $si->setValue((int) $_GET["mq_id"]);
589  $ilToolbar->addInputItem($si, true);
590  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
591  $ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
592  }
593 
594  // workaround to include default rte styles
595  //if (in_array($_GET["style_type"], array("rte_menu")))
596  if ($this->super_type == "rte") {
597  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
598  $tpl->addInlineCss(ilSCORM13PlayerGUI::getInlineCss());
599  }
600 
601  $cur = explode(".", $_GET["tag"]);
602  $cur_tag = $cur[0];
603  $cur_class = $cur[1];
604 
605  $this->initTagStyleForm("edit", $cur_tag);
606  $this->getValues();
607  $this->outputTagStyleEditScreen();
608  }
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
getValues()
FORM: Get current values from persistent object.
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
+ Here is the call graph for this function:

◆ editTemplateObject()

ilObjStyleSheetGUI::editTemplateObject ( )

Edit table template.

Definition at line 2297 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$tpl, displayTemplateEditForm(), getTemplateFormValues(), and initTemplateForm().

2298  {
2299  $tpl = $this->tpl;
2300  $ilCtrl = $this->ctrl;
2301 
2302  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2303  $this->initTemplateForm("edit");
2304  $this->getTemplateFormValues();
2305 
2306  $this->displayTemplateEditForm();
2307  }
$_GET["client_id"]
initTemplateForm($a_mode="create")
Init table template form.
displayTemplateEditForm()
Display table tempalte edit form.
getTemplateFormValues()
Set values for table template editing.
+ Here is the call graph for this function:

◆ enableWrite()

ilObjStyleSheetGUI::enableWrite (   $a_write)

Enable writing.

Parameters
$a_write

Definition at line 80 of file class.ilObjStyleSheetGUI.php.

Referenced by ilObjPortfolioGUI\executeCommand().

81  {
82  $this->enable_write = $a_write;
83  }
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjStyleSheetGUI::executeCommand ( )

execute command

Definition at line 88 of file class.ilObjStyleSheetGUI.php.

References $ret, ilObjectGUI\prepareOutput(), and ilObjectGUI\setCreationMode().

89  {
90  $next_class = $this->ctrl->getNextClass($this);
91  $cmd = $this->ctrl->getCmd("edit");
92 
93  // #9440/#9489: prepareOutput will fail if not set properly
94  if (!$this->object) {
95  $this->setCreationMode(true);
96  }
97 
98  $this->prepareOutput();
99  switch ($next_class) {
100  default:
101  $cmd .= "Object";
102  $ret = $this->$cmd();
103  break;
104  }
105 
106  return $ret;
107  }
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don&#39;t belong to the current class! ...
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

export style

Definition at line 889 of file class.ilObjStyleSheetGUI.php.

References ilUtil\deliverFile().

890  {
891  include_once("./Services/Export/classes/class.ilExport.php");
892  $exp = new ilExport();
893  $r = $exp->exportObject($this->object->getType(), $this->object->getId());
894 
895  ilUtil::deliverFile($r["directory"] . "/" . $r["file"], $r["file"], '', false, true);
896  }
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ extractParametersOfTag()

ilObjStyleSheetGUI::extractParametersOfTag (   $a_tag,
  $a_class,
  $a_style,
  $a_type,
  $a_mq_id = 0,
  $a_custom = false 
)

Definition at line 898 of file class.ilObjStyleSheetGUI.php.

Referenced by getValues().

899  {
900  $parameters = array();
901  foreach ($a_style as $tag) {
902  foreach ($tag as $par) {
903  if ($par["tag"] == $a_tag && $par["class"] == $a_class
904  && $par["type"] == $a_type && (int) $a_mq_id == (int) $par["mq_id"]
905  && (int) $a_custom == (int) $par["custom"]) {
906  $parameters[$par["parameter"]] = $par["value"];
907  }
908  }
909  }
910  return $parameters;
911  }
+ Here is the caller graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

Definition at line 2704 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

2705  {
2706  $tpl = $this->tpl;
2707 
2708  $this->initTemplateGenerationForm();
2709  $tpl->setContent($this->form_gui->getHTML());
2710  }
initTemplateGenerationForm()
Init table template generation form.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSheetGUI::getAdminTabs ( )

admin and normal tabs are equal for roles

Definition at line 1153 of file class.ilObjStyleSheetGUI.php.

References getTabs().

1154  {
1155  $this->getTabs();
1156  }
getTabs()
adds tabs to tab gui object
+ Here is the call graph for this function:

◆ getColorFormValues()

ilObjStyleSheetGUI::getColorFormValues ( )

Set values for color editing.

Definition at line 1897 of file class.ilObjStyleSheetGUI.php.

References $_GET.

Referenced by editColorObject().

1898  {
1899  if ($_GET["c_name"] != "") {
1900  $values["color_name"] = $_GET["c_name"];
1901  $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1902  $this->form_gui->setValuesByArray($values);
1903  }
1904  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getMediaQueryFormValues()

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

Definition at line 2116 of file class.ilObjStyleSheetGUI.php.

References $_GET.

Referenced by editMediaQueryObject().

2117  {
2118  if ($_GET["mq_id"] != "") {
2119  foreach ($this->object->getMediaQueries() as $mq) {
2120  if ($mq["id"] == (int) $_GET["mq_id"]) {
2121  $values["mquery"] = $mq["mquery"];
2122  }
2123  }
2124  $this->form_gui->setValuesByArray($values);
2125  }
2126  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

Definition at line 336 of file class.ilObjStyleSheetGUI.php.

Referenced by propertiesObject().

337  {
338  $values = array();
339 
340  $values["style_title"] = $this->object->getTitle();
341  $values["style_description"] = $this->object->getDescription();
342  $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
343 
344  $this->form->setValuesByArray($values);
345  }
+ Here is the caller graph for this function:

◆ getStyleExampleHTML()

static ilObjStyleSheetGUI::getStyleExampleHTML (   $a_type,
  $a_class 
)
static

Get style example HTML.

Definition at line 1671 of file class.ilObjStyleSheetGUI.php.

References $c, $DIC, and ilObjectGUI\$lng.

Referenced by ilStyleTableGUI\fillRow(), and outputTagStyleEditScreen().

1672  {
1673  global $DIC;
1674 
1675  $lng = $DIC->language();
1676 
1677  $c = explode(":", $a_class);
1678  $a_class = $c[0];
1679 
1680  $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
1681 
1682  if ($ex_tpl->blockExists("Example_" . $a_type)) {
1683  $ex_tpl->setCurrentBlock("Example_" . $a_type);
1684  } else {
1685  $ex_tpl->setCurrentBlock("Example_default");
1686  }
1687  $ex_tpl->setVariable("EX_CLASS", "ilc_" . $a_type . "_" . $a_class);
1688  $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1689  if (in_array($a_type, array("media_cont", "qimg"))) {
1690  //
1691  }
1692  if (in_array($a_type, array("table", "table_caption"))) {
1693  $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1694  }
1695  if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal"))) {
1696  $ex_tpl->setVariable("HOR", "Horizontal");
1697  }
1698  $ex_tpl->parseCurrentBlock();
1699 
1700  return $ex_tpl->get();
1701  }
$c
Definition: cli.php:37
global $DIC
Definition: goto.php:24
+ Here is the caller graph for this function:

◆ getTabs()

ilObjStyleSheetGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Definition at line 1164 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, $help, ilObjectGUI\$lng, and $tabs.

Referenced by getAdminTabs().

1165  {
1166  $lng = $this->lng;
1167  $ilCtrl = $this->ctrl;
1168  $ilTabs = $this->tabs;
1169  $ilHelp = $this->help;
1170 
1171  $ilHelp->setScreenIdComponent("sty");
1172 
1173  if ($ilCtrl->getCmd() == "editTagStyle") {
1174  // back to upper context
1175  $this->tabs_gui->setBackTarget(
1176  $lng->txt("back"),
1177  $ilCtrl->getLinkTarget($this, "edit")
1178  );
1179 
1180  $t = explode(".", $_GET["tag"]);
1181  $t2 = explode(":", $t[1]);
1182  $pc = $this->object->_getPseudoClasses($t[0]);
1183  if (is_array($pc) && count($pc) > 0) {
1184  // style classes
1185  $ilCtrl->setParameter($this, "tag", $t[0] . "." . $t2[0]);
1186  $this->tabs_gui->addTarget(
1187  "sty_tag_normal",
1188  $this->ctrl->getLinkTarget($this, "editTagStyle"),
1189  array("editTagStyle", ""),
1190  get_class($this)
1191  );
1192  if ($t2[1] == "") {
1193  $ilTabs->setTabActive("sty_tag_normal");
1194  }
1195 
1196  foreach ($pc as $p) {
1197  // style classes
1198  $ilCtrl->setParameter($this, "tag", $t[0] . "." . $t2[0] . ":" . $p);
1199  $this->tabs_gui->addTarget(
1200  "sty_tag_" . $p,
1201  $this->ctrl->getLinkTarget($this, "editTagStyle"),
1202  array("editTagStyle", ""),
1203  get_class($this)
1204  );
1205  if ($t2[1] == $p) {
1206  $ilTabs->setTabActive("sty_tag_" . $p);
1207  }
1208  }
1209  $ilCtrl->setParameter($this, "tag", $_GET["tag"]);
1210  }
1211  } else {
1212  // back to upper context
1213  $this->tabs_gui->setBackTarget(
1214  $lng->txt("back"),
1215  $this->ctrl->getLinkTarget($this, "returnToUpperContext")
1216  );
1217 
1218  // style classes
1219  $this->tabs_gui->addTarget(
1220  "sty_style_chars",
1221  $this->ctrl->getLinkTarget($this, "edit"),
1222  array("edit", ""),
1223  get_class($this)
1224  );
1225 
1226  // colors
1227  $this->tabs_gui->addTarget(
1228  "sty_colors",
1229  $this->ctrl->getLinkTarget($this, "listColors"),
1230  "listColors",
1231  get_class($this)
1232  );
1233 
1234  // media queries
1235  $this->tabs_gui->addTarget(
1236  "sty_media_queries",
1237  $this->ctrl->getLinkTarget($this, "listMediaQueries"),
1238  "listMediaQueries",
1239  get_class($this)
1240  );
1241 
1242  // images
1243  $this->tabs_gui->addTarget(
1244  "sty_images",
1245  $this->ctrl->getLinkTarget($this, "listImages"),
1246  "listImages",
1247  get_class($this)
1248  );
1249 
1250  // table templates
1251  $this->tabs_gui->addTarget(
1252  "sty_templates",
1253  $this->ctrl->getLinkTarget($this, "listTemplates"),
1254  "listTemplates",
1255  get_class($this)
1256  );
1257 
1258  // settings
1259  $this->tabs_gui->addTarget(
1260  "settings",
1261  $this->ctrl->getLinkTarget($this, "properties"),
1262  "properties",
1263  get_class($this)
1264  );
1265 
1266  // accordiontest
1267 /*
1268  $this->tabs_gui->addTarget("accordiontest",
1269  $this->ctrl->getLinkTarget($this, "accordiontest"), "accordiontest",
1270  get_class($this));*/
1271  }
1272  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

Definition at line 2595 of file class.ilObjStyleSheetGUI.php.

References $_GET, $type, and ilObjStyleSheet\_getTemplateClassTypes().

Referenced by editTemplateObject().

2596  {
2597  if ($_GET["t_id"] > 0) {
2598  $t = $this->object->getTemplate($_GET["t_id"]);
2599 
2600  $values["name"] = $t["name"];
2601  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2602  foreach ($scs as $k => $type) {
2603  $values[$k . "_class"] = $t["classes"][$k];
2604  }
2605  $this->form_gui->setValuesByArray($values);
2606  }
2607  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$type
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplatePreview()

ilObjStyleSheetGUI::getTemplatePreview (   $a_type,
  $a_t_id,
  $a_small_mode = false 
)

Get table template preview.

Definition at line 2312 of file class.ilObjStyleSheetGUI.php.

References _getTemplatePreview().

Referenced by displayTemplateEditForm(), saveTemplateObject(), templateGenerationObject(), and updateTemplateObject().

2313  {
2314  return $this->_getTemplatePreview(
2315  $this->object,
2316  $a_type,
2317  $a_t_id,
2318  $a_small_mode
2319  );
2320  }
static _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilObjStyleSheetGUI::getValues ( )

FORM: Get current values from persistent object.

Definition at line 826 of file class.ilObjStyleSheetGUI.php.

References $_GET, $c, ilObjStyleSheet\_getFilteredGroups(), ilObjStyleSheet\_getStyleParameters(), and extractParametersOfTag().

Referenced by editTagStyleObject().

827  {
828  $style = $this->object->getStyle();
829  $cur = explode(".", $_GET["tag"]);
830  $cur_tag = $cur[0];
831  $cur_class = $cur[1];
832  $cur_parameters = $this->extractParametersOfTag(
833  $cur_tag,
834  $cur_class,
835  $style,
836  $_GET["style_type"],
837  (int) $_GET["mq_id"],
838  false
839  );
840  $parameters = ilObjStyleSheet::_getStyleParameters();
841  foreach ($parameters as $p => $v) {
842  $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
843  if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]])) {
844  continue;
845  }
846  $p = explode(".", $p);
847  $p = $p[0];
848  $input = $this->form_gui->getItemByPostVar($p);
849  switch ($v["input"]) {
850  case "":
851  break;
852 
853  case "trbl_numeric":
854  case "border_width":
855  case "border_style":
856  case "trbl_color":
857  $input->setAllValue($cur_parameters[$v["subpar"][0]]);
858  $input->setTopValue($cur_parameters[$v["subpar"][1]]);
859  $input->setRightValue($cur_parameters[$v["subpar"][2]]);
860  $input->setBottomValue($cur_parameters[$v["subpar"][3]]);
861  $input->setLeftValue($cur_parameters[$v["subpar"][4]]);
862  break;
863 
864  default:
865  $input->setValue($cur_parameters[$p]);
866  break;
867  }
868  }
869 
870  $cust_parameters = $this->extractParametersOfTag(
871  $cur_tag,
872  $cur_class,
873  $style,
874  $_GET["style_type"],
875  (int) $_GET["mq_id"],
876  true
877  );
878  $vals = array();
879  foreach ($cust_parameters as $k => $c) {
880  $vals[] = $k . ": " . $c;
881  }
882  $input = $this->form_gui->getItemByPostVar("custom_par");
883  $input->setValue($vals);
884  }
$c
Definition: cli.php:37
$_GET["client_id"]
extractParametersOfTag($a_tag, $a_class, $a_style, $a_type, $a_mq_id=0, $a_custom=false)
static _getStyleParameters($a_tag="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importStyleObject()

ilObjStyleSheetGUI::importStyleObject ( )

import style sheet

Definition at line 1078 of file class.ilObjStyleSheetGUI.php.

References $_GET, $source, ilObjStyleSheet\_writeStandard(), ilObjectFactory\getInstanceByObjId(), and ilObjectFactory\getInstanceByRefId().

1079  {
1080  // check file
1081  $source = $_FILES["importfile"]["tmp_name"];
1082  if (($source == 'none') || (!$source)) {
1083  $this->ilias->raiseError("No file selected!", $this->ilias->error_obj->MESSAGE);
1084  }
1085 
1086  // check correct file type
1087  $info = pathinfo($_FILES["importfile"]["name"]);
1088  if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml") {
1089  $this->ilias->raiseError("File must be a zip or xml file!", $this->ilias->error_obj->MESSAGE);
1090  }
1091 
1092  // new import
1093  $fname = explode("_", $_FILES["importfile"]["name"]);
1094  if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty") {
1095  include_once("./Services/Export/classes/class.ilImport.php");
1096  $imp = new ilImport();
1097  $new_id = $imp->importObject(
1098  null,
1099  $_FILES["importfile"]["tmp_name"],
1100  $_FILES["importfile"]["name"],
1101  "sty"
1102  );
1103  if ($new_id > 0) {
1104  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
1105  }
1106  } else { // old import
1107  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1108  $newObj = new ilObjStyleSheet();
1109  $newObj->import($_FILES["importfile"]);
1110  }
1111 
1112  // assign style to style sheet folder,
1113  // if parent is style sheet folder
1114  if ($_GET["ref_id"] > 0) {
1115  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1116  if ($fold->getType() == "stys") {
1117  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1118  $cont_style_settings = new ilContentStyleSettings();
1119  $cont_style_settings->addStyle($newObj->getId());
1120  $cont_style_settings->update();
1121  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1122  $this->ctrl->returnToParent($this);
1123  }
1124  }
1125  return $newObj->getId();
1126  }
$_GET["client_id"]
Import class.
redirection script todo: (a better solution should control the processing via a xml file) ...
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _writeStandard($a_id, $a_std)
Write standard flag.
Class ilObjStyleSheet.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$source
Definition: metadata.php:76
+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

Definition at line 199 of file class.ilObjStyleSheetGUI.php.

References ilObjStyleSheet\getContentStylePath().

Referenced by displayTemplateEditForm(), editObject(), and listTemplatesObject().

200  {
201  // set style sheet
202  $this->tpl->setCurrentBlock("ContentStyle");
203  $this->tpl->setVariable(
204  "LOCATION_CONTENT_STYLESHEET",
205  ilObjStyleSheet::getContentStylePath($this->object->getId())
206  );
207  $this->tpl->parseCurrentBlock();
208  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCharacteristicForm()

ilObjStyleSheetGUI::initCharacteristicForm (   $a_mode)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode

Definition at line 1627 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjStyleSheet\_getStyleSuperTypes(), ilObjStyleSheet\_isExpandable(), and ilRegExpInputGUI\setPattern().

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

1628  {
1629  $lng = $this->lng;
1630  $ilCtrl = $this->ctrl;
1631 
1632  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1633  $this->form_gui = new ilPropertyFormGUI();
1634 
1635  // title
1636  $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1637  $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1638  $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include") . " A-Z, a-z, 0-9");
1639  $txt_input->setRequired(true);
1640  $this->form_gui->addItem($txt_input);
1641 
1642  // type
1643  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1644  $types = $all_super_types[$this->super_type];
1645  $exp_types = array();
1646  foreach ($types as $t) {
1648  $exp_types[$t] = $lng->txt("sty_type_" . $t);
1649  }
1650  }
1651  if (count($exp_types) > 1) {
1652  $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1653  $type_input->setOptions($exp_types);
1654  $type_input->setValue(key($exp_types));
1655  $this->form_gui->addItem($type_input);
1656  } elseif (count($exp_types) == 1) {
1657  $hid_input = new ilHiddenInputGUI("type");
1658  $hid_input->setValue(key($exp_types));
1659  $this->form_gui->addItem($hid_input);
1660  }
1661 
1662  $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1663  $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1664  $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1665  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1666  }
This class represents a property form user interface.
setPattern($pattern)
set pattern
This class represents a hidden form property in a property form.
static _isExpandable($a_type)
This class represents a regular expression input property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initColorForm()

ilObjStyleSheetGUI::initColorForm (   $a_mode = "create")

Init color form.

Definition at line 1859 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilRegExpInputGUI\setPattern(), and ilFormPropertyGUI\setRequired().

Referenced by addColorObject(), editColorObject(), saveColorObject(), and updateColorObject().

1860  {
1861  $lng = $this->lng;
1862  $ilCtrl = $this->ctrl;
1863 
1864  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1865  $this->form_gui = new ilPropertyFormGUI();
1866 
1867  $this->form_gui->setTitle($lng->txt("sty_add_color"));
1868 
1869  // name
1870  $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1871  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1872  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
1873  $name_input->setRequired(true);
1874  $name_input->setSize(15);
1875  $name_input->setMaxLength(15);
1876  $this->form_gui->addItem($name_input);
1877 
1878  // code
1879  $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1880  $color_input->setRequired(true);
1881  $color_input->setDefaultColor("");
1882  $this->form_gui->addItem($color_input);
1883 
1884  if ($a_mode == "create") {
1885  $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1886  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1887  } else {
1888  $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1889  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1890  }
1891  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1892  }
This class represents a property form user interface.
Color picker form for selecting color hexcodes using yui library.
setPattern($pattern)
set pattern
This class represents a regular expression input property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImageForm()

ilObjStyleSheetGUI::initImageForm ( )

Init image form.

Definition at line 1426 of file class.ilObjStyleSheetGUI.php.

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

Referenced by addImageObject(), and uploadImageObject().

1427  {
1428  $lng = $this->lng;
1429  $ilCtrl = $this->ctrl;
1430 
1431  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1432  $this->form_gui = new ilPropertyFormGUI();
1433 
1434  $this->form_gui->setTitle($lng->txt("sty_add_image"));
1435 
1436  $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1437  $file_input->setSuffixes(["jpg","jpeg","png","gif","svg"]);
1438  $file_input->setRequired(true);
1439  $this->form_gui->addItem($file_input);
1440 
1441  $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1442  $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1443  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1444  }
This class represents a property form user interface.
This class represents an image file property in a property form.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMediaQueryForm()

ilObjStyleSheetGUI::initMediaQueryForm (   $a_mode = "create")

Init media query form.

Definition at line 2086 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and ilObjectGUI\$lng.

Referenced by addMediaQueryObject(), editMediaQueryObject(), saveMediaQueryObject(), and updateMediaQueryObject().

2087  {
2088  $lng = $this->lng;
2089  $ilCtrl = $this->ctrl;
2090 
2091  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2092  $this->form_gui = new ilPropertyFormGUI();
2093 
2094  $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2095 
2096  // media query
2097  $ti = new ilTextInputGUI("@media", "mquery");
2098  $ti->setMaxLength(2000);
2099  $ti->setInfo($lng->txt("sty_add_media_query_info"));
2100  $this->form_gui->addItem($ti);
2101 
2102 
2103  if ($a_mode == "create") {
2104  $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2105  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2106  } else {
2107  $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2108  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2109  }
2110  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2111  }
This class represents a property form user interface.
+ Here is the caller graph for this function:

◆ initPropertiesForm()

ilObjStyleSheetGUI::initPropertiesForm (   $a_mode = "edit")

FORM: Init properties form.

Parameters
int$a_modeEdit Mode

Definition at line 352 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, $rbacsystem, checkWrite(), and ilFormPropertyGUI\setInfo().

Referenced by propertiesObject(), and updateObject().

353  {
354  $lng = $this->lng;
356 
357  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
358  $this->form = new ilPropertyFormGUI();
359 
360  // title
361  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
362  $ti->setMaxLength(128);
363  $ti->setSize(40);
364  $ti->setRequired(true);
365  $this->form->addItem($ti);
366 
367  // description
368  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
369  //$ta->setCols();
370  //$ta->setRows();
371  $this->form->addItem($ta);
372 
373  // disable automatic margins for left/right alignment
374  $cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
375  $cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
376  $this->form->addItem($cb);
377 
378  // save and cancel commands
379 
380  if ($a_mode == "create") {
381  $this->form->addCommandButton("save", $lng->txt("save"));
382  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
383  } else {
384  if ($this->checkWrite()) {
385  $this->form->addCommandButton("update", $lng->txt("save"));
386  }
387  }
388 
389  $this->form->setTitle($lng->txt("edit_stylesheet"));
390  $this->form->setFormAction($this->ctrl->getFormAction($this));
391  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTagStyleForm()

ilObjStyleSheetGUI::initTagStyleForm (   $a_mode,
  $a_cur_tag 
)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode

Definition at line 668 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjStyleSheet\_getFilteredGroups(), ilObjStyleSheet\_getStyleParameterInputType(), ilTRBLColorPickerInputGUI\setAcceptNamedColors(), ilNumericStyleValueInputGUI\setAllowPercentage(), ilTRBLNumericStyleValueInputGUI\setAllowPercentage(), ilColorPickerInputGUI\setDefaultColor(), ilBackgroundImageInputGUI\setImages(), ilNumberInputGUI\setMinValue(), and ilSelectInputGUI\setOptions().

Referenced by editTagStyleObject(), refreshTagStyleObject(), and updateTagStyleObject().

669  {
670  $lng = $this->lng;
671  $ilCtrl = $this->ctrl;
672 
673  $ilCtrl->saveParameter($this, array("mq_id"));
674 
675  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
676  $this->form_gui = new ilPropertyFormGUI();
677 
678  $avail_pars = $this->object->getAvailableParameters();
679  $groups = $this->object->getStyleParameterGroups();
680 
681  // output select lists
682  foreach ($groups as $k => $group) {
683  // filter groups of properties that should only be
684  // displayed with matching tag
685  $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
686  if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k])) {
687  continue;
688  }
689 
690  $sh = new ilFormSectionHeaderGUI();
691  $sh->setTitle($lng->txt("sty_" . $k));
692  $this->form_gui->addItem($sh);
693 
694  foreach ($group as $par) {
695  $basepar = explode(".", $par);
696  $basepar = $basepar[0];
697 
698  $var = str_replace("-", "_", $basepar);
699  $up_par = strtoupper($var);
700 
702  case "select":
703  $sel_input = new ilSelectInputGUI($lng->txt("sty_" . $var), $basepar);
704  $options = array("" => "");
705  foreach ($avail_pars[$par] as $p) {
706  $options[$p] = $p;
707  }
708  $sel_input->setOptions($options);
709  $this->form_gui->addItem($sel_input);
710  break;
711 
712  case "text":
713  $text_input = new ilTextInputGUI($lng->txt("sty_" . $var), $basepar);
714  $text_input->setMaxLength(200);
715  $text_input->setSize(20);
716  $this->form_gui->addItem($text_input);
717  break;
718 
719  case "fontsize":
720  include_once("./Services/Style/Content/classes/class.ilFontSizeInputGUI.php");
721  $fs_input = new ilFontSizeInputGUI($lng->txt("sty_" . $var), $basepar);
722  $this->form_gui->addItem($fs_input);
723  break;
724 
725  case "numeric_no_perc":
726  case "numeric":
727  include_once("./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
728  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
729  if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc") {
730  $num_input->setAllowPercentage(false);
731  }
732  $this->form_gui->addItem($num_input);
733  break;
734 
735  case "percentage":
736  $per_input = new ilNumberInputGUI($lng->txt("sty_" . $var), $basepar);
737  $per_input->setMinValue(0);
738  $per_input->setMaxValue(100);
739  $per_input->setMaxLength(3);
740  $per_input->setSize(3);
741  $this->form_gui->addItem($per_input);
742  break;
743 
744  case "color":
745  //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
746  $col_input = new ilColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
747  $col_input->setDefaultColor("");
748  $col_input->setAcceptNamedColors(true);
749  $this->form_gui->addItem($col_input);
750  break;
751 
752  case "trbl_numeric":
753  include_once("./Services/Style/Content/classes/class.ilTRBLNumericStyleValueInputGUI.php");
754  $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
755  if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc") {
756  $num_input->setAllowPercentage(false);
757  }
758  $this->form_gui->addItem($num_input);
759  break;
760 
761  case "border_width":
762  include_once("./Services/Style/Content/classes/class.ilTRBLBorderWidthInputGUI.php");
763  $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_" . $var), $basepar);
764  $this->form_gui->addItem($bw_input);
765  break;
766 
767  case "border_style":
768  include_once("./Services/Style/Content/classes/class.ilTRBLBorderStyleInputGUI.php");
769  $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_" . $var), $basepar);
770  $this->form_gui->addItem($bw_input);
771  break;
772 
773  case "trbl_color":
774  include_once("./Services/Style/Content/classes/class.ilTRBLColorPickerInputGUI.php");
775  $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
776  $col_input->setAcceptNamedColors(true);
777  $this->form_gui->addItem($col_input);
778  break;
779 
780  case "background_image":
781  include_once("./Services/Style/Content/classes/class.ilBackgroundImageInputGUI.php");
782  $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_" . $var), $basepar);
783  $imgs = array();
784  foreach ($this->object->getImages() as $entry) {
785  $imgs[] = $entry["entry"];
786  }
787  $im_input->setImages($imgs);
788  $this->form_gui->addItem($im_input);
789  break;
790 
791  case "background_position":
792  include_once("./Services/Style/Content/classes/class.ilBackgroundPositionInputGUI.php");
793  $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_" . $var), $basepar);
794  $this->form_gui->addItem($im_input);
795  break;
796  }
797  }
798  }
799 
800  // custom parameters
801  $sh = new ilFormSectionHeaderGUI();
802  $sh->setTitle($lng->txt("sty_custom"));
803  $this->form_gui->addItem($sh);
804 
805  // custom parameters
806  $ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
807  $ti->setMaxLength(300);
808  $ti->setSize(80);
809  $ti->setMulti(true);
810  $ti->setInfo($this->lng->txt("sty_custom_par_info"));
811  $this->form_gui->addItem($ti);
812 
813 
814  // save and cancel commands
815  $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
816  $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
817 
818  // $this->form_gui->setTitle($lng->txt("edit"));
819  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
820  }
This class represents a property form user interface.
This class represents a section header in a property form.
Color picker form for selecting color hexcodes using yui library.
setAllowPercentage($a_allowpercentage)
Set Allow Percentage.
Color picker form for selecting color hexcodes using yui library (all/top/right/bottom/left) ...
setAllowPercentage($a_allowpercentage)
Set Allow Percentage.
This class represents a numeric style property in a property form.
This class represents a border style with all/top/right/bottom/left in a property form...
setMinValue($a_minvalue, $a_display_always=false)
Set Minimum Value.
This class represents a number property in a property form.
This class represents a border width with all/top/right/bottom/left in a property form...
setDefaultColor($a_defaultcolor)
Set Default Color.
setOptions($a_options)
Set Options.
This class represents a fint size property in a property form.
This class represents a numeric style property with all/top/right/bottom/left in a property form...
setAcceptNamedColors($a_acceptnamedcolors)
Set Accept Named Colors (Leading &#39;!&#39;).
This class represents a background image property in a property form.
This class represents a background position in a property form.
static _getStyleParameterInputType($par)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplateForm()

ilObjStyleSheetGUI::initTemplateForm (   $a_mode = "create")

Init table template form.

Definition at line 2433 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjStyleSheet\_getTemplateClassTypes(), and ilRegExpInputGUI\setPattern().

Referenced by addTemplateObject(), editTemplateObject(), saveTemplateObject(), and updateTemplateObject().

2434  {
2435  $lng = $this->lng;
2436  $ilCtrl = $this->ctrl;
2437 
2438  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2439  $this->form_gui = new ilPropertyFormGUI();
2440 
2441  if ($a_mode == "create") {
2442  $this->form_gui->setTitle($lng->txt("sty_add_template"));
2443  } else {
2444  $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2445  }
2446 
2447  // name
2448  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2449  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2450  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
2451  $name_input->setRequired(true);
2452  $name_input->setSize(30);
2453  $name_input->setMaxLength(30);
2454  $this->form_gui->addItem($name_input);
2455 
2456  // template style classes
2457  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2458  foreach ($scs as $sc => $st) {
2459  $sc_input = new ilSelectInputGUI($lng->txt("sty_" . $sc . "_class"), $sc . "_class");
2460  $chars = $this->object->getCharacteristics($st);
2461  $options = array("" => "");
2462  foreach ($chars as $char) {
2463  $options[$char] = $char;
2464  }
2465  $sc_input->setOptions($options);
2466  $this->form_gui->addItem($sc_input);
2467  }
2468 
2469  if ($a_mode == "create") {
2470  $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2471  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2472  } else {
2473  $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2474  $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2475  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2476  }
2477  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2478  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
This class represents a property form user interface.
$_GET["client_id"]
setPattern($pattern)
set pattern
This class represents a regular expression input property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplateGenerationForm()

ilObjStyleSheetGUI::initTemplateGenerationForm ( )

Init table template generation form.

Definition at line 2715 of file class.ilObjStyleSheetGUI.php.

References $c, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilNumericStyleValueInputGUI\setAllowPercentage(), ilNumberInputGUI\setMaxValue(), ilSelectInputGUI\setOptions(), and ilRegExpInputGUI\setPattern().

Referenced by generateTemplateObject(), and templateGenerationObject().

2716  {
2717  $lng = $this->lng;
2718  $ilCtrl = $this->ctrl;
2719 
2720  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2721  $this->form_gui = new ilPropertyFormGUI();
2722 
2723  $this->form_gui->setTitle($lng->txt("sty_generate_template"));
2724 
2725  // name
2726  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2727  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2728  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
2729  $name_input->setRequired(true);
2730  $name_input->setSize(30);
2731  $name_input->setMaxLength(30);
2732  $this->form_gui->addItem($name_input);
2733 
2734  // basic layout
2735  $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
2736  $options = array(
2737  "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
2738  "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
2739  "noZebra" => $lng->txt("sty_table_template_no_zebra")
2740  );
2741  $bl_input->setOptions($options);
2742  $this->form_gui->addItem($bl_input);
2743 
2744  // top bottom padding
2745  include_once("./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
2746  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
2747  $num_input->setAllowPercentage(false);
2748  $num_input->setValue("3px");
2749  $this->form_gui->addItem($num_input);
2750 
2751  // left right padding
2752  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
2753  $num_input->setAllowPercentage(false);
2754  $num_input->setValue("10px");
2755  $this->form_gui->addItem($num_input);
2756 
2757  // base color
2758  $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
2759  $cs = $this->object->getColors();
2760  $options = array();
2761  foreach ($cs as $c) {
2762  $options[$c["name"]] = $c["name"];
2763  }
2764  $bc_input->setOptions($options);
2765  $this->form_gui->addItem($bc_input);
2766 
2767  // Lightness Settings
2768  $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
2769  "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
2770  foreach ($lss as $ls => $v) {
2771  $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_" . $ls), "lightness_" . $ls);
2772  $l_input->setMaxValue(100);
2773  $l_input->setMinValue(-100);
2774  $l_input->setValue($v);
2775  $l_input->setSize(4);
2776  $l_input->setMaxLength(4);
2777  $this->form_gui->addItem($l_input);
2778  }
2779 
2780  $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
2781  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2782  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2783  }
$c
Definition: cli.php:37
This class represents a property form user interface.
setAllowPercentage($a_allowpercentage)
Set Allow Percentage.
This class represents a numeric style property in a property form.
setPattern($pattern)
set pattern
This class represents a number property in a property form.
This class represents a regular expression input property in a property form.
setOptions($a_options)
Set Options.
setMaxValue($a_maxvalue, $a_display_always=false)
Set Maximum Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listColorsObject()

ilObjStyleSheetGUI::listColorsObject ( )

List colors of style.

Definition at line 1807 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, $rbacsystem, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, and checkWrite().

1808  {
1809  $tpl = $this->tpl;
1811  $ilToolbar = $this->toolbar;
1812  $ilCtrl = $this->ctrl;
1813 
1814  if ($this->checkWrite()) {
1815  $ilToolbar->addButton(
1816  $this->lng->txt("sty_add_color"),
1817  $ilCtrl->getLinkTarget($this, "addColor")
1818  );
1819  }
1820 
1821  include_once("./Services/Style/Content/classes/class.ilStyleColorTableGUI.php");
1822  $table_gui = new ilStyleColorTableGUI(
1823  $this,
1824  "listColors",
1825  $this->object
1826  );
1827  $tpl->setContent($table_gui->getHTML());
1828  }
TableGUI class for style editor (image list)
+ Here is the call graph for this function:

◆ listImagesObject()

ilObjStyleSheetGUI::listImagesObject ( )

List images of style.

Definition at line 1359 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, $rbacsystem, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, and checkWrite().

1360  {
1361  $tpl = $this->tpl;
1362  $ilToolbar = $this->toolbar;
1363  $ilCtrl = $this->ctrl;
1364  $lng = $this->lng;
1366 
1367  if ($this->checkWrite()) {
1368  $ilToolbar->addButton(
1369  $lng->txt("sty_add_image"),
1370  $ilCtrl->getLinkTarget($this, "addImage")
1371  );
1372  }
1373 
1374  include_once("./Services/Style/Content/classes/class.ilStyleImageTableGUI.php");
1375  $table_gui = new ilStyleImageTableGUI(
1376  $this,
1377  "listImages",
1378  $this->object
1379  );
1380  $tpl->setContent($table_gui->getHTML());
1381  }
TableGUI class for style editor (image list)
+ Here is the call graph for this function:

◆ listMediaQueriesObject()

ilObjStyleSheetGUI::listMediaQueriesObject ( )

List media queries of style.

Definition at line 2034 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, $rbacsystem, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, and checkWrite().

2035  {
2036  $tpl = $this->tpl;
2038  $ilToolbar = $this->toolbar;
2039  $ilCtrl = $this->ctrl;
2040 
2041  if ($this->checkWrite()) {
2042  $ilToolbar->addButton(
2043  $this->lng->txt("sty_add_media_query"),
2044  $ilCtrl->getLinkTarget($this, "addMediaQuery")
2045  );
2046  }
2047 
2048  include_once("./Services/Style/Content/classes/class.ilStyleMediaQueryTableGUI.php");
2049  $table_gui = new ilStyleMediaQueryTableGUI(
2050  $this,
2051  "listMediaQueries",
2052  $this->object
2053  );
2054  $tpl->setContent($table_gui->getHTML());
2055  }
TableGUI class for style editor (image list)
+ Here is the call graph for this function:

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

Definition at line 2239 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, $tabs, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, checkWrite(), includeCSS(), and setTemplatesSubTabs().

2240  {
2241  $tpl = $this->tpl;
2242  $ilTabs = $this->tabs;
2243  $ilCtrl = $this->ctrl;
2244  $ilToolbar = $this->toolbar;
2245 
2246  $ctype = $_GET["temp_type"];
2247  if ($ctype == "") {
2248  $ctype = "table";
2249  $ilCtrl->setParameter($this, "temp_type", $ctype);
2250  $_GET["temp_type"] = $ctype;
2251  }
2252 
2253  $this->setTemplatesSubTabs();
2254  $ilTabs->setSubTabActive("sty_" . $ctype . "_templates");
2255 
2256  // action commands
2257  if ($this->checkWrite()) {
2258  if ($ctype == "table") {
2259  $ilToolbar->addButton(
2260  $this->lng->txt("sty_generate_template"),
2261  $ilCtrl->getLinkTarget($this, "generateTemplate")
2262  );
2263  }
2264  $ilToolbar->addButton(
2265  $this->lng->txt("sty_add_template"),
2266  $ilCtrl->getLinkTarget($this, "addTemplate")
2267  );
2268  }
2269 
2270 
2271 
2272  $this->includeCSS();
2273  include_once("./Services/Style/Content/classes/class.ilTableTemplatesTableGUI.php");
2274  $table_gui = new ilTableTemplatesTableGUI(
2275  $ctype,
2276  $this,
2277  "listTemplates",
2278  $this->object
2279  );
2280  $tpl->setContent($table_gui->getHTML());
2281  }
$_GET["client_id"]
setTemplatesSubTabs()
adds tabs to tab gui object
includeCSS()
Include CSS in output.
+ Here is the call graph for this function:

◆ newStyleParameterObject()

ilObjStyleSheetGUI::newStyleParameterObject ( )

add style parameter

Definition at line 916 of file class.ilObjStyleSheetGUI.php.

References $_POST, and editObject().

917  {
918  $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
919  $this->editObject();
920  }
editObject()
edit style sheet
$_POST["username"]
+ Here is the call graph for this function:

◆ outputTagStyleEditScreen()

ilObjStyleSheetGUI::outputTagStyleEditScreen ( )

Output tag style edit screen.

Definition at line 628 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\getContentStylePath(), and getStyleExampleHTML().

Referenced by editTagStyleObject(), refreshTagStyleObject(), and updateTagStyleObject().

629  {
630  $tpl = $this->tpl;
631  $ilCtrl = $this->ctrl;
632  $lng = $this->lng;
633 
634  // set style sheet
635  $tpl->setCurrentBlock("ContentStyle");
636  $tpl->setVariable(
637  "LOCATION_CONTENT_STYLESHEET",
638  ilObjStyleSheet::getContentStylePath($this->object->getId())
639  );
640 
641  $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style/Content");
642 
643  $cur = explode(".", $_GET["tag"]);
644  $cur_tag = $cur[0];
645  $cur_class = $cur[1];
646 
647  $ts_tpl->setVariable(
648  "EXAMPLE",
649  ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class)
650  );
651 
652  $ts_tpl->setVariable(
653  "FORM",
654  $this->form_gui->getHtml()
655  );
656 
657  $tpl->setTitle($cur_class . " (" . $lng->txt("sty_type_" . $_GET["style_type"]) . ")");
658 
659  $tpl->setContent($ts_tpl->get());
660  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
$_GET["client_id"]
static getStyleExampleHTML($a_type, $a_class)
Get style example HTML.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteCharacteristicsObject()

ilObjStyleSheetGUI::pasteCharacteristicsObject ( )

Paste characteristics.

Parameters

Definition at line 1773 of file class.ilObjStyleSheetGUI.php.

References $_POST, $_SESSION, ilObjectGUI\$ctrl, ilObjectGUI\$lng, and ilObjStyleSheet\_writeUpToDate().

1774  {
1775  $ilCtrl = $this->ctrl;
1776  $lng = $this->lng;
1777 
1778  if (is_array($_POST["title"])) {
1779  foreach ($_POST["title"] as $from_char => $to_title) {
1780  $fc = explode(".", $from_char);
1781 
1782  if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1783  !$this->object->characteristicExists($to_title, $fc[0])) {
1784  $this->object->copyCharacteristic(
1785  $_POST["from_style_id"],
1786  $fc[0],
1787  $fc[2],
1788  $to_title
1789  );
1790  }
1791  }
1792  ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1793  unset($_SESSION["sty_copy"]);
1794  ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1795  }
1796 
1797  $ilCtrl->redirect($this, "edit");
1798  }
$_SESSION["AccountId"]
$_POST["username"]
static _writeUpToDate($a_id, $a_up_to_date)
Write up to date.
+ Here is the call graph for this function:

◆ pasteCharacteristicsOverviewObject()

ilObjStyleSheetGUI::pasteCharacteristicsOverviewObject ( )

Paste characteristics overview.

Parameters

Definition at line 1754 of file class.ilObjStyleSheetGUI.php.

References $tabs, and ilObjectGUI\$tpl.

1755  {
1756  $tpl = $this->tpl;
1757  $ilTabs = $this->tabs;
1758 
1759  $ilTabs->clearTargets();
1760 
1761  include_once("./Services/Style/Content/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1762  $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1763 
1764  $tpl->setContent($table->getHTML());
1765  }

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

Definition at line 307 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, $rbacsystem, ilObjectGUI\$toolbar, ilObjStyleSheet\getContentStylePath(), getPropertiesValues(), and initPropertiesForm().

308  {
310  $lng = $this->lng;
311  $ilToolbar = $this->toolbar;
312 
313  // set style sheet
314  $this->tpl->setCurrentBlock("ContentStyle");
315  $this->tpl->setVariable(
316  "LOCATION_CONTENT_STYLESHEET",
317  ilObjStyleSheet::getContentStylePath($this->object->getId())
318  );
319  $this->tpl->parseCurrentBlock();
320 
321  // export button
322  $ilToolbar->addButton(
323  $this->lng->txt("export"),
324  $this->ctrl->getLinkTarget($this, "exportStyle")
325  );
326 
327  $this->initPropertiesForm();
328  $this->getPropertiesValues();
329  $this->tpl->setContent($this->form->getHTML());
330  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
getPropertiesValues()
Get current values for properties from.
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
+ Here is the call graph for this function:

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

Definition at line 925 of file class.ilObjStyleSheetGUI.php.

References $_POST, and editObject().

926  {
927  $this->object->setTitle($_POST["style_title"]);
928  $this->object->setDescription($_POST["style_description"]);
929 
930  foreach ($_POST["styval"] as $id => $value) {
931  $this->object->updateStyleParameter($id, $value);
932  }
933  $this->object->update();
934  $this->editObject();
935  }
editObject()
edit style sheet
$_POST["username"]
+ Here is the call graph for this function:

◆ refreshTagStyleObject()

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

Definition at line 422 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, initTagStyleForm(), outputTagStyleEditScreen(), and saveTagStyle().

423  {
424  $ilCtrl = $this->ctrl;
425 
426  $cur = explode(".", $_GET["tag"]);
427  $cur_tag = $cur[0];
428  $cur_class = $cur[1];
429 
430  $this->initTagStyleForm("edit", $cur_tag);
431 
432  if ($this->form_gui->checkInput()) {
433  $this->saveTagStyle();
434  $ilCtrl->redirect($this, "editTagStyle");
435  } else {
436  $this->form_gui->setValuesByPost();
437  $this->outputTagStyleEditScreen();
438  }
439  }
saveTagStyle()
Save tag style.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
+ Here is the call graph for this function:

◆ refreshTemplateObject()

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

Definition at line 2587 of file class.ilObjStyleSheetGUI.php.

References updateTemplateObject().

2588  {
2589  $this->updateTemplateObject(true);
2590  }
updateTemplateObject($a_refresh=false)
Update table template.
+ Here is the call graph for this function:

◆ returnToUpperContextObject()

ilObjStyleSheetGUI::returnToUpperContextObject ( )

return to upper context

Definition at line 3041 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl.

3042  {
3043  $ilCtrl = $this->ctrl;
3044 
3045  /*if ($_GET["baseClass"] == "ilAdministrationGUI")
3046  {
3047  $ilCtrl->redirectByClass("ilcontentstylesettingsgui", "edit");
3048  }*/
3049  $ilCtrl->returnToParent($this);
3050  }

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

Definition at line 1594 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_determineTag(), initCharacteristicForm(), and ilUtil\sendInfo().

1595  {
1596  $ilCtrl = $this->ctrl;
1597  $tpl = $this->tpl;
1598  $lng = $this->lng;
1599 
1600  $this->initCharacteristicForm("create");
1601 
1602  if ($this->form_gui->checkInput()) {
1603  if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"])) {
1604  $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1605  $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1606  } else {
1607  $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1608  ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1609  $ilCtrl->setParameter(
1610  $this,
1611  "tag",
1612  ilObjStyleSheet::_determineTag($_POST["type"]) . "." . $_POST["new_characteristic"]
1613  );
1614  $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1615  $ilCtrl->redirect($this, "editTagStyle");
1616  }
1617  }
1618  $this->form_gui->setValuesByPost();
1619  $tpl->setContent($this->form_gui->getHTML());
1620  }
static _determineTag($a_type)
$_GET["client_id"]
initCharacteristicForm($a_mode)
Init tag style editing form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveColorObject()

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

Definition at line 1919 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and initColorForm().

1920  {
1921  $tpl = $this->tpl;
1922  $ilCtrl = $this->ctrl;
1923  $lng = $this->lng;
1924 
1925  $this->initColorForm();
1926 
1927  if ($this->form_gui->checkInput()) {
1928  if ($this->object->colorExists($_POST["color_name"])) {
1929  $col_input = $this->form_gui->getItemByPostVar("color_name");
1930  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1931  } else {
1932  $this->object->addColor(
1933  $_POST["color_name"],
1934  $_POST["color_code"]
1935  );
1936  $ilCtrl->redirect($this, "listColors");
1937  }
1938  }
1939  $this->form_gui->setValuesByPost();
1940  $tpl->setContent($this->form_gui->getHTML());
1941  }
initColorForm($a_mode="create")
Init color form.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveHideStatusObject()

ilObjStyleSheetGUI::saveHideStatusObject ( )

Save hide status for characteristics.

Definition at line 1706 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, and ilUtil\sendInfo().

1707  {
1708  $ilCtrl = $this->ctrl;
1709  $lng = $this->lng;
1710 
1711  //var_dump($_POST);
1712 
1713  foreach ($_POST["all_chars"] as $char) {
1714  $ca = explode(".", $char);
1715  $this->object->saveHideStatus(
1716  $ca[0],
1717  $ca[2],
1718  (is_array($_POST["hide"]) && in_array($char, $_POST["hide"]))
1719  );
1720  }
1721 
1722  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1723  $ilCtrl->redirect($this, "edit");
1724  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveMediaQueryObject()

ilObjStyleSheetGUI::saveMediaQueryObject ( )

Save media query.

Definition at line 2131 of file class.ilObjStyleSheetGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and initMediaQueryForm().

2132  {
2133  $tpl = $this->tpl;
2134  $ilCtrl = $this->ctrl;
2135  $lng = $this->lng;
2136 
2137  $this->initMediaQueryForm();
2138 
2139  if ($this->form_gui->checkInput()) {
2140  $this->object->addMediaQuery($_POST["mquery"]);
2141  $ilCtrl->redirect($this, "listMediaQueries");
2142  }
2143  $this->form_gui->setValuesByPost();
2144  $tpl->setContent($this->form_gui->getHTML());
2145  }
initMediaQueryForm($a_mode="create")
Init media query form.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveMediaQueryOrderObject()

ilObjStyleSheetGUI::saveMediaQueryOrderObject ( )

Save media query order.

Parameters

Definition at line 2221 of file class.ilObjStyleSheetGUI.php.

References $_POST, and ilObjectGUI\$ctrl.

2222  {
2223  $ilCtrl = $this->ctrl;
2224 
2225  if (is_array($_POST["order"])) {
2226  $this->object->saveMediaQueryOrder($_POST["order"]);
2227  }
2228  $ilCtrl->redirect($this, "listMediaQueries");
2229  }
$_POST["username"]

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

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

References $_GET, $_POST, ilObjStyleSheet\_addMissingStyleClassesToStyle(), ilObject\_lookupType(), ilObjStyleSheet\_writeStandard(), ilObjStyleSheet\getBasicZipPath(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), settings(), and ilUtil\stripSlashes().

998  {
999  if (!trim($_POST["style_title"])) {
1000  $this->ctrl->redirect($this, "create");
1001  }
1002 
1003  // copy from default style or ... see #11330
1004  $default_style = $this->settings->get("default_content_style_id");
1005  if (ilObject::_lookupType($default_style) == "sty") {
1006  $style_obj = ilObjectFactory::getInstanceByObjId($default_style);
1007  $new_id = $style_obj->ilClone();
1008  $newObj = new ilObjStyleSheet($new_id);
1009  } else {
1010  // ... import from basic zip file
1011  $imp = new ilImport();
1012  $style_id = $imp->importObject(
1013  null,
1015  "style.zip",
1016  "sty",
1017  $a_comp = "Services/Style",
1018  true
1019  );
1020 
1021  $newObj = new ilObjStyleSheet($style_id);
1022  }
1023 
1024  $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
1025  $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
1026  $newObj->update();
1027 
1029 
1030  // assign style to style sheet folder,
1031  // if parent is style sheet folder
1032  if ($_GET["ref_id"] > 0) {
1033  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1034  if ($fold->getType() == "stys") {
1035  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1036  $cont_style_settings = new ilContentStyleSettings();
1037  $cont_style_settings->addStyle($newObj->getId());
1038  $cont_style_settings->update();
1039 
1040  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1041  $this->ctrl->returnToParent($this);
1042  }
1043  }
1044 
1045  return $newObj->getId();
1046  }
settings()
Definition: settings.php:2
$_GET["client_id"]
static getBasicZipPath()
Get basic zip path.
Import class.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType($a_id, $a_reference=false)
lookup object type
static _addMissingStyleClassesToStyle($a_id)
Add missing style classes to all styles.
static _writeStandard($a_id, $a_std)
Write standard flag.
Class ilObjStyleSheet.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_POST["username"]
+ Here is the call graph for this function:

◆ saveTagStyle()

ilObjStyleSheetGUI::saveTagStyle ( )

Save tag style.

Definition at line 465 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, $in, ilObjStyleSheet\_getStyleParameters(), and writeStylePar().

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

466  {
467  $cur = explode(".", $_GET["tag"]);
468  $cur_tag = $cur[0];
469  $cur_class = $cur[1];
470  $avail_pars = ilObjStyleSheet::_getStyleParameters($cur_tag);
471  foreach ($avail_pars as $par => $v) {
472  $var = str_replace("-", "_", $par);
473  $basepar_arr = explode(".", $par);
474  $basepar = $basepar_arr[0];
475  if ($basepar_arr[1] != "" && $basepar_arr[1] != $cur_tag) {
476  continue;
477  }
478 
479  switch ($v["input"]) {
480  case "fontsize":
481  case "numeric_no_perc":
482  case "numeric":
483  case "background_image":
484  $in = $this->form_gui->getItemByPostVar($basepar);
485 //echo "<br>-".$cur_tag."-".$cur_class."-".$basepar."-".$_GET["style_type"]."-";
486  $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
487  break;
488 
489  case "color":
490  $color = trim($_POST[$basepar]);
491  if ($color != "" && trim(substr($color, 0, 1) != "!")) {
492  $color = "#" . $color;
493  }
494  $this->writeStylePar($cur_tag, $cur_class, $basepar, $color, $_GET["style_type"], (int) $_GET["mq_id"]);
495  break;
496 
497  case "trbl_numeric":
498  case "border_width":
499  case "border_style":
500  $in = $this->form_gui->getItemByPostVar($basepar);
501  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0], $in->getAllValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
502  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1], $in->getTopValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
503  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2], $in->getRightValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
504  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3], $in->getBottomValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
505  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4], $in->getLeftValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
506  break;
507 
508  case "trbl_color":
509  $in = $this->form_gui->getItemByPostVar($basepar);
510  $tblr_p = array(0 => "getAllValue", 1 => "getTopValue", 2 => "getRightValue",
511  3 => "getBottomValue", 4 => "getLeftValue");
512  foreach ($tblr_p as $k => $func) {
513  $val = trim($in->$func());
514  $val = (($in->getAcceptNamedColors() && substr($val, 0, 1) == "!")
515  || $val == "")
516  ? $val
517  : "#" . $val;
518  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][$k], $val, $_GET["style_type"], (int) $_GET["mq_id"]);
519  }
520  break;
521 
522  case "background_position":
523  $in = $this->form_gui->getItemByPostVar($basepar);
524  $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
525  break;
526 
527  default:
528  $this->writeStylePar($cur_tag, $cur_class, $basepar, $_POST[$basepar], $_GET["style_type"], (int) $_GET["mq_id"]);
529  break;
530  }
531  }
532 
533  // write custom parameter
534  $this->object->deleteCustomStylePars($cur_tag, $cur_class, $_GET["style_type"], (int) $_GET["mq_id"]);
535  if (is_array($_POST["custom_par"])) {
536  foreach ($_POST["custom_par"] as $cpar) {
537  $par_arr = explode(":", $cpar);
538  if (count($par_arr) == 2) {
539  $par = trim($par_arr[0]);
540  $val = trim(str_replace(";", "", $par_arr[1]));
541  $this->writeStylePar($cur_tag, $cur_class, $par, $val, $_GET["style_type"], (int) $_GET["mq_id"], true);
542  }
543  }
544  }
545 
546  $this->object->update();
547  }
$_GET["client_id"]
writeStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom=false)
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
static _getStyleParameters($a_tag="")
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTemplateObject()

ilObjStyleSheetGUI::saveTemplateObject ( )

Save table template.

Definition at line 2494 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_getTemplateClassTypes(), getTemplatePreview(), and initTemplateForm().

2495  {
2496  $tpl = $this->tpl;
2497  $ilCtrl = $this->ctrl;
2498  $lng = $this->lng;
2499 
2500  $this->initTemplateForm();
2501 
2502  if ($this->form_gui->checkInput()) {
2503  if ($this->object->templateExists($_POST["name"])) {
2504  $name_input = $this->form_gui->getItemByPostVar("name");
2505  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2506  } else {
2507  $classes = array();
2508  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2509  $classes[$tct] = $_POST[$tct . "_class"];
2510  }
2511  $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2512  $this->object->writeTemplatePreview(
2513  $t_id,
2514  $this->getTemplatePreview($_GET["temp_type"], $t_id, true)
2515  );
2516  $ilCtrl->redirect($this, "listTemplates");
2517  }
2518  }
2519  $this->form_gui->setValuesByPost();
2520  $tpl->setContent($this->form_gui->getHTML());
2521  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_GET["client_id"]
initTemplateForm($a_mode="create")
Init table template form.
$_POST["username"]
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjStyleSheetGUI::setSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Definition at line 1279 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, and ilObjStyleSheet\_getStyleSuperTypes().

Referenced by editObject().

1280  {
1281  $lng = $this->lng;
1282  $ilTabs = $this->tabs;
1283  $ilCtrl = $this->ctrl;
1284 
1286 
1287  foreach ($types as $super_type => $types) {
1288  // text block characteristics
1289  $ilCtrl->setParameter($this, "style_type", $super_type);
1290  $ilTabs->addSubTabTarget(
1291  "sty_" . $super_type . "_char",
1292  $this->ctrl->getLinkTarget($this, "edit"),
1293  array("edit", ""),
1294  get_class($this)
1295  );
1296  }
1297 
1298  $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1299  }
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Definition at line 1306 of file class.ilObjStyleSheetGUI.php.

References $_GET, $c, ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, and ilObjStyleSheet\_getTemplateClassTypes().

Referenced by listTemplatesObject().

1307  {
1308  $lng = $this->lng;
1309  $ilTabs = $this->tabs;
1310  $ilCtrl = $this->ctrl;
1311 
1313 
1314  foreach ($types as $t => $c) {
1315  $ilCtrl->setParameter($this, "temp_type", $t);
1316  $ilTabs->addSubTabTarget(
1317  "sty_" . $t . "_templates",
1318  $this->ctrl->getLinkTarget($this, "listTemplates"),
1319  array("listTemplates", ""),
1320  get_class($this)
1321  );
1322  }
1323 
1324  $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1325  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$c
Definition: cli.php:37
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchMQueryObject()

ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters

Definition at line 616 of file class.ilObjStyleSheetGUI.php.

References $_POST, and ilObjectGUI\$ctrl.

617  {
618  $ilCtrl = $this->ctrl;
619 
620  $ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
621  $ilCtrl->redirect($this, "editTagStyle");
622  }
$_POST["username"]

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

Definition at line 2788 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, Vendor\Package\$b, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, getTemplatePreview(), and initTemplateGenerationForm().

2789  {
2790  $tpl = $this->tpl;
2791  $ilCtrl = $this->ctrl;
2792  $lng = $this->lng;
2793 
2794  $this->initTemplateGenerationForm();
2795 
2796  if ($this->form_gui->checkInput()) {
2797  if ($this->object->templateExists($_POST["name"])) {
2798  $name_input = $this->form_gui->getItemByPostVar("name");
2799  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2800  } else {
2801  // -> move to application class!
2802 
2803  // cell classes
2804  $cells = array("H" => "header", "C1" => "cell1", "C2" => "cell2");
2805  $tb_p = $this->form_gui->getItemByPostVar("tb_padding");
2806  $tb_padding = $tb_p->getValue();
2807  $lr_p = $this->form_gui->getItemByPostVar("lr_padding");
2808  $lr_padding = $lr_p->getValue();
2809  $cell_color = $_POST["base_color"];
2810 
2811  // use mid gray as cell color for bw zebra
2812  if ($_POST["layout"] == "bwZebra") {
2813  $cell_color = "MidGray";
2814  if (!$this->object->colorExists($cell_color)) {
2815  $this->object->addColor($cell_color, "7F7F7F");
2816  }
2817  $this->object->updateColor($cell_color, $cell_color, "7F7F7F");
2818  }
2819 
2820  foreach ($cells as $k => $cell) {
2821  $cell_class[$k] = $_POST["name"] . $k;
2822  if (!$this->object->characteristicExists($cell_class[$k], "table_cell")) {
2823  $this->object->addCharacteristic("table_cell", $cell_class[$k], true);
2824  }
2825  if ($_POST["layout"] == "bwZebra" && $k == "H") {
2826  $this->object->replaceStylePar(
2827  "td",
2828  $cell_class[$k],
2829  "color",
2830  "!" . $_POST["base_color"] . "(" . $_POST["lightness_" . $cell . "_text"] . ")",
2831  "table_cell"
2832  );
2833  $this->object->replaceStylePar(
2834  "td",
2835  $cell_class[$k],
2836  "background-color",
2837  "!" . $_POST["base_color"] . "(" . $_POST["lightness_" . $cell . "_bg"] . ")",
2838  "table_cell"
2839  );
2840  } else {
2841  $this->object->replaceStylePar(
2842  "td",
2843  $cell_class[$k],
2844  "color",
2845  "!" . $cell_color . "(" . $_POST["lightness_" . $cell . "_text"] . ")",
2846  "table_cell"
2847  );
2848  $this->object->replaceStylePar(
2849  "td",
2850  $cell_class[$k],
2851  "background-color",
2852  "!" . $cell_color . "(" . $_POST["lightness_" . $cell . "_bg"] . ")",
2853  "table_cell"
2854  );
2855  }
2856  $this->object->replaceStylePar(
2857  "td",
2858  $cell_class[$k],
2859  "padding-top",
2860  $tb_padding,
2861  "table_cell"
2862  );
2863  $this->object->replaceStylePar(
2864  "td",
2865  $cell_class[$k],
2866  "padding-bottom",
2867  $tb_padding,
2868  "table_cell"
2869  );
2870  $this->object->replaceStylePar(
2871  "td",
2872  $cell_class[$k],
2873  "padding-left",
2874  $lr_padding,
2875  "table_cell"
2876  );
2877  $this->object->replaceStylePar(
2878  "td",
2879  $cell_class[$k],
2880  "padding-right",
2881  $lr_padding,
2882  "table_cell"
2883  );
2884  $this->object->replaceStylePar(
2885  "td",
2886  $cell_class[$k],
2887  "border-width",
2888  "1px",
2889  "table_cell"
2890  );
2891  $this->object->replaceStylePar(
2892  "td",
2893  $cell_class[$k],
2894  "border-style",
2895  "solid",
2896  "table_cell"
2897  );
2898  $this->object->replaceStylePar(
2899  "td",
2900  $cell_class[$k],
2901  "border-color",
2902  "!" . $cell_color . "(" . $_POST["lightness_border"] . ")",
2903  "table_cell"
2904  );
2905  $this->object->replaceStylePar(
2906  "td",
2907  $cell_class[$k],
2908  "font-weight",
2909  "normal",
2910  "table_cell"
2911  );
2912  }
2913 
2914  // table class
2915  $classes["table"] = $_POST["name"] . "T";
2916  if (!$this->object->characteristicExists($classes["table"], "table")) {
2917  $this->object->addCharacteristic("table", $classes["table"], true);
2918  }
2919  $this->object->replaceStylePar(
2920  "table",
2921  $classes["table"],
2922  "caption-side",
2923  "bottom",
2924  "table"
2925  );
2926  $this->object->replaceStylePar(
2927  "table",
2928  $classes["table"],
2929  "border-collapse",
2930  "collapse",
2931  "table"
2932  );
2933  $this->object->replaceStylePar(
2934  "table",
2935  $classes["table"],
2936  "margin-top",
2937  "5px",
2938  "table"
2939  );
2940  $this->object->replaceStylePar(
2941  "table",
2942  $classes["table"],
2943  "margin-bottom",
2944  "5px",
2945  "table"
2946  );
2947  if ($_POST["layout"] == "bwZebra") {
2948  $this->object->replaceStylePar(
2949  "table",
2950  $classes["table"],
2951  "border-bottom-color",
2952  "!" . $_POST["base_color"],
2953  "table"
2954  );
2955  $this->object->replaceStylePar(
2956  "table",
2957  $classes["table"],
2958  "border-bottom-style",
2959  "solid",
2960  "table"
2961  );
2962  $this->object->replaceStylePar(
2963  "table",
2964  $classes["table"],
2965  "border-bottom-width",
2966  "3px",
2967  "table"
2968  );
2969  $sb = array("left", "right", "top");
2970  foreach ($sb as $b) {
2971  $this->object->replaceStylePar(
2972  "table",
2973  $classes["table"],
2974  "border-" . $b . "-width",
2975  "0px",
2976  "table"
2977  );
2978  }
2979  }
2980 
2981  switch ($_POST["layout"]) {
2982  case "coloredZebra":
2983  $classes["row_head"] = $cell_class["H"];
2984  $classes["odd_row"] = $cell_class["C1"];
2985  $classes["even_row"] = $cell_class["C2"];
2986  break;
2987 
2988  case "bwZebra":
2989  $classes["row_head"] = $cell_class["H"];
2990  $classes["odd_row"] = $cell_class["C1"];
2991  $classes["even_row"] = $cell_class["C2"];
2992  break;
2993 
2994  case "noZebra":
2995  $classes["row_head"] = $cell_class["H"];
2996  $classes["odd_row"] = $cell_class["C1"];
2997  $classes["even_row"] = $cell_class["C1"];
2998  $classes["col_head"] = $cell_class["C2"];
2999  break;
3000  }
3001 
3002 
3003  $t_id = $this->object->addTemplate(
3004  $_GET["temp_type"],
3005  $_POST["name"],
3006  $classes
3007  );
3008  $this->object->writeTemplatePreview(
3009  $t_id,
3010  $this->getTemplatePreview($_GET["temp_type"], $t_id, true)
3011  );
3012  $ilCtrl->redirect($this, "listTemplates");
3013  }
3014  }
3015  $this->form_gui->setValuesByPost();
3016  $tpl->setContent($this->form_gui->getHTML());
3017  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$_GET["client_id"]
initTemplateGenerationForm()
Init table template generation form.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

Definition at line 1946 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and initColorForm().

1947  {
1948  $tpl = $this->tpl;
1949  $ilCtrl = $this->ctrl;
1950  $lng = $this->lng;
1951 
1952  $this->initColorForm("edit");
1953 
1954  if ($this->form_gui->checkInput()) {
1955  if ($this->object->colorExists($_POST["color_name"]) &&
1956  $_POST["color_name"] != $_GET["c_name"]) {
1957  $col_input = $this->form_gui->getItemByPostVar("color_name");
1958  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1959  } else {
1960  $this->object->updateColor(
1961  $_GET["c_name"],
1962  $_POST["color_name"],
1963  $_POST["color_code"]
1964  );
1965  $ilCtrl->redirect($this, "listColors");
1966  }
1967  }
1968  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1969  $this->form_gui->setValuesByPost();
1970  $tpl->setContent($this->form_gui->getHTML());
1971  }
$_GET["client_id"]
initColorForm($a_mode="create")
Init color form.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateMediaQueryObject()

ilObjStyleSheetGUI::updateMediaQueryObject ( )

Update media query.

Definition at line 2150 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and initMediaQueryForm().

2151  {
2152  $tpl = $this->tpl;
2153  $ilCtrl = $this->ctrl;
2154  $lng = $this->lng;
2155 
2156  $this->initMediaQueryForm("edit");
2157 
2158  if ($this->form_gui->checkInput()) {
2159  $this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
2160  $ilCtrl->redirect($this, "listMediaQueries");
2161  }
2162  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2163  $this->form_gui->setValuesByPost();
2164  $tpl->setContent($this->form_gui->getHTML());
2165  }
$_GET["client_id"]
initMediaQueryForm($a_mode="create")
Init media query form.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

Update properties.

Definition at line 396 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, initPropertiesForm(), and ilUtil\sendInfo().

397  {
398  $lng = $this->lng;
399  $ilCtrl = $this->ctrl;
400  $tpl = $this->tpl;
401 
402  $this->initPropertiesForm("edit");
403  if ($this->form->checkInput()) {
404  $this->object->setTitle($this->form->getInput("style_title"));
405  $this->object->setDescription($this->form->getInput("style_description"));
406  $this->object->writeStyleSetting(
407  "disable_auto_margins",
408  $this->form->getInput("disable_auto_margins")
409  );
410  $this->object->update();
411  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
412  $ilCtrl->redirect($this, "properties");
413  } else {
414  $this->form->setValuesByPost();
415  $tpl->setContent($this->form->getHtml());
416  }
417  }
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ updateTagStyleObject()

ilObjStyleSheetGUI::updateTagStyleObject ( )

save and refresh tag editing

Definition at line 444 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ctrl, initTagStyleForm(), outputTagStyleEditScreen(), and saveTagStyle().

445  {
446  $ilCtrl = $this->ctrl;
447 
448  $cur = explode(".", $_GET["tag"]);
449  $cur_tag = $cur[0];
450  $cur_class = $cur[1];
451 
452  $this->initTagStyleForm("edit", $cur_tag);
453  if ($this->form_gui->checkInput()) {
454  $this->saveTagStyle();
455  $ilCtrl->redirect($this, "edit");
456  } else {
457  $this->form_gui->setValuesByPost();
458  $this->outputTagStyleEditScreen();
459  }
460  }
saveTagStyle()
Save tag style.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
+ Here is the call graph for this function:

◆ updateTemplateObject()

ilObjStyleSheetGUI::updateTemplateObject (   $a_refresh = false)

Update table template.

Definition at line 2526 of file class.ilObjStyleSheetGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_getTemplateClassTypes(), ilObjStyleSheet\_lookupTemplateName(), displayTemplateEditForm(), getTemplatePreview(), and initTemplateForm().

Referenced by refreshTemplateObject().

2527  {
2528  $tpl = $this->tpl;
2529  $ilCtrl = $this->ctrl;
2530  $lng = $this->lng;
2531 
2532  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2533  $this->initTemplateForm("edit");
2534 
2535  if ($this->form_gui->checkInput()) {
2536  if ($this->object->templateExists($_POST["name"]) &&
2537  $_POST["name"] != ilObjStyleSheet::_lookupTemplateName($_GET["t_id"])) {
2538  $name_input = $this->form_gui->getItemByPostVar("name");
2539  $name_input->setAlert($lng->txt("sty_template_already_exists"));
2540  } else {
2541  $classes = array();
2542  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2543  $classes[$tct] = $_POST[$tct . "_class"];
2544  }
2545 
2546  $this->object->updateTemplate(
2547  $_GET["t_id"],
2548  $_POST["name"],
2549  $classes
2550  );
2551  $this->object->writeTemplatePreview(
2552  $_GET["t_id"],
2553  $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true)
2554  );
2555  if (!$a_refresh) {
2556  $ilCtrl->redirect($this, "listTemplates");
2557  }
2558  }
2559  }
2560 
2561  $this->form_gui->setValuesByPost();
2562  $this->displayTemplateEditForm();
2563  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
static _getTemplateClassTypes($a_template_type="")
Get template class types.
static _lookupTemplateName($a_t_id)
Lookup table template name for template ID.
$_GET["client_id"]
initTemplateForm($a_mode="create")
Init table template form.
displayTemplateEditForm()
Display table tempalte edit form.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadImageObject()

ilObjStyleSheetGUI::uploadImageObject ( )

Upload image.

Definition at line 1407 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, and initImageForm().

1408  {
1409  $tpl = $this->tpl;
1410  $ilCtrl = $this->ctrl;
1411 
1412  $this->initImageForm();
1413 
1414  if ($this->form_gui->checkInput()) {
1415  $this->object->uploadImage($_FILES["image_file"]);
1416  $ilCtrl->redirect($this, "listImages");
1417  } else {
1418  //$this->form_gui->setImageFormValuesByPost();
1419  $tpl->setContent($this->form_gui->getHTML());
1420  }
1421  }
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

Definition at line 109 of file class.ilObjStyleSheetGUI.php.

References editObject().

110  {
111  $this->editObject();
112  }
editObject()
edit style sheet
+ Here is the call graph for this function:

◆ writeStylePar()

ilObjStyleSheetGUI::writeStylePar (   $cur_tag,
  $cur_class,
  $par,
  $value,
  $a_type,
  $a_mq_id,
  $a_custom = false 
)

Definition at line 549 of file class.ilObjStyleSheetGUI.php.

Referenced by saveTagStyle().

550  {
551  // echo $_GET["mq_id"]."-";
552  // echo $a_mq_id."-"; exit;
553  if ($a_type == "") {
554  return;
555  }
556 
557  if ($value != "") {
558  $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
559  } else {
560  $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
561  }
562  }
+ Here is the caller graph for this function:

Field Documentation

◆ $cmd_delete

ilObjStyleSheetGUI::$cmd_delete

Definition at line 41 of file class.ilObjStyleSheetGUI.php.

◆ $cmd_new_par

ilObjStyleSheetGUI::$cmd_new_par

Definition at line 39 of file class.ilObjStyleSheetGUI.php.

◆ $cmd_refresh

ilObjStyleSheetGUI::$cmd_refresh

Definition at line 40 of file class.ilObjStyleSheetGUI.php.

◆ $cmd_update

ilObjStyleSheetGUI::$cmd_update

Definition at line 38 of file class.ilObjStyleSheetGUI.php.

◆ $enable_write

ilObjStyleSheetGUI::$enable_write = false
protected

Definition at line 43 of file class.ilObjStyleSheetGUI.php.

◆ $help

ilObjStyleSheetGUI::$help
protected

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

Referenced by createObject(), and getTabs().

◆ $obj_definition

ilObjStyleSheetGUI::$obj_definition
protected

Definition at line 36 of file class.ilObjStyleSheetGUI.php.

◆ $rbacsystem

◆ $tabs

ilObjStyleSheetGUI::$tabs
protected

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