mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 12:58:52 +00:00
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/twig
# By Dhruv (7) and others # Via Andreas Fischer (7) and others * 'develop' of https://github.com/phpbb/phpbb3: [ticket/11593] initialize $is_expr as null before being passed to get_varref [ticket/9341] Assert that page doesnt contain next or prev page posts [ticket/9341] Follow the Next/Prev link in tests follow the next/prev link and then assert if the page contains its last post or not [ticket/9341] remove PREV_PAGE tpl var used for backward compatability [ticket/11618] Replace glob() with scandir() and string matching [ticket/9341] Add tests for checking Next and Previous template vars [ticket/9341] Move create_topic and post into functional test case [ticket/11615] Fix typo in creation_test [ticket/11615] Remove magic number in creation_test [ticket/11615] Rename class in file to match [ticket/11615] Rename init_test to creation_test for clarity [ticket/9341] Use U_PREVIOUS and U_NEXT in template files [ticket/9341] Correctly named template vars Conflicts: tests/template/template_test_case.php
This commit is contained in:
commit
f08330f762
19 changed files with 174 additions and 134 deletions
|
@ -243,8 +243,8 @@
|
||||||
<td style="text-align: center;">{items.EMOTION}</td>
|
<td style="text-align: center;">{items.EMOTION}</td>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<td style="text-align: right; white-space: nowrap;">
|
<td style="text-align: right; white-space: nowrap;">
|
||||||
<!-- IF items.S_FIRST_ROW and not PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
<!-- IF items.S_FIRST_ROW and not U_PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
||||||
<!-- IF items.S_LAST_ROW and not NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
<!-- IF items.S_LAST_ROW and not U_NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
||||||
<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
|
<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -2345,9 +2345,8 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam
|
||||||
$tpl_prefix . 'BASE_URL' => $base_url,
|
$tpl_prefix . 'BASE_URL' => $base_url,
|
||||||
'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
|
'A_' . $tpl_prefix . 'BASE_URL' => addslashes($base_url),
|
||||||
$tpl_prefix . 'PER_PAGE' => $per_page,
|
$tpl_prefix . 'PER_PAGE' => $per_page,
|
||||||
$tpl_prefix . 'PREVIOUS_PAGE' => $previous_page,
|
'U_' . $tpl_prefix . 'PREVIOUS_PAGE' => $previous_page,
|
||||||
$tpl_prefix . 'PREV_PAGE' => $previous_page,
|
'U_' . $tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page) : '',
|
||||||
$tpl_prefix . 'NEXT_PAGE' => ($on_page != $total_pages) ? $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page) : '',
|
|
||||||
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
|
$tpl_prefix . 'TOTAL_PAGES' => $total_pages,
|
||||||
$tpl_prefix . 'CURRENT_PAGE' => $on_page,
|
$tpl_prefix . 'CURRENT_PAGE' => $on_page,
|
||||||
);
|
);
|
||||||
|
|
|
@ -475,6 +475,7 @@ class phpbb_template_filter extends php_user_filter
|
||||||
*/
|
*/
|
||||||
private function compile_var_tags(&$text_blocks)
|
private function compile_var_tags(&$text_blocks)
|
||||||
{
|
{
|
||||||
|
$is_expr = null;
|
||||||
$text_blocks = $this->get_varref($text_blocks, $is_expr);
|
$text_blocks = $this->get_varref($text_blocks, $is_expr);
|
||||||
$lang_replaced = $this->compile_language_tags($text_blocks);
|
$lang_replaced = $this->compile_language_tags($text_blocks);
|
||||||
|
|
||||||
|
|
|
@ -85,8 +85,8 @@
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
||||||
<label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
<label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
||||||
|
|
|
@ -54,8 +54,8 @@
|
||||||
|
|
||||||
<!-- IF .log -->
|
<!-- IF .log -->
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
||||||
<label>{S_SELECT_SORT_DIR}</label>
|
<label>{S_SELECT_SORT_DIR}</label>
|
||||||
|
|
|
@ -95,8 +95,8 @@
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<label>{L_DISPLAY_LOG}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_LOG}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
|
||||||
<input type="submit" name="sort" value="{L_GO}" class="button2" />
|
<input type="submit" name="sort" value="{L_GO}" class="button2" />
|
||||||
|
|
|
@ -67,8 +67,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
|
||||||
<!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF -->
|
<!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF -->
|
||||||
|
|
|
@ -72,8 +72,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
|
||||||
<!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF -->
|
<!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF -->
|
||||||
|
|
|
@ -140,8 +140,8 @@
|
||||||
|
|
||||||
<!-- IF S_IN_SEARCH_POPUP and not S_SEARCH_USER -->
|
<!-- IF S_IN_SEARCH_POPUP and not S_SEARCH_USER -->
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<label for="sk">{L_SELECT_SORT_METHOD}{L_COLON} <select name="sk" id="sk">{S_MODE_SELECT}</select></label>
|
<label for="sk">{L_SELECT_SORT_METHOD}{L_COLON} <select name="sk" id="sk">{S_MODE_SELECT}</select></label>
|
||||||
<label for="sd">{L_ORDER} <select name="sd" id="sd">{S_ORDER_SELECT}</select> <input type="submit" name="sort" value="{L_SUBMIT}" class="button2" /></label>
|
<label for="sd">{L_ORDER} <select name="sd" id="sd">{S_ORDER_SELECT}</select> <input type="submit" name="sort" value="{L_SUBMIT}" class="button2" /></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -154,8 +154,8 @@
|
||||||
<form method="post" action="{S_SEARCH_ACTION}">
|
<form method="post" action="{S_SEARCH_ACTION}">
|
||||||
|
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY -->
|
<!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY -->
|
||||||
<label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label>
|
<label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label>
|
||||||
<label>{S_SELECT_SORT_DIR}<!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
<label>{S_SELECT_SORT_DIR}<!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<label for="sk">{L_SORT_BY}{L_COLON} <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label>
|
<label for="sk">{L_SORT_BY}{L_COLON} <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label>
|
||||||
<label><select name="sd" id="sd">{S_ORDER_SELECT}</select></label>
|
<label><select name="sd" id="sd">{S_ORDER_SELECT}</select></label>
|
||||||
<input class="button2" type="submit" name="sort" value="{L_SORT}" />
|
<input class="button2" type="submit" name="sort" value="{L_SORT}" />
|
||||||
|
|
|
@ -122,8 +122,8 @@
|
||||||
|
|
||||||
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
|
<!-- IF FOLDER_CUR_MESSAGES neq 0 -->
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<label>{L_DISPLAY}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
||||||
<label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
<label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
||||||
|
|
|
@ -192,8 +192,8 @@
|
||||||
<!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE -->
|
<!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE -->
|
||||||
<form method="post" action="{S_FORUM_ACTION}">
|
<form method="post" action="{S_FORUM_ACTION}">
|
||||||
<fieldset class="display-options">
|
<fieldset class="display-options">
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF not S_IS_BOT -->
|
<!-- IF not S_IS_BOT -->
|
||||||
<label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label>
|
||||||
|
|
|
@ -47,9 +47,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- IF PREVIOUS_PAGE or NEXT_PAGE -->
|
<!-- IF U_PREVIOUS_PAGE or U_NEXT_PAGE -->
|
||||||
<fieldset class="display-options right-box">
|
<fieldset class="display-options right-box">
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ELSE -->{L_PREVIOUS}<!-- ENDIF --> • <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ELSE -->{L_NEXT}<!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ELSE -->{L_PREVIOUS}<!-- ENDIF --> • <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ELSE -->{L_NEXT}<!-- ENDIF -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
|
|
@ -245,12 +245,12 @@
|
||||||
<!-- IF S_QUICK_REPLY -->
|
<!-- IF S_QUICK_REPLY -->
|
||||||
<!-- INCLUDE quickreply_editor.html -->
|
<!-- INCLUDE quickreply_editor.html -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE or NEXT_PAGE -->
|
<!-- IF S_NUM_POSTS > 1 or U_PREVIOUS_PAGE or U_NEXT_PAGE -->
|
||||||
<form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">
|
<form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">
|
||||||
|
|
||||||
<fieldset class="display-options" style="margin-top: 0; ">
|
<fieldset class="display-options" style="margin-top: 0; ">
|
||||||
<!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
<!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
|
||||||
<!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
<!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
|
||||||
<!-- IF not S_IS_BOT -->
|
<!-- IF not S_IS_BOT -->
|
||||||
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
<label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label>
|
||||||
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
<label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR} <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
|
||||||
|
|
39
tests/functional/paging_test.php
Normal file
39
tests/functional/paging_test.php
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package testing
|
||||||
|
* @copyright (c) 2013 phpBB Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group functional
|
||||||
|
*/
|
||||||
|
class phpbb_functional_paging_test extends phpbb_functional_test_case
|
||||||
|
{
|
||||||
|
|
||||||
|
public function test_pagination()
|
||||||
|
{
|
||||||
|
$this->login();
|
||||||
|
|
||||||
|
$post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
|
||||||
|
for ($post_id = 1; $post_id < 20; $post_id++)
|
||||||
|
{
|
||||||
|
$this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post no' . $post_id . ' posted by the testing framework.');
|
||||||
|
}
|
||||||
|
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
|
||||||
|
$this->assertContains('post no9', $crawler->text());
|
||||||
|
$this->assertNotContains('post no19', $crawler->text());
|
||||||
|
|
||||||
|
$next_link = $crawler->filter('#viewtopic > fieldset > a.arrow-right')->attr('href');
|
||||||
|
$crawler = self::request('GET', $next_link);
|
||||||
|
$this->assertContains('post no19', $crawler->text());
|
||||||
|
$this->assertNotContains('post no9', $crawler->text());
|
||||||
|
|
||||||
|
$prev_link = $crawler->filter('#viewtopic > fieldset > a.arrow-left')->attr('href');
|
||||||
|
$crawler = self::request('GET', $prev_link);
|
||||||
|
$this->assertContains('post no9', $crawler->text());
|
||||||
|
$this->assertNotContains('post no19', $crawler->text());
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,105 +32,4 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
|
||||||
$crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
|
$crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
|
||||||
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
|
$this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a topic
|
|
||||||
*
|
|
||||||
* Be sure to login before creating
|
|
||||||
*
|
|
||||||
* @param int $forum_id
|
|
||||||
* @param string $subject
|
|
||||||
* @param string $message
|
|
||||||
* @param array $additional_form_data Any additional form data to be sent in the request
|
|
||||||
* @return array post_id, topic_id
|
|
||||||
*/
|
|
||||||
public function create_topic($forum_id, $subject, $message, $additional_form_data = array())
|
|
||||||
{
|
|
||||||
$posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}";
|
|
||||||
|
|
||||||
$form_data = array_merge(array(
|
|
||||||
'subject' => $subject,
|
|
||||||
'message' => $message,
|
|
||||||
'post' => true,
|
|
||||||
), $additional_form_data);
|
|
||||||
|
|
||||||
return self::submit_post($posting_url, 'POST_TOPIC', $form_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a post
|
|
||||||
*
|
|
||||||
* Be sure to login before creating
|
|
||||||
*
|
|
||||||
* @param int $forum_id
|
|
||||||
* @param string $subject
|
|
||||||
* @param string $message
|
|
||||||
* @param array $additional_form_data Any additional form data to be sent in the request
|
|
||||||
* @return array post_id, topic_id
|
|
||||||
*/
|
|
||||||
public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array())
|
|
||||||
{
|
|
||||||
$posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}";
|
|
||||||
|
|
||||||
$form_data = array_merge(array(
|
|
||||||
'subject' => $subject,
|
|
||||||
'message' => $message,
|
|
||||||
'post' => true,
|
|
||||||
), $additional_form_data);
|
|
||||||
|
|
||||||
return self::submit_post($posting_url, 'POST_REPLY', $form_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper for submitting posts
|
|
||||||
*
|
|
||||||
* @param string $posting_url
|
|
||||||
* @param string $posting_contains
|
|
||||||
* @param array $form_data
|
|
||||||
* @return array post_id, topic_id
|
|
||||||
*/
|
|
||||||
protected function submit_post($posting_url, $posting_contains, $form_data)
|
|
||||||
{
|
|
||||||
$this->add_lang('posting');
|
|
||||||
|
|
||||||
$crawler = self::request('GET', $posting_url);
|
|
||||||
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
|
|
||||||
|
|
||||||
$hidden_fields = array(
|
|
||||||
$crawler->filter('[type="hidden"]')->each(function ($node, $i) {
|
|
||||||
return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value'));
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($hidden_fields as $fields)
|
|
||||||
{
|
|
||||||
foreach($fields as $field)
|
|
||||||
{
|
|
||||||
$form_data[$field['name']] = $field['value'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened)
|
|
||||||
// is not at least 2 seconds before submission, cancel the form
|
|
||||||
$form_data['lastclick'] = 0;
|
|
||||||
|
|
||||||
// I use a request because the form submission method does not allow you to send data that is not
|
|
||||||
// contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs)
|
|
||||||
// Instead, I send it as a request with the submit button "post" set to true.
|
|
||||||
$crawler = self::request('POST', $posting_url, $form_data);
|
|
||||||
$this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text());
|
|
||||||
|
|
||||||
$url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri();
|
|
||||||
|
|
||||||
$matches = $topic_id = $post_id = false;
|
|
||||||
preg_match_all('#&t=([0-9]+)(&p=([0-9]+))?#', $url, $matches);
|
|
||||||
|
|
||||||
$topic_id = (int) (isset($matches[1][0])) ? $matches[1][0] : 0;
|
|
||||||
$post_id = (int) (isset($matches[3][0])) ? $matches[3][0] : 0;
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'topic_id' => $topic_id,
|
|
||||||
'post_id' => $post_id,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
require_once dirname(__FILE__) . '/testable_factory.php';
|
require_once dirname(__FILE__) . '/testable_factory.php';
|
||||||
|
|
||||||
class phpbb_session_init_test extends phpbb_database_test_case
|
class phpbb_session_creation_test extends phpbb_database_test_case
|
||||||
{
|
{
|
||||||
public function getDataSet()
|
public function getDataSet()
|
||||||
{
|
{
|
||||||
|
@ -34,10 +34,11 @@ class phpbb_session_init_test extends phpbb_database_test_case
|
||||||
$this->assertSqlResultEquals(
|
$this->assertSqlResultEquals(
|
||||||
array(array('session_user_id' => 3)),
|
array(array('session_user_id' => 3)),
|
||||||
$sql,
|
$sql,
|
||||||
'Check if exacly one session for user id 3 was created'
|
'Check if exactly one session for user id 3 was created'
|
||||||
);
|
);
|
||||||
|
|
||||||
$cookie_expire = $session->time_now + 31536000; // default is one year
|
$one_year_in_seconds = 365 * 24 * 60 * 60;
|
||||||
|
$cookie_expire = $session->time_now + $one_year_in_seconds;
|
||||||
|
|
||||||
$session->check_cookies($this, array(
|
$session->check_cookies($this, array(
|
||||||
'u' => array(null, $cookie_expire),
|
'u' => array(null, $cookie_expire),
|
|
@ -736,4 +736,105 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a topic
|
||||||
|
*
|
||||||
|
* Be sure to login before creating
|
||||||
|
*
|
||||||
|
* @param int $forum_id
|
||||||
|
* @param string $subject
|
||||||
|
* @param string $message
|
||||||
|
* @param array $additional_form_data Any additional form data to be sent in the request
|
||||||
|
* @return array post_id, topic_id
|
||||||
|
*/
|
||||||
|
public function create_topic($forum_id, $subject, $message, $additional_form_data = array())
|
||||||
|
{
|
||||||
|
$posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}";
|
||||||
|
|
||||||
|
$form_data = array_merge(array(
|
||||||
|
'subject' => $subject,
|
||||||
|
'message' => $message,
|
||||||
|
'post' => true,
|
||||||
|
), $additional_form_data);
|
||||||
|
|
||||||
|
return self::submit_post($posting_url, 'POST_TOPIC', $form_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a post
|
||||||
|
*
|
||||||
|
* Be sure to login before creating
|
||||||
|
*
|
||||||
|
* @param int $forum_id
|
||||||
|
* @param string $subject
|
||||||
|
* @param string $message
|
||||||
|
* @param array $additional_form_data Any additional form data to be sent in the request
|
||||||
|
* @return array post_id, topic_id
|
||||||
|
*/
|
||||||
|
public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array())
|
||||||
|
{
|
||||||
|
$posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}";
|
||||||
|
|
||||||
|
$form_data = array_merge(array(
|
||||||
|
'subject' => $subject,
|
||||||
|
'message' => $message,
|
||||||
|
'post' => true,
|
||||||
|
), $additional_form_data);
|
||||||
|
|
||||||
|
return self::submit_post($posting_url, 'POST_REPLY', $form_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper for submitting posts
|
||||||
|
*
|
||||||
|
* @param string $posting_url
|
||||||
|
* @param string $posting_contains
|
||||||
|
* @param array $form_data
|
||||||
|
* @return array post_id, topic_id
|
||||||
|
*/
|
||||||
|
protected function submit_post($posting_url, $posting_contains, $form_data)
|
||||||
|
{
|
||||||
|
$this->add_lang('posting');
|
||||||
|
|
||||||
|
$crawler = self::request('GET', $posting_url);
|
||||||
|
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
|
||||||
|
|
||||||
|
$hidden_fields = array(
|
||||||
|
$crawler->filter('[type="hidden"]')->each(function ($node, $i) {
|
||||||
|
return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value'));
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($hidden_fields as $fields)
|
||||||
|
{
|
||||||
|
foreach($fields as $field)
|
||||||
|
{
|
||||||
|
$form_data[$field['name']] = $field['value'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened)
|
||||||
|
// is not at least 2 seconds before submission, cancel the form
|
||||||
|
$form_data['lastclick'] = 0;
|
||||||
|
|
||||||
|
// I use a request because the form submission method does not allow you to send data that is not
|
||||||
|
// contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs)
|
||||||
|
// Instead, I send it as a request with the submit button "post" set to true.
|
||||||
|
$crawler = self::request('POST', $posting_url, $form_data);
|
||||||
|
$this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text());
|
||||||
|
|
||||||
|
$url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri();
|
||||||
|
|
||||||
|
$matches = $topic_id = $post_id = false;
|
||||||
|
preg_match_all('#&t=([0-9]+)(&p=([0-9]+))?#', $url, $matches);
|
||||||
|
|
||||||
|
$topic_id = (int) (isset($matches[1][0])) ? $matches[1][0] : 0;
|
||||||
|
$post_id = (int) (isset($matches[3][0])) ? $matches[3][0] : 0;
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'topic_id' => $topic_id,
|
||||||
|
'post_id' => $post_id,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue