Пример #1
0
 /**
  * 
  */
 protected function contentType($ct)
 {
     $ct = ARONodeType::get($ct);
     $this->tpl->assign('ct', $ct);
     if (isset($_GET['del'])) {
         // remove field
         $f = null;
         foreach ($ct->fields as $_f) {
             if ((int) $_f->id === (int) $_GET['del']) {
                 $f = $_f;
                 break;
             }
         }
         if ($f) {
             ARONodeTypeField::finder()->deleteField($f);
         }
     }
     $fields = ARONodeTypeField::finder()->findMany('node_type_id = ' . $ct->id . ' ORDER BY o ASC');
     $this->tpl->assign('fields', $fields);
     $this->tpl->assign('types', self::$field_types);
     $this->tpl->display('content/node_type.tpl.php');
 }
Пример #2
0
 public function getFields()
 {
     $fields = ARONodeTypeField::finder()->findMany('node_type_id = ' . (int) $this->id);
     array_unshift($fields, new ARONodeTypeField(array('id' => 0, 'node_type_id' => $this->id, 'field_machine_name' => 'title', 'field_title' => 'Title', 'field_description' => 'Mandatory title', 'field_type' => 'string', 'mandatory' => true, 'input_format' => '', 'input_regexp' => '', 'o' => -1)));
     return $fields;
 }