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();
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");
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");
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
180 $ilToolbar = $this->toolbar;
181 $ilCtrl = $this->ctrl;
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")
196 $portfolio_list = $this->getPortfolioList();
198 $tpl->setContent($portfolio_list);
211 $shared_objects = $access_handler->getObjectsIShare(
false);
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");
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);
234 $action[] =
$f->button()->shy(
235 $lng->txt(
"prtf_edit_content"),
236 $ctrl->getLinkTargetByClass($prtf_path,
"view")
238 $ctrl->setParameter($this,
"prt_id", $port[
"id"]);
239 if ($port[
"is_online"]) {
241 $action[] =
$f->button()->shy(
242 $lng->txt(
"prtf_set_offline"),
243 $ctrl->getLinkTarget($this,
"setOffline")
247 $action[] =
$f->button()->shy(
248 $lng->txt(
"prtf_set_online"),
249 $ctrl->getLinkTarget($this,
"setOnline")
252 $ctrl->setParameter($this,
"prt_id",
"");
254 $action[] =
$f->button()->shy(
255 $lng->txt(
"settings"),
256 $ctrl->getLinkTargetByClass($prtf_path,
"edit")
259 $action[] =
$f->button()->shy(
260 $lng->txt(
"wsp_permissions"),
261 $ctrl->getLinkTargetByClass(array(get_class($this),
"ilobjportfoliogui",
"ilWorkspaceAccessGUI"),
"share")
263 $ctrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id",
"");
266 $ctrl->setParameter($this,
"prtf", $port[
"id"]);
267 $action[] =
$f->button()->shy(
269 $ctrl->getLinkTarget($this,
"confirmPortfolioDeletion")
271 $ctrl->setParameter($this,
"prtf",
"");
272 $actions =
$f->dropdown()->standard($action);
278 $props[
$lng->txt(
"online")] = ($port[
"is_online"])
283 $props[
$lng->txt(
"wsp_status_shared")] = (in_array($port[
"id"], $shared_objects))
288 if ($port[
"is_default"]) {
289 $props[
$lng->txt(
"prtf_default_portfolio")] =
$lng->txt(
"yes");
294 $visible_to_tutor =
false;
295 foreach ($exercises as $exinfo) {
296 if ($exinfo[
"submitted"]) {
297 $visible_to_tutor =
true;
298 $props[$exinfo[
"ass_title"]] =
299 str_replace(
"$1", $exinfo[
"submitted_date"],
$lng->txt(
"prtf_submission_on"));
301 $props[$exinfo[
"ass_title"]] =
$lng->txt(
"prtf_no_submission");
305 if ($visible_to_tutor) {
306 $props[
$lng->txt(
"prtf_visible_for_tutor")] =
$lng->txt(
"yes");
310 $items[] =
$f->item()->standard(
$f->button()->shy($port[
"title"], $preview_action))
311 ->withActions($actions)
312 ->withProperties($props)
313 ->withLeadIcon($icon);
317 $std_list =
$f->panel()->listing()->standard(
$lng->txt(
"prtf_portfolios"), array(
318 $f->item()->group(
"", $items)
327 $ilCtrl = $this->ctrl;
330 $prt_id = $this->port_request->getPortfolioId();
333 $portfolio->setOnline(
true);
334 $portfolio->update();
335 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"saved_successfully"),
true);
336 $ilCtrl->redirect($this,
"show");
338 $ilCtrl->redirect($this,
"show");
343 $ilCtrl = $this->ctrl;
346 $prt_id = $this->port_request->getPortfolioId();
349 $portfolio->setOnline(
false);
350 $portfolio->update();
351 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"saved_successfully"),
true);
352 $ilCtrl->redirect($this,
"show");
354 $ilCtrl->redirect($this,
"show");
360 $ilCtrl = $this->ctrl;
363 $titles = $this->port_request->getTitles();
364 $online = $this->port_request->getOnline();
365 foreach ($titles as
$id => $title) {
366 if (trim($title) && $this->checkAccess(
"write",
$id)) {
370 if (in_array(
$id, $online)) {
371 $portfolio->setOnline(
true);
373 $portfolio->setOnline(
false);
376 $portfolio->update();
380 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"saved_successfully"),
true);
381 $ilCtrl->redirect($this,
"show");
386 $ilCtrl = $this->ctrl;
390 $prtfs = $this->port_request->getPortfolioIds();
392 if (count($prtfs) === 0) {
393 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_checkbox"),
true);
394 $ilCtrl->redirect($this,
"show");
397 $cgui->setFormAction($ilCtrl->getFormAction($this));
398 $cgui->setHeaderText(
$lng->txt(
"prtf_sure_delete_portfolios"));
399 $cgui->setCancel(
$lng->txt(
"cancel"),
"show");
400 $cgui->setConfirm(
$lng->txt(
"delete"),
"deletePortfolios");
402 foreach ($prtfs as
$id) {
406 $tpl->setContent($cgui->getHTML());
413 $ilCtrl = $this->ctrl;
415 $port_ids = $this->port_request->getPortfolioIds();
416 foreach ($port_ids as
$id) {
417 if ($this->checkAccess(
"write",
$id)) {
419 if ($portfolio->getOwner() === $this->user_id) {
420 $this->access_handler->removePermission(
$id);
421 $portfolio->delete();
425 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"prtf_portfolio_deleted"),
true);
426 $ilCtrl->redirect($this,
"show");
438 $wsp_access = $this->access_handler;
450 $this->showOther(
false);
454 bool $a_load_data =
true
457 $ilTabs = $this->tabs;
458 $ilTabs->activateTab(
"otpf");
460 $tpl->setContent($tbl->getHTML());
467 $tbl->writeFilterToSession();
478 $this->showOther(
false);
483 $owner_id = $this->port_request->getOwnerId();
484 $prt_id = $this->port_request->getPortfolioId();
490 $sig = chr(13) . chr(10) . chr(13) . chr(10);
491 $sig .= $this->
lng->txt(
'prtf_permanent_link');
492 $sig .= chr(13) . chr(10) . chr(13) . chr(10);
494 $sig = rawurlencode(base64_encode($sig));
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
setScreenIdComponent(string $a_comp)
loadLanguageModule(string $a_module)
Load language module.
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 _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@ilCtrl_Calls ilObjPortfolioGUI: ilPortfolioPageGUI, ilPageObjectGUI @ilCtrl_Calls ilObjPortfolioGUI:...
static getAvailablePortfolioTemplates(string $a_permission="read")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPortfoliosOfUser(int $a_user_id)
Get portfolios of user.
static _lookupLogin(int $a_user_id)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static _lookupTitle(int $obj_id)
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
static checkExercise(int $a_user_id, int $a_obj_id, bool $a_add_submit=false, bool $as_array=false)
Portfolio repository gui class.
ILIAS Portfolio InternalGUIService $gui
checkAccess(string $a_permission, ?int $a_portfolio_id=null)
ilPortfolioAccessHandler $access_handler
showOther(bool $a_load_data=true)
StandardGUIRequest $port_request
redirectSendMailToSharer()
confirmPortfolioDeletion()
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static redirect(string $a_script)
Workspace share handler table GUI class.
setLocator()
Insert locator.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
if(!file_exists('../ilias.ini.php'))