Changeset 295


Ignore:
Timestamp:
Dec 16, 2007 7:21:57 AM (16 years ago)
Author:
quinn
Message:

Updated example config file. Added admin2.inc.css and minor corrections into HTML. Module maker fixes.

Location:
trunk
Files:
1 added
18 edited

Legend:

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

    r270 r295  
    6262        if (preg_match('/.*_id$/i', $field)) {
    6363            $output[$field] = <<<E_O_F
    64 
    65 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    66 <select name="$field" id="$field" class="sc-small"><\x3fphp printSelectForm('__///___tbl', "CONCAT(__///___id, '&mdash;', __///__)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f></select>
    67     <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=add&boomerang=true'); \x3f>" onclick"javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>')"><\x3fphp echo _("Add __///__") \x3f></a></span>
     64           
     65<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     66    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     67    <select name="$field" id="$field" class="sc-small"><\x3fphp printSelectForm('__///___tbl', "CONCAT(__///___id, '&mdash;', __///__)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f></select>
     68    <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=add&boomerang=true'); \x3f>" onclick="javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>');"><\x3fphp echo _("Add __///__") \x3f></a></span>
    6869    <\x3fphp if ('' != \$frm['__///___id']) { \x3f>
    69     <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=edit&boomerang=true&__///___id=' . \$frm['__///___id']); \x3f>" onclick"javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>')"><\x3fphp echo sprintf(_("Edit __///__ <em>%s</em>"), \$frm['__///__']) \x3f></a></span>
     70        <span class="commanditem commandtext"><a href="<\x3fphp echo \$app->oHREF('__///__.php?op=edit&boomerang=true&__///___id=' . \$frm['__///___id']); \x3f>" onclick="javascript:return confirm('<\x3fphp echo _("Notice: You are about to leave this form page and any changes you may have made without saving will be lost."); \x3f>');"><\x3fphp echo sprintf(_("Edit __///__ <em>%s</em>"), \$frm['__///__']) \x3f></a></span>
    7071    <\x3fphp } \x3f>
     72</div>
    7173E_O_F;
    7274            continue;
     
    7779            $output[$field] = <<<E_O_F
    7880
    79 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    80 <input type="file" name="$field" id="$field" />
     81<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     82    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     83    <input type="file" name="$field" id="$field" />
    8184    <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>
    82     <div class="sc-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') . '_*')) \x3f></div>
     85        <div class="sc-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') . '_*')) \x3f></div>
    8386    <\x3fphp } \x3f>
    8487    <div class="sc-help"><\x3fphp printf(_("File to upload must have one of the following file-name extensions: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div>
     88</div>
    8589E_O_F;
    8690            continue;
     
    9195            $output[$field] = <<<E_O_F
    9296
    93 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    94 <input type="password" class="sc-medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     97<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     98    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     99    <input type="password" name="$field" id="$field" class="sc-medium" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     100</div>
    95101E_O_F;
    96102            continue;
     
    103109            $output[$field] = <<<E_O_F
    104110
    105 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    106 <select name="$field" id="$field"><\x3fphp printSetSelectForm('$db_tbl', '$field', \$frm['$field'], true); \x3f></select>
     111<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     112    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     113    <select name="$field" id="$field"><\x3fphp printSetSelectForm('$db_tbl', '$field', \$frm['$field'], true); \x3f></select>
     114</div>
    107115E_O_F;
    108116            break;
     
    112120            $output[$field] = <<<E_O_F
    113121
    114 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    115 <\x3fphp printSetCheckboxes('$db_tbl', '$field', \$frm['$field'], 1) \x3f>
     122<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     123    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     124    <\x3fphp printSetCheckboxes('$db_tbl', '$field', \$frm['$field'], 1) \x3f>
     125</div>
    116126E_O_F;
    117127            break;
     
    121131            $output[$field] = <<<E_O_F
    122132
    123 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    124 <input type="checkbox" name="$field" id="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f> /><label class="left"><\x3fphp echo _("Check this box to $title"); \x3f></label>
     133<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     134    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     135    <label><input type="checkbox" name="$field" id="$field" <\x3fphp frmChecked(!empty(\$frm['$field'])) \x3f> /><\x3fphp echo _("Check this box to $title"); \x3f></label>
     136</div>
    125137E_O_F;
    126138            break;
     
    132144            $output[$field] = <<<E_O_F
    133145
    134 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    135 <textarea class="sc-large sc-short" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     146<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     147    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     148    <textarea name="$field" id="$field" rows="8" cols="40" class="sc-short sc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     149</div>
    136150E_O_F;
    137151            break;
     
    144158            $output[$field] = <<<E_O_F
    145159
    146 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    147 <textarea class="sc-large sc-tall" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     160<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     161    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     162    <textarea name="$field" id="$field" rows="8" cols="40" class="sc-short sc-medium"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     163</div>
    148164E_O_F;
    149165            break;
     
    170186            $output[$field] = <<<E_O_F
    171187
    172 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    173 <input type="text" class="sc-tiny" size="12" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     188<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     189    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     190    <input type="text" name="$field" id="$field" class="sc-tiny" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     191</div>
    174192E_O_F;
    175193            break;
     
    184202            $output[$field] = <<<E_O_F
    185203
    186 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    187 <input type="text" class="sc-medium" size="25" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     204<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     205    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     206    <input type="text" name="$field" id="$field" class="sc-small" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     207</div>
    188208E_O_F;
    189209            break;
     
    197217            $output[$field] = <<<E_O_F
    198218
    199 <label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    200 <input type="text" class="sc-medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     219<div class="sc-form-row<\x3fphp \$fv->err('$field'); \x3f>">
     220    <label for="$field"><\x3fphp echo _("$title"); \x3f></label>
     221    <input type="text" name="$field" id="$field" class="sc-medium" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     222</div>
    201223E_O_F;
    202224            break;
  • trunk/bin/module_maker/list_template.cli.php

    r270 r295  
    9090            $listrows[] = "<\x3fphp printf('$%01.2f', \$list[\$i]['$field']); \x3f>";
    9191        } else if (preg_match('/(added_by_user_id)/i', $field)) {
    92             $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['added_admin_username']); \x3f>";
     92            $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['added_by_username']); \x3f>";
    9393        } else if (preg_match('/(modified_by_user_id)/i', $field)) {
    94             $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['modified_admin_username']); \x3f>";
     94            $listrows[] = "<\x3fphp echo oTxt(\$list[\$i]['modified_by_username']); \x3f>";
    9595        } else if ('rank' == $field) {
    9696            $listrows[] = "<input type=\"text\" name=\"rank[<\x3fphp echo \$list[\$i]['$primary_key']; \x3f>]\" value=\"<\x3fphp echo \$list[\$i]['rank']; \x3f>\" size=\"5\" />";
     
    164164
    165165echo isset($op) ? '' : <<<E_O_F
    166         <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick"javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> &nbsp;</td>
     166        <td class="sc-nowrap" align="right"><a title="<\x3fphp printf(_("Delete %s"), oTxt(\$list[\$i]['__///__'])) \x3f>" href="<\x3fphp echo \$app->oHREF(\$_SERVER['PHP_SELF'] . "?op=del&$primary_key=" . \$list[\$i]['$primary_key']); \x3f>" onclick"javascript:return confirm('<\x3fphp printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt(\$list[\$i]['__///__'])) \x3f>');"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0" /></a> &nbsp;</td>
    167167    </tr>
    168168    <\x3fphp } \x3f>
  • trunk/bin/module_maker/module.cli.php

    r259 r295  
    137137
    138138// Make sure requested table is in database.
     139if (!isset($tables)) {
     140    die(sprintf("%s Warning: %s does not exist in database %s. No DB tables found!", basename($_SERVER['argv'][0]), $db_tbl, $app->getParam('db_name')));
     141}
    139142if (!in_array($db_tbl, $tables)) {
    140143    die(sprintf("%s Warning: %s does not exist in database %s. Please select one of: \n\n%s\n\n", basename($_SERVER['argv'][0]), $db_tbl, $app->getParam('db_name'), join("\n", $tables)));
     
    207210
    208211$search['admin_form_tag_init'] = '/%ADMIN_FORM_TAG_INIT%/';
    209 $replace['admin_form_tag_init'] = '<form method="post" action="<\x3fphp echo \$_SERVER[\'PHP_SELF\']; \x3f>" class="sc-form">';
     212$replace['admin_form_tag_init'] = "<form method=\"post\" action=\"<\x3fphp echo oTxt(\$_SERVER['PHP_SELF']); \x3f>\" class=\"sc-form\">";
    210213$search['admin_upload_include'] = '/%ADMIN_UPLOAD_INCLUDE%/';
    211214$replace['admin_upload_include'] = '';
  • trunk/bin/module_maker/skel/adm_form.ihtml

    r136 r295  
    66<input type="hidden" name="%PRIMARY_KEY%" value="<?php echo $frm['%PRIMARY_KEY%']; ?>" />
    77
    8 <?php printSubmitButtons($frm['submit_buttons']); ?>
     8<div class="sc-form-row sc-submit-buttons">
     9    <?php printSubmitButtons($frm['submit_buttons']); ?>
     10</div>
    911
    1012%ADM_FORM_TABLE_ROWS%
    1113
    12 <?php printSubmitButtons($frm['submit_buttons']); ?>
     14<div class="sc-form-row sc-submit-buttons">
     15    <?php printSubmitButtons($frm['submit_buttons']); ?>
     16</div>
    1317</form>
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r270 r295  
    33
    44<div id="commandbox">
    5 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get">
    6 <?php $app->printHiddenSession(false); ?>
    75    <span class="sc-nowrap commandtext"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
    8     <br />
    9 
    10     <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: __///__ %SEARCH_FIELDS%.")); ?>" />
    11     <select name="filter___///__">
    12         <?php // printSelectForm('__///___tbl', "CONCAT(__///___id, '&mdash;', city, '&mdash;', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); ?>
    13     </select>
    14     <input type="submit" value="<?php echo _("Search"); ?>" />
    15 </form>
     6    <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
     7        <?php $app->printHiddenSession(false); ?>
     8        <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: __///__ %SEARCH_FIELDS%.")); ?>" />
     9        <select name="filter___///__" class="sc-small">
     10            <?php // printSelectForm('__///___tbl', "CONCAT(__///___id, '&mdash;', city, '&mdash;', title)", '__///___id', getFormData('filter___///__'), array('Any __///__'), 'ORDER BY __///__ ASC'); ?>
     11        </select>
     12        <input type="submit" value="<?php echo _("Filter"); ?>" />
     13    </form>
    1614</div>
    1715
     
    3129        <td class="sc-padleft sc-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>
    3230%ADM_LIST_ROWS%
    33         <td class="sc-padleft sc-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>
     31        <td class="sc-padleft sc-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>
    3432    </tr>
    3533    <?php } ?>
  • trunk/bin/module_maker/skel/admin.php

    r202 r295  
    203203        'new_op' => 'insert',
    204204        'submit_buttons' => array(
    205             'submit' => _("Add %ITEM_TITLE%"),
    206             'repeat' => _("Add &amp; repeat"),
    207             'cancel' => _("Cancel"),
     205            array('name' => 'submit', 'value' => _("Add %ITEM_TITLE%"), 'accesskey' => 's'),
     206            array('name' => 'repeat', 'value' => _("Add &amp; repeat"), 'accesskey' => 'r'),
     207            array('name' => 'cancel', 'value' => _("Cancel"), 'accesskey' => 'c'),
    208208        ),
    209209    );
     
    216216    global $lock;
    217217    $db =& DB::getInstance();
     218    $app =& App::getInstance();
    218219   
    219220    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     
    242243        'new_op' => 'update',
    243244        'submit_buttons' => array(
    244             'submit' => _("Save changes"),
    245             'repeat' => _("Save &amp; edit next"),
    246             'reset' => _("Reset"),
    247             'cancel' => _("Cancel"),
     245            array('name' => 'submit', 'value' => _("Save changes"), 'accesskey' => 's'),
     246            array('name' => 'repeat', 'value' => _("Save & edit next"), 'accesskey' => 'e'),
     247            array('name' => 'reset', 'value' => _("Reset"), 'accesskey' => 'r'),
     248            array('name' => 'cancel', 'value' => _("Cancel"), 'accesskey' => 'c'),
    248249        ),
    249250    ), $frm);
     
    257258    global $cache;
    258259    $db =& DB::getInstance();
     260    $app =& App::getInstance();
    259261   
    260262    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     
    292294    global $cache;
    293295    $db =& DB::getInstance();
     296    $app =& App::getInstance();
    294297   
    295298    // Remove any stale cached list data.
     
    313316    global $lock;
    314317    global $cache;
     318    $db =& DB::getInstance();
    315319    $app =& App::getInstance();
    316320   
     
    342346    global $cache;
    343347    $db =& DB::getInstance();   
     348    $app =& App::getInstance();
    344349   
    345350    $where_clause = '';
     
    374379        SELECT
    375380            %DB_TBL%.*,
    376             a1.username AS added_admin_username,
    377             a2.username AS modified_admin_username
     381            a1.username AS added_by_username,
     382            a2.username AS modified_by_username
    378383        FROM %DB_TBL%
    379         LEFT JOIN admin_tbl a1 ON (%DB_TBL%.added_by_user_id = a1.admin_id)
    380         LEFT JOIN admin_tbl a2 ON (%DB_TBL%.modified_by_user_id = a2.admin_id)
     384        LEFT JOIN user_tbl a1 ON (%DB_TBL%.added_by_user_id = a1.user_id)
     385        LEFT JOIN user_tbl a2 ON (%DB_TBL%.modified_by_user_id = a2.user_id)
    381386        $where_clause
    382387        " . $so->getSortOrderSQL() . "
     
    398403    // First try to return from the cache.
    399404    if ($cache->exists('list')) {
    400         return $cache->get('list');
     405        $list = $cache->get('list');
     406        return $list;
    401407    }
    402408   
     
    419425    global $cache;
    420426    $db =& DB::getInstance();
     427    $app =& App::getInstance();
    421428   
    422429    if (!is_array($ranks)) {
  • trunk/css/admin.inc.css

    r273 r295  
    138138    margin-left: 9em;
    139139    border-left: 1px solid gray;
    140     padding: 0.75em 0.5em 15px 0.5em;
     140    padding: 0.75em 0.5em 2em 0.5em;
    141141    background-color: #FFF;
    142142}
  • trunk/css/codebase.inc.css

    r274 r295  
    1111/* App.inc.php ------------------------------------------------------ */
    1212.sc-msg { z-index: 2000000000; } /* Close to the maximum of a 32-bit integer. */
     13.sc-msg-success,
     14.sc-msg-notice,
    1315.sc-msg-warning,
    14 .sc-msg-error,
    15 .sc-msg-success,
    16 .sc-msg-notice {
     16.sc-msg-error {
    1717    margin: 0 0 6px 0;
    1818    padding: 5px;
     
    2323.sc-msg-success { color: #090; border-color: #090; }
    2424.sc-msg-notice { color: #C60; border-color: #C60; }
     25
     26form .sc-msg-success,
     27form .sc-msg-notice,
     28form .sc-msg-warning,
     29form .sc-msg-error {
     30    border-style: none;
     31    padding: 0;
     32}
    2533
    2634/* PEdit.inc.php ---------------------------------------------------- */
  • trunk/docs/examples/_config.inc.php

    r288 r295  
    11<?php
    2 /**
    3  * _config.inc.php lives in the document root of the site/application. It is the beginning of everything.
     2/** * _config.inc.php lives in the document root of the site/application. It is the beginning of everything.
    43 *
    54 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information.
    65 * @author  Quinn Comendant <quinn@strangecode.com>
    7  * @version 1.2
     6 * @version 1.3
    87 * @since   03 Dec 2005 19:09:32
    98 */
    10 
     9 
    1110// The constant __FILE__ must be an absolute directory path, starting with / on unix or C: on windows.
    1211// To work around a PHP bug always include this config file with: require_once dirname(__FILE__) . '/_config.inc.php';
     
    1918define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
    2019
    21 // The DocRoot for this application. SITE_BASE is ifferent from $_SERVER['DOCUMENT_ROOT'] because the
     20// The DocRoot for this application. SITE_BASE is different from $_SERVER['DOCUMENT_ROOT'] because the
    2221// latter does not change when using the apache Alias directive or URL Rewriting to define a site.
    2322define('SITE_BASE', dirname(__FILE__));
    2423
    25 // Set include path for all tempates.
     24// Set include path for all templates.
    2625ini_set('include_path', join(PATH_SEPARATOR, array(
    2726    COMMON_BASE,
     
    3231// Include core libraries.
    3332require_once 'codebase/lib/Utilities.inc.php';
    34 require_once 'codebase/lib/Auth_SQL.inc.php';
    3533require_once 'codebase/lib/App.inc.php';
    3634
    3735// Primary application class.
    38 $app =& App::getInstance('example.org');
     36$app =& App::getInstance('public');
    3937$app->setParam(array(
    40     'site_name' => 'My example site',
     38    'site_name' => 'WWW Public Site',
    4139    'site_email' => 'hello@example.com',
    4240    'redirect_home_url' => '/',
     
    4745    'character_set' => 'utf-8',
    4846
    49     'enable_session' => false,
     47    'enable_session' => true,
    5048    'enable_db_session_handler' => false,
    5149    'session_use_cookies' => true,
     50    'session_use_trans_sid' => true, // Disable this for high-security sites where session-ID theft is a risk.
    5251
    53     'enable_db' => false,
     52    // 'ssl_domain' => 'www.example.com',
     53    // 'ssl_enabled' => ($_SERVER['SERVER_NAME'] == 'www.example.com'),
     54
     55    'enable_db' => true,
    5456    'db_always_debug' => false,
    5557    'db_debug' => true,
    5658    'db_die_on_failure' => true,
    57     'db_create_tables' => true, /// Disable after site launch.
     59    'db_create_tables' => true, // Disable after site launch.
    5860
    5961    'display_errors' => true,
     
    6567    'log_sms_priority' => false,
    6668    'log_screen_priority' => false,
    67     'log_to_email_address' => 'log@example.com',
    68     'log_to_sms_address' => 'sms@example.com',
     69    'log_to_email_address' => 'log@strangecode.com',
     70    'log_to_sms_address' => 'sms-quinn@strangecode.com',
    6971));
    70 // DB credentials for command line scripts stored in a file with read rights
    71 // given only to the user who will be executing the scripts: -rw-------
    72 // This file includes $app-> method calls so must be included after App.
    73 // require_once 'global/db_auth.inc.php';
     72
     73if (defined('_CLI')) {
     74    // DB credentials for command line scripts stored in a file with read rights
     75    // given only to the user who will be executing the scripts: -rw-------
     76    // This file includes $app-> method calls so this must be included after App::getInstance().
     77    require_once 'global/db_auth.inc.php';
     78}
    7479
    7580// Start application-based functionality: database, session, environment, ini setup, etc.
     
    7782$app->start();
    7883
    79 // Global DB object. Automatically preconfigured by $app->start().
     84// Global DB object. Automatically pre-configured by $app->start().
    8085$db =& DB::getInstance();
    8186
    82 // User authentication.
    83 $auth = new Auth_SQL('user');
     87// Global Auth object.
     88require_once 'codebase/lib/Auth_SQL.inc.php';
     89$auth = new Auth_SQL('public');
    8490$auth->setParam(array(
    8591    'db_table'          => 'user_tbl',
    8692    'db_primary_key'    => 'user_id',
    87     'login_url'         => '/login.php'
     93    'login_url'         => '/login.php',
     94    'login_timeout' => 260000, // 72 hours
     95    'idle_timeout' => 86400, // 24 hours
    8896));
    8997
    90 // Set CSS files.
     98// Load preferences for the user.
     99require_once 'codebase/lib/Prefs.inc.php';
     100$prefs = new Prefs('permanent');
     101$prefs->setParam(array(
     102    'persistent' => $auth->isLoggedIn(),
     103    'user_id' => $auth->get('user_id'),
     104));
     105$prefs->setDefaults(array(
     106));
     107$prefs->load();
     108// Temporary prefs.
     109$tmp_prefs = new Prefs('temporary');
     110$tmp_prefs->setDefaults(array(
     111));
     112
     113// Global record-locking object.
     114require_once 'codebase/lib/Lock.inc.php';
     115$lock =& Lock::getInstance($auth);
     116$lock->setParam(array(
     117    'timeout' => 0,
     118    'auto_timeout' => 1800,
     119    'error_url' => '/lock.php',
     120));
     121
     122// Global cache object.
     123require_once 'codebase/lib/Cache.inc.php';
     124$cache = new Cache('global');
     125$cache->setParam(array('enabled' => true));
     126
     127// Setup CSS files to include. These will always be available.
    91128require_once 'codebase/lib/CSS.inc.php';
    92129$css = new CSS();
    93 $css->setParam(array('cache_css' => true));
     130$css->setParam(array('cache_css' => false)); /// Enable caching after site launch.
    94131$css->setFile('codebase/css/codebase.inc.css');
    95132$css->setFile('codebase/css/utilities.inc.css');
    96 $css->setFile('html/css/screen.inc.css');
     133// $css->setFile('html/css/screen.inc.css');
    97134
    98 // Global navigation elements object.
     135// Nav class for titles, breadcrumbs, and page features.
     136// Global navigation titles, breadcrumbs, and page features.
    99137require_once 'codebase/lib/Navigation.inc.php';
    100138$nav = new Navigation(array(
     
    103141));
    104142
     143// Global site-specific configuration.
     144// $cfg = array();
     145// require_once 'global/config.inc.php';
     146
    105147?>
  • trunk/lib/TemplateGlue.inc.php

    r290 r295  
    6262 * @param  string $db_table   database table to lookup
    6363 * @param  string $db_col     database column to lookup
     64 * @param  bool   $sort          Sort the output.
    6465 * @return array    Array of the set/enum values on success, false on failure.
    6566 */
    66 function getSetEnumFieldValues($db_table, $db_col)
     67function getSetEnumFieldValues($db_table, $db_col, $sort=false)
    6768{
    6869    $app =& App::getInstance();
     
    7374    $row = mysql_fetch_row($qid);
    7475    if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $enum)) {
    75         natsort($enum[1]);
     76        if ($sort) {
     77            natsort($enum[1]);           
     78        }
    7679        return $enum[1];
    7780    } else {
     
    8790 * @param  string $db_table   database table to lookup
    8891 * @param  string $db_col     database column to lookup
    89  */
    90 function printSetSelectForm($db_table, $db_col, $preselected, $blank=false)
    91 {
    92     $values = getSetEnumFieldValues($db_table, $db_col);
     92 * @param  bool   $sort          Sort the output.
     93 */
     94function printSetSelectForm($db_table, $db_col, $preselected, $blank=false, $sort=false)
     95{
     96    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
    9397    if ($values === false) {
    9498        ?><option value="">&nbsp;</option>
     
    121125 * @param  string $db_table   database table to lookup
    122126 * @param  string $db_col     database column to lookup
    123  */
    124 function printEnumRadios($name, $db_table, $db_col, $preselected, $blank=false)
    125 {
    126     $values = getSetEnumFieldValues($db_table, $db_col);
     127 * @param  bool   $sort          Sort the output.
     128 */
     129function printEnumRadios($name, $db_table, $db_col, $preselected, $blank=false, $sort=false)
     130{
     131    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
    127132    if ($values === false) {
    128133        return false;
     
    145150 * @param  int    $columns       number of table columns to print
    146151 * @param  int    $flag          set to 'allone' for name of input fields to all be the same of a multidimentional array.
    147  */
    148 function printSetCheckboxes($db_table, $db_col, $preselected, $columns=1, $flag=null)
     152 * @param  bool   $sort          Sort the output.
     153 */
     154function printSetCheckboxes($db_table, $db_col, $preselected, $columns=1, $flag=null, $sort)
    149155{
    150156    ?>
     
    166172
    167173    // Retreive values of a Set or ENUM database column.
    168     $values = getSetEnumFieldValues($db_table, $db_col);
     174    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
    169175
    170176    // Initialize the HTML table generation vars.
     
    222228 * @param  array  $preselected   array of preselected values (matching the values in $db_col)
    223229 * @param  int    $columns       number of table columns to print
    224  * @param  int    $flag          set to 'allone' for name of input fields to all be the same of a multidimentional array.
    225  */
    226 function printSetRadios($db_table, $db_col, $preselected, $columns=1, $flag=null)
     230 * @param  bool   $sort          Sort the output.
     231 */
     232function printSetRadios($db_table, $db_col, $preselected, $columns=1, $sort=false)
    227233{
    228234    ?>
     
    244250
    245251    // Retreive values of a Set or ENUM database column.
    246     $values = getSetEnumFieldValues($db_table, $db_col);
     252    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
    247253
    248254    // Initialize the HTML table generation vars.
  • trunk/services/admins.php

    r266 r295  
    3939
    4040// Instantiate a sorting object with the default sort and order. Add SQL for each column.
    41 $so = new SortOrder('admin_tbl.admin_id', 'DESC');
    42 $so->setColumn('admin_tbl.admin_id', 'admin_tbl.admin_id ASC', 'admin_tbl.admin_id DESC');
    43 $so->setColumn('admin_tbl.username', 'admin_tbl.username ASC', 'admin_tbl.username DESC');
    44 $so->setColumn('admin_tbl.userpass', 'admin_tbl.userpass ASC', 'admin_tbl.userpass DESC');
    45 $so->setColumn('admin_tbl.first_name', 'admin_tbl.first_name ASC', 'admin_tbl.first_name DESC');
    46 $so->setColumn('admin_tbl.last_name', 'admin_tbl.last_name ASC', 'admin_tbl.last_name DESC');
    47 $so->setColumn('admin_tbl.email', 'admin_tbl.email ASC', 'admin_tbl.email DESC');
    48 $so->setColumn('admin_tbl.user_type', 'admin_tbl.user_type ASC', 'admin_tbl.user_type DESC');
    49 $so->setColumn('admin_tbl.seconds_online', 'admin_tbl.seconds_online ASC', 'admin_tbl.seconds_online DESC');
    50 $so->setColumn('admin_tbl.last_login_datetime', 'admin_tbl.last_login_datetime ASC', 'admin_tbl.last_login_datetime DESC');
    51 $so->setColumn('admin_tbl.last_access_datetime', 'admin_tbl.last_access_datetime ASC', 'admin_tbl.last_access_datetime DESC');
    52 $so->setColumn('admin_tbl.last_login_ip', 'admin_tbl.last_login_ip ASC', 'admin_tbl.last_login_ip DESC');
    53 $so->setColumn('admin_tbl.added_by_user_id', 'admin_tbl.added_by_user_id ASC', 'admin_tbl.added_by_user_id DESC');
    54 $so->setColumn('admin_tbl.modified_by_user_id', 'admin_tbl.modified_by_user_id ASC', 'admin_tbl.modified_by_user_id DESC');
    55 $so->setColumn('admin_tbl.added_datetime', 'admin_tbl.added_datetime ASC', 'admin_tbl.added_datetime DESC');
    56 $so->setColumn('admin_tbl.modified_datetime', 'admin_tbl.modified_datetime ASC', 'admin_tbl.modified_datetime DESC');
     41$so = new SortOrder('admin_id', 'DESC');
     42$so->setColumn('admin_id', $auth->getParam('db_primary_key') . ' ASC', $auth->getParam('db_primary_key') . ' DESC');
     43$so->setColumn('username', $auth->getParam('db_username_column') . ' ASC', $auth->getParam('db_username_column') . ' DESC');
     44$so->setColumn('userpass', $auth->getParam('db_table') . '.userpass ASC', $auth->getParam('db_table') . '.userpass DESC');
     45$so->setColumn('first_name', $auth->getParam('db_table') . '.first_name ASC', $auth->getParam('db_table') . '.first_name DESC');
     46$so->setColumn('last_name', $auth->getParam('db_table') . '.last_name ASC', $auth->getParam('db_table') . '.last_name DESC');
     47$so->setColumn('email', $auth->getParam('db_table') . '.email ASC', $auth->getParam('db_table') . '.email DESC');
     48$so->setColumn('user_type', $auth->getParam('db_table') . '.user_type ASC', $auth->getParam('db_table') . '.user_type DESC');
     49$so->setColumn('seconds_online', $auth->getParam('db_table') . '.seconds_online ASC', $auth->getParam('db_table') . '.seconds_online DESC');
     50$so->setColumn('last_login_datetime', $auth->getParam('db_table') . '.last_login_datetime ASC', $auth->getParam('db_table') . '.last_login_datetime DESC');
     51$so->setColumn('last_access_datetime', $auth->getParam('db_table') . '.last_access_datetime ASC', $auth->getParam('db_table') . '.last_access_datetime DESC');
     52$so->setColumn('last_login_ip', $auth->getParam('db_table') . '.last_login_ip ASC', $auth->getParam('db_table') . '.last_login_ip DESC');
     53$so->setColumn('added_by_user_id', $auth->getParam('db_table') . '.added_by_user_id ASC', $auth->getParam('db_table') . '.added_by_user_id DESC');
     54$so->setColumn('modified_by_user_id', $auth->getParam('db_table') . '.modified_by_user_id ASC', $auth->getParam('db_table') . '.modified_by_user_id DESC');
     55$so->setColumn('added_datetime', $auth->getParam('db_table') . '.added_datetime ASC', $auth->getParam('db_table') . '.added_datetime DESC');
     56$so->setColumn('modified_datetime', $auth->getParam('db_table') . '.modified_datetime ASC', $auth->getParam('db_table') . '.modified_datetime DESC');
    5757
    5858// Instantiate page numbers. Total items are set and calculation is done in the getRecordList function.
     
    143143    if (getFormdata('cancel', false)) {
    144144        // Remove lock
    145         $lock->select('admin_tbl', 'admin_id', getFormData('admin_id'));
     145        $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), getFormData('admin_id'));
    146146        $lock->remove();
    147147        if ($app->validBoomerangURL('admins')) {
     
    162162        if (getFormdata('repeat', false)) {
    163163            // Display edit function with next available ID.
    164             $qid = $db->query("SELECT admin_id FROM admin_tbl WHERE admin_id > '" . $db->escapeString(getFormData('admin_id')) . "' ORDER BY admin_id ASC LIMIT 1");
     164            $qid = $db->query("SELECT " . $auth->getParam('db_primary_key') . " FROM " . $auth->getParam('db_table') . " WHERE " . $auth->getParam('db_primary_key') . " > '" . $db->escapeString(getFormData('admin_id')) . "' ORDER BY " . $auth->getParam('db_primary_key') . " ASC LIMIT 1");
    165165            if (list($next_id) = mysql_fetch_row($qid)) {
    166166                $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $next_id);
     
    265265function &editRecordForm($id)
    266266{
     267    global $auth;
    267268    global $lock;
    268269    $app =& App::getInstance();
    269270    $db =& DB::getInstance();
    270271   
    271     $lock->select('admin_tbl', 'admin_id', $id);
     272    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id);
    272273    if ($lock->isLocked() && !$lock->isMine()) {
    273274        $lock->dieErrorPage();
     
    276277    // Get the information for the form.
    277278    $qid = $db->query("
    278         SELECT *
    279         FROM admin_tbl
    280         WHERE admin_id = '" . $db->escapeString($id) . "'
     279        SELECT *,
     280        " . $auth->getParam('db_primary_key') . " AS admin_id
     281        FROM " . $auth->getParam('db_table') . "
     282        WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($id) . "'
    281283    ");
    282284    if (!$frm = mysql_fetch_assoc($qid)) {
     
    287289
    288290    // Lock this record.
    289     $lock->set('admin_tbl', 'admin_id', $id, $frm['username']);
     291    $lock->set($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id, $frm['username']);
    290292
    291293    // Set misc values for the form.
     
    328330    $db =& DB::getInstance();
    329331   
    330     $lock->select('admin_tbl', 'admin_id', $id);
     332    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $id);
    331333    if ($lock->isLocked() && !$lock->isMine()) {
    332334        $lock->dieErrorPage();
     
    338340    // Get the information for this object.
    339341    $qid = $db->query("
    340         SELECT username, user_type from admin_tbl
    341         WHERE admin_id = '" . $db->escapeString($id) . "'
     342        SELECT " . $auth->getParam('db_username_column') . ", user_type from " . $auth->getParam('db_table') . "
     343        WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($id) . "'
    342344    ");
    343345    if (! list($name, $user_type) = mysql_fetch_row($qid)) {
     
    348350
    349351    // Get the information for this object.
    350     $qid = $db->query("SELECT COUNT(*) from admin_tbl");
     352    $qid = $db->query("SELECT COUNT(*) from " . $auth->getParam('db_table') . "");
    351353    list($num_admins) = mysql_fetch_row($qid);
    352354    if ('root' == $user_type && 'root' != $auth->get('user_type')) {
     
    361363    } else {
    362364        // Delete the record.
    363         $db->query("DELETE FROM admin_tbl WHERE admin_id = '" . $db->escapeString($id) . "'");
     365        $db->query("DELETE FROM " . $auth->getParam('db_table') . " WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($id) . "'");
    364366        $app->raiseMsg(sprintf(_("The admin <em>%s</em> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
    365367    }
     
    381383    // Insert record data.
    382384    $db->query("
    383         INSERT INTO admin_tbl (
    384             username,
     385        INSERT INTO " . $auth->getParam('db_table') . " (
     386            " . $auth->getParam('db_username_column') . ",
    385387            first_name,
    386388            last_name,
     
    406408    // Create version.
    407409    $version = Version::getInstance($auth);
    408     $version->create('admin_tbl', 'admin_id', $last_insert_id, $frm['username']);
     410    $version->create($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $last_insert_id, $frm['username']);
    409411
    410412    $app->raiseMsg(sprintf(_("The Administrator <em>%s</em> has been added."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
     
    421423    $db =& DB::getInstance();
    422424   
    423     $lock->select('admin_tbl', 'admin_id', $frm['admin_id']);
     425    $lock->select($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id']);
    424426    if ($lock->isLocked() && !$lock->isMine()) {
    425427        $lock->dieErrorPage();
     
    437439    // Update record data.
    438440    $db->query("
    439         UPDATE admin_tbl SET
    440             username = '" . $db->escapeString($frm['username']) . "',
     441        UPDATE " . $auth->getParam('db_table') . " SET
     442            " . $auth->getParam('db_username_column') . " = '" . $db->escapeString($frm['username']) . "',
    441443            first_name = '" . $db->escapeString($frm['first_name']) . "',
    442444            last_name = '" . $db->escapeString($frm['last_name']) . "',
     
    445447            modified_by_user_id = '" . $db->escapeString($auth->get('user_id')) . "',
    446448            modified_datetime = NOW()
    447         WHERE admin_id = '" . $db->escapeString($frm['admin_id']) . "'
     449        WHERE " . $auth->getParam('db_primary_key') . " = '" . $db->escapeString($frm['admin_id']) . "'
    448450    ");
    449451
    450452    // Create version.
    451453    $version = Version::getInstance($auth);
    452     $version->create('admin_tbl', 'admin_id', $frm['admin_id'], $frm['username']);
     454    $version->create($auth->getParam('db_table'), $auth->getParam('db_primary_key'), $frm['admin_id'], $frm['username']);
    453455
    454456    $app->raiseMsg(sprintf(_("The Administrator <em>%s</em> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
     
    464466    global $tmp_prefs;
    465467    global $cache;
     468    global $auth;
    466469    $db =& DB::getInstance();
    467470   
     
    474477            $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . "
    475478                (
    476                     admin_tbl.username LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
    477                     OR admin_tbl.first_name LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
    478                     OR admin_tbl.last_name LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
    479                     OR admin_tbl.email LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
     479                    " . $auth->getParam('db_table') . "." . $auth->getParam('db_username_column') . " LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
     480                    OR " . $auth->getParam('db_table') . ".first_name LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
     481                    OR " . $auth->getParam('db_table') . ".last_name LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
     482                    OR " . $auth->getParam('db_table') . ".email LIKE '%" . $db->escapeString($qry_words[$i]) . "%'
    480483                )
    481484            ";
     
    486489    $qid = $db->query("
    487490        SELECT COUNT(*)
    488         FROM admin_tbl
     491        FROM " . $auth->getParam('db_table') . "
    489492        $where_clause
    490493    ");
     
    498501    $sql = "
    499502        SELECT
    500             admin_tbl.*,
    501             a1.username AS added_admin_username,
    502             a2.username AS modified_admin_username
    503         FROM admin_tbl
    504         LEFT JOIN admin_tbl a1 ON (admin_tbl.added_by_user_id = a1.admin_id)
    505         LEFT JOIN admin_tbl a2 ON (admin_tbl.modified_by_user_id = a2.admin_id)
     503            " . $auth->getParam('db_table') . ".*,
     504            " . $auth->getParam('db_table') . "." . $auth->getParam('db_primary_key') . " AS admin_id,           
     505            a1." . $auth->getParam('db_username_column') . " AS added_admin_username,
     506            a2." . $auth->getParam('db_username_column') . " AS modified_admin_username
     507        FROM " . $auth->getParam('db_table') . "
     508        LEFT JOIN " . $auth->getParam('db_table') . " a1 ON (" . $auth->getParam('db_table') . ".added_by_user_id = a1." . $auth->getParam('db_primary_key') . ")
     509        LEFT JOIN " . $auth->getParam('db_table') . " a2 ON (" . $auth->getParam('db_table') . ".modified_by_user_id = a2." . $auth->getParam('db_primary_key') . ")
    506510        $where_clause
    507511        " . $so->getSortOrderSQL() . "
  • trunk/services/templates/admin_form.ihtml

    r235 r295  
    11<?php $fv->printErrorMessages(); ?>
    22
    3 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>">
     3<form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form">
    44<?php $app->printHiddenSession(); ?>
    55<input type="hidden" name="op" value="<?php echo $frm['new_op']; ?>" />
     
    4646        <td>
    4747            <select name="user_type" class="sc-small">
    48             <?php printSetSelectForm('admin_tbl', 'user_type', $frm['user_type'], true); ?>
     48                <?php printSetSelectForm($auth->getParam('db_table'), 'user_type', $frm['user_type'], true); ?>
    4949            </select>
    5050        </td>
  • trunk/services/templates/admin_list.ihtml

    r270 r295  
    11
    22<?php $fv->printErrorMessages(); ?>
    3 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get">
    4 <?php $app->printHiddenSession(false); ?>
     3
    54<div id="commandbox">
    6     <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add administrator"); ?></a></span>
    7 
    8     <div class="form">
     5    <span class="sc-nowrap commanditem"><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add Administrator"); ?></a></span>
     6    <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
     7        <?php $app->printHiddenSession(false); ?>
    98        <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: Admin id, Username, Userpass, First name, Last name, Email.")); ?>" />
    109        <input type="submit" value="<?php echo _("Search"); ?>" />
    11     </div>
     10    </form>
    1211</div>
    1312
    1413<?php include 'list_info.ihtml'; ?>
    1514
     15<form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
    1616<table class="list">
    1717    <tr>
     
    3333    <tr>
    3434        <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0" /></a> &nbsp;</td>
    35         <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF('/admin/versions.php?record_table=admin_tbl&record_key=admin_id&boomerang=true&record_val=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
     35        <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo $app->oHREF(sprintf('/admin/versions.php?record_table=%s&record_key=%s&record_val=%s&boomerang=true', $auth->getParam('db_table'), $auth->getParam('db_primary_key'), $list[$i]['admin_id'])); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
    3636        <td class="sc-nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?> &nbsp;</td>
    3737        <td class="sc-nowrap"><?php echo oTxt($list[$i]['username'], true); ?> &nbsp;</td>
  • trunk/services/templates/lock.ihtml

    r185 r295  
    44}
    55?>
    6 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>">
     6<form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form">
    77    <?php $app->printHiddenSession() ?>
    88    <input type="hidden" name="lock_id" value="<?php echo $lock->getID(); ?>" />
  • trunk/services/templates/log_list.ihtml

    r270 r295  
    1 <form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get">
     1<form action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" method="get" class="sc-form">
    22<?php $app->printHiddenSession(false); ?>
    33<div id="commandbox">
  • trunk/services/templates/login_form.ihtml

    r291 r295  
    1 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>">
     1<form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form">
    22<?php $app->printHiddenSession() ?>
    33<table>
  • trunk/services/templates/password.ihtml

    r235 r295  
    11<?php $fv->printErrorMessages(); ?>
    22
    3 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>">
     3<form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form">
    44<?php $app->printHiddenSession() ?>
    55<input type="hidden" name="op" value="update_password" />
  • trunk/services/templates/versions_list.ihtml

    r270 r295  
    1 <form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>">
     1<form method="post" action="<?php echo oTxt($_SERVER['PHP_SELF']); ?>" class="sc-form">
    22<?php $app->printHiddenSession() ?>
    33<input type="submit" name="op" value="<?php echo _("Cancel"); ?>" />
Note: See TracChangeset for help on using the changeset viewer.