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

Source for file books.php

Documentation is available at books.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. include_once( WIKI_PKG_PATH.'BitBook.php');
  18.  
  19. // verify stuff
  20. $gBitSystem->verifyPackage( 'wiki' );
  21. $gBitSystem->verifyPermission( 'p_wiki_list_pages' );
  22.  
  23. $book = new BitBook();
  24.  
  25. $listHash = array();
  26. $listHash['content_type_guid'] = BITBOOK_CONTENT_TYPE_GUID;
  27. $channels = $book->getList( $listHash );
  28.  
  29. $cant_pages = ceil($channels["cant"] / $listHash['max_records']);
  30. $gBitSmarty->assign_by_ref('cant_pages', $cant_pages);
  31. $gBitSmarty->assign('actual_page', 1 + ($listHash['offset'] / $listHash['max_records']));
  32.  
  33. if ($channels["cant"] > ($listHash['offset'] + $listHash['max_records'])) {
  34.     $gBitSmarty->assign('next_offset', $listHash['offset'] + $listHash['max_records']);
  35. } else {
  36.     $gBitSmarty->assign('next_offset', -1);
  37. }
  38.  
  39. // If offset is > 0 then prev_offset
  40. if ($listHash['offset'] > 0) {
  41.     $gBitSmarty->assign('prev_offset', $listHash['offset'] - $listHash['max_records']);
  42. } else {
  43.     $gBitSmarty->assign('prev_offset', -1);
  44. }
  45.  
  46. $gBitSmarty->assign_by_ref('channels', $channels["data"]);
  47.  
  48. $gBitSystem->display( 'bitpackage:wiki/list_books.tpl', NULL, array( 'display_mode' => 'display' ));
  49.  
  50. ?>

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