ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilNewsRendererFactory.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
13 {
17  static protected $renderer = array();
18 
25  static function getRenderer($a_context_obj_type)
26  {
27  global $DIC;
28 
29  if (!isset(self::$renderer[$a_context_obj_type]))
30  {
31  $obj_def = $DIC["objDefinition"];
32 
33  $comp = $obj_def->getComponentForType($a_context_obj_type);
34  $class = $obj_def->getClassName($a_context_obj_type);
35 
36  $class = "il" . $class . "NewsRendererGUI";
37  $type_renderer_path = "./" . $comp . "/classes/class." . $class . ".php";
38  if (is_file($type_renderer_path))
39  {
40  include_once($type_renderer_path);
41  $rend = new $class();
42  }
43  else
44  {
45  include_once("./Services/News/classes/class.ilNewsDefaultRendererGUI.php");
46  $rend = new ilNewsDefaultRendererGUI();
47  }
48  self::$renderer[$a_context_obj_type] = $rend;
49  }
50 
51  return self::$renderer[$a_context_obj_type];
52  }
53 }
54 
55 ?>
Create styles array
The data for the language used.
static getRenderer($a_context_obj_type)
Get renderer.
global $DIC