From: <pk...@us...> - 2008-11-28 22:49:56
|
Revision: 15812 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15812&view=rev Author: pkdille Date: 2008-11-28 22:49:51 +0000 (Fri, 28 Nov 2008) Log Message: ----------- [MOD] pagination_links: deploy to some templates Modified Paths: -------------- trunk/templates/tiki-admin_survey_questions.tpl trunk/templates/tiki-admin_surveys.tpl trunk/templates/tiki-list_surveys.tpl trunk/templates/tiki-quiz_stats_quiz.tpl trunk/templates/tiki-survey_stats.tpl trunk/tiki-admin_survey_questions.php trunk/tiki-admin_surveys.php trunk/tiki-list_surveys.php trunk/tiki-quiz_stats_quiz.php trunk/tiki-survey_stats.php Modified: trunk/templates/tiki-admin_survey_questions.tpl =================================================================== --- trunk/templates/tiki-admin_survey_questions.tpl 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/templates/tiki-admin_survey_questions.tpl 2008-11-28 22:49:51 UTC (rev 15812) @@ -8,7 +8,7 @@ {button href="tiki-admin_surveys.php?surveyId=$surveyId" _text="{tr}Edit this Survey{/tr}"} {button href="tiki-admin_surveys.php" _text="{tr}Admin Surveys{/tr}"} </div> -<br /> + <h2> {if $questionId gt 0}{tr}Edit Survey Question{/tr}{else}{tr}Add a New Question to this survey{/tr}{/if} </h2> @@ -46,7 +46,6 @@ </table> </form> <h2>{tr}Questions{/tr}</h2> -<div align="center"> <table class="findtable"> <tr><td class="findtable">{tr}Find{/tr}</td> <td class="findtable"> @@ -83,21 +82,5 @@ </tr> {/section} </table> -<div class="mini"> -{if $prev_offset >= 0} -[<a class="prevnext" href="tiki-admin_survey_questions.php?surveyId={$surveyId}&find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}Prev{/tr}</a>] -{/if} -{tr}Page{/tr}: {$actual_page}/{$cant_pages} -{if $next_offset >= 0} - [<a class="prevnext" href="tiki-admin_survey_questions.php?surveyId={$surveyId}&find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}Next{/tr}</a>] -{/if} -{if $prefs.direct_pagination eq 'y'} -<br /> -{section loop=$cant_pages name=foo} -{assign var=selector_offset value=$smarty.section.foo.index|times:$prefs.maxRecords} -<a class="prevnext" href="tiki-admin_survey_questions.php?surveyId={$surveyId}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> -{$smarty.section.foo.index_next}</a> -{/section} -{/if} -</div> -</div> + +{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links} Modified: trunk/templates/tiki-admin_surveys.tpl =================================================================== --- trunk/templates/tiki-admin_surveys.tpl 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/templates/tiki-admin_surveys.tpl 2008-11-28 22:49:51 UTC (rev 15812) @@ -89,20 +89,4 @@ {/section} </table> -<div class="mini"> -{if $prev_offset >= 0} -[<a class="prevnext" href="tiki-admin_surveys.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}Prev{/tr}</a>] -{/if} -{tr}Page{/tr}: {$actual_page}/{$cant_pages} -{if $next_offset >= 0} - [<a class="prevnext" href="tiki-admin_surveys.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}Next{/tr}</a>] -{/if} -{if $prefs.direct_pagination eq 'y'} -<br /> -{section loop=$cant_pages name=foo} -{assign var=selector_offset value=$smarty.section.foo.index|times:$prefs.maxRecords} -<a class="prevnext" href="tiki-admin_surveys.php?find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> -{$smarty.section.foo.index_next}</a> -{/section} -{/if} -</div> +{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links} Modified: trunk/templates/tiki-list_surveys.tpl =================================================================== --- trunk/templates/tiki-list_surveys.tpl 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/templates/tiki-list_surveys.tpl 2008-11-28 22:49:51 UTC (rev 15812) @@ -56,21 +56,4 @@ </table> <! -- the page advance... it's set to ten by default in maxRecords... --> -<br /> -<div class="mini"> -{if $prev_offset >= 0} -[<a class="prevnext" href="tiki-list_surveys.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}Prev{/tr}</a>] -{/if} -{tr}Page{/tr}: {$actual_page}/{$cant_pages} -{if $next_offset >= 0} - [<a class="prevnext" href="tiki-list_surveys.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}Next{/tr}</a>] -{/if} -{if $prefs.direct_pagination eq 'y'} -<br /> -{section loop=$cant_pages name=foo} -{assign var=selector_offset value=$smarty.section.foo.index|times:$prefs.maxRecords} -<a class="prevnext" href="tiki-list_surveys.php?find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> -{$smarty.section.foo.index_next}</a> -{/section} -{/if} -</div> +{pagination_links cant=$cant_pages step=$maxRecords offset=$offset}{/pagination_links} Modified: trunk/templates/tiki-quiz_stats_quiz.tpl =================================================================== --- trunk/templates/tiki-quiz_stats_quiz.tpl 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/templates/tiki-quiz_stats_quiz.tpl 2008-11-28 22:49:51 UTC (rev 15812) @@ -14,7 +14,6 @@ <!-- end link buttons --> <h2>{tr}Quiz stats{/tr}</h2> -<div align="center"> <!-- begin table for stats data --> @@ -62,26 +61,7 @@ {/section} </table> -<!-- this is the part for viewing the next 10 results --> -<div class="mini"> -{if $prev_offset >= 0} -[<a class="prevnext" href="tiki-quiz_stats_quiz.php?quizId={$quizId}&find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}Prev{/tr}</a>] -{/if} -{tr}Page{/tr}: {$actual_page}/{$cant_pages} -{if $next_offset >= 0} - [<a class="prevnext" href="tiki-quiz_stats_quiz.php?quizId={$quizId}&find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}Next{/tr}</a>] -{/if} -{if $prefs.direct_pagination eq 'y'} -<br /> -{section loop=$cant_pages name=foo} -{assign var=selector_offset value=$smarty.section.foo.index|times:$prefs.maxRecords} -<!-- really need to find how/ where to set the maxRecords to user control --> -<a class="prevnext" href="tiki-quiz_stats_quiz.php?quizId={$quizId}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> -{$smarty.section.foo.index_next}</a> -{/section} -{/if} -</div> -</div> +{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links} <!-- begin second table --> <h2>{tr}Stats for this quiz Questions {/tr}</h2> Modified: trunk/templates/tiki-survey_stats.tpl =================================================================== --- trunk/templates/tiki-survey_stats.tpl 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/templates/tiki-survey_stats.tpl 2008-11-28 22:49:51 UTC (rev 15812) @@ -10,7 +10,6 @@ {/if} </div> -<div align="center"> <table class="findtable"> <tr><td class="findtable">{tr}Find{/tr}</td> <td class="findtable"> @@ -42,22 +41,5 @@ {/if} {/section} </table> -<div class="mini"> -{if $prev_offset >= 0} -[<a class="prevnext" href="tiki-survey_stats.php?surveyId={$surveyId}&find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}Prev{/tr}</a>] -{/if} -{tr}Page{/tr}: {$actual_page}/{$cant_pages} -{if $next_offset >= 0} - [<a class="prevnext" href="tiki-survey_stats.php?surveyId={$surveyId}&find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}Next{/tr}</a>] -{/if} -{if $prefs.direct_pagination eq 'y'} -<br /> -{section loop=$cant_pages name=foo} -{assign var=selector_offset value=$smarty.section.foo.index|times:$prefs.maxRecords} -<a class="prevnext" href="tiki-survey_stats.php?surveyId={$surveyId}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> -{$smarty.section.foo.index_next}</a> -{/section} -{/if} -</div> -</div> +{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links} Modified: trunk/tiki-admin_survey_questions.php =================================================================== --- trunk/tiki-admin_survey_questions.php 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/tiki-admin_survey_questions.php 2008-11-28 22:49:51 UTC (rev 15812) @@ -141,27 +141,13 @@ $smarty->assign_by_ref('sort_mode', $sort_mode); $channels = $srvlib->list_survey_questions($_REQUEST["surveyId"], $offset, $maxRecords, $sort_mode, $find); -//$smarty->assign('questions',$channels["data"]); -$cant_pages = ceil($channels["cant"] / $maxRecords); + if (empty($info["position"])) { $info["position"] = $channels["cant"] + 1; } -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); -if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); -} else { - $smarty->assign('next_offset', -1); -} +$smarty->assign_by_ref('cant_pages', $channels["cant"]); -// If offset is > 0 then prev_offset -if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); -} else { - $smarty->assign('prev_offset', -1); -} - $smarty->assign_by_ref('channels', $channels["data"]); // Fill array with possible number of questions per page Modified: trunk/tiki-admin_surveys.php =================================================================== --- trunk/tiki-admin_surveys.php 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/tiki-admin_surveys.php 2008-11-28 22:49:51 UTC (rev 15812) @@ -131,8 +131,7 @@ $channels["data"][$i]["individual_tiki_p_view_survey_stats"] = 'n'; } - if ($tiki_p_admin - == 'y' || $userlib->object_has_permission($user, $channels["data"][$i]["surveyId"], 'survey', 'tiki_p_admin_surveys')) { + if ($tiki_p_admin == 'y' || $userlib->object_has_permission($user, $channels["data"][$i]["surveyId"], 'survey', 'tiki_p_admin_surveys')) { $channels["data"][$i]["individual_tiki_p_take_survey"] = 'y'; $channels["data"][$i]["individual_tiki_p_view_survey_stats"] = 'y'; @@ -143,23 +142,8 @@ } } -$cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$smarty->assign_by_ref('cant_pages', $channels["cant"]); -if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); -} else { - $smarty->assign('next_offset', -1); -} - -// If offset is > 0 then prev_offset -if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); -} else { - $smarty->assign('prev_offset', -1); -} - $smarty->assign_by_ref('channels', $channels["data"]); // Fill array with possible number of questions per page (qpp) Modified: trunk/tiki-list_surveys.php =================================================================== --- trunk/tiki-list_surveys.php 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/tiki-list_surveys.php 2008-11-28 22:49:51 UTC (rev 15812) @@ -86,23 +86,8 @@ } } -$cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$smarty->assign_by_ref('cant_pages', $channels["cant"]); -if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); -} else { - $smarty->assign('next_offset', -1); -} - -// If offset is > 0 then prev_offset -if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); -} else { - $smarty->assign('prev_offset', -1); -} - $smarty->assign_by_ref('channels', $channels["data"]); include_once ('tiki-section_options.php'); Modified: trunk/tiki-quiz_stats_quiz.php =================================================================== --- trunk/tiki-quiz_stats_quiz.php 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/tiki-quiz_stats_quiz.php 2008-11-28 22:49:51 UTC (rev 15812) @@ -108,23 +108,8 @@ $channels = $quizlib->list_quiz_stats($_REQUEST["quizId"], $offset, $maxRecords, $sort_mode, $find); -$cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$smarty->assign_by_ref('cant_pages', $channels["cant"]); -if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); -} else { - $smarty->assign('next_offset', -1); -} - -// If offset is > 0 then prev_offset -if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); -} else { - $smarty->assign('prev_offset', -1); -} - $smarty->assign_by_ref('channels', $channels["data"]); //Get all the statistics for this quiz Modified: trunk/tiki-survey_stats.php =================================================================== --- trunk/tiki-survey_stats.php 2008-11-28 22:40:54 UTC (rev 15811) +++ trunk/tiki-survey_stats.php 2008-11-28 22:49:51 UTC (rev 15812) @@ -82,23 +82,8 @@ } } -$cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$smarty->assign_by_ref('cant_pages', $channels["cant"]); -if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); -} else { - $smarty->assign('next_offset', -1); -} - -// If offset is > 0 then prev_offset -if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); -} else { - $smarty->assign('prev_offset', -1); -} - $smarty->assign_by_ref('channels', $channels["data"]); $smarty->assign('section',$section); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |