|
| 1 | +<?php |
| 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). |
| 32 | +
|
| 33 | +
|
| 34 | +*/ |
| 35 | +global $app; |
| 36 | + |
| 37 | +$form["title"] = "DNS NAPTR"; |
| 38 | +$form["description"] = ""; |
| 39 | +$form["name"] = "dns_naptr"; |
| 40 | +$form["action"] = "dns_naptr_edit.php"; |
| 41 | +$form["db_table"] = "dns_rr"; |
| 42 | +$form["db_table_idx"] = "id"; |
| 43 | +$form["db_history"] = "yes"; |
| 44 | +$form["tab_default"] = "dns"; |
| 45 | +$form["list_default"] = "dns_a_list.php"; |
| 46 | +$form["auth"] = 'yes'; // yes / no |
| 47 | + |
| 48 | +$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user |
| 49 | +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user |
| 50 | +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| 51 | +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| 52 | +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete |
| 53 | + |
| 54 | +$form["tabs"]['dns'] = array ( |
| 55 | + 'title' => "DNS NAPTR", |
| 56 | + 'width' => 100, |
| 57 | + 'template' => "templates/dns_naptr_edit.htm", |
| 58 | + 'fields' => array ( |
| 59 | + //################################# |
| 60 | + // Begin Datatable fields |
| 61 | + //################################# |
| 62 | + 'server_id' => array ( |
| 63 | + 'datatype' => 'INTEGER', |
| 64 | + 'formtype' => 'SELECT', |
| 65 | + 'default' => '', |
| 66 | + 'value' => '', |
| 67 | + 'width' => '30', |
| 68 | + 'maxlength' => '255' |
| 69 | + ), |
| 70 | + 'zone' => array ( |
| 71 | + 'datatype' => 'INTEGER', |
| 72 | + 'formtype' => 'TEXT', |
| 73 | + 'default' => @$app->functions->intval($_REQUEST["zone"]), |
| 74 | + 'value' => '', |
| 75 | + 'width' => '30', |
| 76 | + 'maxlength' => '255' |
| 77 | + ), |
| 78 | + 'name' => array ( |
| 79 | + 'datatype' => 'VARCHAR', |
| 80 | + 'formtype' => 'TEXT', |
| 81 | + 'filters' => array( |
| 82 | + 0 => array( 'event' => 'SAVE', |
| 83 | + 'type' => 'IDNTOASCII'), |
| 84 | + 1 => array( 'event' => 'SHOW', |
| 85 | + 'type' => 'IDNTOUTF8'), |
| 86 | + 2 => array( 'event' => 'SAVE', |
| 87 | + 'type' => 'TOLOWER') |
| 88 | + ), |
| 89 | + 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| 90 | + 'regex' => '/^((\*|[a-zA-Z0-9\-_]{1,255})(\.[a-zA-Z0-9\-_]{1,255})*\.?)?$/', |
| 91 | + 'errmsg'=> 'name_error_regex'), |
| 92 | + ), |
| 93 | + 'default' => '', |
| 94 | + 'value' => '', |
| 95 | + 'width' => '30', |
| 96 | + 'maxlength' => '1024' |
| 97 | + ), |
| 98 | + 'type' => array ( |
| 99 | + 'datatype' => 'VARCHAR', |
| 100 | + 'formtype' => 'TEXT', |
| 101 | + 'default' => 'NAPTR', |
| 102 | + 'value' => '', |
| 103 | + 'width' => '5', |
| 104 | + 'maxlength' => '5' |
| 105 | + ), |
| 106 | + 'data' => array ( |
| 107 | + 'datatype' => 'VARCHAR', |
| 108 | + 'formtype' => 'TEXT', |
| 109 | + 'validators' => array ( |
| 110 | + 0 => array ( |
| 111 | + 'type' => 'NOTEMPTY', |
| 112 | + 'errmsg'=> 'data_error_empty'), |
| 113 | + 1 => array ( |
| 114 | + 'type' => 'REGEX', |
| 115 | + // matching: 'pref "flags" "service" "regexp" replacement.' |
| 116 | + 'regex' => '/^\s*(\d+)\s+"([a-zA-Z0-9]*)"\s+"([^"]*)"\s+"(.*)"\s+([^\s]*\.)\s*$/', |
| 117 | + 'errmsg'=> 'naptr_error_regex'), |
| 118 | + ), |
| 119 | + 'default' => '100 "" "" "" .', |
| 120 | + 'value' => '', |
| 121 | + 'width' => '30', |
| 122 | + 'maxlength' => '1024' |
| 123 | + ), |
| 124 | + 'aux' => array ( |
| 125 | + 'datatype' => 'INTEGER', |
| 126 | + 'formtype' => 'TEXT', |
| 127 | + 'default' => '100', |
| 128 | + 'value' => '', |
| 129 | + 'width' => '10', |
| 130 | + 'maxlength' => '10' |
| 131 | + ), |
| 132 | + 'ttl' => array ( |
| 133 | + 'datatype' => 'INTEGER', |
| 134 | + 'formtype' => 'TEXT', |
| 135 | + 'validators' => array ( 0 => array ( 'type' => 'RANGE', |
| 136 | + 'range' => '60:', |
| 137 | + 'errmsg'=> 'ttl_range_error'), |
| 138 | + ), |
| 139 | + 'default' => '3600', |
| 140 | + 'value' => '', |
| 141 | + 'width' => '10', |
| 142 | + 'maxlength' => '10' |
| 143 | + ), |
| 144 | + 'active' => array ( |
| 145 | + 'datatype' => 'VARCHAR', |
| 146 | + 'formtype' => 'CHECKBOX', |
| 147 | + 'default' => 'Y', |
| 148 | + 'value' => array(0 => 'N', 1 => 'Y') |
| 149 | + ), |
| 150 | + 'stamp' => array ( |
| 151 | + 'datatype' => 'VARCHAR', |
| 152 | + 'formtype' => 'TEXT', |
| 153 | + 'default' => '', |
| 154 | + 'value' => '', |
| 155 | + 'width' => '30', |
| 156 | + 'maxlength' => '255' |
| 157 | + ), |
| 158 | + 'serial' => array ( |
| 159 | + 'datatype' => 'INTEGER', |
| 160 | + 'formtype' => 'TEXT', |
| 161 | + 'default' => '', |
| 162 | + 'value' => '', |
| 163 | + 'width' => '10', |
| 164 | + 'maxlength' => '10' |
| 165 | + ), |
| 166 | + //################################# |
| 167 | + // END Datatable fields |
| 168 | + //################################# |
| 169 | + ) |
| 170 | +); |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | +?> |
0 commit comments