38 $this->
default = $a_value;
53 $this->
setDefault((
bool) $a_row[
"is_default"]);
68 $a_fields[
"is_default"] = array(
"integer", $this->
isDefault());
75 foreach ($pages as $page) {
77 $page_obj->setPortfolioId($this->
id);
92 ?
int $a_portfolio_id = null
96 $ilDB = $DIC->database();
99 foreach (self::getPortfoliosOfUser($a_user_id) as $item) {
100 $all[] = $item[
"id"];
103 $ilDB->manipulate(
"UPDATE usr_portfolio" .
104 " SET is_default = " .
$ilDB->quote(
false,
"integer") .
105 " WHERE " .
$ilDB->in(
"id", $all,
"",
"integer"));
108 if ($a_portfolio_id) {
109 $ilDB->manipulate(
"UPDATE usr_portfolio" .
110 " SET is_default = " .
$ilDB->quote(
true,
"integer") .
111 " WHERE id = " .
$ilDB->quote($a_portfolio_id,
"integer"));
124 $ilDB = $DIC->database();
126 $set =
$ilDB->query(
"SELECT up.*,od.title,od.description" .
127 " FROM usr_portfolio up" .
128 " JOIN object_data od ON (up.id = od.obj_id)" .
129 " WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer") .
130 " AND od.type = " .
$ilDB->quote(
"prtf",
"text") .
131 " ORDER BY od.title");
133 while ($rec =
$ilDB->fetchAssoc($set)) {
146 $ilDB = $DIC->database();
153 $set =
$ilDB->query(
"SELECT up.id FROM usr_portfolio up" .
154 " JOIN object_data od ON (up.id = od.obj_id)" .
155 " WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer") .
156 " AND up.is_default = " .
$ilDB->quote(1,
"integer"));
159 return (
int)
$res[
"id"];
169 $all = self::getPortfoliosOfUser($a_user_id);
173 foreach ($all as $item) {
174 $access_handler->removePermission($item[
"id"]);
176 $portfolio =
new self($item[
"id"],
false);
177 $portfolio->delete();
185 parent::deleteImage();
192 if (parent::uploadImage($a_upload)) {
205 ?
string $a_back_url = null
213 $params = array(
"back_url" => rawurlencode($a_back_url));
216 foreach ($access_handler->getShardObjectsDataForUserIds($a_owner_ids) as $owner_id => $items) {
236 if (!$this->notes->domain()->commentsActive($this->
id)) {
239 if (!$privacy->enabledCommentsExport()) {
247 return \ilPortfolioPage::lookupTitle($a_sub_id);
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
doReadCustom(array $a_row)
uploadImage(array $a_upload)
get(string $a_keyword, ?string $a_default_value=null)
get setting
setDefault(bool $a_value)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
doUpdateCustom(array &$a_fields)
static getDefaultPortfolio(int $a_user_id)
Get default portfolio of user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAdvMDSubItemTitle(int $a_obj_id, string $a_sub_type, int $a_sub_id)
static getPortfoliosOfUser(int $a_user_id)
Get portfolios of user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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="")
static deleteUserPortfolios(int $a_user_id)
Delete all portfolio data for user.
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, ?string $a_back_url=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isCommentsExportPossible()
Is export possible.