mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12013] Fix functional tests and sniffer issue. [ticket/12013] Clear the jumpbox. [ticket/12013] Add moderator tools icon. [ticket/12013] Remove obsolete jumpbox and quickmod CSS. [ticket/12013] Prevent the dropdown scrollbar from overlapping the content. [ticket/12013] Update to use the new .button class. [ticket/12013] Add missing class to place the buttons on the rightside. [ticket/12013] Use the correct variable for the forum id. [ticket/12013] Use DEFINE instead of Twig's set. [ticket/12013] Use path helper. [ticket/12013] Use new dropdown for quickmod tools and jumpbox.
This commit is contained in:
commit
4558262e2a
17 changed files with 148 additions and 156 deletions
|
@ -1296,6 +1296,10 @@ phpbb.toggleDropdown = function() {
|
|||
else if ((offset + width + 2) > windowWidth) {
|
||||
$this.css('margin-left', (windowWidth - offset - width - 2) + 'px');
|
||||
}
|
||||
|
||||
// Check whether the vertical scrollbar is present.
|
||||
$this.toggleClass('dropdown-nonscroll', this.scrollHeight === $this.innerHeight());
|
||||
|
||||
});
|
||||
var freeSpace = parent.offset().left - 4;
|
||||
|
||||
|
|
|
@ -174,8 +174,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
|
|||
$template->assign_block_vars('jumpbox_forums', array(
|
||||
'FORUM_ID' => ($select_all) ? 0 : -1,
|
||||
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
|
||||
'S_FORUM_COUNT' => $iteration)
|
||||
);
|
||||
'S_FORUM_COUNT' => $iteration,
|
||||
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
|
||||
));
|
||||
|
||||
$iteration++;
|
||||
$display_jumpbox = true;
|
||||
|
@ -188,8 +189,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
|
|||
'S_FORUM_COUNT' => $iteration,
|
||||
'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false,
|
||||
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
|
||||
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false)
|
||||
);
|
||||
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
|
||||
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
|
||||
));
|
||||
|
||||
for ($i = 0; $i < $padding; $i++)
|
||||
{
|
||||
|
@ -1452,16 +1454,19 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
|
|||
/**
|
||||
* Add an option to the quick-mod tools.
|
||||
*
|
||||
* @param string $url The recepting URL for the quickmod actions.
|
||||
* @param string $option The language key for the value of the option.
|
||||
* @param string $lang_string The language string to use.
|
||||
*/
|
||||
function phpbb_add_quickmod_option($option, $lang_string)
|
||||
function phpbb_add_quickmod_option($url, $option, $lang_string)
|
||||
{
|
||||
global $template, $user;
|
||||
global $template, $user, $phpbb_path_helper;
|
||||
|
||||
$lang_string = $user->lang($lang_string);
|
||||
$template->assign_block_vars('quickmod', array(
|
||||
'VALUE' => $option,
|
||||
'TITLE' => $lang_string,
|
||||
'VALUE' => $option,
|
||||
'TITLE' => $lang_string,
|
||||
'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -356,37 +356,6 @@ $('.display_post').click(function(e) {
|
|||
$('#post_hidden' + post_id).hide();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This AJAXifies the quick-mod tools. The reason it cannot be a standard
|
||||
* callback / data attribute is that it requires filtering - some of the options
|
||||
* can be ajaxified, while others cannot.
|
||||
*/
|
||||
phpbb.ajaxify({
|
||||
selector: '#quickmodform',
|
||||
refresh: true,
|
||||
filter: function (data) {
|
||||
var action = $('#quick-mod-select').val();
|
||||
|
||||
if (action === 'make_normal') {
|
||||
return $(this).find('select option[value="make_global"]').length > 0;
|
||||
} else if (action === 'lock' || action === 'unlock') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#quick-mod-select').change(function () {
|
||||
$('#quickmodform').submit();
|
||||
});
|
||||
|
||||
$('#delete_permanent').click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$('#delete_reason').hide();
|
||||
|
|
|
@ -10,24 +10,22 @@
|
|||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_JUMPBOX -->
|
||||
<form method="get" id="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(this.f.value == -1){return false;}">
|
||||
|
||||
<!-- IF $CUSTOM_FIELDSET_CLASS -->
|
||||
<fieldset class="{$CUSTOM_FIELDSET_CLASS}">
|
||||
<!-- ELSE -->
|
||||
<fieldset class="jumpbox">
|
||||
<!-- ENDIF -->
|
||||
{HIDDEN_FIELDS_FOR_JUMPBOX}
|
||||
<label for="f" accesskey="j"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</label>
|
||||
<select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
|
||||
<div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_END}<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox">
|
||||
<span title="<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->" class="dropdown-trigger button dropdown-select">
|
||||
<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->
|
||||
</span>
|
||||
<div class="dropdown hidden">
|
||||
<div class="pointer"><div class="pointer-inner"></div></div>
|
||||
<ul class="dropdown-contents">
|
||||
<!-- BEGIN jumpbox_forums -->
|
||||
<!-- IF jumpbox_forums.S_FORUM_COUNT == 1 --><option value="-1">------------------</option><!-- ENDIF -->
|
||||
<option value="{jumpbox_forums.FORUM_ID}"{jumpbox_forums.SELECTED}><!-- BEGIN level --> <!-- END level -->{jumpbox_forums.FORUM_NAME}</option>
|
||||
<!-- IF jumpbox_forums.FORUM_ID neq -1 -->
|
||||
<li><!-- BEGIN level --> <!-- END level --><a href="{jumpbox_forums.LINK}">{jumpbox_forums.FORUM_NAME}</a></li>
|
||||
<!-- ENDIF -->
|
||||
<!-- END jumpbox_forums -->
|
||||
</select>
|
||||
<input type="submit" value="{L_GO}" class="button2" />
|
||||
</fieldset>
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ELSE -->
|
||||
<br /><br />
|
||||
|
|
|
@ -350,6 +350,21 @@
|
|||
|
||||
<!-- INCLUDE viewtopic_topic_tools.html -->
|
||||
|
||||
<!-- IF .quickmod -->
|
||||
<div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_BEGIN} dropdown-up dropdown-{S_CONTENT_FLOW_END} dropdown-button-control" id="quickmod">
|
||||
<span title="{L_QUICK_MOD}" class="dropdown-trigger button icon-button modtools-icon dropdown-select">{L_QUICK_MOD}</span>
|
||||
<div class="dropdown hidden">
|
||||
<div class="pointer"><div class="pointer-inner"></div></div>
|
||||
<ul class="dropdown-contents">
|
||||
<!-- BEGIN quickmod -->
|
||||
<!-- DEFINE $QUICKMOD_AJAX = (quickmod.VALUE in ['lock', 'unlock', 'delete_topic', 'restore_topic', 'make_normal', 'make_sticky', 'make_announce', 'make_global']) -->
|
||||
<li><a href="{quickmod.LINK}"<!-- IF $QUICKMOD_AJAX --> data-ajax="true" data-refresh="true"<!-- ENDIF -->>{quickmod.TITLE}</a></li>
|
||||
<!-- END quickmod -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .pagination or TOTAL_POSTS -->
|
||||
<div class="pagination">
|
||||
{TOTAL_POSTS}
|
||||
|
@ -366,21 +381,6 @@
|
|||
<!-- EVENT viewtopic_body_footer_before -->
|
||||
<!-- INCLUDE jumpbox.html -->
|
||||
|
||||
<!-- IF .quickmod -->
|
||||
<form method="post" action="{S_MOD_ACTION}" id="quickmodform">
|
||||
<fieldset class="quickmod">
|
||||
<label for="quick-mod-select">{L_QUICK_MOD}{L_COLON}</label>
|
||||
<select name="action" id="quick-mod-select">
|
||||
<!-- BEGIN quickmod -->
|
||||
<option value="{quickmod.VALUE}">{quickmod.TITLE}</option>
|
||||
<!-- END quickmod -->
|
||||
</select>
|
||||
<input type="submit" value="{L_GO}" class="button2" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_ONLINE_LIST -->
|
||||
<div class="stat-block online-list">
|
||||
<h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.icon-button.dropdown-select {
|
||||
padding-right: 28px;
|
||||
.dropdown-select {
|
||||
padding-right: 24px;
|
||||
}
|
||||
|
||||
.icon-button:before {
|
||||
|
@ -35,6 +35,10 @@
|
|||
width: 12px;
|
||||
}
|
||||
|
||||
.dropdown-select.icon-button:before {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.dropdown-select:after {
|
||||
background-position: -103px 10px;
|
||||
border-left: 1px solid;
|
||||
|
@ -58,6 +62,10 @@
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#jumpbox .dropdown-select {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Big button images */
|
||||
.reply-icon:before, .pmreply-icon:before { background-position: -20px 0; }
|
||||
.reply-icon:hover:before, .pmreply-icon:hover:before { background-position: -20px -20px; }
|
||||
|
@ -73,7 +81,11 @@
|
|||
.forwardpm-icon:before { background-position: -40px 0; }
|
||||
.forwardpm-icon:hover:before { background-position: -40px -20px; }
|
||||
|
||||
.tools-icon:before {
|
||||
.modtools-icon {
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.tools-icon:before, .modtools-icon:before {
|
||||
background-position: -80px 0;
|
||||
height: 16px;
|
||||
margin-top: 2px;
|
||||
|
@ -83,6 +95,10 @@
|
|||
.dropdown-visible .tools-icon:before,
|
||||
.nojs .dropdown-container:hover .tools-icon:before { background-position: -80px -20px; }
|
||||
|
||||
.modtools-icon:before { background-position: -225px 0; }
|
||||
.dropdown-visible .modtools-icon:before,
|
||||
.nojs .dropdown-container:hover .modtools-icon:before { background-position: -225px -20px; }
|
||||
|
||||
/* Icon images
|
||||
---------------------------------------- */
|
||||
.small-icon {
|
||||
|
|
|
@ -614,6 +614,10 @@ Colours and backgrounds for buttons.css
|
|||
color: #D31141;
|
||||
}
|
||||
|
||||
.dropdown-select, .dropdown-select:visited {
|
||||
color: #536482;
|
||||
}
|
||||
|
||||
.button:hover, .dropdown-visible .dropdown-select, .nojs .dropdown-container:hover .dropdown-select {
|
||||
border-color: #0a8ed0;
|
||||
background-image: -moz-linear-gradient(top, #E9E9E9, #FFFFFF);
|
||||
|
|
|
@ -477,6 +477,14 @@ ul.linklist.bulletin > li.no-bulletin:before {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.dropdown-container-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-container-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.nojs .dropdown-container:hover .dropdown {
|
||||
display: block !important;
|
||||
}
|
||||
|
@ -595,6 +603,14 @@ ul.linklist.bulletin > li.no-bulletin:before {
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
.dropdown-contents > li {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.dropdown-nonscroll > li {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.dropdown li:first-child, .dropdown li.separator + li, .dropdown li li {
|
||||
border-top: 0;
|
||||
}
|
||||
|
@ -1089,6 +1105,14 @@ form > p.post-notice strong {
|
|||
line-height: 20px;
|
||||
}
|
||||
|
||||
#jumpbox {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.stat-block {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#top {
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
|
|
|
@ -201,24 +201,6 @@ fieldset.forum-selection2 {
|
|||
float: right;
|
||||
}
|
||||
|
||||
/* Jumpbox */
|
||||
fieldset.jumpbox {
|
||||
text-align: right;
|
||||
margin-top: 15px;
|
||||
min-height: 2.5em;
|
||||
}
|
||||
|
||||
fieldset.jumpbox select {
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
fieldset.quickmod {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
height: 2.5em;
|
||||
}
|
||||
|
||||
/* Submit button fieldset */
|
||||
fieldset.submit-buttons {
|
||||
text-align: center;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 6.3 KiB |
|
@ -523,6 +523,19 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']);
|
|||
// Quick mod tools
|
||||
$allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false;
|
||||
|
||||
$s_quickmod_action = append_sid(
|
||||
"{$phpbb_root_path}mcp.$phpEx",
|
||||
array(
|
||||
'f' => $forum_id,
|
||||
't' => $topic_id,
|
||||
'start' => $start,
|
||||
'quickmod' => 1,
|
||||
'redirect' => urlencode(str_replace('&', '&', $viewtopic_url)),
|
||||
),
|
||||
true,
|
||||
$user->session_id
|
||||
);
|
||||
|
||||
$quickmod_array = array(
|
||||
// 'key' => array('LANG_KEY', $userHasPermissions),
|
||||
|
||||
|
@ -546,7 +559,7 @@ foreach($quickmod_array as $option => $qm_ary)
|
|||
{
|
||||
if (!empty($qm_ary[1]))
|
||||
{
|
||||
phpbb_add_quickmod_option($option, $qm_ary[0]);
|
||||
phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -631,7 +644,7 @@ $template->assign_vars(array(
|
|||
'S_SELECT_SORT_DAYS' => $s_limit_days,
|
||||
'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true,
|
||||
'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")),
|
||||
'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . "&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),
|
||||
'S_MOD_ACTION' => $s_quickmod_action,
|
||||
|
||||
'L_RETURN_TO_FORUM' => $user->lang('RETURN_TO', $topic_data['forum_name']),
|
||||
'S_VIEWTOPIC' => true,
|
||||
|
|
|
@ -205,12 +205,8 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||
),
|
||||
));
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
|
||||
|
||||
$this->add_lang('posting');
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('delete_topic');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Download Topic #1'], 'DELETE_TOPIC');
|
||||
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
|
|
|
@ -619,12 +619,8 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
|
|||
),
|
||||
));
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
|
||||
|
||||
$this->add_lang('posting');
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('delete_topic');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Feeds #1 - Topic #2'], 'DELETE_TOPIC');
|
||||
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
|
|
|
@ -20,18 +20,16 @@ class phpbb_functional_jumpbox_test extends phpbb_functional_test_case
|
|||
{
|
||||
$this->login();
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}");
|
||||
$form = $crawler->filter('#quickmodform')->selectButton($this->lang('GO'))->form(array(
|
||||
'action' => 'merge_topic',
|
||||
));
|
||||
$this->crawler = $this->get_quickmod_page(1, 'MERGE_TOPIC');
|
||||
$this->check_valid_jump('Your first forum');
|
||||
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('FORUM') . ': Your first forum', $crawler->filter('#cp-main h2')->text());
|
||||
$form = $crawler->filter('#jumpbox')->selectButton($this->lang('GO'))->form(array(
|
||||
'f' => 1,
|
||||
));
|
||||
$link = $this->crawler->filter('#jumpbox')->selectLink('Your first category')->link()->getUri();
|
||||
$this->crawler = self::request('GET', substr($link, strpos($link, 'mcp.')));
|
||||
$this->check_valid_jump('Your first category');
|
||||
}
|
||||
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContains($this->lang('FORUM') . ': Your first category', $crawler->filter('#cp-main h2')->text());
|
||||
protected function check_valid_jump($forum)
|
||||
{
|
||||
$this->assertContains($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,11 +35,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
|||
public function test_handle_quickmod($crawler)
|
||||
{
|
||||
// Test moving a post
|
||||
$form = $crawler->selectButton('Go')->eq(1)->form();
|
||||
$form['action']->select('merge');
|
||||
$crawler = self::submit($form);
|
||||
|
||||
return $crawler;
|
||||
return $this->get_quickmod_page(0, 'MERGE_POSTS', $crawler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -186,11 +186,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
'forum_last_post_id' => 0,
|
||||
), 'before moving #2');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('move');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC');
|
||||
$this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
|
@ -261,12 +257,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
|
||||
), 'before softdeleting #2');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
|
||||
$this->add_lang('posting');
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('delete_topic');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'DELETE_TOPIC');
|
||||
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
|
@ -336,11 +328,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
'forum_last_post_id' => 0,
|
||||
), 'before moving #2');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('move');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC');
|
||||
$this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
|
@ -484,12 +472,9 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
'forum_last_post_id' => 0,
|
||||
), 'before splitting #2');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'SPLIT_TOPIC');
|
||||
|
||||
$this->add_lang('mcp');
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('split');
|
||||
$crawler = self::submit($form);
|
||||
$this->assertContainsLang('SPLIT_TOPIC_EXPLAIN', $crawler->text());
|
||||
|
||||
$form = $crawler->selectButton('Submit')->form(array(
|
||||
|
@ -546,12 +531,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
),
|
||||
));
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #2']}&sid={$this->sid}");
|
||||
|
||||
$form = $crawler->selectButton('Go')->eq(1)->form();
|
||||
$form['action']->select('move');
|
||||
$crawler = self::submit($form);
|
||||
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2'], 'MOVE_TOPIC');
|
||||
$form = $crawler->selectButton('Yes')->form();
|
||||
$form['to_forum_id']->select($this->data['forums']['Soft Delete #1']);
|
||||
$crawler = self::submit($form);
|
||||
|
@ -605,9 +585,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
$this->assertContainsLang('BOOKMARK_ADDED', $crawler_bookmark->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
$form = $crawler->selectButton('Go')->eq(1)->form();
|
||||
$form['action']->select('merge_topic');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2'], 'MERGE_TOPIC', $crawler);
|
||||
$this->assertContainsLang('SELECT_MERGE', $crawler->text());
|
||||
|
||||
$crawler = self::request('GET', "mcp.php?f={$this->data['forums']['Soft Delete #1']}&t={$this->data['topics']['Soft Delete Topic #2']}&i=main&mode=forum_view&action=merge_topic&to_topic_id={$this->data['topics']['Soft Delete Topic #1']}");
|
||||
|
@ -670,12 +648,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
|
|||
'forum_last_post_id' => 0,
|
||||
), 'before forking #2');
|
||||
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
|
||||
|
||||
$this->add_lang('mcp');
|
||||
$form = $crawler->selectButton('Go')->eq(2)->form();
|
||||
$form['action']->select('fork');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'FORK_TOPIC');
|
||||
$this->assertContainsLang('FORK_TOPIC', $crawler->text());
|
||||
|
||||
$form = $crawler->selectButton('Yes')->form();
|
||||
|
|
|
@ -971,12 +971,8 @@ class phpbb_functional_test_case extends phpbb_mink_test_case
|
|||
*/
|
||||
public function delete_topic($topic_id)
|
||||
{
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
|
||||
|
||||
$this->add_lang('posting');
|
||||
$form = $crawler->selectButton('Go')->eq(1)->form();
|
||||
$form['action']->select('delete_topic');
|
||||
$crawler = self::submit($form);
|
||||
$crawler = $this->get_quickmod_page($topic_id, 'DELETE_TOPIC');
|
||||
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
|
||||
|
||||
$this->add_lang('mcp');
|
||||
|
@ -1067,4 +1063,25 @@ class phpbb_functional_test_case extends phpbb_mink_test_case
|
|||
|
||||
return $manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quickmod page
|
||||
*
|
||||
* @param int $topic_id
|
||||
* @param string $action Language key for the quickmod action
|
||||
* @param Symfony\Component\DomCrawler\Crawler Optional crawler object to use instead of creating new one.
|
||||
* @return Symfony\Component\DomCrawler\Crawler
|
||||
*/
|
||||
public function get_quickmod_page($topic_id, $action, $crawler = false)
|
||||
{
|
||||
$this->add_lang('viewtopic');
|
||||
|
||||
if ($crawler === false)
|
||||
{
|
||||
$crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
|
||||
}
|
||||
$link = $crawler->filter('#quickmod')->selectLink($this->lang($action))->link()->getUri();
|
||||
|
||||
return self::request('GET', substr($link, strpos($link, 'mcp.')));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue