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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.