ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 list childs of current object 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...
 

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...
 
 showMountWebfolderIcon ()
 
 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
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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 38 of file class.ilObjPortfolioAdministrationGUI.php.

References $DIC, and settings().

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

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjPortfolioAdministrationGUI::addToExternalSettingsForm (   $a_form_id)

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

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

275  {
277 
278  switch ($a_form_id) {
280 
281  $fields = array('pd_enable_prtf' => array($ilSetting->get('user_portfolios'), ilAdministrationSettingsFormHandler::VALUE_BOOL));
282 
283  return array(array("editSettings", $fields));
284  }
285  }
global $ilSetting
Definition: privfeed.php:17

◆ cancel()

ilObjPortfolioAdministrationGUI::cancel ( )

Save settings.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

187  {
189 
190  $ilCtrl->redirect($this, "view");
191  }
global $ilCtrl
Definition: ilias.php:18

◆ editDeclarationOfAuthorship()

ilObjPortfolioAdministrationGUI::editDeclarationOfAuthorship ( )
protected

Edit declaration of authorship.

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

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

295  {
296  $main_tpl = $this->tpl;
297  $renderer = $ui = $this->ui->renderer();
298  $form = $this->initAuthorshipForm();
299 
300  $this->tabs_gui->activateTab("authorship");
301 
302  $main_tpl->setContent($renderer->render($form));
303  }
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

◆ editSettings()

ilObjPortfolioAdministrationGUI::editSettings (   $a_form = null)

Edit settings.

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

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

Referenced by saveSettings().

127  {
128  $lng = $this->lng;
130 
131  $this->tabs_gui->activateTab('settings');
132 
133  /*
134  if ($ilSetting->get('user_portfolios'))
135  {
136  ilUtil::sendInfo($lng->txt("prtf_admin_toggle_info"));
137  }
138  else
139  {
140  ilUtil::sendInfo($lng->txt("prtf_admin_inactive_info"));
141  }
142  */
143 
144  if (!$a_form) {
145  $a_form = $this->initFormSettings();
146  }
147  $this->tpl->setContent($a_form->getHTML());
148  return true;
149  }
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 62 of file class.ilObjPortfolioAdministrationGUI.php.

References ilObjectGUI\prepareOutput().

63  {
64  $next_class = $this->ctrl->getNextClass($this);
65  $cmd = $this->ctrl->getCmd();
66 
67  $this->prepareOutput();
68 
69  switch ($next_class) {
70  case 'ilpermissiongui':
71  $this->tabs_gui->activateTab('perm_settings');
72  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
73  $perm_gui = new ilPermissionGUI($this);
74  $this->ctrl->forwardCommand($perm_gui);
75  break;
76 
77  default:
78  if (!$cmd || $cmd == 'view') {
79  $cmd = "editSettings";
80  }
81 
82  $this->$cmd();
83  break;
84  }
85  return true;
86  }
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 94 of file class.ilObjPortfolioAdministrationGUI.php.

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

95  {
96  $lng = $this->lng;
98 
99 
100  if ($this->checkPermissionBool("visible,read")) {
101  $tabs->addTab(
102  "settings",
103  $lng->txt("settings"),
104  $this->ctrl->getLinkTarget($this, "editSettings")
105  );
106  $tabs->addTab(
107  "authorship",
108  $lng->txt("prtf_decl_authorship"),
109  $this->ctrl->getLinkTarget($this, "editDeclarationOfAuthorship")
110  );
111  }
112 
113  if ($this->checkPermissionBool('edit_permission')) {
114  $tabs->addTab(
115  "perm_settings",
116  $lng->txt("perm_settings"),
117  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
118  );
119  }
120  }
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124
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 309 of file class.ilObjPortfolioAdministrationGUI.php.

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

Referenced by editDeclarationOfAuthorship(), and saveAuthorship().

310  {
311  $ui = $this->ui;
312  $f = $ui->factory();
313  $ctrl = $this->ctrl;
314  $lng = $this->lng;
315 
316  $lng->loadLanguageModule("meta");
317 
318  foreach ($lng->getInstalledLanguages() as $l) {
319  $txt = $lng->txt("meta_l_" . $l);
320  if ($lng->getDefaultLanguage() == $l) {
321  $txt .= " (" . $lng->txt("default") . ")";
322  }
323  $fields["decl_" . $l] = $f->input()->field()->textarea($txt)
324  ->withRequired(false)
325  ->withValue((string) $this->declaration_authorship->getForLanguage($l));
326  }
327 
328  // section
329  $section1 = $f->input()->field()->section($fields, $lng->txt("prtf_decl_authorship"));
330 
331  $form_action = $ctrl->getLinkTarget($this, "saveAuthorship");
332  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
333  }
$txt
Definition: error.php:11
global $l
Definition: afr.php:30
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjPortfolioAdministrationGUI::initFormSettings ( )
protected

Init settings property form.

protected

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

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

Referenced by editSettings(), and saveSettings().

199  {
200  $lng = $this->lng;
202  $ilAccess = $this->access;
203 
204  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
205  $form = new ilPropertyFormGUI();
206  $form->setFormAction($this->ctrl->getFormAction($this));
207  $form->setTitle($this->lng->txt('prtf_settings'));
208 
209  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
210  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
211  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
212  }
213 
214  // Enable 'Portfolios'
215  $lng->loadLanguageModule('pd');
216  $lng->loadLanguageModule('user');
217  $prtf_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_prtf'), 'prtf');
218  $prtf_prop->setValue('1');
219  $prtf_prop->setInfo($lng->txt('user_portfolios_desc'));
220  $prtf_prop->setChecked(($ilSetting->get('user_portfolios') ? '1' : '0'));
221  $form->addItem($prtf_prop);
222 
223  $prfa_set = new ilSetting("prfa");
224 
225  $pdblock = new ilCheckboxInputGUI($lng->txt("prtf_pd_block"), "pd_block");
226  $pdblock->setInfo($lng->txt("prtf_pd_block_info"));
227  $pdblock->setChecked($prfa_set->get("pd_block", false));
228  $form->addItem($pdblock);
229 
230  $banner = new ilCheckboxInputGUI($lng->txt("prtf_preview_banner"), "banner");
231  $banner->setInfo($lng->txt("prtf_preview_banner_info"));
232  $form->addItem($banner);
233 
234  $width = new ilNumberInputGUI($lng->txt("prtf_preview_banner_width"), "width");
235  $width->setRequired(true);
236  $width->setSize(4);
237  $banner->addSubItem($width);
238 
239  $height = new ilNumberInputGUI($lng->txt("prtf_preview_banner_height"), "height");
240  $height->setRequired(true);
241  $height->setSize(4);
242  $banner->addSubItem($height);
243 
244  $banner->setChecked($prfa_set->get("banner", false));
245  if ($prfa_set->get("banner")) {
246  $width->setValue($prfa_set->get("banner_width"));
247  $height->setValue($prfa_set->get("banner_height"));
248  } else {
249  $width->setValue(1370);
250  $height->setValue(100);
251  }
252 
253  /*
254  $mask = new ilCheckboxInputGUI($lng->txt("prtf_allow_html"), "mask");
255  $mask->setInfo($lng->txt("prtf_allow_html_info"));
256  $mask->setChecked($prfa_set->get("mask", false));
257  $form->addItem($mask);*/
258 
260  $ne = new ilNonEditableValueGUI($lng->txt("prtf_allow_html"), "", true);
261  $this->ctrl->setParameter($gui, "ref_id", $gui->object->getRefId());
262  $link = $this->ctrl->getLinkTarget($gui);
263  $ne->setValue("<a href='$link'> >> " . $this->lng->txt("settings") . "</a>");
264  $form->addItem($ne);
265 
266  $mycourses = new ilCheckboxInputGUI($lng->txt("prtf_allow_my_courses"), "mycrs");
267  $mycourses->setInfo($lng->txt("prtf_allow_my_courses_info"));
268  $mycourses->setChecked($prfa_set->get("mycrs", true));
269  $form->addItem($mycourses);
270 
271  return $form;
272  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
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 338 of file class.ilObjPortfolioAdministrationGUI.php.

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

339  {
341  $form = $this->initAuthorshipForm();
342  $lng = $this->lng;
343  $ctrl = $this->ctrl;
344 
345  if ($this->checkPermissionBool("write")) {
346  if ($request->getMethod() == "POST") {
347  $form = $form->withRequest($request);
348  $data = $form->getData();
349  if (is_array($data["sec"])) {
350  foreach ($lng->getInstalledLanguages() as $l) {
351  $this->declaration_authorship->setForLanguage($l, $data["sec"]["decl_" . $l]);
352  }
353 
354  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
355  }
356  }
357  } else {
358  ilUtil::sendFailure($lng->txt("msg_no_perm_write"), true);
359  }
360  $ctrl->redirect($this, "editDeclarationOfAuthorship");
361  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $l
Definition: afr.php:30
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 154 of file class.ilObjPortfolioAdministrationGUI.php.

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

155  {
158 
159  $this->checkPermission("write");
160 
161  $form = $this->initFormSettings();
162  if ($form->checkInput()) {
163  $ilSetting->set('user_portfolios', (int) $form->getInput("prtf"));
164 
165  $banner = (bool) $form->getInput("banner");
166 
167  $prfa_set = new ilSetting("prfa");
168  $prfa_set->set("pd_block", (bool) $form->getInput("pd_block"));
169  $prfa_set->set("banner", $banner);
170  $prfa_set->set("banner_width", (int) $form->getInput("width"));
171  $prfa_set->set("banner_height", (int) $form->getInput("height"));
172  $prfa_set->set("mask", (bool) $form->getInput("mask"));
173  $prfa_set->set("mycrs", (bool) $form->getInput("mycrs"));
174 
175  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
176  $ilCtrl->redirect($this, "editSettings");
177  }
178 
179  $form->setValuesByPost();
180  $this->editSettings($form);
181  }
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
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 31 of file class.ilObjPortfolioAdministrationGUI.php.

◆ $request

ilObjPortfolioAdministrationGUI::$request
protected

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

Referenced by saveAuthorship().

◆ $ui

ilObjPortfolioAdministrationGUI::$ui
protected

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