Changeset 20 for trunk/bin


Ignore:
Timestamp:
Nov 17, 2005 3:00:00 AM (19 years ago)
Author:
scdev
Message:

Tons of little updates and bugfixes. CSS updates to templates and core css files. File upload ability to module_maker. Remade Upload interface to use setParam/getParam.

Location:
trunk/bin/module_maker
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/form_template.cli.php

    r19 r20  
    6565        <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    6666        <td valign="top">
    67             <select name="$field" class="formselect">
     67            <select name="$field" class="small">
    6868            <\x3fphp printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', <##>)", '$field', \$frm['$field'], true, 'ORDER BY $field DESC'); \x3f>
    6969            </select>
     
    7575       
    7676        // File upload.
    77         if (preg_match('/file/i', $field)) {
    78             $output[$field] = <<<E_O_F
    79     <tr>
    80         <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    81         <td valign="top">
    82             <input type="file" name="$field" value="<\x3fphp echo \$_FILES['$field']['name']; \x3f>" />
    83             <\x3fphp if (getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>
    84             <div class="help"><\x3fphp printf(_("The current file <strong>%s</strong> will be overwritten if a new file is selected for upload."), \$frm['$field']) \x3f></div>
     77        if (preg_match('/file|image/i', $field)) {
     78            $output[$field] = <<<E_O_F
     79    <tr>
     80        <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
     81        <td valign="top">
     82            <input type="file" name="$field" />
     83            <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key_field') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>
     84            <div class="help"><\x3fphp printf(_("The current file <a href=\"%s/%2\$s\"><strong>%2\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/<##>', \$upload->getFilenameGlob(getFormData('$primary_key_field') . '_*')) \x3f></div>
    8585            <\x3fphp } \x3f>
    86             <div class="help"><\x3fphp printf(_("File to upload must have one of the following file-name extensions: %s."), join(', ', \$upload->valid_file_extensions)) \x3f></div>
     86            <div class="help"><\x3fphp printf(_("File to upload must have one of the following file-name extensions: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div>
    8787        </td>
    8888    </tr>
     
    9797        <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    9898        <td valign="top">
    99             <input type="password" class="forminputtext" size="50" name="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>">
     99            <input type="password" class="medium" size="50" name="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    100100        </td>
    101101    </tr>
     
    138138        <td>&nbsp;</td>
    139139        <td>
    140             <input type="checkbox" name="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f>><label><\x3fphp echo _("$title"); \x3f></label>
     140            <input type="checkbox" name="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f> /><label><\x3fphp echo _("$title"); \x3f></label>
    141141        </td>
    142142    </tr>
     
    157157        <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    158158        <td valign="top">
    159             <textarea class="text" cols="75" rows="4" name="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     159            <textarea class="large" cols="75" rows="4" name="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
    160160        </td>
    161161    </tr>
     
    196196        <td class="right"><label for="$field"<\x3fphp \$fv->err('$field', ' class="error"') \x3f>><\x3fphp echo _("$title"); \x3f></label></td>
    197197        <td valign="top">
    198             <input type="text" class="text" size="50" name="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>">
     198            <input type="text" class="medium" size="50" name="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    199199        </td>
    200200    </tr>
  • trunk/bin/module_maker/list_template.cli.php

    r19 r20  
    112112    <br />
    113113   
    114     <input type="text" class="forminputtext" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" />
     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>" />
    115115    <select name="filter_<##>">
    116116        <\x3fphp // printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', city, '&mdash;', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##> ASC'); \x3f>
  • trunk/bin/module_maker/module.cli.php

    r19 r20  
    5656
    5757// Names
    58 $module_title = ucwords($module_name_plural);
    59 $item_title = ucwords($module_name_singular);
    60 $module_name_upper = strtoupper($module_name_plural);
     58$module_title = ucwords(str_replace('_', ' ', $module_name_plural));
     59$item_title = ucwords(str_replace('_', ' ', $module_name_singular));
     60$module_name_upper = strtoupper(str_replace('_', ' ', $module_name_plural));
    6161
    6262// Admin files
     
    7676// Only after we've defined essential files can we clean.
    7777if ('clean' == $op) {
    78     cleanFiles();
     78    echo "Beginning file cleanup\n";
     79    trashFile("$admin_dir/$admin_script");
     80    trashFile("$admin_tpl_dir/$admin_list_template");
     81    trashFile("$admin_tpl_dir/$admin_form_template");
     82    trashFile("$public_dir/$public_script");
     83    trashFile("$public_tpl_dir/$public_list_template");
     84    trashFile("$public_tpl_dir/$public_detail_template");   
     85    echo "End file cleanup\n";
    7986    die;
    8087}
     
    140147
    141148// Loop through columns
    142 $multipart_form_required = false;
     149$upload_file_capability = false;
    143150$headers = array();
    144151$public_list_page_vars = array();
     
    160167       
    161168        // Our form will require type="multipart/form-data".
    162         if (preg_match('/file/i', $field)) {
    163             $multipart_form_required = true;
     169        if (preg_match('/file|image/i', $field)) {
     170            $upload_file_capability = true;
    164171        }
    165172       
     
    184191
    185192
    186 // -------------VARS-------------
     193// Search-replace variables ----------------------------------
     194
     195// Admin script file upload replacement routines...
     196
     197$search['admin_form_tag_init'] = '/%ADMIN_FORM_TAG_INIT%/';
     198$replace['admin_form_tag_init'] = "<form method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\">";
     199$search['admin_upload_include'] = '/%ADMIN_UPLOAD_INCLUDE%/';
     200$replace['admin_upload_include'] = '';
     201$search['admin_upload_config'] = '/%ADMIN_UPLOAD_CONFIG%/';
     202$replace['admin_upload_config'] = '';
     203$search['admin_upload_init'] = '/%ADMIN_UPLOAD_INIT%/';
     204$replace['admin_upload_init'] = '';
     205$search['admin_upload_del'] = '/%ADMIN_UPLOAD_DEL%/';
     206$replace['admin_upload_del'] = '';
     207$search['admin_upload_insert'] = '/%ADMIN_UPLOAD_INSERT%/';
     208$replace['admin_upload_insert'] = '';
     209$search['admin_upload_insert2'] = '/%ADMIN_UPLOAD_INSERT2%/';
     210$replace['admin_upload_insert2'] = '';
     211$search['admin_upload_update'] = '/%ADMIN_UPLOAD_UPDATE%/';
     212$replace['admin_upload_update'] = '';
     213
     214if ($upload_file_capability) {
     215    $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=\"<##>\" />";
     216
     217    $replace['admin_upload_include'] = "require_once 'codebase/lib/Upload.inc.php';\n";
     218
     219    $replace['admin_upload_config'] = <<<E_O_F
     220
     221// This module has file upload capability.
     222\$upload = new Upload();
     223\$upload->setParam(array(
     224    'upload_path' => COMMON_BASE . '/html/_db_files/<##>',
     225    'dest_file_perms' => 0666,
     226    'allow_overwriting' => false,
     227    'valid_file_extensions' => array('jpg', 'gif', 'png', 'jpeg'),
     228));
     229
     230E_O_F;
     231
     232    $replace['admin_upload_init'] = <<<E_O_F
     233
     234// Copy uploaded image name into form data.
     235\$_POST['<##>'] = isset(\$_FILES['<##>']) ? \$_FILES['<##>']['name'] : '';
     236 
     237
     238E_O_F;
     239
     240    $replace['admin_upload_del'] = <<<E_O_F
     241
     242    // Delete file.
     243    if ('' != \$upload->getFilenameGlob(getFormData('%PRIMARY_KEY%') . '_*')) {
     244        \$upload->deleteFile(\$upload->getFilenameGlob(getFormData('%PRIMARY_KEY%') . '_*'));
     245    }
     246E_O_F;
     247
     248    $replace['admin_upload_insert'] = <<<E_O_F
     249
     250        // Upload file.
     251        if (!\$new_files = \$upload->process('<##>')) {
     252            // Upload failed. Reload form, displaying errors.
     253            \$frm =& addRecordForm();
     254            \$frm = array_merge(\$frm, getFormData());
     255            \$nav->addPage(_("Add %ITEM_TITLE%"));
     256            \$main_template = '%ADMIN_FORM_TEMPLATE%';
     257            break;
     258        }
     259E_O_F;
     260
     261    $replace['admin_upload_insert2'] = <<<E_O_F
     262
     263        // Record inserted successfuly. Now we know the primary key, prepend to filename.
     264        \$upload->moveFile(\$new_files[0]['name'], \$%PRIMARY_KEY% . '_' . \$new_files[0]['name']);
     265E_O_F;
     266
     267    $replace['admin_upload_update'] = <<<E_O_F
     268
     269        // Upload new file.
     270        if (getFormData('<##>')) {
     271            if (\$upload->process('<##>',  getFormData('%PRIMARY_KEY%') . '_' . getFormData('<##>'))) {
     272                // Upload success. Delete old file.
     273                if ('' != \$upload->getFilenameGlob(getFormData('%PRIMARY_KEY%') . '_*')) {
     274                    \$upload->deleteFile(\$upload->getFilenameGlob(getFormData('%PRIMARY_KEY%') . '_*'));
     275                }
     276            } else {
     277                // Upload failed. Reload form, displaying errors.
     278                \$frm =& editRecordForm(getFormData('%PRIMARY_KEY%'));
     279                \$frm = array_merge(\$frm, getFormData());
     280                \$nav->addPage(_("Edit %ITEM_TITLE%"));
     281                \$main_template = '%ADMIN_FORM_TEMPLATE%';
     282                break;
     283            }           
     284        }
     285E_O_F;
     286} // End if.
     287
    187288
    188289// Simple...
     
    242343$replace['search_fields'] = join(", ", $headers);
    243344
    244 $search['admin_form_tag_init'] = '/%ADMIN_FORM_TAG_INIT%/';
    245 if ($multipart_form_required) {
    246     $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=\"12000000\">";
    247 } else {
    248     $replace['admin_form_tag_init'] = "<form method=\"post\" action=\"<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>\">";
    249 }
    250345
    251346
     
    419514 *****************************************************************************/
    420515
    421 /**
    422  * Removes existing modules files. Danger!
    423  */
    424 function cleanFiles()
     516function trashFile($file_path_name)
    425517{
    426518    global $user_trash_folder;
    427     global $admin_dir;
    428     global $admin_script;
    429     global $admin_tpl_dir;
    430     global $admin_list_template;
    431     global $admin_form_template;
    432     global $public_dir;
    433     global $public_script;
    434     global $public_tpl_dir;
    435     global $public_detail_template;
    436     global $public_list_template;
     519    static $file_prefix;
    437520   
    438     echo "Beginning file cleanup\n";
    439 
     521    if (!isset($file_prefix)) {
     522        $file_prefix = time();
     523    } else {
     524        $file_prefix++;
     525    }
     526   
     527    // Make user trash folder.
    440528    if (!dir($user_trash_folder)) {
    441529        mkdir($user_trash_folder);
     
    447535    }
    448536
    449     if (file_exists("$admin_dir/$admin_script")) {
    450         rename("$admin_dir/$admin_script", "$user_trash_folder/$admin_script" . '_' . md5(microtime()));
    451         printf("Moved to trash: %s\n", "$admin_dir/$admin_script");
     537    // Move file to trash.
     538    if (file_exists($file_path_name)) {
     539        rename($file_path_name, sprintf('%s/%s_%s', $user_trash_folder, $file_prefix, basename($file_path_name)));
     540        printf("Moved to trash: %s -> %s\n", $file_path_name, sprintf('%s/%s_%s', $user_trash_folder, $file_prefix, basename($file_path_name)));
    452541    } else {
    453         printf("File not found: %s\n", "$admin_dir/$admin_script");
    454     }
    455 
    456     if (file_exists("$admin_tpl_dir/$admin_list_template")) {
    457         rename("$admin_tpl_dir/$admin_list_template", "$user_trash_folder/$admin_list_template" . '_' . md5(microtime()));
    458         printf("Moved to trash: %s\n", "$admin_tpl_dir/$admin_list_template");
    459     } else {
    460         printf("File not found: %s\n", "$admin_tpl_dir/$admin_list_template");
    461     }
    462 
    463     if (file_exists("$admin_tpl_dir/$admin_form_template")) {
    464         rename("$admin_tpl_dir/$admin_form_template", "$user_trash_folder/$admin_form_template" . '_' . md5(microtime()));
    465         printf("Moved to trash: %s\n", "$admin_tpl_dir/$admin_form_template");
    466     } else {
    467         printf("File not found: %s\n", "$admin_tpl_dir/$admin_form_template");
    468     }
    469 
    470     if (file_exists("$public_dir/$public_script")) {
    471         rename("$public_dir/$public_script", "$user_trash_folder/$public_script" . '_' . md5(microtime()));
    472         printf("Moved to trash: %s\n", "$public_dir/$public_script");
    473     } else {
    474         printf("File not found: %s\n", "$public_dir/$public_script");
    475     }
    476 
    477     if (file_exists("$public_tpl_dir/$public_list_template")) {
    478         rename("$public_tpl_dir/$public_list_template", "$user_trash_folder/$public_list_template" . '_' . md5(microtime()));
    479         printf("Moved to trash: %s\n", "$public_tpl_dir/$public_list_template");
    480     } else {
    481         printf("File not found: %s\n", "$public_tpl_dir/$public_list_template");
    482     }
    483 
    484     if (file_exists("$public_tpl_dir/$public_detail_template")) {
    485         rename("$public_tpl_dir/$public_detail_template", "$user_trash_folder/$public_detail_template" . '_' . md5(microtime()));
    486         printf("Moved to trash: %s\n", "$public_tpl_dir/$public_detail_template");
    487     } else {
    488         printf("File not found: %s\n", "$public_tpl_dir/$public_detail_template");
    489     }
    490    
    491     echo "End file cleanup\n";
     542        printf("File not found: %s\n", $file_path_name);
     543    }
    492544}
    493545
  • trunk/bin/module_maker/skel/adm_form.ihtml

    r19 r20  
    33%ADMIN_FORM_TAG_INIT%
    44<?php App::printHiddenSession(); ?>
    5 <input type="hidden" name="op" value="<?php echo $frm['new_op']; ?>">
    6 <input type="hidden" name="%PRIMARY_KEY%" value="<?php echo $frm['%PRIMARY_KEY%']; ?>">
     5<input type="hidden" name="op" value="<?php echo $frm['new_op']; ?>" />
     6<input type="hidden" name="%PRIMARY_KEY%" value="<?php echo $frm['%PRIMARY_KEY%']; ?>" />
    77
    88<table>
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r19 r20  
    11
    22<?php $fv->printErrorMessages(); ?>
    3 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
     3<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
    44<?php App::printHiddenSession(false); ?>
    55
     
    88    <br />
    99   
    10     <input type="text" class="forminputtext" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: %SEARCH_FIELDS%.")); ?>" />
     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%.")); ?>" />
    1111    <select name="filter_<##>">
    1212        <?php // printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', city, '&mdash;', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##> ASC'); ?>
     
    1414    <input type="submit" name="list" value="<?php echo _("Search"); ?>" />
    1515</div>
     16</form>
    1617
     18<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
     19<?php App::printHiddenSession(); ?>
    1720<?php include 'list_info.ihtml'; ?>
    18 
    1921<table class="list">
    2022    <tr>
     
    2628    <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
    2729    <tr>
    28         <td class="padleft nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
    29         <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
     30        <td class="padleft nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
     31        <td class="padleft nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
    3032%ADM_LIST_ROWS%
    31         <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['______RECORD_NAME______'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['______RECORD_NAME______'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> &nbsp;</td>
     33        <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['<##>'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> &nbsp;</td>
    3234    </tr>
    3335    <?php } ?>
  • trunk/bin/module_maker/skel/admin.php

    r19 r20  
    2121require_once 'codebase/lib/RecordLock.inc.php';
    2222require_once 'codebase/lib/RecordVersion.inc.php';
    23 
     23%ADMIN_UPLOAD_INCLUDE%
    2424
    2525/******************************************************************************
     
    4040$page->setPageNumber(getFormData('page_number'));
    4141
     42// Search limiters retain their values between page requests.
     43App::carryQuery('search_query');
     44App::carryQuery('filter_<##>');
     45%ADMIN_UPLOAD_CONFIG%
    4246/******************************************************************************
    4347 * MAIN
    4448 *****************************************************************************/
    45  
     49 %ADMIN_UPLOAD_INIT%
    4650// We may want to use the add/edit interface from another script, so this
    4751// allows us to remember which page we came from so we can go back there.
    48 if (getFormData('boomerang', false)) {
     52if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) {
    4953    App::setBoomerangURL($_SERVER['HTTP_REFERER'], '%NAME_PLURAL%');
    5054}
     
    7680case 'del' :
    7781//     $auth->requireAccessClearance(ZONE_ADMIN_%NAME_UPPER%_FUNC_DELETE);
    78     deleteRecord(getFormData('%PRIMARY_KEY%'));
     82    deleteRecord(getFormData('%PRIMARY_KEY%'));%ADMIN_UPLOAD_DEL%
    7983    if (App::validBoomerangURL('%NAME_PLURAL%')) {
    8084        // Display boomerang page.
     
    96100        $nav->addPage(_("Add %ITEM_TITLE%"));
    97101        $main_template = '%ADMIN_FORM_TEMPLATE%';
    98     } else {
    99         $%PRIMARY_KEY% = insertRecord(getFormData());
     102    } else {%ADMIN_UPLOAD_INSERT%
     103        $%PRIMARY_KEY% = insertRecord(getFormData());%ADMIN_UPLOAD_INSERT2%
    100104        if (getFormdata('repeat', false)) {
    101105            // Display function again.
     
    134138        $nav->addPage(_("Edit %ITEM_TITLE%"));
    135139        $main_template = '%ADMIN_FORM_TEMPLATE%';
    136     } else {
     140    } else {%ADMIN_UPLOAD_UPDATE%
    137141        updateRecord(getFormData());
    138142        if (getFormdata('repeat', false)) {
     
    277281
    278282    // Create version.
    279     $version = new RecordVersion($GLOBALS['auth']);
     283    $version = RecordVersion::getInstance($GLOBALS['auth']);
    280284    $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['<##>']);
    281285   
     
    300304       
    301305        // Create version.
    302         $version = new RecordVersion($GLOBALS['auth']);
     306        $version = RecordVersion::getInstance($GLOBALS['auth']);
    303307        $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['<##>']);
    304308   
     
    403407    foreach ($ranks as $id => $new_rank) {
    404408        if ('' == trim($new_rank) || !is_numeric($new_rank) || $new_rank > 2147483646) {
    405             // Unspecified entries recieve a sort order of 1000.
    406             $new_rank = 1000;
     409            // Unspecified entries receive a sort order of 10000.
     410            $new_rank = 10000;
    407411            $unspecified_counter++;
    408412        }
     
    416420    App::raiseMsg(_("Records have been reordered with the new rank."), MSG_SUCCESS, __FILE__, __LINE__);
    417421    if ($unspecified_counter > 0) {
    418         App::raiseMsg(sprintf(_("%s items with unspecified ranks were automatically assigned a rank of 1000."), $unspecified_counter), MSG_NOTICE, __FILE__, __LINE__);
     422        App::raiseMsg(sprintf(_("%s items with unspecified ranks were automatically assigned a rank of 10000."), $unspecified_counter), MSG_NOTICE, __FILE__, __LINE__);
    419423    }
    420424}
Note: See TracChangeset for help on using the changeset viewer.