4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
22 function __construct($a_parent_obj, $a_parent_cmd, $a_user_id, $a_shared =
false)
26 $this->user_id = (int)$a_user_id;
27 $this->shared = (bool)$a_shared;
31 $this->
setTitle($lng->txt(
"prtf_portfolios"));
35 $this->
addColumn($this->lng->txt(
""),
"",
"1");
37 $this->
addColumn($this->lng->txt(
"title"),
"title",
"50%");
40 $this->
addColumn($this->lng->txt(
"online"),
"is_online");
41 $this->
addColumn($this->lng->txt(
"prtf_default_portfolio"),
"is_default");
43 $this->
addColumn($this->lng->txt(
"actions"));
46 $this->
setRowTemplate(
"tpl.portfolio_row.html",
"Services/Portfolio");
50 $this->
addMultiCommand(
"confirmPortfolioDeletion", $lng->txt(
"delete"));
52 $lng->txt(
"prtf_save_status_and_titles"));
57 $lng->loadLanguageModule(
"wsp");
59 include_once(
'./Services/Link/classes/class.ilLink.php');
66 include_once
"Services/Portfolio/classes/class.ilPortfolioAccessHandler.php";
69 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
75 $other = $access_handler->getSharedObjects($this->user_id);
76 foreach(
$data as $idx => $item)
78 if(!in_array($item[
"id"], $other))
85 $perms = $access_handler->getPermissions($item[
"id"]);
86 $data[$idx][
"password"] = (!in_array($ilUser->getId(), $perms) &&
95 $this->shared_objects = $access_handler->getObjectsIShare();
111 $this->tpl->setCurrentBlock(
"title_form");
112 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
114 $this->tpl->parseCurrentBlock();
116 if(in_array($a_set[
"id"], $this->shared_objects))
118 $this->tpl->setCurrentBlock(
"shared");
119 $this->tpl->setVariable(
"TXT_SHARED", $lng->txt(
"wsp_status_shared"));
120 $this->tpl->parseCurrentBlock();
123 $this->tpl->setCurrentBlock(
"chck");
124 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
125 $this->tpl->parseCurrentBlock();
127 $this->tpl->setCurrentBlock(
"edit");
128 $this->tpl->setVariable(
"VAL_ID", $a_set[
"id"]);
129 $this->tpl->setVariable(
"STATUS_ONLINE",
130 ($a_set[
"is_online"]) ?
" checked=\"checked\"" :
"");
131 $this->tpl->setVariable(
"VAL_DEFAULT",
132 ($a_set[
"is_default"]) ? $lng->txt(
"yes") :
"");
133 $this->tpl->parseCurrentBlock();
135 $ilCtrl->setParameter($this->parent_obj,
"prt_id", $a_set[
"id"]);
136 $this->tpl->setCurrentBlock(
"action");
138 $this->tpl->setVariable(
"URL_ACTION",
139 $ilCtrl->getLinkTarget($this->parent_obj,
"preview"));
140 $this->tpl->setVariable(
"TXT_ACTION", $lng->txt(
"user_profile_preview"));
141 $this->tpl->parseCurrentBlock();
143 $this->tpl->setVariable(
"URL_ACTION",
144 $ilCtrl->getLinkTarget($this->parent_obj,
"pages"));
145 $this->tpl->setVariable(
"TXT_ACTION", $lng->txt(
"prtf_edit_portfolio"));
146 $this->tpl->parseCurrentBlock();
148 if($a_set[
"is_online"])
150 if(!$a_set[
"is_default"])
152 $this->tpl->setVariable(
"URL_ACTION",
153 $ilCtrl->getLinkTarget($this->parent_obj,
"setDefaultConfirmation"));
154 $this->tpl->setVariable(
"TXT_ACTION", $lng->txt(
"prtf_set_as_default"));
155 $this->tpl->parseCurrentBlock();
159 $this->tpl->setVariable(
"URL_ACTION",
160 $ilCtrl->getLinkTarget($this->parent_obj,
"unsetDefault"));
161 $this->tpl->setVariable(
"TXT_ACTION", $lng->txt(
"prtf_unset_as_default"));
162 $this->tpl->parseCurrentBlock();
166 $ilCtrl->setParameter($this->parent_obj,
"prt_id",
"");
171 $this->tpl->setCurrentBlock(
"title_static");
172 $this->tpl->setVariable(
"VAL_TITLE", $a_set[
"title"]);
173 $this->tpl->parseCurrentBlock();
175 if($a_set[
"password"])
177 $this->tpl->setCurrentBlock(
"shared");
178 $this->tpl->setVariable(
"TXT_SHARED", $lng->txt(
"wsp_password_protected_resource"));
179 $this->tpl->parseCurrentBlock();
184 $this->tpl->setCurrentBlock(
"action");
185 $this->tpl->setVariable(
"URL_ACTION", $link);
186 $this->tpl->setVariable(
"TXT_ACTION", $lng->txt(
"view"));
187 $this->tpl->parseCurrentBlock();