ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 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...
 
 setTabs ()
 output tabs 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...
 
 showUpperIcon ()
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

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 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
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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 47 of file class.ilObjStyleSheetGUI.php.

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObjStyleSheet\_getStyleSuperTypeForType().

48  {
49  global $DIC;
50 
51  $this->tpl = $DIC["tpl"];
52  $this->rbacsystem = $DIC->rbac()->system();
53  $this->help = $DIC["ilHelp"];
54  $this->tabs = $DIC->tabs();
55  $this->toolbar = $DIC->toolbar();
56  $this->locator = $DIC["ilLocator"];
57  $this->tree = $DIC->repositoryTree();
58  $this->obj_definition = $DIC["objDefinition"];
59  $ilCtrl = $DIC->ctrl();
60  $lng = $DIC->language();
61  $tpl = $DIC["tpl"];
62 
63  $this->ctrl = $ilCtrl;
64  $this->lng = $lng;
65  $this->lng->loadLanguageModule("style");
66  $ilCtrl->saveParameter($this, array("tag", "style_type", "temp_type"));
67  if ($_GET["style_type"] != "") {
68  $this->super_type = ilObjStyleSheet::_getStyleSuperTypeForType($_GET["style_type"]);
69  }
70 
71  $this->type = "sty";
72  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
73  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _getStyleSuperTypeForType($a_type)
global $ilCtrl
Definition: ilias.php:18
+ 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 2351 of file class.ilObjStyleSheetGUI.php.

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

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

2352  {
2353  global $DIC;
2354 
2355  $lng = $DIC->language();
2356  $tpl = $DIC["tpl"];
2357 
2358  $kr = $kc = 7;
2359  if ($a_small_mode) {
2360  $kr = 6;
2361  $kc = 5;
2362  }
2363 
2364  $ts = $a_style->getTemplate($a_t_id);
2365  $t = $ts["classes"];
2366 
2367  // preview
2368  if ($a_type == "table") {
2369  $p_content = '<PageContent><Table DataTable="y"';
2370  if ($t["row_head"] != "") {
2371  $p_content .= ' HeaderRows="1"';
2372  }
2373  if ($t["row_foot"] != "") {
2374  $p_content .= ' FooterRows="1"';
2375  }
2376  if ($t["col_head"] != "") {
2377  $p_content .= ' HeaderCols="1"';
2378  }
2379  if ($t["col_foot"] != "") {
2380  $p_content .= ' FooterCols="1"';
2381  }
2382  $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
2383  if (!$a_small_mode) {
2384  $p_content .= '<Caption>' . $lng->txt("sty_caption") . '</Caption>';
2385  }
2386  for ($i = 1; $i <= $kr; $i++) {
2387  $p_content .= '<TableRow>';
2388  for ($j = 1; $j <= $kc; $j++) {
2389  if ($a_small_mode) {
2390  $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
2391  } else {
2392  $cell = 'xxx';
2393  }
2394  $p_content .= '<TableData><PageContent><Paragraph Characteristic="TableContent">' . $cell . '</Paragraph></PageContent></TableData>';
2395  }
2396  $p_content .= '</TableRow>';
2397  }
2398  $p_content .= '</Table></PageContent>';
2399  }
2400 
2401  if ($a_type == "vaccordion" || $a_type == "haccordion" || $a_type == "carousel") {
2402  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2404 
2405  if ($a_small_mode) {
2406  $c = '&amp;nbsp;';
2407  $h = '&amp;nbsp;';
2408  } else {
2409  $c = 'xxx';
2410  $h = 'head';
2411  }
2412  if ($a_type == "vaccordion") {
2413  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2414  if ($a_small_mode) {
2415  $p_content .= ' ContentWidth="70"';
2416  }
2417  } elseif ($a_type == "haccordion") {
2418  $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
2419  if ($a_small_mode) {
2420  $p_content .= ' ContentHeight="40"';
2421  $p_content .= ' ContentWidth="70"';
2422  $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
2423  } else {
2424  $p_content .= ' ContentHeight="40"';
2425  }
2426  } elseif ($a_type == "carousel") {
2427  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="Carousel" ';
2428  if ($a_small_mode) {
2429  $p_content .= ' ContentWidth="70"';
2430  }
2431  }
2432 
2433 
2434  $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
2435  $p_content .= '<Tab><PageContent><Paragraph>' . $c . '</Paragraph></PageContent>';
2436  $p_content .= '<TabCaption>' . $h . '</TabCaption>';
2437  $p_content .= '</Tab>';
2438  $p_content .= '</Tabs></PageContent>';
2439  }
2440  //echo htmlentities($p_content);
2441  $txml = $a_style->getTemplateXML();
2442  //echo htmlentities($txml); exit;
2443  $p_content .= $txml;
2444  include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
2445  $r_content = ilPCTableGUI::_renderTable($p_content, "");
2446 
2447  // fix carousel template visibility
2448  if ($a_type == "carousel") {
2449  $r_content .= "<style>.owl-carousel{ display:block !important; }</style>";
2450  }
2451 
2452  //echo htmlentities($r_content); exit;
2453  return $r_content;
2454  }
global $DIC
Definition: saml.php:7
$h
$a_type
Definition: workflow.php:92
static addCss()
Add required css.
$i
Definition: disco.tpl.php:19
static _renderTable( $content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true)
Static render table function.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accordiontestObject()

ilObjStyleSheetGUI::accordiontestObject ( )

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

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

3046  {
3047  $tpl = $this->tpl;
3048 
3049  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
3050 
3051  $acc = new ilAccordionGUI();
3052  $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
3053  $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
3054  $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
3055 
3056  $ac2 = new ilAccordionGUI();
3057  $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
3058  $ac2->addItem("Header 2", $acc->getHTML());
3059  $ac2->setOrientation(ilAccordionGUI::VERTICAL);
3060 
3061  $tpl->setContent($ac2->getHTML());
3062  }
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 1340 of file class.ilObjStyleSheetGUI.php.

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

1341  {
1342  $ilLocator = $this->locator;
1343 
1344  if ($_GET["admin_mode"] == "settings") { // system settings
1345  parent::addAdminLocatorItems(true);
1346 
1347  $ilLocator->addItem(
1349  ilObject::_lookupObjId($_GET["ref_id"])
1350  ),
1351  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "")
1352  );
1353 
1354  if ($_GET["obj_id"] > 0) {
1355  $ilLocator->addItem(
1356  $this->object->getTitle(),
1357  $this->ctrl->getLinkTarget($this, "edit")
1358  );
1359  }
1360  } else { // repository administration
1361  //?
1362  }
1363  }
$_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 1609 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initCharacteristicForm().

1610  {
1611  $tpl = $this->tpl;
1612 
1613  $this->initCharacteristicForm("create");
1614  $tpl->setContent($this->form_gui->getHTML());
1615  }
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 1859 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initColorForm().

1860  {
1861  $tpl = $this->tpl;
1862 
1863  $this->initColorForm();
1864  $tpl->setContent($this->form_gui->getHTML());
1865  }
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ addImageObject()

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

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

References ilObjectGUI\$tpl, and initImageForm().

1414  {
1415  $tpl = $this->tpl;
1416 
1417  $this->initImageForm();
1418  $tpl->setContent($this->form_gui->getHTML());
1419  }
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

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

References ilObjectGUI\$tpl, and initMediaQueryForm().

2087  {
2088  $tpl = $this->tpl;
2089 
2090  $this->initMediaQueryForm();
2091  $tpl->setContent($this->form_gui->getHTML());
2092  }
initMediaQueryForm($a_mode="create")
Init media query form.
+ Here is the call graph for this function:

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

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

References ilObjectGUI\$tpl, and initTemplateForm().

2313  {
2314  $tpl = $this->tpl;
2315 
2316  $this->initTemplateForm();
2317  $tpl->setContent($this->form_gui->getHTML());
2318  }
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 1128 of file class.ilObjStyleSheetGUI.php.

1129  {
1130  }

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

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

1577  {
1578  $ilCtrl = $this->ctrl;
1579  $lng = $this->lng;
1580 
1581  ilUtil::sendInfo($lng->txt("action_aborted"), true);
1582  $ilCtrl->redirect($this, "edit");
1583  }
global $ilCtrl
Definition: ilias.php:18
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 2030 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2031  {
2032  $ilCtrl = $this->ctrl;
2033 
2034  $ilCtrl->redirect($this, "listColors");
2035  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

1936  {
1937  $ilCtrl = $this->ctrl;
1938 
1939  $ilCtrl->redirect($this, "listColors");
1940  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

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

959  {
960  $this->ctrl->returnToParent($this);
961  }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

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

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

1137  {
1138  $lng = $this->lng;
1139 
1140  ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1141  $this->ctrl->returnToParent($this);
1142  }
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 2682 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2683  {
2684  $ilCtrl = $this->ctrl;
2685 
2686  $ilCtrl->redirect($this, "listTemplates");
2687  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

2510  {
2511  $ilCtrl = $this->ctrl;
2512 
2513  $ilCtrl->redirect($this, "listTemplates");
2514  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

1425  {
1426  $ilCtrl = $this->ctrl;
1427 
1428  $ilCtrl->redirect($this, "listImages");
1429  }
global $ilCtrl
Definition: ilias.php:18

◆ checkWrite()

ilObjStyleSheetGUI::checkWrite ( )

Check write.

Parameters

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

References $_GET, and $rbacsystem.

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

208  {
210 
211  return ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"])
212  || $rbacsystem->checkAccess("sty_write_content", (int) $_GET["ref_id"]));
213  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

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

967  {
968  $this->object->delete();
969 
970  $this->ctrl->returnToParent($this);
971  }

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

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

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

1759  {
1760  $ilCtrl = $this->ctrl;
1761  $lng = $this->lng;
1762 
1763  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1764  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1765  } else {
1766  $style_cp = implode("::", $_POST["char"]);
1767  $style_cp = $this->object->getId() . ":::" . $_GET["style_type"] . ":::" . $style_cp;
1768  $_SESSION["sty_copy"] = $style_cp;
1769  ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1770  }
1771  $ilCtrl->redirect($this, "edit");
1772  }
$_SESSION["AccountId"]
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 1045 of file class.ilObjStyleSheetGUI.php.

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

1046  {
1047  if ($_POST["source_style"] > 0) {
1048  $style_obj = ilObjectFactory::getInstanceByObjId($_POST["source_style"]);
1049  $new_id = $style_obj->ilClone();
1050  }
1051 
1052  // assign style to style sheet folder,
1053  // if parent is style sheet folder
1054  if ($_GET["ref_id"] > 0) {
1055  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1056  if ($fold->getType() == "stys") {
1057  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1058  $cont_style_settings = new ilContentStyleSettings();
1059  $cont_style_settings->addStyle($new_id);
1060  $cont_style_settings->update();
1061  ilObjStyleSheet::_writeStandard($new_id, "1");
1062  $this->ctrl->returnToParent($this);
1063  }
1064  }
1065 
1066  return $new_id;
1067  }
$_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 107 of file class.ilObjStyleSheetGUI.php.

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

108  {
110  $lng = $this->lng;
111  $tpl = $this->tpl;
112  $ilHelp = $this->help;
113 
114  $forms = array();
115 
116 
117  $ilHelp->setScreenIdComponent("sty");
118  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
119 
120  // --- create
121 
122  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
123  $form = new ilPropertyFormGUI();
124  $form->setFormAction($this->ctrl->getFormAction($this));
125  $form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
126 
127  // title
128  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
129  $ti->setMaxLength(128);
130  $ti->setSize(40);
131  $ti->setRequired(true);
132  $form->addItem($ti);
133 
134  // description
135  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
136  $ta->setCols(40);
137  $ta->setRows(2);
138  $form->addItem($ta);
139 
140  $form->addCommandButton("save", $this->lng->txt("save"));
141  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
142 
143  $forms[] = $form;
144 
145 
146  // --- import
147 
148  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
149  $form = new ilPropertyFormGUI();
150  $form->setFormAction($this->ctrl->getFormAction($this));
151  $form->setTitle($this->lng->txt("sty_import_stylesheet"));
152 
153  // title
154  $ti = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
155  $ti->setRequired(true);
156  $form->addItem($ti);
157 
158  $form->addCommandButton("importStyle", $this->lng->txt("import"));
159  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
160 
161  $forms[] = $form;
162 
163 
164  // --- clone
165 
166  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
167  $form = new ilPropertyFormGUI();
168  $form->setFormAction($this->ctrl->getFormAction($this));
169  $form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
170 
171  // source
172  $ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
173  $ti->setRequired(true);
175  $form->addItem($ti);
176 
177  $form->addCommandButton("copyStyle", $this->lng->txt("copy"));
178  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
179 
180  $forms[] = $form;
181 
182 
183  $this->tpl->setContent($this->getCreationFormsHTML($forms));
184  }
This class represents a selection list property in a property form.
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)
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
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 1492 of file class.ilObjStyleSheetGUI.php.

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

1493  {
1494  $ilCtrl = $this->ctrl;
1495  $tpl = $this->tpl;
1496  $lng = $this->lng;
1497 
1498  //var_dump($_POST);
1499 
1500  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1501  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1502  $ilCtrl->redirect($this, "edit");
1503  } else {
1504  // check whether there are any core style classes included
1505  $core_styles = ilObjStyleSheet::_getCoreStyles();
1506  foreach ($_POST["char"] as $char) {
1507  if (!empty($core_styles[$char])) {
1508  $this->deleteCoreCharMessage();
1509  return;
1510  }
1511  }
1512 
1513  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1514  $cgui = new ilConfirmationGUI();
1515  $cgui->setFormAction($ilCtrl->getFormAction($this));
1516  $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1517  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1518  $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1519 
1520  foreach ($_POST["char"] as $char) {
1521  $char_comp = explode(".", $char);
1522  $cgui->addItem("char[]", $char, $char_comp[2]);
1523  }
1524 
1525  $tpl->setContent($cgui->getHTML());
1526  }
1527  }
deleteCoreCharMessage()
Message that appears, when user tries to delete core characteristics.
global $ilCtrl
Definition: ilias.php:18
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 1588 of file class.ilObjStyleSheetGUI.php.

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

1589  {
1590  $ilCtrl = $this->ctrl;
1591 
1592  if (is_array($_POST["char"])) {
1593  foreach ($_POST["char"] as $char) {
1594  $char_comp = explode(".", $char);
1595  $type = $char_comp[0];
1596  $tag = $char_comp[1];
1597  $class = $char_comp[2];
1598 
1599  $this->object->deleteCharacteristic($type, $tag, $class);
1600  }
1601  }
1602 
1603  $ilCtrl->redirect($this, "edit");
1604  }
$type
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

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

2003  {
2004  $ilCtrl = $this->ctrl;
2005  $tpl = $this->tpl;
2006  $lng = $this->lng;
2007 
2008  if (!is_array($_POST["color"]) || count($_POST["color"]) == 0) {
2009  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2010  $ilCtrl->redirect($this, "listColors");
2011  } else {
2012  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2013  $cgui = new ilConfirmationGUI();
2014  $cgui->setFormAction($ilCtrl->getFormAction($this));
2015  $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
2016  $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
2017  $cgui->setConfirm($lng->txt("delete"), "deleteColor");
2018 
2019  foreach ($_POST["color"] as $c) {
2020  $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
2021  }
2022 
2023  $tpl->setContent($cgui->getHTML());
2024  }
2025  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
global $ilCtrl
Definition: ilias.php:18
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 2040 of file class.ilObjStyleSheetGUI.php.

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

2041  {
2042  $ilCtrl = $this->ctrl;
2043 
2044  if (is_array($_POST["color"])) {
2045  foreach ($_POST["color"] as $c) {
2046  $this->object->removeColor($c);
2047  }
2048  }
2049 
2050  $ilCtrl->redirect($this, "listColors");
2051  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteCoreCharMessage()

ilObjStyleSheetGUI::deleteCoreCharMessage ( )

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

Parameters

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

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

Referenced by deleteCharacteristicConfirmationObject().

1536  {
1537  $ilCtrl = $this->ctrl;
1538  $tpl = $this->tpl;
1539  $lng = $this->lng;
1540 
1541  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1542  $cgui = new ilConfirmationGUI();
1543  $cgui->setFormAction($ilCtrl->getFormAction($this));
1544 
1545 
1546  $core_styles = ilObjStyleSheet::_getCoreStyles();
1547  $cnt = 0;
1548  foreach ($_POST["char"] as $char) {
1549  if (!empty($core_styles[$char])) {
1550  $cnt++;
1551  $char_comp = explode(".", $char);
1552  $cgui->addItem("", "", $char_comp[2]);
1553  } else {
1554  $cgui->addHiddenItem("char[]", $char);
1555  }
1556  }
1557  $all_core_styles = ($cnt == count($_POST["char"]))
1558  ? true
1559  : false;
1560 
1561  if ($all_core_styles) {
1562  $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1563  $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1564  } else {
1565  $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1566  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1567  $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1568  }
1569 
1570  $tpl->setContent($cgui->getHTML());
1571  }
global $ilCtrl
Definition: ilias.php:18
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 1475 of file class.ilObjStyleSheetGUI.php.

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

1476  {
1477  $ilCtrl = $this->ctrl;
1478 
1479  $images = $this->object->getImages();
1480 
1481  foreach ($images as $image) {
1482  if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"])) {
1483  $this->object->deleteImage($image["entry"]);
1484  }
1485  }
1486  $ilCtrl->redirect($this, "listImages");
1487  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters

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

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

2229  {
2230  $ilCtrl = $this->ctrl;
2232 
2233  if ($this->checkWrite() && is_array($_POST["mq_id"])) {
2234  foreach ($_POST["mq_id"] as $id) {
2235  $this->object->deleteMediaQuery($id);
2236  }
2237  }
2238  $ilCtrl->redirect($this, "listMediaQueries");
2239  }
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

Confirm media query deletion.

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

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

2197  {
2198  $ilCtrl = $this->ctrl;
2199  $tpl = $this->tpl;
2200  $lng = $this->lng;
2201 
2202  if (!is_array($_POST["mq_id"]) || count($_POST["mq_id"]) == 0) {
2203  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2204  $ilCtrl->redirect($this, "listMediaQueries");
2205  } else {
2206  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2207  $cgui = new ilConfirmationGUI();
2208  $cgui->setFormAction($ilCtrl->getFormAction($this));
2209  $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
2210  $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
2211  $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
2212 
2213  foreach ($_POST["mq_id"] as $i) {
2214  $mq = $this->object->getMediaQueryForId($i);
2215  $cgui->addItem("mq_id[]", $i, $mq["mquery"]);
2216  }
2217 
2218  $tpl->setContent($cgui->getHTML());
2219  }
2220  }
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$i
Definition: disco.tpl.php:19
$_POST["username"]
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 934 of file class.ilObjStyleSheetGUI.php.

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

935  {
936  //$this->setTabs();
937 
938  // display confirmation message
939  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
940  $cgui = new ilConfirmationGUI();
941  $cgui->setFormAction($this->ctrl->getFormAction($this));
942  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
943  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
944  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
945 
946  $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath) .
947  " " . ilObject::_lookupTitle($this->object->getId());
948 
949  $cgui->addItem("id[]", "", $caption);
950 
951  $this->tpl->setContent($cgui->getHTML());
952  }
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 976 of file class.ilObjStyleSheetGUI.php.

References $_POST, $id, and editObject().

977  {
978  if (is_array($_POST["sty_select"])) {
979  foreach ($_POST["sty_select"] as $id => $dummy) {
980  $this->object->deleteParameter($id);
981  }
982  }
983  $this->object->read();
984  $this->object->writeCSSFile();
985  $this->editObject();
986  }
if(!array_key_exists('StateId', $_REQUEST)) $id
editObject()
edit style sheet
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

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

2639  {
2640  $ilCtrl = $this->ctrl;
2641  $tpl = $this->tpl;
2642  $lng = $this->lng;
2643 
2644  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0) {
2645  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2646  $ilCtrl->redirect($this, "listTemplates");
2647  } else {
2648  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2649  $cgui = new ilConfirmationGUI();
2650  $cgui->setFormAction($ilCtrl->getFormAction($this));
2651  $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2652  $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2653  $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2654 
2655  foreach ($_POST["tid"] as $tid) {
2656  $classes = $this->object->getTemplateClasses($tid);
2657  $cl_str = "";
2658  $listed = array();
2659  foreach ($classes as $cl) {
2660  if ($cl != "" && !$listed[$cl]) {
2661  $cl_str .= '<div>- ' .
2662  $cl . "</div>";
2663  $listed[$cl] = true;
2664  }
2665  }
2666  if ($cl_str != "") {
2667  $cl_str = '<div style="padding-left:30px;" class="small">' .
2668  "<div><i>" . $lng->txt("sty_style_class") . "</i></div>" . $cl_str . "</div>";
2669  }
2670  $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid) . $cl_str);
2671  }
2672 
2673  $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2674 
2675  $tpl->setContent($cgui->getHTML());
2676  }
2677  }
global $ilCtrl
Definition: ilias.php:18
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 2692 of file class.ilObjStyleSheetGUI.php.

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

2693  {
2694  $ilCtrl = $this->ctrl;
2695 
2696  if (is_array($_POST["tid"])) {
2697  foreach ($_POST["tid"] as $tid) {
2698  $this->object->removeTemplate($tid);
2699  }
2700  }
2701 
2702  $ilCtrl->redirect($this, "listTemplates");
2703  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

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

2709  {
2710  $ilCtrl = $this->ctrl;
2711 
2712  if (is_array($_POST["tid"])) {
2713  foreach ($_POST["tid"] as $tid) {
2714  $cls = $this->object->getTemplateClasses($tid);
2715  foreach ($cls as $k => $cls) {
2716  $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2717  $ta = ilObjStyleSheet::_determineTag($ty);
2718  $this->object->deleteCharacteristic($ty, $ta, $cls);
2719  }
2720  $this->object->removeTemplate($tid);
2721  }
2722  }
2723 
2724  $ilCtrl->redirect($this, "listTemplates");
2725  }
static _determineTag($a_type)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ displayTemplateEditForm()

ilObjStyleSheetGUI::displayTemplateEditForm ( )

Display table tempalte edit form.

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

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

Referenced by editTemplateObject(), and updateTemplateObject().

2595  {
2596  $tpl = $this->tpl;
2597 
2598  $a_tpl = new ilTemplate(
2599  "tpl.template_edit.html",
2600  true,
2601  true,
2602  "Services/Style/Content"
2603  );
2604  $this->includeCSS();
2605  $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2606  $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2607  $tpl->setContent($a_tpl->get());
2608  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
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 1870 of file class.ilObjStyleSheetGUI.php.

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

1871  {
1872  $tpl = $this->tpl;
1873  $ilCtrl = $this->ctrl;
1874 
1875  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1876  $this->initColorForm("edit");
1877  $this->getColorFormValues();
1878  $tpl->setContent($this->form_gui->getHTML());
1879  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 2097 of file class.ilObjStyleSheetGUI.php.

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

2098  {
2099  $tpl = $this->tpl;
2100  $ilCtrl = $this->ctrl;
2101 
2102  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2103  $this->initMediaQueryForm("edit");
2104  $this->getMediaQueryFormValues();
2105  $tpl->setContent($this->form_gui->getHTML());
2106  }
$_GET["client_id"]
initMediaQueryForm($a_mode="create")
Init media query form.
global $ilCtrl
Definition: ilias.php:18
getMediaQueryFormValues()
Set values for media query editing.
+ Here is the call graph for this function:

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

edit style sheet

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

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

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

220  {
222  $lng = $this->lng;
223  $ilTabs = $this->tabs;
225  $ilToolbar = $this->toolbar;
226  $tpl = $this->tpl;
227 
228  $this->setSubTabs();
229 
230  $this->includeCSS();
231 
232  $ctpl = new ilTemplate("tpl.sty_classes.html", true, true, "Services/Style/Content");
233 
234  // output characteristics
235  $chars = $this->object->getCharacteristics();
236 
237  $style_type = ($this->super_type != "")
238  ? $this->super_type
239  : "text_block";
240  $ilCtrl->setParameter($this, "style_type", $style_type);
241  $ilTabs->setSubTabActive("sty_" . $style_type . "_char");
242 
243  // workaround to include default rte styles
244  if ($this->super_type == "rte") {
245  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
246  include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
247  $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
248  }
249 
250  // add new style?
251  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
252  $subtypes = $all_super_types[$style_type];
253  $expandable = false;
254  foreach ($subtypes as $t) {
256  $expandable = true;
257  }
258  }
259  if ($expandable && $this->checkWrite()) {
260  $ilToolbar->addButton(
261  $lng->txt("sty_add_characteristic"),
262  $ilCtrl->getLinkTarget($this, "addCharacteristicForm")
263  );
264  }
265 
266  if ($_SESSION["sty_copy"] != "") {
267  $style_cp = explode(":::", $_SESSION["sty_copy"]);
268  if ($style_cp[1] == $style_type) {
269  if ($expandable) {
270  $ilToolbar->addSeparator();
271  }
272  $ilToolbar->addButton(
273  $lng->txt("sty_paste_style_classes"),
274  $ilCtrl->getLinkTarget($this, "pasteCharacteristicsOverview")
275  );
276  }
277  }
278 
279  include_once("./Services/Style/Content/classes/class.ilStyleTableGUI.php");
280  $table_gui = new ilStyleTableGUI(
281  $this,
282  "edit",
283  $chars,
284  $style_type,
285  $this->object
286  );
287 
288  $ctpl->setCurrentBlock("style_table");
289  $ctpl->setVariable("STYLE_TABLE", $table_gui->getHTML());
290  $ctpl->parseCurrentBlock();
291 
292  $this->tpl->setContent($ctpl->get());
293  }
setSubTabs()
adds tabs to tab gui object
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
static _isExpandable($a_type)
special template class to simplify handling of ITX/PEAR
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 559 of file class.ilObjStyleSheetGUI.php.

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

560  {
561  $tpl = $this->tpl;
562  $ilToolbar = $this->toolbar;
563  $lng = $this->lng;
565 
566  // media query selector
567  $mqs = $this->object->getMediaQueries();
568  if (count($mqs) > 0) {
569  //
570  $options = array(
571  "" => $lng->txt("sty_default"),
572  );
573  foreach ($mqs as $mq) {
574  $options[$mq["id"]] = $mq["mquery"];
575  }
576  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
577  $si = new ilSelectInputGUI("@media", "mq_id");
578  $si->setOptions($options);
579  $si->setValue((int) $_GET["mq_id"]);
580  $ilToolbar->addInputItem($si, true);
581  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
582  $ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
583  }
584 
585  // workaround to include default rte styles
586  //if (in_array($_GET["style_type"], array("rte_menu")))
587  if ($this->super_type == "rte") {
588  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
589  include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
590  $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
591  }
592 
593  $cur = explode(".", $_GET["tag"]);
594  $cur_tag = $cur[0];
595  $cur_class = $cur[1];
596 
597  $this->initTagStyleForm("edit", $cur_tag);
598  $this->getValues();
599  $this->outputTagStyleEditScreen();
600  }
This class represents a selection list property in a property form.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
getValues()
FORM: Get current values from persistent object.
global $ilCtrl
Definition: ilias.php:18
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 2323 of file class.ilObjStyleSheetGUI.php.

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

2324  {
2325  $tpl = $this->tpl;
2326  $ilCtrl = $this->ctrl;
2327 
2328  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2329  $this->initTemplateForm("edit");
2330  $this->getTemplateFormValues();
2331 
2332  $this->displayTemplateEditForm();
2333  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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:

◆ executeCommand()

ilObjStyleSheetGUI::executeCommand ( )

execute command

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

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

79  {
80  $next_class = $this->ctrl->getNextClass($this);
81  $cmd = $this->ctrl->getCmd("edit");
82 
83  // #9440/#9489: prepareOutput will fail if not set properly
84  if (!$this->object) {
85  $this->setCreationMode(true);
86  }
87 
88  $this->prepareOutput();
89  switch ($next_class) {
90  default:
91  $cmd .= "Object";
92  $ret = $this->$cmd();
93  break;
94  }
95 
96  return $ret;
97  }
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 881 of file class.ilObjStyleSheetGUI.php.

References $r, and ilUtil\deliverFile().

882  {
883  include_once("./Services/Export/classes/class.ilExport.php");
884  $exp = new ilExport();
885  $r = $exp->exportObject($this->object->getType(), $this->object->getId());
886 
887  ilUtil::deliverFile($r["directory"] . "/" . $r["file"], $r["file"], '', false, true);
888  }
$r
Definition: example_031.php:79
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 890 of file class.ilObjStyleSheetGUI.php.

References $a_type, and $tag.

Referenced by getValues().

891  {
892  $parameters = array();
893  foreach ($a_style as $tag) {
894  foreach ($tag as $par) {
895  if ($par["tag"] == $a_tag && $par["class"] == $a_class
896  && $par["type"] == $a_type && (int) $a_mq_id == (int) $par["mq_id"]
897  && (int) $a_custom == (int) $par["custom"]) {
898  $parameters[$par["parameter"]] = $par["value"];
899  }
900  }
901  }
902  return $parameters;
903  }
$a_type
Definition: workflow.php:92
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35
+ Here is the caller graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

2731  {
2732  $tpl = $this->tpl;
2733 
2734  $this->initTemplateGenerationForm();
2735  $tpl->setContent($this->form_gui->getHTML());
2736  }
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 1147 of file class.ilObjStyleSheetGUI.php.

References getTabs().

1148  {
1149  $this->getTabs();
1150  }
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 1923 of file class.ilObjStyleSheetGUI.php.

References $_GET, and $values.

Referenced by editColorObject().

1924  {
1925  if ($_GET["c_name"] != "") {
1926  $values["color_name"] = $_GET["c_name"];
1927  $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1928  $this->form_gui->setValuesByArray($values);
1929  }
1930  }
$_GET["client_id"]
$values
+ Here is the caller graph for this function:

◆ getMediaQueryFormValues()

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

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

References $_GET, and $values.

Referenced by editMediaQueryObject().

2143  {
2144  if ($_GET["mq_id"] != "") {
2145  foreach ($this->object->getMediaQueries() as $mq) {
2146  if ($mq["id"] == (int) $_GET["mq_id"]) {
2147  $values["mquery"] = $mq["mquery"];
2148  }
2149  }
2150  $this->form_gui->setValuesByArray($values);
2151  }
2152  }
$_GET["client_id"]
$values
+ Here is the caller graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

References $values.

Referenced by propertiesObject().

328  {
329  $values = array();
330 
331  $values["style_title"] = $this->object->getTitle();
332  $values["style_description"] = $this->object->getDescription();
333  $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
334 
335  $this->form->setValuesByArray($values);
336  }
$values
+ Here is the caller graph for this function:

◆ getStyleExampleHTML()

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

Get style example HTML.

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

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

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

1698  {
1699  global $DIC;
1700 
1701  $lng = $DIC->language();
1702 
1703  $c = explode(":", $a_class);
1704  $a_class = $c[0];
1705 
1706  $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
1707 
1708  if ($ex_tpl->blockExists("Example_" . $a_type)) {
1709  $ex_tpl->setCurrentBlock("Example_" . $a_type);
1710  } else {
1711  $ex_tpl->setCurrentBlock("Example_default");
1712  }
1713  $ex_tpl->setVariable("EX_CLASS", "ilc_" . $a_type . "_" . $a_class);
1714  $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1715  if (in_array($a_type, array("media_cont", "qimg"))) {
1716  //
1717  }
1718  if (in_array($a_type, array("table", "table_caption"))) {
1719  $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1720  }
1721  if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal"))) {
1722  $ex_tpl->setVariable("HOR", "Horizontal");
1723  }
1724  $ex_tpl->parseCurrentBlock();
1725 
1726  return $ex_tpl->get();
1727  }
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92
special template class to simplify handling of ITX/PEAR
+ 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 1173 of file class.ilObjStyleSheetGUI.php.

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

Referenced by getAdminTabs(), and setTabs().

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

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

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

Referenced by editTemplateObject().

2622  {
2623  if ($_GET["t_id"] > 0) {
2624  $t = $this->object->getTemplate($_GET["t_id"]);
2625 
2626  $values["name"] = $t["name"];
2627  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2628  foreach ($scs as $k => $type) {
2629  $values[$k . "_class"] = $t["classes"][$k];
2630  }
2631  $this->form_gui->setValuesByArray($values);
2632  }
2633  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$type
$_GET["client_id"]
$values
+ 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 2338 of file class.ilObjStyleSheetGUI.php.

References $a_type, and _getTemplatePreview().

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

2339  {
2340  return $this->_getTemplatePreview(
2341  $this->object,
2342  $a_type,
2343  $a_t_id,
2344  $a_small_mode
2345  );
2346  }
static _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$a_type
Definition: workflow.php:92
+ 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 818 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editTagStyleObject().

819  {
820  $style = $this->object->getStyle();
821  $cur = explode(".", $_GET["tag"]);
822  $cur_tag = $cur[0];
823  $cur_class = $cur[1];
824  $cur_parameters = $this->extractParametersOfTag(
825  $cur_tag,
826  $cur_class,
827  $style,
828  $_GET["style_type"],
829  (int) $_GET["mq_id"],
830  false
831  );
832  $parameters = ilObjStyleSheet::_getStyleParameters();
833  foreach ($parameters as $p => $v) {
834  $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
835  if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]])) {
836  continue;
837  }
838  $p = explode(".", $p);
839  $p = $p[0];
840  $input = $this->form_gui->getItemByPostVar($p);
841  switch ($v["input"]) {
842  case "":
843  break;
844 
845  case "trbl_numeric":
846  case "border_width":
847  case "border_style":
848  case "trbl_color":
849  $input->setAllValue($cur_parameters[$v["subpar"][0]]);
850  $input->setTopValue($cur_parameters[$v["subpar"][1]]);
851  $input->setRightValue($cur_parameters[$v["subpar"][2]]);
852  $input->setBottomValue($cur_parameters[$v["subpar"][3]]);
853  $input->setLeftValue($cur_parameters[$v["subpar"][4]]);
854  break;
855 
856  default:
857  $input->setValue($cur_parameters[$p]);
858  break;
859  }
860  }
861 
862  $cust_parameters = $this->extractParametersOfTag(
863  $cur_tag,
864  $cur_class,
865  $style,
866  $_GET["style_type"],
867  (int) $_GET["mq_id"],
868  true
869  );
870  $vals = array();
871  foreach ($cust_parameters as $k => $c) {
872  $vals[] = $k . ": " . $c;
873  }
874  $input = $this->form_gui->getItemByPostVar("custom_par");
875  $input->setValue($vals);
876  }
$style
Definition: example_012.php:70
$_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 1072 of file class.ilObjStyleSheetGUI.php.

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

1073  {
1074  // check file
1075  $source = $_FILES["importfile"]["tmp_name"];
1076  if (($source == 'none') || (!$source)) {
1077  $this->ilias->raiseError("No file selected!", $this->ilias->error_obj->MESSAGE);
1078  }
1079 
1080  // check correct file type
1081  $info = pathinfo($_FILES["importfile"]["name"]);
1082  if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml") {
1083  $this->ilias->raiseError("File must be a zip or xml file!", $this->ilias->error_obj->MESSAGE);
1084  }
1085 
1086  // new import
1087  $fname = explode("_", $_FILES["importfile"]["name"]);
1088  if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty") {
1089  include_once("./Services/Export/classes/class.ilImport.php");
1090  $imp = new ilImport();
1091  $new_id = $imp->importObject(
1092  null,
1093  $_FILES["importfile"]["tmp_name"],
1094  $_FILES["importfile"]["name"],
1095  "sty"
1096  );
1097  if ($new_id > 0) {
1098  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
1099  }
1100  } else { // old import
1101  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1102  $newObj = new ilObjStyleSheet();
1103  $newObj->import($_FILES["importfile"]);
1104  }
1105 
1106  // assign style to style sheet folder,
1107  // if parent is style sheet folder
1108  if ($_GET["ref_id"] > 0) {
1109  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1110  if ($fold->getType() == "stys") {
1111  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1112  $cont_style_settings = new ilContentStyleSettings();
1113  $cont_style_settings->addStyle($newObj->getId());
1114  $cont_style_settings->update();
1115  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1116  $this->ctrl->returnToParent($this);
1117  }
1118  }
1119  return $newObj->getId();
1120  }
$_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: linkback.php:22
$info
Definition: index.php:5
+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

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

References ilObjStyleSheet\getContentStylePath().

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

190  {
191  // set style sheet
192  $this->tpl->setCurrentBlock("ContentStyle");
193  $this->tpl->setVariable(
194  "LOCATION_CONTENT_STYLESHEET",
195  ilObjStyleSheet::getContentStylePath($this->object->getId())
196  );
197  $this->tpl->parseCurrentBlock();
198  }
static getContentStylePath($a_style_id, $add_random=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 (IL_FORM_EDIT | IL_FORM_CREATE)

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

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

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

1654  {
1655  $lng = $this->lng;
1656  $ilCtrl = $this->ctrl;
1657 
1658  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1659  $this->form_gui = new ilPropertyFormGUI();
1660 
1661  // title
1662  $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1663  $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1664  $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include") . " A-Z, a-z, 0-9");
1665  $txt_input->setRequired(true);
1666  $this->form_gui->addItem($txt_input);
1667 
1668  // type
1669  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1670  $types = $all_super_types[$this->super_type];
1671  $exp_types = array();
1672  foreach ($types as $t) {
1674  $exp_types[$t] = $lng->txt("sty_type_" . $t);
1675  }
1676  }
1677  if (count($exp_types) > 1) {
1678  $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1679  $type_input->setOptions($exp_types);
1680  $type_input->setValue(key($exp_types));
1681  $this->form_gui->addItem($type_input);
1682  } elseif (count($exp_types) == 1) {
1683  $hid_input = new ilHiddenInputGUI("type");
1684  $hid_input->setValue(key($exp_types));
1685  $this->form_gui->addItem($hid_input);
1686  }
1687 
1688  $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1689  $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1690  $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1691  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1692  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
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.
setOptions($a_options)
Set Options.
+ 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 1885 of file class.ilObjStyleSheetGUI.php.

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

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

1886  {
1887  $lng = $this->lng;
1888  $ilCtrl = $this->ctrl;
1889 
1890  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1891  $this->form_gui = new ilPropertyFormGUI();
1892 
1893  $this->form_gui->setTitle($lng->txt("sty_add_color"));
1894 
1895  // name
1896  $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1897  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1898  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
1899  $name_input->setRequired(true);
1900  $name_input->setSize(15);
1901  $name_input->setMaxLength(15);
1902  $this->form_gui->addItem($name_input);
1903 
1904  // code
1905  $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1906  $color_input->setRequired(true);
1907  $color_input->setDefaultColor("");
1908  $this->form_gui->addItem($color_input);
1909 
1910  if ($a_mode == "create") {
1911  $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1912  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1913  } else {
1914  $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1915  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1916  }
1917  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1918  }
This class represents a property form user interface.
Color picker form for selecting color hexcodes using yui library.
global $ilCtrl
Definition: ilias.php:18
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 1453 of file class.ilObjStyleSheetGUI.php.

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

Referenced by addImageObject(), and uploadImageObject().

1454  {
1455  $lng = $this->lng;
1456  $ilCtrl = $this->ctrl;
1457 
1458  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1459  $this->form_gui = new ilPropertyFormGUI();
1460 
1461  $this->form_gui->setTitle($lng->txt("sty_add_image"));
1462 
1463  $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1464  $file_input->setRequired(true);
1465  $this->form_gui->addItem($file_input);
1466 
1467  $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1468  $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1469  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1470  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents an image file 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:

◆ initMediaQueryForm()

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

Init media query form.

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

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

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

2113  {
2114  $lng = $this->lng;
2115  $ilCtrl = $this->ctrl;
2116 
2117  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2118  $this->form_gui = new ilPropertyFormGUI();
2119 
2120  $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2121 
2122  // media query
2123  $ti = new ilTextInputGUI("@media", "mquery");
2124  $ti->setMaxLength(2000);
2125  $ti->setInfo($lng->txt("sty_add_media_query_info"));
2126  $this->form_gui->addItem($ti);
2127 
2128 
2129  if ($a_mode == "create") {
2130  $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2131  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2132  } else {
2133  $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2134  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2135  }
2136  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2137  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
+ 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 343 of file class.ilObjStyleSheetGUI.php.

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

Referenced by propertiesObject(), and updateObject().

344  {
345  $lng = $this->lng;
347 
348  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
349  $this->form = new ilPropertyFormGUI();
350 
351  // title
352  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
353  $ti->setMaxLength(128);
354  $ti->setSize(40);
355  $ti->setRequired(true);
356  $this->form->addItem($ti);
357 
358  // description
359  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
360  //$ta->setCols();
361  //$ta->setRows();
362  $this->form->addItem($ta);
363 
364  // disable automatic margins for left/right alignment
365  $cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
366  $cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
367  $this->form->addItem($cb);
368 
369  // save and cancel commands
370 
371  if ($a_mode == "create") {
372  $this->form->addCommandButton("save", $lng->txt("save"));
373  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
374  } else {
375  if ($this->checkWrite()) {
376  $this->form->addCommandButton("update", $lng->txt("save"));
377  }
378  }
379 
380  $this->form->setTitle($lng->txt("edit_stylesheet"));
381  $this->form->setFormAction($this->ctrl->getFormAction($this));
382  }
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 property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
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 (IL_FORM_EDIT | IL_FORM_CREATE)

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

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

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

661  {
662  $lng = $this->lng;
664 
665  $ilCtrl->saveParameter($this, array("mq_id"));
666 
667  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
668  $this->form_gui = new ilPropertyFormGUI();
669 
670  $avail_pars = $this->object->getAvailableParameters();
671  $groups = $this->object->getStyleParameterGroups();
672 
673  // output select lists
674  foreach ($groups as $k => $group) {
675  // filter groups of properties that should only be
676  // displayed with matching tag
677  $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
678  if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k])) {
679  continue;
680  }
681 
682  $sh = new ilFormSectionHeaderGUI();
683  $sh->setTitle($lng->txt("sty_" . $k));
684  $this->form_gui->addItem($sh);
685 
686  foreach ($group as $par) {
687  $basepar = explode(".", $par);
688  $basepar = $basepar[0];
689 
690  $var = str_replace("-", "_", $basepar);
691  $up_par = strtoupper($var);
692 
694  case "select":
695  $sel_input = new ilSelectInputGUI($lng->txt("sty_" . $var), $basepar);
696  $options = array("" => "");
697  foreach ($avail_pars[$par] as $p) {
698  $options[$p] = $p;
699  }
700  $sel_input->setOptions($options);
701  $this->form_gui->addItem($sel_input);
702  break;
703 
704  case "text":
705  $text_input = new ilTextInputGUI($lng->txt("sty_" . $var), $basepar);
706  $text_input->setMaxLength(200);
707  $text_input->setSize(20);
708  $this->form_gui->addItem($text_input);
709  break;
710 
711  case "fontsize":
712  include_once("./Services/Style/Content/classes/class.ilFontSizeInputGUI.php");
713  $fs_input = new ilFontSizeInputGUI($lng->txt("sty_" . $var), $basepar);
714  $this->form_gui->addItem($fs_input);
715  break;
716 
717  case "numeric_no_perc":
718  case "numeric":
719  include_once("./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
720  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
721  if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc") {
722  $num_input->setAllowPercentage(false);
723  }
724  $this->form_gui->addItem($num_input);
725  break;
726 
727  case "percentage":
728  $per_input = new ilNumberInputGUI($lng->txt("sty_" . $var), $basepar);
729  $per_input->setMinValue(0);
730  $per_input->setMaxValue(100);
731  $per_input->setMaxLength(3);
732  $per_input->setSize(3);
733  $this->form_gui->addItem($per_input);
734  break;
735 
736  case "color":
737  //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
738  $col_input = new ilColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
739  $col_input->setDefaultColor("");
740  $col_input->setAcceptNamedColors(true);
741  $this->form_gui->addItem($col_input);
742  break;
743 
744  case "trbl_numeric":
745  include_once("./Services/Style/Content/classes/class.ilTRBLNumericStyleValueInputGUI.php");
746  $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
747  if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc") {
748  $num_input->setAllowPercentage(false);
749  }
750  $this->form_gui->addItem($num_input);
751  break;
752 
753  case "border_width":
754  include_once("./Services/Style/Content/classes/class.ilTRBLBorderWidthInputGUI.php");
755  $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_" . $var), $basepar);
756  $this->form_gui->addItem($bw_input);
757  break;
758 
759  case "border_style":
760  include_once("./Services/Style/Content/classes/class.ilTRBLBorderStyleInputGUI.php");
761  $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_" . $var), $basepar);
762  $this->form_gui->addItem($bw_input);
763  break;
764 
765  case "trbl_color":
766  include_once("./Services/Style/Content/classes/class.ilTRBLColorPickerInputGUI.php");
767  $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
768  $col_input->setAcceptNamedColors(true);
769  $this->form_gui->addItem($col_input);
770  break;
771 
772  case "background_image":
773  include_once("./Services/Style/Content/classes/class.ilBackgroundImageInputGUI.php");
774  $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_" . $var), $basepar);
775  $imgs = array();
776  foreach ($this->object->getImages() as $entry) {
777  $imgs[] = $entry["entry"];
778  }
779  $im_input->setImages($imgs);
780  $this->form_gui->addItem($im_input);
781  break;
782 
783  case "background_position":
784  include_once("./Services/Style/Content/classes/class.ilBackgroundPositionInputGUI.php");
785  $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_" . $var), $basepar);
786  $this->form_gui->addItem($im_input);
787  break;
788  }
789  }
790  }
791 
792  // custom parameters
793  $sh = new ilFormSectionHeaderGUI();
794  $sh->setTitle($lng->txt("sty_custom"));
795  $this->form_gui->addItem($sh);
796 
797  // custom parameters
798  $ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
799  $ti->setMaxLength(300);
800  $ti->setSize(80);
801  $ti->setMulti(true);
802  $ti->setInfo($this->lng->txt("sty_custom_par_info"));
803  $this->form_gui->addItem($ti);
804 
805 
806  // save and cancel commands
807  $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
808  $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
809 
810  // $this->form_gui->setTitle($lng->txt("edit"));
811  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
812  }
This class represents a selection list property in a property form.
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.
global $ilCtrl
Definition: ilias.php:18
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...
This class represents a text property in a property form.
setDefaultColor($a_defaultcolor)
Set Default Color.
setMaxLength($a_maxlength)
Set Max Length.
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 2459 of file class.ilObjStyleSheetGUI.php.

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

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

2460  {
2461  $lng = $this->lng;
2462  $ilCtrl = $this->ctrl;
2463 
2464  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2465  $this->form_gui = new ilPropertyFormGUI();
2466 
2467  if ($a_mode == "create") {
2468  $this->form_gui->setTitle($lng->txt("sty_add_template"));
2469  } else {
2470  $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2471  }
2472 
2473  // name
2474  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2475  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2476  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
2477  $name_input->setRequired(true);
2478  $name_input->setSize(30);
2479  $name_input->setMaxLength(30);
2480  $this->form_gui->addItem($name_input);
2481 
2482  // template style classes
2483  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2484  foreach ($scs as $sc => $st) {
2485  $sc_input = new ilSelectInputGUI($lng->txt("sty_" . $sc . "_class"), $sc . "_class");
2486  $chars = $this->object->getCharacteristics($st);
2487  $options = array("" => "");
2488  foreach ($chars as $char) {
2489  $options[$char] = $char;
2490  }
2491  $sc_input->setOptions($options);
2492  $this->form_gui->addItem($sc_input);
2493  }
2494 
2495  if ($a_mode == "create") {
2496  $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2497  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2498  } else {
2499  $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2500  $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2501  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2502  }
2503  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2504  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 2741 of file class.ilObjStyleSheetGUI.php.

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

Referenced by generateTemplateObject(), and templateGenerationObject().

2742  {
2743  $lng = $this->lng;
2744  $ilCtrl = $this->ctrl;
2745 
2746  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2747  $this->form_gui = new ilPropertyFormGUI();
2748 
2749  $this->form_gui->setTitle($lng->txt("sty_generate_template"));
2750 
2751  // name
2752  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2753  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2754  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
2755  $name_input->setRequired(true);
2756  $name_input->setSize(30);
2757  $name_input->setMaxLength(30);
2758  $this->form_gui->addItem($name_input);
2759 
2760  // basic layout
2761  $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
2762  $options = array(
2763  "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
2764  "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
2765  "noZebra" => $lng->txt("sty_table_template_no_zebra")
2766  );
2767  $bl_input->setOptions($options);
2768  $this->form_gui->addItem($bl_input);
2769 
2770  // top bottom padding
2771  include_once("./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
2772  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
2773  $num_input->setAllowPercentage(false);
2774  $num_input->setValue("3px");
2775  $this->form_gui->addItem($num_input);
2776 
2777  // left right padding
2778  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
2779  $num_input->setAllowPercentage(false);
2780  $num_input->setValue("10px");
2781  $this->form_gui->addItem($num_input);
2782 
2783  // base color
2784  $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
2785  $cs = $this->object->getColors();
2786  $options = array();
2787  foreach ($cs as $c) {
2788  $options[$c["name"]] = $c["name"];
2789  }
2790  $bc_input->setOptions($options);
2791  $this->form_gui->addItem($bc_input);
2792 
2793  // Lightness Settings
2794  $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
2795  "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
2796  foreach ($lss as $ls => $v) {
2797  $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_" . $ls), "lightness_" . $ls);
2798  $l_input->setMaxValue(100);
2799  $l_input->setMinValue(-100);
2800  $l_input->setValue($v);
2801  $l_input->setSize(4);
2802  $l_input->setMaxLength(4);
2803  $this->form_gui->addItem($l_input);
2804  }
2805 
2806  $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
2807  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2808  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2809  }
This class represents a selection list property in a property form.
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.
global $ilCtrl
Definition: ilias.php:18
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 1833 of file class.ilObjStyleSheetGUI.php.

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

1834  {
1835  $tpl = $this->tpl;
1837  $ilToolbar = $this->toolbar;
1838  $ilCtrl = $this->ctrl;
1839 
1840  if ($this->checkWrite()) {
1841  $ilToolbar->addButton(
1842  $this->lng->txt("sty_add_color"),
1843  $ilCtrl->getLinkTarget($this, "addColor")
1844  );
1845  }
1846 
1847  include_once("./Services/Style/Content/classes/class.ilStyleColorTableGUI.php");
1848  $table_gui = new ilStyleColorTableGUI(
1849  $this,
1850  "listColors",
1851  $this->object
1852  );
1853  $tpl->setContent($table_gui->getHTML());
1854  }
global $ilCtrl
Definition: ilias.php:18
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 1386 of file class.ilObjStyleSheetGUI.php.

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

1387  {
1388  $tpl = $this->tpl;
1389  $ilToolbar = $this->toolbar;
1390  $ilCtrl = $this->ctrl;
1391  $lng = $this->lng;
1393 
1394  if ($this->checkWrite()) {
1395  $ilToolbar->addButton(
1396  $lng->txt("sty_add_image"),
1397  $ilCtrl->getLinkTarget($this, "addImage")
1398  );
1399  }
1400 
1401  include_once("./Services/Style/Content/classes/class.ilStyleImageTableGUI.php");
1402  $table_gui = new ilStyleImageTableGUI(
1403  $this,
1404  "listImages",
1405  $this->object
1406  );
1407  $tpl->setContent($table_gui->getHTML());
1408  }
global $ilCtrl
Definition: ilias.php:18
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 2060 of file class.ilObjStyleSheetGUI.php.

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

2061  {
2062  $tpl = $this->tpl;
2064  $ilToolbar = $this->toolbar;
2065  $ilCtrl = $this->ctrl;
2066 
2067  if ($this->checkWrite()) {
2068  $ilToolbar->addButton(
2069  $this->lng->txt("sty_add_media_query"),
2070  $ilCtrl->getLinkTarget($this, "addMediaQuery")
2071  );
2072  }
2073 
2074  include_once("./Services/Style/Content/classes/class.ilStyleMediaQueryTableGUI.php");
2075  $table_gui = new ilStyleMediaQueryTableGUI(
2076  $this,
2077  "listMediaQueries",
2078  $this->object
2079  );
2080  $tpl->setContent($table_gui->getHTML());
2081  }
TableGUI class for style editor (image list)
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

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

2266  {
2267  $tpl = $this->tpl;
2268  $ilTabs = $this->tabs;
2269  $ilCtrl = $this->ctrl;
2270  $ilToolbar = $this->toolbar;
2271 
2272  $ctype = $_GET["temp_type"];
2273  if ($ctype == "") {
2274  $ctype = "table";
2275  $ilCtrl->setParameter($this, "temp_type", $ctype);
2276  $_GET["temp_type"] = $ctype;
2277  }
2278 
2279  $this->setTemplatesSubTabs();
2280  $ilTabs->setSubTabActive("sty_" . $ctype . "_templates");
2281 
2282  // action commands
2283  if ($this->checkWrite()) {
2284  if ($ctype == "table") {
2285  $ilToolbar->addButton(
2286  $this->lng->txt("sty_generate_template"),
2287  $ilCtrl->getLinkTarget($this, "generateTemplate")
2288  );
2289  }
2290  $ilToolbar->addButton(
2291  $this->lng->txt("sty_add_template"),
2292  $ilCtrl->getLinkTarget($this, "addTemplate")
2293  );
2294  }
2295 
2296 
2297 
2298  $this->includeCSS();
2299  include_once("./Services/Style/Content/classes/class.ilTableTemplatesTableGUI.php");
2300  $table_gui = new ilTableTemplatesTableGUI(
2301  $ctype,
2302  $this,
2303  "listTemplates",
2304  $this->object
2305  );
2306  $tpl->setContent($table_gui->getHTML());
2307  }
$_GET["client_id"]
setTemplatesSubTabs()
adds tabs to tab gui object
global $ilCtrl
Definition: ilias.php:18
includeCSS()
Include CSS in output.
+ Here is the call graph for this function:

◆ newStyleParameterObject()

ilObjStyleSheetGUI::newStyleParameterObject ( )

add style parameter

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

References $_POST, and editObject().

909  {
910  $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
911  $this->editObject();
912  }
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 620 of file class.ilObjStyleSheetGUI.php.

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

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

621  {
622  $tpl = $this->tpl;
624  $lng = $this->lng;
625 
626  // set style sheet
627  $tpl->setCurrentBlock("ContentStyle");
628  $tpl->setVariable(
629  "LOCATION_CONTENT_STYLESHEET",
630  ilObjStyleSheet::getContentStylePath($this->object->getId())
631  );
632 
633  $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style/Content");
634 
635  $cur = explode(".", $_GET["tag"]);
636  $cur_tag = $cur[0];
637  $cur_class = $cur[1];
638 
639  $ts_tpl->setVariable(
640  "EXAMPLE",
641  ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class)
642  );
643 
644  $ts_tpl->setVariable(
645  "FORM",
646  $this->form_gui->getHtml()
647  );
648 
649  $tpl->setTitle($cur_class . " (" . $lng->txt("sty_type_" . $_GET["style_type"]) . ")");
650 
651  $tpl->setContent($ts_tpl->get());
652  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
static getContentStylePath($a_style_id, $add_random=true)
get content style path
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 1799 of file class.ilObjStyleSheetGUI.php.

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

1800  {
1801  $ilCtrl = $this->ctrl;
1802  $lng = $this->lng;
1803 
1804  if (is_array($_POST["title"])) {
1805  foreach ($_POST["title"] as $from_char => $to_title) {
1806  $fc = explode(".", $from_char);
1807 
1808  if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1809  !$this->object->characteristicExists($to_title, $fc[0])) {
1810  $this->object->copyCharacteristic(
1811  $_POST["from_style_id"],
1812  $fc[0],
1813  $fc[2],
1814  $to_title
1815  );
1816  }
1817  }
1818  ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1819  unset($_SESSION["sty_copy"]);
1820  ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1821  }
1822 
1823  $ilCtrl->redirect($this, "edit");
1824  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$_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 1780 of file class.ilObjStyleSheetGUI.php.

References $table, $tabs, and ilObjectGUI\$tpl.

1781  {
1782  $tpl = $this->tpl;
1783  $ilTabs = $this->tabs;
1784 
1785  $ilTabs->clearTargets();
1786 
1787  include_once("./Services/Style/Content/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1788  $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1789 
1790  $tpl->setContent($table->getHTML());
1791  }
if(empty($password)) $table
Definition: pwgen.php:24

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

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

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

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

References $_POST, $id, and editObject().

918  {
919  $this->object->setTitle($_POST["style_title"]);
920  $this->object->setDescription($_POST["style_description"]);
921 
922  foreach ($_POST["styval"] as $id => $value) {
923  $this->object->updateStyleParameter($id, $value);
924  }
925  $this->object->update();
926  $this->editObject();
927  }
if(!array_key_exists('StateId', $_REQUEST)) $id
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 413 of file class.ilObjStyleSheetGUI.php.

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

414  {
416 
417  $cur = explode(".", $_GET["tag"]);
418  $cur_tag = $cur[0];
419  $cur_class = $cur[1];
420 
421  $this->initTagStyleForm("edit", $cur_tag);
422 
423  if ($this->form_gui->checkInput()) {
424  $this->saveTagStyle();
425  $ilCtrl->redirect($this, "editTagStyle");
426  } else {
427  $this->form_gui->setValuesByPost();
428  $this->outputTagStyleEditScreen();
429  }
430  }
saveTagStyle()
Save tag style.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
global $ilCtrl
Definition: ilias.php:18
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 2613 of file class.ilObjStyleSheetGUI.php.

References updateTemplateObject().

2614  {
2615  $this->updateTemplateObject(true);
2616  }
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 3067 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

3068  {
3069  $ilCtrl = $this->ctrl;
3070 
3071  /*if ($_GET["baseClass"] == "ilAdministrationGUI")
3072  {
3073  $ilCtrl->redirectByClass("ilcontentstylesettingsgui", "edit");
3074  }*/
3075  $ilCtrl->returnToParent($this);
3076  }
global $ilCtrl
Definition: ilias.php:18

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

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

1621  {
1622  $ilCtrl = $this->ctrl;
1623  $tpl = $this->tpl;
1624  $lng = $this->lng;
1625 
1626  $this->initCharacteristicForm("create");
1627 
1628  if ($this->form_gui->checkInput()) {
1629  if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"])) {
1630  $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1631  $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1632  } else {
1633  $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1634  ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1635  $ilCtrl->setParameter(
1636  $this,
1637  "tag",
1638  ilObjStyleSheet::_determineTag($_POST["type"]) . "." . $_POST["new_characteristic"]
1639  );
1640  $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1641  $ilCtrl->redirect($this, "editTagStyle");
1642  }
1643  }
1644  $this->form_gui->setValuesByPost();
1645  $tpl->setContent($this->form_gui->getHTML());
1646  }
static _determineTag($a_type)
$_GET["client_id"]
initCharacteristicForm($a_mode)
Init tag style editing form.
global $ilCtrl
Definition: ilias.php:18
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 1945 of file class.ilObjStyleSheetGUI.php.

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

1946  {
1947  $tpl = $this->tpl;
1948  $ilCtrl = $this->ctrl;
1949  $lng = $this->lng;
1950 
1951  $this->initColorForm();
1952 
1953  if ($this->form_gui->checkInput()) {
1954  if ($this->object->colorExists($_POST["color_name"])) {
1955  $col_input = $this->form_gui->getItemByPostVar("color_name");
1956  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1957  } else {
1958  $this->object->addColor(
1959  $_POST["color_name"],
1960  $_POST["color_code"]
1961  );
1962  $ilCtrl->redirect($this, "listColors");
1963  }
1964  }
1965  $this->form_gui->setValuesByPost();
1966  $tpl->setContent($this->form_gui->getHTML());
1967  }
global $ilCtrl
Definition: ilias.php:18
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 1732 of file class.ilObjStyleSheetGUI.php.

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

1733  {
1734  $ilCtrl = $this->ctrl;
1735  $lng = $this->lng;
1736 
1737  //var_dump($_POST);
1738 
1739  foreach ($_POST["all_chars"] as $char) {
1740  $ca = explode(".", $char);
1741  $this->object->saveHideStatus(
1742  $ca[0],
1743  $ca[2],
1744  (is_array($_POST["hide"]) && in_array($char, $_POST["hide"]))
1745  );
1746  }
1747 
1748  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1749  $ilCtrl->redirect($this, "edit");
1750  }
global $ilCtrl
Definition: ilias.php:18
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 2157 of file class.ilObjStyleSheetGUI.php.

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

2158  {
2159  $tpl = $this->tpl;
2160  $ilCtrl = $this->ctrl;
2161  $lng = $this->lng;
2162 
2163  $this->initMediaQueryForm();
2164 
2165  if ($this->form_gui->checkInput()) {
2166  $this->object->addMediaQuery($_POST["mquery"]);
2167  $ilCtrl->redirect($this, "listMediaQueries");
2168  }
2169  $this->form_gui->setValuesByPost();
2170  $tpl->setContent($this->form_gui->getHTML());
2171  }
initMediaQueryForm($a_mode="create")
Init media query form.
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ saveMediaQueryOrderObject()

ilObjStyleSheetGUI::saveMediaQueryOrderObject ( )

Save media query order.

Parameters

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

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

2248  {
2249  $ilCtrl = $this->ctrl;
2250 
2251  if (is_array($_POST["order"])) {
2252  $this->object->saveMediaQueryOrder($_POST["order"]);
2253  }
2254  $ilCtrl->redirect($this, "listMediaQueries");
2255  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

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

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

992  {
993  if (!trim($_POST["style_title"])) {
994  $this->ctrl->redirect($this, "create");
995  }
996 
997  // copy from default style or ... see #11330
998  $default_style = $this->settings->get("default_content_style_id");
999  if (ilObject::_lookupType($default_style) == "sty") {
1000  $style_obj = ilObjectFactory::getInstanceByObjId($default_style);
1001  $new_id = $style_obj->ilClone();
1002  $newObj = new ilObjStyleSheet($new_id);
1003  } else {
1004  // ... import from basic zip file
1005  $imp = new ilImport();
1006  $style_id = $imp->importObject(
1007  null,
1009  "style.zip",
1010  "sty",
1011  $a_comp = "Services/Style",
1012  true
1013  );
1014 
1015  $newObj = new ilObjStyleSheet($style_id);
1016  }
1017 
1018  $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
1019  $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
1020  $newObj->update();
1021 
1023 
1024  // assign style to style sheet folder,
1025  // if parent is style sheet folder
1026  if ($_GET["ref_id"] > 0) {
1027  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1028  if ($fold->getType() == "stys") {
1029  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1030  $cont_style_settings = new ilContentStyleSettings();
1031  $cont_style_settings->addStyle($newObj->getId());
1032  $cont_style_settings->update();
1033 
1034  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1035  $this->ctrl->returnToParent($this);
1036  }
1037  }
1038 
1039  return $newObj->getId();
1040  }
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 456 of file class.ilObjStyleSheetGUI.php.

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

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

457  {
458  $cur = explode(".", $_GET["tag"]);
459  $cur_tag = $cur[0];
460  $cur_class = $cur[1];
461  $avail_pars = ilObjStyleSheet::_getStyleParameters($cur_tag);
462  foreach ($avail_pars as $par => $v) {
463  $var = str_replace("-", "_", $par);
464  $basepar_arr = explode(".", $par);
465  $basepar = $basepar_arr[0];
466  if ($basepar_arr[1] != "" && $basepar_arr[1] != $cur_tag) {
467  continue;
468  }
469 
470  switch ($v["input"]) {
471  case "fontsize":
472  case "numeric_no_perc":
473  case "numeric":
474  case "background_image":
475  $in = $this->form_gui->getItemByPostVar($basepar);
476 //echo "<br>-".$cur_tag."-".$cur_class."-".$basepar."-".$_GET["style_type"]."-";
477  $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
478  break;
479 
480  case "color":
481  $color = trim($_POST[$basepar]);
482  if ($color != "" && trim(substr($color, 0, 1) != "!")) {
483  $color = "#" . $color;
484  }
485  $this->writeStylePar($cur_tag, $cur_class, $basepar, $color, $_GET["style_type"], (int) $_GET["mq_id"]);
486  break;
487 
488  case "trbl_numeric":
489  case "border_width":
490  case "border_style":
491  $in = $this->form_gui->getItemByPostVar($basepar);
492  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0], $in->getAllValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
493  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1], $in->getTopValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
494  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2], $in->getRightValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
495  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3], $in->getBottomValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
496  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4], $in->getLeftValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
497  break;
498 
499  case "trbl_color":
500  $in = $this->form_gui->getItemByPostVar($basepar);
501  $tblr_p = array(0 => "getAllValue", 1 => "getTopValue", 2 => "getRightValue",
502  3 => "getBottomValue", 4 => "getLeftValue");
503  foreach ($tblr_p as $k => $func) {
504  $val = trim($in->$func());
505  $val = (($in->getAcceptNamedColors() && substr($val, 0, 1) == "!")
506  || $val == "")
507  ? $val
508  : "#" . $val;
509  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][$k], $val, $_GET["style_type"], (int) $_GET["mq_id"]);
510  }
511  break;
512 
513  case "background_position":
514  $in = $this->form_gui->getItemByPostVar($basepar);
515  $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
516  break;
517 
518  default:
519  $this->writeStylePar($cur_tag, $cur_class, $basepar, $_POST[$basepar], $_GET["style_type"], (int) $_GET["mq_id"]);
520  break;
521  }
522  }
523 
524  // write custom parameter
525  $this->object->deleteCustomStylePars($cur_tag, $cur_class, $_GET["style_type"], (int) $_GET["mq_id"]);
526  if (is_array($_POST["custom_par"])) {
527  foreach ($_POST["custom_par"] as $cpar) {
528  $par_arr = explode(":", $cpar);
529  if (count($par_arr) == 2) {
530  $par = trim($par_arr[0]);
531  $val = trim(str_replace(";", "", $par_arr[1]));
532  $this->writeStylePar($cur_tag, $cur_class, $par, $val, $_GET["style_type"], (int) $_GET["mq_id"], true);
533  }
534  }
535  }
536 
537  $this->object->update();
538  }
$_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 2520 of file class.ilObjStyleSheetGUI.php.

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

2521  {
2522  $tpl = $this->tpl;
2523  $ilCtrl = $this->ctrl;
2524  $lng = $this->lng;
2525 
2526  $this->initTemplateForm();
2527 
2528  if ($this->form_gui->checkInput()) {
2529  if ($this->object->templateExists($_POST["name"])) {
2530  $name_input = $this->form_gui->getItemByPostVar("name");
2531  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2532  } else {
2533  $classes = array();
2534  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2535  $classes[$tct] = $_POST[$tct . "_class"];
2536  }
2537  $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2538  $this->object->writeTemplatePreview(
2539  $t_id,
2540  $this->getTemplatePreview($_GET["temp_type"], $t_id, true)
2541  );
2542  $ilCtrl->redirect($this, "listTemplates");
2543  }
2544  }
2545  $this->form_gui->setValuesByPost();
2546  $tpl->setContent($this->form_gui->getHTML());
2547  }
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"]
global $ilCtrl
Definition: ilias.php:18
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 1288 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editObject().

1289  {
1290  $lng = $this->lng;
1291  $ilTabs = $this->tabs;
1292  $ilCtrl = $this->ctrl;
1293 
1295 
1296  foreach ($types as $super_type => $types) {
1297  // text block characteristics
1298  $ilCtrl->setParameter($this, "style_type", $super_type);
1299  $ilTabs->addSubTabTarget(
1300  "sty_" . $super_type . "_char",
1301  $this->ctrl->getLinkTarget($this, "edit"),
1302  array("edit", ""),
1303  get_class($this)
1304  );
1305  }
1306 
1307  $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1308  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjStyleSheetGUI::setTabs ( )

output tabs

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

References ilObjectGUI\$lng, and getTabs().

1156  {
1157  $lng = $this->lng;
1158 
1159  $this->getTabs($this->tabs_gui);
1160 
1161  if (strtolower(get_class($this->object)) == "ilobjstylesheet") {
1162  $this->tpl->setVariable("HEADER", $this->object->getTitle());
1163  } else {
1164  $this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
1165  }
1166  }
getTabs()
adds tabs to tab gui object
+ Here is the call graph for this function:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

Referenced by listTemplatesObject().

1316  {
1317  $lng = $this->lng;
1318  $ilTabs = $this->tabs;
1319  $ilCtrl = $this->ctrl;
1320 
1322 
1323  foreach ($types as $t => $c) {
1324  $ilCtrl->setParameter($this, "temp_type", $t);
1325  $ilTabs->addSubTabTarget(
1326  "sty_" . $t . "_templates",
1327  $this->ctrl->getLinkTarget($this, "listTemplates"),
1328  array("listTemplates", ""),
1329  get_class($this)
1330  );
1331  }
1332 
1333  $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1334  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUpperIcon()

ilObjStyleSheetGUI::showUpperIcon ( )

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

References $_GET, $obj_definition, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, and ilObjectGUI\$tree.

1366  {
1367  $tree = $this->tree;
1368  $tpl = $this->tpl;
1370 
1371  if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
1372  $tpl->setUpperIcon(
1373  $this->ctrl->getLinkTargetByClass(
1374  "ilcontentstylesettings",
1375  "edit"
1376  )
1377  );
1378  } else {
1379  // ?
1380  }
1381  }
$_GET["client_id"]

◆ switchMQueryObject()

ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters

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

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

609  {
611 
612  $ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
613  $ilCtrl->redirect($this, "editTagStyle");
614  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

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

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

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

1973  {
1974  $tpl = $this->tpl;
1975  $ilCtrl = $this->ctrl;
1976  $lng = $this->lng;
1977 
1978  $this->initColorForm("edit");
1979 
1980  if ($this->form_gui->checkInput()) {
1981  if ($this->object->colorExists($_POST["color_name"]) &&
1982  $_POST["color_name"] != $_GET["c_name"]) {
1983  $col_input = $this->form_gui->getItemByPostVar("color_name");
1984  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1985  } else {
1986  $this->object->updateColor(
1987  $_GET["c_name"],
1988  $_POST["color_name"],
1989  $_POST["color_code"]
1990  );
1991  $ilCtrl->redirect($this, "listColors");
1992  }
1993  }
1994  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1995  $this->form_gui->setValuesByPost();
1996  $tpl->setContent($this->form_gui->getHTML());
1997  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 2176 of file class.ilObjStyleSheetGUI.php.

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

2177  {
2178  $tpl = $this->tpl;
2179  $ilCtrl = $this->ctrl;
2180  $lng = $this->lng;
2181 
2182  $this->initMediaQueryForm("edit");
2183 
2184  if ($this->form_gui->checkInput()) {
2185  $this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
2186  $ilCtrl->redirect($this, "listMediaQueries");
2187  }
2188  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2189  $this->form_gui->setValuesByPost();
2190  $tpl->setContent($this->form_gui->getHTML());
2191  }
$_GET["client_id"]
initMediaQueryForm($a_mode="create")
Init media query form.
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

Update properties.

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

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

388  {
389  $lng = $this->lng;
391  $tpl = $this->tpl;
392 
393  $this->initPropertiesForm("edit");
394  if ($this->form->checkInput()) {
395  $this->object->setTitle($this->form->getInput("style_title"));
396  $this->object->setDescription($this->form->getInput("style_description"));
397  $this->object->writeStyleSetting(
398  "disable_auto_margins",
399  $this->form->getInput("disable_auto_margins")
400  );
401  $this->object->update();
402  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
403  $ilCtrl->redirect($this, "properties");
404  } else {
405  $this->form->setValuesByPost();
406  $tpl->setContent($this->form->getHtml());
407  }
408  }
global $ilCtrl
Definition: ilias.php:18
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 435 of file class.ilObjStyleSheetGUI.php.

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

436  {
438 
439  $cur = explode(".", $_GET["tag"]);
440  $cur_tag = $cur[0];
441  $cur_class = $cur[1];
442 
443  $this->initTagStyleForm("edit", $cur_tag);
444  if ($this->form_gui->checkInput()) {
445  $this->saveTagStyle();
446  $ilCtrl->redirect($this, "edit");
447  } else {
448  $this->form_gui->setValuesByPost();
449  $this->outputTagStyleEditScreen();
450  }
451  }
saveTagStyle()
Save tag style.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
global $ilCtrl
Definition: ilias.php:18
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 2552 of file class.ilObjStyleSheetGUI.php.

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

Referenced by refreshTemplateObject().

2553  {
2554  $tpl = $this->tpl;
2555  $ilCtrl = $this->ctrl;
2556  $lng = $this->lng;
2557 
2558  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2559  $this->initTemplateForm("edit");
2560 
2561  if ($this->form_gui->checkInput()) {
2562  if ($this->object->templateExists($_POST["name"]) &&
2563  $_POST["name"] != ilObjStyleSheet::_lookupTemplateName($_GET["t_id"])) {
2564  $name_input = $this->form_gui->getItemByPostVar("name");
2565  $name_input->setAlert($lng->txt("sty_template_already_exists"));
2566  } else {
2567  $classes = array();
2568  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2569  $classes[$tct] = $_POST[$tct . "_class"];
2570  }
2571 
2572  $this->object->updateTemplate(
2573  $_GET["t_id"],
2574  $_POST["name"],
2575  $classes
2576  );
2577  $this->object->writeTemplatePreview(
2578  $_GET["t_id"],
2579  $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true)
2580  );
2581  if (!$a_refresh) {
2582  $ilCtrl->redirect($this, "listTemplates");
2583  }
2584  }
2585  }
2586 
2587  $this->form_gui->setValuesByPost();
2588  $this->displayTemplateEditForm();
2589  }
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"]
global $ilCtrl
Definition: ilias.php:18
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 1434 of file class.ilObjStyleSheetGUI.php.

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

1435  {
1436  $tpl = $this->tpl;
1437  $ilCtrl = $this->ctrl;
1438 
1439  $this->initImageForm();
1440 
1441  if ($this->form_gui->checkInput()) {
1442  $this->object->uploadImage($_FILES["image_file"]);
1443  $ilCtrl->redirect($this, "listImages");
1444  } else {
1445  //$this->form_gui->setImageFormValuesByPost();
1446  $tpl->setContent($this->form_gui->getHTML());
1447  }
1448  }
global $ilCtrl
Definition: ilias.php:18
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

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

References editObject().

100  {
101  $this->editObject();
102  }
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 540 of file class.ilObjStyleSheetGUI.php.

References $a_type.

Referenced by saveTagStyle().

541  {
542  // echo $_GET["mq_id"]."-";
543  // echo $a_mq_id."-"; exit;
544  if ($a_type == "") {
545  return;
546  }
547 
548  if ($value != "") {
549  $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
550  } else {
551  $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
552  }
553  }
$a_type
Definition: workflow.php:92
+ 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.

◆ $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.

Referenced by showUpperIcon().

◆ $rbacsystem

◆ $tabs

ilObjStyleSheetGUI::$tabs
protected

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