ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

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

Protected Attributes

 $rbacsystem
 
 $help
 
 $tabs
 
 $obj_definition
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

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

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

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

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

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

◆ accordiontestObject()

ilObjStyleSheetGUI::accordiontestObject ( )

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

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

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

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

1324  {
1325  $ilLocator = $this->locator;
1326 
1327  if ($_GET["admin_mode"] == "settings") { // system settings
1328  parent::addAdminLocatorItems(true);
1329 
1330  $ilLocator->addItem(
1332  ilObject::_lookupObjId($_GET["ref_id"])
1333  ),
1334  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "")
1335  );
1336 
1337  if ($_GET["obj_id"] > 0) {
1338  $ilLocator->addItem(
1339  $this->object->getTitle(),
1340  $this->ctrl->getLinkTarget($this, "edit")
1341  );
1342  }
1343  } else { // repository administration
1344  //?
1345  }
1346  }
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ addCharacteristicFormObject()

ilObjStyleSheetGUI::addCharacteristicFormObject ( )

Add characteristic.

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

References ilObjectGUI\$tpl, and initCharacteristicForm().

1593  {
1594  $tpl = $this->tpl;
1595 
1596  $this->initCharacteristicForm("create");
1597  $tpl->setContent($this->form_gui->getHTML());
1598  }
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 1842 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initColorForm().

1843  {
1844  $tpl = $this->tpl;
1845 
1846  $this->initColorForm();
1847  $tpl->setContent($this->form_gui->getHTML());
1848  }
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ addImageObject()

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

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

References ilObjectGUI\$tpl, and initImageForm().

1397  {
1398  $tpl = $this->tpl;
1399 
1400  $this->initImageForm();
1401  $tpl->setContent($this->form_gui->getHTML());
1402  }
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

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

References ilObjectGUI\$tpl, and initMediaQueryForm().

2070  {
2071  $tpl = $this->tpl;
2072 
2073  $this->initMediaQueryForm();
2074  $tpl->setContent($this->form_gui->getHTML());
2075  }
initMediaQueryForm($a_mode="create")
Init media query form.
+ Here is the call graph for this function:

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

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

References ilObjectGUI\$tpl, and initTemplateForm().

2295  {
2296  $tpl = $this->tpl;
2297 
2298  $this->initTemplateForm();
2299  $tpl->setContent($this->form_gui->getHTML());
2300  }
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 1111 of file class.ilObjStyleSheetGUI.php.

1112  {
1113  }

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

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

1560  {
1561  $ilCtrl = $this->ctrl;
1562  $lng = $this->lng;
1563 
1564  ilUtil::sendInfo($lng->txt("action_aborted"), true);
1565  $ilCtrl->redirect($this, "edit");
1566  }
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 2013 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2014  {
2015  $ilCtrl = $this->ctrl;
2016 
2017  $ilCtrl->redirect($this, "listColors");
2018  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

1919  {
1920  $ilCtrl = $this->ctrl;
1921 
1922  $ilCtrl->redirect($this, "listColors");
1923  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

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

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

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

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

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

1120  {
1121  $lng = $this->lng;
1122 
1123  ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1124  $this->ctrl->returnToParent($this);
1125  }
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 2664 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2665  {
2666  $ilCtrl = $this->ctrl;
2667 
2668  $ilCtrl->redirect($this, "listTemplates");
2669  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

2492  {
2493  $ilCtrl = $this->ctrl;
2494 
2495  $ilCtrl->redirect($this, "listTemplates");
2496  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

1408  {
1409  $ilCtrl = $this->ctrl;
1410 
1411  $ilCtrl->redirect($this, "listImages");
1412  }
global $ilCtrl
Definition: ilias.php:18

◆ checkWrite()

ilObjStyleSheetGUI::checkWrite ( )

Check write.

Parameters

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

References $_GET, and $rbacsystem.

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

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

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

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

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

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

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

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

1742  {
1743  $ilCtrl = $this->ctrl;
1744  $lng = $this->lng;
1745 
1746  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0) {
1747  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1748  } else {
1749  $style_cp = implode("::", $_POST["char"]);
1750  $style_cp = $this->object->getId() . ":::" . $_GET["style_type"] . ":::" . $style_cp;
1751  $_SESSION["sty_copy"] = $style_cp;
1752  ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1753  }
1754  $ilCtrl->redirect($this, "edit");
1755  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_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 1028 of file class.ilObjStyleSheetGUI.php.

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

1029  {
1030  if ($_POST["source_style"] > 0) {
1031  $style_obj = ilObjectFactory::getInstanceByObjId($_POST["source_style"]);
1032  $new_id = $style_obj->ilClone();
1033  }
1034 
1035  // assign style to style sheet folder,
1036  // if parent is style sheet folder
1037  if ($_GET["ref_id"] > 0) {
1038  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1039  if ($fold->getType() == "stys") {
1040  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1041  $cont_style_settings = new ilContentStyleSettings();
1042  $cont_style_settings->addStyle($new_id);
1043  $cont_style_settings->update();
1044  ilObjStyleSheet::_writeStandard($new_id, "1");
1045  $this->ctrl->returnToParent($this);
1046  }
1047  }
1048 
1049  return $new_id;
1050  }
$_GET["client_id"]
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _writeStandard($a_id, $a_std)
Write standard flag.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_POST["username"]
+ Here is the call graph for this function:

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

create

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

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

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

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

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

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

1572  {
1573  $ilCtrl = $this->ctrl;
1574 
1575  if (is_array($_POST["char"])) {
1576  foreach ($_POST["char"] as $char) {
1577  $char_comp = explode(".", $char);
1578  $type = $char_comp[0];
1579  $tag = $char_comp[1];
1580  $class = $char_comp[2];
1581 
1582  $this->object->deleteCharacteristic($type, $tag, $class);
1583  }
1584  }
1585 
1586  $ilCtrl->redirect($this, "edit");
1587  }
$type
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
if(function_exists('posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

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

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

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

2024  {
2025  $ilCtrl = $this->ctrl;
2026 
2027  if (is_array($_POST["color"])) {
2028  foreach ($_POST["color"] as $c) {
2029  $this->object->removeColor($c);
2030  }
2031  }
2032 
2033  $ilCtrl->redirect($this, "listColors");
2034  }
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 1518 of file class.ilObjStyleSheetGUI.php.

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

Referenced by deleteCharacteristicConfirmationObject().

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

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

1459  {
1460  $ilCtrl = $this->ctrl;
1461 
1462  $images = $this->object->getImages();
1463 
1464  foreach ($images as $image) {
1465  if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"])) {
1466  $this->object->deleteImage($image["entry"]);
1467  }
1468  }
1469  $ilCtrl->redirect($this, "listImages");
1470  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters

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

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

2211  {
2212  $ilCtrl = $this->ctrl;
2214 
2215  if ($this->checkWrite() && is_array($_POST["mq_id"])) {
2216  foreach ($_POST["mq_id"] as $id) {
2217  $this->object->deleteMediaQuery($id);
2218  }
2219  }
2220  $ilCtrl->redirect($this, "listMediaQueries");
2221  }
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

Confirm media query deletion.

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

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

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

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

public

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

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

935  {
936  //$this->setTabs();
937 
938  // display confirmation message
939  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
940  $cgui = new ilConfirmationGUI();
941  $cgui->setFormAction($this->ctrl->getFormAction($this));
942  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
943  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
944  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
945 
946  $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath) .
947  " " . ilObject::_lookupTitle($this->object->getId());
948 
949  $cgui->addItem("id[]", "", $caption);
950 
951  $this->tpl->setContent($cgui->getHTML());
952  }
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
static _lookupTitle($a_id)
lookup object title
Create new PHPExcel object
obj_idprivate
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteStyleParameterObject()

ilObjStyleSheetGUI::deleteStyleParameterObject ( )

delete style parameters

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

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

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

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

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

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

◆ deleteTemplateKeepClassesObject()

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

Delete table template.

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

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

2675  {
2676  $ilCtrl = $this->ctrl;
2677 
2678  if (is_array($_POST["tid"])) {
2679  foreach ($_POST["tid"] as $tid) {
2680  $this->object->removeTemplate($tid);
2681  }
2682  }
2683 
2684  $ilCtrl->redirect($this, "listTemplates");
2685  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

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

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

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

Referenced by editTemplateObject(), and updateTemplateObject().

2577  {
2578  $tpl = $this->tpl;
2579 
2580  $a_tpl = new ilTemplate(
2581  "tpl.template_edit.html",
2582  true,
2583  true,
2584  "Services/Style/Content"
2585  );
2586  $this->includeCSS();
2587  $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2588  $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2589  $tpl->setContent($a_tpl->get());
2590  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$_GET["client_id"]
special template class to simplify handling of ITX/PEAR
includeCSS()
Include CSS in output.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editColorObject()

ilObjStyleSheetGUI::editColorObject ( )

Edit color.

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

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

1854  {
1855  $tpl = $this->tpl;
1856  $ilCtrl = $this->ctrl;
1857 
1858  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1859  $this->initColorForm("edit");
1860  $this->getColorFormValues();
1861  $tpl->setContent($this->form_gui->getHTML());
1862  }
$_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 2080 of file class.ilObjStyleSheetGUI.php.

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

2081  {
2082  $tpl = $this->tpl;
2083  $ilCtrl = $this->ctrl;
2084 
2085  $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2086  $this->initMediaQueryForm("edit");
2087  $this->getMediaQueryFormValues();
2088  $tpl->setContent($this->form_gui->getHTML());
2089  }
$_GET["client_id"]
initMediaQueryForm($a_mode="create")
Init media query form.
global $ilCtrl
Definition: ilias.php:18
getMediaQueryFormValues()
Set values for media query editing.
+ Here is the call graph for this function:

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

edit style sheet

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

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

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

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

◆ editTagStyleObject()

ilObjStyleSheetGUI::editTagStyleObject ( )

Edit tag style.

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

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

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

◆ editTemplateObject()

ilObjStyleSheetGUI::editTemplateObject ( )

Edit table template.

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

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

2306  {
2307  $tpl = $this->tpl;
2308  $ilCtrl = $this->ctrl;
2309 
2310  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2311  $this->initTemplateForm("edit");
2312  $this->getTemplateFormValues();
2313 
2314  $this->displayTemplateEditForm();
2315  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
initTemplateForm($a_mode="create")
Init table template form.
displayTemplateEditForm()
Display table tempalte edit form.
getTemplateFormValues()
Set values for table template editing.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjStyleSheetGUI::executeCommand ( )

execute command

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

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

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

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

export style

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

References $r, ilUtil\deliverFile(), and object.

882  {
883  include_once("./Services/Export/classes/class.ilExport.php");
884  $exp = new ilExport();
885  $r = $exp->exportObject($this->object->getType(), $this->object->getId());
886 
887  ilUtil::deliverFile($r["directory"] . "/" . $r["file"], $r["file"], '', false, true);
888  }
$r
Definition: example_031.php:79
Create new PHPExcel object
obj_idprivate
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ extractParametersOfTag()

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

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

References $a_type, $tag, and array.

Referenced by getValues().

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

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

2713  {
2714  $tpl = $this->tpl;
2715 
2716  $this->initTemplateGenerationForm();
2717  $tpl->setContent($this->form_gui->getHTML());
2718  }
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 1130 of file class.ilObjStyleSheetGUI.php.

References getTabs().

1131  {
1132  $this->getTabs();
1133  }
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 1906 of file class.ilObjStyleSheetGUI.php.

References $_GET.

Referenced by editColorObject().

1907  {
1908  if ($_GET["c_name"] != "") {
1909  $values["color_name"] = $_GET["c_name"];
1910  $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1911  $this->form_gui->setValuesByArray($values);
1912  }
1913  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getMediaQueryFormValues()

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

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

References $_GET, and object.

Referenced by editMediaQueryObject().

2125  {
2126  if ($_GET["mq_id"] != "") {
2127  foreach ($this->object->getMediaQueries() as $mq) {
2128  if ($mq["id"] == (int) $_GET["mq_id"]) {
2129  $values["mquery"] = $mq["mquery"];
2130  }
2131  }
2132  $this->form_gui->setValuesByArray($values);
2133  }
2134  }
$_GET["client_id"]
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

References array, and object.

Referenced by propertiesObject().

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

◆ getStyleExampleHTML()

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

Get style example HTML.

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

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

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

1681  {
1682  global $DIC;
1683 
1684  $lng = $DIC->language();
1685 
1686  $c = explode(":", $a_class);
1687  $a_class = $c[0];
1688 
1689  $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
1690 
1691  if ($ex_tpl->blockExists("Example_" . $a_type)) {
1692  $ex_tpl->setCurrentBlock("Example_" . $a_type);
1693  } else {
1694  $ex_tpl->setCurrentBlock("Example_default");
1695  }
1696  $ex_tpl->setVariable("EX_CLASS", "ilc_" . $a_type . "_" . $a_class);
1697  $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1698  if (in_array($a_type, array("media_cont", "qimg"))) {
1699  //
1700  }
1701  if (in_array($a_type, array("table", "table_caption"))) {
1702  $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1703  }
1704  if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal"))) {
1705  $ex_tpl->setVariable("HOR", "Horizontal");
1706  }
1707  $ex_tpl->parseCurrentBlock();
1708 
1709  return $ex_tpl->get();
1710  }
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ 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 1156 of file class.ilObjStyleSheetGUI.php.

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

Referenced by getAdminTabs(), and setTabs().

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

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

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

Referenced by editTemplateObject().

2604  {
2605  if ($_GET["t_id"] > 0) {
2606  $t = $this->object->getTemplate($_GET["t_id"]);
2607 
2608  $values["name"] = $t["name"];
2609  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2610  foreach ($scs as $k => $type) {
2611  $values[$k . "_class"] = $t["classes"][$k];
2612  }
2613  $this->form_gui->setValuesByArray($values);
2614  }
2615  }
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 2320 of file class.ilObjStyleSheetGUI.php.

References $a_type, and _getTemplatePreview().

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

2321  {
2322  return $this->_getTemplatePreview(
2323  $this->object,
2324  $a_type,
2325  $a_t_id,
2326  $a_small_mode
2327  );
2328  }
static _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$a_type
Definition: workflow.php:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilObjStyleSheetGUI::getValues ( )

FORM: Get current values from persistent object.

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

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

Referenced by editTagStyleObject().

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

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

1056  {
1057  // check file
1058  $source = $_FILES["importfile"]["tmp_name"];
1059  if (($source == 'none') || (!$source)) {
1060  $this->ilias->raiseError("No file selected!", $this->ilias->error_obj->MESSAGE);
1061  }
1062 
1063  // check correct file type
1064  $info = pathinfo($_FILES["importfile"]["name"]);
1065  if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml") {
1066  $this->ilias->raiseError("File must be a zip or xml file!", $this->ilias->error_obj->MESSAGE);
1067  }
1068 
1069  // new import
1070  $fname = explode("_", $_FILES["importfile"]["name"]);
1071  if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty") {
1072  include_once("./Services/Export/classes/class.ilImport.php");
1073  $imp = new ilImport();
1074  $new_id = $imp->importObject(
1075  null,
1076  $_FILES["importfile"]["tmp_name"],
1077  $_FILES["importfile"]["name"],
1078  "sty"
1079  );
1080  if ($new_id > 0) {
1081  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
1082  }
1083  } else { // old import
1084  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1085  $newObj = new ilObjStyleSheet();
1086  $newObj->import($_FILES["importfile"]);
1087  }
1088 
1089  // assign style to style sheet folder,
1090  // if parent is style sheet folder
1091  if ($_GET["ref_id"] > 0) {
1092  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1093  if ($fold->getType() == "stys") {
1094  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1095  $cont_style_settings = new ilContentStyleSettings();
1096  $cont_style_settings->addStyle($newObj->getId());
1097  $cont_style_settings->update();
1098  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1099  $this->ctrl->returnToParent($this);
1100  }
1101  }
1102  return $newObj->getId();
1103  }
$_GET["client_id"]
Import class.
redirection script todo: (a better solution should control the processing via a xml file) ...
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _writeStandard($a_id, $a_std)
Write standard flag.
Class ilObjStyleSheet.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$source
Definition: linkback.php:22
$info
Definition: index.php:5
+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

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

References ilObjStyleSheet\getContentStylePath(), and object.

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

190  {
191  // set style sheet
192  $this->tpl->setCurrentBlock("ContentStyle");
193  $this->tpl->setVariable(
194  "LOCATION_CONTENT_STYLESHEET",
196  );
197  $this->tpl->parseCurrentBlock();
198  }
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCharacteristicForm()

ilObjStyleSheetGUI::initCharacteristicForm (   $a_mode)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

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

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

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

1637  {
1638  $lng = $this->lng;
1639  $ilCtrl = $this->ctrl;
1640 
1641  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1642  $this->form_gui = new ilPropertyFormGUI();
1643 
1644  // title
1645  $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1646  $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1647  $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include") . " A-Z, a-z, 0-9");
1648  $txt_input->setRequired(true);
1649  $this->form_gui->addItem($txt_input);
1650 
1651  // type
1652  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1653  $types = $all_super_types[$this->super_type];
1654  $exp_types = array();
1655  foreach ($types as $t) {
1657  $exp_types[$t] = $lng->txt("sty_type_" . $t);
1658  }
1659  }
1660  if (count($exp_types) > 1) {
1661  $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1662  $type_input->setOptions($exp_types);
1663  $type_input->setValue(key($exp_types));
1664  $this->form_gui->addItem($type_input);
1665  } elseif (count($exp_types) == 1) {
1666  $hid_input = new ilHiddenInputGUI("type");
1667  $hid_input->setValue(key($exp_types));
1668  $this->form_gui->addItem($hid_input);
1669  }
1670 
1671  $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1672  $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1673  $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1674  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1675  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
setPattern($pattern)
set pattern
This class represents a hidden form property in a property form.
static _isExpandable($a_type)
This class represents a regular expression input property in a property form.
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
+ 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 1868 of file class.ilObjStyleSheetGUI.php.

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

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

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

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

Referenced by addImageObject(), and uploadImageObject().

1437  {
1438  $lng = $this->lng;
1439  $ilCtrl = $this->ctrl;
1440 
1441  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1442  $this->form_gui = new ilPropertyFormGUI();
1443 
1444  $this->form_gui->setTitle($lng->txt("sty_add_image"));
1445 
1446  $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1447  $file_input->setRequired(true);
1448  $this->form_gui->addItem($file_input);
1449 
1450  $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1451  $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1452  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1453  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents an image file property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMediaQueryForm()

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

Init media query form.

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

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

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

2096  {
2097  $lng = $this->lng;
2098  $ilCtrl = $this->ctrl;
2099 
2100  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2101  $this->form_gui = new ilPropertyFormGUI();
2102 
2103  $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2104 
2105  // media query
2106  $ti = new ilTextInputGUI("@media", "mquery");
2107  $ti->setMaxLength(2000);
2108  $this->form_gui->addItem($ti);
2109 
2110 
2111  if ($a_mode == "create") {
2112  $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2113  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2114  } else {
2115  $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2116  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2117  }
2118  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2119  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
+ Here is the caller graph for this function:

◆ initPropertiesForm()

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

FORM: Init properties form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by propertiesObject(), and updateObject().

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

◆ initTagStyleForm()

ilObjStyleSheetGUI::initTagStyleForm (   $a_mode,
  $a_cur_tag 
)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

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

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

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

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

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

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

2442  {
2443  $lng = $this->lng;
2444  $ilCtrl = $this->ctrl;
2445 
2446  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2447  $this->form_gui = new ilPropertyFormGUI();
2448 
2449  if ($a_mode == "create") {
2450  $this->form_gui->setTitle($lng->txt("sty_add_template"));
2451  } else {
2452  $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2453  }
2454 
2455  // name
2456  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2457  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2458  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
2459  $name_input->setRequired(true);
2460  $name_input->setSize(30);
2461  $name_input->setMaxLength(30);
2462  $this->form_gui->addItem($name_input);
2463 
2464  // template style classes
2465  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2466  foreach ($scs as $sc => $st) {
2467  $sc_input = new ilSelectInputGUI($lng->txt("sty_" . $sc . "_class"), $sc . "_class");
2468  $chars = $this->object->getCharacteristics($st);
2469  $options = array("" => "");
2470  foreach ($chars as $char) {
2471  $options[$char] = $char;
2472  }
2473  $sc_input->setOptions($options);
2474  $this->form_gui->addItem($sc_input);
2475  }
2476 
2477  if ($a_mode == "create") {
2478  $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2479  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2480  } else {
2481  $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2482  $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2483  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2484  }
2485  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2486  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
setPattern($pattern)
set pattern
This class represents a regular expression input property in a property form.
Create styles array
The data for the language used.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ 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 2723 of file class.ilObjStyleSheetGUI.php.

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

Referenced by generateTemplateObject(), and templateGenerationObject().

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

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

1817  {
1818  $tpl = $this->tpl;
1820  $ilToolbar = $this->toolbar;
1821  $ilCtrl = $this->ctrl;
1822 
1823  if ($this->checkWrite()) {
1824  $ilToolbar->addButton(
1825  $this->lng->txt("sty_add_color"),
1826  $ilCtrl->getLinkTarget($this, "addColor")
1827  );
1828  }
1829 
1830  include_once("./Services/Style/Content/classes/class.ilStyleColorTableGUI.php");
1831  $table_gui = new ilStyleColorTableGUI(
1832  $this,
1833  "listColors",
1834  $this->object
1835  );
1836  $tpl->setContent($table_gui->getHTML());
1837  }
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 1369 of file class.ilObjStyleSheetGUI.php.

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

1370  {
1371  $tpl = $this->tpl;
1372  $ilToolbar = $this->toolbar;
1373  $ilCtrl = $this->ctrl;
1374  $lng = $this->lng;
1376 
1377  if ($this->checkWrite()) {
1378  $ilToolbar->addButton(
1379  $lng->txt("sty_add_image"),
1380  $ilCtrl->getLinkTarget($this, "addImage")
1381  );
1382  }
1383 
1384  include_once("./Services/Style/Content/classes/class.ilStyleImageTableGUI.php");
1385  $table_gui = new ilStyleImageTableGUI(
1386  $this,
1387  "listImages",
1388  $this->object
1389  );
1390  $tpl->setContent($table_gui->getHTML());
1391  }
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 2043 of file class.ilObjStyleSheetGUI.php.

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

2044  {
2045  $tpl = $this->tpl;
2047  $ilToolbar = $this->toolbar;
2048  $ilCtrl = $this->ctrl;
2049 
2050  if ($this->checkWrite()) {
2051  $ilToolbar->addButton(
2052  $this->lng->txt("sty_add_media_query"),
2053  $ilCtrl->getLinkTarget($this, "addMediaQuery")
2054  );
2055  }
2056 
2057  include_once("./Services/Style/Content/classes/class.ilStyleMediaQueryTableGUI.php");
2058  $table_gui = new ilStyleMediaQueryTableGUI(
2059  $this,
2060  "listMediaQueries",
2061  $this->object
2062  );
2063  $tpl->setContent($table_gui->getHTML());
2064  }
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 2247 of file class.ilObjStyleSheetGUI.php.

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

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

◆ newStyleParameterObject()

ilObjStyleSheetGUI::newStyleParameterObject ( )

add style parameter

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

References $_POST, and editObject().

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

◆ outputTagStyleEditScreen()

ilObjStyleSheetGUI::outputTagStyleEditScreen ( )

Output tag style edit screen.

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

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

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

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

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

1783  {
1784  $ilCtrl = $this->ctrl;
1785  $lng = $this->lng;
1786 
1787  if (is_array($_POST["title"])) {
1788  foreach ($_POST["title"] as $from_char => $to_title) {
1789  $fc = explode(".", $from_char);
1790 
1791  if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1792  !$this->object->characteristicExists($to_title, $fc[0])) {
1793  $this->object->copyCharacteristic(
1794  $_POST["from_style_id"],
1795  $fc[0],
1796  $fc[2],
1797  $to_title
1798  );
1799  }
1800  }
1801  ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1802  unset($_SESSION["sty_copy"]);
1803  ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1804  }
1805 
1806  $ilCtrl->redirect($this, "edit");
1807  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
Create new PHPExcel object
obj_idprivate
$_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 1763 of file class.ilObjStyleSheetGUI.php.

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

1764  {
1765  $tpl = $this->tpl;
1766  $ilTabs = $this->tabs;
1767 
1768  $ilTabs->clearTargets();
1769 
1770  include_once("./Services/Style/Content/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1771  $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1772 
1773  $tpl->setContent($table->getHTML());
1774  }
if(empty($password)) $table
Definition: pwgen.php:24

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

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

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

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

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

918  {
919  $this->object->setTitle($_POST["style_title"]);
920  $this->object->setDescription($_POST["style_description"]);
921 
922  foreach ($_POST["styval"] as $id => $value) {
923  $this->object->updateStyleParameter($id, $value);
924  }
925  $this->object->update();
926  $this->editObject();
927  }
if(!array_key_exists('StateId', $_REQUEST)) $id
editObject()
edit style sheet
$_POST["username"]
+ Here is the call graph for this function:

◆ refreshTagStyleObject()

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

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

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

414  {
416 
417  $cur = explode(".", $_GET["tag"]);
418  $cur_tag = $cur[0];
419  $cur_class = $cur[1];
420 
421  $this->initTagStyleForm("edit", $cur_tag);
422 
423  if ($this->form_gui->checkInput()) {
424  $this->saveTagStyle();
425  $ilCtrl->redirect($this, "editTagStyle");
426  } else {
427  $this->form_gui->setValuesByPost();
428  $this->outputTagStyleEditScreen();
429  }
430  }
saveTagStyle()
Save tag style.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
global $ilCtrl
Definition: ilias.php:18
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
+ Here is the call graph for this function:

◆ refreshTemplateObject()

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

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

References updateTemplateObject().

2596  {
2597  $this->updateTemplateObject(true);
2598  }
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 3049 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

3050  {
3051  $ilCtrl = $this->ctrl;
3052 
3053  /*if ($_GET["baseClass"] == "ilAdministrationGUI")
3054  {
3055  $ilCtrl->redirectByClass("ilcontentstylesettingsgui", "edit");
3056  }*/
3057  $ilCtrl->returnToParent($this);
3058  }
global $ilCtrl
Definition: ilias.php:18

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

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

1604  {
1605  $ilCtrl = $this->ctrl;
1606  $tpl = $this->tpl;
1607  $lng = $this->lng;
1608 
1609  $this->initCharacteristicForm("create");
1610 
1611  if ($this->form_gui->checkInput()) {
1612  if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"])) {
1613  $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1614  $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1615  } else {
1616  $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1617  ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1618  $ilCtrl->setParameter(
1619  $this,
1620  "tag",
1621  ilObjStyleSheet::_determineTag($_POST["type"]) . "." . $_POST["new_characteristic"]
1622  );
1623  $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1624  $ilCtrl->redirect($this, "editTagStyle");
1625  }
1626  }
1627  $this->form_gui->setValuesByPost();
1628  $tpl->setContent($this->form_gui->getHTML());
1629  }
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.
Create new PHPExcel object
obj_idprivate
$_POST["username"]
+ Here is the call graph for this function:

◆ saveColorObject()

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

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

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

1929  {
1930  $tpl = $this->tpl;
1931  $ilCtrl = $this->ctrl;
1932  $lng = $this->lng;
1933 
1934  $this->initColorForm();
1935 
1936  if ($this->form_gui->checkInput()) {
1937  if ($this->object->colorExists($_POST["color_name"])) {
1938  $col_input = $this->form_gui->getItemByPostVar("color_name");
1939  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1940  } else {
1941  $this->object->addColor(
1942  $_POST["color_name"],
1943  $_POST["color_code"]
1944  );
1945  $ilCtrl->redirect($this, "listColors");
1946  }
1947  }
1948  $this->form_gui->setValuesByPost();
1949  $tpl->setContent($this->form_gui->getHTML());
1950  }
global $ilCtrl
Definition: ilias.php:18
Create new PHPExcel object
obj_idprivate
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 1715 of file class.ilObjStyleSheetGUI.php.

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

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

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

2140  {
2141  $tpl = $this->tpl;
2142  $ilCtrl = $this->ctrl;
2143  $lng = $this->lng;
2144 
2145  $this->initMediaQueryForm();
2146 
2147  if ($this->form_gui->checkInput()) {
2148  $this->object->addMediaQuery($_POST["mquery"]);
2149  $ilCtrl->redirect($this, "listMediaQueries");
2150  }
2151  $this->form_gui->setValuesByPost();
2152  $tpl->setContent($this->form_gui->getHTML());
2153  }
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 2229 of file class.ilObjStyleSheetGUI.php.

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

2230  {
2231  $ilCtrl = $this->ctrl;
2232 
2233  if (is_array($_POST["order"])) {
2234  $this->object->saveMediaQueryOrder($_POST["order"]);
2235  }
2236  $ilCtrl->redirect($this, "listMediaQueries");
2237  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

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

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

992  {
993  if (!trim($_POST["style_title"])) {
994  $this->ctrl->redirect($this, "create");
995  }
996 
997  //echo "HH"; exit;
998  $class_name = "ilObjStyleSheet";
999  require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1000  $newObj = new ilObjStyleSheet();
1001  $newObj->setTitle("-");
1002  $newObj->create();
1003  $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
1004  $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
1005  $newObj->update();
1006 
1007  // assign style to style sheet folder,
1008  // if parent is style sheet folder
1009  if ($_GET["ref_id"] > 0) {
1010  $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1011  if ($fold->getType() == "stys") {
1012  include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1013  $cont_style_settings = new ilContentStyleSettings();
1014  $cont_style_settings->addStyle($newObj->getId());
1015  $cont_style_settings->update();
1016 
1017  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1018  $this->ctrl->returnToParent($this);
1019  }
1020  }
1021 
1022  return $newObj->getId();
1023  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _writeStandard($a_id, $a_std)
Write standard flag.
Class ilObjStyleSheet.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_POST["username"]
+ Here is the call graph for this function:

◆ saveTagStyle()

ilObjStyleSheetGUI::saveTagStyle ( )

Save tag style.

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

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

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

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

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

2503  {
2504  $tpl = $this->tpl;
2505  $ilCtrl = $this->ctrl;
2506  $lng = $this->lng;
2507 
2508  $this->initTemplateForm();
2509 
2510  if ($this->form_gui->checkInput()) {
2511  if ($this->object->templateExists($_POST["name"])) {
2512  $name_input = $this->form_gui->getItemByPostVar("name");
2513  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2514  } else {
2515  $classes = array();
2516  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct) {
2517  $classes[$tct] = $_POST[$tct . "_class"];
2518  }
2519  $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2520  $this->object->writeTemplatePreview(
2521  $t_id,
2522  $this->getTemplatePreview($_GET["temp_type"], $t_id, true)
2523  );
2524  $ilCtrl->redirect($this, "listTemplates");
2525  }
2526  }
2527  $this->form_gui->setValuesByPost();
2528  $tpl->setContent($this->form_gui->getHTML());
2529  }
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.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$_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 1271 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editObject().

1272  {
1273  $lng = $this->lng;
1274  $ilTabs = $this->tabs;
1275  $ilCtrl = $this->ctrl;
1276 
1278 
1279  foreach ($types as $super_type => $types) {
1280  // text block characteristics
1281  $ilCtrl->setParameter($this, "style_type", $super_type);
1282  $ilTabs->addSubTabTarget(
1283  "sty_" . $super_type . "_char",
1284  $this->ctrl->getLinkTarget($this, "edit"),
1285  array("edit", ""),
1286  get_class($this)
1287  );
1288  }
1289 
1290  $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1291  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjStyleSheetGUI::setTabs ( )

output tabs

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

References ilObjectGUI\$lng, getTabs(), and object.

1139  {
1140  $lng = $this->lng;
1141 
1142  $this->getTabs($this->tabs_gui);
1143 
1144  if (strtolower(get_class($this->object)) == "ilobjstylesheet") {
1145  $this->tpl->setVariable("HEADER", $this->object->getTitle());
1146  } else {
1147  $this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
1148  }
1149  }
getTabs()
adds tabs to tab gui object
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

Referenced by listTemplatesObject().

1299  {
1300  $lng = $this->lng;
1301  $ilTabs = $this->tabs;
1302  $ilCtrl = $this->ctrl;
1303 
1305 
1306  foreach ($types as $t => $c) {
1307  $ilCtrl->setParameter($this, "temp_type", $t);
1308  $ilTabs->addSubTabTarget(
1309  "sty_" . $t . "_templates",
1310  $this->ctrl->getLinkTarget($this, "listTemplates"),
1311  array("listTemplates", ""),
1312  get_class($this)
1313  );
1314  }
1315 
1316  $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1317  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUpperIcon()

ilObjStyleSheetGUI::showUpperIcon ( )

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

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

1349  {
1350  $tree = $this->tree;
1351  $tpl = $this->tpl;
1353 
1354  if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
1355  $tpl->setUpperIcon(
1356  $this->ctrl->getLinkTargetByClass(
1357  "ilcontentstylesettings",
1358  "edit"
1359  )
1360  );
1361  } else {
1362  // ?
1363  }
1364  }
$_GET["client_id"]

◆ switchMQueryObject()

ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters

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

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

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

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

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

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

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

1956  {
1957  $tpl = $this->tpl;
1958  $ilCtrl = $this->ctrl;
1959  $lng = $this->lng;
1960 
1961  $this->initColorForm("edit");
1962 
1963  if ($this->form_gui->checkInput()) {
1964  if ($this->object->colorExists($_POST["color_name"]) &&
1965  $_POST["color_name"] != $_GET["c_name"]) {
1966  $col_input = $this->form_gui->getItemByPostVar("color_name");
1967  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1968  } else {
1969  $this->object->updateColor(
1970  $_GET["c_name"],
1971  $_POST["color_name"],
1972  $_POST["color_code"]
1973  );
1974  $ilCtrl->redirect($this, "listColors");
1975  }
1976  }
1977  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1978  $this->form_gui->setValuesByPost();
1979  $tpl->setContent($this->form_gui->getHTML());
1980  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Create new PHPExcel object
obj_idprivate
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 2158 of file class.ilObjStyleSheetGUI.php.

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

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

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

Update properties.

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

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

388  {
389  $lng = $this->lng;
391  $tpl = $this->tpl;
392 
393  $this->initPropertiesForm("edit");
394  if ($this->form->checkInput()) {
395  $this->object->setTitle($this->form->getInput("style_title"));
396  $this->object->setDescription($this->form->getInput("style_description"));
397  $this->object->writeStyleSetting(
398  "disable_auto_margins",
399  $this->form->getInput("disable_auto_margins")
400  );
401  $this->object->update();
402  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
403  $ilCtrl->redirect($this, "properties");
404  } else {
405  $this->form->setValuesByPost();
406  $tpl->setContent($this->form->getHtml());
407  }
408  }
global $ilCtrl
Definition: ilias.php:18
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ updateTagStyleObject()

ilObjStyleSheetGUI::updateTagStyleObject ( )

save and refresh tag editing

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

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

436  {
438 
439  $cur = explode(".", $_GET["tag"]);
440  $cur_tag = $cur[0];
441  $cur_class = $cur[1];
442 
443  $this->initTagStyleForm("edit", $cur_tag);
444  if ($this->form_gui->checkInput()) {
445  $this->saveTagStyle();
446  $ilCtrl->redirect($this, "edit");
447  } else {
448  $this->form_gui->setValuesByPost();
449  $this->outputTagStyleEditScreen();
450  }
451  }
saveTagStyle()
Save tag style.
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
global $ilCtrl
Definition: ilias.php:18
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
+ Here is the call graph for this function:

◆ updateTemplateObject()

ilObjStyleSheetGUI::updateTemplateObject (   $a_refresh = false)

Update table template.

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

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

Referenced by refreshTemplateObject().

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

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

1418  {
1419  $tpl = $this->tpl;
1420  $ilCtrl = $this->ctrl;
1421 
1422  $this->initImageForm();
1423 
1424  if ($this->form_gui->checkInput()) {
1425  $this->object->uploadImage($_FILES["image_file"]);
1426  $ilCtrl->redirect($this, "listImages");
1427  } else {
1428  //$this->form_gui->setImageFormValuesByPost();
1429  $tpl->setContent($this->form_gui->getHTML());
1430  }
1431  }
global $ilCtrl
Definition: ilias.php:18
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

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

References editObject().

100  {
101  $this->editObject();
102  }
editObject()
edit style sheet
+ Here is the call graph for this function:

◆ writeStylePar()

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

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

References $a_type.

Referenced by saveTagStyle().

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

Field Documentation

◆ $cmd_delete

ilObjStyleSheetGUI::$cmd_delete

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

◆ $cmd_new_par

ilObjStyleSheetGUI::$cmd_new_par

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

◆ $cmd_refresh

ilObjStyleSheetGUI::$cmd_refresh

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

◆ $cmd_update

ilObjStyleSheetGUI::$cmd_update

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

◆ $help

ilObjStyleSheetGUI::$help
protected

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

Referenced by createObject(), and getTabs().

◆ $obj_definition

ilObjStyleSheetGUI::$obj_definition
protected

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

Referenced by showUpperIcon().

◆ $rbacsystem

◆ $tabs

ilObjStyleSheetGUI::$tabs
protected

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