wiki
[ class tree: wiki ] [ index: wiki ] [ all elements ]

Source for file print.php

Documentation is available at print.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_wiki/print.php,v 1.16 2006/12/23 15:44:22 squareing Exp $
  4.  *
  5.  * Copyright (c) 2004 bitweaver.org
  6.  * Copyright (c) 2003 tikwiki.org
  7.  * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  * All Rights Reserved. See copyright.txt for details and a complete list of authors.
  9.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
  10.  *
  11.  * $Id: print.php,v 1.16 2006/12/23 15:44:22 squareing Exp $
  12.  * @package wiki
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * required setup
  18.  */
  19. require_once'../bit_setup_inc.php' );
  20. include_onceWIKI_PKG_PATH.'BitPage.php');
  21.  
  22. $gBitSystem->verifyPackage'wiki' );
  23.  
  24. // If the page doesn't exist then display an error
  25. $requirePage TRUE;
  26. includeWIKI_PKG_PATH.'lookup_page_inc.php' );
  27.  
  28. // Since we updated the permissions using updateUserPermissions() in lookup_page_inc.php, we can use the regular permission methods here
  29. if!$gBitUser->hasPermission'p_wiki_view_page' ) ) {
  30.     $gBitSystem->fatalErrortra"Permission denied. You cannot view this page." ) );
  31. }
  32.  
  33. require_once WIKI_PKG_PATH.'page_setup_inc.php' );
  34. // Check if we have to perform an action for this page
  35. // for example lock/unlock
  36.  
  37. if (isset($_REQUEST["action"])) {
  38.     if ($_REQUEST["action"== 'lock'{
  39.         $gContent->lock();
  40.     elseif ($_REQUEST["action"== 'unlock'{
  41.         $gContent->unlock_page();
  42.     }
  43. }
  44.  
  45. // Now increment page hits since we are visiting this page
  46. if ($gBitSystem->isFeatureActive'users_count_admin_pageviews' || !$gBitUser->isAdmin()) {
  47.     $gContent->addHit();
  48. }
  49. // Get page data
  50. $info $gContent->mInfo;
  51. if ($gBitSystem->isFeatureActive'wiki_copyrights' && $gBitSystem->isFeatureActive'wiki_copyrights' && $gBitSystem->isFeatureActive'wiki_license_page' )) {
  52.     // insert license if wiki copyrights enabled
  53. //    $license_info = $wikilib->get_page_info($wiki_license_page);
  54. //    $wikilib->add_hit($wiki_license_page);
  55.     
  56.     $info["data"$info["data""\n<HR>\n" $license_info["data"];
  57.     $_REQUEST['copyrightpage'$page;
  58. }
  59. // Verify lock status
  60. if ($info["flag"== 'L'{
  61.     $gBitSmarty->assign('lock'true);
  62. else {
  63.     $gBitSmarty->assign('lock'false);
  64. }
  65. $gBitSmarty->assign_by_ref('last_modified'$info["last_modified"]);
  66. if (empty($info["user"])) {
  67.     $info["user"'anonymous';
  68. }
  69. $gBitSmarty->assign_by_ref('lastUser'$info["user"]);
  70. //Store the page URL to be displayed on print page
  71. $site_http_domain $wikilib->getPreference('site_http_domain'false);
  72. $site_http_port $wikilib->getPreference('site_http_port'80);
  73. $site_http_prefix $wikilib->getPreference('site_http_prefix''/');
  74. if ($site_http_domain{
  75.     $prefix 'http://' $site_http_domain;
  76.     if ($site_http_port != 80)
  77.         $prefix .= ':' $site_http_port;
  78.     $prefix .= $gBitSystem->getConfig'site_https_prefix' );
  79.     $gBitSmarty->assign('urlprefix'$prefix);
  80. }
  81.  
  82. // Display the Index Template
  83. $gBitSmarty->assign('print_page','y');
  84. $gBitSmarty->assign('show_page_bar''n');
  85. $gBitSmarty->display("bitpackage:wiki/print.tpl");
  86. ?>

Documentation generated on Thu, 15 Feb 2007 20:47:31 +0000 by phpDocumentor 1.3.0