4require_once 
"Services/Object/classes/class.ilObject2.php";
 
   23        parent::__construct($a_id, $a_reference);
 
   25        $this->db = 
$DIC->database();
 
   48        $this->online = (bool) $a_value;
 
   72        $set = 
$ilDB->query(
"SELECT is_online" .
 
   73            " FROM usr_portfolio" .
 
   74            " WHERE id = " . 
$ilDB->quote($a_id, 
"integer"));
 
   76        return  (
bool) 
$row[
"is_online"];
 
   86        $this->comments = (bool) $a_value;
 
  116        $this->ppic = (bool) $a_status;
 
  126        if (!$this->bg_color) {
 
  127            $this->bg_color = 
"ffffff";
 
  139        $this->bg_color = (string) $a_value;
 
  149        if (!$this->font_color) {
 
  150            $this->font_color = 
"505050";
 
  162        $this->font_color = (string) $a_value;
 
  182        $this->img = (string) $a_value;
 
  202        $this->style = (int) $a_style;
 
  214        $set = 
$ilDB->query(
"SELECT * FROM usr_portfolio" .
 
  215                " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
  225        include_once(
"./Services/Notes/classes/class.ilNote.php");
 
  228        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  242        $ilDB->manipulate(
"INSERT INTO usr_portfolio (id,is_online)" .
 
  243            " VALUES (" . 
$ilDB->quote($this->id, 
"integer") . 
"," .
 
  244            $ilDB->quote(0, 
"integer") . 
")");
 
  252            "is_online" => array(
"integer", $this->
isOnline()),
 
  255            "font_color" => array(
"text", $this->getFontcolor()),
 
  256            "img" => array(
"text", $this->
getImage())
 
  261        include_once(
"./Services/Notes/classes/class.ilNote.php");
 
  264        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  270            array(
"id"=>array(
"integer", $this->
id))
 
  285        $ilDB->manipulate(
"DELETE FROM usr_portfolio" .
 
  286            " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
  319            include_once 
"Modules/Portfolio/classes/class.ilFSStoragePortfolio.php";
 
  336        include_once 
"Modules/Portfolio/classes/class.ilFSStoragePortfolio.php";
 
  340        $path = $storage->getAbsolutePath() . 
"/";
 
  343            $path .= $a_subdir . 
"/";
 
  345            if (!is_dir(
$path)) {
 
  368        $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/", 
"", $a_upload[
"name"]);
 
  371        $original = 
"org_" . $this->
id . 
"_" . $clean_name;
 
  372        $thumb = 
"thb_" . $this->
id . 
"_" . $clean_name;
 
  373        $processed = $this->
id . 
"_" . $clean_name;
 
  375        if (ilUtil::moveUploadedFile($a_upload[
"tmp_name"], $original, 
$path . $original)) {
 
  376            chmod(
$path . $original, 0770);
 
  383            $dimensions = $prfa_set->get(
"banner_width");
 
  390            ilUtil::execConvert($original_file . 
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
 
  391            ilUtil::execConvert($original_file . 
"[0] -geometry " . $dimensions . 
" -quality 100 JPEG:" . $processed_file);
 
  427        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  431            $new_id = $style_obj->ilClone();
 
  451        $source_id = $a_source->
getId();
 
  467        include_once 
"Services/Skill/classes/class.ilPersonalSkill.php";
 
  472        include_once 
"Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
 
  475            $page_id = $page[
"id"];
 
  477            if ($direction == 
"t2p") {
 
  484            $source_page->setPortfolioId($source_id);
 
  487            $page_type = $source_page->getType();
 
  488            $page_title = $source_page->getTitle();
 
  494            if (is_array($a_recipe)) {
 
  495                $page_recipe = $a_recipe[$page_id];
 
  499            switch ($page_type) {
 
  502                    if ($direction == 
"p2t") {
 
  504                        $page_title = 
$lng->txt(
"obj_blog") . 
" " . (++$blog_count);
 
  511                    if ($direction == 
"t2p" && is_array($page_recipe)) {
 
  513                        if ($page_recipe[0] == 
"blog") {
 
  514                            switch ($page_recipe[1]) {
 
  521                                    $page_title = $page_recipe[2];
 
  535                    $target_page->setXMLContent($source_page->copyXmlContent(
true)); 
 
  536                    $target_page->buildDom(
true);
 
  541                    if ($direction == 
"t2p") {
 
  542                        $dom = $target_page->getDom();
 
  544                            $dom = $dom->myDOMDocument;
 
  553                        $xpath = 
new DOMXPath($dom);
 
  554                        $nodes = $xpath->query(
"//PageContent/Skills");
 
  555                        foreach ($nodes as $node) {
 
  556                            $skill_id = $node->getAttribute(
"Id");
 
  559                            if (in_array($skill_id, $pskills)) {
 
  560                                $node->setAttribute(
"User", 
$ilUser->getId());
 
  563                            elseif (in_array($skill_id, $a_recipe[
"skills"])) {
 
  564                                include_once 
"Services/Skill/classes/class.ilPersonalSkill.php";
 
  567                                $node->setAttribute(
"User", 
$ilUser->getId());
 
  571                                $page_element = $node->parentNode;
 
  572                                $page_element->parentNode->removeChild($page_element);
 
  583                $target_page->setXMLContent($target_page->getXMLFromDom());
 
  585                $target_page->setType($page_type);
 
  586                $target_page->setTitle($page_title);
 
  587                $target_page->create();
 
  590                    $target_page->update();     
 
  592                $page_map[$source_page->getId()] = $target_page->getId();
 
  599    protected static function updateDomNodes($a_dom, $a_xpath, $a_attr_id, $a_attr_value)
 
  601        $xpath_temp = 
new DOMXPath($a_dom);
 
  602        $nodes = $xpath_temp->query($a_xpath);
 
  603        foreach ($nodes as $node) {
 
  604            $node->setAttribute($a_attr_id, $a_attr_value);
 
  614        static $ws_access = 
null;
 
  616        include_once 
"Modules/Blog/classes/class.ilObjBlog.php";
 
  618        $blog->setType(
"blog");
 
  619        $blog->setTitle($a_title);
 
  623            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  624            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
  628            if (!
$tree->getRootId()) {
 
  635        $tree = $ws_access->getTree();
 
  636        $node_id = 
$tree->insertObject(
$tree->getRootId(), $blog->getId());
 
  637        $ws_access->setPermissions(
$tree->getRootId(), $node_id);
 
  639        return $blog->getId();
 
  650            if ($this->
getType() == 
"prtt") {
 
  655            if ($page->renameLinksOnTitleChange($a_title_changes)) {
 
  656                $page->update(
true, 
true);
 
An exception for terminatinating execution or to throw for unit testing.
static _copyDirectory($a_source, $a_target)
Copy directory and all contents.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
static activateComments($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_activate=true)
Activate notes feature.
deleteImage()
remove existing file
setPublicComments($a_value)
Set public comments status.
doUpdateCustom(array &$a_fields)
getStyleSheetId()
Get style sheet id.
setOnline($a_value)
Set online status.
static cloneBasics(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target)
Clone basic settings.
getBackgroundColor()
Get background color.
hasProfilePicture()
Get profile picture status.
uploadImage(array $a_upload)
Upload new image file.
setBackgroundColor($a_value)
Set background color.
static createBlogInPersonalWorkspace($a_title)
__construct($a_id=0, $a_reference=true)
Constructor.
getFontColor()
Get font color.
setStyleSheetId($a_style)
Set style sheet id.
getImage()
Get banner image.
static updateDomNodes($a_dom, $a_xpath, $a_attr_id, $a_attr_value)
static lookupOnline($a_id)
Is online?
hasPublicComments()
Active public comments?
setImage($a_value)
Set banner image.
setProfilePicture($a_status)
Toggle profile picture status.
static initStorage($a_id, $a_subdir=null)
Init file system storage.
fixLinksOnTitleChange($a_title_changes)
Fix internal portfolio links.
doReadCustom(array $a_row)
setFontColor($a_value)
Set font color.
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, array $a_recipe=null)
Build template from portfolio and vice versa.
getImageFullPath($a_as_thumb=false)
Get banner image incl.
static _lookupStandard($a_id)
Lookup standard flag.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
Class ilObject2 This is an intermediate progress of ilObject class.
getType()
get object type @access public
update()
update object in db
getId()
get object id @access public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
static addPersonalSkill($a_user_id, $a_skill_node_id)
Add personal skill.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static updateInternalLinks($a_copied_nodes, ilObjPortfolioBase $a_target_obj)
Update internal links, after multiple pages have been copied.
Page for portfolio template.
static escapeShellArg($a_arg)
static execConvert($args)
execute convert command
Access handler for personal workspace.
Tree handler for personal workspace.