4include_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
    5include_once(
"./Modules/Portfolio/classes/class.ilObjPortfolio.php");
 
   42        $this->portfolio_id = $a_val;
 
   82        $this->title = $a_title;
 
   95        if ($this->title == 
"###-") {
 
   96            return $lng->txt(
"profile");
 
  109        $this->order_nr = (int) $a_val;
 
  134        $set = 
$ilDB->query(
"SELECT MAX(order_nr) m FROM usr_portfolio_page" .
 
  135            " WHERE portfolio_id = " . 
$ilDB->quote($a_portfolio_id, 
"integer"));
 
  136        $rec = 
$ilDB->fetchAssoc($set);
 
  137        return (
int) $rec[
"m"];
 
  147        $fields = array(
"portfolio_id" => array(
"integer", $this->portfolio_id),
 
  148            "type" => array(
"integer", $this->
getType()),
 
  149            "title" => array(
"text", $this->
getTitle()),
 
  150            "order_nr" => array(
"integer", $this->
getOrderNr()));
 
  158    public function create($a_import = 
false)
 
  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);
 
  185    public function update($a_validate = 
true, $a_no_history = 
false)
 
  193                "usr_portfolio_page",
 
  195                array(
"id" => array(
"integer", 
$id))
 
  211        $query = 
"SELECT * FROM usr_portfolio_page" .
 
  212            " WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  214        $rec = 
$ilDB->fetchAssoc($set);
 
  228    public function delete()
 
  235            include_once(
"./Services/Link/classes/class.ilInternalLink.php");
 
  239            $query = 
"DELETE FROM usr_portfolio_page" .
 
  240                " WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  261        $set = 
$ilDB->query(
"SELECT " . $a_prop .
 
  262            " FROM usr_portfolio_page" .
 
  263            " WHERE id = " . 
$ilDB->quote($a_id, 
"integer"));
 
  264        $rec = 
$ilDB->fetchAssoc($set);
 
  265        return $rec[$a_prop];
 
  291        $set = 
$ilDB->query(
"SELECT * FROM usr_portfolio_page" .
 
  292            " WHERE portfolio_id = " . 
$ilDB->quote($a_portfolio_id, 
"integer") .
 
  293            " ORDER BY order_nr");
 
  295        while ($rec = 
$ilDB->fetchAssoc($set)) {
 
  297            if ($rec[
"title"] == 
"###-") {
 
  298                $rec[
"title"] = 
$lng->txt(
"profile");
 
  319        foreach ($pages as $p) {
 
  321                "UPDATE usr_portfolio_page SET " .
 
  322                " order_nr = " . 
$ilDB->quote($cnt, 
"integer") .
 
  323                " WHERE id = " . 
$ilDB->quote($p[
"id"], 
"integer")
 
  352        if (
$type == 
"prtt") {
 
  353            $ctrl = 
$DIC->ctrl();
 
  354            $ctrl->setParameterByClass(
"ilobjportfoliotemplategui", 
"user_page", $a_target);
 
  355            $href = $ctrl->getLinkTargetByClass(array(
"ilRepositoryGUI", 
"ilObjPortfolioTemplateGUI", 
"ilobjportfoliotemplategui"), 
"preview");
 
  358                $href = 
"./goto.php?client_id=" . CLIENT_ID . 
"&target=prtf_" . $pid . 
"_" . $a_target;
 
  360                $href = 
"prtf_" . $a_target . 
".html";
 
  372        $all_fixes = array();
 
  373        foreach ($a_copied_nodes as $original_id => $copied_id) {
 
  380            if ($a_target_obj->
getType() == 
"prtf") {
 
  383            if ($a_target_obj->
getType() == 
"prtt") {
 
  387            $il = $tpg->getInternalLinks();
 
  390            foreach ($il as 
$l) {
 
  396            foreach ($targets as 
$target) {
 
  398                    (
$target[
"type"] == 
"ppage")) {
 
  400                    if ($a_copied_nodes[
$target[
"id"]] > 0) {
 
  407            if (count($fix) > 0) {
 
  409                if (is_array($all_fixes[
$t . 
":" . $copied_id])) {
 
  410                    $all_fixes[
$t . 
":" . $copied_id] += $fix;
 
  412                    $all_fixes[
$t . 
":" . $copied_id] = $fix;
 
  417        foreach ($all_fixes as $pg => $fixes) {
 
  418            $pg = explode(
":", $pg);
 
  419            include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
 
  421            if ($page->moveIntLinks($fixes)) {
 
  422                $page->update(
true, 
true);
 
  441        for (
$i = 0; 
$i < count(
$res->nodeset); 
$i++) {
 
  445            if (isset($a_title_changes[$obj_id]) && is_int(strpos(
$target, 
"__"))) {
 
  446                if (
$type == 
"PortfolioPage") {
 
  447                    if (
$res->nodeset[
$i]->get_content() == $a_title_changes[$obj_id][
"old"]) {
 
  448                        $res->nodeset[
$i]->set_content($a_title_changes[$obj_id][
"new"]);
 
  471        $set = 
$ilDB->query(
"SELECT * FROM usr_portfolio_page" .
 
  472            " WHERE title = " . 
$ilDB->quote($a_blog_id, 
"text") .
 
  473            " AND type = " . 
$ilDB->quote(self::TYPE_BLOG, 
"integer"));
 
  475        while ($rec = 
$ilDB->fetchAssoc($set)) {
 
An exception for terminatinating execution or to throw for unit testing.
static _extractObjIdOfTarget($a_target)
Extract object id out of target.
static _deleteAllLinksToTarget($a_target_type, $a_target_id, $a_target_inst=0)
Delete all links to a given target.
static _extractTypeOfTarget($a_target)
Extract type out of target.
static _extractInstOfTarget($a_target)
Extract installation id out of target.
getType()
get object type @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
getPortfolioId()
Get portfolio id.
setOrderNr($a_val)
Set order nr.
static lookupMaxOrderNr($a_portfolio_id)
Lookup max order nr for portfolio.
setPortfolioId($a_val)
Set portfolio id.
getPropertiesForDB()
Get properties for insert/update statements.
static lookupProperty($a_id, $a_prop)
Lookup portfolio page property.
static findPortfolioForPage($a_page_id)
Get portfolio id of page id.
static getPagesForBlog($a_blog_id)
Get portfolio pages for blog.
getOrderNr()
Get order nr.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
getParentType()
Get parent type.
static updateInternalLinks($a_copied_nodes, ilObjPortfolioBase $a_target_obj)
Update internal links, after multiple pages have been copied.
create($a_import=false)
Create new portfolio page.
static fixOrdering($a_portfolio_id)
Fix ordering.
setTitle($a_title)
Set Title.
renameLinksOnTitleChange($a_title_changes)
static getGotoForPortfolioPageTarget($a_target, $a_offline=false)
Get goto href for internal wiki page link target.
update($a_validate=true, $a_no_history=false)
Update page.
static lookupTitle($a_page_id)
Lookup title.
Page for portfolio template.
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
update($pash, $contents, Config $config)
foreach($_POST as $key=> $value) $res