mail[Wesnoth-commits] r28513 - in /trunk/utils/tests: include/Build.php smarty_workdir/templates/build_history.tpl


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on August 12, 2008 - 22:06:
Author: suokko
Date: Tue Aug 12 22:01:59 2008
New Revision: 28513

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28513&view=rev
Log:
* Added initial implementation for pagination for build history

Modified:
    trunk/utils/tests/include/Build.php
    trunk/utils/tests/smarty_workdir/templates/build_history.tpl

Modified: trunk/utils/tests/include/Build.php
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/tests/include/Build.php?rev=28513&r1=28512&r2=28513&view=diff
==============================================================================
--- trunk/utils/tests/include/Build.php (original)
+++ trunk/utils/tests/include/Build.php Tue Aug 12 22:01:59 2008
@@ -256,11 +256,16 @@
 
        public static function getVisibleBuilds(ParameterValidator 
$user_params)
        {
+               $ret = array();
+               $ret['paginate']['number_of_pages']     = 
self::getNumberOfVisiblePages($builds_per_page);
+
                $page = $user_params->getInt('page', 1);
-               $builds_per_page = 10; // TODO: get from config
+               $builds_per_page = 15; // TODO: get from config
                if ($page < 0)
                        $page = 1;
-               $ret = array();
+               if ($page > $get['number_of_pages'])
+                       $page = $get['number_of_pages'];
+
                $ret['builds'] = array();
                $builds = self::fetchVisibleBuilds($page, $builds_per_page);
                foreach($builds as $build)
@@ -268,8 +273,7 @@
                        $ret['builds'][] = $build->getBuildStats();
                }
 
-               $ret['page'] = $page;
-               $ret['number_of_pages'] = 
self::getNumberOfVisiblePages($builds_per_page);
+               $ret['paginate']['page'] = $page;
 
                return $ret;
        }

Modified: trunk/utils/tests/smarty_workdir/templates/build_history.tpl
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/tests/smarty_workdir/templates/build_history.tpl?rev=28513&r1=28512&r2=28513&view=diff
==============================================================================
--- trunk/utils/tests/smarty_workdir/templates/build_history.tpl (original)
+++ trunk/utils/tests/smarty_workdir/templates/build_history.tpl Tue Aug 12 
22:01:59 2008
@@ -1,2 +1,4 @@
 <h3>Build history</h3>
+{include file='paginate.tpl'}
 {include file='build_list.tpl'}
+{include file='paginate.tpl'}




Related Messages


Powered by MHonArc, Updated Tue Aug 12 22:22:30 2008