30 $this->
default = (bool) $a_value;
50 $this->
setDefault((
bool) $a_row[
"is_default"]);
65 $a_fields[
"is_default"] = array(
"integer", $this->
isDefault());
72 foreach ($pages as $page) {
74 $page_obj->setPortfolioId($this->
id);
97 foreach (self::getPortfoliosOfUser($a_user_id) as $item) {
101 $ilDB->manipulate(
"UPDATE usr_portfolio" .
102 " SET is_default = " .
$ilDB->quote(
false,
"integer") .
103 " WHERE " .
$ilDB->in(
"id", $all,
"",
"integer"));
106 if ($a_portfolio_id) {
107 $ilDB->manipulate(
"UPDATE usr_portfolio" .
108 " SET is_default = " .
$ilDB->quote(
true,
"integer") .
109 " WHERE id = " .
$ilDB->quote($a_portfolio_id,
"integer"));
125 $set =
$ilDB->query(
"SELECT up.*,od.title,od.description" .
126 " FROM usr_portfolio up" .
127 " JOIN object_data od ON (up.id = od.obj_id)" .
128 " WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer") .
129 " AND od.type = " .
$ilDB->quote(
"prtf",
"text") .
130 " ORDER BY od.title");
132 while ($rec =
$ilDB->fetchAssoc($set)) {
155 $set =
$ilDB->query(
"SELECT up.id FROM usr_portfolio up" .
156 " JOIN object_data od ON (up.id = od.obj_id)" .
157 " WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer") .
158 " AND up.is_default = " .
$ilDB->quote(1,
"integer"));
176 foreach ($all as $item) {
177 $access_handler->removePermission($item[
"id"]);
179 $portfolio =
new self($item[
"id"],
false);
180 $portfolio->delete();
188 parent::deleteImage();
195 if (parent::uploadImage($a_upload)) {
208 array($this->
getId()),
221 $params = array(
"back_url" => rawurlencode($a_back_url));
224 foreach ($access_handler->getShardObjectsDataForUserIds($a_owner_ids) as $owner_id => $items) {
An exception for terminatinating execution or to throw for unit testing.
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.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static initStorage($a_id, $a_subdir=null)
Init file system storage.
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
uploadImage(array $a_upload)
Upload new image file.
setDefault($a_value)
Set default.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
doReadCustom(array $a_row)
static deleteUserPortfolios($a_user_id)
Delete all portfolio data for user.
static getPortfoliosOfUser($a_user_id)
Get views of user.
deleteImage()
remove existing file
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
doUpdateCustom(array &$a_fields)
getType()
get object type @access public
getId()
get object id @access public
Access handler for portfolio.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static dirsize($directory)
get size of a directory or a file.
foreach($_POST as $key=> $value) $res