ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPCMyCourses.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
13 {
17  protected $user;
18 
19  public $dom;
20 
24  public function init()
25  {
26  global $DIC;
27  $this->user = $DIC->user();
28  $this->setType("mcrs");
29  }
30 
35  public static function getLangVars()
36  {
37  return array("ed_insert_my_courses", "pc_mcrs");
38  }
39 
43  public function setNode($a_node)
44  {
45  parent::setNode($a_node); // this is the PageContent node
46  $this->mcrs_node = &$a_node->first_child(); // this is the courses node
47  }
48 
55  public function create(&$a_pg_obj, $a_hier_id, $a_pc_id = "")
56  {
57  $this->node = $this->createPageContentNode();
58  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
59  $this->mcrs_node = $this->dom->create_element("MyCourses");
60  $this->mcrs_node = $this->node->append_child($this->mcrs_node);
61  }
62 
66  public function setData($a_sort)
67  {
69 
70  $this->mcrs_node->set_attribute("User", $ilUser->getId());
71  $this->mcrs_node->set_attribute("Sort", $a_sort);
72 
73  /* remove all children first
74  $children = $this->cach_node->child_nodes();
75  if($children)
76  {
77  foreach($children as $child)
78  {
79  $this->cach_node->remove_child($child);
80  }
81  }
82  */
83  }
84 
85  public function getSorting()
86  {
87  if (is_object($this->mcrs_node)) {
88  return $this->mcrs_node->get_attribute("Sort");
89  }
90  }
91 }
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create courses node in xml.
init()
Init page content component.
setType($a_type)
Set Type.
static getLangVars()
Get lang vars needed for editing.
user()
Definition: user.php:4
Class ilPageContent.
global $DIC
Definition: goto.php:24
const IL_INSERT_AFTER
setData($a_sort)
Set courses settings.
Class ilPCMyCourses.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
$ilUser
Definition: imgupload.php:18
setNode($a_node)
Set node.