ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilPageObjectFactory.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
23 static function getInstance($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_lang = "-")
24 {
25 include_once("./Services/COPage/classes/class.ilCOPageObjDef.php");
26 $def = ilCOPageObjDef::getDefinitionByParentType($a_parent_type);
27 $class = $def["class_name"];
28 $path = "./".$def["component"]."/".$def["directory"]."/class.".$class.".php";
29 include_once($path);
30 $obj = new $class($a_id , $a_old_nr, $a_lang);
31
32 return $obj;
33 }
34
41 static function getConfigInstance($a_parent_type)
42 {
43 include_once("./Services/COPage/classes/class.ilCOPageObjDef.php");
44 $def = ilCOPageObjDef::getDefinitionByParentType($a_parent_type);
45 $class = $def["class_name"]."Config";
46 $path = "./".$def["component"]."/".$def["directory"]."/class.".$class.".php";
47 include_once($path);
48 $cfg = new $class();
49
50 return $cfg;
51 }
52
62 /* static function getGUIInstance($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_lang = "-")
63 {
64 include_once("./Services/COPage/classes/class.ilCOPageObjDef.php");
65 $def = ilCOPageObjDef::getDefinitionByParentType($a_parent_type);
66 $class = $def["class_name"]."GUI";
67 $path = "./".$def["component"]."/".$def["directory"]."/class.".$class.".php";
68 include_once($path);
69 if (in_array($a_parent_type, array("cont", "cstr", "lm")))
70 {
71 $obj = new $class($a_id , $a_old_nr, $a_lang);
72 }
73 else if (in_array($a_parent_type, array("impr")))
74 {
75 $obj = new $class();
76 }
77 else if (in_array($a_parent_type, array("stys")))
78 {
79 $obj = new $class($a_parent_type, $a_id, $a_old_nr);
80 }
81 else if (in_array($a_parent_type, array("blog")))
82 {
83 $obj = new $class($a_parent_type, $a_id, $a_old_nr);
84 }
85 else
86 {
87 $obj = new $class($a_id , $a_old_nr);
88 }
89
90 return $obj;
91 }*/
92
93
94}
95
96?>
static getDefinitionByParentType($a_parent_type)
Get definition by parent type.
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static getConfigInstance($a_parent_type)
Get page config instance.
$path
Definition: index.php:22