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

  1. <?php
  2. // $Id: conflict.php,v 1.1 2004/01/12 22:14:05 comsubvie Exp $
  3.  
  4. require_once(TemplateDir . '/common.php');
  5.  
  6. // The conflict 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 version that was
  11. //                saved while the user was editing the page.
  12. //   html      => A string containing the XHTML markup of the version of the
  13. //                page that was saved while the user was editing the page.
  14. //   usertext  => A string containing the wiki markup of the text the user
  15. //                tried to save.
  16. //   timestamp => Timestamp of last edit to page.
  17. //   nextver   => An integer; the expected version of this document when saved.
  18.  
  19. function template_conflict($args)
  20. {
  21.   global $EditRows, $EditCols, $UserName, $PrefsScript;
  22.  
  23.   template_common_prologue(array('norobots' => 1,
  24.                                  'title'    => TMPL_Editing .' '. $args['page'],
  25.                                  'heading'  => TMPL_Editing .' ',
  26.                                  'headlink' => $args['page'],
  27.                                  'headsufx' => '',
  28.                                  'toolbar'  => 1));
  29. ?>
  30. <div id="body">
  31. <p class="warning"><?php print TMPL_WarningOtherEditing; ?></p>
  32. <h1><?php print TMPL_CurrentVersion; ?></h1>
  33. <form method="post" action="<?php print saveURL($args['page']); ?>">
  34. <div class="form">
  35.   <input type="submit" name="Save" value="<?php print TMPL_ButtonSave; ?>" />
  36.   <input type="submit" name="Preview" value="<?php print TMPL_ButtonPreview; ?>" />
  37. <?php
  38.   if($UserName != '')
  39.     { print TMPL_YourUsername .' '. html_ref($UserName, $UserName); }
  40.   else
  41.     { echo TMPL_VisitPrefs . "\n"; }
  42. ?><br />
  43.   <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?>" />
  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="" /><br />
  51.   <?php echo TMPL_AddToCategory; ?> 
  52.   <input type="text" name="categories" size="40" value="" />
  53. <hr />
  54. <h1><?php echo TMPL_YourChanges; ?></h1>
  55.   <textarea name="discard" rows="<?php
  56.     print $EditRows; ?>" cols="<?php
  57.     print $EditCols; ?>" wrap="virtual"><?php
  58.   print str_replace('<', '<', str_replace('&', '&', $args['usertext']));
  59. ?></textarea><br />
  60. </div>
  61. </form>
  62. <h1><?php echo TMPL_PreviewCurrentVersion; ?></h1>
  63. <?php
  64.   print $args['html'];
  65. ?>
  66. </div>
  67. <?php
  68.   template_common_epilogue(array('twin'      => $args['page'],
  69.                                  'edit'      => '',
  70.                                  'editver'   => 0,
  71.                                  'history'   => $args['page'],
  72.                                  'timestamp' => $args['timestamp'],
  73.                                  'nosearch'  => 0));
  74. }
  75. ?>
  76.