ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjPortfolioAdministrationGUI Class Reference

Portfolio Administration Settings. More...

+ Inheritance diagram for ilObjPortfolioAdministrationGUI:
+ Collaboration diagram for ilObjPortfolioAdministrationGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 editSettings ($a_form=null)
 Edit settings. More...
 
 saveSettings ()
 Save settings. More...
 
 cancel ()
 Save settings. More...
 
 addToExternalSettingsForm ($a_form_id)
 
 initAuthorshipForm ()
 Init authorship form. More...
 
 saveAuthorship ()
 Save authorship. More...
 
- 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 @access 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 ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 hasWritePermission ()
 Has write permission. More...
 
 hasReadPermission ()
 Has read permission. More...
 
 initFormSettings ()
 Init settings property form. More...
 
 editDeclarationOfAuthorship ()
 Edit declaration of authorship. More...
 
- 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 

Protected Attributes

 $ui
 
 $request
 
 $declaration_authorship
 
- 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
 

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
 

Detailed Description

Portfolio Administration Settings.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

@ilCtrl_Calls ilObjPortfolioAdministrationGUI: ilPermissionGUI @ilCtrl_IsCalledBy ilObjPortfolioAdministrationGUI: ilAdministrationGUI

Definition at line 13 of file class.ilObjPortfolioAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Contructor.

@access public

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

36 {
37 global $DIC;
38
39 $this->rbacsystem = $DIC->rbac()->system();
40 $this->lng = $DIC->language();
41 $this->settings = $DIC->settings();
42 $this->ctrl = $DIC->ctrl();
43 $this->access = $DIC->access();
44 $this->type = "prfa";
45 $this->ui = $DIC->ui();
46 $this->request = $DIC->http()->request();
47 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
48
49 $this->declaration_authorship = new ilPortfolioDeclarationOfAuthorship();
50
51 $this->lng->loadLanguageModule("prtf");
52 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjPortfolioAdministrationGUI::addToExternalSettingsForm (   $a_form_id)

◆ cancel()

ilObjPortfolioAdministrationGUI::cancel ( )

Save settings.

Definition at line 183 of file class.ilObjPortfolioAdministrationGUI.php.

184 {
185 $ilCtrl = $this->ctrl;
186
187 $ilCtrl->redirect($this, "view");
188 }

References ilObjectGUI\$ctrl.

◆ editDeclarationOfAuthorship()

ilObjPortfolioAdministrationGUI::editDeclarationOfAuthorship ( )
protected

Edit declaration of authorship.

Definition at line 301 of file class.ilObjPortfolioAdministrationGUI.php.

302 {
303 $main_tpl = $this->tpl;
304 $renderer = $ui = $this->ui->renderer();
305 $form = $this->initAuthorshipForm();
306
307 $this->tabs_gui->activateTab("authorship");
308
309 $main_tpl->setContent($renderer->render($form));
310 }

References ilObjectGUI\$tpl, $ui, initAuthorshipForm(), and ui().

+ Here is the call graph for this function:

◆ editSettings()

ilObjPortfolioAdministrationGUI::editSettings (   $a_form = null)

Edit settings.

Definition at line 123 of file class.ilObjPortfolioAdministrationGUI.php.

124 {
127
128 $this->tabs_gui->activateTab('settings');
129
130 /*
131 if ($ilSetting->get('user_portfolios'))
132 {
133 ilUtil::sendInfo($lng->txt("prtf_admin_toggle_info"));
134 }
135 else
136 {
137 ilUtil::sendInfo($lng->txt("prtf_admin_inactive_info"));
138 }
139 */
140
141 if (!$a_form) {
142 $a_form = $this->initFormSettings();
143 }
144 $this->tpl->setContent($a_form->getHTML());
145 return true;
146 }

References $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$settings, and initFormSettings().

Referenced by saveSettings().

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

◆ executeCommand()

ilObjPortfolioAdministrationGUI::executeCommand ( )

Execute command.

@access public

Reimplemented from ilObjectGUI.

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

61 {
62 $next_class = $this->ctrl->getNextClass($this);
63 $cmd = $this->ctrl->getCmd();
64
65 $this->prepareOutput();
66
67 switch ($next_class) {
68 case 'ilpermissiongui':
69 $this->tabs_gui->activateTab('perm_settings');
70 $perm_gui = new ilPermissionGUI($this);
71 $this->ctrl->forwardCommand($perm_gui);
72 break;
73
74 default:
75 if (!$cmd || $cmd == 'view') {
76 $cmd = "editSettings";
77 }
78
79 $this->$cmd();
80 break;
81 }
82 return true;
83 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjPortfolioAdministrationGUI::getAdminTabs ( )

Get tabs.

@access public

Reimplemented from ilObjectGUI.

Definition at line 91 of file class.ilObjPortfolioAdministrationGUI.php.

92 {
94 $tabs = $this->tabs_gui;
95
96
97 if ($this->hasReadPermission()) {
98 $tabs->addTab(
99 "settings",
100 $lng->txt("settings"),
101 $this->ctrl->getLinkTarget($this, "editSettings")
102 );
103 $tabs->addTab(
104 "authorship",
105 $lng->txt("prtf_decl_authorship"),
106 $this->ctrl->getLinkTarget($this, "editDeclarationOfAuthorship")
107 );
108 }
109
110 if ($this->checkPermissionBool('edit_permission')) {
111 $tabs->addTab(
112 "perm_settings",
113 $lng->txt("perm_settings"),
114 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
115 );
116 }
117 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.

References ilObjectGUI\$lng, ilObjectGUI\$tabs_gui, ilObjectGUI\checkPermissionBool(), and hasReadPermission().

+ Here is the call graph for this function:

◆ hasReadPermission()

ilObjPortfolioAdministrationGUI::hasReadPermission ( )
protected

Has read permission.

Returns
bool

Definition at line 203 of file class.ilObjPortfolioAdministrationGUI.php.

204 {
205 return $this->rbacsystem->checkAccess("read", $this->object->getRefId());
206 }

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ hasWritePermission()

ilObjPortfolioAdministrationGUI::hasWritePermission ( )
protected

Has write permission.

Returns
bool

Definition at line 194 of file class.ilObjPortfolioAdministrationGUI.php.

195 {
196 return $this->rbacsystem->checkAccess("write", $this->object->getRefId());
197 }

Referenced by initFormSettings(), saveAuthorship(), and saveSettings().

+ Here is the caller graph for this function:

◆ initAuthorshipForm()

ilObjPortfolioAdministrationGUI::initAuthorshipForm ( )

Init authorship form.

Returns
\ILIAS\UI\Component\Input\Container\Form\Standard

Definition at line 316 of file class.ilObjPortfolioAdministrationGUI.php.

317 {
318 $ui = $this->ui;
319 $f = $ui->factory();
322
323 $lng->loadLanguageModule("meta");
324
325 foreach ($lng->getInstalledLanguages() as $l) {
326 $txt = $lng->txt("meta_l_" . $l);
327 if ($lng->getDefaultLanguage() == $l) {
328 $txt .= " (" . $lng->txt("default") . ")";
329 }
330 $fields["decl_" . $l] = $f->input()->field()->textarea($txt)
331 ->withRequired(false)
332 ->withValue((string) $this->declaration_authorship->getForLanguage($l));
333 }
334
335 // section
336 $section1 = $f->input()->field()->section($fields, $lng->txt("prtf_decl_authorship"), "");
337
338 $form_action = $ctrl->getLinkTarget($this, "saveAuthorship");
339 return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
340 }
$txt
Definition: error.php:13

References ilObjectGUI\$ctrl, Vendor\Package\$f, ilObjectGUI\$lng, $txt, and $ui.

Referenced by editDeclarationOfAuthorship(), and saveAuthorship().

+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjPortfolioAdministrationGUI::initFormSettings ( )
protected

Init settings property form.

@access protected

Definition at line 213 of file class.ilObjPortfolioAdministrationGUI.php.

214 {
217
218 $form = new ilPropertyFormGUI();
219 $form->setFormAction($this->ctrl->getFormAction($this));
220 $form->setTitle($this->lng->txt('prtf_settings'));
221
222 if ($this->hasWritePermission()) {
223 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
224 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
225 }
226
227 // Enable 'Portfolios'
228 $lng->loadLanguageModule('pd');
229 $lng->loadLanguageModule('user');
230 $prtf_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_prtf'), 'prtf');
231 $prtf_prop->setValue('1');
232 $prtf_prop->setInfo($lng->txt('user_portfolios_desc'));
233 $prtf_prop->setChecked(($ilSetting->get('user_portfolios') ? '1' : '0'));
234 $form->addItem($prtf_prop);
235
236 $prfa_set = new ilSetting("prfa");
237
238 $banner = new ilCheckboxInputGUI($lng->txt("prtf_preview_banner"), "banner");
239 $banner->setInfo($lng->txt("prtf_preview_banner_info"));
240 $form->addItem($banner);
241
242 $width = new ilNumberInputGUI($lng->txt("prtf_preview_banner_width"), "width");
243 $width->setRequired(true);
244 $width->setSize(4);
245 $banner->addSubItem($width);
246
247 $height = new ilNumberInputGUI($lng->txt("prtf_preview_banner_height"), "height");
248 $height->setRequired(true);
249 $height->setSize(4);
250 $banner->addSubItem($height);
251
252 $banner->setChecked($prfa_set->get("banner", false));
253 if ($prfa_set->get("banner")) {
254 $width->setValue($prfa_set->get("banner_width"));
255 $height->setValue($prfa_set->get("banner_height"));
256 } else {
257 $width->setValue(1370);
258 $height->setValue(100);
259 }
260
261 /*
262 $mask = new ilCheckboxInputGUI($lng->txt("prtf_allow_html"), "mask");
263 $mask->setInfo($lng->txt("prtf_allow_html_info"));
264 $mask->setChecked($prfa_set->get("mask", false));
265 $form->addItem($mask);*/
267 $ne = new ilNonEditableValueGUI($lng->txt("prtf_allow_html"), "", true);
268 $this->ctrl->setParameter($gui, "ref_id", $gui->object->getRefId());
269 $link = $this->ctrl->getLinkTarget($gui);
270 $ne->setValue("<a href='$link'> >> " . $this->lng->txt("settings") . "</a>");
271 $form->addItem($ne);
272
273 $mycourses = new ilCheckboxInputGUI($lng->txt("prtf_allow_my_courses"), "mycrs");
274 $mycourses->setInfo($lng->txt("prtf_allow_my_courses_info"));
275 $mycourses->setChecked($prfa_set->get("mycrs", true));
276 $form->addItem($mycourses);
277
278 return $form;
279 }
This class represents a checkbox property in a property form.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
This class represents a property form user interface.
ILIAS Setting Class.

References $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$settings, ilAdministrationSettingsFormHandler\getSettingsGUIInstance(), and hasWritePermission().

Referenced by editSettings(), and saveSettings().

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

◆ saveAuthorship()

ilObjPortfolioAdministrationGUI::saveAuthorship ( )

Save authorship.

Definition at line 345 of file class.ilObjPortfolioAdministrationGUI.php.

346 {
348 $form = $this->initAuthorshipForm();
351
352 if ($this->hasWritePermission()) {
353 if ($request->getMethod() == "POST") {
354 $form = $form->withRequest($request);
355 $data = $form->getData();
356 if (is_array($data["sec"])) {
357 foreach ($lng->getInstalledLanguages() as $l) {
358 $this->declaration_authorship->setForLanguage($l, $data["sec"]["decl_" . $l]);
359 }
360
361 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
362 }
363 }
364 } else {
365 ilUtil::sendFailure($lng->txt("msg_no_perm_write"), true);
366 }
367 $ctrl->redirect($this, "editDeclarationOfAuthorship");
368 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilObjectGUI\$ctrl, ilObjectGUI\$data, ilObjectGUI\$lng, $request, hasWritePermission(), initAuthorshipForm(), ilUtil\sendFailure(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveSettings()

ilObjPortfolioAdministrationGUI::saveSettings ( )

Save settings.

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

152 {
153 $ilCtrl = $this->ctrl;
155
156 if ($this->hasWritePermission()) {
157
158 $form = $this->initFormSettings();
159 if ($form->checkInput()) {
160 $ilSetting->set('user_portfolios', (int) $form->getInput("prtf"));
161
162 $banner = (bool) $form->getInput("banner");
163
164 $prfa_set = new ilSetting("prfa");
165 $prfa_set->set("banner", $banner);
166 $prfa_set->set("banner_width", (int) $form->getInput("width"));
167 $prfa_set->set("banner_height", (int) $form->getInput("height"));
168 $prfa_set->set("mask", (bool) $form->getInput("mask"));
169 $prfa_set->set("mycrs", (bool) $form->getInput("mycrs"));
170
171 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
172 $ilCtrl->redirect($this, "editSettings");
173 }
174 }
175
176 $form->setValuesByPost();
177 $this->editSettings($form);
178 }

References ilObjectGUI\$ctrl, $ilSetting, ilObjectGUI\$settings, editSettings(), hasWritePermission(), and initFormSettings().

+ Here is the call graph for this function:

Field Documentation

◆ $declaration_authorship

ilObjPortfolioAdministrationGUI::$declaration_authorship
protected

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

◆ $request

ilObjPortfolioAdministrationGUI::$request
protected

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

Referenced by saveAuthorship().

◆ $ui

ilObjPortfolioAdministrationGUI::$ui
protected

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