ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCMyCourses.php
Go to the documentation of this file.
1<?php
2
25{
26 protected ilObjUser $user;
27
28 public function init(): void
29 {
30 global $DIC;
31 $this->user = $DIC->user();
32 $this->setType("mcrs");
33 }
34
35 public static function getLangVars(): array
36 {
37 return array("ed_insert_my_courses", "pc_mcrs");
38 }
39
40 public function create(
41 ilPageObject $a_pg_obj,
42 string $a_hier_id,
43 string $a_pc_id = ""
44 ): void {
45 $this->createPageContentNode();
46 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
47 $mcrs_node = $this->dom_doc->createElement("MyCourses");
48 $mcrs_node = $this->getDomNode()->appendChild($mcrs_node);
49 }
50
54 public function setData(string $a_sort): void
55 {
56 $ilUser = $this->user;
57 $this->getChildNode()->setAttribute("User", $ilUser->getId());
58 $this->getChildNode()->setAttribute("Sort", $a_sort);
59 }
60
61 public function getSorting(): string
62 {
63 if (is_object($this->getChildNode())) {
64 return $this->getChildNode()->getAttribute("Sort");
65 }
66 return "";
67 }
68}
const IL_INSERT_AFTER
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
init()
Init object.
static getLangVars()
Get lang vars needed for editing.
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
setData(string $a_sort)
Set courses settings.
Content object of ilPageObject (see ILIAS DTD).
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
setType(string $a_type)
Set Type.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
insertContent(ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
insert a content node before/after a sibling or as first child of a parent
global $DIC
Definition: shib_login.php:26