- Timestamp:
- Dec 18, 2005 12:16:03 AM (18 years ago)
- Location:
- trunk/bin
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/file_importer.php
r41 r42 27 27 $file_text = join('', file($file)); 28 28 fclose($fp); 29 29 30 30 // Do something with file contents. 31 31 preg_match('/BALANCE:\s*\$([\.\d]+)/', $file_text, $amt); … … 68 68 69 69 /** 70 * Find all files in directories recursivly with a specified file extension. 70 * Find all files in directories recursivly with a specified file extension. 71 71 * 72 72 * @param string $dir the full path to the directory to scan … … 80 80 { 81 81 static $output; 82 82 83 83 $dir_handle = opendir($dir); 84 84 while ($dir_handle && ($file = readdir($dir_handle)) !== false) { -
trunk/bin/module_maker/form_template.cli.php
r41 r42 40 40 if (is_array($cols) && !empty($cols)) { 41 41 foreach ($cols as $col) { 42 42 43 43 // Human readable. 44 44 $field = $col[0]; … … 48 48 $primary_key_field = $field; 49 49 } 50 50 51 51 // Column types like this are usually single toggle checkboxes. 52 52 if (preg_match("/enum\('true'\)/", $col[1])) { 53 53 $type = 'toggle'; 54 54 } 55 55 56 56 if (in_array($field, $exclude) || $primary_key_field == $field) { 57 57 // Don't add a field for this column. 58 58 continue; 59 59 } 60 60 61 61 // Select menu from the column of a related database table. 62 62 if (preg_match('/.*_id$/i', $field)) { … … 79 79 continue; 80 80 } 81 81 82 82 // File upload. 83 83 if (preg_match('/file|image/i', $field)) { … … 96 96 continue; 97 97 } 98 98 99 99 // Password field. 100 100 if (preg_match('/pass/i', $field)) { … … 109 109 continue; 110 110 } 111 111 112 112 switch ($type) { 113 113 114 114 // Select menu (or radio buttons) 115 115 case 'enum' : … … 125 125 E_O_F; 126 126 break; 127 127 128 128 // Set checkboxes 129 129 case 'set' : … … 137 137 E_O_F; 138 138 break; 139 139 140 140 // Single checkbox 141 141 case 'toggle' : … … 149 149 E_O_F; 150 150 break; 151 151 152 152 // Textarea 153 153 case 'tinytext' : … … 168 168 E_O_F; 169 169 break; 170 171 170 171 172 172 // Text 173 173 case 'tinyint' : … … 179 179 case 'integer' : 180 180 case 'bigint' : 181 181 182 182 case 'float' : 183 183 case 'float' : … … 188 188 case 'dec' : 189 189 case 'numeric' : 190 190 191 191 case 'date' : 192 192 case 'datetime' : … … 194 194 case 'time' : 195 195 case 'year' : 196 196 197 197 case 'char' : 198 198 case 'varchar' : -
trunk/bin/module_maker/list_template.cli.php
r41 r42 49 49 if (is_array($cols) && !empty($cols)) { 50 50 foreach ($cols as $col) { 51 51 52 52 // Human readable. 53 53 $field = $col[0]; 54 54 $title = ucfirst(str_replace('_', ' ', $field)); 55 55 $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]); 56 56 57 57 // Get primary key. 58 58 if ('PRI' == $col[3]) { 59 59 $primary_key = $field; 60 60 } 61 61 62 62 // Column headers. 63 63 $headers[$field] = $title; 64 64 65 65 // Column data. 66 66 if (preg_match("/enum\('true'\)/", $col[1])) { … … 111 111 <span class="nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span> 112 112 <br /> 113 113 114 114 <input type="text" class="small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" /> 115 115 <select name="filter_<##>"> -
trunk/bin/module_maker/module.cli.php
r41 r42 17 17 } else { 18 18 die(basename($_SERVER['argv'][0]) . " Error: invalid arguments. Try like this: 19 19 20 20 " . basename($_SERVER['argv'][0]) . " site_directory name_singular name_plural [clean] 21 21 … … 46 46 break; 47 47 default : 48 48 49 49 } 50 50 … … 91 91 trashFile("$public_dir/$public_script"); 92 92 trashFile("$public_tpl_dir/$public_list_template"); 93 trashFile("$public_tpl_dir/$public_detail_template"); 93 trashFile("$public_tpl_dir/$public_detail_template"); 94 94 echo "End file cleanup\n"; 95 95 die; … … 163 163 if (is_array($cols) && !empty($cols)) { 164 164 foreach ($cols as $col) { 165 165 166 166 // Human readable. 167 167 $field = $col[0]; … … 169 169 $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]); 170 170 $default = $col[4]; 171 171 172 172 // Get primary key. 173 173 // if ('PRI' == $col[3]) { 174 174 // $primary_key = $field; 175 175 // } 176 176 177 177 // Our form will require type="multipart/form-data". 178 178 if (preg_match('/file|image/i', $field)) { 179 179 $upload_file_capability = true; 180 180 } 181 181 182 182 // Column headers. 183 183 $headers[$field] = $field_title; 184 184 185 185 // Get php code for printing variables. 186 186 $public_list_page_vars[] = "<\x3fphp echo oTxt(\$" . $module_name_singular . "_list[\$i]['$field']); \x3f>"; … … 222 222 // Form arguments 223 223 $replace['admin_form_tag_init'] = "<form enctype=\"multipart/form-data\" method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\">\n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"<##>\" />"; 224 224 225 225 // Include statement. 226 226 $replace['admin_upload_include'] = "require_once 'codebase/lib/Upload.inc.php';\n"; … … 245 245 // Copy uploaded image name into form data. 246 246 \$_POST['<##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : ''; 247 247 248 248 249 249 E_O_F; … … 261 261 $replace['admin_upload_insert'] = <<<E_O_F 262 262 263 263 // Upload files with prepended primary key. 264 264 \$new_file = \$upload->process('<##>', \$%PRIMARY_KEY% . '_' . getFormData('<##>')); 265 265 … … 443 443 if ('var' == $op) { 444 444 if (isset($replace[$_SERVER['argv'][5]])) { 445 445 echo "\n\n" . $replace[$_SERVER['argv'][5]] . "\n\n"; 446 446 } else if (isset($skel_files[$_SERVER['argv'][5]])) { 447 447 echo "\n\n" . preg_replace($search, $replace, $skel_files[$_SERVER['argv'][5]]) . "\n\n"; … … 540 540 global $user_trash_folder; 541 541 static $file_prefix; 542 542 543 543 if (!isset($file_prefix)) { 544 544 $file_prefix = time(); … … 546 546 $file_prefix++; 547 547 } 548 548 549 549 // Make user trash folder. 550 550 if (!dir($user_trash_folder)) { -
trunk/bin/module_maker/skel/adm_list.ihtml
r41 r42 7 7 <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span> 8 8 <br /> 9 9 10 10 <input type="text" class="small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: <##> %SEARCH_FIELDS%.")); ?>" /> 11 11 <select name="filter_<##>"> -
trunk/bin/module_maker/skel/admin.php
r41 r42 26 26 * CONFIG 27 27 *****************************************************************************/ 28 28 29 29 // Titles and navigation header. 30 30 $nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']); 31 31 32 32 // The object to validate form input. 33 33 $fv = new FormValidator(); … … 215 215 // Get the information for the form. 216 216 $qid = DB::query(" 217 SELECT * 217 SELECT * 218 218 FROM %DB_TBL% 219 219 WHERE %PRIMARY_KEY% = '" . addslashes($id) . "' … … 227 227 // Lock this record. 228 228 $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['<##>']); 229 229 230 230 // Set misc values for the form. 231 231 $frm = array_merge(array( … … 246 246 { 247 247 global $lock; 248 248 249 249 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); 250 250 if ($lock->isLocked() && !$lock->isMine()) { … … 254 254 // Break the cache because we are changing the list data. 255 255 SessionCache::breakCache($_SERVER['PHP_SELF']); 256 256 257 257 // Get the information for this object. 258 258 $qid = DB::query(" 259 SELECT <##> 259 SELECT <##> 260 260 FROM %DB_TBL% 261 261 WHERE %PRIMARY_KEY% = '" . addslashes($id) . "' … … 266 266 App::dieBoomerangURL(); 267 267 } 268 268 269 269 // Delete the record. 270 270 DB::query("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'"); 271 271 272 272 App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__); 273 273 … … 279 279 { 280 280 global $auth; 281 281 282 282 // Break the cache because we are changing the list data. 283 283 SessionCache::breakCache($_SERVER['PHP_SELF']); 284 284 285 285 %INSERT% 286 286 $last_insert_id = mysql_insert_id(DB::getDBH()); … … 289 289 $version = RecordVersion::getInstance($GLOBALS['auth']); 290 290 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['<##>']); 291 291 292 292 App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been added."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__); 293 293 294 294 return $last_insert_id; 295 295 } … … 298 298 { 299 299 global $auth, $lock; 300 300 301 301 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']); 302 302 if ($lock->isLocked() && !$lock->isMine()) { … … 308 308 309 309 %UPDATE% 310 310 311 311 // Create version. 312 312 $version = RecordVersion::getInstance($GLOBALS['auth']); … … 323 323 global $page; 324 324 global $so; 325 325 326 326 $where_clause = ''; 327 327 328 328 // Build search query if available. 329 329 if (getFormData('search_query', false)) { … … 333 333 } 334 334 } 335 335 336 336 if (getFormData('filter_<##>', false)) { 337 337 // Limit by filter. 338 338 $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " <##> = '" . addslashes(getFormData('filter_<##>')) . "'"; 339 339 } 340 340 341 341 // Count the total number of records so we can do something about the page numbers. 342 342 $qid = DB::query(" 343 SELECT COUNT(*) 344 FROM %DB_TBL% 343 SELECT COUNT(*) 344 FROM %DB_TBL% 345 345 $where_clause 346 346 "); 347 347 list($num_results) = mysql_fetch_row($qid); 348 348 349 349 // Set page numbers now we know (needed for next step). 350 350 $page->setTotalItems($num_results); 351 351 $page->calculate(); 352 352 353 353 // Final SQL, with sort and page limiters. 354 354 $sql = " 355 SELECT 356 %DB_TBL%.*, 355 SELECT 356 %DB_TBL%.*, 357 357 a1.username AS added_admin_username, 358 358 a2.username AS modified_admin_username … … 364 364 " . $page->getLimitSQL() . " 365 365 "; 366 366 367 367 // A unique key for this query, with the total_items in case db records 368 368 // were added since the last cache. This identifies a unique set of … … 375 375 Prefs::setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']); 376 376 } 377 377 378 378 if (SessionCache::isCached($_SERVER['PHP_SELF'])) { 379 379 // Get the cached results. … … 386 386 $list[] = $row; 387 387 } 388 388 389 389 if (isset($list) && !empty($list)) { 390 390 // Cache the results. … … 397 397 398 398 function updateRank($ranks) 399 { 399 { 400 400 if (!is_array($ranks)) { 401 401 App::logMsg('Saving rank failed, data posted is not an array: ' . $ranks, LOG_ERR, __FILE__, __LINE__); … … 405 405 // Break the cache because we are changing the list data. 406 406 SessionCache::breakCache($_SERVER['PHP_SELF']); 407 407 408 408 // Count the ranks with invalid numbers 409 409 $unspecified_counter = 0; 410 410 411 411 // Go through the array of new ranks. 412 412 foreach ($ranks as $id => $new_rank) { … … 414 414 // Unspecified entries receive a sort order of 10000. 415 415 $new_rank = 10000; 416 $unspecified_counter++; 416 $unspecified_counter++; 417 417 } 418 418 DB::query(" … … 422 422 "); 423 423 } 424 424 425 425 App::raiseMsg(_("Records have been reordered with the new rank."), MSG_SUCCESS, __FILE__, __LINE__); 426 426 if ($unspecified_counter > 0) { -
trunk/bin/module_maker/skel/public.php
r41 r42 1 1 <?php 2 2 /** 3 * %PUBLIC_SCRIPT% 3 * %PUBLIC_SCRIPT% 4 4 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information 5 5 * … … 18 18 // Titles and navigation header. 19 19 $nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']); 20 $nav->setFeature(array('title'=>true)); 20 $nav->setFeature(array('title'=>true)); 21 21 22 22 // Instantiate page numbers. Total items are set and calculation is done in the getRecordList function. … … 32 32 33 33 if (getFormData('%PRIMARY_KEY%', false)) { 34 34 35 35 // Get requested record. 36 36 $qid = DB::query(" … … 52 52 WHERE %PRIMARY_KEY% = '" . addslashes(getFormData('%PRIMARY_KEY%')) . "' 53 53 "); 54 54 55 55 // Set title and main template. 56 56 $nav->addPage($item['<##>']); … … 58 58 59 59 } else { 60 60 61 61 // Get the DEFAULT list. 62 62 $%NAME_SINGULAR%_list = array(); 63 63 $qid = DB::query(" 64 SELECT * 65 FROM %DB_TBL% 66 WHERE publish = 'true' 64 SELECT * 65 FROM %DB_TBL% 66 WHERE publish = 'true' 67 67 " . $so->getSortOrderSQL() . " 68 68 LIMIT 100 … … 71 71 $%NAME_SINGULAR%_list[] = $row; 72 72 } 73 73 74 74 // Set page numbers for default list. 75 75 $page->setTotalItems(sizeof($%NAME_SINGULAR%_list)); 76 76 $page->calculate(); 77 77 78 78 79 79 // Get the FEATURED list. 80 80 $featured_list = array(); 81 81 $qid = DB::query(" 82 SELECT * 83 FROM %DB_TBL% 82 SELECT * 83 FROM %DB_TBL% 84 84 WHERE publish = 'true' 85 85 AND featured = 'true' … … 89 89 $featured_list[] = $row; 90 90 } 91 91 92 92 // Get the POPULAR list. 93 93 $popular_list = array(); 94 94 $qid = DB::query(" 95 SELECT * 96 FROM %DB_TBL% 97 WHERE publish = 'true' 95 SELECT * 96 FROM %DB_TBL% 97 WHERE publish = 'true' 98 98 ORDER BY hit_count DESC LIMIT 10 99 99 "); … … 101 101 $popular_list[] = $row; 102 102 } 103 103 104 104 // Get the RECENT list. 105 105 $recent_list = array(); 106 106 $qid = DB::query(" 107 SELECT * 108 FROM %DB_TBL% 109 WHERE publish = 'true' 107 SELECT * 108 FROM %DB_TBL% 109 WHERE publish = 'true' 110 110 ORDER BY added_datetime DESC LIMIT 10 111 111 "); … … 113 113 $recent_list[] = $row; 114 114 } 115 115 116 116 // Set main template. 117 117 $main_template = '%PUBLIC_LIST_TEMPLATE%'; 118 } 118 } 119 119 120 120 // We have the data, and no errors, so here come the templates. -
trunk/bin/module_maker/skel/public_list.ihtml
r41 r42 11 11 <p> 12 12 <em><?php echo date(App::getParam('date_format'), strtotime($%NAME_SINGULAR%_list[$i]['<##>'])); ?></em> — <?php echo nl2br(fancyTxt(oTxt($%NAME_SINGULAR%_list[$i]['summary'], true))); ?> 13 13 14 14 <?php if (strlen(trim($%NAME_SINGULAR%_list[$i]['content'])) > 0) { // Link only if content is available. ?> 15 15 <br /><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $%NAME_SINGULAR%_list[$i]['%PRIMARY_KEY%']); ?>"><?php echo _("Read more"); ?></a> 16 16 <?php } ?> 17 17 </p> 18 <?php 18 <?php 19 19 } 20 20 if ($page->total_pages > 1) { … … 30 30 ?> 31 31 <h2><?php echo _("Featured %NAME_PLURAL%"); ?></h2> 32 <?php 32 <?php 33 33 foreach ($featured_list as $item) { 34 ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a></h4><?php 34 ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a></h4><?php 35 35 } 36 36 } … … 42 42 ?> 43 43 <h2><?php echo _("Popular %NAME_PLURAL%"); ?></h2> 44 <?php 44 <?php 45 45 foreach ($popular_list as $item) { 46 ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php 46 ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php 47 47 } 48 48 } … … 54 54 ?> 55 55 <h2><?php echo _("Recent %NAME_PLURAL%"); ?></h2> 56 <?php 56 <?php 57 57 foreach ($recent_list as $item) { 58 ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php 58 ?><h4><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $item['%PRIMARY_KEY%']); ?>"><?php echo fancyTxt(oTxt($item['title'])); ?></a> </h4><?php 59 59 } 60 60 } -
trunk/bin/module_maker/sql.cli.php
r41 r42 56 56 if (is_array($cols) && !empty($cols)) { 57 57 foreach ($cols as $col) { 58 58 59 59 // Human readable. 60 60 $field = $col[0]; 61 61 $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]); 62 62 $is_primary_key = ('PRI' == $col[3]); 63 63 64 64 $sort_columns .= "\$so->setColumn('$field', '$field ASC', '$field DESC');\n"; 65 65 66 66 if ($is_primary_key) { 67 67 // This is the primary key. Deal with separately. … … 84 84 } 85 85 } 86 86 87 87 } else { 88 88 die(basename($_SERVER['argv'][0]) . " Warning: $db_tbl does not have any columns.\n"); -
trunk/bin/module_maker/validation.cli.php
r41 r42 38 38 // Loop through columns 39 39 if (is_array($cols) && !empty($cols)) { 40 40 41 41 $o = array(); 42 42 43 43 foreach ($cols as $col) { 44 44 45 45 // Human readable. 46 46 $field = $col[0]; … … 49 49 $is_primary_key = ('PRI' == $col[3]); 50 50 $unsigned = preg_match('/\s*unsigned\s*$/i', $col[1]); 51 51 52 52 if (in_array($field, $exclude)) { 53 53 continue; 54 54 } 55 55 56 56 // ----------- isEmpty ------------ 57 57 $o[] = "\$fv->isEmpty('$field', _(\"<strong>$title</strong> cannot be blank.\"));"; … … 68 68 $len_type = 'setenum'; 69 69 break; 70 70 71 71 case 'date' : 72 72 case 'datetime' : … … 77 77 $max_length = 127; 78 78 break; 79 79 80 80 case 'tinytext' : 81 81 case 'tinyblob' : … … 85 85 $max_length = 255; 86 86 break; 87 87 88 88 case 'text' : 89 89 case 'blob' : … … 91 91 $max_length = 65535; 92 92 break; 93 93 94 94 case 'mediumtext' : 95 95 case 'mediumblob' : … … 97 97 $max_length = 16777215; 98 98 break; 99 99 100 100 case 'longtext' : 101 101 case 'longblob' : … … 103 103 $max_length = 4294967295; 104 104 break; 105 105 106 106 case 'tinyint' : 107 107 case 'bit' : … … 116 116 } 117 117 break; 118 118 119 119 case 'smallint' : 120 120 $len_type = 'num'; … … 127 127 } 128 128 break; 129 129 130 130 case 'mediumint' : 131 131 $len_type = 'num'; … … 138 138 } 139 139 break; 140 140 141 141 case 'int' : 142 142 case 'integer' : … … 150 150 } 151 151 break; 152 152 153 153 case 'bigint' : 154 154 $len_type = 'num'; … … 161 161 } 162 162 break; 163 163 164 164 case 'float' : 165 165 $len_type = 'num'; … … 167 167 $max = 3.40282E+38; 168 168 break; 169 169 170 170 case 'double' : 171 171 case 'double precision' : … … 178 178 $max = 1.79769E+308; 179 179 break; 180 180 181 181 default : 182 182 $len_type = null; … … 192 192 $o[] = "\$fv->numericRange('$field', $min, $max, _(\"<strong>$title</strong> must be a valid number between $min and $max.\"));"; 193 193 } 194 194 195 195 // ----------- type check ------------ 196 196 switch ($type) { 197 197 198 198 case 'enum' : 199 199 200 200 case 'set' : 201 201 break; 202 202 203 203 case 'char' : 204 204 case 'varchar' : 205 205 206 206 case 'tinytext' : 207 207 case 'text' : … … 214 214 // $o[] = "\$fv->isString('$field', _(\"<strong>$title</strong> must be a string.\"));"; // Pretty useless 215 215 break; 216 216 217 217 case 'tinyint' : 218 218 case 'bit' : … … 226 226 $o[] = "\$fv->isInteger('$field', _(\"<strong>$title</strong> must be an integer.\")$negative_ok);"; 227 227 break; 228 228 229 229 case 'float' : 230 230 case 'float' : … … 238 238 $o[] = "\$fv->isFloat('$field', _(\"<strong>$title</strong> must be a valid number.\")$negative_ok);"; 239 239 break; 240 240 241 241 case 'date' : 242 242 case 'datetime' : … … 244 244 $o[] = "\$fv->checkRegex('$field', '/^\d{4}-\d{2}-\d{2}$/', true, _(\"<strong>$title</strong> must be a valid date in YYYY-MM-DD format.\"));"; 245 245 break; 246 246 247 247 case 'timestamp' : 248 248 $o[] = "\$fv->checkRegex('$field', '/^\d{14}$/', true, _(\"<strong>$title</strong> must be a valid mysql timestamp in YYYYMMDDhhmmss format.\"));"; 249 249 break; 250 250 251 251 case 'time' : 252 252 $o[] = "\$fv->checkRegex('$field', '/^\d{1,3}:\d{2}:\d{2}$/', true, _(\"<strong>$title</strong> must be a valid time in hh:mm:ss format.\"));"; 253 253 break; 254 254 255 255 case 'year' : 256 256 $o[] = "\$fv->checkRegex('$field', '/^\d{4}$/', true, _(\"<strong>$title</strong> must be a valid year in YYYY format.\"));"; 257 257 break; 258 258 259 259 default : 260 260 break; 261 261 } 262 262 263 263 if (preg_match('/email/', $field)) { 264 264 $o[] = "\$fv->validateEmail('$field');"; … … 266 266 $o[] = "\$fv->validatePhone('$field');"; 267 267 } 268 268 269 269 // Blank between cols? 270 270 $o[] = ''; … … 278 278 279 279 echo "function validateInput() 280 { 280 { 281 281 global \$fv; 282 282
Note: See TracChangeset
for help on using the changeset viewer.