Changeset 42 for trunk/bin


Ignore:
Timestamp:
Dec 18, 2005 12:16:03 AM (18 years ago)
Author:
scdev
Message:

detabbed all files ;P

Location:
trunk/bin
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/file_importer.php

    r41 r42  
    2727            $file_text = join('', file($file));
    2828            fclose($fp);
    29            
     29
    3030            // Do something with file contents.
    3131            preg_match('/BALANCE:\s*\$([\.\d]+)/', $file_text, $amt);
     
    6868
    6969/**
    70  * Find all files in directories recursivly with a specified file extension. 
     70 * Find all files in directories recursivly with a specified file extension.
    7171 *
    7272 * @param  string $dir               the full path to the directory to scan
     
    8080{
    8181    static $output;
    82    
     82
    8383    $dir_handle = opendir($dir);
    8484    while ($dir_handle && ($file = readdir($dir_handle)) !== false) {
  • trunk/bin/module_maker/form_template.cli.php

    r41 r42  
    4040if (is_array($cols) && !empty($cols)) {
    4141    foreach ($cols as $col) {
    42        
     42
    4343        // Human readable.
    4444        $field = $col[0];
     
    4848            $primary_key_field = $field;
    4949        }
    50        
     50
    5151        // Column types like this are usually single toggle checkboxes.
    5252        if (preg_match("/enum\('true'\)/", $col[1])) {
    5353            $type = 'toggle';
    5454        }
    55        
     55
    5656        if (in_array($field, $exclude) || $primary_key_field == $field) {
    5757            // Don't add a field for this column.
    5858            continue;
    5959        }
    60        
     60
    6161        // Select menu from the column of a related database table.
    6262        if (preg_match('/.*_id$/i', $field)) {
     
    7979            continue;
    8080        }
    81        
     81
    8282        // File upload.
    8383        if (preg_match('/file|image/i', $field)) {
     
    9696            continue;
    9797        }
    98        
     98
    9999        // Password field.
    100100        if (preg_match('/pass/i', $field)) {
     
    109109            continue;
    110110        }
    111        
     111
    112112        switch ($type) {
    113        
     113
    114114        // Select menu (or radio buttons)
    115115        case 'enum' :
     
    125125E_O_F;
    126126            break;
    127        
     127
    128128        // Set checkboxes
    129129        case 'set' :
     
    137137E_O_F;
    138138            break;
    139        
     139
    140140        // Single checkbox
    141141        case 'toggle' :
     
    149149E_O_F;
    150150            break;
    151            
     151
    152152        // Textarea
    153153        case 'tinytext' :
     
    168168E_O_F;
    169169            break;
    170        
    171            
     170
     171
    172172        // Text
    173173        case 'tinyint' :
     
    179179        case 'integer' :
    180180        case 'bigint' :
    181        
     181
    182182        case 'float' :
    183183        case 'float' :
     
    188188        case 'dec' :
    189189        case 'numeric' :
    190        
     190
    191191        case 'date' :
    192192        case 'datetime' :
     
    194194        case 'time' :
    195195        case 'year' :
    196        
     196
    197197        case 'char' :
    198198        case 'varchar' :
  • trunk/bin/module_maker/list_template.cli.php

    r41 r42  
    4949if (is_array($cols) && !empty($cols)) {
    5050    foreach ($cols as $col) {
    51        
     51
    5252        // Human readable.
    5353        $field = $col[0];
    5454        $title = ucfirst(str_replace('_', ' ', $field));
    5555        $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
    56        
     56
    5757        // Get primary key.
    5858        if ('PRI' == $col[3]) {
    5959            $primary_key = $field;
    6060        }
    61        
     61
    6262        // Column headers.
    6363        $headers[$field] = $title;
    64        
     64
    6565        // Column data.
    6666        if (preg_match("/enum\('true'\)/", $col[1])) {
     
    111111    <span class="nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span>
    112112    <br />
    113    
     113
    114114    <input type="text" class="small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" />
    115115    <select name="filter_<##>">
  • trunk/bin/module_maker/module.cli.php

    r41 r42  
    1717} else {
    1818    die(basename($_SERVER['argv'][0]) . " Error: invalid arguments. Try like this:
    19    
     19
    2020    " . basename($_SERVER['argv'][0]) . " site_directory name_singular name_plural [clean]
    2121
     
    4646    break;
    4747default :
    48    
     48
    4949}
    5050
     
    9191    trashFile("$public_dir/$public_script");
    9292    trashFile("$public_tpl_dir/$public_list_template");
    93     trashFile("$public_tpl_dir/$public_detail_template");   
     93    trashFile("$public_tpl_dir/$public_detail_template");
    9494    echo "End file cleanup\n";
    9595    die;
     
    163163if (is_array($cols) && !empty($cols)) {
    164164    foreach ($cols as $col) {
    165        
     165
    166166        // Human readable.
    167167        $field = $col[0];
     
    169169        $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
    170170        $default = $col[4];
    171        
     171
    172172        // Get primary key.
    173173//         if ('PRI' == $col[3]) {
    174174//             $primary_key = $field;
    175175//         }
    176        
     176
    177177        // Our form will require type="multipart/form-data".
    178178        if (preg_match('/file|image/i', $field)) {
    179179            $upload_file_capability = true;
    180180        }
    181        
     181
    182182        // Column headers.
    183183        $headers[$field] = $field_title;
    184        
     184
    185185        // Get php code for printing variables.
    186186        $public_list_page_vars[] = "<\x3fphp echo oTxt(\$" . $module_name_singular . "_list[\$i]['$field']); \x3f>";
     
    222222    // Form arguments
    223223    $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
    225225    // Include statement.
    226226    $replace['admin_upload_include'] = "require_once 'codebase/lib/Upload.inc.php';\n";
     
    245245// Copy uploaded image name into form data.
    246246\$_POST['<##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : '';
    247  
     247
    248248
    249249E_O_F;
     
    261261    $replace['admin_upload_insert'] = <<<E_O_F
    262262
    263         // Upload files with prepended primary key.
     263        // Upload files with prepended primary key.
    264264        \$new_file = \$upload->process('<##>',  \$%PRIMARY_KEY% . '_' . getFormData('<##>'));
    265265
     
    443443if ('var' == $op) {
    444444    if (isset($replace[$_SERVER['argv'][5]])) {
    445         echo "\n\n" . $replace[$_SERVER['argv'][5]] . "\n\n";
     445        echo "\n\n" . $replace[$_SERVER['argv'][5]] . "\n\n";
    446446    } else if (isset($skel_files[$_SERVER['argv'][5]])) {
    447447        echo "\n\n" . preg_replace($search, $replace, $skel_files[$_SERVER['argv'][5]]) . "\n\n";
     
    540540    global $user_trash_folder;
    541541    static $file_prefix;
    542    
     542
    543543    if (!isset($file_prefix)) {
    544544        $file_prefix = time();
     
    546546        $file_prefix++;
    547547    }
    548    
     548
    549549    // Make user trash folder.
    550550    if (!dir($user_trash_folder)) {
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r41 r42  
    77    <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
    88    <br />
    9    
     9
    1010    <input type="text" class="small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: <##> %SEARCH_FIELDS%.")); ?>" />
    1111    <select name="filter_<##>">
  • trunk/bin/module_maker/skel/admin.php

    r41 r42  
    2626 * CONFIG
    2727 *****************************************************************************/
    28  
     28
    2929// Titles and navigation header.
    3030$nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']);
    31    
     31
    3232// The object to validate form input.
    3333$fv = new FormValidator();
     
    215215    // Get the information for the form.
    216216    $qid = DB::query("
    217         SELECT * 
     217        SELECT *
    218218        FROM %DB_TBL%
    219219        WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
     
    227227    // Lock this record.
    228228    $lock->set('%DB_TBL%', '%PRIMARY_KEY%', $id, $frm['<##>']);
    229    
     229
    230230    // Set misc values for the form.
    231231    $frm = array_merge(array(
     
    246246{
    247247    global $lock;
    248    
     248
    249249    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
    250250    if ($lock->isLocked() && !$lock->isMine()) {
     
    254254    // Break the cache because we are changing the list data.
    255255    SessionCache::breakCache($_SERVER['PHP_SELF']);
    256    
     256
    257257    // Get the information for this object.
    258258    $qid = DB::query("
    259         SELECT <##> 
     259        SELECT <##>
    260260        FROM %DB_TBL%
    261261        WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
     
    266266        App::dieBoomerangURL();
    267267    }
    268    
     268
    269269    // Delete the record.
    270270    DB::query("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'");
    271    
     271
    272272    App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
    273273
     
    279279{
    280280    global $auth;
    281    
     281
    282282    // Break the cache because we are changing the list data.
    283283    SessionCache::breakCache($_SERVER['PHP_SELF']);
    284    
     284
    285285%INSERT%
    286286    $last_insert_id = mysql_insert_id(DB::getDBH());
     
    289289    $version = RecordVersion::getInstance($GLOBALS['auth']);
    290290    $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['<##>']);
    291    
     291
    292292    App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been added."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__);
    293    
     293
    294294    return $last_insert_id;
    295295}
     
    298298{
    299299    global $auth, $lock;
    300    
     300
    301301    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']);
    302302    if ($lock->isLocked() && !$lock->isMine()) {
     
    308308
    309309%UPDATE%
    310    
     310
    311311    // Create version.
    312312    $version = RecordVersion::getInstance($GLOBALS['auth']);
     
    323323    global $page;
    324324    global $so;
    325    
     325
    326326    $where_clause = '';
    327    
     327
    328328    // Build search query if available.
    329329    if (getFormData('search_query', false)) {
     
    333333        }
    334334    }
    335    
     335
    336336    if (getFormData('filter_<##>', false)) {
    337337        // Limit by filter.
    338338        $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " <##> = '" . addslashes(getFormData('filter_<##>')) . "'";
    339339    }
    340    
     340
    341341    // Count the total number of records so we can do something about the page numbers.
    342342    $qid = DB::query("
    343         SELECT COUNT(*) 
    344         FROM %DB_TBL% 
     343        SELECT COUNT(*)
     344        FROM %DB_TBL%
    345345        $where_clause
    346346    ");
    347347    list($num_results) = mysql_fetch_row($qid);
    348    
     348
    349349    // Set page numbers now we know (needed for next step).
    350350    $page->setTotalItems($num_results);
    351351    $page->calculate();
    352    
     352
    353353    // Final SQL, with sort and page limiters.
    354354    $sql = "
    355         SELECT 
    356             %DB_TBL%.*, 
     355        SELECT
     356            %DB_TBL%.*,
    357357            a1.username AS added_admin_username,
    358358            a2.username AS modified_admin_username
     
    364364        " . $page->getLimitSQL() . "
    365365    ";
    366    
     366
    367367    // A unique key for this query, with the total_items in case db records
    368368    // were added since the last cache. This identifies a unique set of
     
    375375        Prefs::setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
    376376    }
    377    
     377
    378378    if (SessionCache::isCached($_SERVER['PHP_SELF'])) {
    379379        // Get the cached results.
     
    386386            $list[] = $row;
    387387        }
    388            
     388
    389389        if (isset($list) && !empty($list)) {
    390390            // Cache the results.
     
    397397
    398398function updateRank($ranks)
    399 {   
     399{
    400400    if (!is_array($ranks)) {
    401401        App::logMsg('Saving rank failed, data posted is not an array: ' . $ranks, LOG_ERR, __FILE__, __LINE__);
     
    405405    // Break the cache because we are changing the list data.
    406406    SessionCache::breakCache($_SERVER['PHP_SELF']);
    407    
     407
    408408    // Count the ranks with invalid numbers
    409409    $unspecified_counter = 0;
    410    
     410
    411411    // Go through the array of new ranks.
    412412    foreach ($ranks as $id => $new_rank) {
     
    414414            // Unspecified entries receive a sort order of 10000.
    415415            $new_rank = 10000;
    416             $unspecified_counter++; 
     416            $unspecified_counter++;
    417417        }
    418418        DB::query("
     
    422422        ");
    423423    }
    424    
     424
    425425    App::raiseMsg(_("Records have been reordered with the new rank."), MSG_SUCCESS, __FILE__, __LINE__);
    426426    if ($unspecified_counter > 0) {
  • trunk/bin/module_maker/skel/public.php

    r41 r42  
    11<?php
    22/**
    3  * %PUBLIC_SCRIPT% 
     3 * %PUBLIC_SCRIPT%
    44 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
    55 *
     
    1818// Titles and navigation header.
    1919$nav->addPage(_("%TITLE%"), $_SERVER['PHP_SELF']);
    20 $nav->setFeature(array('title'=>true)); 
     20$nav->setFeature(array('title'=>true));
    2121
    2222// Instantiate page numbers. Total items are set and calculation is done in the getRecordList function.
     
    3232
    3333if (getFormData('%PRIMARY_KEY%', false)) {
    34    
     34
    3535    // Get requested record.
    3636    $qid = DB::query("
     
    5252        WHERE %PRIMARY_KEY% = '" . addslashes(getFormData('%PRIMARY_KEY%')) . "'
    5353    ");
    54        
     54
    5555    // Set title and main template.
    5656    $nav->addPage($item['<##>']);
     
    5858
    5959} else {
    60    
     60
    6161    // Get the DEFAULT list.
    6262    $%NAME_SINGULAR%_list = array();
    6363    $qid = DB::query("
    64         SELECT * 
    65         FROM %DB_TBL% 
    66         WHERE publish = 'true' 
     64        SELECT *
     65        FROM %DB_TBL%
     66        WHERE publish = 'true'
    6767        " . $so->getSortOrderSQL() . "
    6868        LIMIT 100
     
    7171        $%NAME_SINGULAR%_list[] = $row;
    7272    }
    73    
     73
    7474    // Set page numbers for default list.
    7575    $page->setTotalItems(sizeof($%NAME_SINGULAR%_list));
    7676    $page->calculate();
    77    
     77
    7878
    7979    // Get the FEATURED list.
    8080    $featured_list = array();
    8181    $qid = DB::query("
    82         SELECT * 
    83         FROM %DB_TBL% 
     82        SELECT *
     83        FROM %DB_TBL%
    8484        WHERE publish = 'true'
    8585        AND featured = 'true'
     
    8989        $featured_list[] = $row;
    9090    }
    91    
     91
    9292    // Get the POPULAR list.
    9393    $popular_list = array();
    9494    $qid = DB::query("
    95         SELECT * 
    96         FROM %DB_TBL% 
    97         WHERE publish = 'true' 
     95        SELECT *
     96        FROM %DB_TBL%
     97        WHERE publish = 'true'
    9898        ORDER BY hit_count DESC LIMIT 10
    9999    ");
     
    101101        $popular_list[] = $row;
    102102    }
    103    
     103
    104104    // Get the RECENT list.
    105105    $recent_list = array();
    106106    $qid = DB::query("
    107         SELECT * 
    108         FROM %DB_TBL% 
    109         WHERE publish = 'true' 
     107        SELECT *
     108        FROM %DB_TBL%
     109        WHERE publish = 'true'
    110110        ORDER BY added_datetime DESC LIMIT 10
    111111    ");
     
    113113        $recent_list[] = $row;
    114114    }
    115    
     115
    116116    // Set main template.
    117117    $main_template = '%PUBLIC_LIST_TEMPLATE%';
    118 }   
     118}
    119119
    120120// We have the data, and no errors, so here come the templates.
  • trunk/bin/module_maker/skel/public_list.ihtml

    r41 r42  
    1111        <p>
    1212        <em><?php echo date(App::getParam('date_format'), strtotime($%NAME_SINGULAR%_list[$i]['<##>'])); ?></em> &mdash; <?php echo nl2br(fancyTxt(oTxt($%NAME_SINGULAR%_list[$i]['summary'], true))); ?>
    13            
     13
    1414        <?php if (strlen(trim($%NAME_SINGULAR%_list[$i]['content'])) > 0) { // Link only if content is available. ?>
    1515            <br /><a href="<?php echo App::oHREF('/%PUBLIC_SCRIPT%?%PRIMARY_KEY%=' . $%NAME_SINGULAR%_list[$i]['%PRIMARY_KEY%']); ?>"><?php echo _("Read more"); ?></a>
    1616        <?php } ?>
    1717        </p>
    18         <?php   
     18        <?php
    1919    }
    2020    if ($page->total_pages > 1) {
     
    3030    ?>
    3131    <h2><?php echo _("Featured %NAME_PLURAL%"); ?></h2>
    32     <?php 
     32    <?php
    3333    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
    3535    }
    3636}
     
    4242    ?>
    4343    <h2><?php echo _("Popular %NAME_PLURAL%"); ?></h2>
    44     <?php 
     44    <?php
    4545    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
    4747    }
    4848}
     
    5454    ?>
    5555    <h2><?php echo _("Recent %NAME_PLURAL%"); ?></h2>
    56     <?php 
     56    <?php
    5757    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
    5959    }
    6060}
  • trunk/bin/module_maker/sql.cli.php

    r41 r42  
    5656if (is_array($cols) && !empty($cols)) {
    5757    foreach ($cols as $col) {
    58        
     58
    5959        // Human readable.
    6060        $field = $col[0];
    6161        $type = preg_replace('/^(\w+).*$/', '\\1', $col[1]);
    6262        $is_primary_key = ('PRI' == $col[3]);
    63        
     63
    6464        $sort_columns .= "\$so->setColumn('$field', '$field ASC', '$field DESC');\n";
    65        
     65
    6666        if ($is_primary_key) {
    6767            // This is the primary key. Deal with separately.
     
    8484        }
    8585    }
    86    
     86
    8787} else {
    8888    die(basename($_SERVER['argv'][0]) . " Warning: $db_tbl does not have any columns.\n");
  • trunk/bin/module_maker/validation.cli.php

    r41 r42  
    3838// Loop through columns
    3939if (is_array($cols) && !empty($cols)) {
    40    
     40
    4141    $o = array();
    4242
    4343    foreach ($cols as $col) {
    44    
     44
    4545        // Human readable.
    4646        $field = $col[0];
     
    4949        $is_primary_key = ('PRI' == $col[3]);
    5050        $unsigned = preg_match('/\s*unsigned\s*$/i', $col[1]);
    51        
     51
    5252        if (in_array($field, $exclude)) {
    5353            continue;
    5454        }
    55        
     55
    5656        // ----------- isEmpty ------------
    5757        $o[] = "\$fv->isEmpty('$field', _(\"<strong>$title</strong> cannot be blank.\"));";
     
    6868            $len_type = 'setenum';
    6969            break;
    70            
     70
    7171        case 'date' :
    7272        case 'datetime' :
     
    7777            $max_length = 127;
    7878            break;
    79            
     79
    8080        case 'tinytext' :
    8181        case 'tinyblob' :
     
    8585            $max_length = 255;
    8686            break;
    87            
     87
    8888        case 'text' :
    8989        case 'blob' :
     
    9191            $max_length = 65535;
    9292            break;
    93            
     93
    9494        case 'mediumtext' :
    9595        case 'mediumblob' :
     
    9797            $max_length = 16777215;
    9898            break;
    99            
     99
    100100        case 'longtext' :
    101101        case 'longblob' :
     
    103103            $max_length = 4294967295;
    104104            break;
    105            
     105
    106106        case 'tinyint' :
    107107        case 'bit' :
     
    116116            }
    117117            break;
    118            
     118
    119119        case 'smallint' :
    120120            $len_type = 'num';
     
    127127            }
    128128            break;
    129            
     129
    130130        case 'mediumint' :
    131131            $len_type = 'num';
     
    138138            }
    139139            break;
    140            
     140
    141141        case 'int' :
    142142        case 'integer' :
     
    150150            }
    151151            break;
    152            
     152
    153153        case 'bigint' :
    154154            $len_type = 'num';
     
    161161            }
    162162            break;
    163            
     163
    164164        case 'float' :
    165165            $len_type = 'num';
     
    167167            $max = 3.40282E+38;
    168168            break;
    169            
     169
    170170        case 'double' :
    171171        case 'double precision' :
     
    178178            $max = 1.79769E+308;
    179179            break;
    180            
     180
    181181        default :
    182182            $len_type = null;
     
    192192            $o[] = "\$fv->numericRange('$field', $min, $max, _(\"<strong>$title</strong> must be a valid number between $min and $max.\"));";
    193193        }
    194        
     194
    195195        // ----------- type check ------------
    196196        switch ($type) {
    197197
    198198        case 'enum' :
    199        
     199
    200200        case 'set' :
    201201            break;
    202        
     202
    203203        case 'char' :
    204204        case 'varchar' :
    205        
     205
    206206        case 'tinytext' :
    207207        case 'text' :
     
    214214//             $o[] = "\$fv->isString('$field', _(\"<strong>$title</strong> must be a string.\"));"; // Pretty useless
    215215            break;
    216        
     216
    217217        case 'tinyint' :
    218218        case 'bit' :
     
    226226            $o[] = "\$fv->isInteger('$field', _(\"<strong>$title</strong> must be an integer.\")$negative_ok);";
    227227            break;
    228        
     228
    229229        case 'float' :
    230230        case 'float' :
     
    238238            $o[] = "\$fv->isFloat('$field', _(\"<strong>$title</strong> must be a valid number.\")$negative_ok);";
    239239            break;
    240        
     240
    241241        case 'date' :
    242242        case 'datetime' :
     
    244244            $o[] = "\$fv->checkRegex('$field', '/^\d{4}-\d{2}-\d{2}$/', true, _(\"<strong>$title</strong> must be a valid date in YYYY-MM-DD format.\"));";
    245245            break;
    246            
     246
    247247        case 'timestamp' :
    248248            $o[] = "\$fv->checkRegex('$field', '/^\d{14}$/', true, _(\"<strong>$title</strong> must be a valid mysql timestamp in YYYYMMDDhhmmss format.\"));";
    249249            break;
    250            
     250
    251251        case 'time' :
    252252            $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.\"));";
    253253            break;
    254        
     254
    255255        case 'year' :
    256256            $o[] = "\$fv->checkRegex('$field', '/^\d{4}$/', true, _(\"<strong>$title</strong> must be a valid year in YYYY format.\"));";
    257257            break;
    258        
     258
    259259        default :
    260260            break;
    261261        }
    262        
     262
    263263        if (preg_match('/email/', $field)) {
    264264            $o[] = "\$fv->validateEmail('$field');";
     
    266266            $o[] = "\$fv->validatePhone('$field');";
    267267        }
    268        
     268
    269269        // Blank between cols?
    270270        $o[] = '';
     
    278278
    279279echo "function validateInput()
    280 {   
     280{
    281281    global \$fv;
    282282
Note: See TracChangeset for help on using the changeset viewer.