From dfe158aca1ceb37735a3c16d856ca6b02d4c4c87 Mon Sep 17 00:00:00 2001 From: pappastech Date: Fri, 27 Jan 2012 01:35:36 +0000 Subject: [PATCH] Pagination in the items area works now. Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@42 c3eb156b-1dc0-44e1-88ae-e38439141b53 --- application/config/config.php | 2 +- application/controllers/items.php | 7 ++++--- system/libraries/Pagination.php | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index dd7f12d80..cac4b43c1 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -9,7 +9,7 @@ | | */ -$config['application_version'] = '2.0_RC2'; +$config['application_version'] = '2.0_RC3'; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/items.php b/application/controllers/items.php index c90ff207b..6c7a7f4d4 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -10,14 +10,15 @@ class Items extends Secure_area implements iData_controller function index() { - $config['base_url'] = site_url('?c=items&m=index'); + $config['base_url'] = site_url('/items/index'); $config['total_rows'] = $this->Item->count_all(); - $config['per_page'] = '20'; + $config['per_page'] = '20'; + $config['uri_segment'] = 3; $this->pagination->initialize($config); $data['controller_name']=strtolower(get_class()); $data['form_width']=$this->get_form_width(); - $data['manage_table']=get_items_manage_table($this->Item->get_all($config['per_page'], $this->input->get('per_page')),$this); + $data['manage_table']=get_items_manage_table( $this->Item->get_all( $config['per_page'], $this->uri->segment( $config['uri_segment'] ) ), $this ); $this->load->view('items/manage',$data); } diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index cdaacf2d4..6bc372c74 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -31,9 +31,9 @@ class CI_Pagination { var $suffix = ''; // A custom suffix added to the path. var $total_rows = 0; // Total number of items (database results) - var $per_page = 10; // Max number of items you want shown per page + var $per_page = 10; // Max number of items you want shown per page var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page - var $cur_page = 0; // The current page being viewed + var $cur_page = 0; // The current page being viewed var $use_page_numbers = FALSE; // Use page number for segment instead of offset var $first_link = '‹ First'; var $next_link = '>';