Ignore:
Timestamp:
May 25, 2006 10:21:07 PM (18 years ago)
Author:
scdev
Message:

Updated App.inc.php thru Hierarchy.inc.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0singleton/bin/module_maker/skel/admin.php

    r111 r127  
    1111$auth->requireLogin();
    1212// $auth->requireAccessClearance(ZONE_ADMIN_%NAME_UPPER%);
    13 App::sslOn();
     13$app->sslOn();
    1414
    1515require_once 'codebase/lib/PageNumbers.inc.php';
     
    4141
    4242// Search limiters retain their values between page requests.
    43 App::carryQuery('search_query');
    44 App::carryQuery('filter_<##>');
     43$app->carryQuery('search_query');
     44$app->carryQuery('filter_<##>');
    4545%ADMIN_UPLOAD_CONFIG%
    4646/******************************************************************************
     
    5151// allows us to remember which page we came from so we can go back there.
    5252if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) {
    53     App::setBoomerangURL($_SERVER['HTTP_REFERER'], '%NAME_PLURAL%');
     53    $app->setBoomerangURL($_SERVER['HTTP_REFERER'], '%NAME_PLURAL%');
    5454}
    5555
     
    8181//     $auth->requireAccessClearance(ZONE_ADMIN_%NAME_UPPER%_FUNC_DELETE);
    8282    deleteRecord(getFormData('%PRIMARY_KEY%'));%ADMIN_UPLOAD_DEL%
    83     if (App::validBoomerangURL('%NAME_PLURAL%')) {
     83    if ($app->validBoomerangURL('%NAME_PLURAL%')) {
    8484        // Display boomerang page.
    85         App::dieBoomerangURL('%NAME_PLURAL%');
     85        $app->dieBoomerangURL('%NAME_PLURAL%');
    8686    }
    8787    // Display default page.
    88     App::dieURL($_SERVER['PHP_SELF']);
     88    $app->dieURL($_SERVER['PHP_SELF']);
    8989    break;
    9090
     
    9292//     $auth->requireAccessClearance(ZONE_ADMIN_%NAME_UPPER%_FUNC_ADD);
    9393    if (getFormdata('cancel', false)) {
    94         if (App::validBoomerangURL('%NAME_PLURAL%')) {
     94        if ($app->validBoomerangURL('%NAME_PLURAL%')) {
    9595            // Display boomerang page.
    96             App::dieBoomerangURL('%NAME_PLURAL%');
     96            $app->dieBoomerangURL('%NAME_PLURAL%');
    9797        }
    9898        // Display default page.
    99         App::dieURL($_SERVER['PHP_SELF']);
     99        $app->dieURL($_SERVER['PHP_SELF']);
    100100    }
    101101    validateInput();
     
    109109        if (getFormdata('repeat', false)) {
    110110            // Display function again.
    111             App::dieURL($_SERVER['PHP_SELF'] . '?op=add');
    112         } else if (App::validBoomerangURL('%NAME_PLURAL%')) {
     111            $app->dieURL($_SERVER['PHP_SELF'] . '?op=add');
     112        } else if ($app->validBoomerangURL('%NAME_PLURAL%')) {
    113113            // Display boomerang page.
    114             App::dieBoomerangURL('%NAME_PLURAL%');
     114            $app->dieBoomerangURL('%NAME_PLURAL%');
    115115        }
    116116        // Display default page.
    117         App::dieURL($_SERVER['PHP_SELF']);
     117        $app->dieURL($_SERVER['PHP_SELF']);
    118118    }
    119119    break;
     
    122122//     $auth->requireAccessClearance(ZONE_ADMIN_%NAME_UPPER%_FUNC_EDIT);
    123123    if (getFormdata('reset', false)) {
    124         App::raiseMsg(_("Saved values have been reloaded."), MSG_NOTICE, __FILE__, __LINE__);
    125         App::dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . getFormData('%PRIMARY_KEY%'));
     124        $app->raiseMsg(_("Saved values have been reloaded."), MSG_NOTICE, __FILE__, __LINE__);
     125        $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . getFormData('%PRIMARY_KEY%'));
    126126    }
    127127    if (getFormdata('cancel', false)) {
     
    129129        $lock->select('%DB_TBL%', '%PRIMARY_KEY%', getFormData('%PRIMARY_KEY%'));
    130130        $lock->remove();
    131         if (App::validBoomerangURL('%NAME_PLURAL%')) {
     131        if ($app->validBoomerangURL('%NAME_PLURAL%')) {
    132132            // Display boomerang page.
    133             App::dieBoomerangURL('%NAME_PLURAL%');
     133            $app->dieBoomerangURL('%NAME_PLURAL%');
    134134        }
    135135        // Display default page.
    136         App::dieURL($_SERVER['PHP_SELF']);
     136        $app->dieURL($_SERVER['PHP_SELF']);
    137137    }
    138138    validateInput();
     
    148148            $qid = DB::query("SELECT %PRIMARY_KEY% FROM %DB_TBL% WHERE %PRIMARY_KEY% > '" . DB::escapeString(getFormData('%PRIMARY_KEY%')) . "' ORDER BY %PRIMARY_KEY% ASC LIMIT 1");
    149149            if (list($next_id) = mysql_fetch_row($qid)) {
    150                 App::dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $next_id);
     150                $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $next_id);
    151151            } else {
    152                 App::raiseMsg(_("Cannot edit next, the end of the list was reached"), MSG_NOTICE, __FILE__, __LINE__);
     152                $app->raiseMsg(_("Cannot edit next, the end of the list was reached"), MSG_NOTICE, __FILE__, __LINE__);
    153153            }
    154         } else if (App::validBoomerangURL('%NAME_PLURAL%')) {
     154        } else if ($app->validBoomerangURL('%NAME_PLURAL%')) {
    155155            // Display boomerang page.
    156             App::dieBoomerangURL('%NAME_PLURAL%');
     156            $app->dieBoomerangURL('%NAME_PLURAL%');
    157157        }
    158158        // Display default page.
    159         App::dieURL($_SERVER['PHP_SELF']);
     159        $app->dieURL($_SERVER['PHP_SELF']);
    160160    }
    161161    break;
     
    164164//     $auth->requireAccessClearance(ZONE_ADMIN_PROGRAMS_FUNC_REORDER);
    165165    updateRank(getFormData('rank'));
    166     App::dieURL($_SERVER['PHP_SELF']);
     166    $app->dieURL($_SERVER['PHP_SELF']);
    167167    break;
    168168
     
    220220    ");
    221221    if (!$frm = mysql_fetch_assoc($qid)) {
    222         App::logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__);
    223         App::raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
    224         App::dieBoomerangURL();
     222        $app->logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__);
     223        $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
     224        $app->dieBoomerangURL();
    225225    }
    226226
     
    262262    ");
    263263    if (! list($name) = mysql_fetch_row($qid)) {
    264         App::logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__);
    265         App::raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
    266         App::dieBoomerangURL();
     264        $app->logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__);
     265        $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
     266        $app->dieBoomerangURL();
    267267    }
    268268
     
    270270    DB::query("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . DB::escapeString($id) . "'");
    271271
    272     App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
     272    $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
    273273
    274274    // Unlock record.
     
    290290    $version->create('%DB_TBL%', '%PRIMARY_KEY%', $last_insert_id, $frm['<##>']);
    291291
    292     App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been added."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__);
     292    $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been added."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__);
    293293
    294294    return $last_insert_id;
     
    313313    $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['<##>']);
    314314
    315     App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been updated."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__);
     315    $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been updated."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__);
    316316
    317317    // Unlock record.
     
    399399{
    400400    if (!is_array($ranks)) {
    401         App::logMsg('Saving rank failed, data posted is not an array: ' . $ranks, LOG_ERR, __FILE__, __LINE__);
     401        $app->logMsg('Saving rank failed, data posted is not an array: ' . $ranks, LOG_ERR, __FILE__, __LINE__);
    402402        return false;
    403403    }
     
    423423    }
    424424
    425     App::raiseMsg(_("Records have been reordered with the new rank."), MSG_SUCCESS, __FILE__, __LINE__);
     425    $app->raiseMsg(_("Records have been reordered with the new rank."), MSG_SUCCESS, __FILE__, __LINE__);
    426426    if ($unspecified_counter > 0) {
    427         App::raiseMsg(sprintf(_("%s items with unspecified ranks were automatically assigned a rank of 10000."), $unspecified_counter), MSG_NOTICE, __FILE__, __LINE__);
     427        $app->raiseMsg(sprintf(_("%s items with unspecified ranks were automatically assigned a rank of 10000."), $unspecified_counter), MSG_NOTICE, __FILE__, __LINE__);
    428428    }
    429429}
Note: See TracChangeset for help on using the changeset viewer.