Changeset 121


Ignore:
Timestamp:
May 22, 2006 5:29:19 AM (18 years ago)
Author:
scdev
Message:

Q - Added "sc-" to all css class selectors; Finished reworking Upload and ImageThumb? (now with GD support!); More PHP 5 upgrades.

Location:
trunk
Files:
21 edited

Legend:

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

    r111 r121  
    6464
    6565<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    66 <select name="$field" id="$field" class="small"><\x3fphp printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', <##>)", '$field', \$frm['$field'], true, 'ORDER BY $field ASC'); \x3f></select>
     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>
    6767    <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>
    6868    <\x3fphp if ('' != \$frm['<##>_id']) { \x3f>
     
    8080<input type="file" name="$field" id="$field" />
    8181    <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>
    82     <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') . '_*')) \x3f></div>
     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>
    8383    <\x3fphp } \x3f>
    84     <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>
     84    <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>
    8585E_O_F;
    8686            continue;
     
    9292
    9393<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    94 <input type="password" class="medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     94<input type="password" class="sc-medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    9595E_O_F;
    9696            continue;
     
    133133
    134134<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    135 <textarea class="large short" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     135<textarea class="sc-large sc-short" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
    136136E_O_F;
    137137            break;
     
    145145
    146146<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    147 <textarea class="large tall" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
     147<textarea class="sc-large sc-tall" cols="75" rows="4" name="$field" id="$field"><\x3fphp echo oTxt(\$frm['$field']); \x3f></textarea>
    148148E_O_F;
    149149            break;
     
    171171
    172172<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    173 <input type="text" class="tiny" size="12" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     173<input type="text" class="sc-tiny" size="12" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    174174E_O_F;
    175175            break;
     
    185185
    186186<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    187 <input type="text" class="medium" size="25" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     187<input type="text" class="sc-medium" size="25" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    188188E_O_F;
    189189            break;
     
    198198
    199199<label for="$field"<\x3fphp \$fv->err('$field') \x3f>><\x3fphp echo _("$title"); \x3f></label>
    200 <input type="text" class="medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
     200<input type="text" class="sc-medium" size="50" name="$field" id="$field" value="<\x3fphp echo oTxt(\$frm['$field']); \x3f>" />
    201201E_O_F;
    202202            break;
  • trunk/bin/module_maker/list_template.cli.php

    r111 r121  
    111111<form action="<\x3fphp echo \$_SERVER['PHP_SELF']; \x3f>" method="get">
    112112<\x3fphp App::printHiddenSession(false); \x3f>
    113     <span class="nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span>
     113    <span class="sc-nowrap commandtext"><a href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=add'); \x3f>"><\x3fphp echo _("Add <##>"); \x3f></a></span>
    114114    <br />
    115115
    116     <input type="text" class="small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" />
     116    <input type="text" class="sc-small" size="20" name="search_query" value="<\x3fphp echo getFormData('search_query'); \x3f>" title="<\x3fphp echo oTxt(_("Fields searched: <##>.")); \x3f>" />
    117117    <select name="filter_<##>">
    118118        <\x3fphp // printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', city, '&mdash;', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##> ASC'); \x3f>
     
    149149    <\x3fphp for (\$i = 0; \$i <= \$page->last_item - \$page->first_item && \$page->total_items > 0; \$i++) { \x3f>
    150150    <tr>
    151         <td class="nowrap"><a title="<\x3fphp printf(_("Edit %s"), oTxt(\$list[\$i]['<##>'])) \x3f>" href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=edit&$primary_key=' . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
    152         <td class="nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['<##>'])) \x3f>" href="<\x3fphp echo App::oHREF("/admin/versions.php?record_table=$db_tbl&record_key=$primary_key&boomerang=true&record_val=" . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
     151        <td class="sc-nowrap"><a title="<\x3fphp printf(_("Edit %s"), oTxt(\$list[\$i]['<##>'])) \x3f>" href="<\x3fphp echo App::oHREF(\$_SERVER['PHP_SELF'] . '?op=edit&$primary_key=' . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> &nbsp;</td>
     152        <td class="sc-nowrap"><a title="<\x3fphp printf(_("Versions of %s"), oTxt(\$list[\$i]['<##>'])) \x3f>" href="<\x3fphp echo App::oHREF("/admin/versions.php?record_table=$db_tbl&record_key=$primary_key&boomerang=true&record_val=" . \$list[\$i]['$primary_key']); \x3f>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> &nbsp;</td>
    153153
    154154E_O_F;
     
    158158    foreach ($listrows as $col_data) {
    159159?>
    160         <td class="nowrap"><?php echo $col_data; ?> &nbsp;</td>
     160        <td class="sc-nowrap"><?php echo $col_data; ?> &nbsp;</td>
    161161<?php
    162162    }
     
    164164
    165165echo isset($op) ? '' : <<<E_O_F
    166         <td class="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>
     
    170170
    171171<\x3fphp if (\$page->total_pages > 1) { \x3f>
    172 <div class="nowrap commandtext" style="float: right;"><\x3fphp echo _("Pages:"); \x3f>&nbsp;<\x3fphp \$page->printPageNumbers() \x3f></div>
     172<div class="sc-nowrap commandtext" style="float: right;"><\x3fphp echo _("Pages:"); \x3f>&nbsp;<\x3fphp \$page->printPageNumbers() \x3f></div>
    173173<\x3fphp } \x3f>
    174174</form>
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r51 r121  
    55<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
    66<?php App::printHiddenSession(false); ?>
    7     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
     7    <span class="sc-nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add %ITEM_TITLE%"); ?></a></span>
    88    <br />
    99
    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%.")); ?>" />
     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%.")); ?>" />
    1111    <select name="filter_<##>">
    1212        <?php // printSelectForm('<##>_tbl', "CONCAT(<##>_id, '&mdash;', city, '&mdash;', title)", '<##>_id', getFormData('filter_<##>'), array('Any <##>'), 'ORDER BY <##> ASC'); ?>
     
    2828    <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
    2929    <tr>
    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>
     30        <td class="padleft sc-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 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>
    3232%ADM_LIST_ROWS%
    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>
     33        <td class="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>
    3434    </tr>
    3535    <?php } ?>
     
    3737
    3838<?php if ($page->total_pages > 1) { ?>
    39 <div class="nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
     39<div class="sc-nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
    4040<?php } ?>
    4141<?php if ($page->total_items > 0) { ?>
  • trunk/css/utilities.inc.css

    r106 r121  
    1111/*_____________________ FORMS ____________________*/
    1212
    13 input.tiny, textarea.tiny, select.tiny,
    14 input.small, textarea.small, select.small,
    15 input.medium, textarea.medium, select.medium,
    16 input.large, textarea.large, select.large       { margin: 0 0.5em 0 0; }
     13input.sc-tiny, textarea.sc-tiny, select.sc-tiny,
     14input.sc-small, textarea.sc-small, select.sc-small,
     15input.sc-medium, textarea.sc-medium, select.sc-medium,
     16input.sc-large, textarea.sc-large, select.sc-large       { margin: 0 0.5em 0 0; }
    1717
    18 input.tiny, textarea.tiny, select.tiny          { width: 4.75em; }
    19 input.small, textarea.small, select.small       { width: 10em; }
    20 input.medium, textarea.medium, select.medium    { width: 20.5em; }
    21 input.large, textarea.large, select.large       { width: 41.5em; }
    22 input.full, textarea.full, select.full          { width: 100%; }
    23 select.small                                    { width: 10em; }
    24 select.medium                                   { width: 20.5em; }
     18input.sc-tiny, textarea.sc-tiny, select.sc-tiny          { width: 4.75em; }
     19input.sc-small, textarea.sc-small, select.sc-small       { width: 10em; }
     20input.sc-medium, textarea.sc-medium, select.sc-medium    { width: 20.5em; }
     21input.sc-large, textarea.sc-large, select.sc-large       { width: 41.5em; }
     22input.sc-full, textarea.sc-full, select.sc-full          { width: 100%; }
     23select.sc-small                                    { width: 10em; }
     24select.sc-medium                                   { width: 20.5em; }
    2525
    26 textarea.twolines, select.twolines              { height: 3em; }
    27 textarea.short, select.short                    { height: 8em; }
    28 textarea.tall, select.tall                      { height: 25em; }
    29 textarea.fullscreen, select.fullscreen          { height: 40em; }
     26textarea.sc-twolines, select.sc-twolines              { height: 3em; }
     27textarea.sc-short, select.sc-short                    { height: 8em; }
     28textarea.sc-tall, select.sc-tall                      { height: 25em; }
     29textarea.sc-fullscreen, select.sc-fullscreen          { height: 40em; }
    3030
    3131/*_____________________ UTILITIES ____________________*/
    32 .nowrap { white-space: nowrap; }
    33 .clearboth { clear: both; }
    34 .center { text-align: center; }
    35 .right { text-align: right; }
    36 .padright { padding: 0 10px 0 0; }
    37 .padleft { padding: 0 0 0 10px; }
    38 .help { color: #999; font-weight: normal; }
    39 .monospaced { font-family: monaco, courier; font-weight: normal; }
     32.sc-nowrap { white-space: nowrap; }
     33.sc-clearboth { clear: both; }
     34.sc-center { text-align: center; }
     35.sc-right { text-align: right; }
     36.sc-padright { padding: 0 10px 0 0; }
     37.sc-padleft { padding: 0 0 0 10px; }
     38.sc-help { color: #999; font-weight: normal; }
     39.sc-monospaced { font-family: monaco, courier; font-weight: normal; }
    4040
    41 /* .pkg class wraps enclosing block element around inner floated elements */
    42 .pkg:after { content: " "; display: block; visibility: hidden; clear: both; height: 0.1px; font-size: 0.1em; line-height: 0.0; }
    43 * html .pkg { display: block; }
     41/* .sc-pkg class wraps enclosing block element around inner floated elements */
     42.sc-pkg:after { content: " "; display: block; visibility: hidden; clear: both; height: 0.1px; font-size: 0.1em; line-height: 0.0; }
     43* html .sc-pkg { display: block; }
    4444/* no ie mac \*/
    45 * html .pkg { height: 1%; }
    46 .pkg { display: block; }
     45* html .sc-pkg { height: 1%; }
     46.sc-pkg { display: block; }
    4747/* */
  • trunk/docs/coding_standards.txt

    r42 r121  
    182182        // Here comes the HTML...
    183183        ?>
    184         <div align="right" class="tiny">
     184        <div align="right" class="sc-tiny">
    185185        [&nbsp;<a href="<?php echo App::oHREF('contact.php') ?>">Contact us</a>&nbsp;]
    186186        </div>
  • trunk/lib/Auth_SQL.inc.php

    r119 r121  
    251251            WHERE " . $this->_params['db_primary_key'] . " = '" . $this->getVal('user_id') . "'
    252252        ");
    253         $_SESSION['_auth_file'] = array('authenticated' => false);
     253        $_SESSION[$this->_sess] = array('authenticated' => false);
    254254    }
    255255
     
    528528                $expire_reasons[] = 'idle_timeout expired';
    529529            }
    530             if ($_SESSION['_auth_file']['remote_ip'] != getRemoteAddr() && !$user_in_trusted_network) {
     530            if ($_SESSION[$this->_sess]['remote_ip'] != getRemoteAddr() && !$user_in_trusted_network) {
    531531                $expire_reasons[] = sprintf('remote_ip not matched (%s != %s)', $_SESSION[$this->_sess]['remote_ip'], getRemoteAddr());
    532532            }
  • trunk/lib/Captcha.inc.php

    r108 r121  
    1616<!-- HTML form for captcha -->
    1717<label for="sc-captcha"><?php echo _("Reverse Turing Test") ?></label>
    18 <p class="help"><?php echo _("Please type the following number to prove you are a human. This is a measure to prevent spam robots from submitting this form.") ?></p>
     18<p class="sc-help"><?php echo _("Please type the following number to prove you are a human. This is a measure to prevent spam robots from submitting this form.") ?></p>
    1919<pre style="font-size: 0.5em;"><?php $captcha->printAsciiNumber() ?></pre>
    2020<?php $captcha->printForm() ?>
  • trunk/lib/FormValidator.inc.php

    r119 r121  
    426426        return true;
    427427    }
    428 //     function validateEmail($form_name, $allow_fullname=false)
    429 //     {
    430 //         $email = getFormData($form_name);
    431 //         if ('' == trim($email)) {
    432 //             return false;
    433 //         }
    434 //
    435 //         // Test email address format.
    436 //         if ($allow_fullname) {
    437 //             if (!$this->checkRegex($form_name, '/^[^<>@]*<?[^\s@\[\]<>()]+\@[A-Za-z0-9.-]+\.[A-Za-z]{2,5}>?$/i', true, sprintf(_("<strong>%s</strong> is not a valid email address."), $email))) {
    438 //                 App::logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);
    439 //                 return false;
    440 //             }
    441 //         } else {
    442 //             if (!$this->checkRegex($form_name, '/^[^\s@\[\]<>()]+\@[A-Za-z0-9.-]+\.[A-Za-z]{2,5}$/i', true, sprintf(_("<strong>%s</strong> is not a valid email address."), $email))) {
    443 //                 App::logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);
    444 //                 return false;
    445 //             }
    446 //         }
    447 //
    448 //         // Test length.
    449 //         if (!$this->stringLength($form_name, 0, 255, sprintf(_("<strong>Email address</strong> must contain less than 256 characters."), $email))) {
    450 //             App::logMsg(sprintf('The email address %s must contain less than 256 characters.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);
    451 //             return false;
    452 //         }
    453 //
    454 //         // Check domain exists and has valid MX record.
    455 //         preg_match('/^[^<>@]*<?[^\s@\[\]<>()]+\@([A-Za-z0-9.-]+\.[A-Za-z]{2,5})>?$/i', $email, $matches);
    456 //         if (!empty($matches[1])) {
    457 //             if (!checkdnsrr($matches[1] . '.', 'MX') && gethostbyname($matches[1]) == $matches[1]) {
    458 //                 $this->addError($form_name, sprintf(_("<strong>%s</strong> is not a valid email domain name"), $matches[1]));
    459 //                 App::logMsg(sprintf('The email address %s contains an invalid email domain name (%s).', getFormData($form_name), $matches[1]), LOG_DEBUG, __FILE__, __LINE__);
    460 //                 return false;
    461 //             }
    462 //         }
    463 //
    464 //         return true;
    465 //     }
    466428
    467429    /**
  • trunk/lib/Image.inc.php

    r95 r121  
    5555        $src = $this->oSrc($id);
    5656        $filepath = preg_match('!://!', $src) ? $src : getenv('DOCUMENT_ROOT') . $src;
     57        // Use exif_imagetype to check not only file existance but that of a valid image.
    5758        return false != @exif_imagetype($filepath);
    5859    }
     
    9495    {
    9596        $file_name = '';
     97        // filename_pattern is a sprintf argument with %s replaced with the image id.
    9698        if ($file_match = glob(sprintf("%s/{$this->_params['filename_pattern']}", $this->_params['base_path'], $id))) {
    9799            $file_name = basename(end($file_match));
  • trunk/lib/ImageThumb.inc.php

    r120 r121  
    194194        if (isset($index) && isset($this->image_specs[$index])) {
    195195            // Merge with previous.
    196             $this->image_specs[$index] = array_merge($this->image_specs[$index], $spec);
     196            $final_spec = array_merge($this->image_specs[$index], $spec);
     197            $this->image_specs[$index] = $final_spec;
    197198        } else {
    198199            // Merge with defaults.
    199             $this->image_specs[] = array_merge($this->default_image_specs, $spec);           
    200         }
     200            $final_spec = array_merge($this->default_image_specs, $spec);           
     201            $this->image_specs[] = $final_spec;
     202        }
     203       
     204        return $final_spec;
    201205    }
    202206
     
    207211     * @return  bool true on success, false on failure.
    208212     */
    209     function processAll()
     213    function processAll($runtime_specs=null)
    210214    {
    211215        // Ensure we have a source.
     
    228232            $return_val = 0;
    229233            foreach ($files as $file_name) {
    230                 $return_val += $this->processFile($file_name);
     234                $return_val += $this->processFile($file_name, $runtime_specs);
    231235            }
    232236            $this->_raiseMsg(sprintf(_("Resized %s images."), sizeof($files)), MSG_SUCCESS, __FILE__, __LINE__);
     
    243247     * @access  public
    244248     * @param   string $file_name Name of file with extention.
     249     * @param   array $runtime_specs Array of specifications that will override all configured specifications.
    245250     * @return  bool true on success, false on failure.
    246251     */
    247     function processFile($file_name)
     252    function processFile($file_name, $runtime_specs=null)
    248253    {
    249254        // Source file determinted by provided file_name.
     
    252257        // Ensure we have a source.
    253258        if (sizeof($this->image_specs) < 1) {
    254             App::logMsg(sprintf('Image specifications not set before processing.'), LOG_ERR, __FILE__, __LINE__);
    255             return false;
     259            if (is_array($runtime_specs)) {
     260                $this->setSpec($runtime_specs, 0);
     261            } else {
     262                App::logMsg(sprintf('Image specifications not set before processing.'), LOG_ERR, __FILE__, __LINE__);
     263                return false;               
     264            }
    256265        }
    257266
     
    265274        if (!file_exists($source_file)) {
    266275            $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s was not found."), $file_name), MSG_ERR, __FILE__, __LINE__);
    267             App::logMsg(sprintf('Source image not found: %s', $file_name), LOG_ALERT, __FILE__, __LINE__);
     276            App::logMsg(sprintf('Source image not found: %s', $source_file), LOG_ALERT, __FILE__, __LINE__);
    268277            return false;
    269278        }
     
    272281        if (!is_readable($source_file)) {
    273282            $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s is not readable."), $file_name), MSG_ERR, __FILE__, __LINE__);
    274             App::logMsg(sprintf('Source image not readable: %s', $file_name), LOG_ALERT, __FILE__, __LINE__);
     283            App::logMsg(sprintf('Source image not readable: %s', $source_file), LOG_ALERT, __FILE__, __LINE__);
    275284            return false;
    276285        }
     
    279288        if (filesize($source_file) <= 0) {
    280289            $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s is zero bytes."), $file_name), MSG_ERR, __FILE__, __LINE__);
    281             App::logMsg(sprintf('Source image is zero bytes: %s', $file_name), LOG_ALERT, __FILE__, __LINE__);
     290            App::logMsg(sprintf('Source image is zero bytes: %s', $source_file), LOG_ALERT, __FILE__, __LINE__);
    282291            return false;
    283292        }
     
    286295        if (!$this->_validFileExtension($file_name)) {
    287296            $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s not a valid type. It must have one of the following file name extensions: %s"), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__);
    288             App::logMsg(sprintf('Image resizing failed: source image not of valid type: %s', $file_name), LOG_ERR, __FILE__, __LINE__);
     297            App::logMsg(sprintf('Image resizing failed: source image not of valid type: %s', $source_file), LOG_ERR, __FILE__, __LINE__);
    289298            return false;
    290299        }
     
    295304        // To keep this script running even if user tries to stop browser.
    296305        ignore_user_abort(true);
    297         if (!ini_get('safe_mode')) {
    298             set_time_limit(300);
    299         }
     306        ini_set('max_execution_time', 300);
     307        ini_set('max_input_time', 300);
    300308
    301309        // This remains zero until something goes wrong.
    302310        $return_val = 0;
    303311
    304         foreach ($this->image_specs as $spec) {
     312        foreach ($this->image_specs as $index => $spec) {
     313           
     314            if (is_array($runtime_specs)) {
     315                // Override with runtime specs.
     316                $spec = $this->setSpec($runtime_specs, $index);
     317            }
    305318           
    306319            // Destination filename uses the extention defined by dest_file_extention.
     
    558571            }
    559572        }
    560         $this->_raiseMsg(sprintf(_("The thumbnails for file <strong>%s</strong> have been deleted."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
     573        $this->_raiseMsg(sprintf(_("The thumbnails for file %s have been deleted."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
    561574        return 0 === $return_val;
    562575    }
     
    582595            return false;
    583596        }
    584         $this->_raiseMsg(sprintf(_("The original file <strong>%s</strong> has been deleted."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
     597        $this->_raiseMsg(sprintf(_("The original file %s has been deleted."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
    585598        return true;
    586599    }
     
    615628    {
    616629        preg_match('/.*?\.(\w+)$/i', $file_name, $ext);
    617         return in_array(strtolower($ext[1]), $this->getParam('valid_file_extensions'));
     630        return !empty($ext) && in_array(strtolower($ext[1]), $this->getParam('valid_file_extensions'));       
    618631    }
    619632
  • trunk/lib/PEdit.inc.php

    r101 r121  
    270270                ?>
    271271                <label><?php echo ucfirst(str_replace('_', ' ', $name)); ?></label>
    272                 <input type="text" name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-field-<?php echo $name; ?>" value="<?php echo oTxt($this->_data[$name]['content']); ?>" class="full" />
     272                <input type="text" name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-field-<?php echo $name; ?>" value="<?php echo oTxt($this->_data[$name]['content']); ?>" class="sc-full" />
    273273                <?php
    274274                break;
     
    276276                ?>
    277277                <label><?php echo ucfirst(str_replace('_', ' ', $name)); ?></label>
    278                 <textarea name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-field-<?php echo $name; ?>" rows="" cols="" class="full tall"><?php echo oTxt($this->_data[$name]['content']); ?></textarea>
     278                <textarea name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-field-<?php echo $name; ?>" rows="" cols="" class="full sc-tall"><?php echo oTxt($this->_data[$name]['content']); ?></textarea>
    279279                <?php
    280280                break;
     
    365365                        <td><?php echo date(App::getParam('time_format'), $v['unixtime']); ?></td>
    366366                        <td><?php echo humanFileSize($v['filesize']); ?></td>
    367                         <td class="nowrap"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=View&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("View"); ?></a> <?php echo _("or"); ?> <a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=Restore&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("Restore"); ?></a></td>
     367                        <td class="sc-nowrap"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=View&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("View"); ?></a> <?php echo _("or"); ?> <a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=Restore&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("Restore"); ?></a></td>
    368368                    </tr>
    369369                    <?php
     
    371371                ?>
    372372                </table>
    373                 <div class="help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $this->getParam('versions_min_qty'), $this->getParam('versions_min_days')); ?></div>
     373                <div class="sc-help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $this->getParam('versions_min_qty'), $this->getParam('versions_min_days')); ?></div>
    374374                <?php
    375375            }
  • trunk/lib/Upload.inc.php

    r119 r121  
    3535        'dest_file_perms' => 0600,
    3636
     37        // The file permissions of the uploaded files. Remember, files will be owned by the web server user.
     38        'dest_dir_perms' => 0700,
     39
    3740        // Require file to have one of the following file name extentions.
    3841        'valid_file_extensions' => array('jpg', 'jpeg', 'gif', 'png', 'pdf', 'txt', 'text', 'html', 'htm'),
     
    4346
    4447    // Array of file name extensions and corresponding mime-types.
    45     var $mime_extension_map = array( 'ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/octet-stream', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ps' => 'application/postscript', 'eps' => 'application/postscript', 'ai' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'stc' => 'application/vnd.sun.xml.calc.template', 'sxc' => 'application/vnd.sun.xml.calc', 'std' => 'application/vnd.sun.xml.draw.template', 'sxd' => 'application/vnd.sun.xml.draw', 'sti' => 'application/vnd.sun.xml.impress.template', 'sxi' => 'application/vnd.sun.xml.impress', 'sxm' => 'application/vnd.sun.xml.math', 'sxg' => 'application/vnd.sun.xml.writer.global', 'stw' => 'application/vnd.sun.xml.writer.template', 'sxw' => 'application/vnd.sun.xml.writer', 'vsd' => 'application/vnd.visio', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'Z' => 'application/x-compress', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'tgz' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hdf' => 'application/x-hdf', 'php3' => 'application/x-httpd-php3', 'php' => 'application/x-httpd-php', 'js' => 'application/x-javascript', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', 'skt' => 'application/x-koan', 'latex' => 'application/x-latex', 'wmd' => 'application/x-ms-wmd', 'wmz' => 'application/x-ms-wmz', 'cdf' => 'application/x-netcdf', 'nc' => 'application/x-netcdf', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sh' => 'application/x-sh', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'tex' => 'application/x-tex', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'roff' => 'application/x-troff', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', 'xml' => 'application/xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'kar' => 'audio/midi', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp3' => 'audio/mpeg', 'mp2' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aiff' => 'audio/x-aiff', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'wax' => 'audio/x-ms-wax', 'wma' => 'audio/x-ms-wma', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'ics' => 'text/calendar', 'ifb' => 'text/calendar', 'vcs' => 'text/calendar', 'vfb' => 'text/calendar', 'css' => 'text/css', 'diff' => 'text/diff', 'patch' => 'text/diff', 'html' => 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', 'txt' => 'text/plain', 'asc' => 'text/plain', 'log' => 'text/plain', 'po' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'tsv' => 'text/tab-separated-values', 'wmls' => 'text/vnd.wap.wmlscript', 'wml' => 'text/vnd.wap.wml', 'etx' => 'text/x-setext', 'vcf' => 'text/x-vcard', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'asf' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'wmv' => 'video/x-ms-wmv', 'wm' => 'video/x-ms-wm', 'wmx' => 'video/x-ms-wmx', 'wvx' => 'video/x-ms-wvx', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference/x-cooltalk', );
     48    var $mime_extension_map = array( 'ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/octet-stream', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'sxc' => 'application/vnd.sun.xml.calc', 'stc' => 'application/vnd.sun.xml.calc.template', 'sxd' => 'application/vnd.sun.xml.draw', 'std' => 'application/vnd.sun.xml.draw.template', 'sxi' => 'application/vnd.sun.xml.impress', 'sti' => 'application/vnd.sun.xml.impress.template', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 'sxg' => 'application/vnd.sun.xml.writer.global', 'stw' => 'application/vnd.sun.xml.writer.template', 'vsd' => 'application/vnd.visio', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'Z' => 'application/x-compress', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'tgz' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hdf' => 'application/x-hdf', 'php' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php3', 'js' => 'application/x-javascript', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', 'skt' => 'application/x-koan', 'latex' => 'application/x-latex', 'wmd' => 'application/x-ms-wmd', 'wmz' => 'application/x-ms-wmz', 'cdf' => 'application/x-netcdf', 'nc' => 'application/x-netcdf', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'psd' => 'application/x-photoshop', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'roff' => 'application/x-troff', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xml' => 'application/xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'kar' => 'audio/midi', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'wax' => 'audio/x-ms-wax', 'wma' => 'audio/x-ms-wma', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'ics' => 'text/calendar', 'ifb' => 'text/calendar', 'vcs' => 'text/calendar', 'vfb' => 'text/calendar', 'css' => 'text/css', 'csv' => 'text/csv', 'diff' => 'text/diff', 'patch' => 'text/diff', 'htm' => 'text/html', 'html' => 'text/html', 'shtml' => 'text/html', 'asc' => 'text/plain', 'log' => 'text/plain', 'po' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'tsv' => 'text/tab-separated-values', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'etx' => 'text/x-setext', 'vcf' => 'text/x-vcard', 'xsl' => 'text/xml', 'mp4' => 'video/mp4v-es', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'asf' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'wm' => 'video/x-ms-wm', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wvx' => 'video/x-ms-wvx', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference/x-cooltalk', );
    4649
    4750    /**
     
    6063                // Must be directory.
    6164                if (!is_dir($params['upload_path'])) {
    62                     App::logMsg(sprintf('Upload directory invalid: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__);
    63                     trigger_error(sprintf('Upload directory invalid: %s', $params['upload_path']), E_USER_ERROR);
     65                    App::logMsg(sprintf('Attempting to auto-create upload directory: %s', $params['upload_path']), LOG_NOTICE, __FILE__, __LINE__);
     66                    mkdir($params['upload_path'], $this->getParam('dest_dir_perms'));
     67                    if (!is_dir($params['upload_path'])) {
     68                        App::logMsg(sprintf('Upload directory invalid: %s', $params['upload_path']), LOG_ERR, __FILE__, __LINE__);
     69                        trigger_error(sprintf('Upload directory invalid: %s', $params['upload_path']), E_USER_ERROR);
     70                    }
    6471                }
    6572                // Must be writable.
     
    159166                    // Valid custom file name.
    160167                    $file_name = $custom_file_name;
    161                     $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> has been renamed to <strong>%s</strong>."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__);
     168                    $this->_raiseMsg(sprintf(_("The file %s has been renamed to %s."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__);
    162169                    App::logMsg(sprintf('Using custom file name: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);
    163170                } else {
     
    171178                    // Valid custom file name.
    172179                    $file_name = $custom_file_name[$i];
    173                     $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> has been renamed to <strong>%s</strong>."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__);
     180                    $this->_raiseMsg(sprintf(_("The file %s has been renamed to %s."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__);
    174181                    App::logMsg(sprintf('Using custom file name: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);
    175182                } else {
     
    180187            }
    181188
    182             // Clean the file name of bad characters.
    183             $file_name = $this->cleanFileName($file_name);
    184 
    185             // If the file name has no extension, use the mime-type extension.
     189            // Check The php upload error messages.
     190            if (UPLOAD_ERR_INI_SIZE === $files['error'][$i]) {
     191                $this->_raiseMsg(sprintf(_("The file %s failed uploading: it exceeds the maximum allowed upload file size of %s."), $file_name, ini_get('upload_max_filesize')), MSG_ERR, __FILE__, __LINE__);
     192                App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_INI_SIZE (currently %s)."), $files['error'][$i], $file_name, ini_get('upload_max_filesize')), LOG_ERR, __FILE__, __LINE__);
     193                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_INI_SIZE);
     194                continue;
     195            }
     196            if (UPLOAD_ERR_FORM_SIZE === $files['error'][$i]) {
     197                $this->_raiseMsg(sprintf(_("The file %s failed uploading: it exceeds the maximum allowed upload file size of %s."), $file_name, $_POST['MAX_FILE_SIZE']), MSG_ERR, __FILE__, __LINE__);
     198                App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_FORM_SIZE (currently %s)."), $files['error'][$i], $file_name, $_POST['MAX_FILE_SIZE']), LOG_ERR, __FILE__, __LINE__);
     199                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_FORM_SIZE);
     200                continue;
     201            }
     202            if (UPLOAD_ERR_PARTIAL === $files['error'][$i]) {
     203                $this->_raiseMsg(sprintf(_("The file %s failed uploading: it was only partially uploaded."), $file_name), MSG_ERR, __FILE__, __LINE__);
     204                App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_PARTIAL."), $files['error'][$i], $file_name), LOG_ERR, __FILE__, __LINE__);
     205                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_PARTIAL);
     206                continue;
     207            }
     208            if (UPLOAD_ERR_NO_FILE === $files['error'][$i]) {
     209                $this->_raiseMsg(sprintf(_("The file %s failed uploading: no file was uploaded."), $file_name), MSG_ERR, __FILE__, __LINE__);
     210                App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_NO_FILE."), $files['error'][$i], $file_name), LOG_ERR, __FILE__, __LINE__);
     211                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_NO_FILE);
     212                continue;
     213            }
     214            if (UPLOAD_ERR_NO_TMP_DIR === $files['error'][$i]) {
     215                $this->_raiseMsg(sprintf(_("The file %s failed uploading: temporary upload directory missing."), $file_name), MSG_ERR, __FILE__, __LINE__);
     216                App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_NO_TMP_DIR."), $files['error'][$i], $file_name), LOG_ERR, __FILE__, __LINE__);
     217                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_NO_TMP_DIR);
     218                continue;
     219            }
     220
     221            // Check to be sure it's an uploaded file.
     222            if (!is_uploaded_file($files['tmp_name'][$i])) {
     223                $this->_raiseMsg(sprintf(_("The file %s failed uploading."), $file_name), MSG_ERR, __FILE__, __LINE__);
     224                App::logMsg(sprintf(_("The file %s failed is_uploaded_file."), $file_name), LOG_ERR, __FILE__, __LINE__);
     225                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_NOT_UPLOADED_FILE);
     226                continue;
     227            }
     228
     229            // Check to be sure the file is not empty.
     230            if ($files['size'][$i] <= 0) {
     231                $this->_raiseMsg(sprintf(_("The file %s failed uploading: it contains zero bytes."), $file_name), MSG_ERR, __FILE__, __LINE__);
     232                App::logMsg(sprintf(_("The uploaded file %s contains zero bytes."), $file_name), LOG_ERR, __FILE__, __LINE__);
     233                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_EMPTY_FILE);
     234                continue;
     235            }
     236
     237            // Check to be sure the file has a valid file name extension.
     238            if (!in_array(strtolower($this->getFilenameExtension($file_name)), $this->getParam('valid_file_extensions'))) {
     239                $this->_raiseMsg(sprintf(_("The file %s failed uploading: it is an unrecognized type. Files must have one of the following file name extensions: %s."), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__);
     240                App::logMsg(sprintf(_("The uploaded file %s has an unrecognized file name extension."), $file_name), LOG_WARNING, __FILE__, __LINE__);
     241                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_INVALID_EXTENSION);
     242                continue;
     243            }
     244
     245            // Check to be sure the file has a unique file name.
     246            if (!$this->getParam('allow_overwriting') && $this->exists($file_name)) {
     247                $this->_raiseMsg(sprintf(_("The file %s failed uploading: a file with that name already exists."), $file_name), MSG_ERR, __FILE__, __LINE__);
     248                App::logMsg(sprintf(_("The uploaded file %s doesn't have a unique filename."), $file_name), LOG_WARNING, __FILE__, __LINE__);
     249                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_NOT_UNIQUE);
     250                continue;
     251            }
     252
     253            // If the file name has no extension, use the mime-type to choose one.
    186254            if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) {
    187255                if ($ext = array_search(mime_content_type($files['tmp_name'][$i]), $this->mime_extension_map)) {
     
    190258            }
    191259
    192             // Set the path and file name.
    193             $file_path_name = $this->getParam('upload_path') . '/' . $file_name;
    194 
    195 
    196             // Check The php upload error messages.
    197             if (UPLOAD_ERR_INI_SIZE === $files['error'][$i]) {
    198                 if ($this->getParam('display_messages')) {
    199                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: it exceeds the maximum allowed upload file size of %s."), $file_name, ini_get('upload_max_filesize')), MSG_ERR, __FILE__, __LINE__);
    200                 }
    201                 App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_INI_SIZE (currently %s)."), $files['error'][$i], $file_name, ini_get('upload_max_filesize')), LOG_ERR, __FILE__, __LINE__);
    202                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_INI_SIZE);
    203                 continue;
    204             }
    205             if (UPLOAD_ERR_FORM_SIZE === $files['error'][$i]) {
    206                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: it exceeds the maximum allowed upload file size of %s."), $file_name, $_POST['MAX_FILE_SIZE']), MSG_ERR, __FILE__, __LINE__);
    207                 App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_FORM_SIZE (currently %s)."), $files['error'][$i], $file_name, $_POST['MAX_FILE_SIZE']), LOG_ERR, __FILE__, __LINE__);
    208                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_FORM_SIZE);
    209                 continue;
    210             }
    211             if (UPLOAD_ERR_PARTIAL === $files['error'][$i]) {
    212                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: it was only partially uploaded."), $file_name), MSG_ERR, __FILE__, __LINE__);
    213                 App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_PARTIAL."), $files['error'][$i], $file_name), LOG_ERR, __FILE__, __LINE__);
    214                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_PARTIAL);
    215                 continue;
    216             }
    217             if (UPLOAD_ERR_NO_FILE === $files['error'][$i]) {
    218                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: no file was uploaded."), $file_name), MSG_ERR, __FILE__, __LINE__);
    219                 App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_NO_FILE."), $files['error'][$i], $file_name), LOG_ERR, __FILE__, __LINE__);
    220                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_NO_FILE);
    221                 continue;
    222             }
    223             if (UPLOAD_ERR_NO_TMP_DIR === $files['error'][$i]) {
    224                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: temporary upload directory missing."), $file_name), MSG_ERR, __FILE__, __LINE__);
    225                 App::logMsg(sprintf(_("The file %s failed uploading with PHP error %s UPLOAD_ERR_NO_TMP_DIR."), $files['error'][$i], $file_name), LOG_ERR, __FILE__, __LINE__);
    226                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_ERR_NO_TMP_DIR);
    227                 continue;
    228             }
    229 
    230             // Check to be sure it's an uploaded file.
    231             if (!is_uploaded_file($files['tmp_name'][$i])) {
    232                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading."), $file_name), MSG_ERR, __FILE__, __LINE__);
    233                 App::logMsg(sprintf(_("The file %s failed is_uploaded_file."), $file_name), LOG_ERR, __FILE__, __LINE__);
    234                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_NOT_UPLOADED_FILE);
    235                 continue;
    236             }
    237 
    238             // Check to be sure the file is not empty.
    239             if ($files['size'][$i] <= 0) {
    240                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: it contains zero bytes."), $file_name), MSG_ERR, __FILE__, __LINE__);
    241                 App::logMsg(sprintf(_("The uploaded file %s contains zero bytes."), $file_name), LOG_ERR, __FILE__, __LINE__);
    242                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_EMPTY_FILE);
    243                 continue;
    244             }
    245 
    246             // Check to be sure the file has a valid file name extension.
    247             if (!in_array(strtolower($this->getFilenameExtension($file_name)), $this->getParam('valid_file_extensions'))) {
    248                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: it is an unrecognized type. Files must have one of the following file name extensions: %s."), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__);
    249                 App::logMsg(sprintf(_("The uploaded file %s has an unrecognized file name extension."), $file_name), LOG_WARNING, __FILE__, __LINE__);
    250                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_INVALID_EXTENSION);
    251                 continue;
    252             }
    253 
    254             // Check to be sure the file has a unique file name.
    255             if (!$this->getParam('allow_overwriting') && $this->exists($file_name)) {
    256                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading: a file with that name already exists."), $file_name), MSG_ERR, __FILE__, __LINE__);
    257                 App::logMsg(sprintf(_("The uploaded file %s doesn't have a unique filename."), $file_name), LOG_WARNING, __FILE__, __LINE__);
    258                 $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_NOT_UNIQUE);
    259                 continue;
    260             }
     260            // Clean the file name of bad characters.
     261            $file_name = $this->cleanFileName($file_name);
     262
     263            // FINAL path and file name, lowercase extension.
     264            $file_extension = strtolower($this->getFilenameExtension($file_name));
     265            $file_name = sprintf('%s.%s', substr($file_name, 0, strrpos($file_name, '.')), $file_extension);
     266            $file_path_name = sprintf('%s/%s', $this->getParam('upload_path'), $file_name);
    261267
    262268            // Move the file to the final place.
     
    264270                chmod($file_path_name, $this->getParam('dest_file_perms'));
    265271                App::logMsg(sprintf('File uploaded: %s', $file_path_name), LOG_INFO, __FILE__, __LINE__);
    266                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> uploaded successfully."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
     272                $this->_raiseMsg(sprintf(_("The file %s uploaded successfully."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
    267273                if (!isset($custom_file_name) && $files['name'][$i] != $file_name) {
    268274                    // Notify user if uploaded file name was modified (unless a custom file name will be used anyways).
    269                     $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> was renamed to <strong>%s</strong>."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__);
     275                    $this->_raiseMsg(sprintf(_("The file %s was renamed to %s."), $files['name'][$i], $file_name), MSG_NOTICE, __FILE__, __LINE__);
    270276                }
    271277                $new_file_names[] = array(
    272278                    'name' => $file_name,
     279                    'mime' => $files['type'][$i],
    273280                    'size' => filesize($file_path_name),
    274                     'extension' => strtolower(substr($file_name, strrpos($file_name, '.') + 1)),
     281                    'extension' => $file_extension,
     282                    'original_index' => $i,
    275283                );
    276                 continue;
    277284            } else {
    278                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> failed uploading."), $file_name), MSG_ERR, __FILE__, __LINE__);
     285                $this->_raiseMsg(sprintf(_("The file %s failed uploading."), $file_name), MSG_ERR, __FILE__, __LINE__);
    279286                App::logMsg(sprintf(_("Moving file failed: %s -> %s"), $files['tmp_name'][$i], $file_path_name), LOG_ALERT, __FILE__, __LINE__);
    280287                $this->errors[] = array('filename' => $file_name, 'errortype' => UPLOAD_USER_ERR_MOVE_FAILED);
    281                 continue;
     288            }
     289
     290            // Check file extension with browsers interpretation of file type.
     291            if (isset($this->mime_extension_map[$file_extension]) && $files['type'][$i] != $this->mime_extension_map[$file_extension]) {
     292                App::logMsg(sprintf('File extension (%s) does not match mime type (%s).', $file_extension, $files['type'][$i]), LOG_NOTICE, __FILE__, __LINE__);
    282293            }
    283294        }
     
    310321            App::logMsg(sprintf('Deleted file: %s', $file_path_name), LOG_INFO, __FILE__, __LINE__);
    311322        } else {
    312             $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> could not be deleted."), $file_name), MSG_ERR, __FILE__, __LINE__);
     323            $this->_raiseMsg(sprintf(_("The file %s could not be deleted."), $file_name), MSG_ERR, __FILE__, __LINE__);
    313324            App::logMsg(sprintf(_("Failed deleting file: %s"), $file_path_name), LOG_ERR, __FILE__, __LINE__);
    314325            return false;
     
    336347        if (file_exists($old_file_path_name)) {
    337348            if (rename($old_file_path_name, $new_file_path_name)) {
    338                 $this->_raiseMsg(sprintf(_("The file <strong>%s</strong> has been renamed to <strong>%s</strong>."), basename($old_file_path_name), basename($new_file_path_name)), MSG_NOTICE, __FILE__, __LINE__);
     349                $this->_raiseMsg(sprintf(_("The file %s has been renamed to %s."), basename($old_file_path_name), basename($new_file_path_name)), MSG_NOTICE, __FILE__, __LINE__);
    339350                App::logMsg(sprintf('File renamed from %s to %s', $old_file_path_name, $new_file_path_name), LOG_DEBUG, __FILE__, __LINE__);
    340351            } else {
     
    344355            }
    345356        } else {
    346             $this->_raiseMsg(sprintf(_("Couldn't rename nonexistent file <strong>%s</strong>."), $old_name), MSG_WARNING, __FILE__, __LINE__);
     357            $this->_raiseMsg(sprintf(_("Couldn't rename nonexistent file %s."), $old_name), MSG_WARNING, __FILE__, __LINE__);
    347358            App::logMsg(sprintf(_("Error renaming nonexistent file: %s"), $old_file_path_name), LOG_WARNING, __FILE__, __LINE__);
    348359            return false;
  • trunk/services/templates/admin_form.ihtml

    r22 r121  
    1313    </tr>
    1414    <tr>
    15         <td class="right"><label for="username"<?php $fv->err('username', ' class="error"') ?>><?php echo _("Username"); ?></label></td>
     15        <td class="sc-right"><label for="username"<?php $fv->err('username', ' class="error"') ?>><?php echo _("Username"); ?></label></td>
    1616        <td>
    17             <input type="text" class="small" size="50" name="username" value="<?php echo oTxt($frm['username']); ?>" />
     17            <input type="text" class="sc-small" size="50" name="username" value="<?php echo oTxt($frm['username']); ?>" />
    1818        </td>
    1919    </tr>
    2020    <tr>
    21         <td class="right"><label for="userpass"<?php $fv->err('userpass', ' class="error"') ?>><?php echo _("Password"); ?></label></td>
     21        <td class="sc-right"><label for="userpass"<?php $fv->err('userpass', ' class="error"') ?>><?php echo _("Password"); ?></label></td>
    2222        <td>
    23             <input type="password" class="small" size="50" name="userpass" value="<?php echo oTxt($frm['userpass']); ?>" />
     23            <input type="password" class="sc-small" size="50" name="userpass" value="<?php echo oTxt($frm['userpass']); ?>" />
    2424        </td>
    2525    </tr>
    2626    <tr>
    27         <td class="right"><label for="first_name"<?php $fv->err('first_name', ' class="error"') ?>><?php echo _("First name"); ?></label></td>
     27        <td class="sc-right"><label for="first_name"<?php $fv->err('first_name', ' class="error"') ?>><?php echo _("First name"); ?></label></td>
    2828        <td>
    29             <input type="text" class="small" size="50" name="first_name" value="<?php echo oTxt($frm['first_name']); ?>" />
     29            <input type="text" class="sc-small" size="50" name="first_name" value="<?php echo oTxt($frm['first_name']); ?>" />
    3030        </td>
    3131    </tr>
    3232    <tr>
    33         <td class="right"><label for="last_name"<?php $fv->err('last_name', ' class="error"') ?>><?php echo _("Last name"); ?></label></td>
     33        <td class="sc-right"><label for="last_name"<?php $fv->err('last_name', ' class="error"') ?>><?php echo _("Last name"); ?></label></td>
    3434        <td>
    35             <input type="text" class="small" size="50" name="last_name" value="<?php echo oTxt($frm['last_name']); ?>" />
     35            <input type="text" class="sc-small" size="50" name="last_name" value="<?php echo oTxt($frm['last_name']); ?>" />
    3636        </td>
    3737    </tr>
    3838    <tr>
    39         <td class="right"><label for="email"<?php $fv->err('email', ' class="error"') ?>><?php echo _("Email"); ?></label></td>
     39        <td class="sc-right"><label for="email"<?php $fv->err('email', ' class="error"') ?>><?php echo _("Email"); ?></label></td>
    4040        <td>
    41             <input type="text" class="medium" size="50" name="email" value="<?php echo oTxt($frm['email']); ?>" />
     41            <input type="text" class="sc-medium" size="50" name="email" value="<?php echo oTxt($frm['email']); ?>" />
    4242        </td>
    4343    </tr>
    4444    <tr>
    45         <td class="right"><label for="user_type"<?php $fv->err('user_type', ' class="error"') ?>><?php echo _("User type"); ?></label></td>
     45        <td class="sc-right"><label for="user_type"<?php $fv->err('user_type', ' class="error"') ?>><?php echo _("User type"); ?></label></td>
    4646        <td>
    47             <select name="user_type" class="small">
     47            <select name="user_type" class="sc-small">
    4848            <?php printSetSelectForm('admin_tbl', 'user_type', $frm['user_type'], true); ?>
    4949            </select>
  • trunk/services/templates/admin_list.ihtml

    r54 r121  
    44<?php App::printHiddenSession(false); ?>
    55<div id="commandbox">
    6     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add administrator"); ?></a></span>
     6    <span class="sc-nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=add'); ?>"><?php echo _("Add administrator"); ?></a></span>
    77    <br />
    88
    9     <input type="text" class="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, User type, Login abuse exempt, Blocked, Blocked reason, Abuse warning level, Seconds online, Last login datetime, Last access datetime, Last login ip, Added by user id, Modified by user id, Added datetime, Modified datetime.")); ?>" />
     9    <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, User type, Login abuse exempt, Blocked, Blocked reason, Abuse warning level, Seconds online, Last login datetime, Last access datetime, Last login ip, Added by user id, Modified by user id, Added datetime, Modified datetime.")); ?>" />
    1010    <input type="submit" value="<?php echo _("Search"); ?>" />
    1111</div>
     
    3131    <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
    3232    <tr>
    33         <td class="padleft 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>
    34         <td class="padleft 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="nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?> &nbsp;</td>
    36         <td class="nowrap"><?php echo oTxt($list[$i]['username'], true); ?> &nbsp;</td>
    37         <td class="nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> &nbsp;</td>
    38         <td class="nowrap"><?php echo oTxt($list[$i]['user_type'], true); ?> &nbsp;</td>
    39         <td class="nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> &nbsp;</td>
    40         <td class="nowrap"><?php
     33        <td class="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>
     34        <td class="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-nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?> &nbsp;</td>
     36        <td class="sc-nowrap"><?php echo oTxt($list[$i]['username'], true); ?> &nbsp;</td>
     37        <td class="sc-nowrap"><?php echo oTxt($list[$i]['first_name'], true); ?> <?php echo oTxt($list[$i]['last_name'], true); ?> &nbsp;</td>
     38        <td class="sc-nowrap"><?php echo oTxt($list[$i]['user_type'], true); ?> &nbsp;</td>
     39        <td class="sc-nowrap"><?php echo round($list[$i]['seconds_online'] / 60); ?> &nbsp;</td>
     40        <td class="sc-nowrap"><?php
    4141            if ($auth->isLoggedIn($list[$i]['admin_id'])) {
    4242                ?><strong><?php echo date(App::getParam('date_format'), strtotime($list[$i]['last_login_datetime'])) ?></strong><?php
     
    4545            }
    4646        ?> &nbsp;</td>
    47         <td class="nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> &nbsp;</td>
    48         <td class="nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['added_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['added_datetime'])); ?> &nbsp;</td>
    49         <td class="nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> &nbsp;</td>
    50         <td class="nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['modified_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['modified_datetime'])); ?> &nbsp;</td>
    51         <td class="padleft nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" 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]['username'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> &nbsp;</td>
     47        <td class="sc-nowrap"><?php echo gethostbyaddr($list[$i]['last_login_ip']); ?> &nbsp;</td>
     48        <td class="sc-nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['added_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['added_datetime'])); ?> &nbsp;</td>
     49        <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> &nbsp;</td>
     50        <td class="sc-nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['modified_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['modified_datetime'])); ?> &nbsp;</td>
     51        <td class="padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" 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]['username'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> &nbsp;</td>
    5252    </tr>
    5353    <?php } ?>
     
    5555
    5656<?php if ($page->total_pages > 1) { ?>
    57 <div class="nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
     57<div class="sc-nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
    5858<?php } ?>
    5959</form>
  • trunk/services/templates/list_info.ihtml

    r42 r121  
    11<div>
    22    <?php if ($page->total_pages > 1) { ?>
    3     <span class="nowrap commanditem commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></span>
     3    <span class="sc-nowrap commanditem commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></span>
    44    <?php } ?>
    5     <span class="nowrap commanditem commandtext">
     5    <span class="sc-nowrap commanditem commandtext">
    66        <?php printf(_("Listing <strong>%s-%s</strong> of <strong>%s</strong> results on <strong>%s</strong> pages"), (0==$page->total_items ? 0 : $page->first_item+1), (0==$page->total_items ? 0 : $page->last_item+1), $page->total_items, $page->total_pages) ?>
    77        &nbsp;&nbsp; <a href="<?php echo App::oHREF($_SERVER['PHP_SELF'], false); ?>"><?php echo _("List all"); ?></a>
  • trunk/services/templates/log_list.ihtml

    r28 r121  
    3030    </table>
    3131<?php } ?>
    32     <input type="text" class="small" size="20" name="search_query" value="<?php echo oTxt(getFormData('search_query')); ?>" title="<?php echo _("All lines in currently viewed log file are searched."); ?>" />
     32    <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo oTxt(getFormData('search_query')); ?>" title="<?php echo _("All lines in currently viewed log file are searched."); ?>" />
    3333    <input type="checkbox" name="search_grep"<?php frmChecked(getFormData('search_grep')) ?> /><span class="commandtext"><?php echo _("Use Grep"); ?></span>
    3434    <input type="submit" name="list" value="<?php echo _("Search"); ?>" />
     
    4646
    4747<?php if ($page->total_pages > 1) { ?>
    48 <div class="nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
     48<div class="sc-nowrap commandtext" style="float: right;"><?php echo _("Pages:"); ?>&nbsp;<?php $page->printPageNumbers() ?></div>
    4949<?php } ?>
    5050</form>
  • trunk/services/templates/login_form.ihtml

    r22 r121  
    33<table>
    44    <tr>
    5         <td class="right"><label for="username"><?php echo _("Username"); ?></label></td>
     5        <td class="sc-right"><label for="username"><?php echo _("Username"); ?></label></td>
    66        <td>
    7             <input type="text" class="small" size="20" name="username" value="<?php echo oTxt($frm['username']); ?>" />
     7            <input type="text" class="sc-small" size="20" name="username" value="<?php echo oTxt($frm['username']); ?>" />
    88        </td>
    99    </tr>
    1010    <tr>
    11         <td class="right"><label for="password"><?php echo _("Password"); ?></label></td>
     11        <td class="sc-right"><label for="password"><?php echo _("Password"); ?></label></td>
    1212        <td>
    13             <input type="password" class="small" size="20" name="password" value="<?php echo oTxt($frm['password']); ?>" />
     13            <input type="password" class="sc-small" size="20" name="password" value="<?php echo oTxt($frm['password']); ?>" />
    1414        </td>
    1515    </tr>
  • trunk/services/templates/password.ihtml

    r119 r121  
    66<table>
    77    <tr>
    8         <td class="right"><label for="oldpassword"<?php $fv->err('oldpassword', ' class="error"') ?>><?php echo _("Old password"); ?></label></td>
     8        <td class="sc-right"><label for="oldpassword"<?php $fv->err('oldpassword', ' class="error"') ?>><?php echo _("Old password"); ?></label></td>
    99        <td>
    10             <input type="password" class="medium" size="50" name="oldpassword" />
     10            <input type="password" class="sc-medium" size="50" name="oldpassword" />
    1111        </td>
    1212    </tr>
    1313    <tr>
    14         <td class="right"><label for="newpassword"<?php $fv->err('newpassword', ' class="error"') ?>><?php echo _("New password"); ?></label></td>
     14        <td class="sc-right"><label for="newpassword"<?php $fv->err('newpassword', ' class="error"') ?>><?php echo _("New password"); ?></label></td>
    1515        <td>
    16             <input type="password" class="medium" size="50" name="newpassword" />
     16            <input type="password" class="sc-medium" size="50" name="newpassword" />
    1717        </td>
    1818    </tr>
    1919    <tr>
    20         <td class="right"><label for="newpassword2"<?php $fv->err('newpassword2', ' class="error"') ?>><?php echo _("New password again"); ?></label></td>
     20        <td class="sc-right"><label for="newpassword2"<?php $fv->err('newpassword2', ' class="error"') ?>><?php echo _("New password again"); ?></label></td>
    2121        <td>
    22             <input type="password" class="medium" size="50" name="newpassword2" />
     22            <input type="password" class="sc-medium" size="50" name="newpassword2" />
    2323        </td>
    2424    </tr>
  • trunk/services/templates/versions_diff.ihtml

    r42 r121  
    11<div id="commandbox">
    22<?php if (!getFormData('current', false)) { ?>
    3     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
     3    <span class="sc-nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
    44<?php } else { ?>
    5     <span class="nowrap commandtext">&nbsp;</span>
     5    <span class="sc-nowrap commandtext">&nbsp;</span>
    66<?php } ?>
    77</div>
     
    1010<table class="list" border="0" cellspacing="0" cellpadding="4">
    1111    <tr>
    12         <th class="padleft"><?php echo _("Field"); ?></th>
    13         <th class="padleft"><?php echo _("Saved version"); ?></th>
    14         <th class="padleft"><?php echo _("Current record"); ?></th>
     12        <th class="sc-padleft"><?php echo _("Field"); ?></th>
     13        <th class="sc-padleft"><?php echo _("Saved version"); ?></th>
     14        <th class="sc-padleft"><?php echo _("Current record"); ?></th>
    1515    </tr>
    1616<?php
     
    2020    ?>
    2121    <tr>
    22         <td class="padleft nowrap"<?php echo $style; ?>><label><?php echo $k; ?></label></td>
    23         <td class="padleft"><?php echo $v_d; ?></td>
    24         <td class="padleft"><?php echo $v_c; ?></td>
     22        <td class="padleft sc-nowrap"<?php echo $style; ?>><label><?php echo $k; ?></label></td>
     23        <td class="sc-padleft"><?php echo $v_d; ?></td>
     24        <td class="sc-padleft"><?php echo $v_c; ?></td>
    2525    </tr>
    2626<?php } ?>
  • trunk/services/templates/versions_list.ihtml

    r49 r121  
    44<table class="list" border="0" cellspacing="0" cellpadding="4">
    55<tr>
    6     <th class="padleft" colspan="3">&nbsp;</th>
    7     <th class="padleft"><?php echo _("ID"); ?></th>
    8     <th class="padleft"><?php echo _("Saved"); ?></th>
    9     <th class="padleft"><?php echo _("By"); ?></th>
     6    <th class="sc-padleft" colspan="3">&nbsp;</th>
     7    <th class="sc-padleft"><?php echo _("ID"); ?></th>
     8    <th class="sc-padleft"><?php echo _("Saved"); ?></th>
     9    <th class="sc-padleft"><?php echo _("By"); ?></th>
    1010</tr>
    1111<?php
     
    1414<tr>
    1515    <?php if ($first) { ?>
    16     <td class="padleft nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view&current=true&version_id=' . $v['version_id']); ?>">view</a>]</td>
    17     <td class="padleft nowrap" colspan="2">(<?php echo _("Current record"); ?>)</td>
     16    <td class="padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view&current=true&version_id=' . $v['version_id']); ?>">view</a>]</td>
     17    <td class="padleft sc-nowrap" colspan="2">(<?php echo _("Current record"); ?>)</td>
    1818    <?php } else { ?>
    19     <td class="padleft nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view&version_id=' . $v['version_id']); ?>">view</a>]</td>
    20     <td class="padleft nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=diff&version_id=' . $v['version_id']); ?>">diff</a>]</td>
    21     <td class="padleft nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore&version_id=' . $v['version_id']); ?>">restore</a>]</td>
     19    <td class="padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view&version_id=' . $v['version_id']); ?>">view</a>]</td>
     20    <td class="padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=diff&version_id=' . $v['version_id']); ?>">diff</a>]</td>
     21    <td class="padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore&version_id=' . $v['version_id']); ?>">restore</a>]</td>
    2222    <?php } ?>
    23     <td class="padleft nowrap"><?php echo $v['version_id']; ?></td>
    24     <td class="padleft nowrap"><?php echo date('d M Y H:i:s', strtotime($v['version_datetime'])); ?></td>
    25     <td class="padleft nowrap"><?php echo $v['editor']; ?></td>
     23    <td class="padleft sc-nowrap"><?php echo $v['version_id']; ?></td>
     24    <td class="padleft sc-nowrap"><?php echo date('d M Y H:i:s', strtotime($v['version_datetime'])); ?></td>
     25    <td class="padleft sc-nowrap"><?php echo $v['editor']; ?></td>
    2626</tr>
    2727<?php
     
    3030?>
    3131</table>
    32 <div class="help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $version->getParam('min_qty'), $version->getParam('min_days')); ?></div>
     32<div class="sc-help"><?php printf(_("When there are more than %s versions, those over %s days old are deleted."), $version->getParam('min_qty'), $version->getParam('min_days')); ?></div>
    3333<input type="submit" name="op" value="<?php echo _("Cancel"); ?>" />
    3434</form>
  • trunk/services/templates/versions_view.ihtml

    r49 r121  
    11<div id="commandbox">
    22<?php if (!getFormData('current', false)) { ?>
    3     <span class="nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
     3    <span class="sc-nowrap commandtext"><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore', array('version_id', 'version_title')); ?>"><?php echo _("Restore this saved version"); ?></a></span>
    44<?php } else { ?>
    5     <span class="nowrap commandtext">&nbsp;</span>
     5    <span class="sc-nowrap commandtext">&nbsp;</span>
    66<?php } ?>
    77</div>
     
    1313    ?>
    1414    <tr>
    15         <td class="padleft nowrap"><label><?php echo $k; ?></label></td>
    16         <td class="padleft"><?php echo $v_d; ?></td>
     15        <td class="sc-padleft sc-nowrap"><label><?php echo $k; ?></label></td>
     16        <td class="sc-padleft"><?php echo $v_d; ?></td>
    1717    </tr>
    1818<?php } ?>
Note: See TracChangeset for help on using the changeset viewer.