26 protected \ILIAS\Notes\Service
$notes;
31 protected string $img =
"";
37 bool $a_reference =
true
41 $this->notes =
$DIC->notes();
45 $this->setting =
$DIC->settings();
47 $this->db =
$DIC->database();
64 $this->comments = $a_value;
79 $this->ppic = $a_status;
84 if (!$this->bg_color) {
85 $this->bg_color =
"ffffff";
95 $this->bg_color = $a_value;
100 if (!$this->font_color) {
101 $this->font_color =
"505050";
108 $this->font_color = $a_value;
119 $set =
$ilDB->query(
"SELECT * FROM usr_portfolio" .
120 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
121 $row =
$ilDB->fetchAssoc($set);
140 protected function doCreate(
bool $clone_mode =
false): void
144 $ilDB->manipulate(
"INSERT INTO usr_portfolio (id)" .
145 " VALUES (" .
$ilDB->quote($this->id,
"integer") .
")");
165 array(
"id" => array(
"integer", $this->
id))
182 $ilDB->manipulate(
"DELETE FROM usr_portfolio" .
183 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
218 $content_style_domain =
$DIC
221 ->styleForObjId($a_source->
getId());
222 $content_style_domain->cloneTo($a_target->
getId());
231 ?array $a_recipe =
null,
232 bool $copy_all =
false
237 $ilUser =
$DIC->user();
238 $skill_personal_service =
$DIC->skills()->personal();
240 $source_id = $a_source->
getId();
241 $target_id = $a_target->
getId();
253 self::cloneBasics($a_source, $a_target);
280 if ($rec->getParentObject() == $a_target->
getId()) {
281 $rec->setAssignedObjectTypes(
283 "obj_type" => $target_type,
284 "sub_type" =>
"pfpg",
289 } elseif (!$rec->isAssignedObjectType($target_type,
'pfpg')) {
290 $rec->appendAssignedObjectType(
299 $pskills = array_keys($skill_personal_service->getSelectedUserSkills($ilUser->getId()));
304 $page_id = $page[
"id"];
306 if ($direction ===
"t2p") {
313 $source_page->setPortfolioId($source_id);
314 $target_page->setPortfolioId($target_id);
316 $page_type = $source_page->getType();
317 $page_title = $source_page->getTitle();
323 if (isset($a_recipe)) {
324 $page_recipe = $a_recipe[$page_id] ??
null;
328 switch ($page_type) {
331 $target_page->setXMLContent(
332 $source_page->copyXmlContent(
338 $target_page->buildDom(
true);
342 if ($direction ===
"t2p") {
343 $dom = $target_page->getDomDoc();
346 self::updateDomNodes($dom,
"//PageContent/Profile",
"User", $ilUser->getId());
347 self::updateDomNodes($dom,
"//PageContent/ConsultationHours",
"User", $ilUser->getId());
348 self::updateDomNodes($dom,
"//PageContent/MyCourses",
"User", $ilUser->getId());
351 $xpath =
new DOMXPath($dom);
352 $nodes = $xpath->query(
"//PageContent/Skills");
353 foreach ($nodes as $node) {
354 $skill_id = $node->getAttribute(
"Id");
357 if (in_array($skill_id, $pskills)) {
358 $node->setAttribute(
"User", $ilUser->getId());
361 elseif ($copy_all || in_array($skill_id, $a_recipe[
"skills"])) {
362 $skill_personal_service->addPersonalSkill($ilUser->getId(), $skill_id);
364 $node->setAttribute(
"User", $ilUser->getId());
368 $page_element = $node->parentNode;
369 $page_element->parentNode->removeChild($page_element);
380 $target_page->setXMLContent($target_page->getXMLFromDom());
382 $target_page->setType($page_type);
383 $target_page->setTitle($page_title);
384 $target_page->create(
false);
387 $target_page->update();
389 $page_map[$source_page->getId()] = $target_page->getId();
401 $xpath_temp = new DOMXPath($a_dom);
402 $nodes = $xpath_temp->query($a_xpath);
403 foreach ($nodes as $node) {
404 $node->setAttribute($a_attr_id, $a_attr_value);
414 if ($this->getType() ===
"prtt") {
419 if ($page->renameLinksOnTitleChange($a_title_changes)) {
420 $page->update(
true,
true);
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", ?array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
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 _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _getContainerSettings(int $a_id)
static _allocateCopyId()
Allocate a copy for further entries.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, ?array $a_recipe=null, bool $copy_all=false)
Build template from portfolio and vice versa.
doUpdateCustom(array &$a_fields)
May be overwritte by derived classes.
fixLinksOnTitleChange(array $a_title_changes)
Update internal portfolio links on title change.
setProfilePicture(bool $a_status)
setFontColor(string $a_value)
static cloneBasics(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target)
Clone basic settings.
ILIAS Notes Service $notes
static updateDomNodes(DOMDocument $a_dom, string $a_xpath, string $a_attr_id, string $a_attr_value)
setBackgroundColor(string $a_value)
Set background color, e.g.
setPublicComments(bool $a_value)
doReadCustom(array $a_row)
May be overwritten by derived classes.
doCreate(bool $clone_mode=false)
__construct(int $a_id=0, bool $a_reference=true)
Constructor.
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 _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
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...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc