Changeset 720


Ignore:
Timestamp:
Mar 9, 2020 3:14:25 AM (4 years ago)
Author:
anonymous
Message:

Update CSS reset with inspiration from https://github.com/hankchizljaw/modern-css-reset

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r664 r720  
    3232    <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?>
    3333    <tr>
    34         <td class="sc-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/i/pen.gif" alt="Edit" width="12" height="12" border="0" /></a></td>
    35         <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/i/multiple.png" alt="" width="12" height="12" border="0" /></a></td>
     34        <td class="sc-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%']); ?>"><i class="fa fa-pencil-square-o fa-fw"></i></a></td>
     35        <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%']); ?>"><i class="fa fa-clone fa-fw"></a></td>
    3636%ADM_LIST_ROWS%
    37         <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/i/trash.gif" alt="Delete" width="10" height="10" border="0" /></a></td>
     37        <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]['__///__'])) ?>');"><i class="fa fa-trash fa-fw"></i></a></td>
    3838    </tr>
    3939    <?php } ?>
  • trunk/css/reset.inc.css

    r635 r720  
    1 /* http://meyerweb.com/eric/tools/css/reset/
    2    v2.0 | 20110126
    3    License: none (public domain)
    4 */
    5 
    6 html, body, div, span, applet, object, iframe,
    7 h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    8 a, abbr, acronym, address, big, cite, code,
    9 del, dfn, em, img, ins, kbd, q, s, samp,
    10 small, strike, strong, sub, sup, tt, var,
    11 b, u, i, center,
    12 dl, dt, dd, ol, ul, li,
    13 fieldset, form, label, legend,
    14 table, caption, tbody, tfoot, thead, tr, th, td,
    15 article, aside, canvas, details, embed,
    16 figure, figcaption, footer, header, hgroup,
    17 menu, nav, output, ruby, section, summary,
    18 time, mark, audio, video {
    19     margin: 0;
    20     padding: 0;
    21     border: 0;
    22     font-size: 100%;
    23     font: inherit;
    24     vertical-align: baseline;
     1/* https://github.com/hankchizljaw/modern-css-reset */
     2*,*::before,*::after {
     3    box-sizing: border-box
    254}
    26 /* HTML5 display-role reset for older browsers */
    27 article, aside, details, figcaption, figure,
    28 footer, header, hgroup, menu, nav, section {
    29     display: block;
     5ul[class],ol[class] {
     6    padding: 0
     7}
     8body,h1,h2,h3,h4,p,ul[class],ol[class],figure,blockquote,dl,dd {
     9    margin: 0
    3010}
    3111body {
    32     line-height: 1;
     12    /* min-height: 100vh; */
     13    scroll-behavior: smooth;
     14    text-rendering: optimizeSpeed;
     15    line-height: 1.4
    3316}
    34 ol, ul {
    35     list-style: none;
     17ul[class],ol[class] {
     18    list-style: none
    3619}
    37 blockquote, q {
    38     quotes: none;
     20a:not([class]) {
     21    text-decoration-skip-ink: auto
    3922}
    40 blockquote:before, blockquote:after,
    41 q:before, q:after {
    42     content: '';
    43     content: none;
     23img:not([class]) {
     24    max-width: 100%;
     25    display: block
     26}
     27article>*+* {
     28    margin-top: 1em
    4429}
    4530table {
     
    4732    border-spacing: 0;
    4833}
     34input,button,textarea,select {
     35    font: inherit
     36}
     37@media(prefers-reduced-motion:reduce) {
     38* {
     39    animation-duration: .01ms !important;
     40    animation-iteration-count: 1 !important;
     41    transition-duration: .01ms !important;
     42    scroll-behavior: auto !important
     43}
     44}
  • trunk/lib/App.inc.php

    r711 r720  
    302302
    303303                    case 'session_use_cookies':
    304                         ini_set('session.use_cookies', $val);
     304                        if (session_status() !== PHP_SESSION_ACTIVE) {
     305                            ini_set('session.use_cookies', $val);
     306                        } else {
     307                            $this->logMsg('Unable to set session_use_cookies; session is already active', LOG_NOTICE, __FILE__, __LINE__);
     308                        }
    305309                        return true;
    306310
  • trunk/services/templates/versions_list.ihtml

    r502 r720  
    88        <?php $app->printHiddenSession() ?>
    99        <div class="row">
    10             <div class="large-12 columns">
     10            <div class="small-12 columns">
    1111                <table>
    1212                    <thead>
    1313                        <tr>
    1414                            <th></th>
    15                             <th><?php echo _("ID"); ?></th>
    16                             <th><?php echo _("Date"); ?></th>
    17                             <th><?php echo _("By"); ?></th>
     15                            <th class="sc-padleft"><?php echo _("ID"); ?></th>
     16                            <th class="sc-padleft"><?php echo _("Date"); ?></th>
     17                            <th class="sc-padleft"><?php echo _("By"); ?></th>
    1818                        </tr>
    1919                    </thead>
     
    4848                    </tbody>
    4949                </table>
    50                 <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>
     50                <p 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')); ?></p>
     51            </div>
     52        </div>
     53        <div class="row">
     54            <div class="small-12 columns">
    5155                <?php
    5256                // Buttons.
  • trunk/tests/AppTest.php

    r547 r720  
    5454    {
    5555        $thisapp =& App::getInstance();
    56         $this->assertTrue(serialize($thisapp) === serialize($this->App), 'Objects do not match across instantiations.');
     56        $this->assertTrue($thisapp === $this->App, 'Objects do not match across instantiations.');
    5757    }
    5858
     
    8080        $this->App->stop();
    8181        $this->App->start();
    82 
    8382        $this->assertEquals(ini_get('error_reporting'), E_ALL, 'Error reporting not set to E_ALL.');
    84         $this->assertTrue($this->App->db->dbh && is_resource($this->App->db->dbh), 'DB handler not a resource');
    8583        $this->assertTrue(isset($_SESSION), '$_SESSION is not set.');
    8684        $_SESSION['sess_test_value'] = 'okay';
     
    115113        $app =& App::getInstance();
    116114        ob_start();
    117         $this->test_raisemsg();  //had to add this line for phpunit ver. 3.7 ///
     115        $this->test_raisemsg();  //had to add this line for phpunit ver. 3.7
    118116        $app->printraisedmessages();
    119117        $result = ob_get_clean();
     
    137135    {
    138136        $app =& App::getInstance();
    139         $_GET['arg1'] = 'A';
     137        $_REQUEST['arg1'] = 'A';
    140138        $result = $app->ohref('/some/url.php', array('arg1'), true);
    141139        $this->assertContains(session_name(), $result, 'SSID not found in URL.');
  • trunk/tests/FormValidatorTest.php

    r468 r720  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    9797    {
    9898        // This should not generate any error.
    99         $_POST['some_field'] = 'a non empty string';
     99        $_REQUEST['some_field'] = 'a non empty string';
     100        $this->FormValidator->notEmpty('some_field', _("Error message"));
     101        $this->assertFalse($this->FormValidator->anyerrors());
     102
     103        // This one is an error!
     104        $_REQUEST['some_field'] = '';
    100105        $this->FormValidator->isempty('some_field', _("Error message"));
    101         $this->assertFalse($this->FormValidator->anyerrors());
    102        
    103         // This one is an error!
    104         $_POST['some_field'] = '';
     106        $this->assertTrue($this->FormValidator->anyerrors());
     107    }
     108
     109    function test_isempty()
     110    {
     111        // This should not generate any error.
     112        $_REQUEST['some_field'] = 'a non empty string';
    105113        $this->FormValidator->isempty('some_field', _("Error message"));
    106         $this->assertTrue($this->FormValidator->anyerrors());
    107     }
    108 
    109     function test_isempty()
    110     {
    111         // This should not generate any error.
    112         $_POST['some_field'] = 'a non empty string';
     114        $this->assertFalse($this->FormValidator->anyerrors());
     115
     116        // This one is an error!
     117        $_REQUEST['some_field'] = '';
    113118        $this->FormValidator->isempty('some_field', _("Error message"));
    114         $this->assertFalse($this->FormValidator->anyerrors());
    115        
    116         // This one is an error!
    117         $_POST['some_field'] = '';
    118         $this->FormValidator->isempty('some_field', _("Error message"));
    119119        $this->assertTrue($this->FormValidator->anyerrors());
    120120    }
     
    123123    {
    124124        // This should not generate any error.
    125         $_POST['some_field'] = 'this is a string';
     125        $_REQUEST['some_field'] = 'this is a string';
    126126        $this->FormValidator->isstring('some_field', _("Error message"));
    127127        $this->assertFalse($this->FormValidator->anyerrors());
    128        
    129         // This one is an error!
    130         $_POST['some_field'] = 12.3248; // not a string.
     128
     129        // This one is an error!
     130        $_REQUEST['some_field'] = 12.3248; // not a string.
    131131        $this->FormValidator->isstring('some_field', _("Error message"));
    132132        $this->assertTrue($this->FormValidator->anyerrors());
     
    136136    {
    137137        // This should not generate any error.
    138         $_POST['some_field'] = '1234.453';
     138        $_REQUEST['some_field'] = '1234.453';
    139139        $this->FormValidator->isnumber('some_field', _("Error message"));
    140140        $this->assertFalse($this->FormValidator->anyerrors());
    141        
    142         // This one is an error!
    143         $_POST['some_field'] = 'not a number';
     141
     142        // This one is an error!
     143        $_REQUEST['some_field'] = 'not a number';
    144144        $this->FormValidator->isnumber('some_field', _("Error message"));
    145145        $this->assertTrue($this->FormValidator->anyerrors());
     
    149149    {
    150150        // This should not generate any error.
    151         $_POST['some_field'] = '1234';
     151        $_REQUEST['some_field'] = '1234';
    152152        $this->FormValidator->isinteger('some_field', _("Error message"));
    153153        $this->assertFalse($this->FormValidator->anyerrors());
    154        
    155         // This one is an error!
    156         $_POST['some_field'] = '1234.1';
     154
     155        // This one is an error!
     156        $_REQUEST['some_field'] = '1234.1';
    157157        $this->FormValidator->isinteger('some_field', _("Error message"));
    158158        $this->assertTrue($this->FormValidator->anyerrors());
     
    162162    {
    163163        // This should not generate any error.
    164         $_POST['some_field'] = '123.1234';
     164        $_REQUEST['some_field'] = '123.1234';
    165165        $this->FormValidator->isfloat('some_field', _("Error message"));
    166166        $this->assertFalse($this->FormValidator->anyerrors());
    167        
    168         // This one is an error!
    169         $_POST['some_field'] = 'some falsity';
     167
     168        // This one is an error!
     169        $_REQUEST['some_field'] = 'some falsity';
    170170        $this->FormValidator->isfloat('some_field', _("Error message"));
    171171        $this->assertTrue($this->FormValidator->anyerrors());
     
    175175    {
    176176        // This should not generate any error.
    177         $_POST['some_field'] = array('asdf', 123);
     177        $_REQUEST['some_field'] = array('asdf', 123);
    178178        $this->FormValidator->isarray('some_field', _("Error message"));
    179179        $this->assertFalse($this->FormValidator->anyerrors());
    180        
    181         // This one is an error!
    182         $_POST['some_field'] = 'some falsity';
     180
     181        // This one is an error!
     182        $_REQUEST['some_field'] = 'some falsity';
    183183        $this->FormValidator->isarray('some_field', _("Error message"));
    184184        $this->assertTrue($this->FormValidator->anyerrors());
     
    188188    {
    189189        // This should not generate any error.
    190         $_POST['some_field'] = '1234abcd';
     190        $_REQUEST['some_field'] = '1234abcd';
    191191        $this->FormValidator->checkregex('some_field', '/\d{4}[a-d]{4}/', true, _("Error message"));
    192192        $this->assertFalse($this->FormValidator->anyerrors());
    193        
    194         // This should not generate any error.
    195         $_POST['some_field'] = 'no digits here';
     193
     194        // This should not generate any error.
     195        $_REQUEST['some_field'] = 'no digits here';
    196196        $this->FormValidator->checkregex('some_field', '/\d/', false, _("Error message"));
    197197        $this->assertFalse($this->FormValidator->anyerrors());
    198        
    199         // This one is an error!
    200         $_POST['some_field'] = 'oops, a d1git';
     198
     199        // This one is an error!
     200        $_REQUEST['some_field'] = 'oops, a d1git';
    201201        $this->FormValidator->checkregex('some_field', '/\d/', false, _("Error message"));
    202202        $this->assertTrue($this->FormValidator->anyerrors());
     
    206206    {
    207207        // This should not generate any error.
    208         $_POST['some_field'] = 'some truth';
     208        $_REQUEST['some_field'] = 'some truth';
    209209        $this->FormValidator->stringLength('some_field', 0, 255, _("Error message"));
    210210        $this->assertFalse($this->FormValidator->anyerrors());
    211        
    212         // This one is an error!
    213         $_POST['some_field'] = 'some falsity';
     211
     212        // This one is an error!
     213        $_REQUEST['some_field'] = 'some falsity';
    214214        $this->FormValidator->stringLength('some_field', 0, 4, _("Error message"));
    215215        $this->assertTrue($this->FormValidator->anyerrors());
     
    219219    {
    220220        // This should not generate any error.
    221         $_POST['some_field'] = '12';
     221        $_REQUEST['some_field'] = '12';
    222222        $this->FormValidator->numericrange('some_field', 3, 22, _("Error message"));
    223223        $this->assertFalse($this->FormValidator->anyerrors());
    224        
    225         // This one is an error!
    226         $_POST['some_field'] = '12';
     224
     225        // This one is an error!
     226        $_REQUEST['some_field'] = '12';
    227227        $this->FormValidator->numericrange('some_field', 300, 2200, _("Error message"));
    228228        $this->assertTrue($this->FormValidator->anyerrors());
     
    232232    {
    233233        // This should not generate any error.
    234         $_POST['some_field'] = 'Quinn the Kook <quinn@strangecode.com>';
     234        $_REQUEST['some_field'] = 'Quinn the Kook <quinn@strangecode.com>';
    235235        $this->FormValidator->validateemail('some_field', _("Error message"));
    236236        $this->assertFalse($this->FormValidator->anyerrors());
    237                
    238         // This one is an error!
    239         $_POST['some_field'] = 'quinn@kook.com.';
     237
     238        // This one is an error!
     239        $_REQUEST['some_field'] = 'quinn@kook.com.';
    240240        $this->FormValidator->validateemail('some_field', _("Error message"));
    241241        $this->assertTrue($this->FormValidator->anyerrors());
     
    245245    {
    246246        // This should not generate any error.
    247         $_POST['some_field'] = '+1 (530) 555-1212';
     247        $_REQUEST['some_field'] = '+1 (530) 555-1212';
    248248        $this->FormValidator->validatephone('some_field', _("Error message"));
    249249        $this->assertFalse($this->FormValidator->anyerrors());
    250        
    251         // This one is an error!
    252         $_POST['some_field'] = 'd321/654*9875 ';
     250
     251        // This one is an error!
     252        $_REQUEST['some_field'] = 'd321/654*9875 ';
    253253        $this->FormValidator->validatephone('some_field', _("Error message"));
    254254        $this->assertTrue($this->FormValidator->anyerrors());
     
    258258    {
    259259        // This should not generate any error.
    260         $_POST['some_field'] = 'next tuesday';
     260        $_REQUEST['some_field'] = 'next tuesday';
    261261        $this->FormValidator->validatestrdate('some_field', _("Error message"));
    262262        $this->assertFalse($this->FormValidator->anyerrors());
    263        
    264         // This one is an error!
    265         $_POST['some_field'] = 'in a galaxy far far away';
     263
     264        // This one is an error!
     265        $_REQUEST['some_field'] = 'in a galaxy far far away';
    266266        $this->FormValidator->validatestrdate('some_field', _("Error message"));
    267267        $this->assertTrue($this->FormValidator->anyerrors());
     
    271271    {
    272272        // This should not generate any error.
    273         $_POST['some_field'] = '2323-2005-7766-3554';
     273        $_REQUEST['some_field'] = '2323-2005-7766-3554';
    274274        $this->FormValidator->validateccnumber('some_field', null);
    275275        $this->assertFalse($this->FormValidator->anyerrors());
    276        
    277         // This one is an error!
    278         $_POST['some_field'] = '1234 1234 1234 1234';
     276
     277        // This one is an error!
     278        $_REQUEST['some_field'] = '1234 1234 1234 1234';
    279279        $this->FormValidator->validateccnumber('some_field', null);
    280280        $this->assertTrue($this->FormValidator->anyerrors());
  • trunk/tests/VersionTest.php

    r695 r720  
    111111    {
    112112        $result = $this->Version->create('test_user_tbl', 'user_id', '1', 'Test User', 'First version of user');
    113         $this->assertSame(1, $result);
     113        $this->assertSame('1', $result);
    114114    }
    115115
Note: See TracChangeset for help on using the changeset viewer.