Beispiel #1
0
 /**
 * Should return every fieldtype this class will provide
 *
 * @param $moduleName
 * @return array - An Array with the following Structure
 *                  array(
 *                      array(
                            'id' => '<uniqueFieldTypeID>',
                            'title' => '<NameOfFieldType>',
                            'config' => $config
 *                      ), ...
 *                  )
                $config is an array of configuration fields, the admin needs to configure in backend
 *                      it must have the following structure
 *                      array(
 *                          '<configKey>' => array(
                                'type' => '[templatefield,templatearea,picklist,checkbox]',
 *                              'label' => '<label Of Configuration Input>',
                                 // if type = checkbox
                                 // 'value' => 1
                                 // if type = picklist
                                 // 'options' => array('ID1' => 'value1', 'ID2' => 'value2', ...)
 *                          ), ...
 *                      )
 *
 */
 public function getFieldTypes($moduleName)
 {
     $fields = array();
     $modules = \Workflow\VtUtils::getRelatedModules($moduleName);
     $relmodules = array();
     foreach ($modules as $mod) {
         $relmodules[$mod['module_name']] = vtranslate($mod['label'], $mod['module_name']);
     }
     $fields[] = array('id' => 'reference', 'title' => 'Referenz', 'config' => array('reference' => array('type' => 'picklist', 'label' => 'Referenz', 'options' => $relmodules), 'nullable' => array('type' => 'checkbox', 'label' => 'allow empty?', 'value' => '1')));
     return $fields;
 }