Changeset 101
- Timestamp:
- Apr 16, 2006 1:46:11 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/example_config.inc.php
r100 r101 27 27 COMMON_BASE, 28 28 SITE_BASE . '/_templates', 29 get_include_path() 29 get_include_path(), 30 30 ))); 31 31 -
trunk/lib/App.inc.php
r100 r101 56 56 // Human-readable format used to display dates. 57 57 'date_format' => 'd M Y', 58 'time_format' => 'h:i:s A', 58 59 'sql_date_format' => '%e %b %Y', 59 60 'sql_time_format' => '%k:%i', -
trunk/lib/PEdit.inc.php
r100 r101 211 211 return false; 212 212 } 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 <?php213 ?> 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 218 218 App::printHiddenSession(); 219 219 switch ($this->op) { 220 220 case 'Edit' : 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 <?php221 ?> 222 <div class="sc-pedit-buttons"> 223 <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) ?>" /> 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 227 227 break; 228 228 case 'View' : 229 ?>230 <input type="hidden" name="version" value="<?php echo getFormData('version'); ?>" />231 <?php229 ?> 230 <input type="hidden" name="version" value="<?php echo getFormData('version'); ?>" /> 231 <?php 232 232 break; 233 233 } … … 260 260 { 261 261 if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) { 262 ?>263 <div class="sc-pedit-item">264 <?php262 ?> 263 <div class="sc-pedit-item"> 264 <?php 265 265 $type = (isset($this->_data[$name]['type'])) ? $this->_data[$name]['type'] : $type; 266 266 // Print edit form. … … 268 268 case 'text' : 269 269 default : 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 <?php270 ?> 271 <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" /> 273 <?php 274 274 break; 275 275 case 'textarea' : 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 <?php276 ?> 277 <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> 279 <?php 280 280 break; 281 281 } 282 ?>283 </div>284 <?php282 ?> 283 </div> 284 <?php 285 285 } 286 286 } … … 300 300 switch ($this->op) { 301 301 case 'Edit' : 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 <?php302 ?> 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 309 309 break; 310 310 case 'Versions' : 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 <?php311 ?> 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 317 317 break; 318 318 case 'View' : 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)', _("Versions"))?>" 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 <?php319 ?> 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)', _("Versions"))?>" 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 327 327 break; 328 328 default : 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)', _("Versions"))?>" accesskey="<?php echo substr(_("Versions"), 0, 1) ?>" />333 </div>334 </form>335 <?php329 ?> 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)', _("Versions"))?>" accesskey="<?php echo substr(_("Versions"), 0, 1) ?>" /> 333 </div> 334 </form> 335 <?php 336 336 } 337 337 } … … 348 348 // Print versions and commands to view/restore. 349 349 $version_files = $this->_getVersions(); 350 ?> 351 <h1><?php printf(_("%s saved versions of %s"), sizeof($version_files), basename($_SERVER['PHP_SELF'])); ?></h1> 352 <?php 350 ?><h1><?php printf(_("%s saved versions of %s"), sizeof($version_files), basename($_SERVER['PHP_SELF'])); ?></h1><?php 353 351 if (is_array($version_files) && !empty($version_files)) { 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 <?php352 ?> 353 <table id="sc-pedit-versions-table"> 354 <tr> 355 <th><?php echo _("Date"); ?></th> 356 <th><?php echo _("Time"); ?></th> 357 <th><?php echo _("File size"); ?></th> 358 <th><?php echo _("Version options"); ?></th> 359 </tr> 360 <?php 363 361 foreach ($version_files as $v) { 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 <?php362 ?> 363 <tr> 364 <td><?php echo date(App::getParam('date_format'), $v['unixtime']); ?></td> 365 <td><?php echo date(App::getParam('time_format'), $v['unixtime']); ?></td> 366 <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> 368 </tr> 369 <?php 372 370 } 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 <?php371 ?> 372 </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> 374 <?php 377 375 } 378 376 }
Note: See TracChangeset
for help on using the changeset viewer.