ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 @access public. More...
 
executeCommand ()
 execute command More...
 
 viewObject ()
 list childs of current object More...
 
 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, $a_mq_id, $a_custom=false)
 
 editTagStyleObject ()
 Edit tag style. More...
 
 switchMQueryObject ()
 Switch media query. More...
 
 outputTagStyleEditScreen ()
 Output tag style edit screen. More...
 
 initTagStyleForm ($a_mode, $a_cur_tag)
 Init tag style editing form. More...
 
 getValues ()
 FORM: Get current values from persistent object. More...
 
 exportStyleObject ()
 export style More...
 
 extractParametersOfTag ($a_tag, $a_class, $a_style, $a_type, $a_mq_id=0, $a_custom=false)
 
 newStyleParameterObject ()
 add style parameter More...
 
 refreshObject ()
 refresh style sheet More...
 
 deleteObject ($a_error=false)
 display deletion confirmation screen More...
 
 cancelDeleteObject ()
 cancel oobject deletion More...
 
 confirmedDeleteObject ()
 delete selected style objects More...
 
 deleteStyleParameterObject ()
 delete style parameters More...
 
 saveObject ()
 save style sheet More...
 
 copyStyleObject ()
 save style sheet More...
 
 importStyleObject ()
 import style sheet More...
 
 afterImport ($a_new_obj)
 After import. 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...
 
 listMediaQueriesObject ()
 List media queries of style. More...
 
 addMediaQueryObject ()
 Add a media query. More...
 
 editMediaQueryObject ()
 Edit media query. More...
 
 initMediaQueryForm ($a_mode="create")
 Init media query form. More...
 
 getMediaQueryFormValues ()
 Set values for media query editing. More...
 
 saveMediaQueryObject ()
 Save media query. More...
 
 updateMediaQueryObject ()
 Update media query. More...
 
 deleteMediaQueryConfirmationObject ()
 Confirm media query deletion. More...
 
 deleteMediaQueriesObject ()
 Delete Media Queries. More...
 
 saveMediaQueryOrderObject ()
 Save media query order. More...
 
 listTemplatesObject ()
 List templates. More...
 
 addTemplateObject ()
 Add template. More...
 
 editTemplateObject ()
 Edit table template. More...
 
 getTemplatePreview ($a_type, $a_t_id, $a_small_mode=false)
 Get table template preview. More...
 
 _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 @access 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 @access 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...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static getStyleExampleHTML ($a_type, $a_class)
 Get style example HTML. More...
 
- Static 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 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...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Class ilObjStyleSheetGUI.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e $Id$

@ilCtrl_Calls ilObjStyleSheetGUI:

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

Member Function Documentation

◆ _getTemplatePreview()

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

Get table template preview.

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

2251 {
2252 global $lng, $tpl;
2253
2254 $kr = $kc = 7;
2255 if ($a_small_mode)
2256 {
2257 $kr = 6;
2258 $kc = 5;
2259 }
2260
2261 $ts = $a_style->getTemplate($a_t_id);
2262 $t = $ts["classes"];
2263
2264 // preview
2265 if ($a_type == "table")
2266 {
2267 $p_content = '<PageContent><Table DataTable="y"';
2268 if ($t["row_head"] != "")
2269 {
2270 $p_content.= ' HeaderRows="1"';
2271 }
2272 if ($t["row_foot"] != "")
2273 {
2274 $p_content.= ' FooterRows="1"';
2275 }
2276 if ($t["col_head"] != "")
2277 {
2278 $p_content.= ' HeaderCols="1"';
2279 }
2280 if ($t["col_foot"] != "")
2281 {
2282 $p_content.= ' FooterCols="1"';
2283 }
2284 $p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
2285 if (!$a_small_mode)
2286 {
2287 $p_content.= '<Caption>'.$lng->txt("sty_caption").'</Caption>';
2288 }
2289 for($i = 1; $i<=$kr; $i++)
2290 {
2291 $p_content.= '<TableRow>';
2292 for($j = 1; $j<=$kc; $j++)
2293 {
2294 if ($a_small_mode)
2295 {
2296 $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
2297 }
2298 else
2299 {
2300 $cell = 'xxx';
2301 }
2302 $p_content.= '<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.'</Paragraph></PageContent></TableData>';
2303 }
2304 $p_content.= '</TableRow>';
2305 }
2306 $p_content.= '</Table></PageContent>';
2307 }
2308
2309 if ($a_type == "vaccordion" || $a_type == "haccordion" || $a_type == "carousel")
2310 {
2311 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2313
2314 if ($a_small_mode)
2315 {
2316 $c = '&amp;nbsp;';
2317 $h = '&amp;nbsp;';
2318 }
2319 else
2320 {
2321 $c = 'xxx';
2322 $h = 'head';
2323 }
2324 if ($a_type == "vaccordion")
2325 {
2326 $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2327 if ($a_small_mode)
2328 {
2329 $p_content.= ' ContentWidth="70"';
2330 }
2331 }
2332 else if ($a_type == "haccordion")
2333 {
2334 $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
2335 if ($a_small_mode)
2336 {
2337 $p_content.= ' ContentHeight="40"';
2338 $p_content.= ' ContentWidth="70"';
2339 $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
2340 }
2341 else
2342 {
2343 $p_content.= ' ContentHeight="40"';
2344 }
2345 }
2346 else if ($a_type == "carousel")
2347 {
2348 $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="Carousel" ';
2349 if ($a_small_mode)
2350 {
2351 $p_content.= ' ContentWidth="70"';
2352 }
2353 }
2354
2355
2356 $p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
2357 $p_content.= '<Tab><PageContent><Paragraph>'.$c.'</Paragraph></PageContent>';
2358 $p_content.= '<TabCaption>'.$h.'</TabCaption>';
2359 $p_content.= '</Tab>';
2360 $p_content.= '</Tabs></PageContent>';
2361 }
2362//echo htmlentities($p_content);
2363 $txml = $a_style->getTemplateXML();
2364//echo htmlentities($txml); exit;
2365 $p_content.= $txml;
2366 include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
2367 $r_content = ilPCTableGUI::_renderTable($p_content, "");
2368
2369 // fix carousel template visibility
2370 if($a_type == "carousel")
2371 {
2372 $r_content.= "<style>.owl-carousel{ display:block !important; }</style>";
2373 }
2374
2375//echo htmlentities($r_content); exit;
2376 return $r_content;
2377 }
static addCss()
Add required css.
static _renderTable($content, $a_mode="table_edit", $a_submode="", $a_table_obj=null)
Static render table function.
$h

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accordiontestObject()

ilObjStyleSheetGUI::accordiontestObject ( )

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

2893 {
2894 global $tpl;
2895
2896 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2897
2898 $acc = new ilAccordionGUI();
2899 $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2900 $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2901 $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
2902
2903 $ac2 = new ilAccordionGUI();
2904 $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2905 $ac2->addItem("Header 2", $acc->getHTML());
2906 $ac2->setOrientation(ilAccordionGUI::VERTICAL);
2907
2908 $tpl->setContent($ac2->getHTML());
2909 }
Accordion user interface class.

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

◆ addAdminLocatorItems()

ilObjStyleSheetGUI::addAdminLocatorItems ( )

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

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

1261 {
1262 global $ilLocator;
1263
1264 if ($_GET["admin_mode"] == "settings") // system settings
1265 {
1266 parent::addAdminLocatorItems(true);
1267
1268 $ilLocator->addItem(ilObject::_lookupTitle(
1269 ilObject::_lookupObjId($_GET["ref_id"])),
1270 $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "view"));
1271
1272 if ($_GET["obj_id"] > 0)
1273 {
1274 $ilLocator->addItem($this->object->getTitle(),
1275 $this->ctrl->getLinkTarget($this, "edit"));
1276 }
1277 }
1278 else // repository administration
1279 {
1280 //?
1281 }
1282
1283 }
$_GET["client_id"]
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title

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

+ Here is the call graph for this function:

◆ addCharacteristicFormObject()

ilObjStyleSheetGUI::addCharacteristicFormObject ( )

Add characteristic.

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

1535 {
1536 global $tpl;
1537
1538 $this->initCharacteristicForm("create");
1539 $tpl->setContent($this->form_gui->getHTML());
1540 }
initCharacteristicForm($a_mode)
Init tag style editing form.

References ilObjectGUI\$tpl, and initCharacteristicForm().

+ Here is the call graph for this function:

◆ addColorObject()

ilObjStyleSheetGUI::addColorObject ( )

Add a color.

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

1782 {
1783 global $tpl;
1784
1785 $this->initColorForm();
1786 $tpl->setContent($this->form_gui->getHTML());
1787 }
initColorForm($a_mode="create")
Init color form.

References ilObjectGUI\$tpl, and initColorForm().

+ Here is the call graph for this function:

◆ addImageObject()

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

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

1325 {
1326 global $tpl;
1327
1328 $this->initImageForm();
1329 $tpl->setContent($this->form_gui->getHTML());
1330 }

References ilObjectGUI\$tpl, and initImageForm().

+ Here is the call graph for this function:

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

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

2007 {
2008 global $tpl;
2009
2010 $this->initMediaQueryForm();
2011 $tpl->setContent($this->form_gui->getHTML());
2012 }
initMediaQueryForm($a_mode="create")
Init media query form.

References ilObjectGUI\$tpl, and initMediaQueryForm().

+ Here is the call graph for this function:

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

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

2217 {
2218 global $tpl;
2219
2220 $this->initTemplateForm();
2221 $tpl->setContent($this->form_gui->getHTML());
2222 }
initTemplateForm($a_mode="create")
Init table template form.

References ilObjectGUI\$tpl, and initTemplateForm().

+ Here is the call graph for this function:

◆ afterImport()

ilObjStyleSheetGUI::afterImport (   $a_new_obj)

After import.

Parameters

return

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

1076 {
1077
1078 }

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

1501 {
1502 global $ilCtrl, $lng;
1503
1504 ilUtil::sendInfo($lng->txt("action_aborted"), true);
1505 $ilCtrl->redirect($this, "edit");
1506 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ cancelColorDeletionObject()

ilObjStyleSheetGUI::cancelColorDeletionObject ( )

Cancel color deletion.

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

1956 {
1957 global $ilCtrl;
1958
1959 $ilCtrl->redirect($this, "listColors");
1960 }

References $ilCtrl.

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

1860 {
1861 global $ilCtrl;
1862
1863 $ilCtrl->redirect($this, "listColors");
1864 }

References $ilCtrl.

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

Reimplemented from ilObjectGUI.

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

914 {
915 $this->ctrl->returnToParent($this);
916 }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

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

1085 {
1086 global $lng;
1087
1088 ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1089 $this->ctrl->returnToParent($this);
1090 }

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

+ Here is the call graph for this function:

◆ cancelTemplateDeletionObject()

ilObjStyleSheetGUI::cancelTemplateDeletionObject ( )

Cancel table template deletion.

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

2616 {
2617 global $ilCtrl;
2618
2619 $ilCtrl->redirect($this, "listTemplates");
2620 }

References $ilCtrl.

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

2440 {
2441 global $ilCtrl;
2442
2443 $ilCtrl->redirect($this, "listTemplates");
2444 }

References $ilCtrl.

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

1336 {
1337 global $ilCtrl;
1338
1339 $ilCtrl->redirect($this, "listImages");
1340 }

References $ilCtrl.

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

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

922 {
923 global $ilias;
924
925 $this->object->delete();
926
927 $this->ctrl->returnToParent($this);
928 }

References ilObjectGUI\$ilias.

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

return

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

1688 {
1689 global $ilCtrl, $lng;
1690
1691 if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1692 {
1693 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1694 }
1695 else
1696 {
1697 $style_cp = implode("::", $_POST["char"]);
1698 $style_cp = $this->object->getId().":::".$_GET["style_type"].":::".$style_cp;
1699 $_SESSION["sty_copy"] = $style_cp;
1700 ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1701 }
1702 $ilCtrl->redirect($this, "edit");
1703 }
$_SESSION["AccountId"]
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12

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

+ Here is the call graph for this function:

◆ copyStyleObject()

ilObjStyleSheetGUI::copyStyleObject ( )

save style sheet

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

989 {
990 global $ilias;
991
992 if ($_POST["source_style"] > 0)
993 $style_obj =& $ilias->obj_factory->getInstanceByObjId($_POST["source_style"]);
994 $new_id = $style_obj->ilClone();
995
996 // assign style to style sheet folder,
997 // if parent is style sheet folder
998 if ($_GET["ref_id"] > 0)
999 {
1000
1001 $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1002 if ($fold->getType() == "stys")
1003 {
1004 $fold->addStyle($new_id);
1005 $fold->update();
1006 ilObjStyleSheet::_writeStandard($new_id, "1");
1007 $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
1008 }
1009 }
1010
1011 return $new_id;
1012 }
_writeStandard($a_id, $a_std)
Write standard flag.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

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

+ Here is the call graph for this function:

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

create

Reimplemented from ilObjectGUI.

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

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

References ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_getClonableContentStyles(), ilObjectGUI\getCreationFormsHTML(), and ilHelpGUI\ID_PART_SCREEN.

+ Here is the call graph for this function:

◆ deleteCharacteristicConfirmationObject()

ilObjStyleSheetGUI::deleteCharacteristicConfirmationObject ( )

Characteristic deletion confirmation screen.

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

1408 {
1409 global $ilCtrl, $tpl, $lng;
1410
1411//var_dump($_POST);
1412
1413 if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1414 {
1415 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1416 $ilCtrl->redirect($this, "edit");
1417 }
1418 else
1419 {
1420 // check whether there are any core style classes included
1421 $core_styles = ilObjStyleSheet::_getCoreStyles();
1422 foreach ($_POST["char"] as $char)
1423 {
1424 if (!empty($core_styles[$char]))
1425 {
1426 $this->deleteCoreCharMessage();
1427 return;
1428 }
1429 }
1430
1431 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1432 $cgui = new ilConfirmationGUI();
1433 $cgui->setFormAction($ilCtrl->getFormAction($this));
1434 $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1435 $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1436 $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1437
1438 foreach ($_POST["char"] as $char)
1439 {
1440 $char_comp = explode(".", $char);
1441 $cgui->addItem("char[]", $char, $char_comp[2]);
1442 }
1443
1444 $tpl->setContent($cgui->getHTML());
1445 }
1446 }
Confirmation screen class.
deleteCoreCharMessage()
Message that appears, when user tries to delete core characteristics.
static _getCoreStyles()
Get core styles.

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

+ Here is the call graph for this function:

◆ deleteCharacteristicObject()

ilObjStyleSheetGUI::deleteCharacteristicObject ( )

Delete one or multiple style characteristic.

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

1512 {
1513 global $ilCtrl;
1514
1515 if (is_array($_POST["char"]))
1516 {
1517 foreach($_POST["char"] as $char)
1518 {
1519 $char_comp = explode(".", $char);
1520 $type = $char_comp[0];
1521 $tag = $char_comp[1];
1522 $class = $char_comp[2];
1523
1524 $this->object->deleteCharacteristic($type, $tag, $class);
1525 }
1526 }
1527
1528 $ilCtrl->redirect($this, "edit");
1529 }

References $_POST, and $ilCtrl.

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

1926 {
1927 global $ilCtrl, $tpl, $lng;
1928
1929 if (!is_array($_POST["color"]) || count($_POST["color"]) == 0)
1930 {
1931 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1932 $ilCtrl->redirect($this, "listColors");
1933 }
1934 else
1935 {
1936 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1937 $cgui = new ilConfirmationGUI();
1938 $cgui->setFormAction($ilCtrl->getFormAction($this));
1939 $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
1940 $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
1941 $cgui->setConfirm($lng->txt("delete"), "deleteColor");
1942
1943 foreach ($_POST["color"] as $c)
1944 {
1945 $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
1946 }
1947
1948 $tpl->setContent($cgui->getHTML());
1949 }
1950 }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

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

+ Here is the call graph for this function:

◆ deleteColorObject()

ilObjStyleSheetGUI::deleteColorObject ( )

Delete colors.

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

1966 {
1967 global $ilCtrl;
1968
1969 if (is_array($_POST["color"]))
1970 {
1971 foreach ($_POST["color"] as $c)
1972 {
1973 $this->object->removeColor($c);
1974 }
1975 }
1976
1977 $ilCtrl->redirect($this, "listColors");
1978 }

References $_POST, and $ilCtrl.

◆ deleteCoreCharMessage()

ilObjStyleSheetGUI::deleteCoreCharMessage ( )

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

Parameters

return

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

1455 {
1456 global $ilCtrl, $tpl, $lng;
1457
1458 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1459 $cgui = new ilConfirmationGUI();
1460 $cgui->setFormAction($ilCtrl->getFormAction($this));
1461
1462
1463 $core_styles = ilObjStyleSheet::_getCoreStyles();
1464 $cnt = 0;
1465 foreach ($_POST["char"] as $char)
1466 {
1467 if (!empty($core_styles[$char]))
1468 {
1469 $cnt++;
1470 $char_comp = explode(".", $char);
1471 $cgui->addItem("", "", $char_comp[2]);
1472 }
1473 else
1474 {
1475 $cgui->addHiddenItem("char[]", $char);
1476 }
1477 }
1478 $all_core_styles = ($cnt == count($_POST["char"]))
1479 ? true
1480 : false;
1481
1482 if ($all_core_styles)
1483 {
1484 $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1485 $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1486 }
1487 else
1488 {
1489 $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1490 $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1491 $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1492 }
1493
1494 $tpl->setContent($cgui->getHTML());
1495 }

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

Referenced by deleteCharacteristicConfirmationObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteImageObject()

ilObjStyleSheetGUI::deleteImageObject ( )

Delete images.

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

1389 {
1390 global $ilCtrl;
1391
1392 $images = $this->object->getImages();
1393
1394 foreach ($images as $image)
1395 {
1396 if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"]))
1397 {
1398 $this->object->deleteImage($image["entry"]);
1399 }
1400 }
1401 $ilCtrl->redirect($this, "listImages");
1402 }

References $_POST, and $ilCtrl.

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters

return

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

2152 {
2153 global $ilCtrl, $rbacsystem;
2154
2155 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]) && is_array($_POST["mq_id"]))
2156 {
2157 foreach ($_POST["mq_id"] as $id)
2158 {
2159 $this->object->deleteMediaQuery($id);
2160 }
2161 }
2162 $ilCtrl->redirect($this, "listMediaQueries");
2163 }

References $_GET, $_POST, and $ilCtrl.

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

Confirm media query deletion.

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

2118 {
2119 global $ilCtrl, $tpl, $lng;
2120
2121 if (!is_array($_POST["mq_id"]) || count($_POST["mq_id"]) == 0)
2122 {
2123 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2124 $ilCtrl->redirect($this, "listMediaQueries");
2125 }
2126 else
2127 {
2128 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2129 $cgui = new ilConfirmationGUI();
2130 $cgui->setFormAction($ilCtrl->getFormAction($this));
2131 $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
2132 $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
2133 $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
2134
2135 foreach ($_POST["mq_id"] as $i)
2136 {
2137 $mq = $this->object->getMediaQueryForId($i);
2138 $cgui->addItem("mq_id[]", $i, $mq["mquery"]);
2139 }
2140
2141 $tpl->setContent($cgui->getHTML());
2142 }
2143 }

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

+ Here is the call graph for this function:

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

@access public

Reimplemented from ilObjectGUI.

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

890 {
891 //$this->setTabs();
892
893 // display confirmation message
894 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
895 $cgui = new ilConfirmationGUI();
896 $cgui->setFormAction($this->ctrl->getFormAction($this));
897 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
898 $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
899 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
900
901 $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath).
902 " ".ilObject::_lookupTitle($this->object->getId());
903
904 $cgui->addItem("id[]", "", $caption);
905
906 $this->tpl->setContent($cgui->getHTML());
907 }
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...

References ilUtil\getImageTagByType().

+ Here is the call graph for this function:

◆ deleteStyleParameterObject()

ilObjStyleSheetGUI::deleteStyleParameterObject ( )

delete style parameters

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

934 {
935 if (is_array($_POST["sty_select"]))
936 {
937 foreach($_POST["sty_select"] as $id => $dummy)
938 {
939 $this->object->deleteParameter($id);
940 }
941 }
942 $this->object->read();
943 $this->object->writeCSSFile();
944 $this->editObject();
945 }

References $_POST, and editObject().

+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

2567 {
2568 global $ilCtrl, $tpl, $lng;
2569
2570 if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
2571 {
2572 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2573 $ilCtrl->redirect($this, "listTemplates");
2574 }
2575 else
2576 {
2577 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2578 $cgui = new ilConfirmationGUI();
2579 $cgui->setFormAction($ilCtrl->getFormAction($this));
2580 $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2581 $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2582 $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2583
2584 foreach ($_POST["tid"] as $tid)
2585 {
2586 $classes = $this->object->getTemplateClasses($tid);
2587 $cl_str = "";
2588 $listed = array();
2589 foreach ($classes as $cl)
2590 {
2591 if ($cl != "" && !$listed[$cl])
2592 {
2593 $cl_str.= '<div>- '.
2594 $cl."</div>";
2595 $listed[$cl] = true;
2596 }
2597 }
2598 if ($cl_str != "")
2599 {
2600 $cl_str = '<div style="padding-left:30px;" class="small">'.
2601 "<div><i>".$lng->txt("sty_style_class")."</i></div>".$cl_str."</div>";
2602 }
2603 $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2604 }
2605
2606 $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2607
2608 $tpl->setContent($cgui->getHTML());
2609 }
2610 }

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

+ Here is the call graph for this function:

◆ deleteTemplateKeepClassesObject()

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

Delete table template.

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

2626 {
2627 global $ilCtrl;
2628
2629 if (is_array($_POST["tid"]))
2630 {
2631 foreach ($_POST["tid"] as $tid)
2632 {
2633 $this->object->removeTemplate($tid);
2634 }
2635 }
2636
2637 $ilCtrl->redirect($this, "listTemplates");
2638 }

References $_POST, and $ilCtrl.

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

2644 {
2645 global $ilCtrl;
2646
2647 if (is_array($_POST["tid"]))
2648 {
2649 foreach ($_POST["tid"] as $tid)
2650 {
2651 $cls = $this->object->getTemplateClasses($tid);
2652 foreach ($cls as $k => $cls)
2653 {
2654 $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2656 $this->object->deleteCharacteristic($ty, $ta, $cls);
2657 }
2658 $this->object->removeTemplate($tid);
2659 }
2660 }
2661
2662 $ilCtrl->redirect($this, "listTemplates");
2663 }
static _determineTag($a_type)

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

+ Here is the call graph for this function:

◆ displayTemplateEditForm()

ilObjStyleSheetGUI::displayTemplateEditForm ( )

Display table tempalte edit form.

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

2525 {
2526 global $tpl;
2527
2528 $a_tpl = new ilTemplate("tpl.template_edit.html", true, true,
2529 "Services/Style");
2530 $this->includeCSS();
2531 $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2532 $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2533 $tpl->setContent($a_tpl->get());
2534 }
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
includeCSS()
Include CSS in output.
special template class to simplify handling of ITX/PEAR

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

Referenced by editTemplateObject(), and updateTemplateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editColorObject()

ilObjStyleSheetGUI::editColorObject ( )

Edit color.

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

1793 {
1794 global $tpl, $ilCtrl;
1795
1796 $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1797 $this->initColorForm("edit");
1798 $this->getColorFormValues();
1799 $tpl->setContent($this->form_gui->getHTML());
1800 }
getColorFormValues()
Set values for color editing.

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

+ Here is the call graph for this function:

◆ editMediaQueryObject()

ilObjStyleSheetGUI::editMediaQueryObject ( )

Edit media query.

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

2018 {
2019 global $tpl, $ilCtrl;
2020
2021 $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2022 $this->initMediaQueryForm("edit");
2023 $this->getMediaQueryFormValues();
2024 $tpl->setContent($this->form_gui->getHTML());
2025 }
getMediaQueryFormValues()
Set values for media query editing.

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

+ Here is the call graph for this function:

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

edit style sheet

Reimplemented from ilObjectGUI.

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

170 {
171 global $rbacsystem, $lng, $ilTabs, $ilCtrl, $ilToolbar, $tpl;
172
173 $this->setSubTabs();
174
175 $this->includeCSS();
176
177 $ctpl = new ilTemplate("tpl.sty_classes.html", true, true, "Services/Style");
178
179 // output characteristics
180 $chars = $this->object->getCharacteristics();
181
182 $style_type = ($this->super_type != "")
183 ? $this->super_type
184 : "text_block";
185 $ilCtrl->setParameter($this, "style_type", $style_type);
186 $ilTabs->setSubTabActive("sty_".$style_type."_char");
187
188 // workaround to include default rte styles
189 if ($this->super_type == "rte")
190 {
191 $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
192 include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
193 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
194 }
195
196 // add new style?
197 $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
198 $subtypes = $all_super_types[$style_type];
199 $expandable = false;
200 foreach ($subtypes as $t)
201 {
203 {
204 $expandable = true;
205 }
206 }
207 if ($expandable && $rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
208 {
209 $ilToolbar->addButton($lng->txt("sty_add_characteristic"),
210 $ilCtrl->getLinkTarget($this, "addCharacteristicForm"));
211 }
212
213 if ($_SESSION["sty_copy"] != "")
214 {
215
216 $style_cp = explode(":::", $_SESSION["sty_copy"]);
217 if ($style_cp[1] == $style_type)
218 {
219
220 if ($expandable)
221 {
222 $ilToolbar->addSeparator();
223 }
224 $ilToolbar->addButton($lng->txt("sty_paste_style_classes"),
225 $ilCtrl->getLinkTarget($this, "pasteCharacteristicsOverview"));
226 }
227 }
228
229 include_once("./Services/Style/classes/class.ilStyleTableGUI.php");
230 $table_gui = new ilStyleTableGUI($this, "edit", $chars, $style_type,
231 $this->object);
232
233 $ctpl->setCurrentBlock("style_table");
234 $ctpl->setVariable("STYLE_TABLE", $table_gui->getHTML());
235 $ctpl->parseCurrentBlock();
236
237 $this->tpl->setContent($ctpl->get());
238 }
setSubTabs()
adds tabs to tab gui object
static _isExpandable($a_type)
TableGUI class for style editor.

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

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

+ 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 519 of file class.ilObjStyleSheetGUI.php.

520 {
521 global $tpl, $ilToolbar, $lng, $ilCtrl;
522
523 // media query selector
524 $mqs = $this->object->getMediaQueries();
525 if (count($mqs) > 0)
526 {
527 //
528 $options = array(
529 "" => $lng->txt("sty_default"),
530 );
531 foreach ($mqs as $mq)
532 {
533 $options[$mq["id"]] = $mq["mquery"];
534 }
535 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
536 $si = new ilSelectInputGUI("@media", "mq_id");
537 $si->setOptions($options);
538 $si->setValue((int) $_GET["mq_id"]);
539 $ilToolbar->addInputItem($si, true);
540 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
541 $ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
542 }
543
544 // workaround to include default rte styles
545 //if (in_array($_GET["style_type"], array("rte_menu")))
546 if ($this->super_type == "rte")
547 {
548 $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
549 include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
550 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
551 }
552
553 $cur = explode(".",$_GET["tag"]);
554 $cur_tag = $cur[0];
555 $cur_class = $cur[1];
556
557 $this->initTagStyleForm("edit", $cur_tag);
558 $this->getValues();
560 }
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
getValues()
FORM: Get current values from persistent object.
outputTagStyleEditScreen()
Output tag style edit screen.
if(!is_array($argv)) $options

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

+ Here is the call graph for this function:

◆ editTemplateObject()

ilObjStyleSheetGUI::editTemplateObject ( )

Edit table template.

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

2228 {
2229 global $tpl, $ilCtrl;
2230
2231 $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2232 $this->initTemplateForm("edit");
2233 $this->getTemplateFormValues();
2234
2235 $this->displayTemplateEditForm();
2236 }
getTemplateFormValues()
Set values for table template editing.
displayTemplateEditForm()
Display table tempalte edit form.

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

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjStyleSheetGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

48 {
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd("edit");
51
52 // #9440/#9489: prepareOutput will fail if not set properly
53 if(!$this->object)
54 {
55 $this->setCreationMode(true);
56 }
57
58 $this->prepareOutput();
59 switch($next_class)
60 {
61 default:
62 $cmd.= "Object";
63 $ret =& $this->$cmd();
64 break;
65 }
66
67 return $ret;
68 }
prepareOutput()
prepare output
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

export style

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

833 {
834 include_once("./Services/Export/classes/class.ilExport.php");
835 $exp = new ilExport();
836 $r = $exp->exportObject($this->object->getType(),$this->object->getId());
837
838 ilUtil::deliverFile($r["directory"]."/".$r["file"], $r["file"], '', false, true);
839 }
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
$r
Definition: example_031.php:79

References $r, and ilUtil\deliverFile().

+ Here is the call graph for this function:

◆ extractParametersOfTag()

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

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

842 {
843 $parameters = array();
844 foreach($a_style as $tag)
845 {
846 foreach($tag as $par)
847 {
848 if ($par["tag"] == $a_tag && $par["class"] == $a_class
849 && $par["type"] == $a_type && (int) $a_mq_id == (int) $par["mq_id"]
850 && (int) $a_custom == (int) $par["custom"])
851 {
852 $parameters[$par["parameter"]] = $par["value"];
853 }
854 }
855 }
856 return $parameters;
857 }

Referenced by getValues().

+ Here is the caller graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

2669 {
2670 global $tpl;
2671
2673 $tpl->setContent($this->form_gui->getHTML());
2674 }
initTemplateGenerationForm()
Init table template generation form.

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSheetGUI::getAdminTabs ( $tabs_gui)

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

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

1096 {
1097 $this->getTabs($tabs_gui);
1098 }
getTabs(&$tabs_gui)
adds tabs to tab gui object

References getTabs().

+ Here is the call graph for this function:

◆ getColorFormValues()

ilObjStyleSheetGUI::getColorFormValues ( )

Set values for color editing.

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

1847 {
1848 if ($_GET["c_name"] != "")
1849 {
1850 $values["color_name"] = $_GET["c_name"];
1851 $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1852 $this->form_gui->setValuesByArray($values);
1853 }
1854 }

References $_GET.

Referenced by editColorObject().

+ Here is the caller graph for this function:

◆ getMediaQueryFormValues()

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

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

2063 {
2064 if ($_GET["mq_id"] != "")
2065 {
2066 foreach ($this->object->getMediaQueries() as $mq)
2067 {
2068 if ($mq["id"] == (int) $_GET["mq_id"])
2069 {
2070 $values["mquery"] = $mq["mquery"];
2071 }
2072 }
2073 $this->form_gui->setValuesByArray($values);
2074 }
2075 }

References $_GET.

Referenced by editMediaQueryObject().

+ Here is the caller graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

267 {
268 $values = array();
269
270 $values["style_title"] = $this->object->getTitle();
271 $values["style_description"] = $this->object->getDescription();
272 $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
273
274 $this->form->setValuesByArray($values);
275 }

Referenced by propertiesObject().

+ Here is the caller graph for this function:

◆ getStyleExampleHTML()

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

Get style example HTML.

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

1626 {
1627 global $lng;
1628
1629 $c = explode(":", $a_class);
1630 $a_class = $c[0];
1631
1632 $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style");
1633
1634 if ($ex_tpl->blockExists("Example_".$a_type))
1635 {
1636 $ex_tpl->setCurrentBlock("Example_".$a_type);
1637 }
1638 else
1639 {
1640 $ex_tpl->setCurrentBlock("Example_default");
1641 }
1642 $ex_tpl->setVariable("EX_CLASS", "ilc_".$a_type."_".$a_class);
1643 $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1644 if (in_array($a_type, array("media_cont", "qimg")))
1645 {
1646 //
1647 }
1648 if (in_array($a_type, array("table", "table_caption")))
1649 {
1650 $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1651 }
1652 if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal")))
1653 {
1654 $ex_tpl->setVariable("HOR", "Horizontal");
1655 }
1656 $ex_tpl->parseCurrentBlock();
1657
1658 return $ex_tpl->get();
1659 }

References ilObjectGUI\$lng.

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

+ Here is the caller graph for this function:

◆ getTabs()

ilObjStyleSheetGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

1125 {
1126 global $lng, $ilCtrl, $ilTabs, $ilHelp;
1127
1128 $ilHelp->setScreenIdComponent("sty");
1129
1130 if ($ilCtrl->getCmd() == "editTagStyle")
1131 {
1132 // back to upper context
1133 $tabs_gui->setBackTarget($lng->txt("back"),
1134 $ilCtrl->getLinkTarget($this, "edit"));
1135
1136 $t = explode(".", $_GET["tag"]);
1137 $t2 = explode(":", $t[1]);
1138 $pc = $this->object->_getPseudoClasses($t[0]);
1139 if (is_array($pc) && count($pc) > 0)
1140 {
1141 // style classes
1142 $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0]);
1143 $tabs_gui->addTarget("sty_tag_normal",
1144 $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1145 get_class($this));
1146 if ($t2[1] == "")
1147 {
1148 $ilTabs->setTabActive("sty_tag_normal");
1149 }
1150
1151 foreach ($pc as $p)
1152 {
1153 // style classes
1154 $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0].":".$p);
1155 $tabs_gui->addTarget("sty_tag_".$p,
1156 $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1157 get_class($this));
1158 if ($t2[1] == $p)
1159 {
1160 $ilTabs->setTabActive("sty_tag_".$p);
1161 }
1162 }
1163 $ilCtrl->setParameter($this, "tag", $_GET["tag"]);
1164 }
1165 }
1166 else
1167 {
1168 // back to upper context
1169 $tabs_gui->setBackTarget($lng->txt("back"),
1170 $this->ctrl->getLinkTarget($this, "returnToUpperContext"));
1171
1172 // style classes
1173 $tabs_gui->addTarget("sty_style_chars",
1174 $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1175 get_class($this));
1176
1177 // colors
1178 $tabs_gui->addTarget("sty_colors",
1179 $this->ctrl->getLinkTarget($this, "listColors"), "listColors",
1180 get_class($this));
1181
1182 // media queries
1183 $tabs_gui->addTarget("sty_media_queries",
1184 $this->ctrl->getLinkTarget($this, "listMediaQueries"), "listMediaQueries",
1185 get_class($this));
1186
1187 // images
1188 $tabs_gui->addTarget("sty_images",
1189 $this->ctrl->getLinkTarget($this, "listImages"), "listImages",
1190 get_class($this));
1191
1192 // table templates
1193 $tabs_gui->addTarget("sty_templates",
1194 $this->ctrl->getLinkTarget($this, "listTemplates"), "listTemplates",
1195 get_class($this));
1196
1197 // settings
1198 $tabs_gui->addTarget("settings",
1199 $this->ctrl->getLinkTarget($this, "properties"), "properties",
1200 get_class($this));
1201
1202 // accordiontest
1203/*
1204 $tabs_gui->addTarget("accordiontest",
1205 $this->ctrl->getLinkTarget($this, "accordiontest"), "accordiontest",
1206 get_class($this));*/
1207 }
1208
1209 }

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

Referenced by getAdminTabs(), and setTabs().

+ Here is the caller graph for this function:

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

2548 {
2549 if ($_GET["t_id"] > 0)
2550 {
2551 $t = $this->object->getTemplate($_GET["t_id"]);
2552
2553 $values["name"] = $t["name"];
2555 foreach ($scs as $k => $type)
2556 {
2557 $values[$k."_class"] = $t["classes"][$k];
2558 }
2559 $this->form_gui->setValuesByArray($values);
2560 }
2561 }
static _getTemplateClassTypes($a_template_type="")
Get template class types.

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

Referenced by editTemplateObject().

+ 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 2241 of file class.ilObjStyleSheetGUI.php.

2242 {
2243 return $this->_getTemplatePreview(
2244 $this->object, $a_type, $a_t_id, $a_small_mode);
2245 }
_getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.

References _getTemplatePreview().

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

+ 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 777 of file class.ilObjStyleSheetGUI.php.

778 {
779 $style = $this->object->getStyle();
780 $cur = explode(".",$_GET["tag"]);
781 $cur_tag = $cur[0];
782 $cur_class = $cur[1];
783 $cur_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
784 (int) $_GET["mq_id"], false);
786 foreach($parameters as $p => $v)
787 {
788 $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
789 if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]]))
790 {
791 continue;
792 }
793 $p = explode(".", $p);
794 $p = $p[0];
795 $input = $this->form_gui->getItemByPostVar($p);
796 switch ($v["input"])
797 {
798 case "":
799 break;
800
801 case "trbl_numeric":
802 case "border_width":
803 case "border_style":
804 case "trbl_color":
805 $input->setAllValue($cur_parameters[$v["subpar"][0]]);
806 $input->setTopValue($cur_parameters[$v["subpar"][1]]);
807 $input->setRightValue($cur_parameters[$v["subpar"][2]]);
808 $input->setBottomValue($cur_parameters[$v["subpar"][3]]);
809 $input->setLeftValue($cur_parameters[$v["subpar"][4]]);
810 break;
811
812 default:
813 $input->setValue($cur_parameters[$p]);
814 break;
815 }
816 }
817
818 $cust_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
819 (int) $_GET["mq_id"], true);
820 $vals = array();
821 foreach ($cust_parameters as $k => $c)
822 {
823 $vals[] = $k.": ".$c;
824 }
825 $input = $this->form_gui->getItemByPostVar("custom_par");
826 $input->setValue($vals);
827 }
extractParametersOfTag($a_tag, $a_class, $a_style, $a_type, $a_mq_id=0, $a_custom=false)
static _getStyleParameters($a_tag="")
$style
Definition: example_012.php:70

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

Referenced by editTagStyleObject().

+ 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 @access public.

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

28 {
29 global $ilCtrl, $lng, $tpl;
30
31 $this->ctrl =& $ilCtrl;
32 $this->lng =& $lng;
33 $this->lng->loadLanguageModule("style");
34 $ilCtrl->saveParameter($this, array("tag", "style_type", "temp_type"));
35 if ($_GET["style_type"] != "")
36 {
37 $this->super_type = ilObjStyleSheet::_getStyleSuperTypeForType($_GET["style_type"]);
38 }
39
40 $this->type = "sty";
41 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
42 }
static _getStyleSuperTypeForType($a_type)
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

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

+ Here is the call graph for this function:

◆ importStyleObject()

ilObjStyleSheetGUI::importStyleObject ( )

import style sheet

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

1018 {
1019 // check file
1020 $source = $_FILES["importfile"]["tmp_name"];
1021 if (($source == 'none') || (!$source))
1022 {
1023 $this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
1024 }
1025
1026 // check correct file type
1027 $info = pathinfo($_FILES["importfile"]["name"]);
1028 if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml")
1029 {
1030 $this->ilias->raiseError("File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
1031 }
1032
1033 // new import
1034 $fname = explode("_", $_FILES["importfile"]["name"]);
1035 if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty")
1036 {
1037 include_once("./Services/Export/classes/class.ilImport.php");
1038 $imp = new ilImport();
1039 $new_id = $imp->importObject(null, $_FILES["importfile"]["tmp_name"],
1040 $_FILES["importfile"]["name"], "sty");
1041 if ($new_id > 0)
1042 {
1043 $newObj = ilObjectFactory::getInstanceByObjId($new_id);
1044 }
1045 }
1046 else // old import
1047 {
1048 require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1049 $newObj = new ilObjStyleSheet();
1050 $newObj->import($_FILES["importfile"]);
1051 }
1052
1053 // assign style to style sheet folder,
1054 // if parent is style sheet folder
1055 if ($_GET["ref_id"] > 0)
1056 {
1057 $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1058 if ($fold->getType() == "stys")
1059 {
1060 $fold->addStyle($newObj->getId());
1061 $fold->update();
1062 ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1063 $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
1064 }
1065 }
1066 return $newObj->getId();
1067 }
Import class.
Class ilObjStyleSheet.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$info
Definition: example_052.php:80
redirection script todo: (a better solution should control the processing via a xml file)

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

+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

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

158 {
159 // set style sheet
160 $this->tpl->setCurrentBlock("ContentStyle");
161 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
162 $this->object->getContentStylePath($this->object->getId()));
163 $this->tpl->parseCurrentBlock();
164 }

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

+ 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 1577 of file class.ilObjStyleSheetGUI.php.

1578 {
1579 global $lng, $ilCtrl;
1580
1581 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1582 $this->form_gui = new ilPropertyFormGUI();
1583
1584 // title
1585 $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1586 $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1587 $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include")." A-Z, a-z, 1-9");
1588 $txt_input->setRequired(true);
1589 $this->form_gui->addItem($txt_input);
1590
1591 // type
1592 $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1593 $types = $all_super_types[$this->super_type];
1594 $exp_types = array();
1595 foreach($types as $t)
1596 {
1598 {
1599 $exp_types[$t] = $lng->txt("sty_type_".$t);
1600 }
1601 }
1602 if (count($exp_types) > 1)
1603 {
1604 $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1605 $type_input->setOptions($exp_types);
1606 $type_input->setValue(key($exp_types));
1607 $this->form_gui->addItem($type_input);
1608 }
1609 else if (count($exp_types) == 1)
1610 {
1611 $hid_input = new ilHiddenInputGUI("type");
1612 $hid_input->setValue(key($exp_types));
1613 $this->form_gui->addItem($hid_input);
1614 }
1615
1616 $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1617 $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1618 $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1619 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1620 }
This class represents a hidden form property in a property form.
This class represents a regular expression input property in a property form.

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

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

+ 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 1806 of file class.ilObjStyleSheetGUI.php.

1807 {
1808 global $lng, $ilCtrl;
1809
1810 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1811 $this->form_gui = new ilPropertyFormGUI();
1812
1813 $this->form_gui->setTitle($lng->txt("sty_add_color"));
1814
1815 // name
1816 $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1817 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1818 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
1819 $name_input->setRequired(true);
1820 $name_input->setSize(15);
1821 $name_input->setMaxLength(15);
1822 $this->form_gui->addItem($name_input);
1823
1824 // code
1825 $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1826 $color_input->setRequired(true);
1827 $color_input->setDefaultColor("");
1828 $this->form_gui->addItem($color_input);
1829
1830 if ($a_mode == "create")
1831 {
1832 $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1833 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1834 }
1835 else
1836 {
1837 $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1838 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1839 }
1840 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1841 }
Color picker form for selecting color hexcodes using yui library.

References $ilCtrl, and ilObjectGUI\$lng.

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

+ Here is the caller graph for this function:

◆ initImageForm()

ilObjStyleSheetGUI::initImageForm ( )

Init image form.

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

1368 {
1369 global $lng, $ilCtrl;
1370
1371 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1372 $this->form_gui = new ilPropertyFormGUI();
1373
1374 $this->form_gui->setTitle($lng->txt("sty_add_image"));
1375
1376 $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1377 $file_input->setRequired(true);
1378 $this->form_gui->addItem($file_input);
1379
1380 $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1381 $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1382 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1383 }
This class represents an image file property in a property form.

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by addImageObject(), and uploadImageObject().

+ Here is the caller graph for this function:

◆ initMediaQueryForm()

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

Init media query form.

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

2032 {
2033 global $lng, $ilCtrl;
2034
2035 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2036 $this->form_gui = new ilPropertyFormGUI();
2037
2038 $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2039
2040 // media query
2041 $ti = new ilTextInputGUI("@media", "mquery");
2042 $ti->setMaxLength(2000);
2043 $this->form_gui->addItem($ti);
2044
2045
2046 if ($a_mode == "create")
2047 {
2048 $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2049 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2050 }
2051 else
2052 {
2053 $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2054 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2055 }
2056 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2057 }

References $ilCtrl, and ilObjectGUI\$lng.

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

+ 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 282 of file class.ilObjStyleSheetGUI.php.

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

References $_GET, and ilObjectGUI\$lng.

Referenced by propertiesObject(), and updateObject().

+ 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 612 of file class.ilObjStyleSheetGUI.php.

613 {
614 global $lng, $ilCtrl;
615
616 $ilCtrl->saveParameter($this, array("mq_id"));
617
618 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
619 $this->form_gui = new ilPropertyFormGUI();
620
621 $avail_pars = $this->object->getAvailableParameters();
622 $groups = $this->object->getStyleParameterGroups();
623
624 // output select lists
625 foreach ($groups as $k => $group)
626 {
627 // filter groups of properties that should only be
628 // displayed with matching tag
629 $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
630 if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
631 {
632 continue;
633 }
634
635 $sh = new ilFormSectionHeaderGUI();
636 $sh->setTitle($lng->txt("sty_".$k));
637 $this->form_gui->addItem($sh);
638
639 foreach ($group as $par)
640 {
641 $basepar = explode(".", $par);
642 $basepar = $basepar[0];
643
644 $var = str_replace("-", "_", $basepar);
645 $up_par = strtoupper($var);
646
648 {
649 case "select":
650 $sel_input = new ilSelectInputGUI($lng->txt("sty_".$var), $basepar);
651 $options = array("" => "");
652 foreach ($avail_pars[$par] as $p)
653 {
654 $options[$p] = $p;
655 }
656 $sel_input->setOptions($options);
657 $this->form_gui->addItem($sel_input);
658 break;
659
660 case "text":
661 $text_input = new ilTextInputGUI($lng->txt("sty_".$var), $basepar);
662 $text_input->setMaxLength(200);
663 $text_input->setSize(20);
664 $this->form_gui->addItem($text_input);
665 break;
666
667 case "fontsize":
668 include_once("./Services/Style/classes/class.ilFontSizeInputGUI.php");
669 $fs_input = new ilFontSizeInputGUI($lng->txt("sty_".$var), $basepar);
670 $this->form_gui->addItem($fs_input);
671 break;
672
673 case "numeric_no_perc":
674 case "numeric":
675 include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
676 $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
677 if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc")
678 {
679 $num_input->setAllowPercentage(false);
680 }
681 $this->form_gui->addItem($num_input);
682 break;
683
684 case "percentage":
685 $per_input = new ilNumberInputGUI($lng->txt("sty_".$var), $basepar);
686 $per_input->setMinValue(0);
687 $per_input->setMaxValue(100);
688 $per_input->setMaxLength(3);
689 $per_input->setSize(3);
690 $this->form_gui->addItem($per_input);
691 break;
692
693 case "color":
694 //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
695 $col_input = new ilColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
696 $col_input->setDefaultColor("");
697 $col_input->setAcceptNamedColors(true);
698 $this->form_gui->addItem($col_input);
699 break;
700
701 case "trbl_numeric":
702 include_once("./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
703 $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
704 if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc")
705 {
706 $num_input->setAllowPercentage(false);
707 }
708 $this->form_gui->addItem($num_input);
709 break;
710
711 case "border_width":
712 include_once("./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
713 $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_".$var), $basepar);
714 $this->form_gui->addItem($bw_input);
715 break;
716
717 case "border_style":
718 include_once("./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
719 $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_".$var), $basepar);
720 $this->form_gui->addItem($bw_input);
721 break;
722
723 case "trbl_color":
724 include_once("./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
725 $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
726 $col_input->setAcceptNamedColors(true);
727 $this->form_gui->addItem($col_input);
728 break;
729
730 case "background_image":
731 include_once("./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
732 $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_".$var), $basepar);
733 $imgs = array();
734 foreach ($this->object->getImages() as $entry)
735 {
736 $imgs[] = $entry["entry"];
737 }
738 $im_input->setImages($imgs);
739 $this->form_gui->addItem($im_input);
740 break;
741
742 case "background_position":
743 include_once("./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
744 $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_".$var), $basepar);
745 $this->form_gui->addItem($im_input);
746 break;
747 }
748 }
749 }
750
751 // custom parameters
752 $sh = new ilFormSectionHeaderGUI();
753 $sh->setTitle($lng->txt("sty_custom"));
754 $this->form_gui->addItem($sh);
755
756 // custom parameters
757 $ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
758 $ti->setMaxLength(300);
759 $ti->setSize(80);
760 $ti->setMulti(true);
761 $ti->setInfo($this->lng->txt("sty_custom_par_info"));
762 $this->form_gui->addItem($ti);
763
764
765 // save and cancel commands
766 $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
767 $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
768
769// $this->form_gui->setTitle($lng->txt("edit"));
770 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
771 }
This class represents a background image property in a property form.
This class represents a background position in a property form.
This class represents a fint size property in a property form.
This class represents a section header in a property form.
This class represents a number property in a property form.
This class represents a numeric style property in a property form.
static _getStyleParameterInputType($par)
This class represents a border style with all/top/right/bottom/left in a property form.
This class represents a border width with all/top/right/bottom/left in a property form.
Color picker form for selecting color hexcodes using yui library (all/top/right/bottom/left)
This class represents a numeric style property with all/top/right/bottom/left in a property form.

References $ilCtrl, ilObjectGUI\$lng, $options, ilObjStyleSheet\_getFilteredGroups(), and ilObjStyleSheet\_getStyleParameterInputType().

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

+ 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 2382 of file class.ilObjStyleSheetGUI.php.

2383 {
2384 global $lng, $ilCtrl;
2385
2386 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2387 $this->form_gui = new ilPropertyFormGUI();
2388
2389 if ($a_mode == "create")
2390 {
2391 $this->form_gui->setTitle($lng->txt("sty_add_template"));
2392 }
2393 else
2394 {
2395 $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2396 }
2397
2398 // name
2399 $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2400 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2401 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2402 $name_input->setRequired(true);
2403 $name_input->setSize(30);
2404 $name_input->setMaxLength(30);
2405 $this->form_gui->addItem($name_input);
2406
2407 // template style classes
2409 foreach ($scs as $sc => $st)
2410 {
2411 $sc_input = new ilSelectInputGUI($lng->txt("sty_".$sc."_class"), $sc."_class");
2412 $chars = $this->object->getCharacteristics($st);
2413 $options = array("" => "");
2414 foreach($chars as $char)
2415 {
2416 $options[$char] = $char;
2417 }
2418 $sc_input->setOptions($options);
2419 $this->form_gui->addItem($sc_input);
2420 }
2421
2422 if ($a_mode == "create")
2423 {
2424 $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2425 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2426 }
2427 else
2428 {
2429 $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2430 $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2431 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2432 }
2433 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2434 }

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

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

+ 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 2679 of file class.ilObjStyleSheetGUI.php.

2680 {
2681 global $lng, $ilCtrl;
2682
2683 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2684 $this->form_gui = new ilPropertyFormGUI();
2685
2686 $this->form_gui->setTitle($lng->txt("sty_generate_template"));
2687
2688 // name
2689 $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2690 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2691 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2692 $name_input->setRequired(true);
2693 $name_input->setSize(30);
2694 $name_input->setMaxLength(30);
2695 $this->form_gui->addItem($name_input);
2696
2697 // basic layout
2698 $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
2699 $options = array(
2700 "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
2701 "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
2702 "noZebra" => $lng->txt("sty_table_template_no_zebra")
2703 );
2704 $bl_input->setOptions($options);
2705 $this->form_gui->addItem($bl_input);
2706
2707 // top bottom padding
2708 include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2709 $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
2710 $num_input->setAllowPercentage(false);
2711 $num_input->setValue("3px");
2712 $this->form_gui->addItem($num_input);
2713
2714 // left right padding
2715 $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
2716 $num_input->setAllowPercentage(false);
2717 $num_input->setValue("10px");
2718 $this->form_gui->addItem($num_input);
2719
2720 // base color
2721 $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
2722 $cs = $this->object->getColors();
2723 $options = array();
2724 foreach ($cs as $c)
2725 {
2726 $options[$c["name"]] = $c["name"];
2727 }
2728 $bc_input->setOptions($options);
2729 $this->form_gui->addItem($bc_input);
2730
2731 // Lightness Settings
2732 $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
2733 "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
2734 foreach ($lss as $ls => $v)
2735 {
2736 $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_".$ls), "lightness_".$ls);
2737 $l_input->setMaxValue(100);
2738 $l_input->setMinValue(-100);
2739 $l_input->setValue($v);
2740 $l_input->setSize(4);
2741 $l_input->setMaxLength(4);
2742 $this->form_gui->addItem($l_input);
2743 }
2744
2745 $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
2746 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2747 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2748 }

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

Referenced by generateTemplateObject(), and templateGenerationObject().

+ Here is the caller graph for this function:

◆ listColorsObject()

ilObjStyleSheetGUI::listColorsObject ( )

List colors of style.

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

1762 {
1763 global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
1764
1765 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1766 {
1767 $ilToolbar->addButton($this->lng->txt("sty_add_color"),
1768 $ilCtrl->getLinkTarget($this, "addColor"));
1769 }
1770
1771 include_once("./Services/Style/classes/class.ilStyleColorTableGUI.php");
1772 $table_gui = new ilStyleColorTableGUI($this, "listColors",
1773 $this->object);
1774 $tpl->setContent($table_gui->getHTML());
1775
1776 }
TableGUI class for style editor (image list)

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

◆ listImagesObject()

ilObjStyleSheetGUI::listImagesObject ( )

List images of style.

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

1305 {
1306 global $tpl, $ilToolbar, $ilCtrl, $lng, $rbacsystem;
1307
1308 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1309 {
1310 $ilToolbar->addButton($lng->txt("sty_add_image"),
1311 $ilCtrl->getLinkTarget($this, "addImage"));
1312 }
1313
1314 include_once("./Services/Style/classes/class.ilStyleImageTableGUI.php");
1315 $table_gui = new ilStyleImageTableGUI($this, "listImages",
1316 $this->object);
1317 $tpl->setContent($table_gui->getHTML());
1318
1319 }
TableGUI class for style editor (image list)

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

◆ listMediaQueriesObject()

ilObjStyleSheetGUI::listMediaQueriesObject ( )

List media queries of style.

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

1988 {
1989 global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
1990
1991 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1992 {
1993 $ilToolbar->addButton($this->lng->txt("sty_add_media_query"),
1994 $ilCtrl->getLinkTarget($this, "addMediaQuery"));
1995 }
1996
1997 include_once("./Services/Style/classes/class.ilStyleMediaQueryTableGUI.php");
1998 $table_gui = new ilStyleMediaQueryTableGUI($this, "listMediaQueries",
1999 $this->object);
2000 $tpl->setContent($table_gui->getHTML());
2001 }
TableGUI class for style editor (image list)

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

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

2191 {
2192 global $tpl, $ilTabs, $ilCtrl;
2193
2194 $ctype = $_GET["temp_type"];
2195 if ($ctype == "")
2196 {
2197 $ctype = "table";
2198 $ilCtrl->setParameter($this, "temp_type", $ctype);
2199 $_GET["temp_type"] = $ctype;
2200 }
2201
2202 $this->setTemplatesSubTabs();
2203 $ilTabs->setSubTabActive("sty_".$ctype."_templates");
2204
2205 $this->includeCSS();
2206 include_once("./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
2207 $table_gui = new ilTableTemplatesTableGUI($ctype, $this, "listTemplates",
2208 $this->object);
2209 $tpl->setContent($table_gui->getHTML());
2210
2211 }
setTemplatesSubTabs()
adds tabs to tab gui object

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

+ Here is the call graph for this function:

◆ newStyleParameterObject()

ilObjStyleSheetGUI::newStyleParameterObject ( )

add style parameter

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

863 {
864 $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
865 $this->editObject();
866 }

References $_POST, and editObject().

+ Here is the call graph for this function:

◆ outputTagStyleEditScreen()

ilObjStyleSheetGUI::outputTagStyleEditScreen ( )

Output tag style edit screen.

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

581 {
582 global $tpl, $ilCtrl, $lng;
583
584 // set style sheet
585 $tpl->setCurrentBlock("ContentStyle");
586 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
587 $this->object->getContentStylePath($this->object->getId()));
588
589 $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style");
590
591 $cur = explode(".",$_GET["tag"]);
592 $cur_tag = $cur[0];
593 $cur_class = $cur[1];
594
595 $ts_tpl->setVariable("EXAMPLE",
596 ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class));
597
598 $ts_tpl->setVariable("FORM",
599 $this->form_gui->getHtml());
600
601 $tpl->setTitle($cur_class." (".$lng->txt("sty_type_".$_GET["style_type"]).")");
602
603 $tpl->setContent($ts_tpl->get());
604 }
static getStyleExampleHTML($a_type, $a_class)
Get style example HTML.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteCharacteristicsObject()

ilObjStyleSheetGUI::pasteCharacteristicsObject ( )

Paste characteristics.

Parameters

return

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

1730 {
1731 global $ilCtrl, $lng;
1732
1733 if (is_array($_POST["title"]))
1734 {
1735 foreach ($_POST["title"] as $from_char => $to_title)
1736 {
1737 $fc = explode(".", $from_char);
1738
1739 if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1740 !$this->object->characteristicExists($to_title, $fc[0]))
1741 {
1742 $this->object->copyCharacteristic($_POST["from_style_id"],
1743 $fc[0], $fc[2], $to_title);
1744 }
1745 }
1746 ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1747 unset($_SESSION["sty_copy"]);
1748 ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1749 }
1750
1751 $ilCtrl->redirect($this, "edit");
1752 }
_writeUpToDate($a_id, $a_up_to_date)
Write up to date.

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

+ Here is the call graph for this function:

◆ pasteCharacteristicsOverviewObject()

ilObjStyleSheetGUI::pasteCharacteristicsOverviewObject ( )

Paste characteristics overview.

Parameters

return

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

1712 {
1713 global $tpl, $ilTabs;
1714
1715 $ilTabs->clearTargets();
1716
1717 include_once("./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1718 $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1719
1720 $tpl->setContent($table->getHTML());
1721 }

References ilObjectGUI\$tpl.

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

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

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

+ Here is the call graph for this function:

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

872 {
873 $this->object->setTitle($_POST["style_title"]);
874 $this->object->setDescription($_POST["style_description"]);
875
876 foreach($_POST["styval"] as $id => $value)
877 {
878 $this->object->updateStyleParameter($id, $value);
879 }
880 $this->object->update();
881 $this->editObject();
882 }

References $_POST, and editObject().

+ Here is the call graph for this function:

◆ refreshTagStyleObject()

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

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

356 {
357 global $ilCtrl;
358
359 $cur = explode(".",$_GET["tag"]);
360 $cur_tag = $cur[0];
361 $cur_class = $cur[1];
362
363 $this->initTagStyleForm("edit", $cur_tag);
364
365 if ($this->form_gui->checkInput())
366 {
367 $this->saveTagStyle();
368 $ilCtrl->redirect($this, "editTagStyle");
369 }
370 else
371 {
372 $this->form_gui->setValuesByPost();
374 }
375 }

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

+ Here is the call graph for this function:

◆ refreshTemplateObject()

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

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

2540 {
2541 $this->updateTemplateObject(true);
2542 }
updateTemplateObject($a_refresh=false)
Update table template.

References updateTemplateObject().

+ Here is the call graph for this function:

◆ returnToUpperContextObject()

ilObjStyleSheetGUI::returnToUpperContextObject ( )

return to upper context

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

2915 {
2916 global $ilCtrl;
2917
2918 if ($_GET["baseClass"] == "ilAdministrationGUI")
2919 {
2920 $ilCtrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
2921 }
2922 $ilCtrl->returnToParent($this);
2923 }

References $_GET, and $ilCtrl.

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

1546 {
1547 global $ilCtrl, $tpl, $lng;
1548
1549 $this->initCharacteristicForm("create");
1550
1551 if ($this->form_gui->checkInput())
1552 {
1553 if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"]))
1554 {
1555 $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1556 $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1557 }
1558 else
1559 {
1560 $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1561 ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1562 $ilCtrl->setParameter($this, "tag",
1563 ilObjStyleSheet::_determineTag($_POST["type"]).".".$_POST["new_characteristic"]);
1564 $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1565 $ilCtrl->redirect($this, "editTagStyle");
1566 }
1567 }
1568 $this->form_gui->setValuesByPost();
1569 $tpl->setContent($this->form_gui->getHTML());
1570 }

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

+ Here is the call graph for this function:

◆ saveColorObject()

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

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

1870 {
1871 global $tpl, $ilCtrl, $lng;
1872
1873 $this->initColorForm();
1874
1875 if ($this->form_gui->checkInput())
1876 {
1877 if ($this->object->colorExists($_POST["color_name"]))
1878 {
1879 $col_input = $this->form_gui->getItemByPostVar("color_name");
1880 $col_input->setAlert($lng->txt("sty_color_already_exists"));
1881 }
1882 else
1883 {
1884 $this->object->addColor($_POST["color_name"],
1885 $_POST["color_code"]);
1886 $ilCtrl->redirect($this, "listColors");
1887 }
1888 }
1889 $this->form_gui->setValuesByPost();
1890 $tpl->setContent($this->form_gui->getHTML());
1891 }

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

+ Here is the call graph for this function:

◆ saveHideStatusObject()

ilObjStyleSheetGUI::saveHideStatusObject ( )

Save hide status for characteristics.

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

1665 {
1666 global $ilCtrl, $lng;
1667
1668 //var_dump($_POST);
1669
1670 foreach ($_POST["all_chars"] as $char)
1671 {
1672 $ca = explode(".", $char);
1673 $this->object->saveHideStatus($ca[0], $ca[2],
1674 (is_array($_POST["hide"]) && in_array($char, $_POST["hide"])));
1675 }
1676
1677 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1678 $ilCtrl->redirect($this, "edit");
1679 }

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

+ Here is the call graph for this function:

◆ saveMediaQueryObject()

ilObjStyleSheetGUI::saveMediaQueryObject ( )

Save media query.

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

2081 {
2082 global $tpl, $ilCtrl, $lng;
2083
2084 $this->initMediaQueryForm();
2085
2086 if ($this->form_gui->checkInput())
2087 {
2088 $this->object->addMediaQuery($_POST["mquery"]);
2089 $ilCtrl->redirect($this, "listMediaQueries");
2090 }
2091 $this->form_gui->setValuesByPost();
2092 $tpl->setContent($this->form_gui->getHTML());
2093 }

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

+ Here is the call graph for this function:

◆ saveMediaQueryOrderObject()

ilObjStyleSheetGUI::saveMediaQueryOrderObject ( )

Save media query order.

Parameters

return

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

2172 {
2173 global $ilCtrl;
2174
2175 if (is_array($_POST["order"]))
2176 {
2177 $this->object->saveMediaQueryOrder($_POST["order"]);
2178 }
2179 $ilCtrl->redirect($this, "listMediaQueries");
2180 }

References $_POST, and $ilCtrl.

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

Reimplemented from ilObjectGUI.

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

951 {
952 if(!trim($_POST["style_title"]))
953 {
954 $this->ctrl->redirect($this, "create");
955 }
956
957//echo "HH"; exit;
958 $class_name = "ilObjStyleSheet";
959 require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
960 $newObj = new ilObjStyleSheet();
961 $newObj->setTitle("-");
962 $newObj->create();
963 $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
964 $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
965 $newObj->update();
966
967 // assign style to style sheet folder,
968 // if parent is style sheet folder
969 if ($_GET["ref_id"] > 0)
970 {
971
972 $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
973 if ($fold->getType() == "stys")
974 {
975 $fold->addStyle($newObj->getId());
976 $fold->update();
977 ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
978 $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
979 }
980 }
981
982 return $newObj->getId();
983 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

+ Here is the call graph for this function:

◆ saveTagStyle()

ilObjStyleSheetGUI::saveTagStyle ( )

Save tag style.

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

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

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

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

+ 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 2450 of file class.ilObjStyleSheetGUI.php.

2451 {
2452 global $tpl, $ilCtrl, $lng;
2453
2454 $this->initTemplateForm();
2455
2456 if ($this->form_gui->checkInput())
2457 {
2458 if ($this->object->templateExists($_POST["name"]))
2459 {
2460 $name_input = $this->form_gui->getItemByPostVar("name");
2461 $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2462 }
2463 else
2464 {
2465 $classes = array();
2466 foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2467 {
2468 $classes[$tct] = $_POST[$tct."_class"];
2469 }
2470 $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2471 $this->object->writeTemplatePreview($t_id,
2472 $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2473 $ilCtrl->redirect($this, "listTemplates");
2474 }
2475 }
2476 $this->form_gui->setValuesByPost();
2477 $tpl->setContent($this->form_gui->getHTML());
2478 }

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

+ 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 1216 of file class.ilObjStyleSheetGUI.php.

1217 {
1218 global $lng, $ilTabs, $ilCtrl;
1219
1221
1222 foreach ($types as $super_type => $types)
1223 {
1224 // text block characteristics
1225 $ilCtrl->setParameter($this, "style_type", $super_type);
1226 $ilTabs->addSubTabTarget("sty_".$super_type."_char",
1227 $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1228 get_class($this));
1229 }
1230
1231 $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1232 }

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

Referenced by editObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjStyleSheetGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

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

1104 {
1105 global $lng;
1106
1107 $this->getTabs($this->tabs_gui);
1108
1109 if (strtolower(get_class($this->object)) == "ilobjstylesheet")
1110 {
1111 $this->tpl->setVariable("HEADER", $this->object->getTitle());
1112 }
1113 else
1114 {
1115 $this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
1116 }
1117 }

References ilObjectGUI\$lng, and getTabs().

+ 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 1239 of file class.ilObjStyleSheetGUI.php.

1240 {
1241 global $lng, $ilTabs, $ilCtrl;
1242
1244
1245 foreach ($types as $t => $c)
1246 {
1247 $ilCtrl->setParameter($this, "temp_type", $t);
1248 $ilTabs->addSubTabTarget("sty_".$t."_templates",
1249 $this->ctrl->getLinkTarget($this, "listTemplates"), array("listTemplates", ""),
1250 get_class($this));
1251 }
1252
1253 $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1254 }

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

Referenced by listTemplatesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUpperIcon()

ilObjStyleSheetGUI::showUpperIcon ( )

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

1286 {
1287 global $tree, $tpl, $objDefinition;
1288
1289 if (strtolower($_GET["baseClass"]) == "iladministrationgui")
1290 {
1291 $tpl->setUpperIcon(
1292 $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui",
1293 "editContentStyles"));
1294 }
1295 else
1296 {
1297 // ?
1298 }
1299 }

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

◆ switchMQueryObject()

ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters

return

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

569 {
570 global $ilCtrl;
571
572 $ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
573 $ilCtrl->redirect($this, "editTagStyle");
574 }

References $_POST, and $ilCtrl.

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

2754 {
2755 global $tpl, $ilCtrl, $lng;
2756
2758
2759 if ($this->form_gui->checkInput())
2760 {
2761 if ($this->object->templateExists($_POST["name"]))
2762 {
2763 $name_input = $this->form_gui->getItemByPostVar("name");
2764 $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2765 }
2766 else
2767 {
2768 // -> move to application class!
2769
2770 // cell classes
2771 $cells = array("H" => "header", "C1" => "cell1", "C2" => "cell2");
2772 $tb_p = $this->form_gui->getItemByPostVar("tb_padding");
2773 $tb_padding = $tb_p->getValue();
2774 $lr_p = $this->form_gui->getItemByPostVar("lr_padding");
2775 $lr_padding = $lr_p->getValue();
2776 $cell_color = $_POST["base_color"];
2777
2778 // use mid gray as cell color for bw zebra
2779 if ($_POST["layout"] == "bwZebra")
2780 {
2781 $cell_color = "MidGray";
2782 if (!$this->object->colorExists($cell_color))
2783 {
2784 $this->object->addColor($cell_color, "7F7F7F");
2785 }
2786 $this->object->updateColor($cell_color, $cell_color, "7F7F7F");
2787 }
2788
2789 foreach ($cells as $k => $cell)
2790 {
2791 $cell_class[$k] = $_POST["name"].$k;
2792 if (!$this->object->characteristicExists($cell_class[$k], "table_cell"))
2793 {
2794 $this->object->addCharacteristic("table_cell", $cell_class[$k], true);
2795 }
2796 if ($_POST["layout"] == "bwZebra" && $k == "H")
2797 {
2798 $this->object->replaceStylePar("td", $cell_class[$k], "color",
2799 "!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
2800 $this->object->replaceStylePar("td", $cell_class[$k], "background-color",
2801 "!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
2802 }
2803 else
2804 {
2805 $this->object->replaceStylePar("td", $cell_class[$k], "color",
2806 "!".$cell_color."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
2807 $this->object->replaceStylePar("td", $cell_class[$k], "background-color",
2808 "!".$cell_color."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
2809 }
2810 $this->object->replaceStylePar("td", $cell_class[$k], "padding-top",
2811 $tb_padding, "table_cell");
2812 $this->object->replaceStylePar("td", $cell_class[$k], "padding-bottom",
2813 $tb_padding, "table_cell");
2814 $this->object->replaceStylePar("td", $cell_class[$k], "padding-left",
2815 $lr_padding, "table_cell");
2816 $this->object->replaceStylePar("td", $cell_class[$k], "padding-right",
2817 $lr_padding, "table_cell");
2818 $this->object->replaceStylePar("td", $cell_class[$k], "border-width",
2819 "1px", "table_cell");
2820 $this->object->replaceStylePar("td", $cell_class[$k], "border-style",
2821 "solid", "table_cell");
2822 $this->object->replaceStylePar("td", $cell_class[$k], "border-color",
2823 "!".$cell_color."(".$_POST["lightness_border"].")", "table_cell");
2824 $this->object->replaceStylePar("td", $cell_class[$k], "font-weight",
2825 "normal", "table_cell");
2826 }
2827
2828 // table class
2829 $classes["table"] = $_POST["name"]."T";
2830 if (!$this->object->characteristicExists($classes["table"], "table"))
2831 {
2832 $this->object->addCharacteristic("table", $classes["table"], true);
2833 }
2834 $this->object->replaceStylePar("table", $classes["table"], "caption-side",
2835 "bottom", "table");
2836 $this->object->replaceStylePar("table", $classes["table"], "border-collapse",
2837 "collapse", "table");
2838 $this->object->replaceStylePar("table", $classes["table"], "margin-top",
2839 "5px", "table");
2840 $this->object->replaceStylePar("table", $classes["table"], "margin-bottom",
2841 "5px", "table");
2842 if ($_POST["layout"] == "bwZebra")
2843 {
2844 $this->object->replaceStylePar("table", $classes["table"], "border-bottom-color",
2845 "!".$_POST["base_color"], "table");
2846 $this->object->replaceStylePar("table", $classes["table"], "border-bottom-style",
2847 "solid", "table");
2848 $this->object->replaceStylePar("table", $classes["table"], "border-bottom-width",
2849 "3px", "table");
2850 $sb = array("left", "right", "top");
2851 foreach ($sb as $b)
2852 {
2853 $this->object->replaceStylePar("table", $classes["table"], "border-".$b."-width",
2854 "0px", "table");
2855 }
2856 }
2857
2858 switch ($_POST["layout"])
2859 {
2860 case "coloredZebra":
2861 $classes["row_head"] = $cell_class["H"];
2862 $classes["odd_row"] = $cell_class["C1"];
2863 $classes["even_row"] = $cell_class["C2"];
2864 break;
2865
2866 case "bwZebra":
2867 $classes["row_head"] = $cell_class["H"];
2868 $classes["odd_row"] = $cell_class["C1"];
2869 $classes["even_row"] = $cell_class["C2"];
2870 break;
2871
2872 case "noZebra":
2873 $classes["row_head"] = $cell_class["H"];
2874 $classes["odd_row"] = $cell_class["C1"];
2875 $classes["even_row"] = $cell_class["C1"];
2876 $classes["col_head"] = $cell_class["C2"];
2877 break;
2878 }
2879
2880
2881 $t_id = $this->object->addTemplate($_GET["temp_type"],
2882 $_POST["name"], $classes);
2883 $this->object->writeTemplatePreview($t_id,
2884 $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2885 $ilCtrl->redirect($this, "listTemplates");
2886 }
2887 }
2888 $this->form_gui->setValuesByPost();
2889 $tpl->setContent($this->form_gui->getHTML());
2890 }

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

+ Here is the call graph for this function:

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

1897 {
1898 global $tpl, $ilCtrl, $lng;
1899
1900 $this->initColorForm("edit");
1901
1902 if ($this->form_gui->checkInput())
1903 {
1904 if ($this->object->colorExists($_POST["color_name"]) &&
1905 $_POST["color_name"] != $_GET["c_name"])
1906 {
1907 $col_input = $this->form_gui->getItemByPostVar("color_name");
1908 $col_input->setAlert($lng->txt("sty_color_already_exists"));
1909 }
1910 else
1911 {
1912 $this->object->updateColor($_GET["c_name"], $_POST["color_name"],
1913 $_POST["color_code"]);
1914 $ilCtrl->redirect($this, "listColors");
1915 }
1916 }
1917 $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1918 $this->form_gui->setValuesByPost();
1919 $tpl->setContent($this->form_gui->getHTML());
1920 }

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

+ Here is the call graph for this function:

◆ updateMediaQueryObject()

ilObjStyleSheetGUI::updateMediaQueryObject ( )

Update media query.

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

2099 {
2100 global $tpl, $ilCtrl, $lng;
2101
2102 $this->initMediaQueryForm("edit");
2103
2104 if ($this->form_gui->checkInput())
2105 {
2106 $this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
2107 $ilCtrl->redirect($this, "listMediaQueries");
2108 }
2109 $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2110 $this->form_gui->setValuesByPost();
2111 $tpl->setContent($this->form_gui->getHTML());
2112 }

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

+ Here is the call graph for this function:

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

Update properties.

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

◆ updateTagStyleObject()

ilObjStyleSheetGUI::updateTagStyleObject ( )

save and refresh tag editing

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

381 {
382 global $ilCtrl;
383
384 $cur = explode(".",$_GET["tag"]);
385 $cur_tag = $cur[0];
386 $cur_class = $cur[1];
387
388 $this->initTagStyleForm("edit", $cur_tag);
389 if ($this->form_gui->checkInput())
390 {
391 $this->saveTagStyle();
392 $ilCtrl->redirect($this, "edit");
393 }
394 else
395 {
396 $this->form_gui->setValuesByPost();
398 }
399 }

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

+ Here is the call graph for this function:

◆ updateTemplateObject()

ilObjStyleSheetGUI::updateTemplateObject (   $a_refresh = false)

Update table template.

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

2484 {
2485 global $tpl, $ilCtrl, $lng;
2486
2487 $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2488 $this->initTemplateForm("edit");
2489
2490 if ($this->form_gui->checkInput())
2491 {
2492 if ($this->object->templateExists($_POST["name"]) &&
2494 {
2495 $name_input = $this->form_gui->getItemByPostVar("name");
2496 $name_input->setAlert($lng->txt("sty_template_already_exists"));
2497 }
2498 else
2499 {
2500 $classes = array();
2501 foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2502 {
2503 $classes[$tct] = $_POST[$tct."_class"];
2504 }
2505
2506 $this->object->updateTemplate($_GET["t_id"],
2507 $_POST["name"], $classes);
2508 $this->object->writeTemplatePreview($_GET["t_id"],
2509 $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true));
2510 if(!$a_refresh)
2511 {
2512 $ilCtrl->redirect($this, "listTemplates");
2513 }
2514 }
2515 }
2516
2517 $this->form_gui->setValuesByPost();
2518 $this->displayTemplateEditForm();
2519 }
lookupTemplateName($a_t_id)
Lookup table template name for template ID.

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

Referenced by refreshTemplateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadImageObject()

ilObjStyleSheetGUI::uploadImageObject ( )

Upload image.

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

1346 {
1347 global $tpl, $ilCtrl;
1348
1349 $this->initImageForm();
1350
1351 if ($this->form_gui->checkInput())
1352 {
1353 $this->object->uploadImage($_FILES["image_file"]);
1354 $ilCtrl->redirect($this, "listImages");
1355 }
1356 else
1357 {
1358 //$this->form_gui->setImageFormValuesByPost();
1359 $tpl->setContent($this->form_gui->getHTML());
1360 }
1361
1362 }

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

+ Here is the call graph for this function:

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

list childs of current object

@access public

Reimplemented from ilObjectGUI.

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

71 {
72 $this->editObject();
73 }

References editObject().

+ Here is the call graph for this function:

◆ writeStylePar()

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

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

497 {
498// echo $_GET["mq_id"]."-";
499// echo $a_mq_id."-"; exit;
500 if ($a_type == "")
501 {
502 return;
503 }
504
505 if ($value != "")
506 {
507 $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
508 }
509 else
510 {
511 $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
512 }
513 }

Referenced by saveTagStyle().

+ Here is the caller graph for this function:

Field Documentation

◆ $cmd_delete

ilObjStyleSheetGUI::$cmd_delete

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

◆ $cmd_new_par

ilObjStyleSheetGUI::$cmd_new_par

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

◆ $cmd_refresh

ilObjStyleSheetGUI::$cmd_refresh

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

◆ $cmd_update

ilObjStyleSheetGUI::$cmd_update

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


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