home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / wiki / template / edit.php < prev    next >
PHP Script  |  2004-03-08  |  2KB  |  64 lines

  1. <?php
  2. // $Id: edit.php,v 1.1 2004/01/12 22:14:05 comsubvie Exp $
  3.  
  4. require_once(TemplateDir . '/common.php');
  5.  
  6. // The edit template is passed an associative array with the following
  7. // elements:
  8. //
  9. //   page      => A string containing the name of the wiki page being edited.
  10. //   text      => A string containing the wiki markup of the wiki page.
  11. //   timestamp => Timestamp of last edit to page.
  12. //   nextver   => An integer; the expected version of this document when saved.
  13. //   archive   => An integer.  Will be nonzero if this is not the most recent
  14. //                version of the page.
  15.  
  16. function template_edit($args)
  17. {
  18.   global $EditRows, $EditCols, $UserName, $PrefsScript;
  19.  
  20.   template_common_prologue(array('norobots' => 1,
  21.                                  'title'    => TMPL_Editing .' '. $args['page'],
  22.                                  'heading'  => TMPL_Editing .' ',
  23.                                  'headlink' => $args['page'],
  24.                                  'headsufx' => '',
  25.                                  'toolbar'  => 1));
  26. ?>
  27. <div id="body">
  28. <form method="post" action="<?php print saveURL($args['page']); ?>">
  29. <div class="form">
  30. <input type="submit" name="Save" value="<?php echo TMPL_ButtonSave; ?>" />
  31. <input type="submit" name="Preview" value="<?php echo TMPL_ButtonPreview; ?>" />
  32. <?php
  33.   if($UserName != '')
  34.     { print TMPL_YourUsername .' '. html_ref($UserName, $UserName); }
  35.   else
  36.   { echo TMPL_VisitPrefs . "\n"; }
  37.  ?><br />
  38.   <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?>" />
  39. <?php  if($args['archive'])
  40.     {?>
  41.   <input type="hidden" name="archive" value="1" />
  42. <?php  }?>
  43.   <textarea name="document" rows="<?php
  44.     print $EditRows; ?>" cols="<?php
  45.     print $EditCols; ?>" wrap="virtual"><?php
  46.   print str_replace('<', '<', str_replace('&', '&', $args['text']));
  47. ?></textarea><br />
  48.   <?php echo TMPL_SummaryOfChange; ?>
  49.   <input type="text" name="comment" size="40" value="" /><br />
  50.   <?php echo TMPL_AddToCategory; ?>
  51.   <input type="text" name="categories" size="40" value="" />
  52. </div>
  53. </form>
  54. </div>
  55. <?php
  56.   template_common_epilogue(array('twin'      => $args['page'],
  57.                                  'edit'      => '',
  58.                                  'editver'   => '',
  59.                                  'history'   => $args['page'],
  60.                                  'timestamp' => $args['timestamp'],
  61.                                  'nosearch'  => 0));
  62. }
  63. ?>
  64.