29 protected \ILIAS\Portfolio\InternalGUIService
$gui;
42 protected \ILIAS\DI\UIServices
$ui;
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();
57 $this->
ui = $DIC->ui();
58 $lng = $DIC->language();
59 $ilUser = $DIC->user();
66 $this->port_request = $DIC->portfolio()
71 $this->user_id = $ilUser->getId();
72 $this->gui = $DIC->portfolio()->internal()->gui();
82 if (!$this->access_handler->editPortfolios()) {
86 $next_class = $ilCtrl->getNextClass($this);
87 $cmd = $ilCtrl->getCmd(
"show");
92 $lng->
txt(
"portfolio")
95 switch ($next_class) {
96 case "ilobjportfoliogui":
100 if ($cmd !==
"preview") {
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));
107 $ilTabs->setBack2Target($lng->
txt(
"prtf_tab_portfolios"), $ilCtrl->getLinkTarget($this,
"show"));
111 $ilCtrl->forwardCommand($gui);
133 $lng->
txt(
"prtf_tab_portfolios"),
134 $ilCtrl->getLinkTarget($this)
139 $lng->
txt(
"prtf_tab_other_users"),
140 $ilCtrl->getLinkTarget($this,
"showotherFilter")
143 $ilTabs->activateTab(
"mypf");
154 $lng->
txt(
"portfolio"),
155 $ilCtrl->getLinkTarget($this,
"show")
162 string $a_permission,
163 ?
int $a_portfolio_id = null
165 if ($a_portfolio_id) {
166 return $this->access_handler->checkAccess($a_permission,
"", $a_portfolio_id);
177 protected function show(): void
184 $this->
lng->txt(
"prtf_add_portfolio"),
185 $ilCtrl->getLinkTargetByClass(
"ilObjPortfolioGUI",
"create")
189 if (count($templates) > 0) {
191 $this->
lng->txt(
"prtf_add_portfolio_from_template"),
192 $ilCtrl->getLinkTargetByClass(
"ilObjPortfolioGUI",
"createFromTemplate")
205 $renderer = $ui->renderer();
217 $icon =
$f->symbol()->icon()->custom(
219 $lng->
txt(
"obj_portfolio"),
222 if (!$port[
"is_online"] || !in_array($port[
"id"], $shared_objects)) {
223 $icon = $icon->withDisabled(
true);
227 $prtf_path = array(get_class($this),
"ilobjportfoliogui");
232 $action[] =
$f->button()->shy($lng->
txt(
"preview"), $preview_action);
234 $action[] =
$f->button()->shy(
235 $lng->
txt(
"prtf_edit_content"),
239 if ($port[
"is_online"]) {
241 $action[] =
$f->button()->shy(
242 $lng->
txt(
"prtf_set_offline"),
247 $action[] =
$f->button()->shy(
248 $lng->
txt(
"prtf_set_online"),
254 $action[] =
$f->button()->shy(
255 $lng->
txt(
"settings"),
259 $action[] =
$f->button()->shy(
260 $lng->
txt(
"wsp_permissions"),
261 $ctrl->
getLinkTargetByClass(array(get_class($this),
"ilobjportfoliogui",
"ilWorkspaceAccessGUI"),
"share")
265 if ($port[
"is_online"]) {
266 if (!$port[
"is_default"]) {
270 $action[] =
$f->button()->shy(
271 $lng->
txt(
"prtf_set_as_default"),
278 $action[] =
$f->button()->shy(
279 $lng->
txt(
"prtf_unset_as_default"),
286 $action[] =
$f->button()->shy(
291 $actions =
$f->dropdown()->standard($action);
297 $props[$lng->
txt(
"online")] = ($port[
"is_online"])
302 $props[$lng->
txt(
"wsp_status_shared")] = (in_array($port[
"id"], $shared_objects))
307 if ($port[
"is_default"]) {
308 $props[$lng->
txt(
"prtf_default_portfolio")] = $lng->
txt(
"yes");
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"));
320 $props[$exinfo[
"ass_title"]] = $lng->
txt(
"prtf_no_submission");
324 if ($visible_to_tutor) {
325 $props[$lng->
txt(
"prtf_visible_for_tutor")] = $lng->
txt(
"yes");
329 $items[] =
$f->item()->standard(
$f->button()->shy($port[
"title"], $preview_action))
330 ->withActions($actions)
331 ->withProperties($props)
332 ->withLeadIcon($icon);
336 $std_list =
$f->panel()->listing()->standard($lng->
txt(
"prtf_portfolios"), array(
337 $f->item()->group(
"", $items)
340 return $renderer->render($std_list);
349 $prt_id = $this->port_request->getPortfolioId();
352 $portfolio->setOnline(
true);
353 $portfolio->update();
354 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"saved_successfully"),
true);
355 $ilCtrl->redirect($this,
"show");
357 $ilCtrl->redirect($this,
"show");
365 $prt_id = $this->port_request->getPortfolioId();
368 $portfolio->setOnline(
false);
369 $portfolio->update();
370 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"saved_successfully"),
true);
371 $ilCtrl->redirect($this,
"show");
373 $ilCtrl->redirect($this,
"show");
382 $titles = $this->port_request->getTitles();
383 $online = $this->port_request->getOnline();
384 foreach ($titles as
$id => $title) {
389 if (in_array(
$id, $online)) {
390 $portfolio->setOnline(
true);
392 $portfolio->setOnline(
false);
395 $portfolio->update();
399 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"saved_successfully"),
true);
400 $ilCtrl->redirect($this,
"show");
409 $prtfs = $this->port_request->getPortfolioIds();
411 if (count($prtfs) === 0) {
412 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
413 $ilCtrl->redirect($this,
"show");
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");
421 foreach ($prtfs as
$id) {
434 $port_ids = $this->port_request->getPortfolioIds();
435 foreach ($port_ids as
$id) {
439 $this->access_handler->removePermission($id);
440 $portfolio->delete();
444 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"prtf_portfolio_deleted"),
true);
445 $ilCtrl->redirect($this,
"show");
461 $ilUser->
setPref(
"public_profile",
"n");
462 $ilUser->writePrefs();
465 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"prtf_unset_default_share_info"),
true);
467 $ilCtrl->redirect($this,
"show");
481 $prtf_id = $this->port_request->getPortfolioId();
485 if ($this->access_handler->hasRegisteredPermission($prtf_id) ||
486 $this->access_handler->hasGlobalPermission($prtf_id)) {
491 $ilTabs->clearTargets();
492 $ilTabs->setBackTarget(
494 $ilCtrl->getLinkTarget($this,
"show")
497 $ilCtrl->setParameter($this,
"prt_id", $prtf_id);
500 if (!
$ilSetting->get(
"enable_global_profiles")) {
501 $ilCtrl->redirect($this,
"setDefaultRegistered");
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");
514 $ilCtrl->redirect($this,
"show");
521 $prtf_id = $this->port_request->getPortfolioId();
526 $ilCtrl->redirect($this,
"show");
533 $prtf_id = $this->port_request->getPortfolioId();
538 $ilCtrl->redirect($this,
"show");
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();
559 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"settings_saved"),
true);
561 $ilCtrl->redirect($this,
"show");
583 bool $a_load_data =
true 596 $tbl->writeFilterToSession();
612 $owner_id = $this->port_request->getOwnerId();
613 $prt_id = $this->port_request->getPortfolioId();
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);
623 $sig = rawurlencode(base64_encode($sig));
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.
static getAvailablePortfolioTemplates(string $a_permission="read")
redirectSendMailToSharer()
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 _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
static setUserDefault(int $a_user_id, ?int $a_portfolio_id=null)
Set the user default portfolio.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
getObjectsIShare(bool $a_online_only=true)
setPref(string $a_keyword, ?string $a_value)
confirmPortfolioDeletion()
ilGlobalTemplateInterface $tpl
static redirect(string $a_script)
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
ILIAS Portfolio InternalGUIService $gui
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
setDefaultConfirmation()
Confirm sharing when setting default.
static _lookupLogin(int $a_user_id)