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

Source for file article_history.php

Documentation is available at article_history.php

  1. <?php
  2. /**
  3.  * $Header$
  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 below for details and a complete list of authors.
  9.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  10.  *
  11.  * $Id$
  12.  * @package wiki
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * required setup
  18.  */
  19. require_once '../kernel/setup_inc.php';
  20. require_onceARTICLES_PKG_PATH.'BitArticle.php' );
  21.  
  22. $gBitSystem->verifyPackage'articles' );
  23. $gBitSystem->verifyPermission'p_articles_read' );
  24. $gBitSystem->verifyPermission'p_articles_read_history' );
  25.  
  26. if!isset$_REQUEST["article_id") ) {
  27.     $gBitSystem->fatalErrortra"No article indicated" ));
  28. }
  29.  
  30. include_onceARTICLES_PKG_PATH.'lookup_article_inc.php' );
  31.  
  32. //vd($gContent->mPageId);vd($gContent->mInfo);
  33. if!$gContent->isValid(|| empty$gContent->mInfo ) ) {
  34.     $gBitSystem->fatalErrortra"Unknown article" ));
  35. }
  36.  
  37. // additionally we need to check if this article is a submission and see if user has perms to view it.
  38. if$gContent->getField'status_id' != ARTICLE_STATUS_APPROVED && !$gContent->hasUserPermission'p_articles_update_submission' || $gBitUser->isAdmin() ) ) {
  39.     $gBitSmarty->assign'msg'tra"Permission denied you cannot view this article" ) );
  40.     $gBitSystem->display"error.tpl" NULLarray'display_mode' => 'display' ));
  41.     die;
  42. }
  43.  
  44. $smartyContentRef 'article';
  45. include_onceLIBERTY_PKG_PATH.'content_history_inc.php' );
  46.  
  47. $gBitSmarty->assign'page'$page !empty$_REQUEST['list_page'$_REQUEST['list_page');
  48. $offset $page $gBitSystem->getConfig'max_records' );
  49. $history $gContent->getHistoryNULLNULL$offset$gBitSystem->getConfig'max_records' ) );
  50. $gBitSmarty->assign_by_ref'data'$history['data');
  51. $gBitSmarty->assign_by_ref'listInfo'$history['listInfo');
  52.  
  53. //vd($gContent->getHistoryCount());
  54.  
  55. // calculate page number
  56. $numPages ceil$gContent->getHistoryCount($gBitSystem->getConfig('max_records'20) );
  57. $gBitSmarty->assign'numPages'$numPages );
  58.  
  59. // Display the template
  60. $gBitSmarty->assign_by_ref'gContent'$gContent );
  61. $gBitSystem->display'bitpackage:articles/article_history.tpl'NULLarray'display_mode' => 'display' ));

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