Changeset 98 for trunk/lib/PEdit.inc.php
- Timestamp:
- Apr 16, 2006 10:18:33 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/PEdit.inc.php
r97 r98 211 211 return false; 212 212 } 213 214 215 216 217 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 218 218 App::printHiddenSession(); 219 219 switch ($this->op) { 220 220 case 'Edit' : 221 222 223 <input type="submit" name="op" value="<?php echo _("Save");?>" />224 <input type="submit" name="op" value="<?php echo _("Cancel");?>" />225 226 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 227 227 break; 228 228 case 'View' : 229 230 231 229 ?> 230 <input type="hidden" name="version" value="<?php echo getFormData('version'); ?>" /> 231 <?php 232 232 break; 233 233 } … … 259 259 function printForm($name, $type='text') 260 260 { 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 262 265 $type = (isset($this->_data[$name]['type'])) ? $this->_data[$name]['type'] : $type; 263 266 // Print edit form. … … 265 268 case 'text' : 266 269 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 268 274 break; 269 275 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 271 280 break; 272 281 } 282 ?> 283 </div> 284 <?php 273 285 } 274 286 } … … 288 300 switch ($this->op) { 289 301 case 'Edit' : 290 291 292 <input type="submit" name="op" value="<?php echo _("Save");?>" />293 <input type="submit" name="op" value="<?php echo _("Cancel");?>" />294 295 296 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 297 309 break; 298 310 case 'Versions' : 299 300 301 <input type="submit" name="op" value="<?php echo _("Cancel");?>" />302 303 304 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 305 317 break; 306 318 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 313 327 break; 314 328 default : 315 316 317 <input type="submit" name="op" value="<?php echo _("Edit");?>" />318 <input type="submit" name="op" value="<?php echo _("Versions");?>" />319 320 321 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 322 336 } 323 337 } … … 334 348 // Print versions and commands to view/restore. 335 349 $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 337 353 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 339 363 foreach ($version_files as $v) { 340 341 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 347 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 348 372 } 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 351 377 } 352 378 }
Note: See TracChangeset
for help on using the changeset viewer.