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

  1. <?php
  2. // $Id: view.php,v 1.1 2004/01/12 22:14:06 comsubvie Exp $
  3.  
  4. require_once(TemplateDir . '/common.php');
  5.  
  6. // The view 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. //   html      => A string containing the XHTML rendering of the wiki page.
  11. //   editable  => An integer.  Will be nonzero if user is allowed to edit page.
  12. //   timestamp => Timestamp of last edit to page.
  13. //   archive   => An integer.  Will be nonzero if this is not the most recent
  14. //                version of the page.
  15. //   version   => Version number of page version being viewed.
  16.  
  17. function template_view($args)
  18. {
  19.   template_common_prologue(array('norobots' => $args['archive'],
  20.                                  'title'    => $args['page'],
  21.                                  'heading'  => '',
  22.                                  'headlink' => $args['page'],
  23.                                  'headsufx' => $args['archive'] ?
  24.                                                  ' (' . html_timestamp($args['timestamp']) . ')'
  25.                                                  : '',
  26.                                  'toolbar'  => 1));
  27.  
  28. ?>
  29. <div id="body">
  30. <?php print $args['html']; ?>
  31. </div>
  32. <?php
  33.   template_common_epilogue(array('twin'      => $args['page'],
  34.                                  'edit'      => $args['page'],
  35.                                  'editver'   => !$args['editable'] ? -1
  36.                                                 : ($args['archive']
  37.                                                    ? $args['version'] : 0),
  38.                                  'history'   => $args['page'],
  39.                                  'timestamp' => $args['timestamp'],
  40.                                  'nosearch'  => 0));
  41. }
  42. ?>
  43.