mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[ticket/15942] Optimize count
PHPBB3-15942
This commit is contained in:
parent
3f4b7059cb
commit
a925605b88
1 changed files with 6 additions and 4 deletions
|
@ -930,10 +930,11 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
|
||||||
'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', count($topic_ids)),
|
'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', count($topic_ids)),
|
||||||
));
|
));
|
||||||
|
|
||||||
$l_confirm = (count($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
|
$count = count($topic_ids);
|
||||||
|
$l_confirm = $count === 1 ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
|
||||||
if ($only_softdeleted)
|
if ($only_softdeleted)
|
||||||
{
|
{
|
||||||
$l_confirm = array($l_confirm . '_PERMANENTLY', count($topic_ids));
|
$l_confirm = array($l_confirm . '_PERMANENTLY', $count);
|
||||||
$s_hidden_fields['delete_permanent'] = '1';
|
$s_hidden_fields['delete_permanent'] = '1';
|
||||||
}
|
}
|
||||||
else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))
|
else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))
|
||||||
|
@ -1184,10 +1185,11 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
|
||||||
'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', count($post_ids)),
|
'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', count($post_ids)),
|
||||||
));
|
));
|
||||||
|
|
||||||
$l_confirm = (count($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';
|
$count = count($post_ids);
|
||||||
|
$l_confirm = $count === 1 ? 'DELETE_POST' : 'DELETE_POSTS';
|
||||||
if ($only_softdeleted)
|
if ($only_softdeleted)
|
||||||
{
|
{
|
||||||
$l_confirm = array($l_confirm . '_PERMANENTLY', (int) count($post_ids));
|
$l_confirm = array($l_confirm . '_PERMANENTLY', $count);
|
||||||
$s_hidden_fields['delete_permanent'] = '1';
|
$s_hidden_fields['delete_permanent'] = '1';
|
||||||
}
|
}
|
||||||
else if (!$auth->acl_get('m_softdelete', $forum_id))
|
else if (!$auth->acl_get('m_softdelete', $forum_id))
|
||||||
|
|
Loading…
Add table
Reference in a new issue