4 require_once
"Modules/Portfolio/classes/class.ilObjPortfolioBase.php";
34 $this->
default = (bool) $a_value;
54 $this->
setDefault((
bool) $a_row[
"is_default"]);
75 include_once
"Modules/Portfolio/classes/class.ilPortfolioPage.php";
77 foreach ($pages as $page) {
79 $page_obj->setPortfolioId($this->
id);
99 $ilDB = $DIC->database();
102 foreach (self::getPortfoliosOfUser($a_user_id) as $item) {
103 $all[] = $item[
"id"];
106 $ilDB->manipulate(
"UPDATE usr_portfolio" .
107 " SET is_default = " .
$ilDB->quote(
false,
"integer") .
108 " WHERE " .
$ilDB->in(
"id", $all,
"",
"integer"));
111 if ($a_portfolio_id) {
112 $ilDB->manipulate(
"UPDATE usr_portfolio" .
113 " SET is_default = " .
$ilDB->quote(
true,
"integer") .
114 " WHERE id = " .
$ilDB->quote($a_portfolio_id,
"integer"));
128 $ilDB = $DIC->database();
130 $set =
$ilDB->query(
"SELECT up.*,od.title,od.description" .
131 " FROM usr_portfolio up" .
132 " JOIN object_data od ON (up.id = od.obj_id)" .
133 " WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer") .
134 " AND od.type = " .
$ilDB->quote(
"prtf",
"text") .
135 " ORDER BY od.title");
137 while ($rec =
$ilDB->fetchAssoc($set)) {
153 $ilDB = $DIC->database();
160 $set =
$ilDB->query(
"SELECT up.id FROM usr_portfolio up" .
161 " JOIN object_data od ON (up.id = od.obj_id)" .
162 " WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer") .
163 " AND up.is_default = " .
$ilDB->quote(1,
"integer"));
177 $all = self::getPortfoliosOfUser($a_user_id);
179 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
182 foreach ($all as $item) {
183 $access_handler->removePermission($item[
"id"]);
185 $portfolio =
new self($item[
"id"],
false);
186 $portfolio->delete();
194 parent::deleteImage();
201 if (parent::uploadImage($a_upload)) {
210 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
224 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
232 include_once
"Services/Link/classes/class.ilLink.php";
233 foreach ($access_handler->getShardObjectsDataForUserIds($a_owner_ids) as $owner_id => $items) {
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
setDefault($a_value)
Set default.
doReadCustom(array $a_row)
uploadImage(array $a_upload)
doUpdateCustom(array &$a_fields)
static getPortfoliosOfUser($a_user_id)
Get views of user.
static initStorage($a_id, $a_subdir=null)
Init file system storage.
foreach($_POST as $key=> $value) $res
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
Create styles array
The data for the language used.
static dirsize($directory)
get size of a directory or a file.
static handleUpdatedSourceObject($a_src_obj_type, $a_src_obj_id, $a_src_filesize, $a_owner_obj_ids=null, $a_is_prtf=false)
Find and update/create all related entries for source object.
Access handler for portfolio.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
static deleteUserPortfolios($a_user_id)
Delete all portfolio data for user.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")