4 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
5 include_once(
"./Modules/Portfolio/classes/class.ilObjPortfolio.php");
42 $this->portfolio_id = $a_val;
82 $this->title = $a_title;
95 if($this->title ==
"###-")
97 return $lng->txt(
"profile");
110 $this->order_nr = (int)$a_val;
133 $set = $ilDB->query(
"SELECT MAX(order_nr) m FROM usr_portfolio_page".
134 " WHERE portfolio_id = ".$ilDB->quote($a_portfolio_id,
"integer"));
135 $rec = $ilDB->fetchAssoc($set);
136 return (
int) $rec[
"m"];
146 $fields =
array(
"portfolio_id" =>
array(
"integer", $this->portfolio_id),
163 $this->
setOrderNr(self::lookupMaxOrderNr($this->portfolio_id) + 10);
166 $id = $ilDB->nextId(
"usr_portfolio_page");
170 $fields[
"id"] =
array(
"integer",
$id);
172 $ilDB->insert(
"usr_portfolio_page", $fields);
186 function update($a_validate =
true, $a_no_history =
false)
194 $ilDB->update(
"usr_portfolio_page", $fields,
197 parent::update($a_validate, $a_no_history);
210 $query =
"SELECT * FROM usr_portfolio_page".
211 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
212 $set = $ilDB->query(
$query);
213 $rec = $ilDB->fetchAssoc($set);
235 include_once(
"./Services/Link/classes/class.ilInternalLink.php");
239 $query =
"DELETE FROM usr_portfolio_page".
240 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
241 $ilDB->manipulate(
$query);
259 $set = $ilDB->query(
"SELECT ".$a_prop.
260 " FROM usr_portfolio_page".
261 " WHERE id = ".$ilDB->quote($a_id,
"integer"));
262 $rec = $ilDB->fetchAssoc($set);
263 return $rec[$a_prop];
273 return self::lookupProperty($a_page_id,
"title");
286 $set = $ilDB->query(
"SELECT * FROM usr_portfolio_page".
287 " WHERE portfolio_id = ".$ilDB->quote($a_portfolio_id,
"integer").
288 " ORDER BY order_nr");
290 while ($rec = $ilDB->fetchAssoc($set))
293 if($rec[
"title"] ==
"###-")
295 $rec[
"title"] = $lng->txt(
"profile");
312 $pages = self::getAllPortfolioPages($a_portfolio_id);
314 foreach ($pages as $p)
316 $ilDB->manipulate(
"UPDATE usr_portfolio_page SET ".
317 " order_nr = ".$ilDB->quote($cnt,
"integer").
318 " WHERE id = ".$ilDB->quote($p[
"id"],
"integer")
332 return self::lookupProperty($a_page_id,
"portfolio_id");
static lookupProperty($a_id, $a_prop)
Lookup portfolio page property.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
setTitle($a_title)
Set Title.
setPortfolioId($a_val)
Set portfolio id.
getPropertiesForDB()
Get properties for insert/update statements.
static findPortfolioForPage($a_page_id)
Get portfolio id of page id.
create($a_import=false)
Create new portfolio page.
static fixOrdering($a_portfolio_id)
Fix ordering.
getParentType()
Get parent type.
getOrderNr()
Get order nr.
static lookupTitle($a_page_id)
Lookup title.
update($a_validate=true, $a_no_history=false)
Update page.
Create styles array
The data for the language used.
static lookupMaxOrderNr($a_portfolio_id)
Lookup max order nr for portfolio.
getPortfolioId()
Get portfolio id.
setOrderNr($a_val)
Set order nr.
static _deleteAllLinksToTarget($a_target_type, $a_target_id, $a_target_inst=0)
Delete all links to a given target.