Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
FGElement.php
1 <?php
2 class FGElement extends CComponent
3 {
4  public static final function getInstance($elementType)
5  {
6  $className = 'FGElement'.ucfirst($elementType);
7  $path = dirname(__FILE__).'/../elements/'.$className.'.php';
8  if(class_exists($className, false) == false) {
9  if(is_file($path)) {
10  require $path;
11  }
12  }
13  if(class_exists($className, false)) {
14  return new $className;
15  } else {
16  return new FGElement();
17  }
18  }
19 
20  public function serializeFormData($value, $element)
21  {
22  return strval($value);
23  }
24 
25  public function displayDataHTML($value)
26  {
27  return CHtml::encode($value);
28  }
29 }