ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

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

Public Member Functions

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

Data Fields

 $cmd_update
 
 $cmd_new_par
 
 $cmd_refresh
 
 $cmd_delete
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $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 ()
 
 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...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilObjStyleSheetGUI::__construct (   $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 parent::__construct($a_data,$a_id,$a_call_by_reference, false);
42 }
$_GET["client_id"]
static _getStyleSuperTypeForType($a_type)
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _getTemplatePreview()

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

Get table template preview.

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

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

References $a_type, $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 2913 of file class.ilObjStyleSheetGUI.php.

2914 {
2915 global $tpl;
2916
2917 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2918
2919 $acc = new ilAccordionGUI();
2920 $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2921 $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2922 $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
2923
2924 $ac2 = new ilAccordionGUI();
2925 $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2926 $ac2->addItem("Header 2", $acc->getHTML());
2927 $ac2->setOrientation(ilAccordionGUI::VERTICAL);
2928
2929 $tpl->setContent($ac2->getHTML());
2930 }
Accordion user interface class.

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

◆ addAdminLocatorItems()

ilObjStyleSheetGUI::addAdminLocatorItems (   $a_do_not_add_object = false)

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

Reimplemented from ilObjectGUI.

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

1282 {
1283 global $ilLocator;
1284
1285 if ($_GET["admin_mode"] == "settings") // system settings
1286 {
1287 parent::addAdminLocatorItems(true);
1288
1289 $ilLocator->addItem(ilObject::_lookupTitle(
1290 ilObject::_lookupObjId($_GET["ref_id"])),
1291 $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", ""));
1292
1293 if ($_GET["obj_id"] > 0)
1294 {
1295 $ilLocator->addItem($this->object->getTitle(),
1296 $this->ctrl->getLinkTarget($this, "edit"));
1297 }
1298 }
1299 else // repository administration
1300 {
1301 //?
1302 }
1303
1304 }
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 1555 of file class.ilObjStyleSheetGUI.php.

1556 {
1557 global $tpl;
1558
1559 $this->initCharacteristicForm("create");
1560 $tpl->setContent($this->form_gui->getHTML());
1561 }
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 1802 of file class.ilObjStyleSheetGUI.php.

1803 {
1804 global $tpl;
1805
1806 $this->initColorForm();
1807 $tpl->setContent($this->form_gui->getHTML());
1808 }
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 1345 of file class.ilObjStyleSheetGUI.php.

1346 {
1347 global $tpl;
1348
1349 $this->initImageForm();
1350 $tpl->setContent($this->form_gui->getHTML());
1351 }

References ilObjectGUI\$tpl, and initImageForm().

+ Here is the call graph for this function:

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

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

2028 {
2029 global $tpl;
2030
2031 $this->initMediaQueryForm();
2032 $tpl->setContent($this->form_gui->getHTML());
2033 }
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 2237 of file class.ilObjStyleSheetGUI.php.

2238 {
2239 global $tpl;
2240
2241 $this->initTemplateForm();
2242 $tpl->setContent($this->form_gui->getHTML());
2243 }
initTemplateForm($a_mode="create")
Init table template form.

References ilObjectGUI\$tpl, and initTemplateForm().

+ Here is the call graph for this function:

◆ afterImport()

ilObjStyleSheetGUI::afterImport ( ilObject  $a_new_obj)

After import.

Parameters

return

Reimplemented from ilObjectGUI.

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

1097 {
1098
1099 }

◆ cancelCharacteristicDeletionObject()

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

1522 {
1523 global $ilCtrl, $lng;
1524
1525 ilUtil::sendInfo($lng->txt("action_aborted"), true);
1526 $ilCtrl->redirect($this, "edit");
1527 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ cancelColorDeletionObject()

ilObjStyleSheetGUI::cancelColorDeletionObject ( )

Cancel color deletion.

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

1977 {
1978 global $ilCtrl;
1979
1980 $ilCtrl->redirect($this, "listColors");
1981 }

References $ilCtrl.

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

1881 {
1882 global $ilCtrl;
1883
1884 $ilCtrl->redirect($this, "listColors");
1885 }

References $ilCtrl.

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

Reimplemented from ilObjectGUI.

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

928 {
929 $this->ctrl->returnToParent($this);
930 }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

update style sheet

Reimplemented from ilObjectGUI.

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

1106 {
1107 global $lng;
1108
1109 ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1110 $this->ctrl->returnToParent($this);
1111 }

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

+ Here is the call graph for this function:

◆ cancelTemplateDeletionObject()

ilObjStyleSheetGUI::cancelTemplateDeletionObject ( )

Cancel table template deletion.

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

2637 {
2638 global $ilCtrl;
2639
2640 $ilCtrl->redirect($this, "listTemplates");
2641 }

References $ilCtrl.

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

2461 {
2462 global $ilCtrl;
2463
2464 $ilCtrl->redirect($this, "listTemplates");
2465 }

References $ilCtrl.

◆ cancelUploadObject()

ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

1357 {
1358 global $ilCtrl;
1359
1360 $ilCtrl->redirect($this, "listImages");
1361 }

References $ilCtrl.

◆ checkWrite()

ilObjStyleSheetGUI::checkWrite ( )

Check write.

Parameters

return

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

174 {
175 global $rbacsystem;
176
177 return ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"])
178 || $rbacsystem->checkAccess("sty_write_content", (int) $_GET["ref_id"]));
179 }

References $_GET.

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

+ Here is the caller graph for this function:

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

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

936 {
937 global $ilias;
938
939 $this->object->delete();
940
941 $this->ctrl->returnToParent($this);
942 }

References ilObjectGUI\$ilias.

◆ copyCharacteristicsObject()

ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters

return

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

1709 {
1710 global $ilCtrl, $lng;
1711
1712 if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1713 {
1714 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1715 }
1716 else
1717 {
1718 $style_cp = implode("::", $_POST["char"]);
1719 $style_cp = $this->object->getId().":::".$_GET["style_type"].":::".$style_cp;
1720 $_SESSION["sty_copy"] = $style_cp;
1721 ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1722 }
1723 $ilCtrl->redirect($this, "edit");
1724 }
$_POST["username"]
$_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.

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

1006 {
1007 global $ilias;
1008
1009 if ($_POST["source_style"] > 0)
1010 $style_obj = $ilias->obj_factory->getInstanceByObjId($_POST["source_style"]);
1011 $new_id = $style_obj->ilClone();
1012
1013 // assign style to style sheet folder,
1014 // if parent is style sheet folder
1015 if ($_GET["ref_id"] > 0)
1016 {
1017
1018 $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1019 if ($fold->getType() == "stys")
1020 {
1021 include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1022 $cont_style_settings = new ilContentStyleSettings();
1023 $cont_style_settings->addStyle($new_id);
1024 $cont_style_settings->update();
1025 ilObjStyleSheet::_writeStandard($new_id, "1");
1026 $this->ctrl->returnToParent($this);
1027 }
1028 }
1029
1030 return $new_id;
1031 }
static _writeStandard($a_id, $a_std)
Write standard flag.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

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
static _getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
This class represents a 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 1428 of file class.ilObjStyleSheetGUI.php.

1429 {
1430 global $ilCtrl, $tpl, $lng;
1431
1432//var_dump($_POST);
1433
1434 if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1435 {
1436 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1437 $ilCtrl->redirect($this, "edit");
1438 }
1439 else
1440 {
1441 // check whether there are any core style classes included
1442 $core_styles = ilObjStyleSheet::_getCoreStyles();
1443 foreach ($_POST["char"] as $char)
1444 {
1445 if (!empty($core_styles[$char]))
1446 {
1447 $this->deleteCoreCharMessage();
1448 return;
1449 }
1450 }
1451
1452 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1453 $cgui = new ilConfirmationGUI();
1454 $cgui->setFormAction($ilCtrl->getFormAction($this));
1455 $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1456 $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1457 $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1458
1459 foreach ($_POST["char"] as $char)
1460 {
1461 $char_comp = explode(".", $char);
1462 $cgui->addItem("char[]", $char, $char_comp[2]);
1463 }
1464
1465 $tpl->setContent($cgui->getHTML());
1466 }
1467 }
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 1532 of file class.ilObjStyleSheetGUI.php.

1533 {
1534 global $ilCtrl;
1535
1536 if (is_array($_POST["char"]))
1537 {
1538 foreach($_POST["char"] as $char)
1539 {
1540 $char_comp = explode(".", $char);
1541 $type = $char_comp[0];
1542 $tag = $char_comp[1];
1543 $class = $char_comp[2];
1544
1545 $this->object->deleteCharacteristic($type, $tag, $class);
1546 }
1547 }
1548
1549 $ilCtrl->redirect($this, "edit");
1550 }

References $_POST, and $ilCtrl.

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

1947 {
1948 global $ilCtrl, $tpl, $lng;
1949
1950 if (!is_array($_POST["color"]) || count($_POST["color"]) == 0)
1951 {
1952 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1953 $ilCtrl->redirect($this, "listColors");
1954 }
1955 else
1956 {
1957 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1958 $cgui = new ilConfirmationGUI();
1959 $cgui->setFormAction($ilCtrl->getFormAction($this));
1960 $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
1961 $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
1962 $cgui->setConfirm($lng->txt("delete"), "deleteColor");
1963
1964 foreach ($_POST["color"] as $c)
1965 {
1966 $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
1967 }
1968
1969 $tpl->setContent($cgui->getHTML());
1970 }
1971 }
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 1986 of file class.ilObjStyleSheetGUI.php.

1987 {
1988 global $ilCtrl;
1989
1990 if (is_array($_POST["color"]))
1991 {
1992 foreach ($_POST["color"] as $c)
1993 {
1994 $this->object->removeColor($c);
1995 }
1996 }
1997
1998 $ilCtrl->redirect($this, "listColors");
1999 }

References $_POST, and $ilCtrl.

◆ deleteCoreCharMessage()

ilObjStyleSheetGUI::deleteCoreCharMessage ( )

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

Parameters

return

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

1476 {
1477 global $ilCtrl, $tpl, $lng;
1478
1479 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1480 $cgui = new ilConfirmationGUI();
1481 $cgui->setFormAction($ilCtrl->getFormAction($this));
1482
1483
1484 $core_styles = ilObjStyleSheet::_getCoreStyles();
1485 $cnt = 0;
1486 foreach ($_POST["char"] as $char)
1487 {
1488 if (!empty($core_styles[$char]))
1489 {
1490 $cnt++;
1491 $char_comp = explode(".", $char);
1492 $cgui->addItem("", "", $char_comp[2]);
1493 }
1494 else
1495 {
1496 $cgui->addHiddenItem("char[]", $char);
1497 }
1498 }
1499 $all_core_styles = ($cnt == count($_POST["char"]))
1500 ? true
1501 : false;
1502
1503 if ($all_core_styles)
1504 {
1505 $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1506 $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1507 }
1508 else
1509 {
1510 $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1511 $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1512 $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1513 }
1514
1515 $tpl->setContent($cgui->getHTML());
1516 }

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

1410 {
1411 global $ilCtrl;
1412
1413 $images = $this->object->getImages();
1414
1415 foreach ($images as $image)
1416 {
1417 if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"]))
1418 {
1419 $this->object->deleteImage($image["entry"]);
1420 }
1421 }
1422 $ilCtrl->redirect($this, "listImages");
1423 }

References $_POST, and $ilCtrl.

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters

return

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

2173 {
2174 global $ilCtrl, $rbacsystem;
2175
2176 if ($this->checkWrite() && is_array($_POST["mq_id"]))
2177 {
2178 foreach ($_POST["mq_id"] as $id)
2179 {
2180 $this->object->deleteMediaQuery($id);
2181 }
2182 }
2183 $ilCtrl->redirect($this, "listMediaQueries");
2184 }

References $_POST, $ilCtrl, and checkWrite().

+ Here is the call graph for this function:

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

Confirm media query deletion.

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

2139 {
2140 global $ilCtrl, $tpl, $lng;
2141
2142 if (!is_array($_POST["mq_id"]) || count($_POST["mq_id"]) == 0)
2143 {
2144 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2145 $ilCtrl->redirect($this, "listMediaQueries");
2146 }
2147 else
2148 {
2149 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2150 $cgui = new ilConfirmationGUI();
2151 $cgui->setFormAction($ilCtrl->getFormAction($this));
2152 $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
2153 $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
2154 $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
2155
2156 foreach ($_POST["mq_id"] as $i)
2157 {
2158 $mq = $this->object->getMediaQueryForId($i);
2159 $cgui->addItem("mq_id[]", $i, $mq["mquery"]);
2160 }
2161
2162 $tpl->setContent($cgui->getHTML());
2163 }
2164 }

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

904 {
905 //$this->setTabs();
906
907 // display confirmation message
908 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
909 $cgui = new ilConfirmationGUI();
910 $cgui->setFormAction($this->ctrl->getFormAction($this));
911 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
912 $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
913 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
914
915 $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath).
916 " ".ilObject::_lookupTitle($this->object->getId());
917
918 $cgui->addItem("id[]", "", $caption);
919
920 $this->tpl->setContent($cgui->getHTML());
921 }
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 947 of file class.ilObjStyleSheetGUI.php.

948 {
949 if (is_array($_POST["sty_select"]))
950 {
951 foreach($_POST["sty_select"] as $id => $dummy)
952 {
953 $this->object->deleteParameter($id);
954 }
955 }
956 $this->object->read();
957 $this->object->writeCSSFile();
958 $this->editObject();
959 }

References $_POST, and editObject().

+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

2588 {
2589 global $ilCtrl, $tpl, $lng;
2590
2591 if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
2592 {
2593 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2594 $ilCtrl->redirect($this, "listTemplates");
2595 }
2596 else
2597 {
2598 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2599 $cgui = new ilConfirmationGUI();
2600 $cgui->setFormAction($ilCtrl->getFormAction($this));
2601 $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2602 $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2603 $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2604
2605 foreach ($_POST["tid"] as $tid)
2606 {
2607 $classes = $this->object->getTemplateClasses($tid);
2608 $cl_str = "";
2609 $listed = array();
2610 foreach ($classes as $cl)
2611 {
2612 if ($cl != "" && !$listed[$cl])
2613 {
2614 $cl_str.= '<div>- '.
2615 $cl."</div>";
2616 $listed[$cl] = true;
2617 }
2618 }
2619 if ($cl_str != "")
2620 {
2621 $cl_str = '<div style="padding-left:30px;" class="small">'.
2622 "<div><i>".$lng->txt("sty_style_class")."</i></div>".$cl_str."</div>";
2623 }
2624 $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2625 }
2626
2627 $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2628
2629 $tpl->setContent($cgui->getHTML());
2630 }
2631 }

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

2647 {
2648 global $ilCtrl;
2649
2650 if (is_array($_POST["tid"]))
2651 {
2652 foreach ($_POST["tid"] as $tid)
2653 {
2654 $this->object->removeTemplate($tid);
2655 }
2656 }
2657
2658 $ilCtrl->redirect($this, "listTemplates");
2659 }

References $_POST, and $ilCtrl.

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

2665 {
2666 global $ilCtrl;
2667
2668 if (is_array($_POST["tid"]))
2669 {
2670 foreach ($_POST["tid"] as $tid)
2671 {
2672 $cls = $this->object->getTemplateClasses($tid);
2673 foreach ($cls as $k => $cls)
2674 {
2675 $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2677 $this->object->deleteCharacteristic($ty, $ta, $cls);
2678 }
2679 $this->object->removeTemplate($tid);
2680 }
2681 }
2682
2683 $ilCtrl->redirect($this, "listTemplates");
2684 }
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 2545 of file class.ilObjStyleSheetGUI.php.

2546 {
2547 global $tpl;
2548
2549 $a_tpl = new ilTemplate("tpl.template_edit.html", true, true,
2550 "Services/Style/Content");
2551 $this->includeCSS();
2552 $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2553 $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2554 $tpl->setContent($a_tpl->get());
2555 }
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 1813 of file class.ilObjStyleSheetGUI.php.

1814 {
1815 global $tpl, $ilCtrl;
1816
1817 $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1818 $this->initColorForm("edit");
1819 $this->getColorFormValues();
1820 $tpl->setContent($this->form_gui->getHTML());
1821 }
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 2038 of file class.ilObjStyleSheetGUI.php.

2039 {
2040 global $tpl, $ilCtrl;
2041
2042 $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2043 $this->initMediaQueryForm("edit");
2044 $this->getMediaQueryFormValues();
2045 $tpl->setContent($this->form_gui->getHTML());
2046 }
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 185 of file class.ilObjStyleSheetGUI.php.

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

References $_SESSION, $ilCtrl, ilObjectGUI\$lng, $t, ilObjectGUI\$tpl, ilObjStyleSheet\_getStyleSuperTypes(), ilObjStyleSheet\_isExpandable(), checkWrite(), 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 533 of file class.ilObjStyleSheetGUI.php.

534 {
535 global $tpl, $ilToolbar, $lng, $ilCtrl;
536
537 // media query selector
538 $mqs = $this->object->getMediaQueries();
539 if (count($mqs) > 0)
540 {
541 //
542 $options = array(
543 "" => $lng->txt("sty_default"),
544 );
545 foreach ($mqs as $mq)
546 {
547 $options[$mq["id"]] = $mq["mquery"];
548 }
549 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
550 $si = new ilSelectInputGUI("@media", "mq_id");
551 $si->setOptions($options);
552 $si->setValue((int) $_GET["mq_id"]);
553 $ilToolbar->addInputItem($si, true);
554 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
555 $ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
556 }
557
558 // workaround to include default rte styles
559 //if (in_array($_GET["style_type"], array("rte_menu")))
560 if ($this->super_type == "rte")
561 {
562 $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
563 include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
564 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
565 }
566
567 $cur = explode(".",$_GET["tag"]);
568 $cur_tag = $cur[0];
569 $cur_class = $cur[1];
570
571 $this->initTagStyleForm("edit", $cur_tag);
572 $this->getValues();
574 }
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 2248 of file class.ilObjStyleSheetGUI.php.

2249 {
2250 global $tpl, $ilCtrl;
2251
2252 $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2253 $this->initTemplateForm("edit");
2254 $this->getTemplateFormValues();
2255
2256 $this->displayTemplateEditForm();
2257 }
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($a_show_subobjects=true)
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!...
$ret
Definition: parser.php:6
$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 846 of file class.ilObjStyleSheetGUI.php.

847 {
848 include_once("./Services/Export/classes/class.ilExport.php");
849 $exp = new ilExport();
850 $r = $exp->exportObject($this->object->getType(),$this->object->getId());
851
852 ilUtil::deliverFile($r["directory"]."/".$r["file"], $r["file"], '', false, true);
853 }
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 855 of file class.ilObjStyleSheetGUI.php.

856 {
857 $parameters = array();
858 foreach($a_style as $tag)
859 {
860 foreach($tag as $par)
861 {
862 if ($par["tag"] == $a_tag && $par["class"] == $a_class
863 && $par["type"] == $a_type && (int) $a_mq_id == (int) $par["mq_id"]
864 && (int) $a_custom == (int) $par["custom"])
865 {
866 $parameters[$par["parameter"]] = $par["value"];
867 }
868 }
869 }
870 return $parameters;
871 }

References $a_type.

Referenced by getValues().

+ Here is the caller graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

2690 {
2691 global $tpl;
2692
2694 $tpl->setContent($this->form_gui->getHTML());
2695 }
initTemplateGenerationForm()
Init table template generation form.

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSheetGUI::getAdminTabs ( )

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

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

1117 {
1118 $this->getTabs();
1119 }
getTabs()
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 1867 of file class.ilObjStyleSheetGUI.php.

1868 {
1869 if ($_GET["c_name"] != "")
1870 {
1871 $values["color_name"] = $_GET["c_name"];
1872 $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1873 $this->form_gui->setValuesByArray($values);
1874 }
1875 }

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

2084 {
2085 if ($_GET["mq_id"] != "")
2086 {
2087 foreach ($this->object->getMediaQueries() as $mq)
2088 {
2089 if ($mq["id"] == (int) $_GET["mq_id"])
2090 {
2091 $values["mquery"] = $mq["mquery"];
2092 }
2093 }
2094 $this->form_gui->setValuesByArray($values);
2095 }
2096 }

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

281 {
282 $values = array();
283
284 $values["style_title"] = $this->object->getTitle();
285 $values["style_description"] = $this->object->getDescription();
286 $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
287
288 $this->form->setValuesByArray($values);
289 }

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

1647 {
1648 global $lng;
1649
1650 $c = explode(":", $a_class);
1651 $a_class = $c[0];
1652
1653 $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
1654
1655 if ($ex_tpl->blockExists("Example_".$a_type))
1656 {
1657 $ex_tpl->setCurrentBlock("Example_".$a_type);
1658 }
1659 else
1660 {
1661 $ex_tpl->setCurrentBlock("Example_default");
1662 }
1663 $ex_tpl->setVariable("EX_CLASS", "ilc_".$a_type."_".$a_class);
1664 $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1665 if (in_array($a_type, array("media_cont", "qimg")))
1666 {
1667 //
1668 }
1669 if (in_array($a_type, array("table", "table_caption")))
1670 {
1671 $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1672 }
1673 if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal")))
1674 {
1675 $ex_tpl->setVariable("HOR", "Horizontal");
1676 }
1677 $ex_tpl->parseCurrentBlock();
1678
1679 return $ex_tpl->get();
1680 }

References $a_type, and ilObjectGUI\$lng.

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

+ Here is the caller graph for this function:

◆ getTabs()

ilObjStyleSheetGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

1146 {
1147 global $lng, $ilCtrl, $ilTabs, $ilHelp;
1148
1149 $ilHelp->setScreenIdComponent("sty");
1150
1151 if ($ilCtrl->getCmd() == "editTagStyle")
1152 {
1153 // back to upper context
1154 $this->tabs_gui->setBackTarget($lng->txt("back"),
1155 $ilCtrl->getLinkTarget($this, "edit"));
1156
1157 $t = explode(".", $_GET["tag"]);
1158 $t2 = explode(":", $t[1]);
1159 $pc = $this->object->_getPseudoClasses($t[0]);
1160 if (is_array($pc) && count($pc) > 0)
1161 {
1162 // style classes
1163 $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0]);
1164 $this->tabs_gui->addTarget("sty_tag_normal",
1165 $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1166 get_class($this));
1167 if ($t2[1] == "")
1168 {
1169 $ilTabs->setTabActive("sty_tag_normal");
1170 }
1171
1172 foreach ($pc as $p)
1173 {
1174 // style classes
1175 $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0].":".$p);
1176 $this->tabs_gui->addTarget("sty_tag_".$p,
1177 $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1178 get_class($this));
1179 if ($t2[1] == $p)
1180 {
1181 $ilTabs->setTabActive("sty_tag_".$p);
1182 }
1183 }
1184 $ilCtrl->setParameter($this, "tag", $_GET["tag"]);
1185 }
1186 }
1187 else
1188 {
1189 // back to upper context
1190 $this->tabs_gui->setBackTarget($lng->txt("back"),
1191 $this->ctrl->getLinkTarget($this, "returnToUpperContext"));
1192
1193 // style classes
1194 $this->tabs_gui->addTarget("sty_style_chars",
1195 $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1196 get_class($this));
1197
1198 // colors
1199 $this->tabs_gui->addTarget("sty_colors",
1200 $this->ctrl->getLinkTarget($this, "listColors"), "listColors",
1201 get_class($this));
1202
1203 // media queries
1204 $this->tabs_gui->addTarget("sty_media_queries",
1205 $this->ctrl->getLinkTarget($this, "listMediaQueries"), "listMediaQueries",
1206 get_class($this));
1207
1208 // images
1209 $this->tabs_gui->addTarget("sty_images",
1210 $this->ctrl->getLinkTarget($this, "listImages"), "listImages",
1211 get_class($this));
1212
1213 // table templates
1214 $this->tabs_gui->addTarget("sty_templates",
1215 $this->ctrl->getLinkTarget($this, "listTemplates"), "listTemplates",
1216 get_class($this));
1217
1218 // settings
1219 $this->tabs_gui->addTarget("settings",
1220 $this->ctrl->getLinkTarget($this, "properties"), "properties",
1221 get_class($this));
1222
1223 // accordiontest
1224/*
1225 $this->tabs_gui->addTarget("accordiontest",
1226 $this->ctrl->getLinkTarget($this, "accordiontest"), "accordiontest",
1227 get_class($this));*/
1228 }
1229
1230 }

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

2569 {
2570 if ($_GET["t_id"] > 0)
2571 {
2572 $t = $this->object->getTemplate($_GET["t_id"]);
2573
2574 $values["name"] = $t["name"];
2576 foreach ($scs as $k => $type)
2577 {
2578 $values[$k."_class"] = $t["classes"][$k];
2579 }
2580 $this->form_gui->setValuesByArray($values);
2581 }
2582 }
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 2262 of file class.ilObjStyleSheetGUI.php.

2263 {
2264 return $this->_getTemplatePreview(
2265 $this->object, $a_type, $a_t_id, $a_small_mode);
2266 }
static _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.

References $a_type, and _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 791 of file class.ilObjStyleSheetGUI.php.

792 {
793 $style = $this->object->getStyle();
794 $cur = explode(".",$_GET["tag"]);
795 $cur_tag = $cur[0];
796 $cur_class = $cur[1];
797 $cur_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
798 (int) $_GET["mq_id"], false);
800 foreach($parameters as $p => $v)
801 {
802 $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
803 if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]]))
804 {
805 continue;
806 }
807 $p = explode(".", $p);
808 $p = $p[0];
809 $input = $this->form_gui->getItemByPostVar($p);
810 switch ($v["input"])
811 {
812 case "":
813 break;
814
815 case "trbl_numeric":
816 case "border_width":
817 case "border_style":
818 case "trbl_color":
819 $input->setAllValue($cur_parameters[$v["subpar"][0]]);
820 $input->setTopValue($cur_parameters[$v["subpar"][1]]);
821 $input->setRightValue($cur_parameters[$v["subpar"][2]]);
822 $input->setBottomValue($cur_parameters[$v["subpar"][3]]);
823 $input->setLeftValue($cur_parameters[$v["subpar"][4]]);
824 break;
825
826 default:
827 $input->setValue($cur_parameters[$p]);
828 break;
829 }
830 }
831
832 $cust_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
833 (int) $_GET["mq_id"], true);
834 $vals = array();
835 foreach ($cust_parameters as $k => $c)
836 {
837 $vals[] = $k.": ".$c;
838 }
839 $input = $this->form_gui->getItemByPostVar("custom_par");
840 $input->setValue($vals);
841 }
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:

◆ importStyleObject()

ilObjStyleSheetGUI::importStyleObject ( )

import style sheet

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

1037 {
1038 // check file
1039 $source = $_FILES["importfile"]["tmp_name"];
1040 if (($source == 'none') || (!$source))
1041 {
1042 $this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
1043 }
1044
1045 // check correct file type
1046 $info = pathinfo($_FILES["importfile"]["name"]);
1047 if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml")
1048 {
1049 $this->ilias->raiseError("File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
1050 }
1051
1052 // new import
1053 $fname = explode("_", $_FILES["importfile"]["name"]);
1054 if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty")
1055 {
1056 include_once("./Services/Export/classes/class.ilImport.php");
1057 $imp = new ilImport();
1058 $new_id = $imp->importObject(null, $_FILES["importfile"]["tmp_name"],
1059 $_FILES["importfile"]["name"], "sty");
1060 if ($new_id > 0)
1061 {
1062 $newObj = ilObjectFactory::getInstanceByObjId($new_id);
1063 }
1064 }
1065 else // old import
1066 {
1067 require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
1068 $newObj = new ilObjStyleSheet();
1069 $newObj->import($_FILES["importfile"]);
1070 }
1071
1072 // assign style to style sheet folder,
1073 // if parent is style sheet folder
1074 if ($_GET["ref_id"] > 0)
1075 {
1076 $fold = ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1077 if ($fold->getType() == "stys")
1078 {
1079 include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
1080 $cont_style_settings = new ilContentStyleSettings();
1081 $cont_style_settings->addStyle($newObj->getId());
1082 $cont_style_settings->update();
1083 ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1084 $this->ctrl->returnToParent($this);
1085 }
1086 }
1087 return $newObj->getId();
1088 }
Import class.
Class ilObjStyleSheet.
static 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 ilObjStyleSheet::getContentStylePath($this->object->getId()));
163 $this->tpl->parseCurrentBlock();
164 }
static getContentStylePath($a_style_id)
get content style path

References ilObjStyleSheet\getContentStylePath().

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

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

◆ initCharacteristicForm()

ilObjStyleSheetGUI::initCharacteristicForm (   $a_mode)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

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

1599 {
1600 global $lng, $ilCtrl;
1601
1602 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1603 $this->form_gui = new ilPropertyFormGUI();
1604
1605 // title
1606 $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1607 $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1608 $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include")." A-Z, a-z, 1-9");
1609 $txt_input->setRequired(true);
1610 $this->form_gui->addItem($txt_input);
1611
1612 // type
1613 $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1614 $types = $all_super_types[$this->super_type];
1615 $exp_types = array();
1616 foreach($types as $t)
1617 {
1619 {
1620 $exp_types[$t] = $lng->txt("sty_type_".$t);
1621 }
1622 }
1623 if (count($exp_types) > 1)
1624 {
1625 $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1626 $type_input->setOptions($exp_types);
1627 $type_input->setValue(key($exp_types));
1628 $this->form_gui->addItem($type_input);
1629 }
1630 else if (count($exp_types) == 1)
1631 {
1632 $hid_input = new ilHiddenInputGUI("type");
1633 $hid_input->setValue(key($exp_types));
1634 $this->form_gui->addItem($hid_input);
1635 }
1636
1637 $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1638 $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1639 $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1640 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1641 }
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 1827 of file class.ilObjStyleSheetGUI.php.

1828 {
1829 global $lng, $ilCtrl;
1830
1831 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1832 $this->form_gui = new ilPropertyFormGUI();
1833
1834 $this->form_gui->setTitle($lng->txt("sty_add_color"));
1835
1836 // name
1837 $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1838 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1839 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
1840 $name_input->setRequired(true);
1841 $name_input->setSize(15);
1842 $name_input->setMaxLength(15);
1843 $this->form_gui->addItem($name_input);
1844
1845 // code
1846 $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1847 $color_input->setRequired(true);
1848 $color_input->setDefaultColor("");
1849 $this->form_gui->addItem($color_input);
1850
1851 if ($a_mode == "create")
1852 {
1853 $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1854 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1855 }
1856 else
1857 {
1858 $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1859 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1860 }
1861 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1862 }
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 1388 of file class.ilObjStyleSheetGUI.php.

1389 {
1390 global $lng, $ilCtrl;
1391
1392 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1393 $this->form_gui = new ilPropertyFormGUI();
1394
1395 $this->form_gui->setTitle($lng->txt("sty_add_image"));
1396
1397 $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1398 $file_input->setRequired(true);
1399 $this->form_gui->addItem($file_input);
1400
1401 $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1402 $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1403 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1404 }
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 2052 of file class.ilObjStyleSheetGUI.php.

2053 {
2054 global $lng, $ilCtrl;
2055
2056 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2057 $this->form_gui = new ilPropertyFormGUI();
2058
2059 $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2060
2061 // media query
2062 $ti = new ilTextInputGUI("@media", "mquery");
2063 $ti->setMaxLength(2000);
2064 $this->form_gui->addItem($ti);
2065
2066
2067 if ($a_mode == "create")
2068 {
2069 $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2070 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2071 }
2072 else
2073 {
2074 $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2075 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2076 }
2077 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2078 }

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

297 {
298 global $lng, $rbacsystem;
299
300 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
301 $this->form = new ilPropertyFormGUI();
302
303 // title
304 $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
305 $ti->setMaxLength(128);
306 $ti->setSize(40);
307 $ti->setRequired(true);
308 $this->form->addItem($ti);
309
310 // description
311 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
312 //$ta->setCols();
313 //$ta->setRows();
314 $this->form->addItem($ta);
315
316 // disable automatic margins for left/right alignment
317 $cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
318 $cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
319 $this->form->addItem($cb);
320
321 // save and cancel commands
322
323 if ($a_mode == "create")
324 {
325 $this->form->addCommandButton("save", $lng->txt("save"));
326 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
327 }
328 else
329 {
330 if ($this->checkWrite())
331 {
332 $this->form->addCommandButton("update", $lng->txt("save"));
333 }
334 }
335
336 $this->form->setTitle($lng->txt("edit_stylesheet"));
337 $this->form->setFormAction($this->ctrl->getFormAction($this));
338
339 }
This class represents a checkbox property in a property form.

References ilObjectGUI\$lng, and checkWrite().

Referenced by propertiesObject(), and updateObject().

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

◆ initTagStyleForm()

ilObjStyleSheetGUI::initTagStyleForm (   $a_mode,
  $a_cur_tag 
)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

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

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

2404 {
2405 global $lng, $ilCtrl;
2406
2407 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2408 $this->form_gui = new ilPropertyFormGUI();
2409
2410 if ($a_mode == "create")
2411 {
2412 $this->form_gui->setTitle($lng->txt("sty_add_template"));
2413 }
2414 else
2415 {
2416 $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2417 }
2418
2419 // name
2420 $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2421 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2422 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2423 $name_input->setRequired(true);
2424 $name_input->setSize(30);
2425 $name_input->setMaxLength(30);
2426 $this->form_gui->addItem($name_input);
2427
2428 // template style classes
2430 foreach ($scs as $sc => $st)
2431 {
2432 $sc_input = new ilSelectInputGUI($lng->txt("sty_".$sc."_class"), $sc."_class");
2433 $chars = $this->object->getCharacteristics($st);
2434 $options = array("" => "");
2435 foreach($chars as $char)
2436 {
2437 $options[$char] = $char;
2438 }
2439 $sc_input->setOptions($options);
2440 $this->form_gui->addItem($sc_input);
2441 }
2442
2443 if ($a_mode == "create")
2444 {
2445 $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2446 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2447 }
2448 else
2449 {
2450 $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2451 $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2452 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2453 }
2454 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2455 }

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

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

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

1783 {
1784 global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
1785
1786 if ($this->checkWrite())
1787 {
1788 $ilToolbar->addButton($this->lng->txt("sty_add_color"),
1789 $ilCtrl->getLinkTarget($this, "addColor"));
1790 }
1791
1792 include_once("./Services/Style/Content/classes/class.ilStyleColorTableGUI.php");
1793 $table_gui = new ilStyleColorTableGUI($this, "listColors",
1794 $this->object);
1795 $tpl->setContent($table_gui->getHTML());
1796
1797 }
TableGUI class for style editor (image list)

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

+ Here is the call graph for this function:

◆ listImagesObject()

ilObjStyleSheetGUI::listImagesObject ( )

List images of style.

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

1326 {
1327 global $tpl, $ilToolbar, $ilCtrl, $lng, $rbacsystem;
1328
1329 if ($this->checkWrite())
1330 {
1331 $ilToolbar->addButton($lng->txt("sty_add_image"),
1332 $ilCtrl->getLinkTarget($this, "addImage"));
1333 }
1334
1335 include_once("./Services/Style/Content/classes/class.ilStyleImageTableGUI.php");
1336 $table_gui = new ilStyleImageTableGUI($this, "listImages",
1337 $this->object);
1338 $tpl->setContent($table_gui->getHTML());
1339
1340 }
TableGUI class for style editor (image list)

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

+ Here is the call graph for this function:

◆ listMediaQueriesObject()

ilObjStyleSheetGUI::listMediaQueriesObject ( )

List media queries of style.

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

2009 {
2010 global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
2011
2012 if ($this->checkWrite())
2013 {
2014 $ilToolbar->addButton($this->lng->txt("sty_add_media_query"),
2015 $ilCtrl->getLinkTarget($this, "addMediaQuery"));
2016 }
2017
2018 include_once("./Services/Style/Content/classes/class.ilStyleMediaQueryTableGUI.php");
2019 $table_gui = new ilStyleMediaQueryTableGUI($this, "listMediaQueries",
2020 $this->object);
2021 $tpl->setContent($table_gui->getHTML());
2022 }
TableGUI class for style editor (image list)

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

+ Here is the call graph for this function:

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

2212 {
2213 global $tpl, $ilTabs, $ilCtrl;
2214
2215 $ctype = $_GET["temp_type"];
2216 if ($ctype == "")
2217 {
2218 $ctype = "table";
2219 $ilCtrl->setParameter($this, "temp_type", $ctype);
2220 $_GET["temp_type"] = $ctype;
2221 }
2222
2223 $this->setTemplatesSubTabs();
2224 $ilTabs->setSubTabActive("sty_".$ctype."_templates");
2225
2226 $this->includeCSS();
2227 include_once("./Services/Style/Content/classes/class.ilTableTemplatesTableGUI.php");
2228 $table_gui = new ilTableTemplatesTableGUI($ctype, $this, "listTemplates",
2229 $this->object);
2230 $tpl->setContent($table_gui->getHTML());
2231
2232 }
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 876 of file class.ilObjStyleSheetGUI.php.

877 {
878 $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
879 $this->editObject();
880 }

References $_POST, and editObject().

+ Here is the call graph for this function:

◆ outputTagStyleEditScreen()

ilObjStyleSheetGUI::outputTagStyleEditScreen ( )

Output tag style edit screen.

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

595 {
596 global $tpl, $ilCtrl, $lng;
597
598 // set style sheet
599 $tpl->setCurrentBlock("ContentStyle");
600 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
601 ilObjStyleSheet::getContentStylePath($this->object->getId()));
602
603 $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style/Content");
604
605 $cur = explode(".",$_GET["tag"]);
606 $cur_tag = $cur[0];
607 $cur_class = $cur[1];
608
609 $ts_tpl->setVariable("EXAMPLE",
610 ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class));
611
612 $ts_tpl->setVariable("FORM",
613 $this->form_gui->getHtml());
614
615 $tpl->setTitle($cur_class." (".$lng->txt("sty_type_".$_GET["style_type"]).")");
616
617 $tpl->setContent($ts_tpl->get());
618 }
static getStyleExampleHTML($a_type, $a_class)
Get style example HTML.

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\getContentStylePath(), 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 1750 of file class.ilObjStyleSheetGUI.php.

1751 {
1752 global $ilCtrl, $lng;
1753
1754 if (is_array($_POST["title"]))
1755 {
1756 foreach ($_POST["title"] as $from_char => $to_title)
1757 {
1758 $fc = explode(".", $from_char);
1759
1760 if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1761 !$this->object->characteristicExists($to_title, $fc[0]))
1762 {
1763 $this->object->copyCharacteristic($_POST["from_style_id"],
1764 $fc[0], $fc[2], $to_title);
1765 }
1766 }
1767 ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1768 unset($_SESSION["sty_copy"]);
1769 ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1770 }
1771
1772 $ilCtrl->redirect($this, "edit");
1773 }
static _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 1732 of file class.ilObjStyleSheetGUI.php.

1733 {
1734 global $tpl, $ilTabs;
1735
1736 $ilTabs->clearTargets();
1737
1738 include_once("./Services/Style/Content/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1739 $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1740
1741 $tpl->setContent($table->getHTML());
1742 }

References ilObjectGUI\$tpl.

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

258 {
259 global $rbacsystem, $lng, $ilToolbar;
260
261 // set style sheet
262 $this->tpl->setCurrentBlock("ContentStyle");
263 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
264 ilObjStyleSheet::getContentStylePath($this->object->getId()));
265 $this->tpl->parseCurrentBlock();
266
267 // export button
268 $ilToolbar->addButton($this->lng->txt("export"),
269 $this->ctrl->getLinkTarget($this, "exportStyle"));
270
271 $this->initPropertiesForm();
272 $this->getPropertiesValues();
273 $this->tpl->setContent($this->form->getHTML());
274 }
getPropertiesValues()
Get current values for properties from.
initPropertiesForm($a_mode="edit")
FORM: Init properties form.

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

+ Here is the call graph for this function:

◆ refreshObject()

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

886 {
887 $this->object->setTitle($_POST["style_title"]);
888 $this->object->setDescription($_POST["style_description"]);
889
890 foreach($_POST["styval"] as $id => $value)
891 {
892 $this->object->updateStyleParameter($id, $value);
893 }
894 $this->object->update();
895 $this->editObject();
896 }

References $_POST, and editObject().

+ Here is the call graph for this function:

◆ refreshTagStyleObject()

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

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

370 {
371 global $ilCtrl;
372
373 $cur = explode(".",$_GET["tag"]);
374 $cur_tag = $cur[0];
375 $cur_class = $cur[1];
376
377 $this->initTagStyleForm("edit", $cur_tag);
378
379 if ($this->form_gui->checkInput())
380 {
381 $this->saveTagStyle();
382 $ilCtrl->redirect($this, "editTagStyle");
383 }
384 else
385 {
386 $this->form_gui->setValuesByPost();
388 }
389 }

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

+ Here is the call graph for this function:

◆ refreshTemplateObject()

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

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

2561 {
2562 $this->updateTemplateObject(true);
2563 }
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 2935 of file class.ilObjStyleSheetGUI.php.

2936 {
2937 global $ilCtrl;
2938
2939 /*if ($_GET["baseClass"] == "ilAdministrationGUI")
2940 {
2941 $ilCtrl->redirectByClass("ilcontentstylesettingsgui", "edit");
2942 }*/
2943 $ilCtrl->returnToParent($this);
2944 }

References $ilCtrl.

◆ saveCharacteristicObject()

ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

1567 {
1568 global $ilCtrl, $tpl, $lng;
1569
1570 $this->initCharacteristicForm("create");
1571
1572 if ($this->form_gui->checkInput())
1573 {
1574 if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"]))
1575 {
1576 $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1577 $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1578 }
1579 else
1580 {
1581 $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1582 ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1583 $ilCtrl->setParameter($this, "tag",
1584 ilObjStyleSheet::_determineTag($_POST["type"]).".".$_POST["new_characteristic"]);
1585 $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1586 $ilCtrl->redirect($this, "editTagStyle");
1587 }
1588 }
1589 $this->form_gui->setValuesByPost();
1590 $tpl->setContent($this->form_gui->getHTML());
1591 }

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

1891 {
1892 global $tpl, $ilCtrl, $lng;
1893
1894 $this->initColorForm();
1895
1896 if ($this->form_gui->checkInput())
1897 {
1898 if ($this->object->colorExists($_POST["color_name"]))
1899 {
1900 $col_input = $this->form_gui->getItemByPostVar("color_name");
1901 $col_input->setAlert($lng->txt("sty_color_already_exists"));
1902 }
1903 else
1904 {
1905 $this->object->addColor($_POST["color_name"],
1906 $_POST["color_code"]);
1907 $ilCtrl->redirect($this, "listColors");
1908 }
1909 }
1910 $this->form_gui->setValuesByPost();
1911 $tpl->setContent($this->form_gui->getHTML());
1912 }

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

1686 {
1687 global $ilCtrl, $lng;
1688
1689 //var_dump($_POST);
1690
1691 foreach ($_POST["all_chars"] as $char)
1692 {
1693 $ca = explode(".", $char);
1694 $this->object->saveHideStatus($ca[0], $ca[2],
1695 (is_array($_POST["hide"]) && in_array($char, $_POST["hide"])));
1696 }
1697
1698 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1699 $ilCtrl->redirect($this, "edit");
1700 }

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

2102 {
2103 global $tpl, $ilCtrl, $lng;
2104
2105 $this->initMediaQueryForm();
2106
2107 if ($this->form_gui->checkInput())
2108 {
2109 $this->object->addMediaQuery($_POST["mquery"]);
2110 $ilCtrl->redirect($this, "listMediaQueries");
2111 }
2112 $this->form_gui->setValuesByPost();
2113 $tpl->setContent($this->form_gui->getHTML());
2114 }

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

2193 {
2194 global $ilCtrl;
2195
2196 if (is_array($_POST["order"]))
2197 {
2198 $this->object->saveMediaQueryOrder($_POST["order"]);
2199 }
2200 $ilCtrl->redirect($this, "listMediaQueries");
2201 }

References $_POST, and $ilCtrl.

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

save style sheet

Reimplemented from ilObjectGUI.

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

965 {
966 if(!trim($_POST["style_title"]))
967 {
968 $this->ctrl->redirect($this, "create");
969 }
970
971//echo "HH"; exit;
972 $class_name = "ilObjStyleSheet";
973 require_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
974 $newObj = new ilObjStyleSheet();
975 $newObj->setTitle("-");
976 $newObj->create();
977 $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
978 $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
979 $newObj->update();
980
981 // assign style to style sheet folder,
982 // if parent is style sheet folder
983 if ($_GET["ref_id"] > 0)
984 {
985
987 if ($fold->getType() == "stys")
988 {
989 include_once("./Services/Style/Content/classes/class.ilContentStyleSettings.php");
990 $cont_style_settings = new ilContentStyleSettings();
991 $cont_style_settings->addStyle($newObj->getId());
992 $cont_style_settings->update();
993
994 ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
995 $this->ctrl->returnToParent($this);
996 }
997 }
998
999 return $newObj->getId();
1000 }
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 418 of file class.ilObjStyleSheetGUI.php.

419 {
420 $cur = explode(".", $_GET["tag"]);
421 $cur_tag = $cur[0];
422 $cur_class = $cur[1];
423 $avail_pars = ilObjStyleSheet::_getStyleParameters($cur_tag);
424 foreach ($avail_pars as $par => $v)
425 {
426 $var = str_replace("-", "_", $par);
427 $basepar_arr = explode(".", $par);
428 $basepar = $basepar_arr[0];
429 if ($basepar_arr[1] != "" && $basepar_arr[1] != $cur_tag)
430 {
431 continue;
432 }
433
434 switch ($v["input"])
435 {
436 case "fontsize":
437 case "numeric_no_perc":
438 case "numeric":
439 case "background_image":
440 $in = $this->form_gui->getItemByPostVar($basepar);
441//echo "<br>-".$cur_tag."-".$cur_class."-".$basepar."-".$_GET["style_type"]."-";
442 $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
443 break;
444
445 case "color":
446 $color = trim($_POST[$basepar]);
447 if ($color != "" && trim(substr($color,0,1) != "!"))
448 {
449 $color = "#".$color;
450 }
451 $this->writeStylePar($cur_tag, $cur_class, $basepar, $color, $_GET["style_type"], (int) $_GET["mq_id"]);
452 break;
453
454 case "trbl_numeric":
455 case "border_width":
456 case "border_style":
457 $in = $this->form_gui->getItemByPostVar($basepar);
458 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0], $in->getAllValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
459 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1], $in->getTopValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
460 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2], $in->getRightValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
461 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3], $in->getBottomValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
462 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4], $in->getLeftValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
463 break;
464
465 case "trbl_color":
466 $in = $this->form_gui->getItemByPostVar($basepar);
467 $tblr_p = array (0 => "getAllValue", 1 => "getTopValue", 2 => "getRightValue",
468 3 => "getBottomValue", 4 => "getLeftValue");
469 foreach ($tblr_p as $k => $func)
470 {
471 $val = trim($in->$func());
472 $val = (($in->getAcceptNamedColors() && substr($val, 0, 1) == "!")
473 || $val == "")
474 ? $val
475 : "#".$val;
476 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][$k], $val, $_GET["style_type"], (int) $_GET["mq_id"]);
477 }
478 break;
479
480 case "background_position":
481 $in = $this->form_gui->getItemByPostVar($basepar);
482 $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
483 break;
484
485 default:
486 $this->writeStylePar($cur_tag, $cur_class, $basepar, $_POST[$basepar], $_GET["style_type"], (int) $_GET["mq_id"]);
487 break;
488 }
489 }
490
491 // write custom parameter
492 $this->object->deleteCustomStylePars($cur_tag, $cur_class, $_GET["style_type"], (int) $_GET["mq_id"]);
493 if (is_array($_POST["custom_par"]))
494 {
495 foreach ($_POST["custom_par"] as $cpar)
496 {
497 $par_arr = explode(":", $cpar);
498 if (count($par_arr) == 2)
499 {
500 $par = trim($par_arr[0]);
501 $val = trim(str_replace(";", "", $par_arr[1]));
502 $this->writeStylePar($cur_tag, $cur_class, $par, $val, $_GET["style_type"], (int) $_GET["mq_id"], true);
503 }
504 }
505 }
506
507 $this->object->update();
508 }
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
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 2471 of file class.ilObjStyleSheetGUI.php.

2472 {
2473 global $tpl, $ilCtrl, $lng;
2474
2475 $this->initTemplateForm();
2476
2477 if ($this->form_gui->checkInput())
2478 {
2479 if ($this->object->templateExists($_POST["name"]))
2480 {
2481 $name_input = $this->form_gui->getItemByPostVar("name");
2482 $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2483 }
2484 else
2485 {
2486 $classes = array();
2487 foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2488 {
2489 $classes[$tct] = $_POST[$tct."_class"];
2490 }
2491 $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2492 $this->object->writeTemplatePreview($t_id,
2493 $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2494 $ilCtrl->redirect($this, "listTemplates");
2495 }
2496 }
2497 $this->form_gui->setValuesByPost();
2498 $tpl->setContent($this->form_gui->getHTML());
2499 }

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

1238 {
1239 global $lng, $ilTabs, $ilCtrl;
1240
1242
1243 foreach ($types as $super_type => $types)
1244 {
1245 // text block characteristics
1246 $ilCtrl->setParameter($this, "style_type", $super_type);
1247 $ilTabs->addSubTabTarget("sty_".$super_type."_char",
1248 $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1249 get_class($this));
1250 }
1251
1252 $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1253 }

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

1125 {
1126 global $lng;
1127
1128 $this->getTabs($this->tabs_gui);
1129
1130 if (strtolower(get_class($this->object)) == "ilobjstylesheet")
1131 {
1132 $this->tpl->setVariable("HEADER", $this->object->getTitle());
1133 }
1134 else
1135 {
1136 $this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
1137 }
1138 }

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

1261 {
1262 global $lng, $ilTabs, $ilCtrl;
1263
1265
1266 foreach ($types as $t => $c)
1267 {
1268 $ilCtrl->setParameter($this, "temp_type", $t);
1269 $ilTabs->addSubTabTarget("sty_".$t."_templates",
1270 $this->ctrl->getLinkTarget($this, "listTemplates"), array("listTemplates", ""),
1271 get_class($this));
1272 }
1273
1274 $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1275 }

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

1307 {
1308 global $tree, $tpl, $objDefinition;
1309
1310 if (strtolower($_GET["baseClass"]) == "iladministrationgui")
1311 {
1312 $tpl->setUpperIcon(
1313 $this->ctrl->getLinkTargetByClass("ilcontentstylesettings",
1314 "edit"));
1315 }
1316 else
1317 {
1318 // ?
1319 }
1320 }

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

◆ switchMQueryObject()

ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters

return

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

583 {
584 global $ilCtrl;
585
586 $ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
587 $ilCtrl->redirect($this, "editTagStyle");
588 }

References $_POST, and $ilCtrl.

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

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

1918 {
1919 global $tpl, $ilCtrl, $lng;
1920
1921 $this->initColorForm("edit");
1922
1923 if ($this->form_gui->checkInput())
1924 {
1925 if ($this->object->colorExists($_POST["color_name"]) &&
1926 $_POST["color_name"] != $_GET["c_name"])
1927 {
1928 $col_input = $this->form_gui->getItemByPostVar("color_name");
1929 $col_input->setAlert($lng->txt("sty_color_already_exists"));
1930 }
1931 else
1932 {
1933 $this->object->updateColor($_GET["c_name"], $_POST["color_name"],
1934 $_POST["color_code"]);
1935 $ilCtrl->redirect($this, "listColors");
1936 }
1937 }
1938 $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1939 $this->form_gui->setValuesByPost();
1940 $tpl->setContent($this->form_gui->getHTML());
1941 }

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

2120 {
2121 global $tpl, $ilCtrl, $lng;
2122
2123 $this->initMediaQueryForm("edit");
2124
2125 if ($this->form_gui->checkInput())
2126 {
2127 $this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
2128 $ilCtrl->redirect($this, "listMediaQueries");
2129 }
2130 $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2131 $this->form_gui->setValuesByPost();
2132 $tpl->setContent($this->form_gui->getHTML());
2133 }

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

345 {
346 global $lng, $ilCtrl, $tpl;
347
348 $this->initPropertiesForm("edit");
349 if ($this->form->checkInput())
350 {
351 $this->object->setTitle($this->form->getInput("style_title"));
352 $this->object->setDescription($this->form->getInput("style_description"));
353 $this->object->writeStyleSetting("disable_auto_margins",
354 $this->form->getInput("disable_auto_margins"));
355 $this->object->update();
356 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
357 $ilCtrl->redirect($this, "properties");
358 }
359 else
360 {
361 $this->form->setValuesByPost();
362 $tpl->setContent($this->form->getHtml());
363 }
364 }

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

395 {
396 global $ilCtrl;
397
398 $cur = explode(".",$_GET["tag"]);
399 $cur_tag = $cur[0];
400 $cur_class = $cur[1];
401
402 $this->initTagStyleForm("edit", $cur_tag);
403 if ($this->form_gui->checkInput())
404 {
405 $this->saveTagStyle();
406 $ilCtrl->redirect($this, "edit");
407 }
408 else
409 {
410 $this->form_gui->setValuesByPost();
412 }
413 }

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

2505 {
2506 global $tpl, $ilCtrl, $lng;
2507
2508 $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2509 $this->initTemplateForm("edit");
2510
2511 if ($this->form_gui->checkInput())
2512 {
2513 if ($this->object->templateExists($_POST["name"]) &&
2515 {
2516 $name_input = $this->form_gui->getItemByPostVar("name");
2517 $name_input->setAlert($lng->txt("sty_template_already_exists"));
2518 }
2519 else
2520 {
2521 $classes = array();
2522 foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2523 {
2524 $classes[$tct] = $_POST[$tct."_class"];
2525 }
2526
2527 $this->object->updateTemplate($_GET["t_id"],
2528 $_POST["name"], $classes);
2529 $this->object->writeTemplatePreview($_GET["t_id"],
2530 $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true));
2531 if(!$a_refresh)
2532 {
2533 $ilCtrl->redirect($this, "listTemplates");
2534 }
2535 }
2536 }
2537
2538 $this->form_gui->setValuesByPost();
2539 $this->displayTemplateEditForm();
2540 }
static _lookupTemplateName($a_t_id)
Lookup table template name for template ID.

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

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

1367 {
1368 global $tpl, $ilCtrl;
1369
1370 $this->initImageForm();
1371
1372 if ($this->form_gui->checkInput())
1373 {
1374 $this->object->uploadImage($_FILES["image_file"]);
1375 $ilCtrl->redirect($this, "listImages");
1376 }
1377 else
1378 {
1379 //$this->form_gui->setImageFormValuesByPost();
1380 $tpl->setContent($this->form_gui->getHTML());
1381 }
1382
1383 }

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

511 {
512// echo $_GET["mq_id"]."-";
513// echo $a_mq_id."-"; exit;
514 if ($a_type == "")
515 {
516 return;
517 }
518
519 if ($value != "")
520 {
521 $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
522 }
523 else
524 {
525 $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
526 }
527 }

References $a_type.

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: