41 protected \ILIAS\DI\UIServices
$ui;
47 $this->
lng = $DIC->language();
48 $this->
user = $DIC->user();
49 $this->
ctrl = $DIC->ctrl();
50 $this->tpl = $DIC[
"tpl"];
51 $this->
tabs = $DIC->tabs();
52 $this->
help = $DIC[
"ilHelp"];
53 $this->
locator = $DIC[
"ilLocator"];
54 $this->
toolbar = $DIC->toolbar();
56 $this->
ui = $DIC->ui();
57 $lng = $DIC->language();
65 $this->port_request = $DIC->portfolio()
70 $this->user_id =
$ilUser->getId();
80 if (!$this->access_handler->editPortfolios()) {
84 $next_class = $ilCtrl->getNextClass($this);
85 $cmd = $ilCtrl->getCmd(
"show");
90 $lng->
txt(
"portfolio")
93 switch ($next_class) {
94 case "ilobjportfoliogui":
98 if ($cmd !==
"preview") {
101 $exercise_back_ref_id = $this->port_request->getExcBackRefId();
102 if ($exercise_back_ref_id > 0) {
105 $ilTabs->setBack2Target($lng->
txt(
"prtf_tab_portfolios"), $ilCtrl->getLinkTarget($this,
"show"));
109 $ilCtrl->forwardCommand($gui);
131 $lng->
txt(
"prtf_tab_portfolios"),
132 $ilCtrl->getLinkTarget($this)
137 $lng->
txt(
"prtf_tab_other_users"),
138 $ilCtrl->getLinkTarget($this,
"showotherFilter")
141 $ilTabs->activateTab(
"mypf");
152 $lng->
txt(
"portfolio"),
153 $ilCtrl->getLinkTarget($this,
"show")
160 string $a_permission,
161 ?
int $a_portfolio_id = null
163 if ($a_portfolio_id) {
164 return $this->access_handler->checkAccess($a_permission,
"", $a_portfolio_id);
175 protected function show(): void
182 $button->setCaption(
"prtf_add_portfolio");
183 $button->setUrl($ilCtrl->getLinkTargetByClass(
"ilObjPortfolioGUI",
"create"));
184 $ilToolbar->addButtonInstance($button);
194 $renderer = $ui->renderer();
206 $icon =
$f->symbol()->icon()->custom(
208 $lng->
txt(
"obj_portfolio"),
211 if (!$port[
"is_online"] || !in_array($port[
"id"], $shared_objects)) {
212 $icon = $icon->withDisabled(
true);
216 $prtf_path = array(get_class($this),
"ilobjportfoliogui");
221 $action[] =
$f->button()->shy($lng->
txt(
"preview"), $preview_action);
223 $action[] =
$f->button()->shy(
224 $lng->
txt(
"prtf_edit_content"),
228 if ($port[
"is_online"]) {
230 $action[] =
$f->button()->shy(
231 $lng->
txt(
"prtf_set_offline"),
236 $action[] =
$f->button()->shy(
237 $lng->
txt(
"prtf_set_online"),
243 $action[] =
$f->button()->shy(
244 $lng->
txt(
"settings"),
248 $action[] =
$f->button()->shy(
249 $lng->
txt(
"wsp_permissions"),
250 $ctrl->
getLinkTargetByClass(array(get_class($this),
"ilobjportfoliogui",
"ilWorkspaceAccessGUI"),
"share")
254 if ($port[
"is_online"]) {
255 if (!$port[
"is_default"]) {
259 $action[] =
$f->button()->shy(
260 $lng->
txt(
"prtf_set_as_default"),
267 $action[] =
$f->button()->shy(
268 $lng->
txt(
"prtf_unset_as_default"),
275 $action[] =
$f->button()->shy(
280 $actions =
$f->dropdown()->standard($action);
286 $props[$lng->
txt(
"online")] = ($port[
"is_online"])
291 $props[$lng->
txt(
"wsp_status_shared")] = (in_array($port[
"id"], $shared_objects))
296 if ($port[
"is_default"]) {
297 $props[$lng->
txt(
"prtf_default_portfolio")] = $lng->
txt(
"yes");
302 foreach ($exercises as $exinfo) {
303 if ($exinfo[
"submitted"]) {
304 $props[$exinfo[
"ass_title"]] =
305 str_replace(
"$1", $exinfo[
"submitted_date"], $lng->
txt(
"prtf_submission_on"));
307 $props[$exinfo[
"ass_title"]] = $lng->
txt(
"prtf_no_submission");
313 $items[] =
$f->item()->standard(
$f->button()->shy($port[
"title"], $preview_action))
314 ->withActions($actions)
315 ->withProperties($props)
316 ->withLeadIcon($icon);
320 $std_list =
$f->panel()->listing()->standard($lng->
txt(
"prtf_portfolios"), array(
321 $f->item()->group(
"", $items)
324 return $renderer->render($std_list);
333 $prt_id = $this->port_request->getPortfolioId();
336 $portfolio->setOnline(
true);
337 $portfolio->update();
338 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"saved_successfully"),
true);
339 $ilCtrl->redirect($this,
"show");
341 $ilCtrl->redirect($this,
"show");
349 $prt_id = $this->port_request->getPortfolioId();
352 $portfolio->setOnline(
false);
353 $portfolio->update();
354 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"saved_successfully"),
true);
355 $ilCtrl->redirect($this,
"show");
357 $ilCtrl->redirect($this,
"show");
366 $titles = $this->port_request->getTitles();
367 $online = $this->port_request->getOnline();
368 foreach ($titles as
$id => $title) {
373 if (in_array(
$id, $online)) {
374 $portfolio->setOnline(
true);
376 $portfolio->setOnline(
false);
379 $portfolio->update();
383 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"saved_successfully"),
true);
384 $ilCtrl->redirect($this,
"show");
393 $prtfs = $this->port_request->getPortfolioIds();
395 if (count($prtfs) === 0) {
396 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
397 $ilCtrl->redirect($this,
"show");
400 $cgui->setFormAction($ilCtrl->getFormAction($this));
401 $cgui->setHeaderText($lng->
txt(
"prtf_sure_delete_portfolios"));
402 $cgui->setCancel($lng->
txt(
"cancel"),
"show");
403 $cgui->setConfirm($lng->
txt(
"delete"),
"deletePortfolios");
405 foreach ($prtfs as
$id) {
418 $port_ids = $this->port_request->getPortfolioIds();
419 foreach ($port_ids as
$id) {
423 $this->access_handler->removePermission($id);
424 $portfolio->delete();
428 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"prtf_portfolio_deleted"),
true);
429 $ilCtrl->redirect($this,
"show");
445 $ilUser->setPref(
"public_profile",
"n");
449 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"prtf_unset_default_share_info"),
true);
451 $ilCtrl->redirect($this,
"show");
465 $prtf_id = $this->port_request->getPortfolioId();
469 if ($this->access_handler->hasRegisteredPermission($prtf_id) ||
470 $this->access_handler->hasGlobalPermission($prtf_id)) {
475 $ilTabs->clearTargets();
476 $ilTabs->setBackTarget(
478 $ilCtrl->getLinkTarget($this,
"show")
481 $ilCtrl->setParameter($this,
"prt_id", $prtf_id);
484 if (!
$ilSetting->get(
"enable_global_profiles")) {
485 $ilCtrl->redirect($this,
"setDefaultRegistered");
489 $cgui->setFormAction($ilCtrl->getFormAction($this));
490 $cgui->setHeaderText($lng->
txt(
"prtf_set_default_publish_confirmation"));
491 $cgui->setCancel($lng->
txt(
"prtf_set_default_publish_global"),
"setDefaultGlobal");
492 $cgui->setConfirm($lng->
txt(
"prtf_set_default_publish_registered"),
"setDefaultRegistered");
498 $ilCtrl->redirect($this,
"show");
505 $prtf_id = $this->port_request->getPortfolioId();
510 $ilCtrl->redirect($this,
"show");
517 $prtf_id = $this->port_request->getPortfolioId();
522 $ilCtrl->redirect($this,
"show");
533 if ($this->access_handler->hasGlobalPermission($a_prtf_id)) {
534 $ilUser->setPref(
"public_profile",
"g");
536 } elseif ($this->access_handler->hasRegisteredPermission($a_prtf_id)) {
537 $ilUser->setPref(
"public_profile",
"y");
543 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"settings_saved"),
true);
545 $ilCtrl->redirect($this,
"show");
567 bool $a_load_data =
true 582 $tbl->writeFilterToSession();
StandardGUIRequest $port_request
setLocator()
Insert locator.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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="")
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)
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.
loadLanguageModule(string $a_module)
Load language module.
const PERMISSION_REGISTERED
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
Portfolio repository gui class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPortfolioAccessHandler $access_handler
Workspace share handler table GUI class.
Portfolio view gui class.
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
setDefault(int $a_prtf_id)
setScreenIdComponent(string $a_comp)
static getPortfoliosOfUser(int $a_user_id)
Get portfolios of user.
static setUserDefault(int $a_user_id, ?int $a_portfolio_id=null)
Set the user default portfolio.
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
getObjectsIShare(bool $a_online_only=true)
confirmPortfolioDeletion()
ilGlobalTemplateInterface $tpl
activateTab(string $a_id)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
showOther(bool $a_load_data=true)
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDefaultConfirmation()
Confirm sharing when setting default.