Exemple #1
0
 /**
  * Public function that creates a single instance
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemple #2
0
 /**
  * Handle drawing columns
  *
  * @param array $tag_params
  * @param array $children
  */
 public function tag_ColumnsList($tag_params, $children)
 {
     $manager = LeadsTypesManager::getInstance();
     $id = null;
     if (isset($tag_params['type'])) {
         $id = fix_id($tag_params['type']);
     }
     if (is_null($id)) {
         return;
     }
     $type = $manager->getSingleItem($manager->getFieldNames(), array('id' => $id));
     if (is_object($type)) {
         $template = $this->loadTemplate($tag_params, 'column.xml');
         $fields = array_slice(explode(',', $type->fields), 0, leads::COLUMN_COUNT);
         foreach ($fields as $field) {
             $params = array('name' => $field, 'title' => ucwords($field));
             $template->setLocalParams($params);
             $template->restoreXML();
             $template->parse();
         }
     }
 }