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

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