ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

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

Public Member Functions

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

Static Public Member Functions

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

Data Fields

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

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showMountWebfolderIcon ()
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput())
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.

Detailed Description

Class ilObjStyleSheetGUI.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Id:
class.ilObjStyleSheetGUI.php 58653 2015-04-04 13:21:23Z gitmgr

ilObjStyleSheetGUI:

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

Member Function Documentation

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

Get table template preview.

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

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

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

{
global $lng, $tpl;
$kr = $kc = 7;
if ($a_small_mode)
{
$kr = 6;
$kc = 5;
}
$ts = $a_style->getTemplate($a_t_id);
$t = $ts["classes"];
// preview
if ($a_type == "table")
{
$p_content = '<PageContent><Table DataTable="y"';
if ($t["row_head"] != "")
{
$p_content.= ' HeaderRows="1"';
}
if ($t["row_foot"] != "")
{
$p_content.= ' FooterRows="1"';
}
if ($t["col_head"] != "")
{
$p_content.= ' HeaderCols="1"';
}
if ($t["col_foot"] != "")
{
$p_content.= ' FooterCols="1"';
}
$p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
if (!$a_small_mode)
{
$p_content.= '<Caption>'.$lng->txt("sty_caption").'</Caption>';
}
for($i = 1; $i<=$kr; $i++)
{
$p_content.= '<TableRow>';
for($j = 1; $j<=$kc; $j++)
{
if ($a_small_mode)
{
$cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
}
else
{
$cell = 'xxx';
}
$p_content.= '<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.'</Paragraph></PageContent></TableData>';
}
$p_content.= '</TableRow>';
}
$p_content.= '</Table></PageContent>';
}
if ($a_type == "vaccordion" || $a_type == "haccordion")
{
include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
if ($a_small_mode)
{
$c = '&amp;nbsp;';
$h = '&amp;nbsp;';
}
else
{
$c = 'xxx';
$h = 'head';
}
if ($a_type == "vaccordion")
{
$p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
if ($a_small_mode)
{
$p_content.= ' ContentWidth="70"';
}
}
else
{
$p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
if ($a_small_mode)
{
$p_content.= ' ContentHeight="40"';
$p_content.= ' ContentWidth="70"';
$c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
}
else
{
$p_content.= ' ContentHeight="40"';
}
}
$p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
$p_content.= '<Tab><PageContent><Paragraph>'.$c.'</Paragraph></PageContent>';
$p_content.= '<TabCaption>'.$h.'</TabCaption>';
$p_content.= '</Tab>';
$p_content.= '</Tabs></PageContent>';
}
//echo htmlentities($p_content);
$txml = $a_style->getTemplateXML();
//echo htmlentities($txml);
$p_content.= $txml;
include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
$r_content = ilPCTableGUI::_renderTable($p_content, "");
return $r_content;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::accordiontestObject ( )

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

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

{
global $tpl;
include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
$acc = new ilAccordionGUI();
$acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
$acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
$acc->setOrientation(ilAccordionGUI::HORIZONTAL);
$ac2 = new ilAccordionGUI();
$ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
$ac2->addItem("Header 2", $acc->getHTML());
$ac2->setOrientation(ilAccordionGUI::VERTICAL);
$tpl->setContent($ac2->getHTML());
}
ilObjStyleSheetGUI::addAdminLocatorItems ( )

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

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

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

{
global $ilLocator;
if ($_GET["admin_mode"] == "settings") // system settings
{
$ilLocator->addItem(ilObject::_lookupTitle(
$this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "view"));
if ($_GET["obj_id"] > 0)
{
$ilLocator->addItem($this->object->getTitle(),
$this->ctrl->getLinkTarget($this, "edit"));
}
}
else // repository administration
{
//?
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::addCharacteristicFormObject ( )

Add characteristic.

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

References ilObjectGUI\$tpl, and initCharacteristicForm().

{
global $tpl;
$this->initCharacteristicForm("create");
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::addColorObject ( )

Add a color.

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

References ilObjectGUI\$tpl, and initColorForm().

{
global $tpl;
$this->initColorForm();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::addImageObject ( )

Add an image.

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

References ilObjectGUI\$tpl, and initImageForm().

{
global $tpl;
$this->initImageForm();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::addMediaQueryObject ( )

Add a media query.

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

References ilObjectGUI\$tpl, and initMediaQueryForm().

{
global $tpl;
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::addTemplateObject ( )

Add template.

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

References ilObjectGUI\$tpl, and initTemplateForm().

{
global $tpl;
$this->initTemplateForm();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::cancelCharacteristicDeletionObject ( )

Cancel characteristic deletion.

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

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

{
global $ilCtrl, $lng;
ilUtil::sendInfo($lng->txt("action_aborted"), true);
$ilCtrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::cancelColorDeletionObject ( )

Cancel color deletion.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "listColors");
}
ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "listColors");
}
ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

Reimplemented from ilObjectGUI.

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

{
$this->ctrl->returnToParent($this);
}
ilObjStyleSheetGUI::cancelObject ( )

update style sheet

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

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

{
global $lng;
ilUtil::sendInfo($lng->txt("msg_cancel"), true);
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::cancelTemplateDeletionObject ( )

Cancel table template deletion.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "listTemplates");
}
ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "listTemplates");
}
ilObjStyleSheetGUI::cancelUploadObject ( )

Cancel Upload.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "listImages");
}
ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\$ilias.

{
global $ilias;
$this->object->delete();
$this->ctrl->returnToParent($this);
}
ilObjStyleSheetGUI::copyCharacteristicsObject ( )

Copy style classes.

Parameters
@return

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

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

{
global $ilCtrl, $lng;
if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
}
else
{
$style_cp = implode("::", $_POST["char"]);
$style_cp = $this->object->getId().":::".$_GET["style_type"].":::".$style_cp;
$_SESSION["sty_copy"] = $style_cp;
ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
}
$ilCtrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::copyStyleObject ( )

save style sheet

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

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

{
global $ilias;
if ($_POST["source_style"] > 0)
$style_obj =& $ilias->obj_factory->getInstanceByObjId($_POST["source_style"]);
$new_id = $style_obj->ilClone();
// assign style to style sheet folder,
// if parent is style sheet folder
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$fold->addStyle($new_id);
$fold->update();
$this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
}
return $new_id;
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::createObject ( )

create

Reimplemented from ilObjectGUI.

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

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

{
global $rbacsystem, $lng, $tpl, $ilHelp;
$forms = array();
$ilHelp->setScreenIdComponent("sty");
$ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
// --- create
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
$ta->setCols(40);
$ta->setRows(2);
$form->addItem($ta);
$form->addCommandButton("save", $this->lng->txt("save"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
$forms[] = $form;
// --- import
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("sty_import_stylesheet"));
// title
$ti = new ilFileInputGUI($this->lng->txt("import_file"), "stylefile");
$ti->setRequired(true);
$form->addItem($ti);
$form->addCommandButton("importStyle", $this->lng->txt("import"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
$forms[] = $form;
// --- clone
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
// source
$ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
$ti->setRequired(true);
$form->addItem($ti);
$form->addCommandButton("copyStyle", $this->lng->txt("copy"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
$forms[] = $form;
$this->tpl->setContent($this->getCreationFormsHTML($forms));
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteCharacteristicConfirmationObject ( )

Characteristic deletion confirmation screen.

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

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

{
global $ilCtrl, $tpl, $lng;
//var_dump($_POST);
if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "edit");
}
else
{
// check whether there are any core style classes included
foreach ($_POST["char"] as $char)
{
if (!empty($core_styles[$char]))
{
return;
}
}
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
$cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
$cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
foreach ($_POST["char"] as $char)
{
$char_comp = explode(".", $char);
$cgui->addItem("char[]", $char, $char_comp[2]);
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteCharacteristicObject ( )

Delete one or multiple style characteristic.

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
if (is_array($_POST["char"]))
{
foreach($_POST["char"] as $char)
{
$char_comp = explode(".", $char);
$type = $char_comp[0];
$tag = $char_comp[1];
$class = $char_comp[2];
$this->object->deleteCharacteristic($type, $tag, $class);
}
}
$ilCtrl->redirect($this, "edit");
}
ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

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

{
global $ilCtrl, $tpl, $lng;
if (!is_array($_POST["color"]) || count($_POST["color"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listColors");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
$cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
$cgui->setConfirm($lng->txt("delete"), "deleteColor");
foreach ($_POST["color"] as $c)
{
$cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteColorObject ( )

Delete colors.

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
if (is_array($_POST["color"]))
{
foreach ($_POST["color"] as $c)
{
$this->object->removeColor($c);
}
}
$ilCtrl->redirect($this, "listColors");
}
ilObjStyleSheetGUI::deleteCoreCharMessage ( )

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

Parameters
@return

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

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

Referenced by deleteCharacteristicConfirmationObject().

{
global $ilCtrl, $tpl, $lng;
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cnt = 0;
foreach ($_POST["char"] as $char)
{
if (!empty($core_styles[$char]))
{
$cnt++;
$char_comp = explode(".", $char);
$cgui->addItem("", "", $char_comp[2]);
}
else
{
$cgui->addHiddenItem("char[]", $char);
}
}
$all_core_styles = ($cnt == count($_POST["char"]))
? true
: false;
if ($all_core_styles)
{
$cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
$cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
}
else
{
$cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
$cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
$cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
}
$tpl->setContent($cgui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::deleteImageObject ( )

Delete images.

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
$images = $this->object->getImages();
foreach ($images as $image)
{
if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"]))
{
$this->object->deleteImage($image["entry"]);
}
}
$ilCtrl->redirect($this, "listImages");
}
ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

Delete Media Queries.

Parameters
@return

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

References $_GET, $_POST, and $ilCtrl.

{
global $ilCtrl, $rbacsystem;
if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]) && is_array($_POST["mq_id"]))
{
foreach ($_POST["mq_id"] as $id)
{
$this->object->deleteMediaQuery($id);
}
}
$ilCtrl->redirect($this, "listMediaQueries");
}
ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

Confirm media query deletion.

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

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

{
global $ilCtrl, $tpl, $lng;
if (!is_array($_POST["mq_id"]) || count($_POST["mq_id"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listMediaQueries");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
$cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
$cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
foreach ($_POST["mq_id"] as $i)
{
$mq = $this->object->getMediaQueryForId($i);
$cgui->addItem("mq_id[]", $i, $mq["mquery"]);
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

public

Reimplemented from ilObjectGUI.

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

References ilUtil\getImageTagByType().

{
//$this->setTabs();
// display confirmation message
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("info_delete_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
$cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
$caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath).
" ".ilObject::_lookupTitle($this->object->getId());
$cgui->addItem("id[]", "", $caption);
$this->tpl->setContent($cgui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteStyleParameterObject ( )

delete style parameters

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

References $_POST, and editObject().

{
if (is_array($_POST["sty_select"]))
{
foreach($_POST["sty_select"] as $id => $dummy)
{
$this->object->deleteParameter($id);
}
}
$this->object->read();
$this->object->writeCSSFile();
$this->editObject();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

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

{
global $ilCtrl, $tpl, $lng;
if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listTemplates");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
$cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
$cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
foreach ($_POST["tid"] as $tid)
{
$classes = $this->object->getTemplateClasses($tid);
$cl_str = "";
$listed = array();
foreach ($classes as $cl)
{
if ($cl != "" && !$listed[$cl])
{
$cl_str.= '<div>- '.
$cl."</div>";
$listed[$cl] = true;
}
}
if ($cl_str != "")
{
$cl_str = '<div style="padding-left:30px;" class="small">'.
"<div><i>".$lng->txt("sty_style_class")."</i></div>".$cl_str."</div>";
}
$cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
}
$cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

Delete table template.

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
if (is_array($_POST["tid"]))
{
foreach ($_POST["tid"] as $tid)
{
$this->object->removeTemplate($tid);
}
}
$ilCtrl->redirect($this, "listTemplates");
}
ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete table template.

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

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

{
global $ilCtrl;
if (is_array($_POST["tid"]))
{
foreach ($_POST["tid"] as $tid)
{
$cls = $this->object->getTemplateClasses($tid);
foreach ($cls as $k => $cls)
{
$ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
$this->object->deleteCharacteristic($ty, $ta, $cls);
}
$this->object->removeTemplate($tid);
}
}
$ilCtrl->redirect($this, "listTemplates");
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::displayTemplateEditForm ( )

Display table tempalte edit form.

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

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

Referenced by editTemplateObject(), and updateTemplateObject().

{
global $tpl;
$a_tpl = new ilTemplate("tpl.template_edit.html", true, true,
"Services/Style");
$this->includeCSS();
$a_tpl->setVariable("FORM", $this->form_gui->getHTML());
$a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
$tpl->setContent($a_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::editColorObject ( )

Edit color.

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

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

{
global $tpl, $ilCtrl;
$ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
$this->initColorForm("edit");
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::editMediaQueryObject ( )

Edit media query.

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

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

{
global $tpl, $ilCtrl;
$ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
$this->initMediaQueryForm("edit");
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::editObject ( )

edit style sheet

Reimplemented from ilObjectGUI.

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

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

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

{
global $rbacsystem, $lng, $ilTabs, $ilCtrl, $ilToolbar, $tpl;
$this->setSubTabs();
$this->includeCSS();
$ctpl = new ilTemplate("tpl.sty_classes.html", true, true, "Services/Style");
// output characteristics
$chars = $this->object->getCharacteristics();
$style_type = ($this->super_type != "")
? $this->super_type
: "text_block";
$ilCtrl->setParameter($this, "style_type", $style_type);
$ilTabs->setSubTabActive("sty_".$style_type."_char");
// workaround to include default rte styles
if ($this->super_type == "rte")
{
$tpl->addCss("Modules/Scorm2004/templates/default/player.css");
include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
$tpl->addInlineCss(ilSCORM13Player::getInlineCss());
}
// add new style?
$subtypes = $all_super_types[$style_type];
$expandable = false;
foreach ($subtypes as $t)
{
{
$expandable = true;
}
}
if ($expandable && $rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
{
$ilToolbar->addButton($lng->txt("sty_add_characteristic"),
$ilCtrl->getLinkTarget($this, "addCharacteristicForm"));
}
if ($_SESSION["sty_copy"] != "")
{
$style_cp = explode(":::", $_SESSION["sty_copy"]);
if ($style_cp[1] == $_GET["style_type"])
{
if ($expandable)
{
$ilToolbar->addSeparator();
}
$ilToolbar->addButton($lng->txt("sty_paste_style_classes"),
$ilCtrl->getLinkTarget($this, "pasteCharacteristicsOverview"));
}
}
include_once("./Services/Style/classes/class.ilStyleTableGUI.php");
$table_gui = new ilStyleTableGUI($this, "edit", $chars, $style_type,
$this->object);
$ctpl->setCurrentBlock("style_table");
$ctpl->setVariable("STYLE_TABLE", $table_gui->getHTML());
$ctpl->parseCurrentBlock();
$this->tpl->setContent($ctpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::editTagStyleObject ( )

Edit tag style.

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

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

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
// media query selector
$mqs = $this->object->getMediaQueries();
if (count($mqs) > 0)
{
//
$options = array(
"" => $lng->txt("sty_default"),
);
foreach ($mqs as $mq)
{
$options[$mq["id"]] = $mq["mquery"];
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI("@media", "mq_id");
$si->setOptions($options);
$si->setValue((int) $_GET["mq_id"]);
$ilToolbar->addInputItem($si, true);
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
}
// workaround to include default rte styles
//if (in_array($_GET["style_type"], array("rte_menu")))
if ($this->super_type == "rte")
{
$tpl->addCss("Modules/Scorm2004/templates/default/player.css");
include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
$tpl->addInlineCss(ilSCORM13Player::getInlineCss());
}
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$this->initTagStyleForm("edit", $cur_tag);
$this->getValues();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::editTemplateObject ( )

Edit table template.

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

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

{
global $tpl, $ilCtrl;
$ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
$this->initTemplateForm("edit");
}

+ Here is the call graph for this function:

& ilObjStyleSheetGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

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

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd("edit");
// #9440/#9489: prepareOutput will fail if not set properly
if(!$this->object)
{
$this->setCreationMode(true);
}
$this->prepareOutput();
switch($next_class)
{
default:
$cmd.= "Object";
$ret =& $this->$cmd();
break;
}
return $ret;
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::exportStyleObject ( )

export style

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

References $file, and ilUtil\deliverFile().

{
$file = $this->object->export();
ilUtil::deliverFile($file, "sty_".$this->object->getId().".zip");
}

+ Here is the call graph for this function:

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

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

Referenced by getValues().

{
$parameters = array();
foreach($a_style as $tag)
{
foreach($tag as $par)
{
if ($par["tag"] == $a_tag && $par["class"] == $a_class
&& $par["type"] == $a_type && (int) $a_mq_id == (int) $par["mq_id"]
&& (int) $a_custom == (int) $par["custom"])
{
$parameters[$par["parameter"]] = $par["value"];
}
}
}
return $parameters;
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::generateTemplateObject ( )

Generate table template.

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

References ilObjectGUI\$tpl, and initTemplateGenerationForm().

{
global $tpl;
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::getAdminTabs ( $tabs_gui)

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

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

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::getColorFormValues ( )

Set values for color editing.

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

References $_GET.

Referenced by editColorObject().

{
if ($_GET["c_name"] != "")
{
$values["color_name"] = $_GET["c_name"];
$values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
$this->form_gui->setValuesByArray($values);
}
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

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

References $_GET.

Referenced by editMediaQueryObject().

{
if ($_GET["mq_id"] != "")
{
foreach ($this->object->getMediaQueries() as $mq)
{
if ($mq["id"] == (int) $_GET["mq_id"])
{
$values["mquery"] = $mq["mquery"];
}
}
$this->form_gui->setValuesByArray($values);
}
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

Referenced by propertiesObject().

{
$values = array();
$values["style_title"] = $this->object->getTitle();
$values["style_description"] = $this->object->getDescription();
$values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
$this->form->setValuesByArray($values);
}

+ Here is the caller graph for this function:

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

Get style example HTML.

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

References ilObjectGUI\$lng.

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

{
global $lng;
$c = explode(":", $a_class);
$a_class = $c[0];
$ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style");
$ex_tpl->setCurrentBlock("Example_".$a_type);
$ex_tpl->setVariable("EX_CLASS", "ilc_".$a_type."_".$a_class);
$ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
if (in_array($a_type, array("media_cont", "qimg")))
{
//
}
if (in_array($a_type, array("table", "table_caption")))
{
$ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
}
if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal")))
{
$ex_tpl->setVariable("HOR", "Horizontal");
}
$ex_tpl->parseCurrentBlock();
return $ex_tpl->get();
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

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

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

Referenced by getAdminTabs(), and setTabs().

{
global $lng, $ilCtrl, $ilTabs, $ilHelp;
$ilHelp->setScreenIdComponent("sty");
if ($ilCtrl->getCmd() == "editTagStyle")
{
// back to upper context
$tabs_gui->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "edit"));
$t = explode(".", $_GET["tag"]);
$t2 = explode(":", $t[1]);
$pc = $this->object->_getPseudoClasses($t[0]);
if (is_array($pc) && count($pc) > 0)
{
// style classes
$ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0]);
$tabs_gui->addTarget("sty_tag_normal",
$this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
get_class($this));
if ($t2[1] == "")
{
$ilTabs->setTabActive("sty_tag_normal");
}
foreach ($pc as $p)
{
// style classes
$ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0].":".$p);
$tabs_gui->addTarget("sty_tag_".$p,
$this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
get_class($this));
if ($t2[1] == $p)
{
$ilTabs->setTabActive("sty_tag_".$p);
}
}
$ilCtrl->setParameter($this, "tag", $_GET["tag"]);
}
}
else
{
// back to upper context
$tabs_gui->setBackTarget($lng->txt("back"),
$this->ctrl->getLinkTarget($this, "returnToUpperContext"));
// style classes
$tabs_gui->addTarget("sty_style_chars",
$this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
get_class($this));
// colors
$tabs_gui->addTarget("sty_colors",
$this->ctrl->getLinkTarget($this, "listColors"), "listColors",
get_class($this));
// media queries
$tabs_gui->addTarget("sty_media_queries",
$this->ctrl->getLinkTarget($this, "listMediaQueries"), "listMediaQueries",
get_class($this));
// images
$tabs_gui->addTarget("sty_images",
$this->ctrl->getLinkTarget($this, "listImages"), "listImages",
get_class($this));
// table templates
$tabs_gui->addTarget("sty_templates",
$this->ctrl->getLinkTarget($this, "listTemplates"), "listTemplates",
get_class($this));
// settings
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "properties"), "properties",
get_class($this));
// accordiontest
/*
$tabs_gui->addTarget("accordiontest",
$this->ctrl->getLinkTarget($this, "accordiontest"), "accordiontest",
get_class($this));*/
}
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

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

Referenced by editTemplateObject().

{
if ($_GET["t_id"] > 0)
{
$t = $this->object->getTemplate($_GET["t_id"]);
$values["name"] = $t["name"];
foreach ($scs as $k => $type)
{
$values[$k."_class"] = $t["classes"][$k];
}
$this->form_gui->setValuesByArray($values);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Get table template preview.

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

References _getTemplatePreview().

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

{
return $this->_getTemplatePreview(
$this->object, $a_type, $a_t_id, $a_small_mode);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::getValues ( )

FORM: Get current values from persistent object.

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

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

Referenced by editTagStyleObject().

{
$style = $this->object->getStyle();
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$cur_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
(int) $_GET["mq_id"], false);
foreach($parameters as $p => $v)
{
if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]]))
{
continue;
}
$p = explode(".", $p);
$p = $p[0];
$input = $this->form_gui->getItemByPostVar($p);
switch ($v["input"])
{
case "":
break;
case "trbl_numeric":
case "border_width":
case "border_style":
case "trbl_color":
$input->setAllValue($cur_parameters[$v["subpar"][0]]);
$input->setTopValue($cur_parameters[$v["subpar"][1]]);
$input->setRightValue($cur_parameters[$v["subpar"][2]]);
$input->setBottomValue($cur_parameters[$v["subpar"][3]]);
$input->setLeftValue($cur_parameters[$v["subpar"][4]]);
break;
default:
$input->setValue($cur_parameters[$p]);
break;
}
}
$cust_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
(int) $_GET["mq_id"], true);
$vals = array();
foreach ($cust_parameters as $k => $c)
{
$vals[] = $k.": ".$c;
}
$input = $this->form_gui->getItemByPostVar("custom_par");
$input->setValue($vals);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Constructor public.

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

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

{
global $ilCtrl, $lng, $tpl;
$this->ctrl =& $ilCtrl;
$this->lng =& $lng;
$this->lng->loadLanguageModule("style");
$ilCtrl->saveParameter($this, array("tag", "style_type", "temp_type"));
if ($_GET["style_type"] != "")
{
$this->super_type = ilObjStyleSheet::_getStyleSuperTypeForType($_GET["style_type"]);
}
$this->type = "sty";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::importStyleObject ( )

import style sheet

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

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

{
// check file
$source = $_FILES["stylefile"]["tmp_name"];
if (($source == 'none') || (!$source))
{
$this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
}
// check correct file type
$info = pathinfo($_FILES["stylefile"]["name"]);
if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml")
{
$this->ilias->raiseError("File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
}
$class_name = "ilObjStyleSheet";
require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$newObj = new ilObjStyleSheet();
//$newObj->setTitle();
//$newObj->setDescription($_POST["style_description"]);
$newObj->import($_FILES["stylefile"]);
//$newObj->createFromXMLFile($_FILES["stylefile"]["tmp_name"]);
// assign style to style sheet folder,
// if parent is style sheet folder
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$fold->addStyle($newObj->getId());
$fold->update();
ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
$this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
}
return $newObj->getId();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::includeCSS ( )

Include CSS in output.

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

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

{
// set style sheet
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->object->getContentStylePath($this->object->getId()));
$this->tpl->parseCurrentBlock();
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::initCharacteristicForm (   $a_mode)

Init tag style editing form.

Parameters
int$a_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)

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

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

Referenced by addCharacteristicFormObject(), and saveCharacteristicObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
// title
$txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
$txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
$txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include")." A-Z, a-z, 1-9");
$txt_input->setRequired(true);
$this->form_gui->addItem($txt_input);
// type
$types = $all_super_types[$this->super_type];
$exp_types = array();
foreach($types as $t)
{
{
$exp_types[$t] = $lng->txt("sty_type_".$t);
}
}
if (count($exp_types) > 1)
{
$type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
$type_input->setOptions($exp_types);
$type_input->setValue(key($exp_types));
$this->form_gui->addItem($type_input);
}
else if (count($exp_types) == 1)
{
$hid_input = new ilHiddenInputGUI("type");
$hid_input->setValue(key($exp_types));
$this->form_gui->addItem($hid_input);
}
$this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
$this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
$this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Init color form.

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

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

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTitle($lng->txt("sty_add_color"));
// name
$name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
$name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
$name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
$name_input->setRequired(true);
$name_input->setSize(15);
$name_input->setMaxLength(15);
$this->form_gui->addItem($name_input);
// code
$color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
$color_input->setRequired(true);
$color_input->setDefaultColor("");
$this->form_gui->addItem($color_input);
if ($a_mode == "create")
{
$this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
}
else
{
$this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
}
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::initImageForm ( )

Init image form.

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

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

Referenced by addImageObject(), and uploadImageObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTitle($lng->txt("sty_add_image"));
$file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
$file_input->setRequired(true);
$this->form_gui->addItem($file_input);
$this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
$this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Init media query form.

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

References $ilCtrl, and ilObjectGUI\$lng.

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTitle($lng->txt("sty_add_media_query"));
// media query
$ti = new ilTextInputGUI("@media", "mquery");
$ti->setMaxLength(2000);
$this->form_gui->addItem($ti);
if ($a_mode == "create")
{
$this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
$this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
}
else
{
$this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
$this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
}
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the caller graph for this function:

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

FORM: Init properties form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by propertiesObject(), and updateObject().

{
global $lng, $rbacsystem;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$this->form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
//$ta->setCols();
//$ta->setRows();
$this->form->addItem($ta);
// disable automatic margins for left/right alignment
$cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
$cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
$this->form->addItem($cb);
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("save", $lng->txt("save"));
$this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
}
else
{
if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
{
$this->form->addCommandButton("update", $lng->txt("save"));
}
}
$this->form->setTitle($lng->txt("edit_stylesheet"));
$this->form->setFormAction($this->ctrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

{
global $lng, $ilCtrl;
$ilCtrl->saveParameter($this, array("mq_id"));
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$avail_pars = $this->object->getAvailableParameters();
$groups = $this->object->getStyleParameterGroups();
// output select lists
foreach ($groups as $k => $group)
{
// filter groups of properties that should only be
// displayed with matching tag
if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
{
continue;
}
$sh->setTitle($lng->txt("sty_".$k));
$this->form_gui->addItem($sh);
foreach ($group as $par)
{
$basepar = explode(".", $par);
$basepar = $basepar[0];
$var = str_replace("-", "_", $basepar);
$up_par = strtoupper($var);
{
case "select":
$sel_input = new ilSelectInputGUI($lng->txt("sty_".$var), $basepar);
$options = array("" => "");
foreach ($avail_pars[$par] as $p)
{
$options[$p] = $p;
}
$sel_input->setOptions($options);
$this->form_gui->addItem($sel_input);
break;
case "text":
$text_input = new ilTextInputGUI($lng->txt("sty_".$var), $basepar);
$text_input->setMaxLength(200);
$text_input->setSize(20);
$this->form_gui->addItem($text_input);
break;
case "fontsize":
include_once("./Services/Style/classes/class.ilFontSizeInputGUI.php");
$fs_input = new ilFontSizeInputGUI($lng->txt("sty_".$var), $basepar);
$this->form_gui->addItem($fs_input);
break;
case "numeric_no_perc":
case "numeric":
include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
$num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc")
{
$num_input->setAllowPercentage(false);
}
$this->form_gui->addItem($num_input);
break;
case "percentage":
$per_input = new ilNumberInputGUI($lng->txt("sty_".$var), $basepar);
$per_input->setMinValue(0);
$per_input->setMaxValue(100);
$per_input->setMaxLength(3);
$per_input->setSize(3);
$this->form_gui->addItem($per_input);
break;
case "color":
//include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
$col_input = new ilColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
$col_input->setDefaultColor("");
$col_input->setAcceptNamedColors(true);
$this->form_gui->addItem($col_input);
break;
case "trbl_numeric":
include_once("./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
$num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc")
{
$num_input->setAllowPercentage(false);
}
$this->form_gui->addItem($num_input);
break;
case "border_width":
include_once("./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
$bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_".$var), $basepar);
$this->form_gui->addItem($bw_input);
break;
case "border_style":
include_once("./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
$bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_".$var), $basepar);
$this->form_gui->addItem($bw_input);
break;
case "trbl_color":
include_once("./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
$col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
$col_input->setAcceptNamedColors(true);
$this->form_gui->addItem($col_input);
break;
case "background_image":
include_once("./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
$im_input = new ilBackgroundImageInputGUI($lng->txt("sty_".$var), $basepar);
$imgs = array();
foreach ($this->object->getImages() as $entry)
{
$imgs[] = $entry["entry"];
}
$im_input->setImages($imgs);
$this->form_gui->addItem($im_input);
break;
case "background_position":
include_once("./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
$im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_".$var), $basepar);
$this->form_gui->addItem($im_input);
break;
}
}
}
// custom parameters
$sh->setTitle($lng->txt("sty_custom"));
$this->form_gui->addItem($sh);
// custom parameters
$ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
$ti->setMaxLength(300);
$ti->setSize(80);
$ti->setMulti(true);
$ti->setInfo($this->lng->txt("sty_custom_par_info"));
$this->form_gui->addItem($ti);
// save and cancel commands
$this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
$this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
// $this->form_gui->setTitle($lng->txt("edit"));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Init table template form.

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

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

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
if ($a_mode == "create")
{
$this->form_gui->setTitle($lng->txt("sty_add_template"));
}
else
{
$this->form_gui->setTitle($lng->txt("sty_edit_template"));
}
// name
$name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
$name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
$name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
$name_input->setRequired(true);
$name_input->setSize(30);
$name_input->setMaxLength(30);
$this->form_gui->addItem($name_input);
// template style classes
foreach ($scs as $sc => $st)
{
$sc_input = new ilSelectInputGUI($lng->txt("sty_".$sc."_class"), $sc."_class");
$chars = $this->object->getCharacteristics($st);
$options = array("" => "");
foreach($chars as $char)
{
$options[$char] = $char;
}
$sc_input->setOptions($options);
$this->form_gui->addItem($sc_input);
}
if ($a_mode == "create")
{
$this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
$this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
}
else
{
$this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
$this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
$this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
}
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::initTemplateGenerationForm ( )

Init table template generation form.

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

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

Referenced by generateTemplateObject(), and templateGenerationObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTitle($lng->txt("sty_generate_template"));
// name
$name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
$name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
$name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
$name_input->setRequired(true);
$name_input->setSize(30);
$name_input->setMaxLength(30);
$this->form_gui->addItem($name_input);
// basic layout
$bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
$options = array(
"coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
"bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
"noZebra" => $lng->txt("sty_table_template_no_zebra")
);
$bl_input->setOptions($options);
$this->form_gui->addItem($bl_input);
// top bottom padding
include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
$num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
$num_input->setAllowPercentage(false);
$num_input->setValue("3px");
$this->form_gui->addItem($num_input);
// left right padding
$num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
$num_input->setAllowPercentage(false);
$num_input->setValue("10px");
$this->form_gui->addItem($num_input);
// base color
$bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
$cs = $this->object->getColors();
$options = array();
foreach ($cs as $c)
{
$options[$c["name"]] = $c["name"];
}
$bc_input->setOptions($options);
$this->form_gui->addItem($bc_input);
// Lightness Settings
$lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
"cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
foreach ($lss as $ls => $v)
{
$l_input = new ilNumberInputGUI($lng->txt("sty_lightness_".$ls), "lightness_".$ls);
$l_input->setMaxValue(100);
$l_input->setMinValue(-100);
$l_input->setValue($v);
$l_input->setSize(4);
$l_input->setMaxLength(4);
$this->form_gui->addItem($l_input);
}
$this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
$this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::listColorsObject ( )

List colors of style.

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

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

{
global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
{
$ilToolbar->addButton($this->lng->txt("sty_add_color"),
$ilCtrl->getLinkTarget($this, "addColor"));
}
include_once("./Services/Style/classes/class.ilStyleColorTableGUI.php");
$table_gui = new ilStyleColorTableGUI($this, "listColors",
$this->object);
$tpl->setContent($table_gui->getHTML());
}
ilObjStyleSheetGUI::listImagesObject ( )

List images of style.

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

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

{
global $tpl, $ilToolbar, $ilCtrl, $lng, $rbacsystem;
if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
{
$ilToolbar->addButton($lng->txt("sty_add_image"),
$ilCtrl->getLinkTarget($this, "addImage"));
}
include_once("./Services/Style/classes/class.ilStyleImageTableGUI.php");
$table_gui = new ilStyleImageTableGUI($this, "listImages",
$this->object);
$tpl->setContent($table_gui->getHTML());
}
ilObjStyleSheetGUI::listMediaQueriesObject ( )

List media queries of style.

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

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

{
global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
{
$ilToolbar->addButton($this->lng->txt("sty_add_media_query"),
$ilCtrl->getLinkTarget($this, "addMediaQuery"));
}
include_once("./Services/Style/classes/class.ilStyleMediaQueryTableGUI.php");
$table_gui = new ilStyleMediaQueryTableGUI($this, "listMediaQueries",
$this->object);
$tpl->setContent($table_gui->getHTML());
}
ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

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

{
global $tpl, $ilTabs, $ilCtrl;
$ctype = $_GET["temp_type"];
if ($ctype == "")
{
$ctype = "table";
$ilCtrl->setParameter($this, "temp_type", $ctype);
$_GET["temp_type"] = $ctype;
}
$ilTabs->setSubTabActive("sty_".$ctype."_templates");
$this->includeCSS();
include_once("./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
$table_gui = new ilTableTemplatesTableGUI($ctype, $this, "listTemplates",
$this->object);
$tpl->setContent($table_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::newStyleParameterObject ( )

add style parameter

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

References $_POST, and editObject().

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

+ Here is the call graph for this function:

ilObjStyleSheetGUI::outputTagStyleEditScreen ( )

Output tag style edit screen.

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

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

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

{
global $tpl, $ilCtrl, $lng;
// set style sheet
$tpl->setCurrentBlock("ContentStyle");
$tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->object->getContentStylePath($this->object->getId()));
$ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style");
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$ts_tpl->setVariable("EXAMPLE",
ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class));
$ts_tpl->setVariable("FORM",
$this->form_gui->getHtml());
$tpl->setTitle($cur_class." (".$lng->txt("sty_type_".$_GET["style_type"]).")");
$tpl->setContent($ts_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::pasteCharacteristicsObject ( )

Paste characteristics.

Parameters
@return

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

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

{
global $ilCtrl, $lng;
if (is_array($_POST["title"]))
{
foreach ($_POST["title"] as $from_char => $to_title)
{
$fc = explode(".", $from_char);
if ($_POST["conflict_action"][$from_char] == "overwrite" ||
!$this->object->characteristicExists($to_title, $fc[0]))
{
$this->object->copyCharacteristic($_POST["from_style_id"],
$fc[0], $fc[2], $to_title);
}
}
ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
unset($_SESSION["sty_copy"]);
ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
}
$ilCtrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::pasteCharacteristicsOverviewObject ( )

Paste characteristics overview.

Parameters
@return

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

References ilObjectGUI\$tpl.

{
global $tpl, $ilTabs;
$ilTabs->clearTargets();
include_once("./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
$table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
$tpl->setContent($table->getHTML());
}
ilObjStyleSheetGUI::propertiesObject ( )

Properties.

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

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

{
global $rbacsystem, $lng, $ilToolbar;
// set style sheet
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->object->getContentStylePath($this->object->getId()));
$this->tpl->parseCurrentBlock();
// export button
$ilToolbar->addButton($this->lng->txt("export"),
$this->ctrl->getLinkTarget($this, "exportStyle"));
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

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

References $_POST, and editObject().

{
$this->object->setTitle($_POST["style_title"]);
$this->object->setDescription($_POST["style_description"]);
foreach($_POST["styval"] as $id => $value)
{
$this->object->updateStyleParameter($id, $value);
}
$this->object->update();
$this->editObject();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

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

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

{
global $ilCtrl;
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$this->initTagStyleForm("edit", $cur_tag);
if ($this->form_gui->checkInput())
{
$this->saveTagStyle();
$ilCtrl->redirect($this, "editTagStyle");
}
else
{
$this->form_gui->setValuesByPost();
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

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

References updateTemplateObject().

{
$this->updateTemplateObject(true);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::returnToUpperContextObject ( )

return to upper context

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

References $_GET, and $ilCtrl.

{
global $ilCtrl;
if ($_GET["baseClass"] == "ilAdministrationGUI")
{
$ilCtrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
$ilCtrl->returnToParent($this);
}
ilObjStyleSheetGUI::saveCharacteristicObject ( )

Save Characteristic.

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

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

{
global $ilCtrl, $tpl, $lng;
$this->initCharacteristicForm("create");
if ($this->form_gui->checkInput())
{
if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"]))
{
$char_input = $this->form_gui->getItemByPostVar("new_characteristic");
$char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
}
else
{
$this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
$ilCtrl->setParameter($this, "tag",
ilObjStyleSheet::_determineTag($_POST["type"]).".".$_POST["new_characteristic"]);
$ilCtrl->setParameter($this, "style_type", $_POST["type"]);
$ilCtrl->redirect($this, "editTagStyle");
}
}
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

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

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

{
global $tpl, $ilCtrl, $lng;
$this->initColorForm();
if ($this->form_gui->checkInput())
{
if ($this->object->colorExists($_POST["color_name"]))
{
$col_input = $this->form_gui->getItemByPostVar("color_name");
$col_input->setAlert($lng->txt("sty_color_already_exists"));
}
else
{
$this->object->addColor($_POST["color_name"],
$_POST["color_code"]);
$ilCtrl->redirect($this, "listColors");
}
}
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::saveHideStatusObject ( )

Save hide status for characteristics.

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

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

{
global $ilCtrl, $lng;
//var_dump($_POST);
foreach ($_POST["all_chars"] as $char)
{
$ca = explode(".", $char);
$this->object->saveHideStatus($ca[0], $ca[2],
(is_array($_POST["hide"]) && in_array($char, $_POST["hide"])));
}
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "edit");
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::saveMediaQueryObject ( )

Save media query.

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

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

{
global $tpl, $ilCtrl, $lng;
if ($this->form_gui->checkInput())
{
$this->object->addMediaQuery($_POST["mquery"]);
$ilCtrl->redirect($this, "listMediaQueries");
}
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::saveMediaQueryOrderObject ( )

Save media query order.

Parameters
@return

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
if (is_array($_POST["order"]))
{
$this->object->saveMediaQueryOrder($_POST["order"]);
}
$ilCtrl->redirect($this, "listMediaQueries");
}
ilObjStyleSheetGUI::saveObject ( )

save style sheet

Reimplemented from ilObjectGUI.

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

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

{
if(!trim($_POST["style_title"]))
{
$this->ctrl->redirect($this, "create");
}
//echo "HH"; exit;
$class_name = "ilObjStyleSheet";
require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$newObj = new ilObjStyleSheet();
$newObj->setTitle("-");
$newObj->create();
$newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
$newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
$newObj->update();
// assign style to style sheet folder,
// if parent is style sheet folder
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$fold->addStyle($newObj->getId());
$fold->update();
ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
$this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
}
return $newObj->getId();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::saveTagStyle ( )

Save tag style.

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

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

Referenced by refreshTagStyleObject(), and updateTagStyleObject().

{
$cur = explode(".", $_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$avail_pars = ilObjStyleSheet::_getStyleParameters($cur_tag);
foreach ($avail_pars as $par => $v)
{
$var = str_replace("-", "_", $par);
$basepar_arr = explode(".", $par);
$basepar = $basepar_arr[0];
if ($basepar_arr[1] != "" && $basepar_arr[1] != $cur_tag)
{
continue;
}
switch ($v["input"])
{
case "fontsize":
case "numeric_no_perc":
case "numeric":
case "background_image":
$in = $this->form_gui->getItemByPostVar($basepar);
//echo "<br>-".$cur_tag."-".$cur_class."-".$basepar."-".$_GET["style_type"]."-";
$this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
break;
case "color":
$color = trim($_POST[$basepar]);
if ($color != "" && trim(substr($color,0,1) != "!"))
{
$color = "#".$color;
}
$this->writeStylePar($cur_tag, $cur_class, $basepar, $color, $_GET["style_type"], (int) $_GET["mq_id"]);
break;
case "trbl_numeric":
case "border_width":
case "border_style":
$in = $this->form_gui->getItemByPostVar($basepar);
$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0], $in->getAllValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1], $in->getTopValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2], $in->getRightValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3], $in->getBottomValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4], $in->getLeftValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
break;
case "trbl_color":
$in = $this->form_gui->getItemByPostVar($basepar);
$tblr_p = array (0 => "getAllValue", 1 => "getTopValue", 2 => "getRightValue",
3 => "getBottomValue", 4 => "getLeftValue");
foreach ($tblr_p as $k => $func)
{
$val = trim($in->$func());
$val = (($in->getAcceptNamedColors() && substr($val, 0, 1) == "!")
|| $val == "")
? $val
: "#".$val;
$this->writeStylePar($cur_tag, $cur_class, $v["subpar"][$k], $val, $_GET["style_type"], (int) $_GET["mq_id"]);
}
break;
case "background_position":
$in = $this->form_gui->getItemByPostVar($basepar);
$this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
break;
default:
$this->writeStylePar($cur_tag, $cur_class, $basepar, $_POST[$basepar], $_GET["style_type"], (int) $_GET["mq_id"]);
break;
}
}
// write custom parameter
$this->object->deleteCustomStylePars($cur_tag, $cur_class, $_GET["style_type"], (int) $_GET["mq_id"]);
if (is_array($_POST["custom_par"]))
{
foreach ($_POST["custom_par"] as $cpar)
{
$par_arr = explode(":", $cpar);
if (count($par_arr) == 2)
{
$par = trim($par_arr[0]);
$val = trim(str_replace(";", "", $par_arr[1]));
$this->writeStylePar($cur_tag, $cur_class, $par, $val, $_GET["style_type"], (int) $_GET["mq_id"], true);
}
}
}
$this->object->update();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::saveTemplateObject ( )

Save table template.

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

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

{
global $tpl, $ilCtrl, $lng;
$this->initTemplateForm();
if ($this->form_gui->checkInput())
{
if ($this->object->templateExists($_POST["name"]))
{
$name_input = $this->form_gui->getItemByPostVar("name");
$name_input->setAlert($lng->txt("sty_table_template_already_exists"));
}
else
{
$classes = array();
foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
{
$classes[$tct] = $_POST[$tct."_class"];
}
$t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
$this->object->writeTemplatePreview($t_id,
$this->getTemplatePreview($_GET["temp_type"], $t_id, true));
$ilCtrl->redirect($this, "listTemplates");
}
}
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::setSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

Referenced by editObject().

{
global $lng, $ilTabs, $ilCtrl;
foreach ($types as $super_type => $types)
{
// text block characteristics
$ilCtrl->setParameter($this, "style_type", $super_type);
$ilTabs->addSubTabTarget("sty_".$super_type."_char",
$this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
get_class($this));
}
$ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\$lng, and getTabs().

{
global $lng;
$this->getTabs($this->tabs_gui);
if (strtolower(get_class($this->object)) == "ilobjstylesheet")
{
$this->tpl->setVariable("HEADER", $this->object->getTitle());
}
else
{
$this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

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

Referenced by listTemplatesObject().

{
global $lng, $ilTabs, $ilCtrl;
foreach ($types as $t => $c)
{
$ilCtrl->setParameter($this, "temp_type", $t);
$ilTabs->addSubTabTarget("sty_".$t."_templates",
$this->ctrl->getLinkTarget($this, "listTemplates"), array("listTemplates", ""),
get_class($this));
}
$ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::showUpperIcon ( )

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

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

{
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
$tpl->setUpperIcon(
$this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui",
"editContentStyles"));
}
else
{
// ?
}
}
ilObjStyleSheetGUI::switchMQueryObject ( )

Switch media query.

Parameters
@return

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
$ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
$ilCtrl->redirect($this, "editTagStyle");
}
ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

{
global $tpl, $ilCtrl, $lng;
if ($this->form_gui->checkInput())
{
if ($this->object->templateExists($_POST["name"]))
{
$name_input = $this->form_gui->getItemByPostVar("name");
$name_input->setAlert($lng->txt("sty_table_template_already_exists"));
}
else
{
// -> move to application class!
// cell classes
$cells = array("H" => "header", "C1" => "cell1", "C2" => "cell2");
$tb_p = $this->form_gui->getItemByPostVar("tb_padding");
$tb_padding = $tb_p->getValue();
$lr_p = $this->form_gui->getItemByPostVar("lr_padding");
$lr_padding = $lr_p->getValue();
$cell_color = $_POST["base_color"];
// use mid gray as cell color for bw zebra
if ($_POST["layout"] == "bwZebra")
{
$cell_color = "MidGray";
if (!$this->object->colorExists($cell_color))
{
$this->object->addColor($cell_color, "7F7F7F");
}
$this->object->updateColor($cell_color, $cell_color, "7F7F7F");
}
foreach ($cells as $k => $cell)
{
$cell_class[$k] = $_POST["name"].$k;
if (!$this->object->characteristicExists($cell_class[$k], "table_cell"))
{
$this->object->addCharacteristic("table_cell", $cell_class[$k], true);
}
if ($_POST["layout"] == "bwZebra" && $k == "H")
{
$this->object->replaceStylePar("td", $cell_class[$k], "color",
"!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "background-color",
"!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
}
else
{
$this->object->replaceStylePar("td", $cell_class[$k], "color",
"!".$cell_color."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "background-color",
"!".$cell_color."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
}
$this->object->replaceStylePar("td", $cell_class[$k], "padding-top",
$tb_padding, "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "padding-bottom",
$tb_padding, "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "padding-left",
$lr_padding, "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "padding-right",
$lr_padding, "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "border-width",
"1px", "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "border-style",
"solid", "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "border-color",
"!".$cell_color."(".$_POST["lightness_border"].")", "table_cell");
$this->object->replaceStylePar("td", $cell_class[$k], "font-weight",
"normal", "table_cell");
}
// table class
$classes["table"] = $_POST["name"]."T";
if (!$this->object->characteristicExists($classes["table"], "table"))
{
$this->object->addCharacteristic("table", $classes["table"], true);
}
$this->object->replaceStylePar("table", $classes["table"], "caption-side",
"bottom", "table");
$this->object->replaceStylePar("table", $classes["table"], "border-collapse",
"collapse", "table");
$this->object->replaceStylePar("table", $classes["table"], "margin-top",
"5px", "table");
$this->object->replaceStylePar("table", $classes["table"], "margin-bottom",
"5px", "table");
if ($_POST["layout"] == "bwZebra")
{
$this->object->replaceStylePar("table", $classes["table"], "border-bottom-color",
"!".$_POST["base_color"], "table");
$this->object->replaceStylePar("table", $classes["table"], "border-bottom-style",
"solid", "table");
$this->object->replaceStylePar("table", $classes["table"], "border-bottom-width",
"3px", "table");
$sb = array("left", "right", "top");
foreach ($sb as $b)
{
$this->object->replaceStylePar("table", $classes["table"], "border-".$b."-width",
"0px", "table");
}
}
switch ($_POST["layout"])
{
case "coloredZebra":
$classes["row_head"] = $cell_class["H"];
$classes["odd_row"] = $cell_class["C1"];
$classes["even_row"] = $cell_class["C2"];
break;
case "bwZebra":
$classes["row_head"] = $cell_class["H"];
$classes["odd_row"] = $cell_class["C1"];
$classes["even_row"] = $cell_class["C2"];
break;
case "noZebra":
$classes["row_head"] = $cell_class["H"];
$classes["odd_row"] = $cell_class["C1"];
$classes["even_row"] = $cell_class["C1"];
$classes["col_head"] = $cell_class["C2"];
break;
}
$t_id = $this->object->addTemplate($_GET["temp_type"],
$_POST["name"], $classes);
$this->object->writeTemplatePreview($t_id,
$this->getTemplatePreview($_GET["temp_type"], $t_id, true));
$ilCtrl->redirect($this, "listTemplates");
}
}
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

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

{
global $tpl, $ilCtrl, $lng;
$this->initColorForm("edit");
if ($this->form_gui->checkInput())
{
if ($this->object->colorExists($_POST["color_name"]) &&
$_POST["color_name"] != $_GET["c_name"])
{
$col_input = $this->form_gui->getItemByPostVar("color_name");
$col_input->setAlert($lng->txt("sty_color_already_exists"));
}
else
{
$this->object->updateColor($_GET["c_name"], $_POST["color_name"],
$_POST["color_code"]);
$ilCtrl->redirect($this, "listColors");
}
}
$ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::updateMediaQueryObject ( )

Update media query.

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

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

{
global $tpl, $ilCtrl, $lng;
$this->initMediaQueryForm("edit");
if ($this->form_gui->checkInput())
{
$this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
$ilCtrl->redirect($this, "listMediaQueries");
}
$ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
$this->form_gui->setValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::updateObject ( )

Update properties.

Reimplemented from ilObjectGUI.

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

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

{
global $lng, $ilCtrl, $tpl;
$this->initPropertiesForm("edit");
if ($this->form->checkInput())
{
$this->object->setTitle($this->form->getInput("style_title"));
$this->object->setDescription($this->form->getInput("style_description"));
$this->object->writeStyleSetting("disable_auto_margins",
$this->form->getInput("disable_auto_margins"));
$this->object->update();
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "properties");
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::updateTagStyleObject ( )

save and refresh tag editing

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

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

{
global $ilCtrl;
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$this->initTagStyleForm("edit", $cur_tag);
if ($this->form_gui->checkInput())
{
$this->saveTagStyle();
$ilCtrl->redirect($this, "edit");
}
else
{
$this->form_gui->setValuesByPost();
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::updateTemplateObject (   $a_refresh = false)

Update table template.

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

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

Referenced by refreshTemplateObject().

{
global $tpl, $ilCtrl, $lng;
$ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
$this->initTemplateForm("edit");
if ($this->form_gui->checkInput())
{
if ($this->object->templateExists($_POST["name"]) &&
{
$name_input = $this->form_gui->getItemByPostVar("name");
$name_input->setAlert($lng->txt("sty_template_already_exists"));
}
else
{
$classes = array();
foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
{
$classes[$tct] = $_POST[$tct."_class"];
}
$this->object->updateTemplate($_GET["t_id"],
$_POST["name"], $classes);
$this->object->writeTemplatePreview($_GET["t_id"],
$this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true));
if(!$a_refresh)
{
$ilCtrl->redirect($this, "listTemplates");
}
}
}
$this->form_gui->setValuesByPost();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::uploadImageObject ( )

Upload image.

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

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

{
global $tpl, $ilCtrl;
$this->initImageForm();
if ($this->form_gui->checkInput())
{
$this->object->uploadImage($_FILES["image_file"]);
$ilCtrl->redirect($this, "listImages");
}
else
{
//$this->form_gui->setImageFormValuesByPost();
$tpl->setContent($this->form_gui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::viewObject ( )

list childs of current object

public

Reimplemented from ilObjectGUI.

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

References editObject().

{
$this->editObject();
}

+ Here is the call graph for this function:

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

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

Referenced by saveTagStyle().

{
// echo $_GET["mq_id"]."-";
// echo $a_mq_id."-"; exit;
if ($a_type == "")
{
return;
}
if ($value != "")
{
$this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
}
else
{
$this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
}
}

+ Here is the caller graph for this function:

Field Documentation

ilObjStyleSheetGUI::$cmd_delete

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

ilObjStyleSheetGUI::$cmd_new_par

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

ilObjStyleSheetGUI::$cmd_refresh

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

ilObjStyleSheetGUI::$cmd_update

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


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