ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilPortfolioRepositoryGUI Class Reference

Portfolio repository gui class. More...

+ Collaboration diagram for ilPortfolioRepositoryGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 setTabs ()
 
 redirectSendMailToSharer ()
 

Protected Member Functions

 setLocator ()
 
 checkAccess (string $a_permission, ?int $a_portfolio_id=null)
 
 show ()
 
 getPortfolioList ()
 
 setOnline ()
 
 setOffline ()
 
 saveTitles ()
 
 confirmPortfolioDeletion ()
 
 deletePortfolios ()
 
 unsetDefault ()
 
 setDefaultConfirmation ()
 Confirm sharing when setting default. More...
 
 setDefaultGlobal ()
 
 setDefaultRegistered ()
 
 setDefault (int $a_prtf_id)
 
 showOtherFilter ()
 
 showOther (bool $a_load_data=true)
 
 applyShareFilter ()
 
 resetShareFilter ()
 

Protected Attributes

ILIAS Portfolio InternalGUIService $gui
 
StandardGUIRequest $port_request
 
ilLanguage $lng
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilLocatorGUI $locator
 
ilToolbarGUI $toolbar
 
ilSetting $settings
 
int $user_id
 
ilPortfolioAccessHandler $access_handler
 
ILIAS DI UIServices $ui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPortfolioRepositoryGUI::__construct ( )

Definition at line 44 of file class.ilPortfolioRepositoryGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

45  {
46  global $DIC;
47 
48  $this->lng = $DIC->language();
49  $this->user = $DIC->user();
50  $this->ctrl = $DIC->ctrl();
51  $this->tpl = $DIC["tpl"];
52  $this->tabs = $DIC->tabs();
53  $this->help = $DIC["ilHelp"];
54  $this->locator = $DIC["ilLocator"];
55  $this->toolbar = $DIC->toolbar();
56  $this->settings = $DIC->settings();
57  $this->ui = $DIC->ui();
58  $lng = $DIC->language();
59  $ilUser = $DIC->user();
60 
61  $lng->loadLanguageModule("prtf");
62  $lng->loadLanguageModule("user");
63 
64  $this->access_handler = new ilPortfolioAccessHandler();
65 
66  $this->port_request = $DIC->portfolio()
67  ->internal()
68  ->gui()
69  ->standardRequest();
70 
71  $this->user_id = $ilUser->getId();
72  $this->gui = $DIC->portfolio()->internal()->gui();
73  }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.
+ Here is the call graph for this function:

Member Function Documentation

◆ applyShareFilter()

ilPortfolioRepositoryGUI::applyShareFilter ( )
protected

Definition at line 592 of file class.ilPortfolioRepositoryGUI.php.

References showOther().

592  : void
593  {
594  $tbl = new ilWorkspaceShareTableGUI($this, "showOther", $this->getWorkspaceAccess());
595  $tbl->resetOffset();
596  $tbl->writeFilterToSession();
597 
598  $this->showOther();
599  }
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ checkAccess()

ilPortfolioRepositoryGUI::checkAccess ( string  $a_permission,
?int  $a_portfolio_id = null 
)
protected

Definition at line 161 of file class.ilPortfolioRepositoryGUI.php.

Referenced by deletePortfolios(), saveTitles(), setDefault(), setDefaultConfirmation(), setDefaultGlobal(), setDefaultRegistered(), and unsetDefault().

164  : bool {
165  if ($a_portfolio_id) {
166  return $this->access_handler->checkAccess($a_permission, "", $a_portfolio_id);
167  }
168  // currently only object-based permissions
169  return true;
170  }
+ Here is the caller graph for this function:

◆ confirmPortfolioDeletion()

ilPortfolioRepositoryGUI::confirmPortfolioDeletion ( )
protected

Definition at line 403 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $id, $lng, $tpl, ilObject\_lookupTitle(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

403  : void
404  {
405  $ilCtrl = $this->ctrl;
406  $tpl = $this->tpl;
407  $lng = $this->lng;
408 
409  $prtfs = $this->port_request->getPortfolioIds();
410 
411  if (count($prtfs) === 0) {
412  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
413  $ilCtrl->redirect($this, "show");
414  } else {
415  $cgui = new ilConfirmationGUI();
416  $cgui->setFormAction($ilCtrl->getFormAction($this));
417  $cgui->setHeaderText($lng->txt("prtf_sure_delete_portfolios"));
418  $cgui->setCancel($lng->txt("cancel"), "show");
419  $cgui->setConfirm($lng->txt("delete"), "deletePortfolios");
420 
421  foreach ($prtfs as $id) {
422  $cgui->addItem("prtfs[]", $id, ilObjPortfolio::_lookupTitle($id));
423  }
424 
425  $tpl->setContent($cgui->getHTML());
426  }
427  }
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 _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ deletePortfolios()

ilPortfolioRepositoryGUI::deletePortfolios ( )
protected

Definition at line 429 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $id, $lng, $user_id, checkAccess(), and ilLanguage\txt().

429  : void
430  {
431  $lng = $this->lng;
432  $ilCtrl = $this->ctrl;
433 
434  $port_ids = $this->port_request->getPortfolioIds();
435  foreach ($port_ids as $id) {
436  if ($this->checkAccess("write", $id)) {
437  $portfolio = new ilObjPortfolio($id, false);
438  if ($portfolio->getOwner() === $this->user_id) {
439  $this->access_handler->removePermission($id);
440  $portfolio->delete();
441  }
442  }
443  }
444  $this->tpl->setOnScreenMessage('success', $lng->txt("prtf_portfolio_deleted"), true);
445  $ilCtrl->redirect($this, "show");
446  }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ executeCommand()

ilPortfolioRepositoryGUI::executeCommand ( )

Definition at line 75 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $lng, $tabs, $tpl, ilUtil\getImagePath(), ILIAS\Repository\lng(), setLocator(), setTabs(), ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), and ilLanguage\txt().

75  : void
76  {
77  $ilCtrl = $this->ctrl;
78  $lng = $this->lng;
79  $tpl = $this->tpl;
80  $ilTabs = $this->tabs;
81 
82  if (!$this->access_handler->editPortfolios()) {
83  throw new ilException($this->lng->txt("no_permission"));
84  }
85 
86  $next_class = $ilCtrl->getNextClass($this);
87  $cmd = $ilCtrl->getCmd("show");
88 
89  $tpl->setTitle($lng->txt("portfolio"));
91  ilUtil::getImagePath("standard/icon_prtf.svg"),
92  $lng->txt("portfolio")
93  );
94 
95  switch ($next_class) {
96  case "ilobjportfoliogui":
97 
98  $gui = new ilObjPortfolioGUI($this->port_request->getPortfolioId());
99 
100  if ($cmd !== "preview") {
101  $this->setLocator();
102 
103  $exercise_back_ref_id = $this->port_request->getExcBackRefId();
104  if ($exercise_back_ref_id > 0) {
105  $ilTabs->setBack2Target($lng->txt("obj_exc"), ilLink::_getLink($exercise_back_ref_id));
106  } else {
107  $ilTabs->setBack2Target($lng->txt("prtf_tab_portfolios"), $ilCtrl->getLinkTarget($this, "show"));
108  }
109  }
110 
111  $ilCtrl->forwardCommand($gui);
112  break;
113 
114  default:
115  $this->setLocator();
116  $this->setTabs();
117  $this->$cmd();
118  break;
119  }
120  }
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 getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
Portfolio view gui class.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ILIAS Portfolio InternalGUIService $gui
+ Here is the call graph for this function:

◆ getPortfolioList()

ilPortfolioRepositoryGUI::getPortfolioList ( )
protected

Definition at line 201 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, Vendor\Package\$f, $lng, $ui, ilPortfolioExerciseGUI\checkExercise(), ilUtil\getImagePath(), ilCtrl\getLinkTarget(), ilCtrl\getLinkTargetByClass(), ilPortfolioAccessHandler\getObjectsIShare(), ilObjPortfolio\getPortfoliosOfUser(), ilCtrl\setParameter(), ilCtrl\setParameterByClass(), and ilLanguage\txt().

Referenced by show().

201  : string
202  {
203  $ui = $this->ui;
204  $f = $ui->factory();
205  $renderer = $ui->renderer();
206  $lng = $this->lng;
207  $ctrl = $this->ctrl;
208 
210 
211  $shared_objects = $access_handler->getObjectsIShare(false);
212 
213  $items = [];
214 
215  foreach (ilObjPortfolio::getPortfoliosOfUser($this->user_id) as $port) {
216  // icon
217  $icon = $f->symbol()->icon()->custom(
218  ilUtil::getImagePath("standard/icon_prtf.svg"),
219  $lng->txt("obj_portfolio"),
220  "medium"
221  );
222  if (!$port["is_online"] || !in_array($port["id"], $shared_objects)) {
223  $icon = $icon->withDisabled(true);
224  }
225 
226  // actions
227  $prtf_path = array(get_class($this), "ilobjportfoliogui");
228  $action = [];
229  // ... preview
230  $ctrl->setParameterByClass("ilobjportfoliogui", "prt_id", $port["id"]);
231  $preview_action = $ctrl->getLinkTargetByClass($prtf_path, "preview");
232  $action[] = $f->button()->shy($lng->txt("preview"), $preview_action);
233  // ... edit content
234  $action[] = $f->button()->shy(
235  $lng->txt("prtf_edit_content"),
236  $ctrl->getLinkTargetByClass($prtf_path, "view")
237  );
238  $ctrl->setParameter($this, "prt_id", $port["id"]);
239  if ($port["is_online"]) {
240  // ... set offline
241  $action[] = $f->button()->shy(
242  $lng->txt("prtf_set_offline"),
243  $ctrl->getLinkTarget($this, "setOffline")
244  );
245  } else {
246  // ... set online
247  $action[] = $f->button()->shy(
248  $lng->txt("prtf_set_online"),
249  $ctrl->getLinkTarget($this, "setOnline")
250  );
251  }
252  $ctrl->setParameter($this, "prt_id", "");
253  // ... settings
254  $action[] = $f->button()->shy(
255  $lng->txt("settings"),
256  $ctrl->getLinkTargetByClass($prtf_path, "edit")
257  );
258  // ... sharing
259  $action[] = $f->button()->shy(
260  $lng->txt("wsp_permissions"),
261  $ctrl->getLinkTargetByClass(array(get_class($this), "ilobjportfoliogui", "ilWorkspaceAccessGUI"), "share")
262  );
263  $ctrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
264 
265  if ($port["is_online"]) {
266  if (!$port["is_default"]) {
267  // ... set as default
268  $ctrl->setParameter($this, "prt_id", $port["id"]);
269 
270  $action[] = $f->button()->shy(
271  $lng->txt("prtf_set_as_default"),
272  $ctrl->getLinkTarget($this, "setDefaultConfirmation")
273  );
274 
275  $ctrl->setParameter($this, "prt_id", "");
276  } else {
277  // ... unset as default
278  $action[] = $f->button()->shy(
279  $lng->txt("prtf_unset_as_default"),
280  $ctrl->getLinkTarget($this, "unsetDefault")
281  );
282  }
283  }
284  // ... delete
285  $ctrl->setParameter($this, "prtf", $port["id"]);
286  $action[] = $f->button()->shy(
287  $lng->txt("delete"),
288  $ctrl->getLinkTarget($this, "confirmPortfolioDeletion")
289  );
290  $ctrl->setParameter($this, "prtf", "");
291  $actions = $f->dropdown()->standard($action);
292 
293 
294  // properties
295  $props = [];
296  // ... online
297  $props[$lng->txt("online")] = ($port["is_online"])
298  ? $lng->txt("yes")
299  : $lng->txt("no");
300  //: "<span class='il_ItemAlertProperty'>" . $lng->txt("no") . "</span>";
301  // ... shared
302  $props[$lng->txt("wsp_status_shared")] = (in_array($port["id"], $shared_objects))
303  ? $lng->txt("yes")
304  : $lng->txt("no");
305  //: "<span class='il_ItemAlertProperty'>" . $lng->txt("no") . "</span>";
306  // ... default (my profile)
307  if ($port["is_default"]) {
308  $props[$lng->txt("prtf_default_portfolio")] = $lng->txt("yes");
309  }
310  // ... handed in
311  // exercise portfolio?
312  $exercises = ilPortfolioExerciseGUI::checkExercise($this->user_id, $port["id"], false, true);
313  $visible_to_tutor = false;
314  foreach ($exercises as $exinfo) {
315  if ($exinfo["submitted"]) {
316  $visible_to_tutor = true;
317  $props[$exinfo["ass_title"]] =
318  str_replace("$1", $exinfo["submitted_date"], $lng->txt("prtf_submission_on"));
319  } else {
320  $props[$exinfo["ass_title"]] = $lng->txt("prtf_no_submission");
321  //$props[$exinfo["ass_title"]] = "<span class='il_ItemAlertProperty'>" . $lng->txt("prtf_no_submission") . "</span>";
322  }
323  }
324  if ($visible_to_tutor) {
325  $props[$lng->txt("prtf_visible_for_tutor")] = $lng->txt("yes");
326  }
327 
328 
329  $items[] = $f->item()->standard($f->button()->shy($port["title"], $preview_action))
330  ->withActions($actions)
331  ->withProperties($props)
332  ->withLeadIcon($icon);
333  }
334 
335 
336  $std_list = $f->panel()->listing()->standard($lng->txt("prtf_portfolios"), array(
337  $f->item()->group("", $items)
338  ));
339 
340  return $renderer->render($std_list);
341  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
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 checkExercise(int $a_user_id, int $a_obj_id, bool $a_add_submit=false, bool $as_array=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
ilPortfolioAccessHandler $access_handler
static getPortfoliosOfUser(int $a_user_id)
Get portfolios of user.
getObjectsIShare(bool $a_online_only=true)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectSendMailToSharer()

ilPortfolioRepositoryGUI::redirectSendMailToSharer ( )

Definition at line 610 of file class.ilPortfolioRepositoryGUI.php.

References ilLink\_getStaticLink(), ilObjUser\_lookupLogin(), ilMailFormCall\getRedirectTarget(), ILIAS\Repository\lng(), ilUtil\redirect(), and ilMailFormCall\SIGNATURE_KEY.

610  : void
611  {
612  $owner_id = $this->port_request->getOwnerId();
613  $prt_id = $this->port_request->getPortfolioId();
614 
615  if ($owner_id > 0) {
616  $login = ilObjUser::_lookupLogin($owner_id);
617 
618  // #16530 - see ilObjCourseGUI::createMailSignature
619  $sig = chr(13) . chr(10) . chr(13) . chr(10);
620  $sig .= $this->lng->txt('prtf_permanent_link');
621  $sig .= chr(13) . chr(10) . chr(13) . chr(10);
622  $sig .= ilLink::_getStaticLink($prt_id, "prtf", true);
623  $sig = rawurlencode(base64_encode($sig));
624 
626  $this,
627  "showotherFilter",
628  array(),
629  array(
630  'type' => 'new',
631  'rcp_to' => $login,
633  )
634  ));
635  }
636  }
static redirect(string $a_script)
final const SIGNATURE_KEY
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

◆ resetShareFilter()

ilPortfolioRepositoryGUI::resetShareFilter ( )
protected

Definition at line 601 of file class.ilPortfolioRepositoryGUI.php.

References showOther().

601  : void
602  {
603  $tbl = new ilWorkspaceShareTableGUI($this, "showOther", $this->getWorkspaceAccess());
604  $tbl->resetOffset();
605  $tbl->resetFilter();
606 
607  $this->showOther(false);
608  }
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ saveTitles()

ilPortfolioRepositoryGUI::saveTitles ( )
protected

Definition at line 377 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $id, $lng, checkAccess(), ilUtil\stripSlashes(), and ilLanguage\txt().

377  : void
378  {
379  $ilCtrl = $this->ctrl;
380  $lng = $this->lng;
381 
382  $titles = $this->port_request->getTitles();
383  $online = $this->port_request->getOnline();
384  foreach ($titles as $id => $title) {
385  if (trim($title) && $this->checkAccess("write", $id)) {
386  $portfolio = new ilObjPortfolio($id, false);
387  $portfolio->setTitle(ilUtil::stripSlashes($title));
388 
389  if (in_array($id, $online)) {
390  $portfolio->setOnline(true);
391  } else {
392  $portfolio->setOnline(false);
393  }
394 
395  $portfolio->update();
396  }
397  }
398 
399  $this->tpl->setOnScreenMessage('success', $lng->txt("saved_successfully"), true);
400  $ilCtrl->redirect($this, "show");
401  }
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 stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ setDefault()

ilPortfolioRepositoryGUI::setDefault ( int  $a_prtf_id)
protected

Definition at line 541 of file class.ilPortfolioRepositoryGUI.php.

References $access_handler, $ctrl, $lng, $user, checkAccess(), ilObjUser\setPref(), ilObjPortfolio\setUserDefault(), and ilLanguage\txt().

Referenced by setDefaultConfirmation(), setDefaultGlobal(), and setDefaultRegistered().

541  : void
542  {
543  $ilCtrl = $this->ctrl;
544  $lng = $this->lng;
545  $ilUser = $this->user;
546 
547  if ($a_prtf_id && $this->checkAccess("write")) {
548  // #12845
549  if ($this->access_handler->hasGlobalPermission($a_prtf_id)) {
550  $ilUser->setPref("public_profile", "g");
551  $ilUser->writePrefs();
552  } elseif ($this->access_handler->hasRegisteredPermission($a_prtf_id)) {
553  $ilUser->setPref("public_profile", "y");
554  $ilUser->writePrefs();
555  } else {
556  return;
557  }
558  ilObjPortfolio::setUserDefault($this->user_id, $a_prtf_id);
559  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
560  }
561  $ilCtrl->redirect($this, "show");
562  }
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 setUserDefault(int $a_user_id, ?int $a_portfolio_id=null)
Set the user default portfolio.
setPref(string $a_keyword, ?string $a_value)
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDefaultConfirmation()

ilPortfolioRepositoryGUI::setDefaultConfirmation ( )
protected

Confirm sharing when setting default.

Definition at line 473 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $ilSetting, $lng, $settings, $tabs, $tpl, checkAccess(), ilGlobalTemplateInterface\setContent(), setDefault(), and ilLanguage\txt().

473  : void
474  {
475  $ilCtrl = $this->ctrl;
476  $lng = $this->lng;
477  $tpl = $this->tpl;
478  $ilTabs = $this->tabs;
480 
481  $prtf_id = $this->port_request->getPortfolioId();
482 
483  if ($prtf_id && $this->checkAccess("write")) {
484  // if already shared, no need to ask again
485  if ($this->access_handler->hasRegisteredPermission($prtf_id) ||
486  $this->access_handler->hasGlobalPermission($prtf_id)) {
487  $this->setDefault($prtf_id);
488  return;
489  }
490 
491  $ilTabs->clearTargets();
492  $ilTabs->setBackTarget(
493  $lng->txt("cancel"),
494  $ilCtrl->getLinkTarget($this, "show")
495  );
496 
497  $ilCtrl->setParameter($this, "prt_id", $prtf_id);
498 
499  // #20310
500  if (!$ilSetting->get("enable_global_profiles")) {
501  $ilCtrl->redirect($this, "setDefaultRegistered");
502  }
503 
504  $cgui = new ilConfirmationGUI();
505  $cgui->setFormAction($ilCtrl->getFormAction($this));
506  $cgui->setHeaderText($lng->txt("prtf_set_default_publish_confirmation"));
507  $cgui->setCancel($lng->txt("prtf_set_default_publish_global"), "setDefaultGlobal");
508  $cgui->setConfirm($lng->txt("prtf_set_default_publish_registered"), "setDefaultRegistered");
509  $tpl->setContent($cgui->getHTML());
510 
511  return;
512  }
513 
514  $ilCtrl->redirect($this, "show");
515  }
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...
setContent(string $a_html)
Sets content for standard template.
global $ilSetting
Definition: privfeed.php:18
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
+ Here is the call graph for this function:

◆ setDefaultGlobal()

ilPortfolioRepositoryGUI::setDefaultGlobal ( )
protected

Definition at line 517 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, checkAccess(), ilWorkspaceAccessGUI\PERMISSION_ALL, and setDefault().

517  : void
518  {
519  $ilCtrl = $this->ctrl;
520 
521  $prtf_id = $this->port_request->getPortfolioId();
522  if ($prtf_id && $this->checkAccess("write")) {
523  $this->access_handler->addMissingPermissionForObjects($prtf_id, [ilWorkspaceAccessGUI::PERMISSION_ALL]);
524  $this->setDefault($prtf_id);
525  }
526  $ilCtrl->redirect($this, "show");
527  }
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
+ Here is the call graph for this function:

◆ setDefaultRegistered()

ilPortfolioRepositoryGUI::setDefaultRegistered ( )
protected

Definition at line 529 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, checkAccess(), ilWorkspaceAccessGUI\PERMISSION_REGISTERED, and setDefault().

529  : void
530  {
531  $ilCtrl = $this->ctrl;
532 
533  $prtf_id = $this->port_request->getPortfolioId();
534  if ($prtf_id && $this->checkAccess("write")) {
535  $this->access_handler->addMissingPermissionForObjects($prtf_id, [ilWorkspaceAccessGUI::PERMISSION_REGISTERED]);
536  $this->setDefault($prtf_id);
537  }
538  $ilCtrl->redirect($this, "show");
539  }
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
+ Here is the call graph for this function:

◆ setLocator()

ilPortfolioRepositoryGUI::setLocator ( )
protected

Definition at line 146 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $lng, $locator, $tpl, ilGlobalTemplateInterface\setLocator(), and ilLanguage\txt().

Referenced by executeCommand().

146  : void
147  {
148  $ilLocator = $this->locator;
149  $lng = $this->lng;
150  $ilCtrl = $this->ctrl;
151  $tpl = $this->tpl;
152 
153  $ilLocator->addItem(
154  $lng->txt("portfolio"),
155  $ilCtrl->getLinkTarget($this, "show")
156  );
157 
158  $tpl->setLocator();
159  }
setLocator()
Insert locator.
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOffline()

ilPortfolioRepositoryGUI::setOffline ( )
protected

Definition at line 360 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $lng, ilObject\_lookupOwner(), and ilLanguage\txt().

360  : void
361  {
362  $ilCtrl = $this->ctrl;
363  $lng = $this->lng;
364 
365  $prt_id = $this->port_request->getPortfolioId();
366  if (ilObjPortfolio::_lookupOwner($prt_id) === $this->user_id) {
367  $portfolio = new ilObjPortfolio($prt_id, false);
368  $portfolio->setOnline(false);
369  $portfolio->update();
370  $this->tpl->setOnScreenMessage('success', $lng->txt("saved_successfully"), true);
371  $ilCtrl->redirect($this, "show");
372  }
373  $ilCtrl->redirect($this, "show");
374  }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
+ Here is the call graph for this function:

◆ setOnline()

ilPortfolioRepositoryGUI::setOnline ( )
protected

Definition at line 344 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $lng, ilObject\_lookupOwner(), and ilLanguage\txt().

344  : void
345  {
346  $ilCtrl = $this->ctrl;
347  $lng = $this->lng;
348 
349  $prt_id = $this->port_request->getPortfolioId();
350  if (ilObjPortfolio::_lookupOwner($prt_id) === $this->user_id) {
351  $portfolio = new ilObjPortfolio($prt_id, false);
352  $portfolio->setOnline(true);
353  $portfolio->update();
354  $this->tpl->setOnScreenMessage('success', $lng->txt("saved_successfully"), true);
355  $ilCtrl->redirect($this, "show");
356  }
357  $ilCtrl->redirect($this, "show");
358  }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
+ Here is the call graph for this function:

◆ setTabs()

ilPortfolioRepositoryGUI::setTabs ( )

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

References $ctrl, $help, $lng, $tabs, ilHelpGUI\setScreenIdComponent(), and ilLanguage\txt().

Referenced by executeCommand().

122  : void
123  {
124  $ilTabs = $this->tabs;
125  $lng = $this->lng;
126  $ilCtrl = $this->ctrl;
127  $ilHelp = $this->help;
128 
129  $ilHelp->setScreenIdComponent("prtf");
130 
131  $ilTabs->addTab(
132  "mypf",
133  $lng->txt("prtf_tab_portfolios"),
134  $ilCtrl->getLinkTarget($this)
135  );
136 
137  $ilTabs->addTab(
138  "otpf",
139  $lng->txt("prtf_tab_other_users"),
140  $ilCtrl->getLinkTarget($this, "showotherFilter")
141  );
142 
143  $ilTabs->activateTab("mypf");
144  }
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...
setScreenIdComponent(string $a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilPortfolioRepositoryGUI::show ( )
protected

Definition at line 177 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $toolbar, $tpl, ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), getPortfolioList(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

177  : void
178  {
179  $tpl = $this->tpl;
180  $ilToolbar = $this->toolbar;
181  $ilCtrl = $this->ctrl;
182 
183  $this->gui->button(
184  $this->lng->txt("prtf_add_portfolio"),
185  $ilCtrl->getLinkTargetByClass("ilObjPortfolioGUI", "create")
186  )->toToolbar(true);
187 
189  if (count($templates) > 0) {
190  $this->gui->button(
191  $this->lng->txt("prtf_add_portfolio_from_template"),
192  $ilCtrl->getLinkTargetByClass("ilObjPortfolioGUI", "createFromTemplate")
193  )->toToolbar(true);
194  }
195 
196  $portfolio_list = $this->getPortfolioList();
197 
198  $tpl->setContent($portfolio_list);
199  }
static getAvailablePortfolioTemplates(string $a_permission="read")
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ showOther()

ilPortfolioRepositoryGUI::showOther ( bool  $a_load_data = true)
protected

Definition at line 582 of file class.ilPortfolioRepositoryGUI.php.

References $tabs, $tpl, ilTabsGUI\activateTab(), and ilGlobalTemplateInterface\setContent().

Referenced by applyShareFilter(), resetShareFilter(), and showOtherFilter().

584  : void {
585  $tpl = $this->tpl;
586  $ilTabs = $this->tabs;
587  $ilTabs->activateTab("otpf");
588  $tbl = new ilWorkspaceShareTableGUI($this, "showOther", $this->getWorkspaceAccess(), null, $a_load_data);
589  $tpl->setContent($tbl->getHTML());
590  }
Workspace share handler table GUI class.
setContent(string $a_html)
Sets content for standard template.
activateTab(string $a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showOtherFilter()

ilPortfolioRepositoryGUI::showOtherFilter ( )
protected

Definition at line 577 of file class.ilPortfolioRepositoryGUI.php.

References showOther().

577  : void
578  {
579  $this->showOther(false);
580  }
+ Here is the call graph for this function:

◆ unsetDefault()

ilPortfolioRepositoryGUI::unsetDefault ( )
protected

Definition at line 453 of file class.ilPortfolioRepositoryGUI.php.

References $ctrl, $lng, $user, checkAccess(), ilObjUser\setPref(), ilObjPortfolio\setUserDefault(), and ilLanguage\txt().

453  : void
454  {
455  $ilCtrl = $this->ctrl;
456  $lng = $this->lng;
457  $ilUser = $this->user;
458 
459  if ($this->checkAccess("write")) {
460  // #12845
461  $ilUser->setPref("public_profile", "n");
462  $ilUser->writePrefs();
463 
464  ilObjPortfolio::setUserDefault($this->user_id);
465  $this->tpl->setOnScreenMessage('success', $lng->txt("prtf_unset_default_share_info"), true);
466  }
467  $ilCtrl->redirect($this, "show");
468  }
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 setUserDefault(int $a_user_id, ?int $a_portfolio_id=null)
Set the user default portfolio.
setPref(string $a_keyword, ?string $a_value)
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
+ Here is the call graph for this function:

Field Documentation

◆ $access_handler

ilPortfolioAccessHandler ilPortfolioRepositoryGUI::$access_handler
protected

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

Referenced by setDefault().

◆ $ctrl

◆ $gui

ILIAS Portfolio InternalGUIService ilPortfolioRepositoryGUI::$gui
protected

Definition at line 29 of file class.ilPortfolioRepositoryGUI.php.

◆ $help

ilHelpGUI ilPortfolioRepositoryGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

◆ $locator

ilLocatorGUI ilPortfolioRepositoryGUI::$locator
protected

Definition at line 37 of file class.ilPortfolioRepositoryGUI.php.

Referenced by setLocator().

◆ $port_request

StandardGUIRequest ilPortfolioRepositoryGUI::$port_request
protected

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

◆ $settings

ilSetting ilPortfolioRepositoryGUI::$settings
protected

Definition at line 39 of file class.ilPortfolioRepositoryGUI.php.

Referenced by setDefaultConfirmation().

◆ $tabs

ilTabsGUI ilPortfolioRepositoryGUI::$tabs
protected

◆ $toolbar

ilToolbarGUI ilPortfolioRepositoryGUI::$toolbar
protected

Definition at line 38 of file class.ilPortfolioRepositoryGUI.php.

Referenced by show().

◆ $tpl

◆ $ui

ILIAS DI UIServices ilPortfolioRepositoryGUI::$ui
protected

Definition at line 42 of file class.ilPortfolioRepositoryGUI.php.

Referenced by getPortfolioList().

◆ $user

ilObjUser ilPortfolioRepositoryGUI::$user
protected

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

Referenced by setDefault(), and unsetDefault().

◆ $user_id

int ilPortfolioRepositoryGUI::$user_id
protected

Definition at line 40 of file class.ilPortfolioRepositoryGUI.php.

Referenced by deletePortfolios().


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