21        $this->db = 
$DIC->database();
 
   44        $this->online = (bool) $a_value;
 
   68        $set = 
$ilDB->query(
"SELECT is_online" .
 
   69            " FROM usr_portfolio" .
 
   70            " WHERE id = " . 
$ilDB->quote($a_id, 
"integer"));
 
   71        $row = 
$ilDB->fetchAssoc($set);
 
   72        return  (
bool) $row[
"is_online"];
 
   82        $this->comments = (bool) $a_value;
 
  112        $this->ppic = (bool) $a_status;
 
  122        if (!$this->bg_color) {
 
  123            $this->bg_color = 
"ffffff";
 
  135        $this->bg_color = (string) $a_value;
 
  145        if (!$this->font_color) {
 
  146            $this->font_color = 
"505050";
 
  158        $this->font_color = (string) $a_value;
 
  178        $this->img = (string) $a_value;
 
  198        $this->style = (int) $a_style;
 
  210        $set = 
$ilDB->query(
"SELECT * FROM usr_portfolio" .
 
  211                " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
  212        $row = 
$ilDB->fetchAssoc($set);
 
  214        $this->
setOnline((
bool) $row[
"is_online"]);
 
  236        $ilDB->manipulate(
"INSERT INTO usr_portfolio (id,is_online)" .
 
  237            " VALUES (" . 
$ilDB->quote($this->id, 
"integer") . 
"," .
 
  238            $ilDB->quote(0, 
"integer") . 
")");
 
  246            "is_online" => array(
"integer", $this->
isOnline()),
 
  249            "font_color" => array(
"text", $this->getFontcolor()),
 
  250            "img" => array(
"text", $this->
getImage())
 
  262            array(
"id" => array(
"integer", $this->
id))
 
  277        $ilDB->manipulate(
"DELETE FROM usr_portfolio" .
 
  278            " WHERE id = " . 
$ilDB->quote($this->id, 
"integer"));
 
  330        $path = $storage->getAbsolutePath() . 
"/";
 
  333            $path .= $a_subdir . 
"/";
 
  335            if (!is_dir($path)) {
 
  358        $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/", 
"", $a_upload[
"name"]);
 
  361        $original = 
"org_" . $this->
id . 
"_" . $clean_name;
 
  362        $thumb = 
"thb_" . $this->
id . 
"_" . $clean_name;
 
  363        $processed = $this->
id . 
"_" . $clean_name;
 
  366            chmod($path . $original, 0770);
 
  373            $dimensions = $prfa_set->get(
"banner_width");
 
  380            ilUtil::execConvert($original_file . 
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
 
  381            ilUtil::execConvert($original_file . 
"[0] -geometry " . $dimensions . 
" -quality 100 JPEG:" . $processed_file);
 
  420            $new_id = $style_obj->ilClone();
 
  440        $source_id = $a_source->
getId();
 
  462            $page_id = $page[
"id"];
 
  464            if ($direction == 
"t2p") {
 
  471            $source_page->setPortfolioId($source_id);
 
  474            $page_type = $source_page->getType();
 
  475            $page_title = $source_page->getTitle();
 
  481            if (is_array($a_recipe)) {
 
  482                $page_recipe = $a_recipe[$page_id];
 
  486            switch ($page_type) {
 
  489                    if ($direction == 
"p2t") {
 
  491                        $page_title = 
$lng->txt(
"obj_blog") . 
" " . (++$blog_count);
 
  498                    if ($direction == 
"t2p" && (is_array($page_recipe) || $copy_all)) {
 
  504                            if ($page_recipe[0] == 
"blog") {
 
  505                                switch ($page_recipe[1]) {
 
  512                                        $page_title = $page_recipe[2];
 
  527                    $target_page->setXMLContent($source_page->copyXmlContent(
true)); 
 
  528                    $target_page->buildDom(
true);
 
  533                    if ($direction == 
"t2p") {
 
  534                        $dom = $target_page->getDom();
 
  536                            $dom = $dom->myDOMDocument;
 
  545                        $xpath = 
new DOMXPath($dom);
 
  546                        $nodes = $xpath->query(
"//PageContent/Skills");
 
  547                        foreach ($nodes as $node) {
 
  548                            $skill_id = $node->getAttribute(
"Id");
 
  551                            if (in_array($skill_id, $pskills)) {
 
  552                                $node->setAttribute(
"User", 
$ilUser->getId());
 
  555                            elseif ($copy_all || in_array($skill_id, $a_recipe[
"skills"])) {
 
  558                                $node->setAttribute(
"User", 
$ilUser->getId());
 
  562                                $page_element = $node->parentNode;
 
  563                                $page_element->parentNode->removeChild($page_element);
 
  574                $target_page->setXMLContent($target_page->getXMLFromDom());
 
  576                $target_page->setType($page_type);
 
  577                $target_page->setTitle($page_title);
 
  578                $target_page->create();
 
  581                    $target_page->update();     
 
  583                $page_map[$source_page->getId()] = $target_page->getId();
 
  590    protected static function updateDomNodes($a_dom, $a_xpath, $a_attr_id, $a_attr_value)
 
  592        $xpath_temp = 
new DOMXPath($a_dom);
 
  593        $nodes = $xpath_temp->query($a_xpath);
 
  594        foreach ($nodes as $node) {
 
  595            $node->setAttribute($a_attr_id, $a_attr_value);
 
  605        static $ws_access = 
null;
 
  608        $blog->setType(
"blog");
 
  609        $blog->setTitle($a_title);
 
  616            if (!
$tree->getRootId()) {
 
  623        $tree = $ws_access->getTree();
 
  624        $node_id = 
$tree->insertObject(
$tree->getRootId(), $blog->getId());
 
  625        $ws_access->setPermissions(
$tree->getRootId(), $node_id);
 
  627        return $blog->getId();
 
  638            if ($this->
getType() == 
"prtt") {
 
  643            if ($page->renameLinksOnTitleChange($a_title_changes)) {
 
  644                $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, $a_news_id=0)
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.
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, array $a_recipe=null, $copy_all=false)
Build template from portfolio and vice versa.
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.
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
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getId()
get object id @access public
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static escapeShellArg($a_arg)
static execConvert($args)
execute convert command
Access handler for personal workspace.
Tree handler for personal workspace.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc