Changeset 98 for trunk/lib/PEdit.inc.php


Ignore:
Timestamp:
Apr 16, 2006 10:18:33 AM (18 years ago)
Author:
scdev
Message:

B - pEdit formatting ticket #1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/PEdit.inc.php

    r97 r98  
    211211            return false;
    212212        }
    213         ?>       
    214         <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="sc-pedit-form">
    215         <input type="hidden" name="filename" value="<?php echo $_SERVER['PHP_SELF']; ?>" />
    216         <input type="hidden" name="file_hash" value="<?php echo $this->_fileHash(); ?>" />
    217         <?php
     213?>       
     214<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="sc-pedit-form">
     215    <input type="hidden" name="filename" value="<?php echo $_SERVER['PHP_SELF']; ?>" />
     216    <input type="hidden" name="file_hash" value="<?php echo $this->_fileHash(); ?>" />
     217<?php
    218218        App::printHiddenSession();
    219219        switch ($this->op) {
    220220        case 'Edit' :
    221             ?>
    222             <div class="sc-pedit-buttons">
    223                 <input type="submit" name="op" value="<?php echo _("Save"); ?>" />
    224                 <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" />
    225             </div>
    226             <?php
     221?>
     222    <div class="sc-pedit-buttons">
     223        <input type="submit" name="op" value="<?php echo _("Save"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Search"))?>" accesskey="<?php echo substr(_("Save"), 0, 1) ?>" />
     224        <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Cancel"))?>" accesskey="<?php echo substr(_("Cancel"), 0, 1) ?>" />
     225    </div>
     226<?php
    227227            break;
    228228        case 'View' :
    229             ?>
    230             <input type="hidden" name="version" value="<?php echo getFormData('version'); ?>" />
    231             <?php
     229?>
     230    <input type="hidden" name="version" value="<?php echo getFormData('version'); ?>" />
     231<?php
    232232            break;
    233233        }
     
    259259    function printForm($name, $type='text')
    260260    {
    261         if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) {
     261        if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) {       
     262?>
     263    <div class="sc-pedit-item">
     264<?php
    262265            $type = (isset($this->_data[$name]['type'])) ? $this->_data[$name]['type'] : $type;
    263266            // Print edit form.
     
    265268            case 'text' :
    266269            default :
    267                 ?><br /><label><?php echo ucfirst(str_replace('_', ' ', $name)); ?> <input type="text" name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-<?php echo $name; ?>" value="<?php echo oTxt($this->_data[$name]['content']); ?>" /></label><?php
     270?>
     271        <label><?php echo ucfirst(str_replace('_', ' ', $name)); ?></label>
     272        <input type="text" name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-<?php echo $name; ?>" value="<?php echo oTxt($this->_data[$name]['content']); ?>" class="full" />
     273<?php
    268274                break;
    269275            case 'textarea' :
    270                 ?><br /><label><?php echo ucfirst(str_replace('_', ' ', $name)); ?> <textarea name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-<?php echo $name; ?>"><?php echo oTxt($this->_data[$name]['content']); ?></textarea></label><?php
     276?>
     277        <label><?php echo ucfirst(str_replace('_', ' ', $name)); ?></label>
     278        <textarea name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-<?php echo $name; ?>" rows="" cols="" class="full tall"><?php echo oTxt($this->_data[$name]['content']); ?></textarea>
     279<?php
    271280                break;
    272281            }
     282?>
     283    </div>
     284<?php
    273285        }
    274286    }
     
    288300        switch ($this->op) {
    289301        case 'Edit' :
    290             ?>
    291             <div class="sc-pedit-buttons">
    292                 <input type="submit" name="op" value="<?php echo _("Save"); ?>" />
    293                 <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" />
    294             </div>
    295             </form>
    296             <?php
     302?>
     303    <div class="sc-pedit-buttons">
     304        <input type="submit" name="op" value="<?php echo _("Save"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Save"))?>" accesskey="<?php echo substr(_("Save"), 0, 1) ?>" />
     305        <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Cancel"))?>" accesskey="<?php echo substr(_("Cancel"), 0, 1) ?>" />
     306    </div>
     307</form>
     308<?php
    297309            break;
    298310        case 'Versions' :
    299             ?>
    300             <div class="sc-pedit-buttons">
    301                 <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" />
    302             </div>
    303             </form>
    304             <?php
     311?>
     312    <div class="sc-pedit-buttons">
     313        <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Cancel"))?>" accesskey="<?php echo substr(_("Cancel"), 0, 1) ?>" />
     314    </div>
     315</form>
     316<?php
    305317            break;
    306318        case 'View' :
    307             ?>
    308             <div class="sc-pedit-buttons">
    309                 <input type="submit" name="op" value="<?php echo _("Restore"); ?>" />
    310                 <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" />
    311             </div>
    312             <?php
     319?>
     320    <div class="sc-pedit-buttons">
     321        <input type="submit" name="op" value="<?php echo _("Restore"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Restore"))?>" accesskey="<?php echo substr(_("Restore"), 0, 1) ?>" />
     322        <input type="submit" name="op" value="<?php echo _("Versions"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Cancel"))?>" accesskey="<?php echo substr(_("Versions"), 0, 1) ?>" />
     323        <input type="submit" name="op" value="<?php echo _("Cancel"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Cancel"))?>" accesskey="<?php echo substr(_("Cancel"), 0, 1) ?>" />
     324    </div>
     325</form>
     326<?php
    313327            break;
    314328        default :
    315             ?>
    316             <div class="sc-pedit-buttons">
    317                 <input type="submit" name="op" value="<?php echo _("Edit"); ?>" />
    318                 <input type="submit" name="op" value="<?php echo _("Versions"); ?>" />
    319             </div>
    320             </form>
    321             <?php
     329?>
     330    <div class="sc-pedit-buttons">
     331        <input type="submit" name="op" value="<?php echo _("Edit"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Edit"))?>" accesskey="<?php echo substr(_("Edit"), 0, 1) ?>" />
     332        <input type="submit" name="op" value="<?php echo _("Versions"); ?>" title="<?php echo preg_replace('/^(\w)/i', '($1)', _("Cancel"))?>" accesskey="<?php echo substr(_("Versions"), 0, 1) ?>" />
     333    </div>
     334</form>
     335<?php
    322336        }
    323337    }
     
    334348            // Print versions and commands to view/restore.
    335349            $version_files = $this->_getVersions();
    336             ?><h1><?php printf(_("%s saved versions of %s"), sizeof($version_files), basename($_SERVER['PHP_SELF'])); ?></h1><?php
     350?>
     351    <h1><?php printf(_("%s saved versions of %s"), sizeof($version_files), basename($_SERVER['PHP_SELF'])); ?></h1>
     352<?php
    337353            if (is_array($version_files) && !empty($version_files)) {
    338                 ?><table id="sc-pedit-versions"><?php
     354?>
     355    <table id="sc-pedit-versions-table">
     356        <tr>
     357            <th><?php echo _("Date"); ?></th>
     358            <th><?php echo _("Time"); ?></th>
     359            <th><?php echo _("File Size"); ?></th>
     360            <th><?php echo _("Version Options"); ?></th>
     361        </tr>
     362<?php
    339363                foreach ($version_files as $v) {
    340                     ?>
    341                     <tr>
    342                         <td><?php echo date('r', $v['unixtime']); ?></td>
    343                         <td><?php printf(_("%s bytes"), $v['filesize']); ?></td>
    344                         <td><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=View&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("View"); ?></a></td>
    345                         <td><a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=Restore&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("Restore"); ?></a></td>
    346                     </tr>
    347                     <?php
     364?>
     365        <tr>
     366            <td><?php echo date('F j, Y', $v['unixtime']); ?></td>
     367            <td><?php echo date('h:i:s A', $v['unixtime']); ?></td>
     368            <td><?php printf(_("%s bytes"), $v['filesize']); ?></td>
     369            <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> or <a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=Restore&version=' . $v['unixtime'] . '&file_hash=' . $this->_fileHash()); ?>"><?php echo _("Restore"); ?></a></td>
     370        </tr>
     371<?php
    348372                }
    349                 ?></table><?php
    350             ?><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_qty')); ?></div><?php
     373?>
     374    </table>
     375    <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_qty')); ?></div>
     376<?php
    351377            }
    352378        }
Note: See TracChangeset for help on using the changeset viewer.