4 include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolio.php');
75 $this->lng = $DIC->language();
76 $this->
user = $DIC->user();
77 $this->ctrl = $DIC->ctrl();
78 $this->tpl = $DIC[
"tpl"];
79 $this->tabs = $DIC->tabs();
80 $this->help = $DIC[
"ilHelp"];
81 $this->locator = $DIC[
"ilLocator"];
82 $this->toolbar = $DIC->toolbar();
84 $this->ui = $DIC->ui();
85 $lng = $DIC->language();
88 $lng->loadLanguageModule(
"prtf");
89 $lng->loadLanguageModule(
"user");
91 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
94 $this->user_id =
$ilUser->getId();
104 $next_class =
$ilCtrl->getNextClass($this);
105 $cmd =
$ilCtrl->getCmd(
"show");
107 $tpl->setTitle(
$lng->txt(
"portfolio"));
110 $lng->txt(
"portfolio")
113 switch ($next_class) {
114 case "ilobjportfoliogui":
116 include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolioGUI.php');
119 if ($cmd !=
"preview") {
122 if ((
int)
$_GET[
"exc_back_ref_id"] > 0) {
123 include_once(
"./Services/Link/classes/class.ilLink.php");
126 $ilTabs->setBack2Target(
$lng->txt(
"prtf_tab_portfolios"),
$ilCtrl->getLinkTarget($this,
"show"));
150 $ilHelp->setScreenIdComponent(
"prtf");
154 $lng->txt(
"prtf_tab_portfolios"),
160 $lng->txt(
"prtf_tab_other_users"),
161 $ilCtrl->getLinkTarget($this,
"showotherFilter")
164 $ilTabs->activateTab(
"mypf");
175 $lng->txt(
"portfolio"),
176 $ilCtrl->getLinkTarget($this,
"show")
182 protected function checkAccess($a_permission, $a_portfolio_id = null)
184 if ($a_portfolio_id) {
185 return $this->access_handler->checkAccess($a_permission,
"", $a_portfolio_id);
203 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
205 $button->setCaption(
"prtf_add_portfolio");
206 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
"ilObjPortfolioGUI",
"create"));
207 $ilToolbar->addButtonInstance($button);
223 $renderer =
$ui->renderer();
235 $icon =
$f->icon()->custom(
237 $lng->txt(
"obj_portfolio"),
240 if (!$port[
"is_online"] || !in_array($port[
"id"], $shared_objects)) {
241 $icon = $icon->withDisabled(
true);
245 $prtf_path = array(get_class($this),
"ilobjportfoliogui");
248 $ctrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id", $port[
"id"]);
249 $preview_action =
$ctrl->getLinkTargetByClass($prtf_path,
"preview");
250 $action[] =
$f->button()->shy(
$lng->txt(
"user_profile_preview"), $preview_action);
253 $lng->txt(
"prtf_edit_content"),
254 $ctrl->getLinkTargetByClass($prtf_path,
"view")
256 $ctrl->setParameter($this,
"prt_id", $port[
"id"]);
257 if ($port[
"is_online"]) {
260 $lng->txt(
"prtf_set_offline"),
261 $ctrl->getLinkTarget($this,
"setOffline")
266 $lng->txt(
"prtf_set_online"),
267 $ctrl->getLinkTarget($this,
"setOnline")
270 $ctrl->setParameter($this,
"prt_id",
"");
273 $lng->txt(
"settings"),
274 $ctrl->getLinkTargetByClass($prtf_path,
"edit")
278 $lng->txt(
"wsp_permissions"),
279 $ctrl->getLinkTargetByClass(array(get_class($this),
"ilobjportfoliogui",
"ilWorkspaceAccessGUI"),
"share")
281 $ctrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id",
"");
283 if ($port[
"is_online"]) {
284 if (!$port[
"is_default"]) {
286 $ctrl->setParameter($this,
"prt_id", $port[
"id"]);
289 $lng->txt(
"prtf_set_as_default"),
290 $ctrl->getLinkTarget($this,
"setDefaultConfirmation")
293 $ctrl->setParameter($this,
"prt_id",
"");
297 $lng->txt(
"prtf_unset_as_default"),
298 $ctrl->getLinkTarget($this,
"unsetDefault")
303 $ctrl->setParameter($this,
"prtfs[]", $port[
"id"]);
306 $ctrl->getLinkTarget($this,
"confirmPortfolioDeletion")
308 $ctrl->setParameter($this,
"prtfs[]",
"");
309 $actions =
$f->dropdown()->standard(
$action);
315 $props[
$lng->txt(
"online")] = ($port[
"is_online"])
317 :
"<span class='il_ItemAlertProperty'>" .
$lng->txt(
"no") .
"</span>";
319 $props[
$lng->txt(
"wsp_status_shared")] = (in_array($port[
"id"], $shared_objects))
321 :
"<span class='il_ItemAlertProperty'>" .
$lng->txt(
"no") .
"</span>";
323 if ($port[
"is_default"]) {
324 $props[
$lng->txt(
"prtf_default_portfolio")] =
$lng->txt(
"yes");
328 include_once
"Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
330 foreach ($exercises as $exinfo) {
331 if ($exinfo[
"submitted"]) {
332 $props[$exinfo[
"ass_title"]] =
333 str_replace(
"$1", $exinfo[
"submitted_date"],
$lng->txt(
"prtf_submission_on"));
335 $props[$exinfo[
"ass_title"]] =
"<span class='il_ItemAlertProperty'>" .
$lng->txt(
"prtf_no_submission") .
"</span>";
340 $items[] =
$f->item()->standard(
$f->button()->shy($port[
"title"], $preview_action))
341 ->withActions($actions)
342 ->withProperties($props)
343 ->withLeadIcon($icon);
347 $std_list =
$f->panel()->listing()->standard(
$lng->txt(
"prtf_portfolios"), array(
348 $f->item()->group(
"", $items)
351 return $renderer->render($std_list);
363 $prt_id = (int)
$_GET[
"prt_id"];
366 $portfolio->setOnline(
true);
367 $portfolio->update();
368 ilUtil::sendSuccess(
$lng->txt(
"saved_successfully"),
true);
369 $ilCtrl->redirect($this,
"show");
371 $ilCtrl->redirect($this,
"show");
382 $prt_id = (int)
$_GET[
"prt_id"];
385 $portfolio->setOnline(
false);
386 $portfolio->update();
387 ilUtil::sendSuccess(
$lng->txt(
"saved_successfully"),
true);
388 $ilCtrl->redirect($this,
"show");
390 $ilCtrl->redirect($this,
"show");
406 $portfolio->setOnline(
true);
408 $portfolio->setOnline(
false);
411 $portfolio->update();
416 ilUtil::sendSuccess(
$lng->txt(
"saved_successfully"),
true);
417 $ilCtrl->redirect($this,
"show");
426 $prtfs = $_REQUEST[
"prtfs"];
428 if (!is_array($prtfs) || count($prtfs) == 0) {
430 $ilCtrl->redirect($this,
"show");
432 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
434 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
435 $cgui->setHeaderText(
$lng->txt(
"prtf_sure_delete_portfolios"));
436 $cgui->setCancel(
$lng->txt(
"cancel"),
"show");
437 $cgui->setConfirm(
$lng->txt(
"delete"),
"deletePortfolios");
439 foreach ($prtfs as
$id) {
443 $tpl->setContent($cgui->getHTML());
452 if (is_array(
$_POST[
"prtfs"])) {
457 $this->access_handler->removePermission($id);
458 $portfolio->delete();
463 ilUtil::sendSuccess(
$lng->txt(
"prtf_portfolio_deleted"),
true);
464 $ilCtrl->redirect($this,
"show");
480 $ilUser->setPref(
"public_profile",
"n");
484 ilUtil::sendSuccess(
$lng->txt(
"prtf_unset_default_share_info"),
true);
486 $ilCtrl->redirect($this,
"show");
500 $prtf_id = (int) $_REQUEST[
"prt_id"];
504 if ($this->access_handler->hasRegisteredPermission($prtf_id) ||
505 $this->access_handler->hasGlobalPermission($prtf_id)) {
509 $ilTabs->clearTargets();
510 $ilTabs->setBackTarget(
512 $ilCtrl->getLinkTarget($this,
"show")
515 $ilCtrl->setParameter($this,
"prt_id", $prtf_id);
518 if (!
$ilSetting->get(
"enable_global_profiles")) {
519 $ilCtrl->redirect($this,
"setDefaultRegistered");
522 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
524 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
525 $cgui->setHeaderText(
$lng->txt(
"prtf_set_default_publish_confirmation"));
526 $cgui->setCancel(
$lng->txt(
"prtf_set_default_publish_global"),
"setDefaultGlobal");
527 $cgui->setConfirm(
$lng->txt(
"prtf_set_default_publish_registered"),
"setDefaultRegistered");
528 $tpl->setContent($cgui->getHTML());
533 $ilCtrl->redirect($this,
"show");
540 $prtf_id = (int) $_REQUEST[
"prt_id"];
545 $ilCtrl->redirect($this,
"show");
552 $prtf_id = (int) $_REQUEST[
"prt_id"];
557 $ilCtrl->redirect($this,
"show");
568 if ($this->access_handler->hasGlobalPermission($a_prtf_id)) {
569 $ilUser->setPref(
"public_profile",
"g");
571 } elseif ($this->access_handler->hasRegisteredPermission($a_prtf_id)) {
572 $ilUser->setPref(
"public_profile",
"y");
578 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
580 $ilCtrl->redirect($this,
"show");
598 $ilTabs->activateTab(
"otpf");
600 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
607 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
610 $tbl->writeFilterToSession();
617 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
checkAccess($a_permission, $a_portfolio_id=null)
getPortfolioList()
Get portfolio list.
static _lookupTitle($a_id)
static getPortfoliosOfUser($a_user_id)
Get views of user.
if(!array_key_exists('StateId', $_REQUEST)) $id
const PERMISSION_REGISTERED
Portfolio repository gui class.
static _lookupOwner($a_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Workspace share handler table GUI class.
Portfolio view gui class.
static checkExercise($a_user_id, $a_obj_id, $a_add_submit=false, $as_array=false)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
confirmPortfolioDeletion()
Access handler for portfolio.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Confirmation screen class.
setDefaultConfirmation()
Confirm sharing when setting default.
showOther($a_load_data=true)