ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 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 ()
 

Protected Member Functions

 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 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...
 

Protected Attributes

 $ui
 
 $request
 
 $declaration_authorship
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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 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

Constructor & Destructor Documentation

◆ __construct()

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

Contructor.

public

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

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

36  {
37  global $DIC;
38 
39  $this->lng = $DIC->language();
40  $this->settings = $DIC->settings();
41  $this->ctrl = $DIC->ctrl();
42  $this->access = $DIC->access();
43  $this->type = "prfa";
44  $this->ui = $DIC->ui();
45  $this->request = $DIC->http()->request();
46  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
47 
48  $this->declaration_authorship = new ilPortfolioDeclarationOfAuthorship();
49 
50  $this->lng->loadLanguageModule("prtf");
51  }
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjPortfolioAdministrationGUI::addToExternalSettingsForm (   $a_form_id)

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

References $ilSetting, ilObjectGUI\$settings, ilAdministrationSettingsFormHandler\FORM_WSP, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

264  {
266 
267  switch ($a_form_id) {
269 
270  $fields = array('pd_enable_prtf' => array($ilSetting->get('user_portfolios'), ilAdministrationSettingsFormHandler::VALUE_BOOL));
271 
272  return array(array("editSettings", $fields));
273  }
274  }
global $ilSetting
Definition: privfeed.php:17

◆ cancel()

ilObjPortfolioAdministrationGUI::cancel ( )

Save settings.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

182  {
184 
185  $ilCtrl->redirect($this, "view");
186  }
global $ilCtrl
Definition: ilias.php:18

◆ editDeclarationOfAuthorship()

ilObjPortfolioAdministrationGUI::editDeclarationOfAuthorship ( )
protected

Edit declaration of authorship.

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

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

284  {
285  $main_tpl = $this->tpl;
286  $renderer = $ui = $this->ui->renderer();
287  $form = $this->initAuthorshipForm();
288 
289  $this->tabs_gui->activateTab("authorship");
290 
291  $main_tpl->setContent($renderer->render($form));
292  }
ui()
Definition: ui.php:5
+ Here is the call graph for this function:

◆ editSettings()

ilObjPortfolioAdministrationGUI::editSettings (   $a_form = null)

Edit settings.

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

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

Referenced by saveSettings().

123  {
124  $lng = $this->lng;
126 
127  $this->tabs_gui->activateTab('settings');
128 
129  /*
130  if ($ilSetting->get('user_portfolios'))
131  {
132  ilUtil::sendInfo($lng->txt("prtf_admin_toggle_info"));
133  }
134  else
135  {
136  ilUtil::sendInfo($lng->txt("prtf_admin_inactive_info"));
137  }
138  */
139 
140  if (!$a_form) {
141  $a_form = $this->initFormSettings();
142  }
143  $this->tpl->setContent($a_form->getHTML());
144  return true;
145  }
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjPortfolioAdministrationGUI::executeCommand ( )

Execute command.

public

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

References ilObjectGUI\prepareOutput().

60  {
61  $next_class = $this->ctrl->getNextClass($this);
62  $cmd = $this->ctrl->getCmd();
63 
64  $this->prepareOutput();
65 
66  switch ($next_class) {
67  case 'ilpermissiongui':
68  $this->tabs_gui->activateTab('perm_settings');
69  $perm_gui = new ilPermissionGUI($this);
70  $this->ctrl->forwardCommand($perm_gui);
71  break;
72 
73  default:
74  if (!$cmd || $cmd == 'view') {
75  $cmd = "editSettings";
76  }
77 
78  $this->$cmd();
79  break;
80  }
81  return true;
82  }
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()

ilObjPortfolioAdministrationGUI::getAdminTabs ( )

Get tabs.

public

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

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

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

◆ initAuthorshipForm()

ilObjPortfolioAdministrationGUI::initAuthorshipForm ( )

Init authorship form.

Returns

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

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

Referenced by editDeclarationOfAuthorship(), and saveAuthorship().

299  {
300  $ui = $this->ui;
301  $f = $ui->factory();
302  $ctrl = $this->ctrl;
303  $lng = $this->lng;
304 
305  $lng->loadLanguageModule("meta");
306 
307  foreach ($lng->getInstalledLanguages() as $l) {
308  $txt = $lng->txt("meta_l_" . $l);
309  if ($lng->getDefaultLanguage() == $l) {
310  $txt .= " (" . $lng->txt("default") . ")";
311  }
312  $fields["decl_" . $l] = $f->input()->field()->textarea($txt)
313  ->withRequired(false)
314  ->withValue((string) $this->declaration_authorship->getForLanguage($l));
315  }
316 
317  // section
318  $section1 = $f->input()->field()->section($fields, $lng->txt("prtf_decl_authorship"), "");
319 
320  $form_action = $ctrl->getLinkTarget($this, "saveAuthorship");
321  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
322  }
$txt
Definition: error.php:13
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjPortfolioAdministrationGUI::initFormSettings ( )
protected

Init settings property form.

protected

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

References ilObjectGUI\$access, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$settings, ilAdministrationSettingsFormHandler\getSettingsGUIInstance(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilCheckboxInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by editSettings(), and saveSettings().

194  {
195  $lng = $this->lng;
197  $ilAccess = $this->access;
198 
199  $form = new ilPropertyFormGUI();
200  $form->setFormAction($this->ctrl->getFormAction($this));
201  $form->setTitle($this->lng->txt('prtf_settings'));
202 
203  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
204  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
205  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
206  }
207 
208  // Enable 'Portfolios'
209  $lng->loadLanguageModule('pd');
210  $lng->loadLanguageModule('user');
211  $prtf_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_prtf'), 'prtf');
212  $prtf_prop->setValue('1');
213  $prtf_prop->setInfo($lng->txt('user_portfolios_desc'));
214  $prtf_prop->setChecked(($ilSetting->get('user_portfolios') ? '1' : '0'));
215  $form->addItem($prtf_prop);
216 
217  $prfa_set = new ilSetting("prfa");
218 
219  $banner = new ilCheckboxInputGUI($lng->txt("prtf_preview_banner"), "banner");
220  $banner->setInfo($lng->txt("prtf_preview_banner_info"));
221  $form->addItem($banner);
222 
223  $width = new ilNumberInputGUI($lng->txt("prtf_preview_banner_width"), "width");
224  $width->setRequired(true);
225  $width->setSize(4);
226  $banner->addSubItem($width);
227 
228  $height = new ilNumberInputGUI($lng->txt("prtf_preview_banner_height"), "height");
229  $height->setRequired(true);
230  $height->setSize(4);
231  $banner->addSubItem($height);
232 
233  $banner->setChecked($prfa_set->get("banner", false));
234  if ($prfa_set->get("banner")) {
235  $width->setValue($prfa_set->get("banner_width"));
236  $height->setValue($prfa_set->get("banner_height"));
237  } else {
238  $width->setValue(1370);
239  $height->setValue(100);
240  }
241 
242  /*
243  $mask = new ilCheckboxInputGUI($lng->txt("prtf_allow_html"), "mask");
244  $mask->setInfo($lng->txt("prtf_allow_html_info"));
245  $mask->setChecked($prfa_set->get("mask", false));
246  $form->addItem($mask);*/
247 
249  $ne = new ilNonEditableValueGUI($lng->txt("prtf_allow_html"), "", true);
250  $this->ctrl->setParameter($gui, "ref_id", $gui->object->getRefId());
251  $link = $this->ctrl->getLinkTarget($gui);
252  $ne->setValue("<a href='$link'> >> " . $this->lng->txt("settings") . "</a>");
253  $form->addItem($ne);
254 
255  $mycourses = new ilCheckboxInputGUI($lng->txt("prtf_allow_my_courses"), "mycrs");
256  $mycourses->setInfo($lng->txt("prtf_allow_my_courses_info"));
257  $mycourses->setChecked($prfa_set->get("mycrs", true));
258  $form->addItem($mycourses);
259 
260  return $form;
261  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
setValue($a_value)
Set Value.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:17
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAuthorship()

ilObjPortfolioAdministrationGUI::saveAuthorship ( )

Save authorship.

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

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

328  {
330  $form = $this->initAuthorshipForm();
331  $lng = $this->lng;
332  $ctrl = $this->ctrl;
333 
334  if ($this->checkPermissionBool("write")) {
335  if ($request->getMethod() == "POST") {
336  $form = $form->withRequest($request);
337  $data = $form->getData();
338  if (is_array($data["sec"])) {
339  foreach ($lng->getInstalledLanguages() as $l) {
340  $this->declaration_authorship->setForLanguage($l, $data["sec"]["decl_" . $l]);
341  }
342 
343  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
344  }
345  }
346  } else {
347  ilUtil::sendFailure($lng->txt("msg_no_perm_write"), true);
348  }
349  $ctrl->redirect($this, "editDeclarationOfAuthorship");
350  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ saveSettings()

ilObjPortfolioAdministrationGUI::saveSettings ( )

Save settings.

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

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

151  {
154 
155  $this->checkPermission("write");
156 
157  $form = $this->initFormSettings();
158  if ($form->checkInput()) {
159  $ilSetting->set('user_portfolios', (int) $form->getInput("prtf"));
160 
161  $banner = (bool) $form->getInput("banner");
162 
163  $prfa_set = new ilSetting("prfa");
164  $prfa_set->set("banner", $banner);
165  $prfa_set->set("banner_width", (int) $form->getInput("width"));
166  $prfa_set->set("banner_height", (int) $form->getInput("height"));
167  $prfa_set->set("mask", (bool) $form->getInput("mask"));
168  $prfa_set->set("mycrs", (bool) $form->getInput("mycrs"));
169 
170  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
171  $ilCtrl->redirect($this, "editSettings");
172  }
173 
174  $form->setValuesByPost();
175  $this->editSettings($form);
176  }
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:17
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ 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: