ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

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

Public Member Functions

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

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

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

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

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

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

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

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

◆ accordiontestObject()

ilObjStyleSheetGUI::accordiontestObject ( )

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

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

3022  {
3023  $tpl = $this->tpl;
3024 
3025  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
3026 
3027  $acc = new ilAccordionGUI();
3028  $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
3029  $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
3030  $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
3031 
3032  $ac2 = new ilAccordionGUI();
3033  $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
3034  $ac2->addItem("Header 2", $acc->getHTML());
3035  $ac2->setOrientation(ilAccordionGUI::VERTICAL);
3036 
3037  $tpl->setContent($ac2->getHTML());
3038  }
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 1333 of file class.ilObjStyleSheetGUI.php.

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

1334  {
1335  $ilLocator = $this->locator;
1336 
1337  if ($_GET["admin_mode"] == "settings") { // system settings
1338  parent::addAdminLocatorItems(true);
1339 
1340  $ilLocator->addItem(
1342  ilObject::_lookupObjId($_GET["ref_id"])
1343  ),
1344  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "")
1345  );
1346 
1347  if ($_GET["obj_id"] > 0) {
1348  $ilLocator->addItem(
1349  $this->object->getTitle(),
1350  $this->ctrl->getLinkTarget($this, "edit")
1351  );
1352  }
1353  } else { // repository administration
1354  //?
1355  }
1356  }
$_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 1585 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initCharacteristicForm().

1586  {
1587  $tpl = $this->tpl;
1588 
1589  $this->initCharacteristicForm("create");
1590  $tpl->setContent($this->form_gui->getHTML());
1591  }
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 1835 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initColorForm().

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

◆ addImageObject()

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

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

References ilObjectGUI\$tpl, and initImageForm().

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

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

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

References ilObjectGUI\$tpl, and initMediaQueryForm().

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

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

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

References ilObjectGUI\$tpl, and initTemplateForm().

2289  {
2290  $tpl = $this->tpl;
2291 
2292  $this->initTemplateForm();
2293  $tpl->setContent($this->form_gui->getHTML());
2294  }
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 1136 of file class.ilObjStyleSheetGUI.php.

1137  {
1138  }

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

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

1553  {
1554  $ilCtrl = $this->ctrl;
1555  $lng = $this->lng;
1556 
1557  ilUtil::sendInfo($lng->txt("action_aborted"), true);
1558  $ilCtrl->redirect($this, "edit");
1559  }
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 2006 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2007  {
2008  $ilCtrl = $this->ctrl;
2009 
2010  $ilCtrl->redirect($this, "listColors");
2011  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

1912  {
1913  $ilCtrl = $this->ctrl;
1914 
1915  $ilCtrl->redirect($this, "listColors");
1916  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

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

967  {
968  $this->ctrl->returnToParent($this);
969  }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

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

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

1145  {
1146  $lng = $this->lng;
1147 
1148  ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1149  $this->ctrl->returnToParent($this);
1150  }
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 2658 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2659  {
2660  $ilCtrl = $this->ctrl;
2661 
2662  $ilCtrl->redirect($this, "listTemplates");
2663  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

2486  {
2487  $ilCtrl = $this->ctrl;
2488 
2489  $ilCtrl->redirect($this, "listTemplates");
2490  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

1400  {
1401  $ilCtrl = $this->ctrl;
1402 
1403  $ilCtrl->redirect($this, "listImages");
1404  }
global $ilCtrl
Definition: ilias.php:18

◆ checkWrite()

ilObjStyleSheetGUI::checkWrite ( )

Check write.

Parameters

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

References $_GET, and $rbacsystem.

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

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

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

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

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

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

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

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

1735  {
1736  $ilCtrl = $this->ctrl;
1737  $lng = $this->lng;
1738 
1739  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1740  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1741  } else {
1742  $style_cp = implode("::", $_POST["char"]);
1743  $style_cp = $this->object->getId() . ":::" . $_GET["style_type"] . ":::" . $style_cp;
1744  $_SESSION["sty_copy"] = $style_cp;
1745  ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1746  }
1747  $ilCtrl->redirect($this, "edit");
1748  }
$_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 1053 of file class.ilObjStyleSheetGUI.php.

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

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

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

create

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

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

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

◆ deleteCharacteristicConfirmationObject()

ilObjStyleSheetGUI::deleteCharacteristicConfirmationObject ( )

Characteristic deletion confirmation screen.

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

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

1469  {
1470  $ilCtrl = $this->ctrl;
1471  $tpl = $this->tpl;
1472  $lng = $this->lng;
1473 
1474  //var_dump($_POST);
1475 
1476  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1477  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1478  $ilCtrl->redirect($this, "edit");
1479  } else {
1480  // check whether there are any core style classes included
1481  $core_styles = ilObjStyleSheet::_getCoreStyles();
1482  foreach ($_POST["char"] as $char) {
1483  if (!empty($core_styles[$char])) {
1484  $this->deleteCoreCharMessage();
1485  return;
1486  }
1487  }
1488 
1489  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1490  $cgui = new ilConfirmationGUI();
1491  $cgui->setFormAction($ilCtrl->getFormAction($this));
1492  $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1493  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1494  $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1495 
1496  foreach ($_POST["char"] as $char) {
1497  $char_comp = explode(".", $char);
1498  $cgui->addItem("char[]", $char, $char_comp[2]);
1499  }
1500 
1501  $tpl->setContent($cgui->getHTML());
1502  }
1503  }
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 1564 of file class.ilObjStyleSheetGUI.php.

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

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

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

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

1979  {
1980  $ilCtrl = $this->ctrl;
1981  $tpl = $this->tpl;
1982  $lng = $this->lng;
1983 
1984  if (!is_array($_POST["color"]) || count($_POST["color"]) == 0) {
1985  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1986  $ilCtrl->redirect($this, "listColors");
1987  } else {
1988  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1989  $cgui = new ilConfirmationGUI();
1990  $cgui->setFormAction($ilCtrl->getFormAction($this));
1991  $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
1992  $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
1993  $cgui->setConfirm($lng->txt("delete"), "deleteColor");
1994 
1995  foreach ($_POST["color"] as $c) {
1996  $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
1997  }
1998 
1999  $tpl->setContent($cgui->getHTML());
2000  }
2001  }
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 2016 of file class.ilObjStyleSheetGUI.php.

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

2017  {
2018  $ilCtrl = $this->ctrl;
2019 
2020  if (is_array($_POST["color"])) {
2021  foreach ($_POST["color"] as $c) {
2022  $this->object->removeColor($c);
2023  }
2024  }
2025 
2026  $ilCtrl->redirect($this, "listColors");
2027  }
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 1511 of file class.ilObjStyleSheetGUI.php.

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

Referenced by deleteCharacteristicConfirmationObject().

1512  {
1513  $ilCtrl = $this->ctrl;
1514  $tpl = $this->tpl;
1515  $lng = $this->lng;
1516 
1517  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1518  $cgui = new ilConfirmationGUI();
1519  $cgui->setFormAction($ilCtrl->getFormAction($this));
1520 
1521 
1522  $core_styles = ilObjStyleSheet::_getCoreStyles();
1523  $cnt = 0;
1524  foreach ($_POST["char"] as $char) {
1525  if (!empty($core_styles[$char])) {
1526  $cnt++;
1527  $char_comp = explode(".", $char);
1528  $cgui->addItem("", "", $char_comp[2]);
1529  } else {
1530  $cgui->addHiddenItem("char[]", $char);
1531  }
1532  }
1533  $all_core_styles = ($cnt == count($_POST["char"]))
1534  ? true
1535  : false;
1536 
1537  if ($all_core_styles) {
1538  $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1539  $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1540  } else {
1541  $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1542  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1543  $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1544  }
1545 
1546  $tpl->setContent($cgui->getHTML());
1547  }
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 1451 of file class.ilObjStyleSheetGUI.php.

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

1452  {
1453  $ilCtrl = $this->ctrl;
1454 
1455  $images = $this->object->getImages();
1456 
1457  foreach ($images as $image) {
1458  if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"])) {
1459  $this->object->deleteImage($image["entry"]);
1460  }
1461  }
1462  $ilCtrl->redirect($this, "listImages");
1463  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters

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

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

2205  {
2206  $ilCtrl = $this->ctrl;
2208 
2209  if ($this->checkWrite() && is_array($_POST["mq_id"])) {
2210  foreach ($_POST["mq_id"] as $id) {
2211  $this->object->deleteMediaQuery($id);
2212  }
2213  }
2214  $ilCtrl->redirect($this, "listMediaQueries");
2215  }
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 2172 of file class.ilObjStyleSheetGUI.php.

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

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

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

public

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

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

945  {
946  // display confirmation message
947  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
948  $cgui = new ilConfirmationGUI();
949  $cgui->setFormAction($this->ctrl->getFormAction($this));
950  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
951  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
952  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
953 
954  $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath) .
955  " " . ilObject::_lookupTitle($this->object->getId());
956 
957  $cgui->addItem("id[]", "", $caption);
958 
959  $this->tpl->setContent($cgui->getHTML());
960  }
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 984 of file class.ilObjStyleSheetGUI.php.

References $_POST, and editObject().

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

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

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

2615  {
2616  $ilCtrl = $this->ctrl;
2617  $tpl = $this->tpl;
2618  $lng = $this->lng;
2619 
2620  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0) {
2621  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2622  $ilCtrl->redirect($this, "listTemplates");
2623  } else {
2624  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2625  $cgui = new ilConfirmationGUI();
2626  $cgui->setFormAction($ilCtrl->getFormAction($this));
2627  $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2628  $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2629  $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2630 
2631  foreach ($_POST["tid"] as $tid) {
2632  $classes = $this->object->getTemplateClasses($tid);
2633  $cl_str = "";
2634  $listed = array();
2635  foreach ($classes as $cl) {
2636  if ($cl != "" && !$listed[$cl]) {
2637  $cl_str .= '<div>- ' .
2638  $cl . "</div>";
2639  $listed[$cl] = true;
2640  }
2641  }
2642  if ($cl_str != "") {
2643  $cl_str = '<div style="padding-left:30px;" class="small">' .
2644  "<div><i>" . $lng->txt("sty_style_class") . "</i></div>" . $cl_str . "</div>";
2645  }
2646  $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid) . $cl_str);
2647  }
2648 
2649  $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2650 
2651  $tpl->setContent($cgui->getHTML());
2652  }
2653  }
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 2668 of file class.ilObjStyleSheetGUI.php.

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

2669  {
2670  $ilCtrl = $this->ctrl;
2671 
2672  if (is_array($_POST["tid"])) {
2673  foreach ($_POST["tid"] as $tid) {
2674  $this->object->removeTemplate($tid);
2675  }
2676  }
2677 
2678  $ilCtrl->redirect($this, "listTemplates");
2679  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

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

2685  {
2686  $ilCtrl = $this->ctrl;
2687 
2688  if (is_array($_POST["tid"])) {
2689  foreach ($_POST["tid"] as $tid) {
2690  $cls = $this->object->getTemplateClasses($tid);
2691  foreach ($cls as $k => $cls) {
2692  $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2693  $ta = ilObjStyleSheet::_determineTag($ty);
2694  $this->object->deleteCharacteristic($ty, $ta, $cls);
2695  }
2696  $this->object->removeTemplate($tid);
2697  }
2698  }
2699 
2700  $ilCtrl->redirect($this, "listTemplates");
2701  }
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 2570 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editTemplateObject(), and updateTemplateObject().

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

◆ editColorObject()

ilObjStyleSheetGUI::editColorObject ( )

Edit color.

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

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

1847  {
1848  $tpl = $this->tpl;
1849  $ilCtrl = $this->ctrl;
1850 
1851  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1852  $this->initColorForm("edit");
1853  $this->getColorFormValues();
1854  $tpl->setContent($this->form_gui->getHTML());
1855  }
$_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 2073 of file class.ilObjStyleSheetGUI.php.

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

2074  {
2075  $tpl = $this->tpl;
2076  $ilCtrl = $this->ctrl;
2077 
2078  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2079  $this->initMediaQueryForm("edit");
2080  $this->getMediaQueryFormValues();
2081  $tpl->setContent($this->form_gui->getHTML());
2082  }
$_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 229 of file class.ilObjStyleSheetGUI.php.

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

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

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

◆ editTagStyleObject()

ilObjStyleSheetGUI::editTagStyleObject ( )

Edit tag style.

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

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

570  {
571  $tpl = $this->tpl;
572  $ilToolbar = $this->toolbar;
573  $lng = $this->lng;
575 
576  // media query selector
577  $mqs = $this->object->getMediaQueries();
578  if (count($mqs) > 0) {
579  //
580  $options = array(
581  "" => $lng->txt("sty_default"),
582  );
583  foreach ($mqs as $mq) {
584  $options[$mq["id"]] = $mq["mquery"];
585  }
586  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
587  $si = new ilSelectInputGUI("@media", "mq_id");
588  $si->setOptions($options);
589  $si->setValue((int) $_GET["mq_id"]);
590  $ilToolbar->addInputItem($si, true);
591  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
592  $ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
593  }
594 
595  // workaround to include default rte styles
596  //if (in_array($_GET["style_type"], array("rte_menu")))
597  if ($this->super_type == "rte") {
598  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
599  include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
600  $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
601  }
602 
603  $cur = explode(".", $_GET["tag"]);
604  $cur_tag = $cur[0];
605  $cur_class = $cur[1];
606 
607  $this->initTagStyleForm("edit", $cur_tag);
608  $this->getValues();
609  $this->outputTagStyleEditScreen();
610  }
$_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 2299 of file class.ilObjStyleSheetGUI.php.

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

2300  {
2301  $tpl = $this->tpl;
2302  $ilCtrl = $this->ctrl;
2303 
2304  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2305  $this->initTemplateForm("edit");
2306  $this->getTemplateFormValues();
2307 
2308  $this->displayTemplateEditForm();
2309  }
$_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:

◆ enableWrite()

ilObjStyleSheetGUI::enableWrite (   $a_write)

Enable writing.

Parameters
$a_write

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

Referenced by ilObjPortfolioGUI\executeCommand().

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

◆ executeCommand()

ilObjStyleSheetGUI::executeCommand ( )

execute command

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

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

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

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

export style

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

References ilUtil\deliverFile().

892  {
893  include_once("./Services/Export/classes/class.ilExport.php");
894  $exp = new ilExport();
895  $r = $exp->exportObject($this->object->getType(), $this->object->getId());
896 
897  ilUtil::deliverFile($r["directory"] . "/" . $r["file"], $r["file"], '', false, true);
898  }
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 900 of file class.ilObjStyleSheetGUI.php.

References $a_type.

Referenced by getValues().

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

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

2707  {
2708  $tpl = $this->tpl;
2709 
2710  $this->initTemplateGenerationForm();
2711  $tpl->setContent($this->form_gui->getHTML());
2712  }
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 1155 of file class.ilObjStyleSheetGUI.php.

References getTabs().

1156  {
1157  $this->getTabs();
1158  }
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 1899 of file class.ilObjStyleSheetGUI.php.

References $_GET.

Referenced by editColorObject().

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

◆ getMediaQueryFormValues()

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

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

References $_GET.

Referenced by editMediaQueryObject().

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

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

Referenced by propertiesObject().

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

◆ getStyleExampleHTML()

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

Get style example HTML.

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

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

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

1674  {
1675  global $DIC;
1676 
1677  $lng = $DIC->language();
1678 
1679  $c = explode(":", $a_class);
1680  $a_class = $c[0];
1681 
1682  $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
1683 
1684  if ($ex_tpl->blockExists("Example_" . $a_type)) {
1685  $ex_tpl->setCurrentBlock("Example_" . $a_type);
1686  } else {
1687  $ex_tpl->setCurrentBlock("Example_default");
1688  }
1689  $ex_tpl->setVariable("EX_CLASS", "ilc_" . $a_type . "_" . $a_class);
1690  $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1691  if (in_array($a_type, array("media_cont", "qimg"))) {
1692  //
1693  }
1694  if (in_array($a_type, array("table", "table_caption"))) {
1695  $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1696  }
1697  if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal"))) {
1698  $ex_tpl->setVariable("HOR", "Horizontal");
1699  }
1700  $ex_tpl->parseCurrentBlock();
1701 
1702  return $ex_tpl->get();
1703  }
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46
+ 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 1166 of file class.ilObjStyleSheetGUI.php.

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

Referenced by getAdminTabs().

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

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

Referenced by editTemplateObject().

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

◆ getTemplatePreview()

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

Get table template preview.

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

References $a_type, and _getTemplatePreview().

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

2315  {
2316  return $this->_getTemplatePreview(
2317  $this->object,
2318  $a_type,
2319  $a_t_id,
2320  $a_small_mode
2321  );
2322  }
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 828 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editTagStyleObject().

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

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

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

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

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

References ilObjStyleSheet\getContentStylePath().

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

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

◆ initCharacteristicForm()

ilObjStyleSheetGUI::initCharacteristicForm (   $a_mode)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode

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

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

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

1630  {
1631  $lng = $this->lng;
1632  $ilCtrl = $this->ctrl;
1633 
1634  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1635  $this->form_gui = new ilPropertyFormGUI();
1636 
1637  // title
1638  $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1639  $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1640  $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include") . " A-Z, a-z, 0-9");
1641  $txt_input->setRequired(true);
1642  $this->form_gui->addItem($txt_input);
1643 
1644  // type
1645  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1646  $types = $all_super_types[$this->super_type];
1647  $exp_types = array();
1648  foreach ($types as $t) {
1650  $exp_types[$t] = $lng->txt("sty_type_" . $t);
1651  }
1652  }
1653  if (count($exp_types) > 1) {
1654  $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1655  $type_input->setOptions($exp_types);
1656  $type_input->setValue(key($exp_types));
1657  $this->form_gui->addItem($type_input);
1658  } elseif (count($exp_types) == 1) {
1659  $hid_input = new ilHiddenInputGUI("type");
1660  $hid_input->setValue(key($exp_types));
1661  $this->form_gui->addItem($hid_input);
1662  }
1663 
1664  $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1665  $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1666  $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1667  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1668  }
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.
+ 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 1861 of file class.ilObjStyleSheetGUI.php.

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

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

1862  {
1863  $lng = $this->lng;
1864  $ilCtrl = $this->ctrl;
1865 
1866  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1867  $this->form_gui = new ilPropertyFormGUI();
1868 
1869  $this->form_gui->setTitle($lng->txt("sty_add_color"));
1870 
1871  // name
1872  $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1873  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1874  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
1875  $name_input->setRequired(true);
1876  $name_input->setSize(15);
1877  $name_input->setMaxLength(15);
1878  $this->form_gui->addItem($name_input);
1879 
1880  // code
1881  $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1882  $color_input->setRequired(true);
1883  $color_input->setDefaultColor("");
1884  $this->form_gui->addItem($color_input);
1885 
1886  if ($a_mode == "create") {
1887  $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1888  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1889  } else {
1890  $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1891  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1892  }
1893  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1894  }
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 1428 of file class.ilObjStyleSheetGUI.php.

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

Referenced by addImageObject(), and uploadImageObject().

1429  {
1430  $lng = $this->lng;
1431  $ilCtrl = $this->ctrl;
1432 
1433  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1434  $this->form_gui = new ilPropertyFormGUI();
1435 
1436  $this->form_gui->setTitle($lng->txt("sty_add_image"));
1437 
1438  $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1439  $file_input->setSuffixes(["jpg","jpeg","png","gif","svg"]);
1440  $file_input->setRequired(true);
1441  $this->form_gui->addItem($file_input);
1442 
1443  $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1444  $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1445  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1446  }
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.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMediaQueryForm()

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

Init media query form.

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

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

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

2089  {
2090  $lng = $this->lng;
2091  $ilCtrl = $this->ctrl;
2092 
2093  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2094  $this->form_gui = new ilPropertyFormGUI();
2095 
2096  $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2097 
2098  // media query
2099  $ti = new ilTextInputGUI("@media", "mquery");
2100  $ti->setMaxLength(2000);
2101  $ti->setInfo($lng->txt("sty_add_media_query_info"));
2102  $this->form_gui->addItem($ti);
2103 
2104 
2105  if ($a_mode == "create") {
2106  $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2107  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2108  } else {
2109  $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2110  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2111  }
2112  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2113  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
+ 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 353 of file class.ilObjStyleSheetGUI.php.

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

Referenced by propertiesObject(), and updateObject().

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

◆ initTagStyleForm()

ilObjStyleSheetGUI::initTagStyleForm (   $a_mode,
  $a_cur_tag 
)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode

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

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

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

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

◆ initTemplateForm()

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

Init table template form.

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

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

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

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

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

Referenced by generateTemplateObject(), and templateGenerationObject().

2718  {
2719  $lng = $this->lng;
2720  $ilCtrl = $this->ctrl;
2721 
2722  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2723  $this->form_gui = new ilPropertyFormGUI();
2724 
2725  $this->form_gui->setTitle($lng->txt("sty_generate_template"));
2726 
2727  // name
2728  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2729  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2730  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
2731  $name_input->setRequired(true);
2732  $name_input->setSize(30);
2733  $name_input->setMaxLength(30);
2734  $this->form_gui->addItem($name_input);
2735 
2736  // basic layout
2737  $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
2738  $options = array(
2739  "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
2740  "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
2741  "noZebra" => $lng->txt("sty_table_template_no_zebra")
2742  );
2743  $bl_input->setOptions($options);
2744  $this->form_gui->addItem($bl_input);
2745 
2746  // top bottom padding
2747  include_once("./Services/Style/Content/classes/class.ilNumericStyleValueInputGUI.php");
2748  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
2749  $num_input->setAllowPercentage(false);
2750  $num_input->setValue("3px");
2751  $this->form_gui->addItem($num_input);
2752 
2753  // left right padding
2754  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
2755  $num_input->setAllowPercentage(false);
2756  $num_input->setValue("10px");
2757  $this->form_gui->addItem($num_input);
2758 
2759  // base color
2760  $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
2761  $cs = $this->object->getColors();
2762  $options = array();
2763  foreach ($cs as $c) {
2764  $options[$c["name"]] = $c["name"];
2765  }
2766  $bc_input->setOptions($options);
2767  $this->form_gui->addItem($bc_input);
2768 
2769  // Lightness Settings
2770  $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
2771  "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
2772  foreach ($lss as $ls => $v) {
2773  $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_" . $ls), "lightness_" . $ls);
2774  $l_input->setMaxValue(100);
2775  $l_input->setMinValue(-100);
2776  $l_input->setValue($v);
2777  $l_input->setSize(4);
2778  $l_input->setMaxLength(4);
2779  $this->form_gui->addItem($l_input);
2780  }
2781 
2782  $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
2783  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2784  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2785  }
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 1809 of file class.ilObjStyleSheetGUI.php.

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

1810  {
1811  $tpl = $this->tpl;
1813  $ilToolbar = $this->toolbar;
1814  $ilCtrl = $this->ctrl;
1815 
1816  if ($this->checkWrite()) {
1817  $ilToolbar->addButton(
1818  $this->lng->txt("sty_add_color"),
1819  $ilCtrl->getLinkTarget($this, "addColor")
1820  );
1821  }
1822 
1823  include_once("./Services/Style/Content/classes/class.ilStyleColorTableGUI.php");
1824  $table_gui = new ilStyleColorTableGUI(
1825  $this,
1826  "listColors",
1827  $this->object
1828  );
1829  $tpl->setContent($table_gui->getHTML());
1830  }
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 1361 of file class.ilObjStyleSheetGUI.php.

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

1362  {
1363  $tpl = $this->tpl;
1364  $ilToolbar = $this->toolbar;
1365  $ilCtrl = $this->ctrl;
1366  $lng = $this->lng;
1368 
1369  if ($this->checkWrite()) {
1370  $ilToolbar->addButton(
1371  $lng->txt("sty_add_image"),
1372  $ilCtrl->getLinkTarget($this, "addImage")
1373  );
1374  }
1375 
1376  include_once("./Services/Style/Content/classes/class.ilStyleImageTableGUI.php");
1377  $table_gui = new ilStyleImageTableGUI(
1378  $this,
1379  "listImages",
1380  $this->object
1381  );
1382  $tpl->setContent($table_gui->getHTML());
1383  }
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 2036 of file class.ilObjStyleSheetGUI.php.

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

2037  {
2038  $tpl = $this->tpl;
2040  $ilToolbar = $this->toolbar;
2041  $ilCtrl = $this->ctrl;
2042 
2043  if ($this->checkWrite()) {
2044  $ilToolbar->addButton(
2045  $this->lng->txt("sty_add_media_query"),
2046  $ilCtrl->getLinkTarget($this, "addMediaQuery")
2047  );
2048  }
2049 
2050  include_once("./Services/Style/Content/classes/class.ilStyleMediaQueryTableGUI.php");
2051  $table_gui = new ilStyleMediaQueryTableGUI(
2052  $this,
2053  "listMediaQueries",
2054  $this->object
2055  );
2056  $tpl->setContent($table_gui->getHTML());
2057  }
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 2241 of file class.ilObjStyleSheetGUI.php.

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

2242  {
2243  $tpl = $this->tpl;
2244  $ilTabs = $this->tabs;
2245  $ilCtrl = $this->ctrl;
2246  $ilToolbar = $this->toolbar;
2247 
2248  $ctype = $_GET["temp_type"];
2249  if ($ctype == "") {
2250  $ctype = "table";
2251  $ilCtrl->setParameter($this, "temp_type", $ctype);
2252  $_GET["temp_type"] = $ctype;
2253  }
2254 
2255  $this->setTemplatesSubTabs();
2256  $ilTabs->setSubTabActive("sty_" . $ctype . "_templates");
2257 
2258  // action commands
2259  if ($this->checkWrite()) {
2260  if ($ctype == "table") {
2261  $ilToolbar->addButton(
2262  $this->lng->txt("sty_generate_template"),
2263  $ilCtrl->getLinkTarget($this, "generateTemplate")
2264  );
2265  }
2266  $ilToolbar->addButton(
2267  $this->lng->txt("sty_add_template"),
2268  $ilCtrl->getLinkTarget($this, "addTemplate")
2269  );
2270  }
2271 
2272 
2273 
2274  $this->includeCSS();
2275  include_once("./Services/Style/Content/classes/class.ilTableTemplatesTableGUI.php");
2276  $table_gui = new ilTableTemplatesTableGUI(
2277  $ctype,
2278  $this,
2279  "listTemplates",
2280  $this->object
2281  );
2282  $tpl->setContent($table_gui->getHTML());
2283  }
$_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 918 of file class.ilObjStyleSheetGUI.php.

References $_POST, and editObject().

919  {
920  $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
921  $this->editObject();
922  }
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 630 of file class.ilObjStyleSheetGUI.php.

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

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

631  {
632  $tpl = $this->tpl;
634  $lng = $this->lng;
635 
636  // set style sheet
637  $tpl->setCurrentBlock("ContentStyle");
638  $tpl->setVariable(
639  "LOCATION_CONTENT_STYLESHEET",
640  ilObjStyleSheet::getContentStylePath($this->object->getId())
641  );
642 
643  $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style/Content");
644 
645  $cur = explode(".", $_GET["tag"]);
646  $cur_tag = $cur[0];
647  $cur_class = $cur[1];
648 
649  $ts_tpl->setVariable(
650  "EXAMPLE",
651  ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class)
652  );
653 
654  $ts_tpl->setVariable(
655  "FORM",
656  $this->form_gui->getHtml()
657  );
658 
659  $tpl->setTitle($cur_class . " (" . $lng->txt("sty_type_" . $_GET["style_type"]) . ")");
660 
661  $tpl->setContent($ts_tpl->get());
662  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 1775 of file class.ilObjStyleSheetGUI.php.

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

1776  {
1777  $ilCtrl = $this->ctrl;
1778  $lng = $this->lng;
1779 
1780  if (is_array($_POST["title"])) {
1781  foreach ($_POST["title"] as $from_char => $to_title) {
1782  $fc = explode(".", $from_char);
1783 
1784  if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1785  !$this->object->characteristicExists($to_title, $fc[0])) {
1786  $this->object->copyCharacteristic(
1787  $_POST["from_style_id"],
1788  $fc[0],
1789  $fc[2],
1790  $to_title
1791  );
1792  }
1793  }
1794  ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1795  unset($_SESSION["sty_copy"]);
1796  ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1797  }
1798 
1799  $ilCtrl->redirect($this, "edit");
1800  }
$_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 1756 of file class.ilObjStyleSheetGUI.php.

References $tabs, and ilObjectGUI\$tpl.

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

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

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

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

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

References $_POST, and editObject().

928  {
929  $this->object->setTitle($_POST["style_title"]);
930  $this->object->setDescription($_POST["style_description"]);
931 
932  foreach ($_POST["styval"] as $id => $value) {
933  $this->object->updateStyleParameter($id, $value);
934  }
935  $this->object->update();
936  $this->editObject();
937  }
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 423 of file class.ilObjStyleSheetGUI.php.

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

424  {
426 
427  $cur = explode(".", $_GET["tag"]);
428  $cur_tag = $cur[0];
429  $cur_class = $cur[1];
430 
431  $this->initTagStyleForm("edit", $cur_tag);
432 
433  if ($this->form_gui->checkInput()) {
434  $this->saveTagStyle();
435  $ilCtrl->redirect($this, "editTagStyle");
436  } else {
437  $this->form_gui->setValuesByPost();
438  $this->outputTagStyleEditScreen();
439  }
440  }
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 2589 of file class.ilObjStyleSheetGUI.php.

References updateTemplateObject().

2590  {
2591  $this->updateTemplateObject(true);
2592  }
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 3043 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

3044  {
3045  $ilCtrl = $this->ctrl;
3046 
3047  /*if ($_GET["baseClass"] == "ilAdministrationGUI")
3048  {
3049  $ilCtrl->redirectByClass("ilcontentstylesettingsgui", "edit");
3050  }*/
3051  $ilCtrl->returnToParent($this);
3052  }
global $ilCtrl
Definition: ilias.php:18

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

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

1597  {
1598  $ilCtrl = $this->ctrl;
1599  $tpl = $this->tpl;
1600  $lng = $this->lng;
1601 
1602  $this->initCharacteristicForm("create");
1603 
1604  if ($this->form_gui->checkInput()) {
1605  if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"])) {
1606  $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1607  $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1608  } else {
1609  $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1610  ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1611  $ilCtrl->setParameter(
1612  $this,
1613  "tag",
1614  ilObjStyleSheet::_determineTag($_POST["type"]) . "." . $_POST["new_characteristic"]
1615  );
1616  $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1617  $ilCtrl->redirect($this, "editTagStyle");
1618  }
1619  }
1620  $this->form_gui->setValuesByPost();
1621  $tpl->setContent($this->form_gui->getHTML());
1622  }
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 1921 of file class.ilObjStyleSheetGUI.php.

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

1922  {
1923  $tpl = $this->tpl;
1924  $ilCtrl = $this->ctrl;
1925  $lng = $this->lng;
1926 
1927  $this->initColorForm();
1928 
1929  if ($this->form_gui->checkInput()) {
1930  if ($this->object->colorExists($_POST["color_name"])) {
1931  $col_input = $this->form_gui->getItemByPostVar("color_name");
1932  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1933  } else {
1934  $this->object->addColor(
1935  $_POST["color_name"],
1936  $_POST["color_code"]
1937  );
1938  $ilCtrl->redirect($this, "listColors");
1939  }
1940  }
1941  $this->form_gui->setValuesByPost();
1942  $tpl->setContent($this->form_gui->getHTML());
1943  }
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 1708 of file class.ilObjStyleSheetGUI.php.

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

1709  {
1710  $ilCtrl = $this->ctrl;
1711  $lng = $this->lng;
1712 
1713  //var_dump($_POST);
1714 
1715  foreach ($_POST["all_chars"] as $char) {
1716  $ca = explode(".", $char);
1717  $this->object->saveHideStatus(
1718  $ca[0],
1719  $ca[2],
1720  (is_array($_POST["hide"]) && in_array($char, $_POST["hide"]))
1721  );
1722  }
1723 
1724  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1725  $ilCtrl->redirect($this, "edit");
1726  }
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 2133 of file class.ilObjStyleSheetGUI.php.

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

2134  {
2135  $tpl = $this->tpl;
2136  $ilCtrl = $this->ctrl;
2137  $lng = $this->lng;
2138 
2139  $this->initMediaQueryForm();
2140 
2141  if ($this->form_gui->checkInput()) {
2142  $this->object->addMediaQuery($_POST["mquery"]);
2143  $ilCtrl->redirect($this, "listMediaQueries");
2144  }
2145  $this->form_gui->setValuesByPost();
2146  $tpl->setContent($this->form_gui->getHTML());
2147  }
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 2223 of file class.ilObjStyleSheetGUI.php.

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

2224  {
2225  $ilCtrl = $this->ctrl;
2226 
2227  if (is_array($_POST["order"])) {
2228  $this->object->saveMediaQueryOrder($_POST["order"]);
2229  }
2230  $ilCtrl->redirect($this, "listMediaQueries");
2231  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

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

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

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

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

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

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

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

2497  {
2498  $tpl = $this->tpl;
2499  $ilCtrl = $this->ctrl;
2500  $lng = $this->lng;
2501 
2502  $this->initTemplateForm();
2503 
2504  if ($this->form_gui->checkInput()) {
2505  if ($this->object->templateExists($_POST["name"])) {
2506  $name_input = $this->form_gui->getItemByPostVar("name");
2507  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2508  } else {
2509  $classes = array();
2510  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2511  $classes[$tct] = $_POST[$tct . "_class"];
2512  }
2513  $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2514  $this->object->writeTemplatePreview(
2515  $t_id,
2516  $this->getTemplatePreview($_GET["temp_type"], $t_id, true)
2517  );
2518  $ilCtrl->redirect($this, "listTemplates");
2519  }
2520  }
2521  $this->form_gui->setValuesByPost();
2522  $tpl->setContent($this->form_gui->getHTML());
2523  }
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 1281 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editObject().

1282  {
1283  $lng = $this->lng;
1284  $ilTabs = $this->tabs;
1285  $ilCtrl = $this->ctrl;
1286 
1288 
1289  foreach ($types as $super_type => $types) {
1290  // text block characteristics
1291  $ilCtrl->setParameter($this, "style_type", $super_type);
1292  $ilTabs->addSubTabTarget(
1293  "sty_" . $super_type . "_char",
1294  $this->ctrl->getLinkTarget($this, "edit"),
1295  array("edit", ""),
1296  get_class($this)
1297  );
1298  }
1299 
1300  $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1301  }
$_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:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

Referenced by listTemplatesObject().

1309  {
1310  $lng = $this->lng;
1311  $ilTabs = $this->tabs;
1312  $ilCtrl = $this->ctrl;
1313 
1315 
1316  foreach ($types as $t => $c) {
1317  $ilCtrl->setParameter($this, "temp_type", $t);
1318  $ilTabs->addSubTabTarget(
1319  "sty_" . $t . "_templates",
1320  $this->ctrl->getLinkTarget($this, "listTemplates"),
1321  array("listTemplates", ""),
1322  get_class($this)
1323  );
1324  }
1325 
1326  $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1327  }
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:

◆ switchMQueryObject()

ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters

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

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

619  {
621 
622  $ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
623  $ilCtrl->redirect($this, "editTagStyle");
624  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

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

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

1949  {
1950  $tpl = $this->tpl;
1951  $ilCtrl = $this->ctrl;
1952  $lng = $this->lng;
1953 
1954  $this->initColorForm("edit");
1955 
1956  if ($this->form_gui->checkInput()) {
1957  if ($this->object->colorExists($_POST["color_name"]) &&
1958  $_POST["color_name"] != $_GET["c_name"]) {
1959  $col_input = $this->form_gui->getItemByPostVar("color_name");
1960  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1961  } else {
1962  $this->object->updateColor(
1963  $_GET["c_name"],
1964  $_POST["color_name"],
1965  $_POST["color_code"]
1966  );
1967  $ilCtrl->redirect($this, "listColors");
1968  }
1969  }
1970  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1971  $this->form_gui->setValuesByPost();
1972  $tpl->setContent($this->form_gui->getHTML());
1973  }
$_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 2152 of file class.ilObjStyleSheetGUI.php.

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

2153  {
2154  $tpl = $this->tpl;
2155  $ilCtrl = $this->ctrl;
2156  $lng = $this->lng;
2157 
2158  $this->initMediaQueryForm("edit");
2159 
2160  if ($this->form_gui->checkInput()) {
2161  $this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
2162  $ilCtrl->redirect($this, "listMediaQueries");
2163  }
2164  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2165  $this->form_gui->setValuesByPost();
2166  $tpl->setContent($this->form_gui->getHTML());
2167  }
$_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 397 of file class.ilObjStyleSheetGUI.php.

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

398  {
399  $lng = $this->lng;
401  $tpl = $this->tpl;
402 
403  $this->initPropertiesForm("edit");
404  if ($this->form->checkInput()) {
405  $this->object->setTitle($this->form->getInput("style_title"));
406  $this->object->setDescription($this->form->getInput("style_description"));
407  $this->object->writeStyleSetting(
408  "disable_auto_margins",
409  $this->form->getInput("disable_auto_margins")
410  );
411  $this->object->update();
412  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
413  $ilCtrl->redirect($this, "properties");
414  } else {
415  $this->form->setValuesByPost();
416  $tpl->setContent($this->form->getHtml());
417  }
418  }
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 445 of file class.ilObjStyleSheetGUI.php.

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

446  {
448 
449  $cur = explode(".", $_GET["tag"]);
450  $cur_tag = $cur[0];
451  $cur_class = $cur[1];
452 
453  $this->initTagStyleForm("edit", $cur_tag);
454  if ($this->form_gui->checkInput()) {
455  $this->saveTagStyle();
456  $ilCtrl->redirect($this, "edit");
457  } else {
458  $this->form_gui->setValuesByPost();
459  $this->outputTagStyleEditScreen();
460  }
461  }
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 2528 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().

2529  {
2530  $tpl = $this->tpl;
2531  $ilCtrl = $this->ctrl;
2532  $lng = $this->lng;
2533 
2534  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2535  $this->initTemplateForm("edit");
2536 
2537  if ($this->form_gui->checkInput()) {
2538  if ($this->object->templateExists($_POST["name"]) &&
2539  $_POST["name"] != ilObjStyleSheet::_lookupTemplateName($_GET["t_id"])) {
2540  $name_input = $this->form_gui->getItemByPostVar("name");
2541  $name_input->setAlert($lng->txt("sty_template_already_exists"));
2542  } else {
2543  $classes = array();
2544  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2545  $classes[$tct] = $_POST[$tct . "_class"];
2546  }
2547 
2548  $this->object->updateTemplate(
2549  $_GET["t_id"],
2550  $_POST["name"],
2551  $classes
2552  );
2553  $this->object->writeTemplatePreview(
2554  $_GET["t_id"],
2555  $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true)
2556  );
2557  if (!$a_refresh) {
2558  $ilCtrl->redirect($this, "listTemplates");
2559  }
2560  }
2561  }
2562 
2563  $this->form_gui->setValuesByPost();
2564  $this->displayTemplateEditForm();
2565  }
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 1409 of file class.ilObjStyleSheetGUI.php.

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

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

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

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

References editObject().

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

◆ writeStylePar()

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

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

References $a_type.

Referenced by saveTagStyle().

551  {
552  // echo $_GET["mq_id"]."-";
553  // echo $a_mq_id."-"; exit;
554  if ($a_type == "") {
555  return;
556  }
557 
558  if ($value != "") {
559  $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
560  } else {
561  $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
562  }
563  }
$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.

◆ $enable_write

ilObjStyleSheetGUI::$enable_write = false
protected

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

◆ $help

ilObjStyleSheetGUI::$help
protected

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

Referenced by createObject(), and getTabs().

◆ $obj_definition

ilObjStyleSheetGUI::$obj_definition
protected

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

◆ $rbacsystem

◆ $tabs

ilObjStyleSheetGUI::$tabs
protected

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