ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjAdvancedEditingGUI Class Reference

Class ilObjAdvancedEditingGUI. More...

+ Inheritance diagram for ilObjAdvancedEditingGUI:
+ Collaboration diagram for ilObjAdvancedEditingGUI:

Public Member Functions

 executeCommand ()
 
 saveObject ()
 
 getAdminTabs ()
 
 addSubtabs ()
 
 addPageEditorSettingsSubtabs ()
 
 settingsObject ()
 
 getTinyForm ()
 
 saveSettingsObject ()
 
 assessmentObject ()
 
 saveAssessmentSettingsObject ()
 
 frmPostObject ()
 
 saveFrmPostSettingsObject ()
 
 showPageEditorSettingsObject ()
 
 initPageEditorForm ()
 
 savePageEditorSettingsObject ()
 
 showGeneralPageEditorSettingsObject ()
 
 initGeneralPageSettingsForm ()
 
 saveGeneralPageSettingsObject ()
 
- Public Member Functions inherited from ilObjectGUI
 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)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getTabs ()
 
 initTagsForm (string $a_id, string $a_cmd, string $a_title)
 
 saveTags (string $a_id, string $a_cmd, ilPropertyFormGUI $form)
 
 getPageObjectKeysWithOptionalHTML ()
 This limits the possibility to allow html for these page objects that supported the feature in the past. 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ilPropertyFormGUI $form
 
string $cgrp = ""
 
StandardGUIRequest $std_request
 
ilComponentRepository $component_repository
 
- 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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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 = ""
 

Additional Inherited Members

- 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 inherited from ilObjectGUI
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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Member Function Documentation

◆ addPageEditorSettingsSubtabs()

ilObjAdvancedEditingGUI::addPageEditorSettingsSubtabs ( )

Definition at line 131 of file class.ilObjAdvancedEditingGUI.php.

References ILIAS\Repository\ctrl(), and ilPageEditorSettings\getGroups().

Referenced by showGeneralPageEditorSettingsObject(), and showPageEditorSettingsObject().

131  : void
132  {
133  $this->tabs_gui->addSubTabTarget(
134  "adve_pe_general",
135  $this->ctrl->getLinkTarget($this, "showGeneralPageEditorSettings"),
136  array("showGeneralPageEditorSettings", "", "view")
137  );
138 
140 
141  foreach ($grps as $g => $types) {
142  $this->ctrl->setParameter($this, "grp", $g);
143  $this->tabs_gui->addSubTabTarget(
144  "adve_grp_" . $g,
145  $this->ctrl->getLinkTarget($this, "showPageEditorSettings"),
146  array("showPageEditorSettings")
147  );
148  }
149  $this->ctrl->setParameter($this, "grp", $this->std_request->getGroup());
150  }
static getGroups()
Get all settings groups.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSubtabs()

ilObjAdvancedEditingGUI::addSubtabs ( )

Definition at line 98 of file class.ilObjAdvancedEditingGUI.php.

References ILIAS\Repository\ctrl().

Referenced by getTabs().

98  : void
99  {
100  if ($this->ctrl->getNextClass() !== "ilpermissiongui" &&
101  !in_array($this->ctrl->getCmd(), array(
102  "showPageEditorSettings",
103  "showGeneralPageEditorSettings",
104  "",
105  "view"
106  ), true)) {
107  $this->tabs_gui->addSubTabTarget(
108  "adve_general_settings",
109  $this->ctrl->getLinkTarget($this, "settings"),
110  array("settings", "saveSettings"),
111  "",
112  ""
113  );
114  $this->tabs_gui->addSubTabTarget(
115  "adve_assessment_settings",
116  $this->ctrl->getLinkTarget($this, "assessment"),
117  array("assessment", "saveAssessmentSettings"),
118  "",
119  ""
120  );
121  $this->tabs_gui->addSubTabTarget(
122  "adve_frm_post_settings",
123  $this->ctrl->getLinkTarget($this, "frmPost"),
124  array("frmPost", "saveFrmPostSettings"),
125  "",
126  ""
127  );
128  }
129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assessmentObject()

ilObjAdvancedEditingGUI::assessmentObject ( )

Definition at line 223 of file class.ilObjAdvancedEditingGUI.php.

References ilPropertyFormGUI\getHTML(), and initTagsForm().

223  : void
224  {
225  $form = $this->initTagsForm(
226  "assessment",
227  "saveAssessmentSettings",
228  "advanced_editing_assessment_settings"
229  );
230 
231  $this->tpl->setContent($form->getHTML());
232  }
initTagsForm(string $a_id, string $a_cmd, string $a_title)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjAdvancedEditingGUI::executeCommand ( )

Definition at line 54 of file class.ilObjAdvancedEditingGUI.php.

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

54  : void
55  {
56  if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
57  $mess = str_replace("%s", $this->object->getTitle(), $this->lng->txt("msg_no_perm_read_item"));
58  $this->ilias->raiseError($mess, $this->ilias->error_obj->WARNING);
59  }
60 
61  $next_class = $this->ctrl->getNextClass($this);
62  $cmd = $this->ctrl->getCmd();
63  $this->prepareOutput();
64 
65  switch ($next_class) {
66  case 'ilpermissiongui':
67  $perm_gui = new ilPermissionGUI($this);
68  $this->ctrl->forwardCommand($perm_gui);
69  break;
70 
71  default:
72  if ($cmd === null || $cmd === "" || $cmd === "view") {
73  $cmd = "showGeneralPageEditorSettings";
74  }
75  $cmd .= "Object";
76  $this->$cmd();
77 
78  break;
79  }
80  }
prepareOutput(bool $show_sub_objects=true)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjForumAdministration.
+ Here is the call graph for this function:

◆ frmPostObject()

ilObjAdvancedEditingGUI::frmPostObject ( )

Definition at line 247 of file class.ilObjAdvancedEditingGUI.php.

References ilPropertyFormGUI\getHTML(), and initTagsForm().

247  : void
248  {
249  $form = $this->initTagsForm(
250  "frm_post",
251  "saveFrmPostSettings",
252  "advanced_editing_frm_post_settings"
253  );
254 
255  $this->tpl->setContent($form->getHTML());
256  }
initTagsForm(string $a_id, string $a_cmd, string $a_title)
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAdvancedEditingGUI::getAdminTabs ( )

Definition at line 93 of file class.ilObjAdvancedEditingGUI.php.

References getTabs().

93  : void
94  {
95  $this->getTabs();
96  }
+ Here is the call graph for this function:

◆ getPageObjectKeysWithOptionalHTML()

ilObjAdvancedEditingGUI::getPageObjectKeysWithOptionalHTML ( )
protected

This limits the possibility to allow html for these page objects that supported the feature in the past.

PLEASE do not add additional keys here. The whole feature might be abandonded in the future.

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

496  : array
497  {
498  return ["lobj","copa","mep","blp","prtf","prtt","term","lm","qht","qpl","qfbg","qfbs","sahs","stys","cont","cstr","auth"];
499  }

◆ getTabs()

ilObjAdvancedEditingGUI::getTabs ( )
protected

Definition at line 152 of file class.ilObjAdvancedEditingGUI.php.

References addSubtabs(), and ILIAS\Repository\ctrl().

Referenced by getAdminTabs().

152  : void
153  {
154  if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
155  $this->tabs_gui->addTarget(
156  "adve_page_editor_settings",
157  $this->ctrl->getLinkTarget($this, "showGeneralPageEditorSettings"),
158  array("showPageEditorSettings", "","view")
159  );
160 
161  $this->tabs_gui->addTarget(
162  "adve_rte_settings",
163  $this->ctrl->getLinkTarget($this, "settings"),
164  array("settings","assessment", "frmPost"),
165  "",
166  ""
167  );
168  }
169 
170  if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
171  $this->tabs_gui->addTarget(
172  "perm_settings",
173  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
174  array("perm","info","owner"),
175  'ilpermissiongui'
176  );
177  }
178  $this->addSubtabs();
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTinyForm()

ilObjAdvancedEditingGUI::getTinyForm ( )

Definition at line 188 of file class.ilObjAdvancedEditingGUI.php.

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

Referenced by saveSettingsObject(), and settingsObject().

189  {
191  $form = new ilPropertyFormGUI();
192  $form->setFormAction($this->ctrl->getFormAction($this));
193  $form->setTitle($this->lng->txt("adve_activation"));
194  $cb = new ilCheckboxInputGUI($this->lng->txt("adve_use_tiny_mce"), "use_tiny");
195  if ($editor === "tinymce") {
196  $cb->setChecked(true);
197  }
198  $form->addItem($cb);
199  if ($this->checkPermissionBool("write")) {
200  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
201  }
202 
203  return $form;
204  }
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initGeneralPageSettingsForm()

ilObjAdvancedEditingGUI::initGeneralPageSettingsForm ( )

Definition at line 433 of file class.ilObjAdvancedEditingGUI.php.

References $form, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilNumberInputGUI\setMinValue(), ilGlossaryTerm\setShortTextsDirtyGlobally(), ilNumberInputGUI\setSuffix(), and ilPropertyFormGUI\setTitle().

Referenced by saveGeneralPageSettingsObject(), and showGeneralPageEditorSettingsObject().

434  {
435  $form = new ilPropertyFormGUI();
436 
437  $aset = new ilSetting("adve");
438 
439  // use physical character styles
440  $cb = new ilCheckboxInputGUI($this->lng->txt("adve_use_physical"), "use_physical");
441  $cb->setInfo($this->lng->txt("adve_use_physical_info"));
442  $cb->setChecked((bool) $aset->get("use_physical"));
443  $form->addItem($cb);
444 
445  // blocking mode
446  $cb = new ilCheckboxInputGUI($this->lng->txt("adve_blocking_mode"), "block_mode_act");
447  $cb->setChecked((bool) $aset->get("block_mode_minutes") > 0);
448  $form->addItem($cb);
449 
450  // number of minutes
451  $ni = new ilNumberInputGUI($this->lng->txt("adve_minutes"), "block_mode_minutes");
452  $ni->setMinValue(2);
453  $ni->setMaxLength(5);
454  $ni->setSize(5);
455  $ni->setRequired(true);
456  $ni->setInfo($this->lng->txt("adve_minutes_info"));
457  $ni->setValue($aset->get("block_mode_minutes"));
458  $cb->addSubItem($ni);
459 
460  // autosave
461  $as = new ilNumberInputGUI($this->lng->txt("adve_autosave"), "autosave");
462  $as->setSuffix($this->lng->txt("seconds"));
463  $as->setMaxLength(5);
464  $as->setSize(5);
465  $as->setInfo($this->lng->txt("adve_autosave_info"));
466  $as->setValue($aset->get("autosave"));
467  $form->addItem($as);
468 
469  // auto url linking
470  $cb = new ilCheckboxInputGUI($this->lng->txt("adve_auto_url_linking"), "auto_url_linking");
471  $cb->setChecked((bool) $aset->get("auto_url_linking"));
472  $cb->setInfo($this->lng->txt("adve_auto_url_linking_info"));
473  $form->addItem($cb);
474 
475  if ($this->checkPermissionBool("write")) {
476  $form->addCommandButton("saveGeneralPageSettings", $this->lng->txt("save"));
477  }
478 
479  // workaround for glossaries to force rewriting of short texts
481 
482 
483  $form->setTitle($this->lng->txt("adve_pe_general"));
484  $form->setFormAction($this->ctrl->getFormAction($this));
485 
486  return $form;
487  }
setSuffix(string $a_value)
setFormAction(string $a_formaction)
This class represents a number property in a property form.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setMinValue(float $a_minvalue, bool $a_display_always=false)
static setShortTextsDirtyGlobally()
Set short texts dirty (for all glossaries)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPageEditorForm()

ilObjAdvancedEditingGUI::initPageEditorForm ( )

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

References Vendor\Package\$b, ilPageContentGUI\_getCommonBBButtons(), ilObjTestFolder\ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ILIAS\Repository\lng(), ilPageEditorSettings\lookupSetting(), and ILIAS\Repository\settings().

Referenced by savePageEditorSettingsObject(), and showPageEditorSettingsObject().

341  : void
342  {
343  $this->lng->loadLanguageModule("content");
344 
345  $this->form = new ilPropertyFormGUI();
346 
347  if ($this->cgrp === "test") {
348  $this->form->setTitle($this->lng->txt("adve_activation"));
349  $cb = new ilCheckboxInputGUI($this->lng->txt("advanced_editing_tst_editing"), "tst_page_edit");
350  $cb->setInfo($this->lng->txt("advanced_editing_tst_editing_desc"));
352  $cb->setChecked(true);
353  }
354  $this->form->addItem($cb);
355 
356  $sh = new ilFormSectionHeaderGUI();
357  $sh->setTitle($this->lng->txt("adve_text_content_features"));
358  $this->form->addItem($sh);
359  } elseif ($this->cgrp === "rep") {
360  $this->form->setTitle($this->lng->txt("adve_activation"));
361  $cb = new ilCheckboxInputGUI($this->lng->txt("advanced_editing_rep_page_editing"), "cat_page_edit");
362  $cb->setInfo($this->lng->txt("advanced_editing_rep_page_editing_desc"));
363  if ($this->settings->get("enable_cat_page_edit")) {
364  $cb->setChecked(true);
365  }
366  $this->form->addItem($cb);
367 
368  $sh = new ilFormSectionHeaderGUI();
369  $sh->setTitle($this->lng->txt("adve_text_content_features"));
370  $this->form->addItem($sh);
371  } else {
372  $this->form->setTitle($this->lng->txt("adve_text_content_features"));
373  }
374 
375 
377  foreach ($buttons as $b => $t) {
378  // command button activation
379  $cb = new ilCheckboxInputGUI(str_replace(":", "", $this->lng->txt("cont_text_" . $b)), "active_" . $b);
380  $cb->setChecked((bool) ilPageEditorSettings::lookupSetting($this->cgrp, "active_" . $b, true));
381  $this->form->addItem($cb);
382  }
383 
384  // save and cancel commands
385  if ($this->checkPermissionBool("write")) {
386  $this->form->addCommandButton("savePageEditorSettings", $this->lng->txt("save"));
387  }
388 
389  $this->form->setFormAction($this->ctrl->getFormAction($this));
390  }
static lookupSetting(string $a_grp, string $a_name, string $a_default='0')
Lookup setting.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTagsForm()

ilObjAdvancedEditingGUI::initTagsForm ( string  $a_id,
string  $a_cmd,
string  $a_title 
)
protected

Definition at line 271 of file class.ilObjAdvancedEditingGUI.php.

References $form, ilObjAdvancedEditing\_getUsedHTMLTags(), ILIAS\Repository\access(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilMultiSelectInputGUI\setHeight(), and ilPropertyFormGUI\setTitle().

Referenced by assessmentObject(), frmPostObject(), saveAssessmentSettingsObject(), and saveFrmPostSettingsObject().

276  $form = new ilPropertyFormGUI();
277  $form->setFormAction($this->ctrl->getFormAction($this, $a_cmd));
278  $form->setTitle($this->lng->txt($a_title));
279 
280  $alltags = $this->object->getHTMLTags();
281  $alltags = array_combine($alltags, $alltags);
282 
283  $tags = new ilMultiSelectInputGUI($this->lng->txt("advanced_editing_allow_html_tags"), "html_tags");
284  $tags->setHeight(400);
285  $tags->enableSelectAll(true);
286  $tags->enableSelectedFirst(true);
287  $tags->setOptions($alltags);
288  $tags->setValue(ilObjAdvancedEditing::_getUsedHTMLTags($a_id));
289  $form->addItem($tags);
290 
291  if ($this->access->checkAccess("write", "", $this->object->getRefId())) {
292  $form->addCommandButton($a_cmd, $this->lng->txt("save"));
293  }
294 
295  return $form;
296  }
This class represents a multi selection list property in a property form.
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAssessmentSettingsObject()

ilObjAdvancedEditingGUI::saveAssessmentSettingsObject ( )

Definition at line 234 of file class.ilObjAdvancedEditingGUI.php.

References ilPropertyFormGUI\getHTML(), initTagsForm(), saveTags(), and ilPropertyFormGUI\setValuesByPost().

234  : void
235  {
236  $form = $this->initTagsForm(
237  "assessment",
238  "saveAssessmentSettings",
239  "advanced_editing_assessment_settings"
240  );
241  if (!$this->saveTags("assessment", "assessment", $form)) {
243  $this->tpl->setContent($form->getHTML());
244  }
245  }
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)
initTagsForm(string $a_id, string $a_cmd, string $a_title)
+ Here is the call graph for this function:

◆ saveFrmPostSettingsObject()

ilObjAdvancedEditingGUI::saveFrmPostSettingsObject ( )

Definition at line 258 of file class.ilObjAdvancedEditingGUI.php.

References ilPropertyFormGUI\getHTML(), initTagsForm(), saveTags(), and ilPropertyFormGUI\setValuesByPost().

258  : void
259  {
260  $form = $this->initTagsForm(
261  "frm_post",
262  "saveFrmPostSettings",
263  "advanced_editing_frm_post_settings"
264  );
265  if (!$this->saveTags("frm_post", "frmPost", $form)) {
267  $this->tpl->setContent($form->getHTML());
268  }
269  }
saveTags(string $a_id, string $a_cmd, ilPropertyFormGUI $form)
initTagsForm(string $a_id, string $a_cmd, string $a_title)
+ Here is the call graph for this function:

◆ saveGeneralPageSettingsObject()

ilObjAdvancedEditingGUI::saveGeneralPageSettingsObject ( )

Definition at line 501 of file class.ilObjAdvancedEditingGUI.php.

References ilPropertyFormGUI\checkInput(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), initGeneralPageSettingsForm(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilPropertyFormGUI\setValuesByPost().

501  : void
502  {
503  $this->checkPermission("write");
504 
506  if ($form->checkInput()) {
507  $autosave = (int) $form->getInput("autosave");
508  $ok = true;
509 
510  // autosave must be greater 10, if activated
511  if ($autosave > 0 && $autosave < 10) {
512  $form->getItemByPostVar("autosave")->setAlert($this->lng->txt("adve_autosave_info_min_10"));
513  $ok = false;
514  }
515 
516  if ($ok) {
517  $aset = new ilSetting("adve");
518  $aset->set("use_physical", $form->getInput("use_physical"));
519  if ($form->getInput("block_mode_act")) {
520  $aset->set("block_mode_minutes", (string) (int) $form->getInput("block_mode_minutes"));
521  } else {
522  $aset->set("block_mode_minutes", 0);
523  }
524  $aset->set("auto_url_linking", $form->getInput("auto_url_linking"));
525 
526  $aset->set("autosave", $form->getInput("autosave"));
527 
528  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
529  $this->ctrl->redirect($this, "showGeneralPageEditorSettings");
530  }
531  }
532 
534  $this->tpl->setContent($form->getHTML());
535  }
getItemByPostVar(string $a_post_var)
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-...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveObject()

ilObjAdvancedEditingGUI::saveObject ( )

Definition at line 82 of file class.ilObjAdvancedEditingGUI.php.

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

82  : void
83  {
84  $this->checkPermission("write");
85 
86  parent::saveObject();
87 
88  // always send a message
89  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
90  $this->ctrl->redirect($this);
91  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ savePageEditorSettingsObject()

ilObjAdvancedEditingGUI::savePageEditorSettingsObject ( )

Definition at line 392 of file class.ilObjAdvancedEditingGUI.php.

References Vendor\Package\$b, ilObjectGUI\$ctrl, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$settings, ilPageContentGUI\_getCommonBBButtons(), ilObjectGUI\checkPermission(), ILIAS\Repository\form(), initPageEditorForm(), ilLanguage\txt(), and ilPageEditorSettings\writeSetting().

392  : void
393  {
394  $lng = $this->lng;
395  $ilCtrl = $this->ctrl;
397 
398  $this->checkPermission("write");
399 
400  $this->initPageEditorForm();
401  if ($this->form->checkInput()) {
403  foreach ($buttons as $b => $t) {
405  $this->std_request->getGroup(),
406  "active_" . $b,
407  $this->form->getInput("active_" . $b)
408  );
409  }
410 
411  if ($this->std_request->getGroup() === "test") {
412  $ilSetting->set("enable_tst_page_edit", (string) $this->form->getInput("tst_page_edit"));
413  } elseif ($this->std_request->getGroup() === "rep") {
414  $ilSetting->set("enable_cat_page_edit", (string) $this->form->getInput("cat_page_edit"));
415  }
416 
417  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_obj_modified"), true);
418  }
419 
420  $ilCtrl->setParameter($this, "grp", $this->std_request->getGroup());
421  $ilCtrl->redirect($this, "showPageEditorSettings");
422  }
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 writeSetting(string $a_grp, string $a_name, string $a_value)
Write Setting.
ilLanguage $lng
form( $class_path, string $cmd, string $submit_caption="")
global $ilSetting
Definition: privfeed.php:31
ilSetting $settings
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjAdvancedEditingGUI::saveSettingsObject ( )

Definition at line 206 of file class.ilObjAdvancedEditingGUI.php.

References ilPropertyFormGUI\checkInput(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), getTinyForm(), and ILIAS\Repository\lng().

206  : void
207  {
208  $this->checkPermission("write");
209 
210  $form = $this->getTinyForm();
211  $form->checkInput();
212 
213  if ($form->getInput("use_tiny")) {
214  $this->object->setRichTextEditor("tinymce");
215  } else {
216  $this->object->setRichTextEditor("");
217  }
218  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
219 
220  $this->ctrl->redirect($this, 'settings');
221  }
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-...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveTags()

ilObjAdvancedEditingGUI::saveTags ( string  $a_id,
string  $a_cmd,
ilPropertyFormGUI  $form 
)
protected

Definition at line 298 of file class.ilObjAdvancedEditingGUI.php.

References Vendor\Package\$e, ilPropertyFormGUI\checkInput(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), and ILIAS\Repository\lng().

Referenced by saveAssessmentSettingsObject(), and saveFrmPostSettingsObject().

302  : bool {
303  $this->checkPermission("write");
304  try {
305  if ($form->checkInput()) {
306  $html_tags = $form->getInput("html_tags");
307  // get rid of select all
308  if (array_key_exists(0, $html_tags) && (string) $html_tags[0] === '') {
309  unset($html_tags[0]);
310  }
311  $this->object->setUsedHTMLTags((array) $html_tags, $a_id);
312  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
313  } else {
314  return false;
315  }
317  $this->tpl->setOnScreenMessage('info', $e->getMessage(), true);
318  }
319  $this->ctrl->redirect($this, $a_cmd);
320  return true;
321  }
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...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settingsObject()

ilObjAdvancedEditingGUI::settingsObject ( )

Definition at line 181 of file class.ilObjAdvancedEditingGUI.php.

References ilObjectGUI\$tpl, ilPropertyFormGUI\getHTML(), getTinyForm(), and ILIAS\UICore\GlobalTemplate\setContent().

181  : void
182  {
183  $tpl = $this->tpl;
184  $form = $this->getTinyForm();
186  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ showGeneralPageEditorSettingsObject()

ilObjAdvancedEditingGUI::showGeneralPageEditorSettingsObject ( )

Definition at line 424 of file class.ilObjAdvancedEditingGUI.php.

References addPageEditorSettingsSubtabs(), ilPropertyFormGUI\getHTML(), and initGeneralPageSettingsForm().

424  : void
425  {
427  $this->tabs_gui->activateTab("adve_page_editor_settings");
428 
430  $this->tpl->setContent($form->getHTML());
431  }
+ Here is the call graph for this function:

◆ showPageEditorSettingsObject()

ilObjAdvancedEditingGUI::showPageEditorSettingsObject ( )

Definition at line 323 of file class.ilObjAdvancedEditingGUI.php.

References addPageEditorSettingsSubtabs(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilPageEditorSettings\getGroups(), and initPageEditorForm().

323  : void
324  {
326 
328 
329  $this->cgrp = $this->std_request->getGroup();
330  if ($this->cgrp === "") {
331  $this->cgrp = (string) key($grps);
332  }
333 
334  $this->ctrl->setParameter($this, "grp", $this->cgrp);
335  $this->tabs_gui->setSubTabActive("adve_grp_" . $this->cgrp);
336 
337  $this->initPageEditorForm();
338  $this->tpl->setContent($this->form->getHTML());
339  }
static getGroups()
Get all settings groups.
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

Field Documentation

◆ $cgrp

string ilObjAdvancedEditingGUI::$cgrp = ""
protected

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

◆ $component_repository

ilComponentRepository ilObjAdvancedEditingGUI::$component_repository
protected

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

◆ $form

ilPropertyFormGUI ilObjAdvancedEditingGUI::$form
protected

◆ $std_request

StandardGUIRequest ilObjAdvancedEditingGUI::$std_request
protected

Definition at line 31 of file class.ilObjAdvancedEditingGUI.php.


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