ILIAS  release_4-4 Revision
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

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

Public Member Functions

 ilObjStyleSheetGUI ($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...
 
 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)
 
 editTagStyleObject ()
 Edit tag style. 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)
 
 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...
 
 cancelObject ()
 update style sheet More...
 
 getAdminTabs (&$tabs_gui)
 admin and normal tabs are equal for roles More...
 
 setTabs ()
 output tabs More...
 
 getTabs (&$tabs_gui)
 adds tabs to tab gui object More...
 
 setSubTabs ()
 adds tabs to tab gui object More...
 
 setTemplatesSubTabs ()
 adds tabs to tab gui object More...
 
 addAdminLocatorItems ()
 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...
 
 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...
 
 _getTemplatePreview ($a_style, $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
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 editObject ()
 edit object More...
 
 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 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
 
 $ilias
 
 $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
 

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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

Member Function Documentation

◆ _getTemplatePreview()

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

Get table template preview.

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

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

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

1943  {
1944  global $lng, $tpl;
1945 
1946  $kr = $kc = 7;
1947  if ($a_small_mode)
1948  {
1949  $kr = 6;
1950  $kc = 5;
1951  }
1952 
1953  $ts = $a_style->getTemplate($a_t_id);
1954  $t = $ts["classes"];
1955 
1956  // preview
1957  if ($a_type == "table")
1958  {
1959  $p_content = '<PageContent><Table DataTable="y"';
1960  if ($t["row_head"] != "")
1961  {
1962  $p_content.= ' HeaderRows="1"';
1963  }
1964  if ($t["row_foot"] != "")
1965  {
1966  $p_content.= ' FooterRows="1"';
1967  }
1968  if ($t["col_head"] != "")
1969  {
1970  $p_content.= ' HeaderCols="1"';
1971  }
1972  if ($t["col_foot"] != "")
1973  {
1974  $p_content.= ' FooterCols="1"';
1975  }
1976  $p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
1977  if (!$a_small_mode)
1978  {
1979  $p_content.= '<Caption>'.$lng->txt("sty_caption").'</Caption>';
1980  }
1981  for($i = 1; $i<=$kr; $i++)
1982  {
1983  $p_content.= '<TableRow>';
1984  for($j = 1; $j<=$kc; $j++)
1985  {
1986  if ($a_small_mode)
1987  {
1988  $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
1989  }
1990  else
1991  {
1992  $cell = 'xxx';
1993  }
1994  $p_content.= '<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.'</Paragraph></PageContent></TableData>';
1995  }
1996  $p_content.= '</TableRow>';
1997  }
1998  $p_content.= '</Table></PageContent>';
1999  }
2000 
2001  if ($a_type == "vaccordion" || $a_type == "haccordion")
2002  {
2003  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2005 
2006  if ($a_small_mode)
2007  {
2008  $c = '&amp;nbsp;';
2009  $h = '&amp;nbsp;';
2010  }
2011  else
2012  {
2013  $c = 'xxx';
2014  $h = 'head';
2015  }
2016  if ($a_type == "vaccordion")
2017  {
2018  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2019  if ($a_small_mode)
2020  {
2021  $p_content.= ' ContentWidth="70"';
2022  }
2023  }
2024  else
2025  {
2026  $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
2027  if ($a_small_mode)
2028  {
2029  $p_content.= ' ContentHeight="40"';
2030  $p_content.= ' ContentWidth="70"';
2031  $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
2032  }
2033  else
2034  {
2035  $p_content.= ' ContentHeight="40"';
2036  }
2037  }
2038  $p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
2039  $p_content.= '<Tab><PageContent><Paragraph>'.$c.'</Paragraph></PageContent>';
2040  $p_content.= '<TabCaption>'.$h.'</TabCaption>';
2041  $p_content.= '</Tab>';
2042  $p_content.= '</Tabs></PageContent>';
2043  }
2044 //echo htmlentities($p_content);
2045  $txml = $a_style->getTemplateXML();
2046 //echo htmlentities($txml);
2047  $p_content.= $txml;
2048  include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
2049  $r_content = ilPCTableGUI::_renderTable($p_content, "");
2050 
2051  return $r_content;
2052  }
static addCss()
Add required css.
static _renderTable($content, $a_mode="table_edit", $a_submode="", $a_table_obj=null)
Static render table function.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accordiontestObject()

ilObjStyleSheetGUI::accordiontestObject ( )

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

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

2568  {
2569  global $tpl;
2570 
2571  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2572 
2573  $acc = new ilAccordionGUI();
2574  $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2575  $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2576  $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
2577 
2578  $ac2 = new ilAccordionGUI();
2579  $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2580  $ac2->addItem("Header 2", $acc->getHTML());
2581  $ac2->setOrientation(ilAccordionGUI::VERTICAL);
2582 
2583  $tpl->setContent($ac2->getHTML());
2584  }
Accordion user interface class.

◆ addAdminLocatorItems()

ilObjStyleSheetGUI::addAdminLocatorItems ( )

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

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

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

1163  {
1164  global $ilLocator;
1165 
1166  if ($_GET["admin_mode"] == "settings") // system settings
1167  {
1168  parent::addAdminLocatorItems(true);
1169 
1170  $ilLocator->addItem(ilObject::_lookupTitle(
1171  ilObject::_lookupObjId($_GET["ref_id"])),
1172  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "view"));
1173 
1174  if ($_GET["obj_id"] > 0)
1175  {
1176  $ilLocator->addItem($this->object->getTitle(),
1177  $this->ctrl->getLinkTarget($this, "edit"));
1178  }
1179  }
1180  else // repository administration
1181  {
1182  //?
1183  }
1184 
1185  }
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ addCharacteristicFormObject()

ilObjStyleSheetGUI::addCharacteristicFormObject ( )

Add characteristic.

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

References ilObjectGUI\$tpl, and initCharacteristicForm().

1437  {
1438  global $tpl;
1439 
1440  $this->initCharacteristicForm("create");
1441  $tpl->setContent($this->form_gui->getHTML());
1442  }
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 1676 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl, and initColorForm().

1677  {
1678  global $tpl;
1679 
1680  $this->initColorForm();
1681  $tpl->setContent($this->form_gui->getHTML());
1682  }
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ addImageObject()

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

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

References ilObjectGUI\$tpl, and initImageForm().

1227  {
1228  global $tpl;
1229 
1230  $this->initImageForm();
1231  $tpl->setContent($this->form_gui->getHTML());
1232  }
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

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

References ilObjectGUI\$tpl, and initTemplateForm().

1909  {
1910  global $tpl;
1911 
1912  $this->initTemplateForm();
1913  $tpl->setContent($this->form_gui->getHTML());
1914  }
initTemplateForm($a_mode="create")
Init table template form.
+ Here is the call graph for this function:

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

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

1403  {
1404  global $ilCtrl, $lng;
1405 
1406  ilUtil::sendInfo($lng->txt("action_aborted"), true);
1407  $ilCtrl->redirect($this, "edit");
1408  }
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 1850 of file class.ilObjStyleSheetGUI.php.

References $ilCtrl.

1851  {
1852  global $ilCtrl;
1853 
1854  $ilCtrl->redirect($this, "listColors");
1855  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

References $ilCtrl.

1755  {
1756  global $ilCtrl;
1757 
1758  $ilCtrl->redirect($this, "listColors");
1759  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

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

843  {
844  $this->ctrl->returnToParent($this);
845  }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

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

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

992  {
993  global $lng;
994 
995  ilUtil::sendInfo($lng->txt("msg_cancel"), true);
996  $this->ctrl->returnToParent($this);
997  }
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 2290 of file class.ilObjStyleSheetGUI.php.

References $ilCtrl.

2291  {
2292  global $ilCtrl;
2293 
2294  $ilCtrl->redirect($this, "listTemplates");
2295  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

References $ilCtrl.

2115  {
2116  global $ilCtrl;
2117 
2118  $ilCtrl->redirect($this, "listTemplates");
2119  }
global $ilCtrl
Definition: ilias.php:18

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

References $ilCtrl.

1238  {
1239  global $ilCtrl;
1240 
1241  $ilCtrl->redirect($this, "listImages");
1242  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

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

References ilObjectGUI\$ilias.

851  {
852  global $ilias;
853 
854  $this->object->delete();
855 
856  $this->ctrl->returnToParent($this);
857  }

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

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

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

1583  {
1584  global $ilCtrl, $lng;
1585 
1586  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1587  {
1588  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1589  }
1590  else
1591  {
1592  $style_cp = implode("::", $_POST["char"]);
1593  $style_cp = $this->object->getId().":::".$_GET["style_type"].":::".$style_cp;
1594  $_SESSION["sty_copy"] = $style_cp;
1595  ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1596  }
1597  $ilCtrl->redirect($this, "edit");
1598  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ copyStyleObject()

ilObjStyleSheetGUI::copyStyleObject ( )

save style sheet

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

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

918  {
919  global $ilias;
920 
921  if ($_POST["source_style"] > 0)
922  $style_obj =& $ilias->obj_factory->getInstanceByObjId($_POST["source_style"]);
923  $new_id = $style_obj->ilClone();
924 
925  // assign style to style sheet folder,
926  // if parent is style sheet folder
927  if ($_GET["ref_id"] > 0)
928  {
929 
930  $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
931  if ($fold->getType() == "stys")
932  {
933  $fold->addStyle($new_id);
934  $fold->update();
935  ilObjStyleSheet::_writeStandard($new_id, "1");
936  $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
937  }
938  }
939 
940  return $new_id;
941  }
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
_writeStandard($a_id, $a_std)
Write standard flag.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

create

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

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

82  {
83  global $rbacsystem, $lng, $tpl, $ilHelp;
84 
85  $forms = array();
86 
87 
88  $ilHelp->setScreenIdComponent("sty");
89  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
90 
91  // --- create
92 
93  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
94  $form = new ilPropertyFormGUI();
95  $form->setFormAction($this->ctrl->getFormAction($this));
96  $form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
97 
98  // title
99  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
100  $ti->setMaxLength(128);
101  $ti->setSize(40);
102  $ti->setRequired(true);
103  $form->addItem($ti);
104 
105  // description
106  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
107  $ta->setCols(40);
108  $ta->setRows(2);
109  $form->addItem($ta);
110 
111  $form->addCommandButton("save", $this->lng->txt("save"));
112  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
113 
114  $forms[] = $form;
115 
116 
117  // --- import
118 
119  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
120  $form = new ilPropertyFormGUI();
121  $form->setFormAction($this->ctrl->getFormAction($this));
122  $form->setTitle($this->lng->txt("sty_import_stylesheet"));
123 
124  // title
125  $ti = new ilFileInputGUI($this->lng->txt("import_file"), "stylefile");
126  $ti->setRequired(true);
127  $form->addItem($ti);
128 
129  $form->addCommandButton("importStyle", $this->lng->txt("import"));
130  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
131 
132  $forms[] = $form;
133 
134 
135  // --- clone
136 
137  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
138  $form = new ilPropertyFormGUI();
139  $form->setFormAction($this->ctrl->getFormAction($this));
140  $form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
141 
142  // source
143  $ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
144  $ti->setRequired(true);
146  $form->addItem($ti);
147 
148  $form->addCommandButton("copyStyle", $this->lng->txt("copy"));
149  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
150 
151  $forms[] = $form;
152 
153 
154  $this->tpl->setContent($this->getCreationFormsHTML($forms));
155  }
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.
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
_getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
This class represents a text area property in a property form.
const ID_PART_SCREEN
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ deleteCharacteristicConfirmationObject()

ilObjStyleSheetGUI::deleteCharacteristicConfirmationObject ( )

Characteristic deletion confirmation screen.

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

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

1310  {
1311  global $ilCtrl, $tpl, $lng;
1312 
1313 //var_dump($_POST);
1314 
1315  if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1316  {
1317  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1318  $ilCtrl->redirect($this, "edit");
1319  }
1320  else
1321  {
1322  // check whether there are any core style classes included
1323  $core_styles = ilObjStyleSheet::_getCoreStyles();
1324  foreach ($_POST["char"] as $char)
1325  {
1326  if (!empty($core_styles[$char]))
1327  {
1328  $this->deleteCoreCharMessage();
1329  return;
1330  }
1331  }
1332 
1333  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1334  $cgui = new ilConfirmationGUI();
1335  $cgui->setFormAction($ilCtrl->getFormAction($this));
1336  $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1337  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1338  $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1339 
1340  foreach ($_POST["char"] as $char)
1341  {
1342  $char_comp = explode(".", $char);
1343  $cgui->addItem("char[]", $char, $char_comp[2]);
1344  }
1345 
1346  $tpl->setContent($cgui->getHTML());
1347  }
1348  }
$_POST['username']
Definition: cron.php:12
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.
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteCharacteristicObject()

ilObjStyleSheetGUI::deleteCharacteristicObject ( )

Delete one or multiple style characteristic.

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

References $_POST, and $ilCtrl.

1414  {
1415  global $ilCtrl;
1416 
1417  if (is_array($_POST["char"]))
1418  {
1419  foreach($_POST["char"] as $char)
1420  {
1421  $char_comp = explode(".", $char);
1422  $type = $char_comp[0];
1423  $tag = $char_comp[1];
1424  $class = $char_comp[2];
1425 
1426  $this->object->deleteCharacteristic($type, $tag, $class);
1427  }
1428  }
1429 
1430  $ilCtrl->redirect($this, "edit");
1431  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

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

1821  {
1822  global $ilCtrl, $tpl, $lng;
1823 
1824  if (!is_array($_POST["color"]) || count($_POST["color"]) == 0)
1825  {
1826  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1827  $ilCtrl->redirect($this, "listColors");
1828  }
1829  else
1830  {
1831  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1832  $cgui = new ilConfirmationGUI();
1833  $cgui->setFormAction($ilCtrl->getFormAction($this));
1834  $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
1835  $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
1836  $cgui->setConfirm($lng->txt("delete"), "deleteColor");
1837 
1838  foreach ($_POST["color"] as $c)
1839  {
1840  $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
1841  }
1842 
1843  $tpl->setContent($cgui->getHTML());
1844  }
1845  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteColorObject()

ilObjStyleSheetGUI::deleteColorObject ( )

Delete colors.

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

References $_POST, and $ilCtrl.

1861  {
1862  global $ilCtrl;
1863 
1864  if (is_array($_POST["color"]))
1865  {
1866  foreach ($_POST["color"] as $c)
1867  {
1868  $this->object->removeColor($c);
1869  }
1870  }
1871 
1872  $ilCtrl->redirect($this, "listColors");
1873  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

◆ deleteCoreCharMessage()

ilObjStyleSheetGUI::deleteCoreCharMessage ( )

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

Parameters

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

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

Referenced by deleteCharacteristicConfirmationObject().

1357  {
1358  global $ilCtrl, $tpl, $lng;
1359 
1360  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1361  $cgui = new ilConfirmationGUI();
1362  $cgui->setFormAction($ilCtrl->getFormAction($this));
1363 
1364 
1365  $core_styles = ilObjStyleSheet::_getCoreStyles();
1366  $cnt = 0;
1367  foreach ($_POST["char"] as $char)
1368  {
1369  if (!empty($core_styles[$char]))
1370  {
1371  $cnt++;
1372  $char_comp = explode(".", $char);
1373  $cgui->addItem("", "", $char_comp[2]);
1374  }
1375  else
1376  {
1377  $cgui->addHiddenItem("char[]", $char);
1378  }
1379  }
1380  $all_core_styles = ($cnt == count($_POST["char"]))
1381  ? true
1382  : false;
1383 
1384  if ($all_core_styles)
1385  {
1386  $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1387  $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1388  }
1389  else
1390  {
1391  $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1392  $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1393  $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1394  }
1395 
1396  $tpl->setContent($cgui->getHTML());
1397  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static _getCoreStyles()
Get core styles.
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 1290 of file class.ilObjStyleSheetGUI.php.

References $_POST, and $ilCtrl.

1291  {
1292  global $ilCtrl;
1293 
1294  $images = $this->object->getImages();
1295 
1296  foreach ($images as $image)
1297  {
1298  if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"]))
1299  {
1300  $this->object->deleteImage($image["entry"]);
1301  }
1302  }
1303  $ilCtrl->redirect($this, "listImages");
1304  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

public

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

References ilUtil\getImageTagByType().

819  {
820  //$this->setTabs();
821 
822  // display confirmation message
823  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
824  $cgui = new ilConfirmationGUI();
825  $cgui->setFormAction($this->ctrl->getFormAction($this));
826  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
827  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
828  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
829 
830  $caption = ilUtil::getImageTagByType("styf", $this->tpl->tplPath).
831  " ".ilObject::_lookupTitle($this->object->getId());
832 
833  $cgui->addItem("id[]", "", $caption);
834 
835  $this->tpl->setContent($cgui->getHTML());
836  }
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...
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteStyleParameterObject()

ilObjStyleSheetGUI::deleteStyleParameterObject ( )

delete style parameters

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

References $_POST, and editObject().

863  {
864  if (is_array($_POST["sty_select"]))
865  {
866  foreach($_POST["sty_select"] as $id => $dummy)
867  {
868  $this->object->deleteParameter($id);
869  }
870  }
871  $this->object->read();
872  $this->object->writeCSSFile();
873  $this->editObject();
874  }
$_POST['username']
Definition: cron.php:12
editObject()
edit style sheet
+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

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

2242  {
2243  global $ilCtrl, $tpl, $lng;
2244 
2245  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
2246  {
2247  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2248  $ilCtrl->redirect($this, "listTemplates");
2249  }
2250  else
2251  {
2252  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2253  $cgui = new ilConfirmationGUI();
2254  $cgui->setFormAction($ilCtrl->getFormAction($this));
2255  $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2256  $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2257  $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2258 
2259  foreach ($_POST["tid"] as $tid)
2260  {
2261  $classes = $this->object->getTemplateClasses($tid);
2262  $cl_str = "";
2263  $listed = array();
2264  foreach ($classes as $cl)
2265  {
2266  if ($cl != "" && !$listed[$cl])
2267  {
2268  $cl_str.= '<div>- '.
2269  $cl."</div>";
2270  $listed[$cl] = true;
2271  }
2272  }
2273  if ($cl_str != "")
2274  {
2275  $cl_str = '<div style="padding-left:30px;" class="small">'.
2276  "<div><i>".$lng->txt("sty_style_class")."</i></div>".$cl_str."</div>";
2277  }
2278  $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2279  }
2280 
2281  $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2282 
2283  $tpl->setContent($cgui->getHTML());
2284  }
2285  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteTemplateKeepClassesObject()

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

Delete table template.

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

References $_POST, and $ilCtrl.

2301  {
2302  global $ilCtrl;
2303 
2304  if (is_array($_POST["tid"]))
2305  {
2306  foreach ($_POST["tid"] as $tid)
2307  {
2308  $this->object->removeTemplate($tid);
2309  }
2310  }
2311 
2312  $ilCtrl->redirect($this, "listTemplates");
2313  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

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

2319  {
2320  global $ilCtrl;
2321 
2322  if (is_array($_POST["tid"]))
2323  {
2324  foreach ($_POST["tid"] as $tid)
2325  {
2326  $cls = $this->object->getTemplateClasses($tid);
2327  foreach ($cls as $k => $cls)
2328  {
2329  $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2330  $ta = ilObjStyleSheet::_determineTag($ty);
2331  $this->object->deleteCharacteristic($ty, $ta, $cls);
2332  }
2333  $this->object->removeTemplate($tid);
2334  }
2335  }
2336 
2337  $ilCtrl->redirect($this, "listTemplates");
2338  }
$_POST['username']
Definition: cron.php:12
static _determineTag($a_type)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ displayTemplateEditForm()

ilObjStyleSheetGUI::displayTemplateEditForm ( )

Display table tempalte edit form.

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

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

Referenced by editTemplateObject(), and updateTemplateObject().

2200  {
2201  global $tpl;
2202 
2203  $a_tpl = new ilTemplate("tpl.template_edit.html", true, true,
2204  "Services/Style");
2205  $this->includeCSS();
2206  $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2207  $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2208  $tpl->setContent($a_tpl->get());
2209  }
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 1687 of file class.ilObjStyleSheetGUI.php.

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

1688  {
1689  global $tpl, $ilCtrl;
1690 
1691  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1692  $this->initColorForm("edit");
1693  $this->getColorFormValues();
1694  $tpl->setContent($this->form_gui->getHTML());
1695  }
$_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:

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

edit style sheet

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

References $_GET, $_SESSION, $ilCtrl, ilObjectGUI\$lng, $t, ilObjectGUI\$tpl, ilObjStyleSheet\_getStyleSuperTypes(), ilObjStyleSheet\_isExpandable(), includeCSS(), and setSubTabs().

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

173  {
174  global $rbacsystem, $lng, $ilTabs, $ilCtrl, $ilToolbar, $tpl;
175 
176  $this->setSubTabs();
177 
178  $this->includeCSS();
179 
180  $ctpl = new ilTemplate("tpl.sty_classes.html", true, true, "Services/Style");
181 
182  // output characteristics
183  $chars = $this->object->getCharacteristics();
184 
185  $style_type = ($this->super_type != "")
186  ? $this->super_type
187  : "text_block";
188  $ilCtrl->setParameter($this, "style_type", $style_type);
189  $ilTabs->setSubTabActive("sty_".$style_type."_char");
190 
191  // workaround to include default rte styles
192  if ($this->super_type == "rte")
193  {
194  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
195  include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
196  $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
197  }
198 
199  // add new style?
200  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
201  $subtypes = $all_super_types[$style_type];
202  $expandable = false;
203  foreach ($subtypes as $t)
204  {
206  {
207  $expandable = true;
208  }
209  }
210  if ($expandable && $rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
211  {
212  $ilToolbar->addButton($lng->txt("sty_add_characteristic"),
213  $ilCtrl->getLinkTarget($this, "addCharacteristicForm"));
214  }
215 
216  if ($_SESSION["sty_copy"] != "")
217  {
218  $style_cp = explode(":::", $_SESSION["sty_copy"]);
219  if ($style_cp[1] == $_GET["style_type"])
220  {
221  if ($expandable)
222  {
223  $ilToolbar->addSeparator();
224  }
225  $ilToolbar->addButton($lng->txt("sty_paste_style_classes"),
226  $ilCtrl->getLinkTarget($this, "pasteCharacteristicsOverview"));
227  }
228  }
229 
230  include_once("./Services/Style/classes/class.ilStyleTableGUI.php");
231  $table_gui = new ilStyleTableGUI($this, "edit", $chars, $style_type,
232  $this->object);
233 
234  $ctpl->setCurrentBlock("style_table");
235  $ctpl->setVariable("STYLE_TABLE", $table_gui->getHTML());
236  $ctpl->parseCurrentBlock();
237 
238  $this->tpl->setContent($ctpl->get());
239  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setSubTabs()
adds tabs to tab gui object
$_GET["client_id"]
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 513 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$tpl, getValues(), initTagStyleForm(), and outputTagStyleEditScreen().

514  {
515  global $tpl;
516 
517  // workaround to include default rte styles
518  //if (in_array($_GET["style_type"], array("rte_menu")))
519  if ($this->super_type == "rte")
520  {
521  $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
522  include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
523  $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
524  }
525 
526  $cur = explode(".",$_GET["tag"]);
527  $cur_tag = $cur[0];
528  $cur_class = $cur[1];
529 
530  $this->initTagStyleForm("edit", $cur_tag);
531  $this->getValues();
532  $this->outputTagStyleEditScreen();
533  }
$_GET["client_id"]
outputTagStyleEditScreen()
Output tag style edit screen.
getValues()
FORM: Get current values from persistent object.
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
+ Here is the call graph for this function:

◆ editTemplateObject()

ilObjStyleSheetGUI::editTemplateObject ( )

Edit table template.

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

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

1920  {
1921  global $tpl, $ilCtrl;
1922 
1923  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
1924  $this->initTemplateForm("edit");
1925  $this->getTemplateFormValues();
1926 
1927  $this->displayTemplateEditForm();
1928  }
$_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 50 of file class.ilObjStyleSheetGUI.php.

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

51  {
52  $next_class = $this->ctrl->getNextClass($this);
53  $cmd = $this->ctrl->getCmd("edit");
54 
55  // #9440/#9489: prepareOutput will fail if not set properly
56  if(!$this->object)
57  {
58  $this->setCreationMode(true);
59  }
60 
61  $this->prepareOutput();
62  switch($next_class)
63  {
64  default:
65  $cmd.= "Object";
66  $ret =& $this->$cmd();
67  break;
68  }
69 
70  return $ret;
71  }
$cmd
Definition: sahs_server.php:35
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()
prepare output
+ Here is the call graph for this function:

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

export style

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

References $file, and ilUtil\deliverFile().

765  {
766  $file = $this->object->export();
767 
768  ilUtil::deliverFile($file, "sty_".$this->object->getId().".zip");
769  }
print $file
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 
)

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

Referenced by getValues().

772  {
773  $parameters = array();
774  foreach($a_style as $tag)
775  {
776  foreach($tag as $par)
777  {
778  if ($par["tag"] == $a_tag && $par["class"] == $a_class
779  && $par["type"] == $a_type)
780  {
781  $parameters[$par["parameter"]] = $par["value"];
782  }
783  }
784  }
785  return $parameters;
786  }
+ Here is the caller graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

2344  {
2345  global $tpl;
2346 
2347  $this->initTemplateGenerationForm();
2348  $tpl->setContent($this->form_gui->getHTML());
2349  }
initTemplateGenerationForm()
Init table template generation form.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSheetGUI::getAdminTabs ( $tabs_gui)

admin and normal tabs are equal for roles

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

References getTabs().

1003  {
1004  $this->getTabs($tabs_gui);
1005  }
getTabs(&$tabs_gui)
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 1741 of file class.ilObjStyleSheetGUI.php.

References $_GET.

Referenced by editColorObject().

1742  {
1743  if ($_GET["c_name"] != "")
1744  {
1745  $values["color_name"] = $_GET["c_name"];
1746  $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1747  $this->form_gui->setValuesByArray($values);
1748  }
1749  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

Referenced by propertiesObject().

268  {
269  $values = array();
270 
271  $values["style_title"] = $this->object->getTitle();
272  $values["style_description"] = $this->object->getDescription();
273  $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
274 
275  $this->form->setValuesByArray($values);
276  }
+ Here is the caller graph for this function:

◆ getStyleExampleHTML()

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

Get style example HTML.

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

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

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

1528  {
1529  global $lng;
1530 
1531  $c = explode(":", $a_class);
1532  $a_class = $c[0];
1533 
1534  $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style");
1535 
1536  $ex_tpl->setCurrentBlock("Example_".$a_type);
1537  $ex_tpl->setVariable("EX_CLASS", "ilc_".$a_type."_".$a_class);
1538  $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1539  if (in_array($a_type, array("media_cont", "qimg")))
1540  {
1541  $ex_tpl->setVariable("IMG_MEDIA_DISABLED", ilUtil::getImagePath("media_disabled.png"));
1542  }
1543  if (in_array($a_type, array("table", "table_caption")))
1544  {
1545  $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1546  }
1547  if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal")))
1548  {
1549  $ex_tpl->setVariable("HOR", "Horizontal");
1550  }
1551  $ex_tpl->parseCurrentBlock();
1552 
1553  return $ex_tpl->get();
1554  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjStyleSheetGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, and $t.

Referenced by getAdminTabs(), and setTabs().

1032  {
1033  global $lng, $ilCtrl, $ilTabs, $ilHelp;
1034 
1035  $ilHelp->setScreenIdComponent("sty");
1036 
1037  if ($ilCtrl->getCmd() == "editTagStyle")
1038  {
1039  // back to upper context
1040  $tabs_gui->setBackTarget($lng->txt("back"),
1041  $ilCtrl->getLinkTarget($this, "edit"));
1042 
1043  $t = explode(".", $_GET["tag"]);
1044  $t2 = explode(":", $t[1]);
1045  $pc = $this->object->_getPseudoClasses($t[0]);
1046  if (is_array($pc) && count($pc) > 0)
1047  {
1048  // style classes
1049  $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0]);
1050  $tabs_gui->addTarget("sty_tag_normal",
1051  $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1052  get_class($this));
1053  if ($t2[1] == "")
1054  {
1055  $ilTabs->setTabActive("sty_tag_normal");
1056  }
1057 
1058  foreach ($pc as $p)
1059  {
1060  // style classes
1061  $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0].":".$p);
1062  $tabs_gui->addTarget("sty_tag_".$p,
1063  $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1064  get_class($this));
1065  if ($t2[1] == $p)
1066  {
1067  $ilTabs->setTabActive("sty_tag_".$p);
1068  }
1069  }
1070  $ilCtrl->setParameter($this, "tag", $_GET["tag"]);
1071  }
1072  }
1073  else
1074  {
1075  // back to upper context
1076  $tabs_gui->setBackTarget($lng->txt("back"),
1077  $this->ctrl->getLinkTarget($this, "returnToUpperContext"));
1078 
1079  // style classes
1080  $tabs_gui->addTarget("sty_style_chars",
1081  $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1082  get_class($this));
1083 
1084  // colors
1085  $tabs_gui->addTarget("sty_colors",
1086  $this->ctrl->getLinkTarget($this, "listColors"), "listColors",
1087  get_class($this));
1088 
1089  // images
1090  $tabs_gui->addTarget("sty_images",
1091  $this->ctrl->getLinkTarget($this, "listImages"), "listImages",
1092  get_class($this));
1093 
1094  // table templates
1095  $tabs_gui->addTarget("sty_templates",
1096  $this->ctrl->getLinkTarget($this, "listTemplates"), "listTemplates",
1097  get_class($this));
1098 
1099  // settings
1100  $tabs_gui->addTarget("settings",
1101  $this->ctrl->getLinkTarget($this, "properties"), "properties",
1102  get_class($this));
1103 
1104  // accordiontest
1105 /*
1106  $tabs_gui->addTarget("accordiontest",
1107  $this->ctrl->getLinkTarget($this, "accordiontest"), "accordiontest",
1108  get_class($this));*/
1109  }
1110 
1111  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

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

Referenced by editTemplateObject().

2223  {
2224  if ($_GET["t_id"] > 0)
2225  {
2226  $t = $this->object->getTemplate($_GET["t_id"]);
2227 
2228  $values["name"] = $t["name"];
2229  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2230  foreach ($scs as $k => $type)
2231  {
2232  $values[$k."_class"] = $t["classes"][$k];
2233  }
2234  $this->form_gui->setValuesByArray($values);
2235  }
2236  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_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 1933 of file class.ilObjStyleSheetGUI.php.

References _getTemplatePreview().

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

1934  {
1935  return $this->_getTemplatePreview(
1936  $this->object, $a_type, $a_t_id, $a_small_mode);
1937  }
_getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilObjStyleSheetGUI::getValues ( )

FORM: Get current values from persistent object.

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

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

Referenced by editTagStyleObject().

720  {
721  $style = $this->object->getStyle();
722  $cur = explode(".",$_GET["tag"]);
723  $cur_tag = $cur[0];
724  $cur_class = $cur[1];
725  $cur_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"]);
726 
727  $parameters = ilObjStyleSheet::_getStyleParameters();
728  foreach($parameters as $p => $v)
729  {
730  $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
731  if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]]))
732  {
733  continue;
734  }
735  $p = explode(".", $p);
736  $p = $p[0];
737  $input = $this->form_gui->getItemByPostVar($p);
738  switch ($v["input"])
739  {
740  case "":
741  break;
742 
743  case "trbl_numeric":
744  case "border_width":
745  case "border_style":
746  case "trbl_color":
747  $input->setAllValue($cur_parameters[$v["subpar"][0]]);
748  $input->setTopValue($cur_parameters[$v["subpar"][1]]);
749  $input->setRightValue($cur_parameters[$v["subpar"][2]]);
750  $input->setBottomValue($cur_parameters[$v["subpar"][3]]);
751  $input->setLeftValue($cur_parameters[$v["subpar"][4]]);
752  break;
753 
754  default:
755  $input->setValue($cur_parameters[$p]);
756  break;
757  }
758  }
759  }
$_GET["client_id"]
extractParametersOfTag($a_tag, $a_class, $a_style, $a_type)
static _getStyleParameters($a_tag="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilObjStyleSheetGUI()

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

Constructor public.

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

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

31  {
32  global $ilCtrl, $lng, $tpl;
33 
34  $this->ctrl =& $ilCtrl;
35  $this->lng =& $lng;
36  $this->lng->loadLanguageModule("style");
37  $ilCtrl->saveParameter($this, array("tag", "style_type", "temp_type"));
38  if ($_GET["style_type"] != "")
39  {
40  $this->super_type = ilObjStyleSheet::_getStyleSuperTypeForType($_GET["style_type"]);
41  }
42 
43  $this->type = "sty";
44  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
45  }
$_GET["client_id"]
static _getStyleSuperTypeForType($a_type)
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ importStyleObject()

ilObjStyleSheetGUI::importStyleObject ( )

import style sheet

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

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

947  {
948  // check file
949  $source = $_FILES["stylefile"]["tmp_name"];
950  if (($source == 'none') || (!$source))
951  {
952  $this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
953  }
954 
955  // check correct file type
956  $info = pathinfo($_FILES["stylefile"]["name"]);
957  if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml")
958  {
959  $this->ilias->raiseError("File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
960  }
961 
962  $class_name = "ilObjStyleSheet";
963  require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
964  $newObj = new ilObjStyleSheet();
965  //$newObj->setTitle();
966  //$newObj->setDescription($_POST["style_description"]);
967  $newObj->import($_FILES["stylefile"]);
968  //$newObj->createFromXMLFile($_FILES["stylefile"]["tmp_name"]);
969 
970  // assign style to style sheet folder,
971  // if parent is style sheet folder
972  if ($_GET["ref_id"] > 0)
973  {
974 
975  $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
976  if ($fold->getType() == "stys")
977  {
978  $fold->addStyle($newObj->getId());
979  $fold->update();
980  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
981  $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
982  }
983  }
984 
985  return $newObj->getId();
986  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
_writeStandard($a_id, $a_std)
Write standard flag.
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilObjStyleSheet.
+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

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

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

161  {
162  // set style sheet
163  $this->tpl->setCurrentBlock("ContentStyle");
164  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
165  $this->object->getContentStylePath($this->object->getId()));
166  $this->tpl->parseCurrentBlock();
167  }
+ 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 1479 of file class.ilObjStyleSheetGUI.php.

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

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

1480  {
1481  global $lng, $ilCtrl;
1482 
1483  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1484  $this->form_gui = new ilPropertyFormGUI();
1485 
1486  // title
1487  $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1488  $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1489  $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include")." A-Z, a-z, 1-9");
1490  $txt_input->setRequired(true);
1491  $this->form_gui->addItem($txt_input);
1492 
1493  // type
1494  $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1495  $types = $all_super_types[$this->super_type];
1496  $exp_types = array();
1497  foreach($types as $t)
1498  {
1500  {
1501  $exp_types[$t] = $lng->txt("sty_type_".$t);
1502  }
1503  }
1504  if (count($exp_types) > 1)
1505  {
1506  $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1507  $type_input->setOptions($exp_types);
1508  $type_input->setValue(key($exp_types));
1509  $this->form_gui->addItem($type_input);
1510  }
1511  else if (count($exp_types) == 1)
1512  {
1513  $hid_input = new ilHiddenInputGUI("type");
1514  $hid_input->setValue(key($exp_types));
1515  $this->form_gui->addItem($hid_input);
1516  }
1517 
1518  $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1519  $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1520  $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1521  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1522  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
setPattern($pattern)
set pattern
This class represents a hidden form property in a property form.
static _isExpandable($a_type)
This class represents a regular expression input property in a property form.
setOptions($a_options)
Set Options.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initColorForm()

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

Init color form.

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

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

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

1702  {
1703  global $lng, $ilCtrl;
1704 
1705  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1706  $this->form_gui = new ilPropertyFormGUI();
1707 
1708  $this->form_gui->setTitle($lng->txt("sty_add_color"));
1709 
1710  // name
1711  $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1712  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1713  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
1714  $name_input->setRequired(true);
1715  $name_input->setSize(15);
1716  $name_input->setMaxLength(15);
1717  $this->form_gui->addItem($name_input);
1718 
1719  // code
1720  $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1721  $color_input->setRequired(true);
1722  $color_input->setDefaultColor("");
1723  $this->form_gui->addItem($color_input);
1724 
1725  if ($a_mode == "create")
1726  {
1727  $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1728  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1729  }
1730  else
1731  {
1732  $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1733  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1734  }
1735  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1736  }
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 1269 of file class.ilObjStyleSheetGUI.php.

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

Referenced by addImageObject(), and uploadImageObject().

1270  {
1271  global $lng, $ilCtrl;
1272 
1273  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1274  $this->form_gui = new ilPropertyFormGUI();
1275 
1276  $this->form_gui->setTitle($lng->txt("sty_add_image"));
1277 
1278  $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1279  $file_input->setRequired(true);
1280  $this->form_gui->addItem($file_input);
1281 
1282  $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1283  $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1284  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1285  }
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:

◆ initPropertiesForm()

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

FORM: Init properties form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by propertiesObject(), and updateObject().

284  {
285  global $lng, $rbacsystem;
286 
287  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
288  $this->form = new ilPropertyFormGUI();
289 
290  // title
291  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
292  $ti->setMaxLength(128);
293  $ti->setSize(40);
294  $ti->setRequired(true);
295  $this->form->addItem($ti);
296 
297  // description
298  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
299  //$ta->setCols();
300  //$ta->setRows();
301  $this->form->addItem($ta);
302 
303  // disable automatic margins for left/right alignment
304  $cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
305  $cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
306  $this->form->addItem($cb);
307 
308  // save and cancel commands
309 
310  if ($a_mode == "create")
311  {
312  $this->form->addCommandButton("save", $lng->txt("save"));
313  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
314  }
315  else
316  {
317  if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
318  {
319  $this->form->addCommandButton("update", $lng->txt("save"));
320  }
321  }
322 
323  $this->form->setTitle($lng->txt("edit_stylesheet"));
324  $this->form->setFormAction($this->ctrl->getFormAction($this));
325 
326  }
This class represents a property form user interface.
$_GET["client_id"]
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 570 of file class.ilObjStyleSheetGUI.php.

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

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

571  {
572  global $lng;
573 
574  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
575  $this->form_gui = new ilPropertyFormGUI();
576 
577  $avail_pars = $this->object->getAvailableParameters();
578  $groups = $this->object->getStyleParameterGroups();
579 
580  // output select lists
581  foreach ($groups as $k => $group)
582  {
583  // filter groups of properties that should only be
584  // displayed with matching tag
585  $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
586  if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
587  {
588  continue;
589  }
590 
591  $sh = new ilFormSectionHeaderGUI();
592  $sh->setTitle($lng->txt("sty_".$k));
593  $this->form_gui->addItem($sh);
594 
595  foreach ($group as $par)
596  {
597  $basepar = explode(".", $par);
598  $basepar = $basepar[0];
599 
600  $var = str_replace("-", "_", $basepar);
601  $up_par = strtoupper($var);
602 
604  {
605  case "select":
606  $sel_input = new ilSelectInputGUI($lng->txt("sty_".$var), $basepar);
607  $options = array("" => "");
608  foreach ($avail_pars[$par] as $p)
609  {
610  $options[$p] = $p;
611  }
612  $sel_input->setOptions($options);
613  $this->form_gui->addItem($sel_input);
614  break;
615 
616  case "text":
617  $text_input = new ilTextInputGUI($lng->txt("sty_".$var), $basepar);
618  $text_input->setMaxLength(200);
619  $text_input->setSize(20);
620  $this->form_gui->addItem($text_input);
621  break;
622 
623  case "fontsize":
624  include_once("./Services/Style/classes/class.ilFontSizeInputGUI.php");
625  $fs_input = new ilFontSizeInputGUI($lng->txt("sty_".$var), $basepar);
626  $this->form_gui->addItem($fs_input);
627  break;
628 
629  case "numeric_no_perc":
630  case "numeric":
631  include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
632  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
633  if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc")
634  {
635  $num_input->setAllowPercentage(false);
636  }
637  $this->form_gui->addItem($num_input);
638  break;
639 
640  case "percentage":
641  $per_input = new ilNumberInputGUI($lng->txt("sty_".$var), $basepar);
642  $per_input->setMinValue(0);
643  $per_input->setMaxValue(100);
644  $per_input->setMaxLength(3);
645  $per_input->setSize(3);
646  $this->form_gui->addItem($per_input);
647  break;
648 
649  case "color":
650  //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
651  $col_input = new ilColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
652  $col_input->setDefaultColor("");
653  $col_input->setAcceptNamedColors(true);
654  $this->form_gui->addItem($col_input);
655  break;
656 
657  case "trbl_numeric":
658  include_once("./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
659  $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
660  if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc")
661  {
662  $num_input->setAllowPercentage(false);
663  }
664  $this->form_gui->addItem($num_input);
665  break;
666 
667  case "border_width":
668  include_once("./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
669  $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_".$var), $basepar);
670  $this->form_gui->addItem($bw_input);
671  break;
672 
673  case "border_style":
674  include_once("./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
675  $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_".$var), $basepar);
676  $this->form_gui->addItem($bw_input);
677  break;
678 
679  case "trbl_color":
680  include_once("./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
681  $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
682  $col_input->setAcceptNamedColors(true);
683  $this->form_gui->addItem($col_input);
684  break;
685 
686  case "background_image":
687  include_once("./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
688  $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_".$var), $basepar);
689  $imgs = array();
690  foreach ($this->object->getImages() as $entry)
691  {
692  $imgs[] = $entry["entry"];
693  }
694  $im_input->setImages($imgs);
695  $this->form_gui->addItem($im_input);
696  break;
697 
698  case "background_position":
699  include_once("./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
700  $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_".$var), $basepar);
701  $this->form_gui->addItem($im_input);
702  break;
703  }
704  }
705  }
706 
707  // save and cancel commands
708  $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
709  $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
710 
711 // $this->form_gui->setTitle($lng->txt("edit"));
712  $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
713  }
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.
This class represents a border style with all/top/right/bottom/left in a property form...
if(!is_array($argv)) $options
This class represents a number property in a property form.
This class represents a border width with all/top/right/bottom/left in a property form...
This class represents a text property in a property form.
setDefaultColor($a_defaultcolor)
Set Default Color.
setMaxLength($a_maxlength)
Set Max Length.
setOptions($a_options)
Set Options.
This class represents a fint size property in a property form.
This class represents a numeric style property with all/top/right/bottom/left in a property form...
setAcceptNamedColors($a_acceptnamedcolors)
Set Accept Named Colors (Leading &#39;!&#39;).
This class represents a background image property in a property form.
This class represents a background position in a property form.
static _getStyleParameterInputType($par)
setMinValue($a_minvalue)
Set Minimum Value.
+ 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 2057 of file class.ilObjStyleSheetGUI.php.

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

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

2058  {
2059  global $lng, $ilCtrl;
2060 
2061  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2062  $this->form_gui = new ilPropertyFormGUI();
2063 
2064  if ($a_mode == "create")
2065  {
2066  $this->form_gui->setTitle($lng->txt("sty_add_template"));
2067  }
2068  else
2069  {
2070  $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2071  }
2072 
2073  // name
2074  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2075  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2076  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2077  $name_input->setRequired(true);
2078  $name_input->setSize(30);
2079  $name_input->setMaxLength(30);
2080  $this->form_gui->addItem($name_input);
2081 
2082  // template style classes
2083  $scs = ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]);
2084  foreach ($scs as $sc => $st)
2085  {
2086  $sc_input = new ilSelectInputGUI($lng->txt("sty_".$sc."_class"), $sc."_class");
2087  $chars = $this->object->getCharacteristics($st);
2088  $options = array("" => "");
2089  foreach($chars as $char)
2090  {
2091  $options[$char] = $char;
2092  }
2093  $sc_input->setOptions($options);
2094  $this->form_gui->addItem($sc_input);
2095  }
2096 
2097  if ($a_mode == "create")
2098  {
2099  $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2100  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2101  }
2102  else
2103  {
2104  $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2105  $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2106  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2107  }
2108  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2109  }
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
if(!is_array($argv)) $options
This class represents a regular expression input property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplateGenerationForm()

ilObjStyleSheetGUI::initTemplateGenerationForm ( )

Init table template generation form.

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

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

Referenced by generateTemplateObject(), and templateGenerationObject().

2355  {
2356  global $lng, $ilCtrl;
2357 
2358  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2359  $this->form_gui = new ilPropertyFormGUI();
2360 
2361  $this->form_gui->setTitle($lng->txt("sty_generate_template"));
2362 
2363  // name
2364  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2365  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2366  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2367  $name_input->setRequired(true);
2368  $name_input->setSize(30);
2369  $name_input->setMaxLength(30);
2370  $this->form_gui->addItem($name_input);
2371 
2372  // basic layout
2373  $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
2374  $options = array(
2375  "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
2376  "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
2377  "noZebra" => $lng->txt("sty_table_template_no_zebra")
2378  );
2379  $bl_input->setOptions($options);
2380  $this->form_gui->addItem($bl_input);
2381 
2382  // top bottom padding
2383  include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2384  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
2385  $num_input->setAllowPercentage(false);
2386  $num_input->setValue("3px");
2387  $this->form_gui->addItem($num_input);
2388 
2389  // left right padding
2390  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
2391  $num_input->setAllowPercentage(false);
2392  $num_input->setValue("10px");
2393  $this->form_gui->addItem($num_input);
2394 
2395  // base color
2396  $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
2397  $cs = $this->object->getColors();
2398  $options = array();
2399  foreach ($cs as $c)
2400  {
2401  $options[$c["name"]] = $c["name"];
2402  }
2403  $bc_input->setOptions($options);
2404  $this->form_gui->addItem($bc_input);
2405 
2406  // Lightness Settings
2407  $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
2408  "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
2409  foreach ($lss as $ls => $v)
2410  {
2411  $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_".$ls), "lightness_".$ls);
2412  $l_input->setMaxValue(100);
2413  $l_input->setMinValue(-100);
2414  $l_input->setValue($v);
2415  $l_input->setSize(4);
2416  $l_input->setMaxLength(4);
2417  $this->form_gui->addItem($l_input);
2418  }
2419 
2420  $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
2421  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2422  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2423  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
setMaxValue($a_maxvalue)
Set Maximum Value.
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
if(!is_array($argv)) $options
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.
+ 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 1656 of file class.ilObjStyleSheetGUI.php.

References $_GET, $ilCtrl, and ilObjectGUI\$tpl.

1657  {
1658  global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
1659 
1660  if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1661  {
1662  $ilToolbar->addButton($this->lng->txt("sty_add_color"),
1663  $ilCtrl->getLinkTarget($this, "addColor"));
1664  }
1665 
1666  include_once("./Services/Style/classes/class.ilStyleColorTableGUI.php");
1667  $table_gui = new ilStyleColorTableGUI($this, "listColors",
1668  $this->object);
1669  $tpl->setContent($table_gui->getHTML());
1670 
1671  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
TableGUI class for style editor (image list)

◆ listImagesObject()

ilObjStyleSheetGUI::listImagesObject ( )

List images of style.

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\$tpl.

1207  {
1208  global $tpl, $ilToolbar, $ilCtrl, $lng, $rbacsystem;
1209 
1210  if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1211  {
1212  $ilToolbar->addButton($lng->txt("sty_add_image"),
1213  $ilCtrl->getLinkTarget($this, "addImage"));
1214  }
1215 
1216  include_once("./Services/Style/classes/class.ilStyleImageTableGUI.php");
1217  $table_gui = new ilStyleImageTableGUI($this, "listImages",
1218  $this->object);
1219  $tpl->setContent($table_gui->getHTML());
1220 
1221  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
TableGUI class for style editor (image list)

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

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

1883  {
1884  global $tpl, $ilTabs, $ilCtrl;
1885 
1886  $ctype = $_GET["temp_type"];
1887  if ($ctype == "")
1888  {
1889  $ctype = "table";
1890  $ilCtrl->setParameter($this, "temp_type", $ctype);
1891  $_GET["temp_type"] = $ctype;
1892  }
1893 
1894  $this->setTemplatesSubTabs();
1895  $ilTabs->setSubTabActive("sty_".$ctype."_templates");
1896 
1897  $this->includeCSS();
1898  include_once("./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
1899  $table_gui = new ilTableTemplatesTableGUI($ctype, $this, "listTemplates",
1900  $this->object);
1901  $tpl->setContent($table_gui->getHTML());
1902 
1903  }
$_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 791 of file class.ilObjStyleSheetGUI.php.

References $_POST, and editObject().

792  {
793  $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
794  $this->editObject();
795  }
$_POST['username']
Definition: cron.php:12
editObject()
edit style sheet
+ Here is the call graph for this function:

◆ outputTagStyleEditScreen()

ilObjStyleSheetGUI::outputTagStyleEditScreen ( )

Output tag style edit screen.

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

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

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

539  {
540  global $tpl, $ilCtrl, $lng;
541 
542  // set style sheet
543  $tpl->setCurrentBlock("ContentStyle");
544  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
545  $this->object->getContentStylePath($this->object->getId()));
546 
547  $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style");
548 
549  $cur = explode(".",$_GET["tag"]);
550  $cur_tag = $cur[0];
551  $cur_class = $cur[1];
552 
553  $ts_tpl->setVariable("EXAMPLE",
554  ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class));
555 
556  $ts_tpl->setVariable("FORM",
557  $this->form_gui->getHtml());
558 
559  $tpl->setTitle($cur_class." (".$lng->txt("sty_type_".$_GET["style_type"]).")");
560 
561  $tpl->setContent($ts_tpl->get());
562  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
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 1624 of file class.ilObjStyleSheetGUI.php.

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

1625  {
1626  global $ilCtrl, $lng;
1627 
1628  if (is_array($_POST["title"]))
1629  {
1630  foreach ($_POST["title"] as $from_char => $to_title)
1631  {
1632  $fc = explode(".", $from_char);
1633 
1634  if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1635  !$this->object->characteristicExists($to_title, $fc[0]))
1636  {
1637  $this->object->copyCharacteristic($_POST["from_style_id"],
1638  $fc[0], $fc[2], $to_title);
1639  }
1640  }
1641  ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1642  unset($_SESSION["sty_copy"]);
1643  ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1644  }
1645 
1646  $ilCtrl->redirect($this, "edit");
1647  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
_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 1606 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$tpl.

1607  {
1608  global $tpl, $ilTabs;
1609 
1610  $ilTabs->clearTargets();
1611 
1612  include_once("./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1613  $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1614 
1615  $tpl->setContent($table->getHTML());
1616  }

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

References ilObjectGUI\$lng, getPropertiesValues(), and initPropertiesForm().

245  {
246  global $rbacsystem, $lng, $ilToolbar;
247 
248  // set style sheet
249  $this->tpl->setCurrentBlock("ContentStyle");
250  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
251  $this->object->getContentStylePath($this->object->getId()));
252  $this->tpl->parseCurrentBlock();
253 
254  // export button
255  $ilToolbar->addButton($this->lng->txt("export"),
256  $this->ctrl->getLinkTarget($this, "exportStyle"));
257 
258  $this->initPropertiesForm();
259  $this->getPropertiesValues();
260  $this->tpl->setContent($this->form->getHTML());
261  }
getPropertiesValues()
Get current values for properties from.
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
+ Here is the call graph for this function:

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

References $_POST, and editObject().

801  {
802  $this->object->setTitle($_POST["style_title"]);
803  $this->object->setDescription($_POST["style_description"]);
804 
805  foreach($_POST["styval"] as $id => $value)
806  {
807  $this->object->updateStyleParameter($id, $value);
808  }
809  $this->object->update();
810  $this->editObject();
811  }
$_POST['username']
Definition: cron.php:12
editObject()
edit style sheet
+ Here is the call graph for this function:

◆ refreshTagStyleObject()

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

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

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

357  {
358  global $ilCtrl;
359 
360  $cur = explode(".",$_GET["tag"]);
361  $cur_tag = $cur[0];
362  $cur_class = $cur[1];
363 
364  $this->initTagStyleForm("edit", $cur_tag);
365 
366  if ($this->form_gui->checkInput())
367  {
368  $this->saveTagStyle();
369  $ilCtrl->redirect($this, "editTagStyle");
370  }
371  else
372  {
373  $this->form_gui->setValuesByPost();
374  $this->outputTagStyleEditScreen();
375  }
376  }
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 2214 of file class.ilObjStyleSheetGUI.php.

References updateTemplateObject().

2215  {
2216  $this->updateTemplateObject(true);
2217  }
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 2589 of file class.ilObjStyleSheetGUI.php.

References $_GET, and $ilCtrl.

2590  {
2591  global $ilCtrl;
2592 
2593  if ($_GET["baseClass"] == "ilAdministrationGUI")
2594  {
2595  $ilCtrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
2596  }
2597  $ilCtrl->returnToParent($this);
2598  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

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

1448  {
1449  global $ilCtrl, $tpl, $lng;
1450 
1451  $this->initCharacteristicForm("create");
1452 
1453  if ($this->form_gui->checkInput())
1454  {
1455  if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"]))
1456  {
1457  $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1458  $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1459  }
1460  else
1461  {
1462  $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1463  ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1464  $ilCtrl->setParameter($this, "tag",
1465  ilObjStyleSheet::_determineTag($_POST["type"]).".".$_POST["new_characteristic"]);
1466  $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1467  $ilCtrl->redirect($this, "editTagStyle");
1468  }
1469  }
1470  $this->form_gui->setValuesByPost();
1471  $tpl->setContent($this->form_gui->getHTML());
1472  }
$_POST['username']
Definition: cron.php:12
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.
+ Here is the call graph for this function:

◆ saveColorObject()

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

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

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

1765  {
1766  global $tpl, $ilCtrl, $lng;
1767 
1768  $this->initColorForm();
1769 
1770  if ($this->form_gui->checkInput())
1771  {
1772  if ($this->object->colorExists($_POST["color_name"]))
1773  {
1774  $col_input = $this->form_gui->getItemByPostVar("color_name");
1775  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1776  }
1777  else
1778  {
1779  $this->object->addColor($_POST["color_name"],
1780  $_POST["color_code"]);
1781  $ilCtrl->redirect($this, "listColors");
1782  }
1783  }
1784  $this->form_gui->setValuesByPost();
1785  $tpl->setContent($this->form_gui->getHTML());
1786  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ saveHideStatusObject()

ilObjStyleSheetGUI::saveHideStatusObject ( )

Save hide status for characteristics.

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

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

1560  {
1561  global $ilCtrl, $lng;
1562 
1563  //var_dump($_POST);
1564 
1565  foreach ($_POST["all_chars"] as $char)
1566  {
1567  $ca = explode(".", $char);
1568  $this->object->saveHideStatus($ca[0], $ca[2],
1569  (is_array($_POST["hide"]) && in_array($char, $_POST["hide"])));
1570  }
1571 
1572  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1573  $ilCtrl->redirect($this, "edit");
1574  }
$_POST['username']
Definition: cron.php:12
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:

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

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

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

880  {
881  if(!trim($_POST["style_title"]))
882  {
883  $this->ctrl->redirect($this, "create");
884  }
885 
886 //echo "HH"; exit;
887  $class_name = "ilObjStyleSheet";
888  require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
889  $newObj = new ilObjStyleSheet();
890  $newObj->setTitle("-");
891  $newObj->create();
892  $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
893  $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
894  $newObj->update();
895 
896  // assign style to style sheet folder,
897  // if parent is style sheet folder
898  if ($_GET["ref_id"] > 0)
899  {
900 
901  $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
902  if ($fold->getType() == "stys")
903  {
904  $fold->addStyle($newObj->getId());
905  $fold->update();
906  ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
907  $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
908  }
909  }
910 
911  return $newObj->getId();
912  }
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
_writeStandard($a_id, $a_std)
Write standard flag.
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilObjStyleSheet.
+ Here is the call graph for this function:

◆ saveTagStyle()

ilObjStyleSheetGUI::saveTagStyle ( )

Save tag style.

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

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

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

406  {
407  $cur = explode(".", $_GET["tag"]);
408  $cur_tag = $cur[0];
409  $cur_class = $cur[1];
410  $avail_pars = ilObjStyleSheet::_getStyleParameters($cur_tag);
411  foreach ($avail_pars as $par => $v)
412  {
413  $var = str_replace("-", "_", $par);
414  $basepar_arr = explode(".", $par);
415  $basepar = $basepar_arr[0];
416  if ($basepar_arr[1] != "" && $basepar_arr[1] != $cur_tag)
417  {
418  continue;
419  }
420 
421  switch ($v["input"])
422  {
423  case "fontsize":
424  case "numeric_no_perc":
425  case "numeric":
426  case "background_image":
427  $in = $this->form_gui->getItemByPostVar($basepar);
428 //echo "<br>-".$cur_tag."-".$cur_class."-".$basepar."-".$_GET["style_type"]."-";
429  $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"]);
430  break;
431 
432  case "color":
433  $color = trim($_POST[$basepar]);
434  if ($color != "" && trim(substr($color,0,1) != "!"))
435  {
436  $color = "#".$color;
437  }
438  $this->writeStylePar($cur_tag, $cur_class, $basepar, $color, $_GET["style_type"]);
439  break;
440 
441  case "trbl_numeric":
442  case "border_width":
443  case "border_style":
444  $in = $this->form_gui->getItemByPostVar($basepar);
445  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0], $in->getAllValue(), $_GET["style_type"]);
446  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1], $in->getTopValue(), $_GET["style_type"]);
447  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2], $in->getRightValue(), $_GET["style_type"]);
448  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3], $in->getBottomValue(), $_GET["style_type"]);
449  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4], $in->getLeftValue(), $_GET["style_type"]);
450  break;
451 
452  case "trbl_color":
453  $in = $this->form_gui->getItemByPostVar($basepar);
454  $tblr_p = array (0 => "getAllValue", 1 => "getTopValue", 2 => "getRightValue",
455  3 => "getBottomValue", 4 => "getLeftValue");
456  foreach ($tblr_p as $k => $func)
457  {
458  $val = trim($in->$func());
459  $val = (($in->getAcceptNamedColors() && substr($val, 0, 1) == "!")
460  || $val == "")
461  ? $val
462  : "#".$val;
463  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][$k], $val, $_GET["style_type"]);
464  }
465  /*$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0],
466  trim($in->getAllValue() != "") ? "#".$in->getAllValue() : "", $_GET["style_type"]);
467  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1],
468  trim($in->getTopValue() != "") ? "#".$in->getTopValue() : "", $_GET["style_type"]);
469  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2],
470  trim($in->getRightValue() != "") ? "#".$in->getRightValue() : "", $_GET["style_type"]);
471  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3],
472  trim($in->getBottomValue() != "") ? "#".$in->getBottomValue() : "", $_GET["style_type"]);
473  $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4],
474  trim($in->getLeftValue() != "") ? "#".$in->getLeftValue() : "", $_GET["style_type"]);
475  */
476  break;
477 
478  case "background_position":
479  $in = $this->form_gui->getItemByPostVar($basepar);
480  $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"]);
481  break;
482 
483  default:
484  $this->writeStylePar($cur_tag, $cur_class, $basepar, $_POST[$basepar], $_GET["style_type"]);
485  break;
486  }
487  }
488 
489  $this->object->update();
490  }
writeStylePar($cur_tag, $cur_class, $par, $value, $a_type)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _getStyleParameters($a_tag="")
+ 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 2125 of file class.ilObjStyleSheetGUI.php.

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

2126  {
2127  global $tpl, $ilCtrl, $lng;
2128 
2129  $this->initTemplateForm();
2130 
2131  if ($this->form_gui->checkInput())
2132  {
2133  if ($this->object->templateExists($_POST["name"]))
2134  {
2135  $name_input = $this->form_gui->getItemByPostVar("name");
2136  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2137  }
2138  else
2139  {
2140  $classes = array();
2141  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2142  {
2143  $classes[$tct] = $_POST[$tct."_class"];
2144  }
2145  $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2146  $this->object->writeTemplatePreview($t_id,
2147  $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2148  $ilCtrl->redirect($this, "listTemplates");
2149  }
2150  }
2151  $this->form_gui->setValuesByPost();
2152  $tpl->setContent($this->form_gui->getHTML());
2153  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
initTemplateForm($a_mode="create")
Init table template form.
+ 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 1118 of file class.ilObjStyleSheetGUI.php.

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

Referenced by editObject().

1119  {
1120  global $lng, $ilTabs, $ilCtrl;
1121 
1123 
1124  foreach ($types as $super_type => $types)
1125  {
1126  // text block characteristics
1127  $ilCtrl->setParameter($this, "style_type", $super_type);
1128  $ilTabs->addSubTabTarget("sty_".$super_type."_char",
1129  $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1130  get_class($this));
1131  }
1132 
1133  $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1134  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjStyleSheetGUI::setTabs ( )

output tabs

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

References ilObjectGUI\$lng, and getTabs().

1011  {
1012  global $lng;
1013 
1014  $this->getTabs($this->tabs_gui);
1015 
1016  if (strtolower(get_class($this->object)) == "ilobjstylesheet")
1017  {
1018  $this->tpl->setVariable("HEADER", $this->object->getTitle());
1019  }
1020  else
1021  {
1022  $this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
1023  }
1024  }
getTabs(&$tabs_gui)
adds tabs to tab gui object
+ Here is the call graph for this function:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

Referenced by listTemplatesObject().

1142  {
1143  global $lng, $ilTabs, $ilCtrl;
1144 
1146 
1147  foreach ($types as $t => $c)
1148  {
1149  $ilCtrl->setParameter($this, "temp_type", $t);
1150  $ilTabs->addSubTabTarget("sty_".$t."_templates",
1151  $this->ctrl->getLinkTarget($this, "listTemplates"), array("listTemplates", ""),
1152  get_class($this));
1153  }
1154 
1155  $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1156  }
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUpperIcon()

ilObjStyleSheetGUI::showUpperIcon ( )

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

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

1188  {
1189  global $tree, $tpl, $objDefinition;
1190 
1191  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
1192  {
1193  $tpl->setUpperIcon(
1194  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui",
1195  "editContentStyles"));
1196  }
1197  else
1198  {
1199  // ?
1200  }
1201  }
$_GET["client_id"]

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

2429  {
2430  global $tpl, $ilCtrl, $lng;
2431 
2432  $this->initTemplateGenerationForm();
2433 
2434  if ($this->form_gui->checkInput())
2435  {
2436  if ($this->object->templateExists($_POST["name"]))
2437  {
2438  $name_input = $this->form_gui->getItemByPostVar("name");
2439  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2440  }
2441  else
2442  {
2443  // -> move to application class!
2444 
2445  // cell classes
2446  $cells = array("H" => "header", "C1" => "cell1", "C2" => "cell2");
2447  $tb_p = $this->form_gui->getItemByPostVar("tb_padding");
2448  $tb_padding = $tb_p->getValue();
2449  $lr_p = $this->form_gui->getItemByPostVar("lr_padding");
2450  $lr_padding = $lr_p->getValue();
2451  $cell_color = $_POST["base_color"];
2452 
2453  // use mid gray as cell color for bw zebra
2454  if ($_POST["layout"] == "bwZebra")
2455  {
2456  $cell_color = "MidGray";
2457  if (!$this->object->colorExists($cell_color))
2458  {
2459  $this->object->addColor($cell_color, "7F7F7F");
2460  }
2461  $this->object->updateColor($cell_color, $cell_color, "7F7F7F");
2462  }
2463 
2464  foreach ($cells as $k => $cell)
2465  {
2466  $cell_class[$k] = $_POST["name"].$k;
2467  if (!$this->object->characteristicExists($cell_class[$k], "table_cell"))
2468  {
2469  $this->object->addCharacteristic("table_cell", $cell_class[$k], true);
2470  }
2471  if ($_POST["layout"] == "bwZebra" && $k == "H")
2472  {
2473  $this->object->replaceStylePar("td", $cell_class[$k], "color",
2474  "!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
2475  $this->object->replaceStylePar("td", $cell_class[$k], "background-color",
2476  "!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
2477  }
2478  else
2479  {
2480  $this->object->replaceStylePar("td", $cell_class[$k], "color",
2481  "!".$cell_color."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
2482  $this->object->replaceStylePar("td", $cell_class[$k], "background-color",
2483  "!".$cell_color."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
2484  }
2485  $this->object->replaceStylePar("td", $cell_class[$k], "padding-top",
2486  $tb_padding, "table_cell");
2487  $this->object->replaceStylePar("td", $cell_class[$k], "padding-bottom",
2488  $tb_padding, "table_cell");
2489  $this->object->replaceStylePar("td", $cell_class[$k], "padding-left",
2490  $lr_padding, "table_cell");
2491  $this->object->replaceStylePar("td", $cell_class[$k], "padding-right",
2492  $lr_padding, "table_cell");
2493  $this->object->replaceStylePar("td", $cell_class[$k], "border-width",
2494  "1px", "table_cell");
2495  $this->object->replaceStylePar("td", $cell_class[$k], "border-style",
2496  "solid", "table_cell");
2497  $this->object->replaceStylePar("td", $cell_class[$k], "border-color",
2498  "!".$cell_color."(".$_POST["lightness_border"].")", "table_cell");
2499  $this->object->replaceStylePar("td", $cell_class[$k], "font-weight",
2500  "normal", "table_cell");
2501  }
2502 
2503  // table class
2504  $classes["table"] = $_POST["name"]."T";
2505  if (!$this->object->characteristicExists($classes["table"], "table"))
2506  {
2507  $this->object->addCharacteristic("table", $classes["table"], true);
2508  }
2509  $this->object->replaceStylePar("table", $classes["table"], "caption-side",
2510  "bottom", "table");
2511  $this->object->replaceStylePar("table", $classes["table"], "border-collapse",
2512  "collapse", "table");
2513  $this->object->replaceStylePar("table", $classes["table"], "margin-top",
2514  "5px", "table");
2515  $this->object->replaceStylePar("table", $classes["table"], "margin-bottom",
2516  "5px", "table");
2517  if ($_POST["layout"] == "bwZebra")
2518  {
2519  $this->object->replaceStylePar("table", $classes["table"], "border-bottom-color",
2520  "!".$_POST["base_color"], "table");
2521  $this->object->replaceStylePar("table", $classes["table"], "border-bottom-style",
2522  "solid", "table");
2523  $this->object->replaceStylePar("table", $classes["table"], "border-bottom-width",
2524  "3px", "table");
2525  $sb = array("left", "right", "top");
2526  foreach ($sb as $b)
2527  {
2528  $this->object->replaceStylePar("table", $classes["table"], "border-".$b."-width",
2529  "0px", "table");
2530  }
2531  }
2532 
2533  switch ($_POST["layout"])
2534  {
2535  case "coloredZebra":
2536  $classes["row_head"] = $cell_class["H"];
2537  $classes["odd_row"] = $cell_class["C1"];
2538  $classes["even_row"] = $cell_class["C2"];
2539  break;
2540 
2541  case "bwZebra":
2542  $classes["row_head"] = $cell_class["H"];
2543  $classes["odd_row"] = $cell_class["C1"];
2544  $classes["even_row"] = $cell_class["C2"];
2545  break;
2546 
2547  case "noZebra":
2548  $classes["row_head"] = $cell_class["H"];
2549  $classes["odd_row"] = $cell_class["C1"];
2550  $classes["even_row"] = $cell_class["C1"];
2551  $classes["col_head"] = $cell_class["C2"];
2552  break;
2553  }
2554 
2555 
2556  $t_id = $this->object->addTemplate($_GET["temp_type"],
2557  $_POST["name"], $classes);
2558  $this->object->writeTemplatePreview($t_id,
2559  $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2560  $ilCtrl->redirect($this, "listTemplates");
2561  }
2562  }
2563  $this->form_gui->setValuesByPost();
2564  $tpl->setContent($this->form_gui->getHTML());
2565  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
initTemplateGenerationForm()
Init table template generation form.
+ Here is the call graph for this function:

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

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

1792  {
1793  global $tpl, $ilCtrl, $lng;
1794 
1795  $this->initColorForm("edit");
1796 
1797  if ($this->form_gui->checkInput())
1798  {
1799  if ($this->object->colorExists($_POST["color_name"]) &&
1800  $_POST["color_name"] != $_GET["c_name"])
1801  {
1802  $col_input = $this->form_gui->getItemByPostVar("color_name");
1803  $col_input->setAlert($lng->txt("sty_color_already_exists"));
1804  }
1805  else
1806  {
1807  $this->object->updateColor($_GET["c_name"], $_POST["color_name"],
1808  $_POST["color_code"]);
1809  $ilCtrl->redirect($this, "listColors");
1810  }
1811  }
1812  $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1813  $this->form_gui->setValuesByPost();
1814  $tpl->setContent($this->form_gui->getHTML());
1815  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
initColorForm($a_mode="create")
Init color form.
+ Here is the call graph for this function:

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

Update properties.

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

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

332  {
333  global $lng, $ilCtrl, $tpl;
334 
335  $this->initPropertiesForm("edit");
336  if ($this->form->checkInput())
337  {
338  $this->object->setTitle($this->form->getInput("style_title"));
339  $this->object->setDescription($this->form->getInput("style_description"));
340  $this->object->writeStyleSetting("disable_auto_margins",
341  $this->form->getInput("disable_auto_margins"));
342  $this->object->update();
343  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
344  $ilCtrl->redirect($this, "properties");
345  }
346  else
347  {
348  $this->form->setValuesByPost();
349  $tpl->setContent($this->form->getHtml());
350  }
351  }
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 381 of file class.ilObjStyleSheetGUI.php.

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

382  {
383  global $ilCtrl;
384 
385  $cur = explode(".",$_GET["tag"]);
386  $cur_tag = $cur[0];
387  $cur_class = $cur[1];
388 
389  $this->initTagStyleForm("edit", $cur_tag);
390  if ($this->form_gui->checkInput())
391  {
392  $this->saveTagStyle();
393  $ilCtrl->redirect($this, "edit");
394  }
395  else
396  {
397  $this->form_gui->setValuesByPost();
398  $this->outputTagStyleEditScreen();
399  }
400  }
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 2158 of file class.ilObjStyleSheetGUI.php.

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

Referenced by refreshTemplateObject().

2159  {
2160  global $tpl, $ilCtrl, $lng;
2161 
2162  $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2163  $this->initTemplateForm("edit");
2164 
2165  if ($this->form_gui->checkInput())
2166  {
2167  if ($this->object->templateExists($_POST["name"]) &&
2168  $_POST["name"] != ilObjStyleSheet::lookupTemplateName($_GET["t_id"]))
2169  {
2170  $name_input = $this->form_gui->getItemByPostVar("name");
2171  $name_input->setAlert($lng->txt("sty_template_already_exists"));
2172  }
2173  else
2174  {
2175  $classes = array();
2176  foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2177  {
2178  $classes[$tct] = $_POST[$tct."_class"];
2179  }
2180 
2181  $this->object->updateTemplate($_GET["t_id"],
2182  $_POST["name"], $classes);
2183  $this->object->writeTemplatePreview($_GET["t_id"],
2184  $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true));
2185  if(!$a_refresh)
2186  {
2187  $ilCtrl->redirect($this, "listTemplates");
2188  }
2189  }
2190  }
2191 
2192  $this->form_gui->setValuesByPost();
2193  $this->displayTemplateEditForm();
2194  }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
static _getTemplateClassTypes($a_template_type="")
Get template class types.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
lookupTemplateName($a_t_id)
Lookup table template name for template ID.
global $ilCtrl
Definition: ilias.php:18
initTemplateForm($a_mode="create")
Init table template form.
displayTemplateEditForm()
Display table tempalte edit form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadImageObject()

ilObjStyleSheetGUI::uploadImageObject ( )

Upload image.

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

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

1248  {
1249  global $tpl, $ilCtrl;
1250 
1251  $this->initImageForm();
1252 
1253  if ($this->form_gui->checkInput())
1254  {
1255  $this->object->uploadImage($_FILES["image_file"]);
1256  $ilCtrl->redirect($this, "listImages");
1257  }
1258  else
1259  {
1260  //$this->form_gui->setImageFormValuesByPost();
1261  $tpl->setContent($this->form_gui->getHTML());
1262  }
1263 
1264  }
global $ilCtrl
Definition: ilias.php:18
initImageForm()
Init image form.
+ Here is the call graph for this function:

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

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

References editObject().

74  {
75  $this->editObject();
76  }
editObject()
edit style sheet
+ Here is the call graph for this function:

◆ writeStylePar()

ilObjStyleSheetGUI::writeStylePar (   $cur_tag,
  $cur_class,
  $par,
  $value,
  $a_type 
)

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

Referenced by saveTagStyle().

493  {
494  if ($a_type == "")
495  {
496  return;
497  }
498 
499  if ($value != "")
500  {
501  $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type);
502  }
503  else
504  {
505  $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type);
506  }
507  }
+ Here is the caller graph for this function:

Field Documentation

◆ $cmd_delete

ilObjStyleSheetGUI::$cmd_delete

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

◆ $cmd_new_par

ilObjStyleSheetGUI::$cmd_new_par

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

◆ $cmd_refresh

ilObjStyleSheetGUI::$cmd_refresh

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

◆ $cmd_update

ilObjStyleSheetGUI::$cmd_update

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


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