4 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
5 include_once(
"./Services/Portfolio/classes/class.ilObjPortfolio.php");
32 function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0)
34 $this->portfolio_id = (int)$a_portfolio_id;
67 $this->title = $a_title;
80 if($this->title ==
"###-")
82 return $lng->txt(
"profile");
95 $this->order_nr = (int)$a_val;
118 $set = $ilDB->query(
"SELECT MAX(order_nr) m FROM usr_portfolio_page".
119 " WHERE portfolio_id = ".$ilDB->quote($a_portfolio_id,
"integer"));
120 $rec = $ilDB->fetchAssoc($set);
121 return (
int) $rec[
"m"];
131 $fields = array(
"portfolio_id" => array(
"integer", $this->portfolio_id),
132 "type" => array(
"integer", $this->
getType()),
133 "title" => array(
"text", $this->
getTitle()),
134 "order_nr" => array(
"integer", $this->
getOrderNr()));
146 $this->
setOrderNr(self::lookupMaxOrderNr($this->portfolio_id) + 10);
148 $id = $ilDB->nextId(
"usr_portfolio_page");
152 $fields[
"id"] = array(
"integer",
$id);
154 $ilDB->insert(
"usr_portfolio_page", $fields);
165 function update($a_validate =
true, $a_no_history =
false)
173 $ilDB->update(
"usr_portfolio_page", $fields,
174 array(
"id"=>array(
"integer",
$id)));
189 $query =
"SELECT * FROM usr_portfolio_page".
190 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
191 $set = $ilDB->query(
$query);
192 $rec = $ilDB->fetchAssoc($set);
213 include_once(
"./Services/COPage/classes/class.ilInternalLink.php");
217 $query =
"DELETE FROM usr_portfolio_page".
218 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
219 $ilDB->manipulate(
$query);
237 $set = $ilDB->query(
"SELECT ".$a_prop.
238 " FROM usr_portfolio_page".
239 " WHERE id = ".$ilDB->quote($a_id,
"integer"));
240 $rec = $ilDB->fetchAssoc($set);
241 return $rec[$a_prop];
264 $set = $ilDB->query(
"SELECT * FROM usr_portfolio_page".
265 " WHERE portfolio_id = ".$ilDB->quote($a_portfolio_id,
"integer").
266 " ORDER BY order_nr");
268 while ($rec = $ilDB->fetchAssoc($set))
271 if($rec[
"title"] ==
"###-")
273 $rec[
"title"] = $lng->txt(
"profile");
292 foreach ($pages as $p)
294 $ilDB->manipulate(
"UPDATE usr_portfolio_page SET ".
295 " order_nr = ".$ilDB->quote($cnt,
"integer").
296 " WHERE id = ".$ilDB->quote($p[
"id"],
"integer")