Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
commit | author | age
ef55b5 1 <?php
F 2
3 /*
4     Form Definition
5
6     Tabledefinition
7
8     Datatypes:
9     - INTEGER (Forces the input to Int)
10     - DOUBLE
11     - CURRENCY (Formats the values to currency notation)
12     - VARCHAR (no format check, maxlength: 255)
13     - TEXT (no format check)
14     - DATE (Dateformat, automatic conversion to timestamps)
15
16     Formtype:
17     - TEXT (Textfield)
18     - TEXTAREA (Textarea)
19     - PASSWORD (Password textfield, input is not shown when edited)
20     - SELECT (Select option field)
21     - RADIO
22     - CHECKBOX
23     - CHECKBOXARRAY
24     - FILE
25
26     VALUE:
27     - Wert oder Array
28
29     Hint:
30     The ID field of the database table is not part of the datafield definition.
31     The ID field must be always auto incement (int or bigint).
b1a6a5 32
921224 33     Search:
F 34     - searchable = 1 or searchable = 2 include the field in the search
35     - searchable = 1: this field will be the title of the search result
36     - searchable = 2: this field will be included in the description of the search result
ef55b5 37
F 38
39 */
40
b1a6a5 41 $form["title"]    = "Directive Snippets";
MC 42 $form["description"]  = "";
43 $form["name"]    = "directive_snippets";
44 $form["action"]   = "directive_snippets_edit.php";
45 $form["db_table"]  = "directive_snippets";
46 $form["db_table_idx"] = "directive_snippets_id";
47 $form["db_history"]  = "yes";
48 $form["tab_default"] = "directive_snippets";
49 $form["list_default"] = "directive_snippets_list.php";
50 $form["auth"]   = 'yes'; // yes / no
ef55b5 51
F 52 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
53 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
54 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
55 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
56 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
57
58 $form["tabs"]['directive_snippets'] = array (
b1a6a5 59     'title'  => "Directive Snippets",
MC 60     'width'  => 100,
61     'template'  => "templates/directive_snippets_edit.htm",
62     'fields'  => array (
63         //#################################
64         // Begin Datatable fields
65         //#################################
ef55b5 66         'name' => array (
b1a6a5 67             'datatype' => 'VARCHAR',
MC 68             'formtype' => 'TEXT',
69             'validators' => array (  0 =>  array (    'type' => 'NOTEMPTY',
70                     'errmsg'=> 'directive_snippets_name_empty'),
71                 1 => array ( 'type' => 'UNIQUE',
72                     'errmsg'=> 'directive_snippets_name_error_unique'),
73             ),
74             'default' => '',
75             'value'  => '',
76             'width'  => '30',
77             'maxlength' => '255',
921224 78             'searchable' => 1
ef55b5 79         ),
F 80         'type' => array (
b1a6a5 81             'datatype' => 'VARCHAR',
MC 82             'formtype' => 'SELECT',
83             'default' => '',
84             'value'  => array('apache' => 'Apache', 'nginx' => 'nginx', 'php' => 'PHP', 'proxy' => 'Proxy'),
921224 85             'searchable' => 2
ef55b5 86         ),
F 87         'snippet' => array (
b1a6a5 88             'datatype' => 'TEXT',
MC 89             'formtype' => 'TEXT',
90             'default' => '',
91             'value'  => '',
92             'width'  => '30',
93             'maxlength' => '255',
921224 94             'searchable' => 2
ef55b5 95         ),
1fa8f4 96         'customer_viewable' => array (
FT 97             'datatype' => 'VARCHAR',
98             'formtype' => 'CHECKBOX',
99             'default' => 'n',
100             'value'  => array(0 => 'n', 1 => 'y')
101         ),
ef55b5 102         'active' => array (
b1a6a5 103             'datatype' => 'VARCHAR',
MC 104             'formtype' => 'CHECKBOX',
105             'default' => 'y',
106             'value'  => array(0 => 'n', 1 => 'y')
ef55b5 107         ),
b41803 108         'required_php_snippets' => array (
MC 109             'datatype' => 'VARCHAR',
110             'formtype' => 'CHECKBOXARRAY',
111             'default' => '',
112             'datasource' => array (  'type' => 'SQL',
d22277 113                 'querystring' => "SELECT directive_snippets_id,name FROM directive_snippets WHERE type = 'php' AND active = 'y' AND master_directive_snippets_id = 0 ORDER BY name",
b41803 114                 'keyfield' => 'directive_snippets_id',
MC 115                 'valuefield' => 'name'
116             ),
117             'separator' => ',',
118         ),
b1a6a5 119         //#################################
MC 120         // ENDE Datatable fields
121         //#################################
ef55b5 122     )
F 123 );
124
125
b1a6a5 126 ?>