mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Confirm in moderator control panel works on Deletes
git-svn-id: file:///svn/phpbb/trunk@619 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
6a8674bd2d
commit
bfcabd3df2
2 changed files with 142 additions and 79 deletions
|
@ -218,6 +218,7 @@ $lang['Post_Annoucement'] = "Announcement";
|
||||||
$lang['Post_Sticky'] = "Sticky";
|
$lang['Post_Sticky'] = "Sticky";
|
||||||
$lang['Options'] = "Options";
|
$lang['Options'] = "Options";
|
||||||
|
|
||||||
|
$lang['Confirm'] = "Confirm";
|
||||||
$lang['Confirm_delete'] = "Are you sure you want to delete this post?";
|
$lang['Confirm_delete'] = "Are you sure you want to delete this post?";
|
||||||
$lang['Submit_post'] = "Submit Post";
|
$lang['Submit_post'] = "Submit Post";
|
||||||
$lang['Preview'] = "Preview";
|
$lang['Preview'] = "Preview";
|
||||||
|
@ -491,6 +492,10 @@ $lang['Topics_Removed'] = "The selected topics have been successfully removed fr
|
||||||
$lang['Topics_Locked'] = "The selected topics have been locked";
|
$lang['Topics_Locked'] = "The selected topics have been locked";
|
||||||
$lang['Topics_Unlocked'] = "The selected topics have been unlocked";
|
$lang['Topics_Unlocked'] = "The selected topics have been unlocked";
|
||||||
$lang['Return_to_modcp'] = "to return to the moderator control panel";
|
$lang['Return_to_modcp'] = "to return to the moderator control panel";
|
||||||
|
$lang['Confirm_delete_topic'] = "Are you sure you want to remove this topic(s)?";
|
||||||
|
$lang['Confirm_lock_topic'] = "Are you sure you want to lock this topic(s)?";
|
||||||
|
$lang['Confirm_unlock_topic'] = "Are you sure you want to unlock this topic(s)?";
|
||||||
|
$lang['Confirm_move_topic'] = "Are you sure you want to move this topic(s)?";
|
||||||
|
|
||||||
//
|
//
|
||||||
// Old format ... _DON'T_add_any_ new entries here!!
|
// Old format ... _DON'T_add_any_ new entries here!!
|
||||||
|
|
|
@ -98,14 +98,29 @@ if(!$is_mod)
|
||||||
message_die(CRITICAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised'], __LINE__, __FILE__);
|
message_die(CRITICAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised'], __LINE__, __FILE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if user did or did not confirm
|
||||||
|
// If they did not, forward them to the last page they were on
|
||||||
|
//
|
||||||
|
$confirm = ($HTTP_POST_VARS['confirm']) ? 1 : 0;
|
||||||
|
if($HTTP_POST_VARS['not_confirm'])
|
||||||
|
{
|
||||||
|
header("Location: index.$phpEx");
|
||||||
|
}
|
||||||
|
|
||||||
include('includes/page_header.'.$phpEx);
|
include('includes/page_header.'.$phpEx);
|
||||||
|
|
||||||
|
// Set template files
|
||||||
|
$template->set_filenames(array("body" => "modcp_body.tpl", "confirm" => "confirm.tpl"));
|
||||||
|
|
||||||
$mode = ($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
|
$mode = ($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
|
||||||
$delete = ($HTTP_POST_VARS['delete']) ? 1 : 0;
|
$delete = ($HTTP_POST_VARS['delete']) ? 1 : 0;
|
||||||
$move = ($HTTP_POST_VARS['move']) ? 1 : 0;
|
$move = ($HTTP_POST_VARS['move']) ? 1 : 0;
|
||||||
$lock = ($HTTP_POST_VARS['lock']) ? 1 : 0;
|
$lock = ($HTTP_POST_VARS['lock']) ? 1 : 0;
|
||||||
$unlock = ($HTTP_POST_VARS['unlock']) ? 1 : 0;
|
$unlock = ($HTTP_POST_VARS['unlock']) ? 1 : 0;
|
||||||
|
|
||||||
|
|
||||||
if(!$mode)
|
if(!$mode)
|
||||||
{
|
{
|
||||||
if($delete)
|
if($delete)
|
||||||
|
@ -129,6 +144,8 @@ if(!$mode)
|
||||||
switch($mode)
|
switch($mode)
|
||||||
{
|
{
|
||||||
case 'delete':
|
case 'delete':
|
||||||
|
if($confirm)
|
||||||
|
{
|
||||||
if($HTTP_POST_VARS['preform_op'])
|
if($HTTP_POST_VARS['preform_op'])
|
||||||
{
|
{
|
||||||
$topics = $HTTP_POST_VARS['preform_op'];
|
$topics = $HTTP_POST_VARS['preform_op'];
|
||||||
|
@ -220,7 +237,33 @@ switch($mode)
|
||||||
|
|
||||||
$msg = $lang['Topics_Removed'] . "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp'];
|
$msg = $lang['Topics_Removed'] . "<br />" . "<a href=\"".append_sid("modcp.$phpEx?".POST_FORUM_URL."=$forum_id")."\">". $lang['Click'] . " " . $lang['Here'] ."</a> " . $lang['Return_to_modcp'];
|
||||||
message_die(GENERAL_MESSAGE, $msg);
|
message_die(GENERAL_MESSAGE, $msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'"><input type="hidden" name="'.POST_FORUM_URL.'" value="'.$forum_id.'">';
|
||||||
|
if($HTTP_POST_VARS['preform_op'])
|
||||||
|
{
|
||||||
|
$topics = $HTTP_POST_VARS['preform_op'];
|
||||||
|
for($x = 0; $x < count($topics); $x++)
|
||||||
|
{
|
||||||
|
$hidden_fields .= '<input type="hidden" name="preform_op[]" value="'.$topics[$x].'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$hidden_fields .= '<input type="hidden" name="'.POST_TOPIC_URL.'" value="'.$topic_id.'">';
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->assign_vars(array("MESSAGE_TITLE" => $lang['Confirm'],
|
||||||
|
"MESSAGE_TEXT" => $lang['Confirm_delete_topic'],
|
||||||
|
"L_YES" => $lang['Yes'],
|
||||||
|
"L_NO" => $lang['No'],
|
||||||
|
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
|
||||||
|
"HIDDEN_FIELDS" => $hidden_fields));
|
||||||
|
$template->pparse("confirm");
|
||||||
|
include('includes/page_tail.'.$phpEx);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'move':
|
case 'move':
|
||||||
echo 'Move';
|
echo 'Move';
|
||||||
|
@ -288,9 +331,24 @@ switch($mode)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'split':
|
||||||
|
if($HTTP_POST_VARS['split_posts'])
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
$template->set_filenames(array("body" => "modcp_body.tpl"));
|
|
||||||
$template->assign_vars(array("L_MOD_EXPLAIN" => $lang['ModCp_Explain'],
|
$template->assign_vars(array("L_MOD_EXPLAIN" => $lang['ModCp_Explain'],
|
||||||
"L_SELECT" => $lang['Select'],
|
"L_SELECT" => $lang['Select'],
|
||||||
"L_DELETE" => $lang['Delete'],
|
"L_DELETE" => $lang['Delete'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue