ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

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

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference)
 
 enableWrite (bool $a_write)
 Enable writing. More...
 
 executeCommand ()
 
 viewObject ()
 
 createObject ()
 
 includeCSS ()
 
 editObject ()
 Edit -> List characteristics. More...
 
 propertiesObject ()
 
 getPropertiesValues ()
 Get current values for properties from. More...
 
 initPropertiesForm (string $a_mode="edit")
 FORM: Init properties form. More...
 
 updateObject ()
 
 exportStyleObject ()
 
 deleteObject ($a_error=false)
 display deletion confirmation screen More...
 
 cancelDeleteObject ()
 
 confirmedDeleteObject ()
 delete selected style objects More...
 
 saveObject ()
 
 copyStyleObject ()
 
 importStyleObject ()
 Import style sheet. More...
 
 cancelObject ()
 
 getAdminTabs ()
 
 setTemplatesSubTabs ()
 
 listColorsObject ()
 List colors of style. More...
 
 addColorObject ()
 
 editColorObject ()
 
 initColorForm (string $a_mode="create")
 
 getColorFormValues ()
 Set values for color editing. More...
 
 cancelColorSavingObject ()
 Cancel color saving. More...
 
 saveColorObject ()
 Save color. More...
 
 updateColorObject ()
 Update color. More...
 
 deleteColorConfirmationObject ()
 Delete color confirmation. More...
 
 cancelColorDeletionObject ()
 Cancel color deletion. More...
 
 deleteColorObject ()
 
 listMediaQueriesObject ()
 
 addMediaQueryObject ()
 
 editMediaQueryObject ()
 
 initMediaQueryForm (string $a_mode="create")
 Init media query form. More...
 
 getMediaQueryFormValues ()
 Set values for media query editing. More...
 
 saveMediaQueryObject ()
 Save media query. More...
 
 updateMediaQueryObject ()
 
 deleteMediaQueryConfirmationObject ()
 
 deleteMediaQueriesObject ()
 
 saveMediaQueryOrderObject ()
 
 listTemplatesObject ()
 List templates. More...
 
 addTemplateObject ()
 
 editTemplateObject ()
 
 getTemplatePreview (string $a_type, int $a_t_id, bool $a_small_mode=false)
 
 initTemplateForm (string $a_mode="create")
 Init table template form. More...
 
 cancelTemplateSavingObject ()
 Cancel color saving. More...
 
 saveTemplateObject ()
 Save table template. More...
 
 updateTemplateObject (bool $a_refresh=false)
 
 displayTemplateEditForm ()
 
 refreshTemplateObject ()
 Refresh table template. More...
 
 getTemplateFormValues ()
 Set values for table template editing. More...
 
 deleteTemplateConfirmationObject ()
 Delete table template confirmation. More...
 
 cancelTemplateDeletionObject ()
 Cancel table template deletion. More...
 
 deleteTemplateKeepClassesObject ()
 
 deleteTemplateObject ()
 Delete template. More...
 
 generateTemplateObject ()
 
 initTemplateGenerationForm ()
 Init table template generation form. More...
 
 templateGenerationObject ()
 Table template generation. More...
 
 returnToUpperContextObject ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static getStyleExampleHTML (string $a_type, string $a_class)
 Get style example HTML. More...
 
static _getTemplatePreview (ilObjStyleSheet $a_style, string $a_type, int $a_t_id, bool $a_small_mode=false)
 Get table template preview. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

string $cmd_update
 
string $cmd_new_par
 
string $cmd_delete
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 getCreateForm ()
 
 getImportForm ()
 
 getCloneForm ()
 
 getTabs ()
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ilPropertyFormGUI $form_gui
 
ilPropertyFormGUI $form
 
Content StandardGUIRequest $style_request
 
Content InternalService $service
 
ilHelpGUI $help
 
ilObjectDefinition $obj_definition
 
bool $enable_write = false
 
string $super_type
 
Access StyleAccessManager $access_manager
 
Content CharacteristicManager $characteristic_manager
 
Content ColorManager $color_manager
 
Content ImageManager $image_manager
 
Content InternalGUIService $gui_service
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStyleSheetGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference 
)

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

References $DIC, ilObjectGUI\$ref_id, ILIAS\MetaData\Repository\Validation\Data\__construct(), ilObjStyleSheet\_getStyleSuperTypeForType(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

54  {
55  global $DIC;
56 
57  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
58 
59  $this->service = $DIC->contentStyle()
60  ->internal();
61  $this->gui_service = $this->service->gui();
62  $this->help = $this->gui_service->help();
63  $this->lng->loadLanguageModule("style");
64  $this->ctrl->saveParameter($this, array("tag", "style_type", "temp_type"));
65  $this->style_request = $DIC->contentStyle()
66  ->internal()
67  ->gui()
68  ->standardRequest();
69 
70  $this->super_type = "";
71  if ($this->style_request->getStyleType() != "") {
73  $this->style_request->getStyleType()
74  );
75  }
76  $this->type = "sty";
77 
78  $ref_id = (is_object($this->object))
79  ? $this->object->getRefId()
80  : 0;
81  $style_id = (is_object($this->object))
82  ? $this->object->getId()
83  : 0;
84 
85  $this->access_manager = $this->service->domain()->access(
86  $ref_id,
87  $this->user->getId()
88  );
89  $this->characteristic_manager = $this->service->domain()->characteristic(
90  $style_id,
91  $this->access_manager
92  );
93  $this->color_manager = $this->service->domain()->color(
94  $style_id,
95  $this->access_manager
96  );
97  $this->image_manager = $this->service->domain()->image(
98  $style_id,
99  $this->access_manager
100  );
101  }
static _getStyleSuperTypeForType(string $a_type)
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getTemplatePreview()

static ilObjStyleSheetGUI::_getTemplatePreview ( ilObjStyleSheet  $a_style,
string  $a_type,
int  $a_t_id,
bool  $a_small_mode = false 
)
static

Get table template preview.

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

References Vendor\Package\$c, $DIC, ilObjectGUI\$lng, ilPCTableGUI\_renderTable(), ilAccordionGUI\addCss(), ilObjStyleSheet\getTemplate(), ilObjStyleSheet\getTemplateXML(), ilObjStyleSheet\lookupTemplateName(), and ilLanguage\txt().

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

1204  : string {
1205  global $DIC;
1206 
1207  $lng = $DIC->language();
1208  $p_content = "";
1209 
1210  $kr = $kc = 7;
1211  if ($a_small_mode) {
1212  $kr = 6;
1213  $kc = 5;
1214  }
1215 
1216  $ts = $a_style->getTemplate($a_t_id);
1217  $t = $ts["classes"];
1218 
1219  // preview
1220  if ($a_type == "table") {
1221  $p_content = '<PageContent><Table DataTable="y"';
1222  $t["row_head"] = $t["row_head"] ?? "";
1223  $t["row_foot"] = $t["row_foot"] ?? "";
1224  $t["col_head"] = $t["col_head"] ?? "";
1225  $t["col_foot"] = $t["col_foot"] ?? "";
1226  if ($t["row_head"] != "") {
1227  $p_content .= ' HeaderRows="1"';
1228  }
1229  if ($t["row_foot"] != "") {
1230  $p_content .= ' FooterRows="1"';
1231  }
1232  if ($t["col_head"] != "") {
1233  $p_content .= ' HeaderCols="1"';
1234  }
1235  if ($t["col_foot"] != "") {
1236  $p_content .= ' FooterCols="1"';
1237  }
1238  $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
1239  if (!$a_small_mode) {
1240  $p_content .= '<Caption>' . $lng->txt("sty_caption") . '</Caption>';
1241  }
1242  for ($i = 1; $i <= $kr; $i++) {
1243  $p_content .= '<TableRow>';
1244  for ($j = 1; $j <= $kc; $j++) {
1245  if ($a_small_mode) {
1246  $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
1247  } else {
1248  $cell = 'xxx';
1249  }
1250  $p_content .= '<TableData><PageContent><Paragraph Characteristic="TableContent">' . $cell . '</Paragraph></PageContent></TableData>';
1251  }
1252  $p_content .= '</TableRow>';
1253  }
1254  $p_content .= '</Table></PageContent>';
1255  }
1256 
1257  if ($a_type == "vaccordion" || $a_type == "haccordion" || $a_type == "carousel") {
1259 
1260  if ($a_small_mode) {
1261  $c = '&amp;nbsp;';
1262  $h = '&amp;nbsp;';
1263  } else {
1264  $c = 'xxx';
1265  $h = 'head';
1266  }
1267  if ($a_type == "vaccordion") {
1268  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
1269  if ($a_small_mode) {
1270  $p_content .= ' ContentWidth="70"';
1271  }
1272  } elseif ($a_type == "haccordion") {
1273  $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
1274  $p_content .= ' ContentHeight="40"';
1275  if ($a_small_mode) {
1276  $p_content .= ' ContentWidth="70"';
1277  $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
1278  }
1279  } elseif ($a_type == "carousel") {
1280  $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="Carousel" ';
1281  if ($a_small_mode) {
1282  $p_content .= ' ContentWidth="70"';
1283  }
1284  }
1285 
1286 
1287  $p_content .= ' Template="' . $a_style->lookupTemplateName($a_t_id) . '">';
1288  $p_content .= '<Tab><PageContent><Paragraph>' . $c . '</Paragraph></PageContent>';
1289  $p_content .= '<TabCaption>' . $h . '</TabCaption>';
1290  $p_content .= '</Tab>';
1291  $p_content .= '</Tabs></PageContent>';
1292  }
1293  //echo htmlentities($p_content);
1294  $txml = $a_style->getTemplateXML();
1295  //echo htmlentities($txml); exit;
1296  $p_content .= $txml;
1297  $r_content = ilPCTableGUI::_renderTable($p_content, "");
1298 
1299  // fix carousel template visibility
1300  if ($a_type == "carousel") {
1301  $r_content .= "<style>.owl-carousel{ display:block !important; }</style>";
1302  }
1303 
1304  //echo htmlentities($r_content); exit;
1305  return $r_content;
1306  }
static _renderTable(string $content, string $a_mode="table_edit", string $a_submode="", ilPCTable $a_table_obj=null, bool $unmask=true, ilPageObject $page_object=null)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
lookupTemplateName(int $a_t_id)
Lookup table template name for template ID.
global $DIC
Definition: feed.php:28
ilLanguage $lng
static addCss()
Add required css.
getTemplateXML()
Get table template xml.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdminLocatorItems()

ilObjStyleSheetGUI::addAdminLocatorItems ( bool  $do_not_add_object = false)
protected

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

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

654  : void
655  {
656  $ilLocator = $this->gui_service->locator();
657 
658  if ($this->style_request->getAdminMode() == "settings") { // system settings
659  parent::addAdminLocatorItems(true);
660 
661  $ilLocator->addItem(
662  $this->lng->txt("obj_stys"),
663  $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "")
664  );
665 
666  $ilLocator->addItem(
667  $this->lng->txt("content_styles"),
668  $this->ctrl->getLinkTargetByClass("ilcontentstylesettingsgui", "")
669  );
670 
671  if ($this->style_request->getObjId() > 0) {
672  $ilLocator->addItem(
673  $this->object->getTitle(),
674  $this->ctrl->getLinkTarget($this, "edit")
675  );
676  }
677  }
678  }
+ Here is the call graph for this function:

◆ addColorObject()

ilObjStyleSheetGUI::addColorObject ( )

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

References ilObjectGUI\$tpl, initColorForm(), and ilGlobalTemplateInterface\setContent().

747  : void
748  {
749  $tpl = $this->gui_service->ui()->mainTemplate();
750 
751  $this->initColorForm();
752  $tpl->setContent($this->form_gui->getHTML());
753  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initColorForm(string $a_mode="create")
+ Here is the call graph for this function:

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

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

References ilObjectGUI\$tpl, initMediaQueryForm(), and ilGlobalTemplateInterface\setContent().

956  : void
957  {
958  $tpl = $this->gui_service->ui()->mainTemplate();
959 
960  $this->initMediaQueryForm();
961  $tpl->setContent($this->form_gui->getHTML());
962  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initMediaQueryForm(string $a_mode="create")
Init media query form.
+ Here is the call graph for this function:

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

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

References ilObjectGUI\$tpl, initTemplateForm(), and ilGlobalTemplateInterface\setContent().

1160  : void
1161  {
1162  $tpl = $this->gui_service->ui()->mainTemplate();
1163 
1164  $this->initTemplateForm();
1165  $tpl->setContent($this->form_gui->getHTML());
1166  }
initTemplateForm(string $a_mode="create")
Init table template form.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ cancelColorDeletionObject()

ilObjStyleSheetGUI::cancelColorDeletionObject ( )

Cancel color deletion.

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

912  : void
913  {
914  $ilCtrl = $this->ctrl;
915  $ilCtrl->redirect($this, "listColors");
916  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

817  : void
818  {
819  $ilCtrl = $this->ctrl;
820 
821  $ilCtrl->redirect($this, "listColors");
822  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

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

394  : void
395  {
396  $this->gui_service->ctrl()->returnToParent($this);
397  }

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

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

References ilObjectGUI\$lng, ILIAS\Repository\ctrl(), and ilLanguage\txt().

547  : void
548  {
549  $lng = $this->lng;
550 
551  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_cancel"), true);
552  $this->ctrl->returnToParent($this);
553  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
+ Here is the call graph for this function:

◆ cancelTemplateDeletionObject()

ilObjStyleSheetGUI::cancelTemplateDeletionObject ( )

Cancel table template deletion.

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

1541  : void
1542  {
1543  $ilCtrl = $this->ctrl;
1544 
1545  $ilCtrl->redirect($this, "listTemplates");
1546  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

1362  : void
1363  {
1364  $ilCtrl = $this->ctrl;
1365  $ilCtrl->redirect($this, "listTemplates");
1366  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

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

402  : void
403  {
404  $this->object->delete();
405  $this->gui_service->ctrl()->returnToParent($this);
406  }

◆ copyStyleObject()

ilObjStyleSheetGUI::copyStyleObject ( )

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

References ilObjectGUI\$ctrl, ilObjStyleSheet\_writeStandard(), ilPropertyFormGUI\checkInput(), getCloneForm(), ilPropertyFormGUI\getInput(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), and ilCtrl\returnToParent().

464  : int
465  {
466  $ctrl = $this->gui_service->ctrl();
467 
468  $form = $this->getCloneForm();
469  $form->checkInput();
470  $new_id = 0;
471 
472  if ($form->getInput("source_style") > 0) {
473  $style_obj = ilObjectFactory::getInstanceByObjId((int) $form->getInput("source_style"));
474  $new_id = $style_obj->ilClone();
475  }
476 
477  // assign style to style sheet folder,
478  // if parent is style sheet folder
479  if ($this->requested_ref_id > 0) {
480  $fold = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
481  if ($fold->getType() == "stys") {
482  $cont_style_settings = new ilContentStyleSettings();
483  $cont_style_settings->addStyle($new_id);
484  $cont_style_settings->update();
485  ilObjStyleSheet::_writeStandard($new_id, true);
486  $ctrl->returnToParent($this);
487  }
488  }
489  $this->object = new ilObjStyleSheet($new_id);
490 
491  return $new_id;
492  }
returnToParent(object $a_gui_obj, string $a_anchor=null)
static _writeStandard(int $a_id, bool $a_std)
Write standard flag.
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

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

References $help, ilObjectGUI\$tpl, getCloneForm(), getCreateForm(), ilObjectGUI\getCreationFormsHTML(), getImportForm(), ilHelpGUI\ID_PART_SCREEN, and ilGlobalTemplateInterface\setContent().

177  : void
178  {
179  $tpl = $this->gui_service->ui()->mainTemplate();
180 
181  $ilHelp = $this->help;
182 
183  $forms = array();
184 
185 
186  $ilHelp->setScreenIdComponent("sty");
187  $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
188 
189  $forms[] = $this->getCreateForm();
190  $forms[] = $this->getImportForm();
191  $forms[] = $this->getCloneForm();
192 
193  $tpl->setContent($this->getCreationFormsHTML($forms));
194  }
getCreationFormsHTML(array $forms)
Get HTML for creation forms (accordion)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
const ID_PART_SCREEN
+ Here is the call graph for this function:

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

References Vendor\Package\$c, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilLegacyFormElementsUtil\prepareFormOutput(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

884  : void
885  {
886  $ilCtrl = $this->ctrl;
887  $tpl = $this->gui_service->ui()->mainTemplate();
888  $lng = $this->lng;
889 
890  $colors = $this->style_request->getColors();
891  if (count($colors) == 0) {
892  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
893  $ilCtrl->redirect($this, "listColors");
894  } else {
895  $cgui = new ilConfirmationGUI();
896  $cgui->setFormAction($ilCtrl->getFormAction($this));
897  $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
898  $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
899  $cgui->setConfirm($lng->txt("delete"), "deleteColor");
900 
901  foreach ($colors as $c) {
902  $cgui->addItem("color[]", ilLegacyFormElementsUtil::prepareFormOutput($c), $c);
903  }
904 
905  $tpl->setContent($cgui->getHTML());
906  }
907  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static prepareFormOutput($a_str, bool $a_strip=false)
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ deleteColorObject()

ilObjStyleSheetGUI::deleteColorObject ( )

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

References Vendor\Package\$c, ilObjectGUI\$ctrl, and ilCtrl\redirect().

918  : void
919  {
920  $ilCtrl = $this->ctrl;
921 
922  $colors = $this->style_request->getColors();
923  foreach ($colors as $c) {
924  $this->object->removeColor($c);
925  }
926 
927  $ilCtrl->redirect($this, "listColors");
928  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$id, and ilCtrl\redirect().

1085  : void
1086  {
1087  $ilCtrl = $this->ctrl;
1088 
1089  $mq_ids = $this->style_request->getMediaQueryIds();
1090  if ($this->access_manager->checkWrite()) {
1091  foreach ($mq_ids as $id) {
1092  $this->object->deleteMediaQuery($id);
1093  }
1094  }
1095  $ilCtrl->redirect($this, "listMediaQueries");
1096  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

1059  : void
1060  {
1061  $ilCtrl = $this->ctrl;
1062  $tpl = $this->gui_service->ui()->mainTemplate();
1063  $lng = $this->lng;
1064 
1065  $mq_ids = $this->style_request->getMediaQueryIds();
1066  if (count($mq_ids) == 0) {
1067  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
1068  $ilCtrl->redirect($this, "listMediaQueries");
1069  } else {
1070  $cgui = new ilConfirmationGUI();
1071  $cgui->setFormAction($ilCtrl->getFormAction($this));
1072  $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
1073  $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
1074  $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
1075 
1076  foreach ($mq_ids as $i) {
1077  $mq = $this->object->getMediaQueryForId($i);
1078  $cgui->addItem("mq_id[]", (string) $i, $mq["mquery"]);
1079  }
1080 
1081  $tpl->setContent($cgui->getHTML());
1082  }
1083  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, ilObject\_lookupTitle(), ilCtrl\getFormAction(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilGlobalTemplateInterface\setContent().

375  : void
376  {
377  $tpl = $this->gui_service->ui()->mainTemplate();
378  $ctrl = $this->gui_service->ctrl();
379 
380  // display confirmation message
381  $cgui = new ilConfirmationGUI();
382  $cgui->setFormAction($ctrl->getFormAction($this));
383  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
384  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
385  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
386 
387  $caption = ilObject::_lookupTitle($this->object->getId());
388 
389  $cgui->addItem("id[]", "", $caption);
390 
391  $tpl->setContent($cgui->getHTML());
392  }
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ILIAS\Repository\object(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

1497  : void
1498  {
1499  $ilCtrl = $this->ctrl;
1500  $tpl = $this->gui_service->ui()->mainTemplate();
1501  $lng = $this->lng;
1502 
1503  $tids = $this->style_request->getTemplateIds();
1504  if (count($tids) == 0) {
1505  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
1506  $ilCtrl->redirect($this, "listTemplates");
1507  } else {
1508  $cgui = new ilConfirmationGUI();
1509  $cgui->setFormAction($ilCtrl->getFormAction($this));
1510  $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
1511  $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
1512  $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
1513 
1514  foreach ($tids as $tid) {
1515  $classes = $this->object->getTemplateClasses($tid);
1516  $cl_str = "";
1517  $listed = array();
1518  foreach ($classes as $cl) {
1519  if ($cl != "" && !($listed[$cl] ?? false)) {
1520  $cl_str .= '<div>- ' .
1521  $cl . "</div>";
1522  $listed[$cl] = true;
1523  }
1524  }
1525  if ($cl_str != "") {
1526  $cl_str = '<div style="padding-left:30px;" class="small">' .
1527  "<div><i>" . $lng->txt("sty_style_class") . "</i></div>" . $cl_str . "</div>";
1528  }
1529  $cgui->addItem("tid[]", (string) $tid, $this->object->lookupTemplateName($tid) . $cl_str);
1530  }
1531 
1532  $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
1533 
1534  $tpl->setContent($cgui->getHTML());
1535  }
1536  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ deleteTemplateKeepClassesObject()

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

1548  : void
1549  {
1550  $ilCtrl = $this->ctrl;
1551 
1552  $tids = $this->style_request->getTemplateIds();
1553  foreach ($tids as $tid) {
1554  $this->object->removeTemplate($tid);
1555  }
1556 
1557  $ilCtrl->redirect($this, "listTemplates");
1558  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete template.

Exceptions
Content

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

1566  : void
1567  {
1568  $ilCtrl = $this->ctrl;
1569 
1570  $tids = $this->style_request->getTemplateIds();
1571  foreach ($tids as $tid) {
1572  $cls = $this->object->getTemplateClasses($tid);
1573  foreach ($cls as $k => $cls2) {
1574  $ty = $this->object->determineTemplateStyleClassType(
1575  $this->style_request->getTempType(),
1576  $k
1577  );
1578  $this->characteristic_manager->deleteCharacteristic($ty, $cls2);
1579  }
1580  $this->object->removeTemplate($tid);
1581  }
1582 
1583  $ilCtrl->redirect($this, "listTemplates");
1584  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ displayTemplateEditForm()

ilObjStyleSheetGUI::displayTemplateEditForm ( )

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

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

Referenced by editTemplateObject(), and updateTemplateObject().

1447  : void
1448  {
1449  $tpl = $this->gui_service->ui()->mainTemplate();
1450 
1451  $a_tpl = new ilTemplate(
1452  "tpl.template_edit.html",
1453  true,
1454  true,
1455  "Services/Style/Content"
1456  );
1457  $this->includeCSS();
1458  $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
1459  $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview(
1460  $this->style_request->getTempType(),
1461  $this->style_request->getTemplateId()
1462  ));
1463  $tpl->setContent($a_tpl->get());
1464  }
getTemplatePreview(string $a_type, int $a_t_id, bool $a_small_mode=false)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editColorObject()

ilObjStyleSheetGUI::editColorObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, getColorFormValues(), initColorForm(), ilGlobalTemplateInterface\setContent(), and ilCtrl\setParameter().

755  : void
756  {
757  $tpl = $this->gui_service->ui()->mainTemplate();
758  $ilCtrl = $this->ctrl;
759 
760  $ilCtrl->setParameter($this, "c_name", $this->style_request->getColorName());
761  $this->initColorForm("edit");
762  $this->getColorFormValues();
763  $tpl->setContent($this->form_gui->getHTML());
764  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
getColorFormValues()
Set values for color editing.
initColorForm(string $a_mode="create")
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ editMediaQueryObject()

ilObjStyleSheetGUI::editMediaQueryObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, getMediaQueryFormValues(), initMediaQueryForm(), ilGlobalTemplateInterface\setContent(), and ilCtrl\setParameter().

964  : void
965  {
966  $tpl = $this->gui_service->ui()->mainTemplate();
967  $ilCtrl = $this->ctrl;
968 
969  $ilCtrl->setParameter($this, "mq_id", $this->style_request->getMediaQueryId());
970  $this->initMediaQueryForm("edit");
971  $this->getMediaQueryFormValues();
972  $tpl->setContent($this->form_gui->getHTML());
973  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
getMediaQueryFormValues()
Set values for media query editing.
initMediaQueryForm(string $a_mode="create")
Init media query form.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

Edit -> List characteristics.

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

References ilObjectGUI\$ctrl, and ilCtrl\redirectByClass().

Referenced by viewObject().

266  : void
267  {
268  $ctrl = $this->gui_service->ctrl();
269  $ctrl->redirectByClass("ilStyleCharacteristicGUI", "listCharacteristics");
270  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editTemplateObject()

ilObjStyleSheetGUI::editTemplateObject ( )

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

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

1168  : void
1169  {
1170  $ilCtrl = $this->ctrl;
1171 
1172  $ilCtrl->setParameter(
1173  $this,
1174  "t_id",
1175  $this->style_request->getTemplateId()
1176  );
1177  $this->initTemplateForm("edit");
1178  $this->getTemplateFormValues();
1179 
1180  $this->displayTemplateEditForm();
1181  }
initTemplateForm(string $a_mode="create")
Init table template form.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
getTemplateFormValues()
Set values for table template editing.
+ Here is the call graph for this function:

◆ enableWrite()

ilObjStyleSheetGUI::enableWrite ( bool  $a_write)

Enable writing.

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

106  : void
107  {
108  $this->access_manager->enableWrite($a_write);
109  }

◆ executeCommand()

ilObjStyleSheetGUI::executeCommand ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$object, ilCtrl\forwardCommand(), ilCtrl\getCmd(), ilCtrl\getNextClass(), includeCSS(), ilObjectGUI\prepareOutput(), and ilObjectGUI\setCreationMode().

111  : void
112  {
113  $tabs = $this->gui_service->tabs();
114  $ctrl = $this->gui_service->ctrl();
115 
116  $next_class = $ctrl->getNextClass($this);
117  $cmd = $ctrl->getCmd("edit");
118 
119  // #9440/#9489: prepareOutput will fail if not set properly
120  if (!$this->object || $cmd == "create") {
121  $this->setCreationMode();
122  }
123 
124  switch ($next_class) {
125  case "ilexportgui":
126  $this->prepareOutput();
127  $exp_gui = new ilExportGUI($this);
128  $exp_gui->addFormat("xml");
129  $ctrl->forwardCommand($exp_gui);
130  break;
131 
132  case "ilstylecharacteristicgui":
133  $this->prepareOutput();
134  $this->includeCSS();
135  $tabs->activateTab("sty_style_chars");
136  $gui = $this->gui_service->characteristic()->ilStyleCharacteristicGUI(
137  $this->getStyleSheet(),
138  $this->super_type,
139  $this->access_manager,
140  $this->characteristic_manager,
141  $this->image_manager
142  );
143  $ctrl->forwardCommand($gui);
144  break;
145 
146  case "ilcontentstyleimagegui":
147  $this->prepareOutput();
148  $this->includeCSS();
149  $tabs->activateTab("sty_images");
150  $gui = $this->gui_service->image()->ilContentStyleImageGUI(
151  $this->access_manager,
152  $this->image_manager
153  );
154  $ctrl->forwardCommand($gui);
155  break;
156 
157  default:
158  $this->prepareOutput();
159  $cmd .= "Object";
160  $this->$cmd();
161  break;
162  }
163  }
getCmd(string $fallback_command=null)
prepareOutput(bool $show_sub_objects=true)
forwardCommand(object $a_gui_object)
setCreationMode(bool $mode=true)
If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode...
Export User Interface Class.
getNextClass($a_gui_class=null)
+ Here is the call graph for this function:

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

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

References $r, ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\object().

364  : void
365  {
366  $exp = new ilExport();
367  $r = $exp->exportObject($this->object->getType(), $this->object->getId());
368 
369  ilFileDelivery::deliverFileLegacy($r["directory"] . "/" . $r["file"], $r["file"], '', false, true);
370  }
Export.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
$r
+ Here is the call graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

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

References ilObjectGUI\$tpl, initTemplateGenerationForm(), and ilGlobalTemplateInterface\setContent().

1586  : void
1587  {
1588  $tpl = $this->gui_service->ui()->mainTemplate();
1589 
1590  $this->initTemplateGenerationForm();
1591  $tpl->setContent($this->form_gui->getHTML());
1592  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initTemplateGenerationForm()
Init table template generation form.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjStyleSheetGUI::getAdminTabs ( )

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

References getTabs().

555  : void
556  {
557  $this->getTabs();
558  }
+ Here is the call graph for this function:

◆ getCloneForm()

ilObjStyleSheetGUI::getCloneForm ( )
protected

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

References ilObjectGUI\$ctrl, $form, ilObjStyleSheet\_getClonableContentStyles(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilCtrl\getFormAction(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setRequired(), and ilPropertyFormGUI\setTitle().

Referenced by copyStyleObject(), and createObject().

239  {
240  $ctrl = $this->ctrl;
241  $form = new ilPropertyFormGUI();
243  $form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
244 
245  // source
246  $ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
247  $ti->setRequired(true);
249  $form->addItem($ti);
250 
251  $form->addCommandButton("copyStyle", $this->lng->txt("copy"));
252  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
253  return $form;
254  }
This class represents a selection list property in a property form.
static _getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
setFormAction(string $a_formaction)
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColorFormValues()

ilObjStyleSheetGUI::getColorFormValues ( )

Set values for color editing.

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

Referenced by editColorObject().

804  : void
805  {
806  $c_name = $this->style_request->getColorName();
807  if ($c_name != "") {
808  $values["color_name"] = $c_name;
809  $values["color_code"] = $this->object->getColorCodeForName($c_name);
810  $this->form_gui->setValuesByArray($values);
811  }
812  }
+ Here is the caller graph for this function:

◆ getCreateForm()

ilObjStyleSheetGUI::getCreateForm ( )
protected

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

References ilObjectGUI\$ctrl, $form, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilCtrl\getFormAction(), ILIAS\Repository\lng(), ilTextAreaInputGUI\setCols(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

Referenced by createObject(), and saveObject().

197  {
198  $ctrl = $this->ctrl;
199  $form = new ilPropertyFormGUI();
201  $form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
202 
203  // title
204  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
205  $ti->setMaxLength(128);
206  $ti->setSize(40);
207  $ti->setRequired(true);
208  $form->addItem($ti);
209 
210  // description
211  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
212  $ta->setCols(40);
213  $ta->setRows(2);
214  $form->addItem($ta);
215 
216  $form->addCommandButton("save", $this->lng->txt("save"));
217  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
218  return $form;
219  }
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a text area property in a property form.
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImportForm()

ilObjStyleSheetGUI::getImportForm ( )
protected

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

References ilObjectGUI\$ctrl, $form, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilCtrl\getFormAction(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setRequired(), and ilPropertyFormGUI\setTitle().

Referenced by createObject().

222  {
223  $ctrl = $this->ctrl;
224  $form = new ilPropertyFormGUI();
226  $form->setTitle($this->lng->txt("sty_import_stylesheet"));
227 
228  // title
229  $ti = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
230  $ti->setRequired(true);
231  $form->addItem($ti);
232 
233  $form->addCommandButton("importStyle", $this->lng->txt("import"));
234  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
235  return $form;
236  }
This class represents a file property in a property form.
setFormAction(string $a_formaction)
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMediaQueryFormValues()

ilObjStyleSheetGUI::getMediaQueryFormValues ( )

Set values for media query editing.

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

References ILIAS\Repository\object().

Referenced by editMediaQueryObject().

1008  : void
1009  {
1010  $values = [];
1011  if ($this->style_request->getMediaQueryId() > 0) {
1012  foreach ($this->object->getMediaQueries() as $mq) {
1013  if ($mq["id"] == $this->style_request->getMediaQueryId()) {
1014  $values["mquery"] = $mq["mquery"];
1015  }
1016  }
1017  $this->form_gui->setValuesByArray($values);
1018  }
1019  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

References ILIAS\Repository\form(), ILIAS\Repository\int(), and ILIAS\Repository\object().

Referenced by propertiesObject().

285  : void
286  {
287  $values = array();
288 
289  $values["style_title"] = $this->object->getTitle();
290  $values["style_description"] = $this->object->getDescription();
291  $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
292 
293  $this->form->setValuesByArray($values);
294  }
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStyleExampleHTML()

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

Get style example HTML.

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

References Vendor\Package\$c, $DIC, ilObjectGUI\$lng, and ilLanguage\txt().

Referenced by ILIAS\Style\Content\CharacteristicTableGUI\fillRow(), and ilStyleCharacteristicGUI\outputTagStyleEditScreen().

686  : string {
687  global $DIC;
688 
689  $lng = $DIC->language();
690 
691  $c = explode(":", $a_class);
692  $a_class = $c[0];
693 
694  $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
695 
696  if ($ex_tpl->blockExists("Example_" . $a_type)) {
697  $ex_tpl->setCurrentBlock("Example_" . $a_type);
698  } else {
699  $ex_tpl->setCurrentBlock("Example_default");
700  }
701  $ex_tpl->setVariable("EX_CLASS", "ilc_" . $a_type . "_" . $a_class);
702  $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
703  if (in_array($a_type, array("media_cont", "qimg"))) {
704  //
705  }
706  if (in_array($a_type, array("table", "table_caption"))) {
707  $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
708  }
709  if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal"))) {
710  $ex_tpl->setVariable("HOR", "Horizontal");
711  }
712  $ex_tpl->parseCurrentBlock();
713 
714  return $ex_tpl->get();
715  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjStyleSheetGUI::getTabs ( )
protected

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

References $help, ilObjectGUI\$lng, ILIAS\Repository\ctrl(), ilHelpGUI\setScreenIdComponent(), and ilLanguage\txt().

Referenced by getAdminTabs().

560  : void
561  {
562  $lng = $this->lng;
563  $ilHelp = $this->help;
564  $tabs = $this->gui_service->tabs();
565  $ilHelp->setScreenIdComponent("sty");
566  // back to upper context
567  $tabs->setBackTarget(
568  $lng->txt("back"),
569  $this->ctrl->getLinkTarget($this, "returnToUpperContext")
570  );
571 
572  // style classes
573  $tabs->addTarget(
574  "sty_style_chars",
575  $this->ctrl->getLinkTarget($this, "edit"),
576  array("edit", ""),
577  get_class($this)
578  );
579 
580  // colors
581  $tabs->addTarget(
582  "sty_colors",
583  $this->ctrl->getLinkTarget($this, "listColors"),
584  "listColors",
585  get_class($this)
586  );
587 
588  // images
589  $tabs->addTarget(
590  "sty_images",
591  $this->ctrl->getLinkTargetByClass("ilContentStyleImageGUI", ""),
592  "",
593  "ilContentStyleImageGUI"
594  );
595 
596  // media queries
597  $tabs->addTarget(
598  "sty_media_queries",
599  $this->ctrl->getLinkTarget($this, "listMediaQueries"),
600  "listMediaQueries",
601  get_class($this)
602  );
603 
604 
605  // table templates
606  $tabs->addTarget(
607  "sty_templates",
608  $this->ctrl->getLinkTarget($this, "listTemplates"),
609  "listTemplates",
610  get_class($this)
611  );
612 
613  // settings
614  $tabs->addTarget(
615  "settings",
616  $this->ctrl->getLinkTarget($this, "properties"),
617  "properties",
618  get_class($this)
619  );
620 
621  // export
622  $tabs->addTarget(
623  "export",
624  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
625  "",
626  "ilexportgui"
627  );
628  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
setScreenIdComponent(string $a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

References ilObjectGUI\$type, and ilObjStyleSheet\_getTemplateClassTypes().

Referenced by editTemplateObject().

1477  : void
1478  {
1479  $t_id = $this->style_request->getTemplateId();
1480  if ($t_id > 0) {
1481  $t = $this->object->getTemplate($t_id);
1482 
1483  $values["name"] = $t["name"];
1485  $this->style_request->getTempType()
1486  );
1487  foreach ($scs as $k => $type) {
1488  $values[$k . "_class"] = $t["classes"][$k] ?? "";
1489  }
1490  $this->form_gui->setValuesByArray($values);
1491  }
1492  }
static _getTemplateClassTypes(string $a_template_type="")
Get template class types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplatePreview()

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

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

References _getTemplatePreview().

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

1187  : string {
1188  return $this->_getTemplatePreview(
1189  $this->getStyleSheet(),
1190  $a_type,
1191  $a_t_id,
1192  $a_small_mode
1193  );
1194  }
static _getTemplatePreview(ilObjStyleSheet $a_style, string $a_type, int $a_t_id, bool $a_small_mode=false)
Get table template preview.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importStyleObject()

ilObjStyleSheetGUI::importStyleObject ( )

Import style sheet.

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

References ilObjStyleSheet\_writeStandard(), ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), and ilObjectFactory\getInstanceByRefId().

497  : int
498  {
499  $newObj = null;
500  // check file
501  $source = $_FILES["importfile"]["tmp_name"];
502  if (($source == 'none') || (!$source)) {
503  $this->ilias->raiseError("No file selected!", $this->ilias->error_obj->MESSAGE);
504  }
505 
506  // check correct file type
507  $info = pathinfo($_FILES["importfile"]["name"]);
508  if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml") {
509  $this->ilias->raiseError("File must be a zip or xml file!", $this->ilias->error_obj->MESSAGE);
510  }
511 
512  // new import
513  $fname = explode("_", $_FILES["importfile"]["name"]);
514  if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty") {
515  $imp = new ilImport();
516  $new_id = $imp->importObject(
517  null,
518  $_FILES["importfile"]["tmp_name"],
519  $_FILES["importfile"]["name"],
520  "sty"
521  );
522  if ($new_id > 0) {
523  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
524  }
525  } else { // old import
526  $newObj = new ilObjStyleSheet();
527  $newObj->import($_FILES["importfile"]);
528  }
529 
530  // assign style to style sheet folder,
531  // if parent is style sheet folder
532  if ($this->requested_ref_id > 0) {
533  $fold = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
534  if ($fold->getType() == "stys") {
535  $cont_style_settings = new ilContentStyleSettings();
536  $cont_style_settings->addStyle($newObj->getId());
537  $cont_style_settings->update();
538  ilObjStyleSheet::_writeStandard($newObj->getId(), true);
539  $this->ctrl->returnToParent($this);
540  }
541  }
542  $this->object = $newObj;
543  return $newObj->getId();
544  }
Import class.
static _writeStandard(int $a_id, bool $a_std)
Write standard flag.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
header include for all ilias files.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

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

References ilObjectGUI\$tpl, ilGlobalTemplateInterface\addCss(), ilObjStyleSheet\getContentStylePath(), and ILIAS\Repository\object().

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

256  : void
257  {
258  $tpl = $this->gui_service->ui()->mainTemplate();
260  }
ilGlobalTemplateInterface $tpl
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initColorForm()

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

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

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

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

769  : void {
770  $lng = $this->lng;
771  $ilCtrl = $this->ctrl;
772 
773  $this->form_gui = new ilPropertyFormGUI();
774 
775  $this->form_gui->setTitle($lng->txt("sty_add_color"));
776 
777  // name
778  $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
779  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
780  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
781  $name_input->setRequired(true);
782  $name_input->setSize(15);
783  $name_input->setMaxLength(15);
784  $this->form_gui->addItem($name_input);
785 
786  // code
787  $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
788  $color_input->setRequired(true);
789  $color_input->setDefaultColor("");
790  $this->form_gui->addItem($color_input);
791 
792  if ($a_mode == "create") {
793  $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
794  } else {
795  $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
796  }
797  $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
798  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
799  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setPattern(string $pattern)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMediaQueryForm()

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

Init media query form.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, and ilLanguage\txt().

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

981  : void {
982  $lng = $this->lng;
983  $ilCtrl = $this->ctrl;
984 
985  $this->form_gui = new ilPropertyFormGUI();
986 
987  $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
988 
989  // media query
990  $ti = new ilTextInputGUI("@media", "mquery");
991  $ti->setMaxLength(2000);
992  $ti->setInfo($lng->txt("sty_add_media_query_info"));
993  $this->form_gui->addItem($ti);
994 
995 
996  if ($a_mode == "create") {
997  $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
998  } else {
999  $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
1000  }
1001  $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
1002  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1003  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPropertiesForm()

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

FORM: Init properties form.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ILIAS\Repository\form(), ilCtrl\getFormAction(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by propertiesObject(), and updateObject().

301  : void {
302  $ctrl = $this->gui_service->ctrl();
303  $lng = $this->lng;
304 
305  $this->form = new ilPropertyFormGUI();
306 
307  // title
308  $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
309  $ti->setMaxLength(128);
310  $ti->setSize(40);
311  $ti->setRequired(true);
312  $this->form->addItem($ti);
313 
314  // description
315  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
316  //$ta->setCols();
317  //$ta->setRows();
318  $this->form->addItem($ta);
319 
320  // disable automatic margins for left/right alignment
321  $cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
322  $cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
323  $this->form->addItem($cb);
324 
325  // save and cancel commands
326 
327  if ($a_mode == "create") {
328  $this->form->addCommandButton("save", $lng->txt("save"));
329  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
330  } else {
331  if ($this->access_manager->checkWrite()) {
332  $this->form->addCommandButton("update", $lng->txt("save"));
333  }
334  }
335 
336  $this->form->setTitle($lng->txt("edit_stylesheet"));
337  $this->form->setFormAction($ctrl->getFormAction($this));
338  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
form( $class_path, string $cmd, string $submit_caption="")
This class represents a text area property in a property form.
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplateForm()

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

Init table template form.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjStyleSheet\_getTemplateClassTypes(), ilRegExpInputGUI\setPattern(), and ilLanguage\txt().

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

1311  : void
1312  {
1313  $lng = $this->lng;
1314  $ilCtrl = $this->ctrl;
1315 
1316  $this->form_gui = new ilPropertyFormGUI();
1317 
1318  if ($a_mode == "create") {
1319  $this->form_gui->setTitle($lng->txt("sty_add_template"));
1320  } else {
1321  $this->form_gui->setTitle($lng->txt("sty_edit_template"));
1322  }
1323 
1324  // name
1325  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
1326  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1327  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
1328  $name_input->setRequired(true);
1329  $name_input->setSize(30);
1330  $name_input->setMaxLength(30);
1331  $this->form_gui->addItem($name_input);
1332 
1333  // template style classes
1335  $this->style_request->getTempType()
1336  );
1337 
1338  foreach ($scs as $sc => $st) {
1339  $sc_input = new ilSelectInputGUI($lng->txt("sty_" . $sc . "_class"), $sc . "_class");
1340  $chars = $this->object->getCharacteristics($st);
1341  $options = array("" => "");
1342  foreach ($chars as $char) {
1343  $options[$char] = $char;
1344  }
1345  $sc_input->setOptions($options);
1346  $this->form_gui->addItem($sc_input);
1347  }
1348 
1349  if ($a_mode == "create") {
1350  $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
1351  } else {
1352  $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
1353  $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
1354  }
1355  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
1356  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1357  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setPattern(string $pattern)
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getTemplateClassTypes(string $a_template_type="")
Get template class types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplateGenerationForm()

ilObjStyleSheetGUI::initTemplateGenerationForm ( )

Init table template generation form.

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

References Vendor\Package\$c, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilNumericStyleValueInputGUI\setAllowPercentage(), ilSelectInputGUI\setOptions(), ilRegExpInputGUI\setPattern(), and ilLanguage\txt().

Referenced by generateTemplateObject(), and templateGenerationObject().

1597  : void
1598  {
1599  $lng = $this->lng;
1600  $ilCtrl = $this->ctrl;
1601 
1602  $this->form_gui = new ilPropertyFormGUI();
1603 
1604  $this->form_gui->setTitle($lng->txt("sty_generate_template"));
1605 
1606  // name
1607  $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
1608  $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1609  $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
1610  $name_input->setRequired(true);
1611  $name_input->setSize(30);
1612  $name_input->setMaxLength(30);
1613  $this->form_gui->addItem($name_input);
1614 
1615  // basic layout
1616  $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
1617  $options = array(
1618  "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
1619  "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
1620  "noZebra" => $lng->txt("sty_table_template_no_zebra")
1621  );
1622  $bl_input->setOptions($options);
1623  $this->form_gui->addItem($bl_input);
1624 
1625  // top bottom padding
1626  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
1627  $num_input->setAllowPercentage(false);
1628  $num_input->setValue("3px");
1629  $this->form_gui->addItem($num_input);
1630 
1631  // left right padding
1632  $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
1633  $num_input->setAllowPercentage(false);
1634  $num_input->setValue("10px");
1635  $this->form_gui->addItem($num_input);
1636 
1637  // base color
1638  $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
1639  $cs = $this->object->getColors();
1640  $options = array();
1641  foreach ($cs as $c) {
1642  $options[$c["name"]] = $c["name"];
1643  }
1644  $bc_input->setOptions($options);
1645  $this->form_gui->addItem($bc_input);
1646 
1647  // Lightness Settings
1648  $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
1649  "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
1650  foreach ($lss as $ls => $v) {
1651  $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_" . $ls), "lightness_" . $ls);
1652  $l_input->setMaxValue(100);
1653  $l_input->setMinValue(-100);
1654  $l_input->setValue((string) $v);
1655  $l_input->setSize(4);
1656  $l_input->setMaxLength(4);
1657  $this->form_gui->addItem($l_input);
1658  }
1659 
1660  $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
1661  $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
1662  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1663  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setPattern(string $pattern)
setOptions(array $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listColorsObject()

ilObjStyleSheetGUI::listColorsObject ( )

List colors of style.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

725  : void
726  {
727  $tpl = $this->gui_service->ui()->mainTemplate();
728  $ilToolbar = $this->gui_service->toolbar();
729  $ilCtrl = $this->ctrl;
730 
731  if ($this->access_manager->checkWrite()) {
732  $ilToolbar->addButton(
733  $this->lng->txt("sty_add_color"),
734  $ilCtrl->getLinkTarget($this, "addColor")
735  );
736  }
737 
738  $table_gui = new ilStyleColorTableGUI(
739  $this,
740  "listColors",
741  $this->getStyleSheet(),
742  $this->access_manager
743  );
744  $tpl->setContent($table_gui->getHTML());
745  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
TableGUI class for style editor (image list)
+ Here is the call graph for this function:

◆ listMediaQueriesObject()

ilObjStyleSheetGUI::listMediaQueriesObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

934  : void
935  {
936  $tpl = $this->gui_service->ui()->mainTemplate();
937  $ilToolbar = $this->gui_service->toolbar();
938  $ilCtrl = $this->ctrl;
939 
940  if ($this->access_manager->checkWrite()) {
941  $ilToolbar->addButton(
942  $this->lng->txt("sty_add_media_query"),
943  $ilCtrl->getLinkTarget($this, "addMediaQuery")
944  );
945  }
946 
947  $table_gui = new ilStyleMediaQueryTableGUI(
948  $this,
949  "listMediaQueries",
950  $this->getStyleSheet(),
951  $this->access_manager
952  );
953  $tpl->setContent($table_gui->getHTML());
954  }
TableGUI class for style editor (image list)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, includeCSS(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), and setTemplatesSubTabs().

1117  : void
1118  {
1119  $tpl = $this->gui_service->ui()->mainTemplate();
1120  $ilTabs = $this->gui_service->tabs();
1121  $ilCtrl = $this->ctrl;
1122  $ilToolbar = $this->gui_service->toolbar();
1123 
1124  $ctype = $this->style_request->getTempType();
1125  if ($ctype == "") {
1126  $ctype = "table";
1127  }
1128 
1129  $this->setTemplatesSubTabs();
1130  $ilCtrl->setParameter($this, "temp_type", $ctype);
1131  $ilTabs->setSubTabActive("sty_" . $ctype . "_templates");
1132 
1133  // action commands
1134  if ($this->access_manager->checkWrite()) {
1135  if ($ctype == "table") {
1136  $ilToolbar->addButton(
1137  $this->lng->txt("sty_generate_template"),
1138  $ilCtrl->getLinkTarget($this, "generateTemplate")
1139  );
1140  }
1141  $ilToolbar->addButton(
1142  $this->lng->txt("sty_add_template"),
1143  $ilCtrl->getLinkTarget($this, "addTemplate")
1144  );
1145  }
1146 
1147 
1148 
1149  $this->includeCSS();
1150  $table_gui = new ilTableTemplatesTableGUI(
1151  $ctype,
1152  $this,
1153  "listTemplates",
1154  $this->getStyleSheet(),
1155  $this->access_manager
1156  );
1157  $tpl->setContent($table_gui->getHTML());
1158  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

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

References ilObjectGUI\$tpl, ilGlobalTemplateInterface\addCss(), ILIAS\Repository\form(), ilObjStyleSheet\getContentStylePath(), getPropertiesValues(), initPropertiesForm(), ILIAS\Repository\object(), and ilGlobalTemplateInterface\setContent().

272  : void
273  {
274  $tpl = $this->gui_service->ui()->mainTemplate();
276 
277  $this->initPropertiesForm();
278  $this->getPropertiesValues();
279  $tpl->setContent($this->form->getHTML());
280  }
getPropertiesValues()
Get current values for properties from.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
form( $class_path, string $cmd, string $submit_caption="")
initPropertiesForm(string $a_mode="edit")
FORM: Init properties form.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
+ Here is the call graph for this function:

◆ refreshTemplateObject()

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

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

References updateTemplateObject().

1469  : void
1470  {
1471  $this->updateTemplateObject(true);
1472  }
updateTemplateObject(bool $a_refresh=false)
+ Here is the call graph for this function:

◆ returnToUpperContextObject()

ilObjStyleSheetGUI::returnToUpperContextObject ( )

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

References ilObjectGUI\$ctrl, and ilCtrl\returnToParent().

1898  : void
1899  {
1900  $ilCtrl = $this->ctrl;
1901  $ilCtrl->returnToParent($this);
1902  }
returnToParent(object $a_gui_obj, string $a_anchor=null)
+ Here is the call graph for this function:

◆ saveColorObject()

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, initColorForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

827  : void
828  {
829  $tpl = $this->gui_service->ui()->mainTemplate();
830  $ilCtrl = $this->ctrl;
831  $lng = $this->lng;
832 
833  $this->initColorForm();
834  if ($this->form_gui->checkInput()) {
835  if ($this->color_manager->colorExists($this->form_gui->getInput("color_name"))) {
836  $col_input = $this->form_gui->getItemByPostVar("color_name");
837  $col_input->setAlert($lng->txt("sty_color_already_exists"));
838  } else {
839  $this->color_manager->addColor(
840  $this->form_gui->getInput("color_name"),
841  $this->form_gui->getInput("color_code")
842  );
843  $ilCtrl->redirect($this, "listColors");
844  }
845  }
846  $this->form_gui->setValuesByPost();
847  $tpl->setContent($this->form_gui->getHTML());
848  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initColorForm(string $a_mode="create")
+ Here is the call graph for this function:

◆ saveMediaQueryObject()

ilObjStyleSheetGUI::saveMediaQueryObject ( )

Save media query.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, initMediaQueryForm(), and ilGlobalTemplateInterface\setContent().

1024  : void
1025  {
1026  $tpl = $this->gui_service->ui()->mainTemplate();
1027  $ilCtrl = $this->ctrl;
1028  $lng = $this->lng;
1029 
1030  $this->initMediaQueryForm();
1031 
1032  if ($this->form_gui->checkInput()) {
1033  $this->object->addMediaQuery($this->form_gui->getInput("mquery"));
1034  $ilCtrl->redirect($this, "listMediaQueries");
1035  }
1036  $this->form_gui->setValuesByPost();
1037  $tpl->setContent($this->form_gui->getHTML());
1038  }
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initMediaQueryForm(string $a_mode="create")
Init media query form.
+ Here is the call graph for this function:

◆ saveMediaQueryOrderObject()

ilObjStyleSheetGUI::saveMediaQueryOrderObject ( )

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

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

1098  : void
1099  {
1100  $ilCtrl = $this->ctrl;
1101 
1102  $order = $this->style_request->getOrder();
1103  if (count($order) > 0) {
1104  $this->getStyleSheet()->saveMediaQueryOrder($order);
1105  }
1106  $ilCtrl->redirect($this, "listMediaQueries");
1107  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

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

References ilObjectGUI\$ctrl, ilObjStyleSheet\_addMissingStyleClassesToStyle(), ilObject\_lookupType(), ilObjStyleSheet\_writeStandard(), ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilObjStyleSheet\getBasicZipPath(), getCreateForm(), ilPropertyFormGUI\getInput(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), ILIAS\Repository\lng(), ilCtrl\redirect(), and ILIAS\Repository\settings().

408  : void
409  {
410  $ctrl = $this->gui_service->ctrl();
411 
412  $form = $this->getCreateForm();
413  $form->checkInput();
414 
415  if (!trim($form->getInput("style_title"))) {
416  $ctrl->redirect($this, "create");
417  }
418 
419  // copy from default style or ... see #11330
420  $default_style = $this->settings->get("default_content_style_id");
421  if (ilObject::_lookupType((int) $default_style) == "sty") {
422  $style_obj = ilObjectFactory::getInstanceByObjId((int) $default_style);
423  $new_id = $style_obj->ilClone();
424  $newObj = new ilObjStyleSheet($new_id);
425  } else {
426  // ... import from basic zip file
427  $imp = new ilImport();
428  $style_id = $imp->importObject(
429  null,
431  "style.zip",
432  "sty",
433  "Services/Style",
434  true
435  );
436 
437  $newObj = new ilObjStyleSheet($style_id);
438  }
439 
440  $newObj->setTitle($form->getInput("style_title"));
441  $newObj->setDescription($form->getInput("style_description"));
442  $newObj->update();
443  $this->object = $newObj;
444 
446 
447  // assign style to style sheet folder,
448  // if parent is style sheet folder
449  if ($this->requested_ref_id > 0) {
450  $fold = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
451  if ($fold->getType() == "stys") {
452  $cont_style_settings = new ilContentStyleSettings();
453  $cont_style_settings->addStyle($newObj->getId());
454  $cont_style_settings->update();
455 
456  ilObjStyleSheet::_writeStandard($newObj->getId(), true);
457  $this->tpl->setOnScreenMessage("success", $this->lng->txt("object_added"), true);
458  $this->ctrl->setParameterByClass(self::class, "obj_id", (string) $newObj->getId());
459  $this->ctrl->redirectByClass(self::class, "");
460  }
461  }
462  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
Import class.
static _writeStandard(int $a_id, bool $a_std)
Write standard flag.
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _addMissingStyleClassesToStyle(int $a_id)
Add missing style classes to all styles.
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ saveTemplateObject()

ilObjStyleSheetGUI::saveTemplateObject ( )

Save table template.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_getTemplateClassTypes(), getTemplatePreview(), initTemplateForm(), ILIAS\Repository\object(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

1372  : void
1373  {
1374  $tpl = $this->gui_service->ui()->mainTemplate();
1375  $ilCtrl = $this->ctrl;
1376  $lng = $this->lng;
1377 
1378  $this->initTemplateForm();
1379  $temp_type = $this->style_request->getTempType();
1380 
1381  if ($this->form_gui->checkInput()) {
1382  if ($this->object->templateExists($this->form_gui->getInput("name"))) {
1383  $name_input = $this->form_gui->getItemByPostVar("name");
1384  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
1385  } else {
1386  $classes = array();
1387  foreach (ilObjStyleSheet::_getTemplateClassTypes($temp_type) as $tct => $ct) {
1388  $classes[$tct] = $this->form_gui->getInput($tct . "_class");
1389  }
1390  $t_id = $this->object->addTemplate(
1391  $temp_type,
1392  $this->form_gui->getInput("name"),
1393  $classes
1394  );
1395  $this->object->writeTemplatePreview(
1396  $t_id,
1397  $this->getTemplatePreview($temp_type, $t_id, true)
1398  );
1399  $ilCtrl->redirect($this, "listTemplates");
1400  }
1401  }
1402  $this->form_gui->setValuesByPost();
1403  $tpl->setContent($this->form_gui->getHTML());
1404  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
initTemplateForm(string $a_mode="create")
Init table template form.
ilLanguage $lng
getTemplatePreview(string $a_type, int $a_t_id, bool $a_small_mode=false)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static _getTemplateClassTypes(string $a_template_type="")
Get template class types.
+ Here is the call graph for this function:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

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

References Vendor\Package\$c, ilObjectGUI\$ctrl, ilObjStyleSheet\_getTemplateClassTypes(), and ILIAS\Repository\ctrl().

Referenced by listTemplatesObject().

630  : void
631  {
632  $ilTabs = $this->gui_service->tabs();
633  $ilCtrl = $this->ctrl;
634 
636 
637  foreach ($types as $t => $c) {
638  $ilCtrl->setParameter($this, "temp_type", $t);
639  $ilTabs->addSubTabTarget(
640  "sty_" . $t . "_templates",
641  $this->ctrl->getLinkTarget($this, "listTemplates"),
642  array("listTemplates", ""),
643  get_class($this)
644  );
645  }
646 
647  $ilCtrl->setParameter($this, "temp_type", $this->style_request->getTempType());
648  }
static _getTemplateClassTypes(string $a_template_type="")
Get template class types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

References Vendor\Package\$b, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, getTemplatePreview(), initTemplateGenerationForm(), ILIAS\Repository\object(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

1668  : void
1669  {
1670  $tpl = $this->gui_service->ui()->mainTemplate();
1671  $ilCtrl = $this->ctrl;
1672  $lng = $this->lng;
1673 
1674  $this->initTemplateGenerationForm();
1675 
1676  if ($this->form_gui->checkInput()) {
1677  if ($this->object->templateExists($this->form_gui->getInput("name"))) {
1678  $name_input = $this->form_gui->getItemByPostVar("name");
1679  $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
1680  } else {
1681  // -> move to application class!
1682 
1683  // cell classes
1684  $cells = array("H" => "header", "C1" => "cell1", "C2" => "cell2");
1685  $tb_p = $this->form_gui->getItemByPostVar("tb_padding");
1686  $tb_padding = $tb_p->getValue();
1687  $lr_p = $this->form_gui->getItemByPostVar("lr_padding");
1688  $lr_padding = $lr_p->getValue();
1689  $cell_color = $this->form_gui->getInput("base_color");
1690 
1691  // use mid gray as cell color for bw zebra
1692  if ($this->form_gui->getInput("layout") == "bwZebra") {
1693  $cell_color = "MidGray";
1694  if (!$this->color_manager->colorExists($cell_color)) {
1695  $this->color_manager->addColor($cell_color, "7F7F7F");
1696  }
1697  $this->color_manager->updateColor($cell_color, $cell_color, "7F7F7F");
1698  }
1699 
1700  foreach ($cells as $k => $cell) {
1701  $cell_class[$k] = $this->form_gui->getInput("name") . $k;
1702  if (!$this->object->characteristicExists($cell_class[$k], "table_cell")) {
1703  $this->characteristic_manager->addCharacteristic("table_cell", $cell_class[$k], true);
1704  }
1705  if ($this->form_gui->getInput("layout") == "bwZebra" && $k == "H") {
1706  $this->characteristic_manager->replaceParameter(
1707  "td",
1708  $cell_class[$k],
1709  "color",
1710  "!" . $this->form_gui->getInput("base_color") . "(" . $this->form_gui->getInput("lightness_" . $cell . "_text") . ")",
1711  "table_cell"
1712  );
1713  $this->characteristic_manager->replaceParameter(
1714  "td",
1715  $cell_class[$k],
1716  "background-color",
1717  "!" . $this->form_gui->getInput("base_color") . "(" . $this->form_gui->getInput("lightness_" . $cell . "_bg") . ")",
1718  "table_cell"
1719  );
1720  } else {
1721  $this->characteristic_manager->replaceParameter(
1722  "td",
1723  $cell_class[$k],
1724  "color",
1725  "!" . $cell_color . "(" . $this->form_gui->getInput("lightness_" . $cell . "_text") . ")",
1726  "table_cell"
1727  );
1728  $this->characteristic_manager->replaceParameter(
1729  "td",
1730  $cell_class[$k],
1731  "background-color",
1732  "!" . $cell_color . "(" . $this->form_gui->getInput("lightness_" . $cell . "_bg") . ")",
1733  "table_cell"
1734  );
1735  }
1736  $this->characteristic_manager->replaceParameter(
1737  "td",
1738  $cell_class[$k],
1739  "padding-top",
1740  $tb_padding,
1741  "table_cell"
1742  );
1743  $this->characteristic_manager->replaceParameter(
1744  "td",
1745  $cell_class[$k],
1746  "padding-bottom",
1747  $tb_padding,
1748  "table_cell"
1749  );
1750  $this->characteristic_manager->replaceParameter(
1751  "td",
1752  $cell_class[$k],
1753  "padding-left",
1754  $lr_padding,
1755  "table_cell"
1756  );
1757  $this->characteristic_manager->replaceParameter(
1758  "td",
1759  $cell_class[$k],
1760  "padding-right",
1761  $lr_padding,
1762  "table_cell"
1763  );
1764  $this->characteristic_manager->replaceParameter(
1765  "td",
1766  $cell_class[$k],
1767  "border-width",
1768  "1px",
1769  "table_cell"
1770  );
1771  $this->characteristic_manager->replaceParameter(
1772  "td",
1773  $cell_class[$k],
1774  "border-style",
1775  "solid",
1776  "table_cell"
1777  );
1778  $this->characteristic_manager->replaceParameter(
1779  "td",
1780  $cell_class[$k],
1781  "border-color",
1782  "!" . $cell_color . "(" . $this->form_gui->getInput("lightness_border") . ")",
1783  "table_cell"
1784  );
1785  $this->characteristic_manager->replaceParameter(
1786  "td",
1787  $cell_class[$k],
1788  "font-weight",
1789  "normal",
1790  "table_cell"
1791  );
1792  }
1793 
1794  // table class
1795  $classes["table"] = $this->form_gui->getInput("name") . "T";
1796  if (!$this->object->characteristicExists($classes["table"], "table")) {
1797  $this->characteristic_manager->addCharacteristic("table", $classes["table"], true);
1798  }
1799  $this->characteristic_manager->replaceParameter(
1800  "table",
1801  $classes["table"],
1802  "caption-side",
1803  "bottom",
1804  "table"
1805  );
1806  $this->characteristic_manager->replaceParameter(
1807  "table",
1808  $classes["table"],
1809  "border-collapse",
1810  "collapse",
1811  "table"
1812  );
1813  $this->characteristic_manager->replaceParameter(
1814  "table",
1815  $classes["table"],
1816  "margin-top",
1817  "5px",
1818  "table"
1819  );
1820  $this->characteristic_manager->replaceParameter(
1821  "table",
1822  $classes["table"],
1823  "margin-bottom",
1824  "5px",
1825  "table"
1826  );
1827  if ($this->form_gui->getInput("layout") == "bwZebra") {
1828  $this->characteristic_manager->replaceParameter(
1829  "table",
1830  $classes["table"],
1831  "border-bottom-color",
1832  "!" . $this->form_gui->getInput("base_color"),
1833  "table"
1834  );
1835  $this->characteristic_manager->replaceParameter(
1836  "table",
1837  $classes["table"],
1838  "border-bottom-style",
1839  "solid",
1840  "table"
1841  );
1842  $this->characteristic_manager->replaceParameter(
1843  "table",
1844  $classes["table"],
1845  "border-bottom-width",
1846  "3px",
1847  "table"
1848  );
1849  $sb = array("left", "right", "top");
1850  foreach ($sb as $b) {
1851  $this->characteristic_manager->replaceParameter(
1852  "table",
1853  $classes["table"],
1854  "border-" . $b . "-width",
1855  "0px",
1856  "table"
1857  );
1858  }
1859  }
1860 
1861  switch ($this->form_gui->getInput("layout")) {
1862  case "bwZebra":
1863  case "coloredZebra":
1864  $classes["row_head"] = $cell_class["H"];
1865  $classes["odd_row"] = $cell_class["C1"];
1866  $classes["even_row"] = $cell_class["C2"];
1867  break;
1868 
1869  case "noZebra":
1870  $classes["row_head"] = $cell_class["H"];
1871  $classes["odd_row"] = $cell_class["C1"];
1872  $classes["even_row"] = $cell_class["C1"];
1873  $classes["col_head"] = $cell_class["C2"];
1874  break;
1875  }
1876 
1877 
1878  $t_id = $this->object->addTemplate(
1879  $this->style_request->getTempType(),
1880  $this->form_gui->getInput("name"),
1881  $classes
1882  );
1883  $this->object->writeTemplatePreview(
1884  $t_id,
1885  $this->getTemplatePreview(
1886  $this->style_request->getTempType(),
1887  $t_id,
1888  true
1889  )
1890  );
1891  $ilCtrl->redirect($this, "listTemplates");
1892  }
1893  }
1894  $this->form_gui->setValuesByPost();
1895  $tpl->setContent($this->form_gui->getHTML());
1896  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
getTemplatePreview(string $a_type, int $a_t_id, bool $a_small_mode=false)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initTemplateGenerationForm()
Init table template generation form.
+ Here is the call graph for this function:

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, initColorForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

853  : void
854  {
855  $tpl = $this->gui_service->ui()->mainTemplate();
856  $ilCtrl = $this->ctrl;
857  $lng = $this->lng;
858 
859  $c_name = $this->style_request->getColorName();
860  $ilCtrl->setParameter($this, "c_name", $c_name);
861  $this->initColorForm("edit");
862 
863  if ($this->form_gui->checkInput()) {
864  if ($this->color_manager->colorExists($this->form_gui->getInput("color_name")) &&
865  $this->form_gui->getInput("color_name") != $c_name) {
866  $col_input = $this->form_gui->getItemByPostVar("color_name");
867  $col_input->setAlert($lng->txt("sty_color_already_exists"));
868  } else {
869  $this->color_manager->updateColor(
870  $c_name,
871  $this->form_gui->getInput("color_name"),
872  $this->form_gui->getInput("color_code")
873  );
874  $ilCtrl->redirect($this, "listColors");
875  }
876  }
877  $this->form_gui->setValuesByPost();
878  $tpl->setContent($this->form_gui->getHTML());
879  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initColorForm(string $a_mode="create")
+ Here is the call graph for this function:

◆ updateMediaQueryObject()

ilObjStyleSheetGUI::updateMediaQueryObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$tpl, initMediaQueryForm(), and ilGlobalTemplateInterface\setContent().

1040  : void
1041  {
1042  $tpl = $this->gui_service->ui()->mainTemplate();
1043  $ilCtrl = $this->ctrl;
1044 
1045  $this->initMediaQueryForm("edit");
1046 
1047  if ($this->form_gui->checkInput()) {
1048  $this->object->updateMediaQuery(
1049  $this->style_request->getMediaQueryId(),
1050  $this->form_gui->getInput("mquery")
1051  );
1052  $ilCtrl->redirect($this, "listMediaQueries");
1053  }
1054  $ilCtrl->setParameter($this, "mq_id", $this->style_request->getMediaQueryId());
1055  $this->form_gui->setValuesByPost();
1056  $tpl->setContent($this->form_gui->getHTML());
1057  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initMediaQueryForm(string $a_mode="create")
Init media query form.
+ Here is the call graph for this function:

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ILIAS\Repository\form(), initPropertiesForm(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

340  : void
341  {
342  $lng = $this->lng;
343  $ctrl = $this->gui_service->ctrl();
344  $tpl = $this->gui_service->ui()->mainTemplate();
345 
346  $this->initPropertiesForm("edit");
347  if ($this->form->checkInput()) {
348  $this->object->setTitle($this->form->getInput("style_title"));
349  $this->object->setDescription($this->form->getInput("style_description"));
350  $this->object->writeStyleSetting(
351  "disable_auto_margins",
352  $this->form->getInput("disable_auto_margins")
353  );
354  $this->object->update();
355  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_obj_modified"), true);
356  $ctrl->redirect($this, "properties");
357  } else {
358  $this->form->setValuesByPost();
359  $tpl->setContent($this->form->getHTML());
360  }
361  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
form( $class_path, string $cmd, string $submit_caption="")
initPropertiesForm(string $a_mode="edit")
FORM: Init properties form.
+ Here is the call graph for this function:

◆ updateTemplateObject()

ilObjStyleSheetGUI::updateTemplateObject ( bool  $a_refresh = false)

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjStyleSheet\_getTemplateClassTypes(), ilObjStyleSheet\_lookupTemplateName(), displayTemplateEditForm(), getTemplatePreview(), initTemplateForm(), ILIAS\Repository\object(), and ilLanguage\txt().

Referenced by refreshTemplateObject().

1408  : void {
1409  $ilCtrl = $this->ctrl;
1410  $lng = $this->lng;
1411 
1412  $ilCtrl->setParameter($this, "t_id", $this->style_request->getTemplateId());
1413  $this->initTemplateForm("edit");
1414  $temp_type = $this->style_request->getTempType();
1415 
1416  $t_id = $this->style_request->getTemplateId();
1417  if ($this->form_gui->checkInput()) {
1418  if ($this->object->templateExists($this->form_gui->getInput("name")) &&
1419  $this->form_gui->getInput("name") != ilObjStyleSheet::_lookupTemplateName($t_id)) {
1420  $name_input = $this->form_gui->getItemByPostVar("name");
1421  $name_input->setAlert($lng->txt("sty_template_already_exists"));
1422  } else {
1423  $classes = array();
1424  foreach (ilObjStyleSheet::_getTemplateClassTypes($temp_type) as $tct => $ct) {
1425  $classes[$tct] = $this->form_gui->getInput($tct . "_class");
1426  }
1427 
1428  $this->object->updateTemplate(
1429  $t_id,
1430  $this->form_gui->getInput("name"),
1431  $classes
1432  );
1433  $this->object->writeTemplatePreview(
1434  $t_id,
1435  $this->getTemplatePreview($temp_type, $t_id, true)
1436  );
1437  if (!$a_refresh) {
1438  $ilCtrl->redirect($this, "listTemplates");
1439  }
1440  }
1441  }
1442 
1443  $this->form_gui->setValuesByPost();
1444  $this->displayTemplateEditForm();
1445  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
initTemplateForm(string $a_mode="create")
Init table template form.
ilLanguage $lng
getTemplatePreview(string $a_type, int $a_t_id, bool $a_small_mode=false)
static _lookupTemplateName(int $a_t_id)
Lookup table template name for template ID.
static _getTemplateClassTypes(string $a_template_type="")
Get template class types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

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

References editObject().

172  : void
173  {
174  $this->editObject();
175  }
editObject()
Edit -> List characteristics.
+ Here is the call graph for this function:

Field Documentation

◆ $access_manager

Access StyleAccessManager ilObjStyleSheetGUI::$access_manager
protected

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

◆ $characteristic_manager

Content CharacteristicManager ilObjStyleSheetGUI::$characteristic_manager
protected

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

◆ $cmd_delete

string ilObjStyleSheetGUI::$cmd_delete

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

◆ $cmd_new_par

string ilObjStyleSheetGUI::$cmd_new_par

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

◆ $cmd_update

string ilObjStyleSheetGUI::$cmd_update

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

◆ $color_manager

Content ColorManager ilObjStyleSheetGUI::$color_manager
protected

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

◆ $enable_write

bool ilObjStyleSheetGUI::$enable_write = false
protected

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

◆ $form

ilPropertyFormGUI ilObjStyleSheetGUI::$form
protected

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

Referenced by getCloneForm(), getCreateForm(), and getImportForm().

◆ $form_gui

ilPropertyFormGUI ilObjStyleSheetGUI::$form_gui
protected

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

◆ $gui_service

Content InternalGUIService ilObjStyleSheetGUI::$gui_service
protected

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

◆ $help

ilHelpGUI ilObjStyleSheetGUI::$help
protected

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

Referenced by createObject(), and getTabs().

◆ $image_manager

Content ImageManager ilObjStyleSheetGUI::$image_manager
protected

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

◆ $obj_definition

ilObjectDefinition ilObjStyleSheetGUI::$obj_definition
protected

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

◆ $service

Content InternalService ilObjStyleSheetGUI::$service
protected

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

◆ $style_request

Content StandardGUIRequest ilObjStyleSheetGUI::$style_request
protected

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

◆ $super_type

string ilObjStyleSheetGUI::$super_type
protected

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


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