26 protected \ILIAS\Notes\Service
$notes;
32 protected string $img =
"";
38 bool $a_reference =
true 42 $this->notes = $DIC->notes();
46 $this->setting = $DIC->settings();
48 $this->db = $DIC->database();
58 $this->online = $a_value;
70 $ilDB = $DIC->database();
72 $set =
$ilDB->query(
"SELECT is_online" .
73 " FROM usr_portfolio" .
74 " WHERE id = " .
$ilDB->quote($a_id,
"integer"));
75 $row =
$ilDB->fetchAssoc($set);
76 return (
bool) $row[
"is_online"];
81 $this->comments = $a_value;
96 $this->ppic = $a_status;
101 if (!$this->bg_color) {
102 $this->bg_color =
"ffffff";
112 $this->bg_color = $a_value;
117 if (!$this->font_color) {
118 $this->font_color =
"505050";
125 $this->font_color = $a_value;
141 $this->img = $a_value;
152 $set =
$ilDB->query(
"SELECT * FROM usr_portfolio" .
153 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
154 $row =
$ilDB->fetchAssoc($set);
156 $this->
setOnline((
bool) $row[
"is_online"]);
160 $this->
setImage((
string) $row[
"img"]);
175 protected function doCreate(
bool $clone_mode =
false): void
179 $ilDB->manipulate(
"INSERT INTO usr_portfolio (id,is_online)" .
180 " VALUES (" .
$ilDB->quote($this->id,
"integer") .
"," .
181 $ilDB->quote(0,
"integer") .
")");
189 "is_online" => array(
"integer", $this->
isOnline()),
193 "img" => array(
"text", $this->
getImage())
203 array(
"id" => array(
"integer", $this->
id))
221 $ilDB->manipulate(
"DELETE FROM usr_portfolio" .
222 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
236 bool $a_as_thumb =
false 239 $path = self::initStorage($this->
id);
267 string $a_subdir = null
272 $path = $storage->getAbsolutePath() .
"/";
275 $path .= $a_subdir .
"/";
278 throw new \RuntimeException(sprintf(
'Directory "%s" was not created',
$path));
298 $clean_name = preg_replace(
"/[^a-zA-Z0-9\_\.\-]/",
"", $a_upload[
"name"]);
300 $path = self::initStorage($this->
id);
301 $original =
"org_" . $this->
id .
"_" . $clean_name;
302 $thumb =
"thb_" . $this->
id .
"_" . $clean_name;
303 $processed = $this->
id .
"_" . $clean_name;
306 chmod(
$path . $original, 0770);
313 $dimensions = $prfa_set->get(
"banner_width");
322 $original_file .
"[0] -geometry " . $dimensions .
" -quality 100 JPEG:" . $processed_file
368 $content_style_domain = $DIC
371 ->styleForObjId($a_source->
getId());
372 $content_style_domain->cloneTo($a_target->
getId());
381 ?array $a_recipe = null,
382 bool $copy_all =
false 386 $lng = $DIC->language();
389 $source_id = $a_source->
getId();
395 } elseif ($a_source instanceof ilObjPortfolio &&
402 self::cloneBasics($a_source, $a_target);
429 if ($rec->getParentObject() == $a_target->
getId()) {
430 $rec->setAssignedObjectTypes(
433 "sub_type" =>
"pfpg",
438 } elseif (!$rec->isAssignedObjectType(
$target_type,
'pfpg')) {
439 $rec->appendAssignedObjectType(
454 $page_id = $page[
"id"];
456 if ($direction ===
"t2p") {
463 $source_page->setPortfolioId($source_id);
466 $page_type = $source_page->getType();
467 $page_title = $source_page->getTitle();
473 if (isset($a_recipe)) {
474 $page_recipe = $a_recipe[$page_id] ?? null;
478 switch ($page_type) {
481 if ($direction ===
"p2t") {
483 $page_title =
$lng->
txt(
"obj_blog") .
" " . (++$blog_count);
490 if ($direction ===
"t2p" && (is_array($page_recipe) || $copy_all)) {
493 $page_title = self::createBlogInPersonalWorkspace($page_title);
495 } elseif ($page_recipe[0] ==
"blog") {
496 switch ($page_recipe[1]) {
498 $page_title = self::createBlogInPersonalWorkspace($page_recipe[2]);
503 $page_title = $page_recipe[2];
517 $target_page->setXMLContent(
518 $source_page->copyXmlContent(
524 $target_page->buildDom(
true);
528 if ($direction ===
"t2p") {
529 $dom = $target_page->getDom();
531 $dom = $dom->myDOMDocument;
535 self::updateDomNodes($dom,
"//PageContent/Profile",
"User",
$ilUser->getId());
536 self::updateDomNodes($dom,
"//PageContent/ConsultationHours",
"User",
$ilUser->getId());
537 self::updateDomNodes($dom,
"//PageContent/MyCourses",
"User",
$ilUser->getId());
541 $nodes = $xpath->query(
"//PageContent/Skills");
542 foreach ($nodes as $node) {
543 $skill_id = $node->getAttribute(
"Id");
546 if (in_array($skill_id, $pskills)) {
547 $node->setAttribute(
"User",
$ilUser->getId());
550 elseif ($copy_all || in_array($skill_id, $a_recipe[
"skills"])) {
553 $node->setAttribute(
"User",
$ilUser->getId());
557 $page_element = $node->parentNode;
558 $page_element->parentNode->removeChild($page_element);
569 $target_page->setXMLContent($target_page->getXMLFromDom());
571 $target_page->setType($page_type);
572 $target_page->setTitle($page_title);
573 $target_page->create(
false);
576 $target_page->update();
578 $page_map[$source_page->getId()] = $target_page->getId();
591 $nodes = $xpath_temp->query($a_xpath);
592 foreach ($nodes as $node) {
593 $node->setAttribute($a_attr_id, $a_attr_value);
603 static $ws_access = null;
606 $blog->setType(
"blog");
607 $blog->setTitle($a_title);
621 $tree = $ws_access->getTree();
625 return $blog->getId();
634 if ($this->
getType() ===
"prtt") {
639 if ($page->renameLinksOnTitleChange($a_title_changes)) {
640 $page->update(
true,
true);
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
setProfilePicture(bool $a_status)
ILIAS Notes Service $notes
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
deleteImage()
remove existing file
static initStorage(int $a_id, string $a_subdir=null)
Init file system storage.
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static createBlogInPersonalWorkspace(string $a_title)
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static escapeShellArg(string $a_arg)
setFontColor(string $a_value)
setBackgroundColor(string $a_value)
Set background color, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setImage(string $a_value)
Set banner image.
static cloneBasics(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target)
Clone basic settings.
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
setPublicComments(bool $a_value)
uploadImage(array $a_upload)
Upload new image file.
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, ?array $a_recipe=null, bool $copy_all=false)
Build template from portfolio and vice versa.
static lookupOnline(int $a_id)
static updateInternalLinks(array $a_copied_nodes, ilObjPortfolioBase $a_target_obj)
Update internal links, after multiple pages have been copied.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _allocateCopyId()
Allocate a copy for further entries.
static getSelectedUserSkills(int $a_user_id)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static updateDomNodes(DOMDocument $a_dom, string $a_xpath, string $a_attr_id, string $a_attr_value)
__construct(int $a_id=0, bool $a_reference=true)
doReadCustom(array $a_row)
May be overwritten by derived classes.
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
getImage()
Get banner image.
static _cloneValues(int $copy_id, int $a_source_id, int $a_target_id, ?string $a_sub_type=null, ?int $a_source_sub_id=null, ?int $a_target_sub_id=null)
Clone Advanced Meta Data.
static addPersonalSkill(int $a_user_id, int $a_skill_node_id)
__construct(Container $dic, ilPlugin $plugin)
fixLinksOnTitleChange(array $a_title_changes)
Update internal portfolio links on title change.
doCreate(bool $clone_mode=false)
doUpdateCustom(array &$a_fields)
May be overwritte by derived classes.
getImageFullPath(bool $a_as_thumb=false)
Get banner image incl.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _copyDirectory(string $a_sdir, string $a_tdir)
static _getContainerSettings(int $a_id)
static execConvert(string $args)
execute convert command