ILIAS  release_8 Revision v8.24
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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 createObject ()
 create new object form More...
 
 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 ()
 updates object entry in object_data More...
 
 exportStyleObject ()
 
 deleteObject ($a_error=false)
 display deletion confirmation screen More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 confirmedDeleteObject ()
 delete selected style objects More...
 
 saveObject ()
 
 copyStyleObject ()
 
 importStyleObject ()
 Import style sheet. More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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 ()
 @abstract overwrite in derived GUI class of your object type More...
 
 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 ()
 
 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...
 
 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 ()
 @abstract 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...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container 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
 
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.

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(Container $dic, ilPlugin $plugin)
@inheritDoc

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

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

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

◆ addAdminLocatorItems()

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

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

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

◆ addColorObject()

ilObjStyleSheetGUI::addColorObject ( )

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

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

References $tpl.

◆ addMediaQueryObject()

ilObjStyleSheetGUI::addMediaQueryObject ( )

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

955 : void
956 {
957 $tpl = $this->gui_service->ui()->mainTemplate();
958
959 $this->initMediaQueryForm();
960 $tpl->setContent($this->form_gui->getHTML());
961 }
initMediaQueryForm(string $a_mode="create")
Init media query form.

References $tpl.

◆ addTemplateObject()

ilObjStyleSheetGUI::addTemplateObject ( )

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

1159 : void
1160 {
1161 $tpl = $this->gui_service->ui()->mainTemplate();
1162
1163 $this->initTemplateForm();
1164 $tpl->setContent($this->form_gui->getHTML());
1165 }
initTemplateForm(string $a_mode="create")
Init table template form.

References $tpl.

◆ cancelColorDeletionObject()

ilObjStyleSheetGUI::cancelColorDeletionObject ( )

Cancel color deletion.

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

911 : void
912 {
913 $ilCtrl = $this->ctrl;
914 $ilCtrl->redirect($this, "listColors");
915 }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc

◆ cancelColorSavingObject()

ilObjStyleSheetGUI::cancelColorSavingObject ( )

Cancel color saving.

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

816 : void
817 {
818 $ilCtrl = $this->ctrl;
819
820 $ilCtrl->redirect($this, "listColors");
821 }

◆ cancelDeleteObject()

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel deletion of object

Reimplemented from ilObjectGUI.

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

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

◆ cancelObject()

ilObjStyleSheetGUI::cancelObject ( )

cancel action and go back to previous page

Reimplemented from ilObjectGUI.

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

546 : void
547 {
549
550 $this->tpl->setOnScreenMessage('info', $lng->txt("msg_cancel"), true);
551 $this->ctrl->returnToParent($this);
552 }

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

+ Here is the call graph for this function:

◆ cancelTemplateDeletionObject()

ilObjStyleSheetGUI::cancelTemplateDeletionObject ( )

Cancel table template deletion.

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

1540 : void
1541 {
1542 $ilCtrl = $this->ctrl;
1543
1544 $ilCtrl->redirect($this, "listTemplates");
1545 }

◆ cancelTemplateSavingObject()

ilObjStyleSheetGUI::cancelTemplateSavingObject ( )

Cancel color saving.

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

1361 : void
1362 {
1363 $ilCtrl = $this->ctrl;
1364 $ilCtrl->redirect($this, "listTemplates");
1365 }

◆ confirmedDeleteObject()

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

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

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

◆ copyStyleObject()

ilObjStyleSheetGUI::copyStyleObject ( )

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

463 : int
464 {
465 $ctrl = $this->gui_service->ctrl();
466
467 $form = $this->getCloneForm();
468 $form->checkInput();
469 $new_id = 0;
470
471 if ($form->getInput("source_style") > 0) {
472 $style_obj = ilObjectFactory::getInstanceByObjId((int) $form->getInput("source_style"));
473 $new_id = $style_obj->ilClone();
474 }
475
476 // assign style to style sheet folder,
477 // if parent is style sheet folder
478 if ($this->requested_ref_id > 0) {
479 $fold = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
480 if ($fold->getType() == "stys") {
481 $cont_style_settings = new ilContentStyleSettings();
482 $cont_style_settings->addStyle($new_id);
483 $cont_style_settings->update();
484 ilObjStyleSheet::_writeStandard($new_id, true);
485 $ctrl->returnToParent($this);
486 }
487 }
488 $this->object = new ilObjStyleSheet($new_id);
489
490 return $new_id;
491 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
returnToParent(object $a_gui_obj, string $a_anchor=null)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeStandard(int $a_id, bool $a_std)
Write standard flag.
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
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-...

References ilObjStyleSheet\_writeStandard(), ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilObjectFactory\getInstanceByObjId(), and ilObjectFactory\getInstanceByRefId().

+ Here is the call graph for this function:

◆ createObject()

ilObjStyleSheetGUI::createObject ( )

create new object form

Reimplemented from ilObjectGUI.

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

178 : void
179 {
180 $tpl = $this->gui_service->ui()->mainTemplate();
181
182 $ilHelp = $this->help;
183
184 $forms = array();
185
186
187 $ilHelp->setScreenIdComponent("sty");
188 $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
189
190 $forms[] = $this->getCreateForm();
191 $forms[] = $this->getImportForm();
192 $forms[] = $this->getCloneForm();
193
194 $tpl->setContent($this->getCreationFormsHTML($forms));
195 }
const ID_PART_SCREEN
getCreationFormsHTML(array $forms)
Get HTML for creation forms (accordion)

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

+ Here is the call graph for this function:

◆ deleteColorConfirmationObject()

ilObjStyleSheetGUI::deleteColorConfirmationObject ( )

Delete color confirmation.

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

883 : void
884 {
885 $ilCtrl = $this->ctrl;
886 $tpl = $this->gui_service->ui()->mainTemplate();
888
889 $colors = $this->style_request->getColors();
890 if (count($colors) == 0) {
891 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
892 $ilCtrl->redirect($this, "listColors");
893 } else {
894 $cgui = new ilConfirmationGUI();
895 $cgui->setFormAction($ilCtrl->getFormAction($this));
896 $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
897 $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
898 $cgui->setConfirm($lng->txt("delete"), "deleteColor");
899
900 foreach ($colors as $c) {
901 $cgui->addItem("color[]", ilLegacyFormElementsUtil::prepareFormOutput($c), $c);
902 }
903
904 $tpl->setContent($cgui->getHTML());
905 }
906 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static prepareFormOutput($a_str, bool $a_strip=false)

References $c, $lng, $tpl, and ilLegacyFormElementsUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ deleteColorObject()

ilObjStyleSheetGUI::deleteColorObject ( )

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

917 : void
918 {
919 $ilCtrl = $this->ctrl;
920
921 $colors = $this->style_request->getColors();
922 foreach ($colors as $c) {
923 $this->object->removeColor($c);
924 }
925
926 $ilCtrl->redirect($this, "listColors");
927 }

References $c.

◆ deleteMediaQueriesObject()

ilObjStyleSheetGUI::deleteMediaQueriesObject ( )

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

1084 : void
1085 {
1086 $ilCtrl = $this->ctrl;
1087
1088 $mq_ids = $this->style_request->getMediaQueryIds();
1089 if ($this->access_manager->checkWrite()) {
1090 foreach ($mq_ids as $id) {
1091 $this->object->deleteMediaQuery($id);
1092 }
1093 }
1094 $ilCtrl->redirect($this, "listMediaQueries");
1095 }

References $id.

◆ deleteMediaQueryConfirmationObject()

ilObjStyleSheetGUI::deleteMediaQueryConfirmationObject ( )

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

1058 : void
1059 {
1060 $ilCtrl = $this->ctrl;
1061 $tpl = $this->gui_service->ui()->mainTemplate();
1062 $lng = $this->lng;
1063
1064 $mq_ids = $this->style_request->getMediaQueryIds();
1065 if (count($mq_ids) == 0) {
1066 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
1067 $ilCtrl->redirect($this, "listMediaQueries");
1068 } else {
1069 $cgui = new ilConfirmationGUI();
1070 $cgui->setFormAction($ilCtrl->getFormAction($this));
1071 $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
1072 $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
1073 $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
1074
1075 foreach ($mq_ids as $i) {
1076 $mq = $this->object->getMediaQueryForId($i);
1077 $cgui->addItem("mq_id[]", (string) $i, $mq["mquery"]);
1078 }
1079
1080 $tpl->setContent($cgui->getHTML());
1081 }
1082 }

References $i, $lng, and $tpl.

◆ deleteObject()

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

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

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

References $tpl, ilObject\_lookupTitle(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ deleteTemplateConfirmationObject()

ilObjStyleSheetGUI::deleteTemplateConfirmationObject ( )

Delete table template confirmation.

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

1496 : void
1497 {
1498 $ilCtrl = $this->ctrl;
1499 $tpl = $this->gui_service->ui()->mainTemplate();
1500 $lng = $this->lng;
1501
1502 $tids = $this->style_request->getTemplateIds();
1503 if (count($tids) == 0) {
1504 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
1505 $ilCtrl->redirect($this, "listTemplates");
1506 } else {
1507 $cgui = new ilConfirmationGUI();
1508 $cgui->setFormAction($ilCtrl->getFormAction($this));
1509 $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
1510 $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
1511 $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
1512
1513 foreach ($tids as $tid) {
1514 $classes = $this->object->getTemplateClasses($tid);
1515 $cl_str = "";
1516 $listed = array();
1517 foreach ($classes as $cl) {
1518 if ($cl != "" && !($listed[$cl] ?? false)) {
1519 $cl_str .= '<div>- ' .
1520 $cl . "</div>";
1521 $listed[$cl] = true;
1522 }
1523 }
1524 if ($cl_str != "") {
1525 $cl_str = '<div style="padding-left:30px;" class="small">' .
1526 "<div><i>" . $lng->txt("sty_style_class") . "</i></div>" . $cl_str . "</div>";
1527 }
1528 $cgui->addItem("tid[]", (string) $tid, $this->object->lookupTemplateName($tid) . $cl_str);
1529 }
1530
1531 $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
1532
1533 $tpl->setContent($cgui->getHTML());
1534 }
1535 }

References $lng, $tpl, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ deleteTemplateKeepClassesObject()

ilObjStyleSheetGUI::deleteTemplateKeepClassesObject ( )

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

1547 : void
1548 {
1549 $ilCtrl = $this->ctrl;
1550
1551 $tids = $this->style_request->getTemplateIds();
1552 foreach ($tids as $tid) {
1553 $this->object->removeTemplate($tid);
1554 }
1555
1556 $ilCtrl->redirect($this, "listTemplates");
1557 }

◆ deleteTemplateObject()

ilObjStyleSheetGUI::deleteTemplateObject ( )

Delete template.

Exceptions
Content

ContentStyleNoPermissionException

Exceptions
Content

ContentStyleNoPermissionException

Exceptions
ilCtrlException

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

1565 : void
1566 {
1567 $ilCtrl = $this->ctrl;
1568
1569 $tids = $this->style_request->getTemplateIds();
1570 foreach ($tids as $tid) {
1571 $cls = $this->object->getTemplateClasses($tid);
1572 foreach ($cls as $k => $cls2) {
1573 $ty = $this->object->determineTemplateStyleClassType(
1574 $this->style_request->getTempType(),
1575 $k
1576 );
1577 $this->characteristic_manager->deleteCharacteristic($ty, $cls2);
1578 }
1579 $this->object->removeTemplate($tid);
1580 }
1581
1582 $ilCtrl->redirect($this, "listTemplates");
1583 }

◆ displayTemplateEditForm()

ilObjStyleSheetGUI::displayTemplateEditForm ( )

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

1446 : void
1447 {
1448 $tpl = $this->gui_service->ui()->mainTemplate();
1449
1450 $a_tpl = new ilTemplate(
1451 "tpl.template_edit.html",
1452 true,
1453 true,
1454 "Services/Style/Content"
1455 );
1456 $this->includeCSS();
1457 $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
1458 $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview(
1459 $this->style_request->getTempType(),
1460 $this->style_request->getTemplateId()
1461 ));
1462 $tpl->setContent($a_tpl->get());
1463 }
getTemplatePreview(string $a_type, int $a_t_id, bool $a_small_mode=false)
special template class to simplify handling of ITX/PEAR

References $tpl.

◆ editColorObject()

ilObjStyleSheetGUI::editColorObject ( )

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

754 : void
755 {
756 $tpl = $this->gui_service->ui()->mainTemplate();
757 $ilCtrl = $this->ctrl;
758
759 $ilCtrl->setParameter($this, "c_name", $this->style_request->getColorName());
760 $this->initColorForm("edit");
761 $this->getColorFormValues();
762 $tpl->setContent($this->form_gui->getHTML());
763 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
getColorFormValues()
Set values for color editing.

References $tpl.

◆ editMediaQueryObject()

ilObjStyleSheetGUI::editMediaQueryObject ( )

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

963 : void
964 {
965 $tpl = $this->gui_service->ui()->mainTemplate();
966 $ilCtrl = $this->ctrl;
967
968 $ilCtrl->setParameter($this, "mq_id", $this->style_request->getMediaQueryId());
969 $this->initMediaQueryForm("edit");
971 $tpl->setContent($this->form_gui->getHTML());
972 }
getMediaQueryFormValues()
Set values for media query editing.

References $tpl.

◆ editObject()

ilObjStyleSheetGUI::editObject ( )

Edit -> List characteristics.

Reimplemented from ilObjectGUI.

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

267 : void
268 {
269 $ctrl = $this->gui_service->ctrl();
270 $ctrl->redirectByClass("ilStyleCharacteristicGUI", "listCharacteristics");
271 }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc

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

Referenced by viewObject().

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

◆ editTemplateObject()

ilObjStyleSheetGUI::editTemplateObject ( )

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

1167 : void
1168 {
1169 $ilCtrl = $this->ctrl;
1170
1171 $ilCtrl->setParameter(
1172 $this,
1173 "t_id",
1174 $this->style_request->getTemplateId()
1175 );
1176 $this->initTemplateForm("edit");
1177 $this->getTemplateFormValues();
1178
1179 $this->displayTemplateEditForm();
1180 }
getTemplateFormValues()
Set values for table template editing.

◆ 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 ( )

Reimplemented from ilObjectGUI.

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

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
126 case "ilexportgui":
127 $this->prepareOutput();
128 $exp_gui = new ilExportGUI($this);
129 $exp_gui->addFormat("xml");
130 $ctrl->forwardCommand($exp_gui);
131 break;
132
133 case "ilstylecharacteristicgui":
134 $this->prepareOutput();
135 $this->includeCSS();
136 $tabs->activateTab("sty_style_chars");
137 $gui = $this->gui_service->characteristic()->ilStyleCharacteristicGUI(
138 $this->getStyleSheet(),
139 $this->super_type,
140 $this->access_manager,
141 $this->characteristic_manager,
142 $this->image_manager
143 );
144 $ctrl->forwardCommand($gui);
145 break;
146
147 case "ilcontentstyleimagegui":
148 $this->prepareOutput();
149 $this->includeCSS();
150 $tabs->activateTab("sty_images");
151 $gui = $this->gui_service->image()->ilContentStyleImageGUI(
152 $this->access_manager,
153 $this->image_manager
154 );
155 $ctrl->forwardCommand($gui);
156 break;
157
158 default:
159 $this->prepareOutput();
160 $cmd .= "Object";
161 $this->$cmd();
162 break;
163 }
164 }
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(string $fallback_command=null)
@inheritDoc
forwardCommand(object $a_gui_object)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCreationMode(bool $mode=true)
if true, a creation screen is displayed the current [ref_id] don't belong to the current class!...
prepareOutput(bool $show_sub_objects=true)

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

+ Here is the call graph for this function:

◆ exportStyleObject()

ilObjStyleSheetGUI::exportStyleObject ( )

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

365 : void
366 {
367 $exp = new ilExport();
368 $r = $exp->exportObject($this->object->getType(), $this->object->getId());
369
370 ilFileDelivery::deliverFileLegacy($r["directory"] . "/" . $r["file"], $r["file"], '', false, true);
371 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)

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

+ Here is the call graph for this function:

◆ generateTemplateObject()

ilObjStyleSheetGUI::generateTemplateObject ( )

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

1585 : void
1586 {
1587 $tpl = $this->gui_service->ui()->mainTemplate();
1588
1590 $tpl->setContent($this->form_gui->getHTML());
1591 }
initTemplateGenerationForm()
Init table template generation form.

References $tpl.

◆ getAdminTabs()

ilObjStyleSheetGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

554 : void
555 {
556 $this->getTabs();
557 }
getTabs()
@abstract overwrite in derived GUI class of your object type

◆ getCloneForm()

ilObjStyleSheetGUI::getCloneForm ( )
protected

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

240 {
242 $form = new ilPropertyFormGUI();
244 $form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
245
246 // source
247 $ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
248 $ti->setRequired(true);
250 $form->addItem($ti);
251
252 $form->addCommandButton("copyStyle", $this->lng->txt("copy"));
253 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
254 return $form;
255 }
setFormAction(string $a_formaction)
static _getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a selection list property in a property form.

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

Referenced by createObject().

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

803 : void
804 {
805 $c_name = $this->style_request->getColorName();
806 if ($c_name != "") {
807 $values["color_name"] = $c_name;
808 $values["color_code"] = $this->object->getColorCodeForName($c_name);
809 $this->form_gui->setValuesByArray($values);
810 }
811 }

◆ getCreateForm()

ilObjStyleSheetGUI::getCreateForm ( )
protected

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

198 {
200 $form = new ilPropertyFormGUI();
202 $form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
203
204 // title
205 $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
206 $ti->setMaxLength(128);
207 $ti->setSize(40);
208 $ti->setRequired(true);
209 $form->addItem($ti);
210
211 // description
212 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
213 $ta->setCols(40);
214 $ta->setRows(2);
215 $form->addItem($ta);
216
217 $form->addCommandButton("save", $this->lng->txt("save"));
218 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
219 return $form;
220 }
This class represents a text area property in a property form.
This class represents a text property in a property form.

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

Referenced by createObject().

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

◆ getImportForm()

ilObjStyleSheetGUI::getImportForm ( )
protected

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

223 {
225 $form = new ilPropertyFormGUI();
227 $form->setTitle($this->lng->txt("sty_import_stylesheet"));
228
229 // title
230 $ti = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
231 $ti->setRequired(true);
232 $form->addItem($ti);
233
234 $form->addCommandButton("importStyle", $this->lng->txt("import"));
235 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
236 return $form;
237 }
This class represents a file property in a property form.

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

Referenced by createObject().

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

1007 : void
1008 {
1009 $values = [];
1010 if ($this->style_request->getMediaQueryId() > 0) {
1011 foreach ($this->object->getMediaQueries() as $mq) {
1012 if ($mq["id"] == $this->style_request->getMediaQueryId()) {
1013 $values["mquery"] = $mq["mquery"];
1014 }
1015 }
1016 $this->form_gui->setValuesByArray($values);
1017 }
1018 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getPropertiesValues()

ilObjStyleSheetGUI::getPropertiesValues ( )

Get current values for properties from.

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

286 : void
287 {
288 $values = array();
289
290 $values["style_title"] = $this->object->getTitle();
291 $values["style_description"] = $this->object->getDescription();
292 $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
293
294 $this->form->setValuesByArray($values);
295 }
form( $class_path, string $cmd)

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

Referenced by propertiesObject().

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

685 : string {
686 global $DIC;
687
688 $lng = $DIC->language();
689
690 $c = explode(":", $a_class);
691 $a_class = $c[0];
692
693 $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style/Content");
694
695 if ($ex_tpl->blockExists("Example_" . $a_type)) {
696 $ex_tpl->setCurrentBlock("Example_" . $a_type);
697 } else {
698 $ex_tpl->setCurrentBlock("Example_default");
699 }
700 $ex_tpl->setVariable("EX_CLASS", "ilc_" . $a_type . "_" . $a_class);
701 $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
702 if (in_array($a_type, array("media_cont", "qimg"))) {
703 //
704 }
705 if (in_array($a_type, array("table", "table_caption"))) {
706 $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
707 }
708 if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal"))) {
709 $ex_tpl->setVariable("HOR", "Horizontal");
710 }
711 $ex_tpl->parseCurrentBlock();
712
713 return $ex_tpl->get();
714 }

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

+ Here is the caller graph for this function:

◆ getTabs()

ilObjStyleSheetGUI::getTabs ( )
protected

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

◆ getTemplateFormValues()

ilObjStyleSheetGUI::getTemplateFormValues ( )

Set values for table template editing.

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

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

References $type, and ilObjStyleSheet\_getTemplateClassTypes().

+ Here is the call graph for this function:

◆ getTemplatePreview()

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

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

1186 : string {
1187 return $this->_getTemplatePreview(
1188 $this->getStyleSheet(),
1189 $a_type,
1190 $a_t_id,
1191 $a_small_mode
1192 );
1193 }
static _getTemplatePreview(ilObjStyleSheet $a_style, string $a_type, int $a_t_id, bool $a_small_mode=false)
Get table template preview.

◆ importStyleObject()

ilObjStyleSheetGUI::importStyleObject ( )

Import style sheet.

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

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

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

+ Here is the call graph for this function:

◆ includeCSS()

ilObjStyleSheetGUI::includeCSS ( )

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

257 : void
258 {
259 $tpl = $this->gui_service->ui()->mainTemplate();
261 }
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.

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

Referenced by executeCommand().

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

768 : void {
770 $ilCtrl = $this->ctrl;
771
772 $this->form_gui = new ilPropertyFormGUI();
773
774 $this->form_gui->setTitle($lng->txt("sty_add_color"));
775
776 // name
777 $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
778 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
779 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
780 $name_input->setRequired(true);
781 $name_input->setSize(15);
782 $name_input->setMaxLength(15);
783 $this->form_gui->addItem($name_input);
784
785 // code
786 $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
787 $color_input->setRequired(true);
788 $color_input->setDefaultColor("");
789 $this->form_gui->addItem($color_input);
790
791 if ($a_mode == "create") {
792 $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
793 } else {
794 $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
795 }
796 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
797 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
798 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ initMediaQueryForm()

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

Init media query form.

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

980 : void {
982 $ilCtrl = $this->ctrl;
983
984 $this->form_gui = new ilPropertyFormGUI();
985
986 $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
987
988 // media query
989 $ti = new ilTextInputGUI("@media", "mquery");
990 $ti->setMaxLength(2000);
991 $ti->setInfo($lng->txt("sty_add_media_query_info"));
992 $this->form_gui->addItem($ti);
993
994
995 if ($a_mode == "create") {
996 $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
997 } else {
998 $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
999 }
1000 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
1001 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1002 }

◆ initPropertiesForm()

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

FORM: Init properties form.

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

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

Referenced by propertiesObject().

+ Here is the caller graph for this function:

◆ initTemplateForm()

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

Init table template form.

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

1310 : void
1311 {
1312 $lng = $this->lng;
1313 $ilCtrl = $this->ctrl;
1314
1315 $this->form_gui = new ilPropertyFormGUI();
1316
1317 if ($a_mode == "create") {
1318 $this->form_gui->setTitle($lng->txt("sty_add_template"));
1319 } else {
1320 $this->form_gui->setTitle($lng->txt("sty_edit_template"));
1321 }
1322
1323 // name
1324 $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
1325 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1326 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include") . " A-Z, a-z, 1-9");
1327 $name_input->setRequired(true);
1328 $name_input->setSize(30);
1329 $name_input->setMaxLength(30);
1330 $this->form_gui->addItem($name_input);
1331
1332 // template style classes
1334 $this->style_request->getTempType()
1335 );
1336
1337 foreach ($scs as $sc => $st) {
1338 $sc_input = new ilSelectInputGUI($lng->txt("sty_" . $sc . "_class"), $sc . "_class");
1339 $chars = $this->object->getCharacteristics($st);
1340 $options = array("" => "");
1341 foreach ($chars as $char) {
1342 $options[$char] = $char;
1343 }
1344 $sc_input->setOptions($options);
1345 $this->form_gui->addItem($sc_input);
1346 }
1347
1348 if ($a_mode == "create") {
1349 $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
1350 } else {
1351 $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
1352 $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
1353 }
1354 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
1355 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1356 }

References $lng, and ilObjStyleSheet\_getTemplateClassTypes().

+ Here is the call graph for this function:

◆ initTemplateGenerationForm()

ilObjStyleSheetGUI::initTemplateGenerationForm ( )

Init table template generation form.

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

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

References $c, and $lng.

◆ listColorsObject()

ilObjStyleSheetGUI::listColorsObject ( )

List colors of style.

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

724 : void
725 {
726 $tpl = $this->gui_service->ui()->mainTemplate();
727 $ilToolbar = $this->gui_service->toolbar();
728 $ilCtrl = $this->ctrl;
729
730 if ($this->access_manager->checkWrite()) {
731 $ilToolbar->addButton(
732 $this->lng->txt("sty_add_color"),
733 $ilCtrl->getLinkTarget($this, "addColor")
734 );
735 }
736
737 $table_gui = new ilStyleColorTableGUI(
738 $this,
739 "listColors",
740 $this->getStyleSheet(),
741 $this->access_manager
742 );
743 $tpl->setContent($table_gui->getHTML());
744 }
TableGUI class for style editor (image list)

References $tpl, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ listMediaQueriesObject()

ilObjStyleSheetGUI::listMediaQueriesObject ( )

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

933 : void
934 {
935 $tpl = $this->gui_service->ui()->mainTemplate();
936 $ilToolbar = $this->gui_service->toolbar();
937 $ilCtrl = $this->ctrl;
938
939 if ($this->access_manager->checkWrite()) {
940 $ilToolbar->addButton(
941 $this->lng->txt("sty_add_media_query"),
942 $ilCtrl->getLinkTarget($this, "addMediaQuery")
943 );
944 }
945
946 $table_gui = new ilStyleMediaQueryTableGUI(
947 $this,
948 "listMediaQueries",
949 $this->getStyleSheet(),
950 $this->access_manager
951 );
952 $tpl->setContent($table_gui->getHTML());
953 }
TableGUI class for style editor (image list)

References $tpl, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ listTemplatesObject()

ilObjStyleSheetGUI::listTemplatesObject ( )

List templates.

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

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

References $tpl, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ propertiesObject()

ilObjStyleSheetGUI::propertiesObject ( )

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

273 : void
274 {
275 $tpl = $this->gui_service->ui()->mainTemplate();
277
278 $this->initPropertiesForm();
279 $this->getPropertiesValues();
280 $tpl->setContent($this->form->getHTML());
281 }
getPropertiesValues()
Get current values for properties from.
initPropertiesForm(string $a_mode="edit")
FORM: Init properties form.

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

+ Here is the call graph for this function:

◆ refreshTemplateObject()

ilObjStyleSheetGUI::refreshTemplateObject ( )

Refresh table template.

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

1468 : void
1469 {
1470 $this->updateTemplateObject(true);
1471 }
updateTemplateObject(bool $a_refresh=false)

◆ returnToUpperContextObject()

ilObjStyleSheetGUI::returnToUpperContextObject ( )

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

1897 : void
1898 {
1899 $ilCtrl = $this->ctrl;
1900 $ilCtrl->returnToParent($this);
1901 }

◆ saveColorObject()

ilObjStyleSheetGUI::saveColorObject ( )

Save color.

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

826 : void
827 {
828 $tpl = $this->gui_service->ui()->mainTemplate();
829 $ilCtrl = $this->ctrl;
831
832 $this->initColorForm();
833 if ($this->form_gui->checkInput()) {
834 if ($this->color_manager->colorExists($this->form_gui->getInput("color_name"))) {
835 $col_input = $this->form_gui->getItemByPostVar("color_name");
836 $col_input->setAlert($lng->txt("sty_color_already_exists"));
837 } else {
838 $this->color_manager->addColor(
839 $this->form_gui->getInput("color_name"),
840 $this->form_gui->getInput("color_code")
841 );
842 $ilCtrl->redirect($this, "listColors");
843 }
844 }
845 $this->form_gui->setValuesByPost();
846 $tpl->setContent($this->form_gui->getHTML());
847 }

References $lng, and $tpl.

◆ saveMediaQueryObject()

ilObjStyleSheetGUI::saveMediaQueryObject ( )

Save media query.

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

1023 : void
1024 {
1025 $tpl = $this->gui_service->ui()->mainTemplate();
1026 $ilCtrl = $this->ctrl;
1027 $lng = $this->lng;
1028
1029 $this->initMediaQueryForm();
1030
1031 if ($this->form_gui->checkInput()) {
1032 $this->object->addMediaQuery($this->form_gui->getInput("mquery"));
1033 $ilCtrl->redirect($this, "listMediaQueries");
1034 }
1035 $this->form_gui->setValuesByPost();
1036 $tpl->setContent($this->form_gui->getHTML());
1037 }

References $lng, and $tpl.

◆ saveMediaQueryOrderObject()

ilObjStyleSheetGUI::saveMediaQueryOrderObject ( )

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

1097 : void
1098 {
1099 $ilCtrl = $this->ctrl;
1100
1101 $order = $this->style_request->getOrder();
1102 if (count($order) > 0) {
1103 $this->getStyleSheet()->saveMediaQueryOrder($order);
1104 }
1105 $ilCtrl->redirect($this, "listMediaQueries");
1106 }

◆ saveObject()

ilObjStyleSheetGUI::saveObject ( )

Reimplemented from ilObjectGUI.

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

409 : void
410 {
411 $ctrl = $this->gui_service->ctrl();
412
413 $form = $this->getCreateForm();
414 $form->checkInput();
415
416 if (!trim($form->getInput("style_title"))) {
417 $ctrl->redirect($this, "create");
418 }
419
420 // copy from default style or ... see #11330
421 $default_style = $this->settings->get("default_content_style_id");
422 if (ilObject::_lookupType((int) $default_style) == "sty") {
423 $style_obj = ilObjectFactory::getInstanceByObjId((int) $default_style);
424 $new_id = $style_obj->ilClone();
425 $newObj = new ilObjStyleSheet($new_id);
426 } else {
427 // ... import from basic zip file
428 $imp = new ilImport();
429 $style_id = $imp->importObject(
430 null,
432 "style.zip",
433 "sty",
434 "Services/Style",
435 true
436 );
437
438 $newObj = new ilObjStyleSheet($style_id);
439 }
440
441 $newObj->setTitle($form->getInput("style_title"));
442 $newObj->setDescription($form->getInput("style_description"));
443 $newObj->update();
444 $this->object = $newObj;
445
447
448 // assign style to style sheet folder,
449 // if parent is style sheet folder
450 if ($this->requested_ref_id > 0) {
451 $fold = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
452 if ($fold->getType() == "stys") {
453 $cont_style_settings = new ilContentStyleSettings();
454 $cont_style_settings->addStyle($newObj->getId());
455 $cont_style_settings->update();
456
457 ilObjStyleSheet::_writeStandard($newObj->getId(), true);
458 $ctrl->returnToParent($this);
459 }
460 }
461 }
static _addMissingStyleClassesToStyle(int $a_id)
Add missing style classes to all styles.
static _lookupType(int $id, bool $reference=false)

References ilObjStyleSheet\_addMissingStyleClassesToStyle(), ilObject\_lookupType(), ilObjStyleSheet\_writeStandard(), ilPropertyFormGUI\checkInput(), ilObjStyleSheet\getBasicZipPath(), ilPropertyFormGUI\getInput(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ saveTemplateObject()

ilObjStyleSheetGUI::saveTemplateObject ( )

Save table template.

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

1371 : void
1372 {
1373 $tpl = $this->gui_service->ui()->mainTemplate();
1374 $ilCtrl = $this->ctrl;
1375 $lng = $this->lng;
1376
1377 $this->initTemplateForm();
1378 $temp_type = $this->style_request->getTempType();
1379
1380 if ($this->form_gui->checkInput()) {
1381 if ($this->object->templateExists($this->form_gui->getInput("name"))) {
1382 $name_input = $this->form_gui->getItemByPostVar("name");
1383 $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
1384 } else {
1385 $classes = array();
1386 foreach (ilObjStyleSheet::_getTemplateClassTypes($temp_type) as $tct => $ct) {
1387 $classes[$tct] = $this->form_gui->getInput($tct . "_class");
1388 }
1389 $t_id = $this->object->addTemplate(
1390 $temp_type,
1391 $this->form_gui->getInput("name"),
1392 $classes
1393 );
1394 $this->object->writeTemplatePreview(
1395 $t_id,
1396 $this->getTemplatePreview($temp_type, $t_id, true)
1397 );
1398 $ilCtrl->redirect($this, "listTemplates");
1399 }
1400 }
1401 $this->form_gui->setValuesByPost();
1402 $tpl->setContent($this->form_gui->getHTML());
1403 }

References $lng, $tpl, ilObjStyleSheet\_getTemplateClassTypes(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ setTemplatesSubTabs()

ilObjStyleSheetGUI::setTemplatesSubTabs ( )

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

629 : void
630 {
631 $ilTabs = $this->gui_service->tabs();
632 $ilCtrl = $this->ctrl;
633
635
636 foreach ($types as $t => $c) {
637 $ilCtrl->setParameter($this, "temp_type", $t);
638 $ilTabs->addSubTabTarget(
639 "sty_" . $t . "_templates",
640 $this->ctrl->getLinkTarget($this, "listTemplates"),
641 array("listTemplates", ""),
642 get_class($this)
643 );
644 }
645
646 $ilCtrl->setParameter($this, "temp_type", $this->style_request->getTempType());
647 }

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

+ Here is the call graph for this function:

◆ templateGenerationObject()

ilObjStyleSheetGUI::templateGenerationObject ( )

Table template generation.

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

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

References Vendor\Package\$b, $lng, $tpl, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ updateColorObject()

ilObjStyleSheetGUI::updateColorObject ( )

Update color.

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

852 : void
853 {
854 $tpl = $this->gui_service->ui()->mainTemplate();
855 $ilCtrl = $this->ctrl;
857
858 $c_name = $this->style_request->getColorName();
859 $ilCtrl->setParameter($this, "c_name", $c_name);
860 $this->initColorForm("edit");
861
862 if ($this->form_gui->checkInput()) {
863 if ($this->color_manager->colorExists($this->form_gui->getInput("color_name")) &&
864 $this->form_gui->getInput("color_name") != $c_name) {
865 $col_input = $this->form_gui->getItemByPostVar("color_name");
866 $col_input->setAlert($lng->txt("sty_color_already_exists"));
867 } else {
868 $this->color_manager->updateColor(
869 $c_name,
870 $this->form_gui->getInput("color_name"),
871 $this->form_gui->getInput("color_code")
872 );
873 $ilCtrl->redirect($this, "listColors");
874 }
875 }
876 $this->form_gui->setValuesByPost();
877 $tpl->setContent($this->form_gui->getHTML());
878 }

References $lng, and $tpl.

◆ updateMediaQueryObject()

ilObjStyleSheetGUI::updateMediaQueryObject ( )

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

1039 : void
1040 {
1041 $tpl = $this->gui_service->ui()->mainTemplate();
1042 $ilCtrl = $this->ctrl;
1043
1044 $this->initMediaQueryForm("edit");
1045
1046 if ($this->form_gui->checkInput()) {
1047 $this->object->updateMediaQuery(
1048 $this->style_request->getMediaQueryId(),
1049 $this->form_gui->getInput("mquery")
1050 );
1051 $ilCtrl->redirect($this, "listMediaQueries");
1052 }
1053 $ilCtrl->setParameter($this, "mq_id", $this->style_request->getMediaQueryId());
1054 $this->form_gui->setValuesByPost();
1055 $tpl->setContent($this->form_gui->getHTML());
1056 }

References $tpl.

◆ updateObject()

ilObjStyleSheetGUI::updateObject ( )

updates object entry in object_data

Reimplemented from ilObjectGUI.

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

341 : void
342 {
344 $ctrl = $this->gui_service->ctrl();
345 $tpl = $this->gui_service->ui()->mainTemplate();
346
347 $this->initPropertiesForm("edit");
348 if ($this->form->checkInput()) {
349 $this->object->setTitle($this->form->getInput("style_title"));
350 $this->object->setDescription($this->form->getInput("style_description"));
351 $this->object->writeStyleSetting(
352 "disable_auto_margins",
353 $this->form->getInput("disable_auto_margins")
354 );
355 $this->object->update();
356 $this->tpl->setOnScreenMessage('info', $lng->txt("msg_obj_modified"), true);
357 $ctrl->redirect($this, "properties");
358 } else {
359 $this->form->setValuesByPost();
360 $tpl->setContent($this->form->getHTML());
361 }
362 }

References $lng, $tpl, and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ updateTemplateObject()

ilObjStyleSheetGUI::updateTemplateObject ( bool  $a_refresh = false)

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

1407 : void {
1408 $ilCtrl = $this->ctrl;
1409 $lng = $this->lng;
1410
1411 $ilCtrl->setParameter($this, "t_id", $this->style_request->getTemplateId());
1412 $this->initTemplateForm("edit");
1413 $temp_type = $this->style_request->getTempType();
1414
1415 $t_id = $this->style_request->getTemplateId();
1416 if ($this->form_gui->checkInput()) {
1417 if ($this->object->templateExists($this->form_gui->getInput("name")) &&
1418 $this->form_gui->getInput("name") != ilObjStyleSheet::_lookupTemplateName($t_id)) {
1419 $name_input = $this->form_gui->getItemByPostVar("name");
1420 $name_input->setAlert($lng->txt("sty_template_already_exists"));
1421 } else {
1422 $classes = array();
1423 foreach (ilObjStyleSheet::_getTemplateClassTypes($temp_type) as $tct => $ct) {
1424 $classes[$tct] = $this->form_gui->getInput($tct . "_class");
1425 }
1426
1427 $this->object->updateTemplate(
1428 $t_id,
1429 $this->form_gui->getInput("name"),
1430 $classes
1431 );
1432 $this->object->writeTemplatePreview(
1433 $t_id,
1434 $this->getTemplatePreview($temp_type, $t_id, true)
1435 );
1436 if (!$a_refresh) {
1437 $ilCtrl->redirect($this, "listTemplates");
1438 }
1439 }
1440 }
1441
1442 $this->form_gui->setValuesByPost();
1443 $this->displayTemplateEditForm();
1444 }
static _lookupTemplateName(int $a_t_id)
Lookup table template name for template ID.

◆ viewObject()

ilObjStyleSheetGUI::viewObject ( )

viewObject container presentation for "administration -> repository, trash, permissions"

Reimplemented from ilObjectGUI.

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

173 : void
174 {
175 $this->editObject();
176 }
editObject()
Edit -> List characteristics.

References editObject().

+ 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().

◆ $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: