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

Source for file page_history.php

Documentation is available at page_history.php

  1. <?php
  2. /**
  3.  * Copyright (c) 2004 bitweaver.org
  4.  * Copyright (c) 2003 tikwiki.org
  5.  * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  6.  * All Rights Reserved. See below for details and a complete list of authors.
  7.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  8.  *
  9.  * @package wiki
  10.  * @subpackage functions
  11.  */
  12.  
  13. /**
  14.  * required setup
  15.  */
  16. require_once( '../kernel/setup_inc.php' );
  17. require_once( WIKI_PKG_PATH.'BitPage.php');
  18.  
  19. $gBitSystem->verifyPackage( 'wiki' );
  20. $gBitSystem->verifyFeature( 'wiki_history' );
  21.  
  22. // Get the page from the request var or default it to HomePage
  23. include( WIKI_PKG_PATH.'lookup_page_inc.php' );
  24.  
  25. //vd($gContent->mPageId);vd($gContent->mInfo);
  26. if( !$gContent->isValid() || empty( $gContent->mInfo ) ) {
  27.     $gBitSystem->fatalError( tra( "Unknown page" ));
  28. }
  29.  
  30. $gContent->verifyViewPermission();
  31. $gContent->verifyUserPermission( 'p_wiki_view_history' );
  32.  
  33. $gBitSmarty->assign_by_ref( 'pageInfo', $gContent->mInfo );
  34.  
  35. if (!empty( $_REQUEST['rollback_preview'] )) {
  36.     $gBitSmarty->assign( 'rollback_preview', $_REQUEST['rollback_preview']);
  37. }
  38.  
  39. // set up stuff to get history working
  40. $smartyContentRef = 'pageInfo';
  41. $rollbackPerm     = 'p_wiki_rollback';
  42. include_once( LIBERTY_PKG_PATH.'content_history_inc.php' );
  43.  
  44. // pagination stuff
  45. $gBitSmarty->assign( 'page', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 );
  46. if( !empty( $_REQUEST['list_page'] )) {
  47.     $gBitSmarty->assign( 'page', $page = !empty( $_REQUEST['list_page'] ) ? $_REQUEST['list_page'] : 1 );
  48. }
  49.  
  50. $offset = ( $page - 1 ) * $gBitSystem->getConfig( 'max_records' );
  51. $history = $gContent->getHistory( NULL, NULL, $offset, $gBitSystem->getConfig( 'max_records' ) );
  52. $gBitSmarty->assign_by_ref( 'data', $history['data'] );
  53. $gBitSmarty->assign_by_ref( 'listInfo', $history['listInfo'] );
  54.  
  55. // Display the template
  56. $gBitSmarty->assign_by_ref( 'gContent', $gContent );
  57. $gBitSystem->display( 'bitpackage:wiki/page_history.tpl' , NULL, array( 'display_mode' => 'display' ));
  58. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:14 +0000 by phpDocumentor 1.5.0-lsces