ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjContentPageAdministrationGUI Class Reference

Class ilObjContentPageAdministrationGUI. More...

+ Inheritance diagram for ilObjContentPageAdministrationGUI:
+ Collaboration diagram for ilObjContentPageAdministrationGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 
 getAdminTabs ()
 
 executeCommand ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 show (array $components)
 
 edit ()
 
 save ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Member Functions

 getForm (array $values=[])
 

Private Attributes

const CMD_VIEW = 'view'
 
const CMD_EDIT = 'edit'
 
const CMD_SAVE = 'save'
 
const F_READING_TIME = 'reading_time'
 
 $httpRequest
 
 $uiFactory
 
 $uiRenderer
 
 $refinery
 
 $settingsStorage
 
 $error
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjContentPageAdministrationGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

42  {
43  global $DIC;
44 
45  $this->type = 'cpad';
46  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
47  $this->lng->loadLanguageModule($this->type);
48 
49  $this->uiFactory = $DIC->ui()->factory();
50  $this->uiRenderer = $DIC->ui()->renderer();
51  $this->httpRequest = $DIC->http()->request();
52  $this->refinery = $DIC->refinery();
53  $this->error = $DIC['ilErr'];
54  $this->settingsStorage = new StorageImpl($DIC->settings());
55  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ edit()

ilObjContentPageAdministrationGUI::edit ( )
protected

Definition at line 151 of file class.ilObjContentPageAdministrationGUI.php.

References getForm(), and show().

Referenced by executeCommand().

151  : void
152  {
153  $values = [
154  self::F_READING_TIME => $this->settingsStorage->getSettings()->isReadingTimeEnabled(),
155  ];
156 
157  $form = $this->getForm($values);
158 
159  $this->show([$form]);
160  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjContentPageAdministrationGUI::executeCommand ( )

Definition at line 74 of file class.ilObjContentPageAdministrationGUI.php.

References edit(), ilObjectGUI\prepareOutput(), and save().

75  {
76  if (!$this->rbacsystem->checkAccess('visible,read', $this->object->getRefId())) {
77  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
78  }
79 
80  $nextClass = $this->ctrl->getNextClass($this);
81  $cmd = $this->ctrl->getCmd();
82  $this->prepareOutput();
83 
84  switch (strtolower($nextClass)) {
85  case 'ilpermissiongui':
86  $this->tabs_gui->setTabActive('perm_settings');
87  $perm_gui = new ilPermissionGUI($this);
88  $this->ctrl->forwardCommand($perm_gui);
89  break;
90 
91  default:
92  switch ($cmd) {
93  case self::CMD_VIEW:
94  case self::CMD_EDIT:
95  $this->edit();
96  break;
97  case self::CMD_SAVE:
98  $this->save();
99  break;
100  default:
101  throw new Exception(__METHOD__ . " :: Unknown command " . $cmd);
102  }
103  }
104  }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjContentPageAdministrationGUI::getAdminTabs ( )

Definition at line 60 of file class.ilObjContentPageAdministrationGUI.php.

61  {
62  if ($this->rbacsystem->checkAccess('visible,read', $this->object->getRefId())) {
63  $this->tabs_gui->addTarget('settings', $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT));
64  }
65 
66  if ($this->rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
67  $this->tabs_gui->addTarget('perm_settings', $this->ctrl->getLinkTargetByClass('ilpermissiongui', 'perm'), [], 'ilpermissiongui');
68  }
69  }

◆ getForm()

ilObjContentPageAdministrationGUI::getForm ( array  $values = [])
private
Parameters
array$values
Returns
Form

Definition at line 110 of file class.ilObjContentPageAdministrationGUI.php.

References $section.

Referenced by edit(), and save().

110  : Form
111  {
112  $action = $this->ctrl->getLinkTargetByClass(self::class, self::CMD_SAVE);
113 
114  $readingTimeStatus = $this->uiFactory
115  ->input()
116  ->field()
117  ->checkbox(
118  $this->lng->txt('cpad_reading_time_status'),
119  $this->lng->txt('cpad_reading_time_status_desc')
120  );
121 
122  if (isset($values[self::F_READING_TIME])) {
123  $readingTimeStatus = $readingTimeStatus->withValue($values[self::F_READING_TIME]);
124  }
125 
126  $section = $this->uiFactory->input()->field()->section(
127  [self::F_READING_TIME => $readingTimeStatus],
128  $this->lng->txt('settings')
129  );
130 
131  return $this->uiFactory
132  ->input()
133  ->container()
134  ->form()
135  ->standard($action, [$section])
136  ->withAdditionalTransformation($this->refinery->custom()->transformation(static function ($values) : array {
137  return call_user_func_array('array_merge', $values);
138  }));
139  }
$section
Definition: Utf8Test.php:83
+ Here is the caller graph for this function:

◆ save()

ilObjContentPageAdministrationGUI::save ( )
protected

Definition at line 162 of file class.ilObjContentPageAdministrationGUI.php.

References ilObjectGUI\$data, ilObjectGUI\$settings, ilObjectGUI\checkPermissionBool(), getForm(), and show().

Referenced by executeCommand().

162  : void
163  {
164  if (!$this->checkPermissionBool('write')) {
165  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
166  }
167 
168  $form = $this->getForm()->withRequest($this->httpRequest);
169 
170  $data = $form->getData();
171  if ($data) {
172  $readingTime = $data[self::F_READING_TIME];
173  $settings = $this->settingsStorage->getSettings()
174  ->withDisabledReadingTime();
175  if ($readingTime) {
176  $settings = $settings->withEnabledReadingTime();
177  }
178  $this->settingsStorage->store($settings);
179  }
180 
181  $this->show(
182  [$this->uiFactory->messageBox()->success($this->lng->txt('saved_successfully')), $form]
183  );
184  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilObjContentPageAdministrationGUI::show ( array  $components)
protected
Parameters
Component[]$components

Definition at line 144 of file class.ilObjContentPageAdministrationGUI.php.

Referenced by edit(), and save().

144  : void
145  {
146  $this->tpl->setContent(
147  $this->uiRenderer->render($components)
148  );
149  }
+ Here is the caller graph for this function:

Field Documentation

◆ $error

ilObjContentPageAdministrationGUI::$error
private

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

◆ $httpRequest

ilObjContentPageAdministrationGUI::$httpRequest
private

Definition at line 26 of file class.ilObjContentPageAdministrationGUI.php.

◆ $refinery

ilObjContentPageAdministrationGUI::$refinery
private

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

◆ $settingsStorage

ilObjContentPageAdministrationGUI::$settingsStorage
private

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

◆ $uiFactory

ilObjContentPageAdministrationGUI::$uiFactory
private

Definition at line 28 of file class.ilObjContentPageAdministrationGUI.php.

◆ $uiRenderer

ilObjContentPageAdministrationGUI::$uiRenderer
private

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

◆ CMD_EDIT

const ilObjContentPageAdministrationGUI::CMD_EDIT = 'edit'
private

Definition at line 20 of file class.ilObjContentPageAdministrationGUI.php.

◆ CMD_SAVE

const ilObjContentPageAdministrationGUI::CMD_SAVE = 'save'
private

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

◆ CMD_VIEW

const ilObjContentPageAdministrationGUI::CMD_VIEW = 'view'
private

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

◆ F_READING_TIME

const ilObjContentPageAdministrationGUI::F_READING_TIME = 'reading_time'
private

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


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