Confirm works with lock/unlock now too. Next up, move and split

git-svn-id: file:///svn/phpbb/trunk@620 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson 2001-07-10 23:25:33 +00:00
parent bfcabd3df2
commit 777f847473
2 changed files with 105 additions and 46 deletions

View file

@ -492,10 +492,10 @@ $lang['Topics_Removed'] = "The selected topics have been successfully removed fr
$lang['Topics_Locked'] = "The selected topics have been locked";
$lang['Topics_Unlocked'] = "The selected topics have been unlocked";
$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)?";
$lang['Confirm_delete_topic'] = "Are you sure you want to remove the selected topic(s)?";
$lang['Confirm_lock_topic'] = "Are you sure you want to lock the selected topic(s)?";
$lang['Confirm_unlock_topic'] = "Are you sure you want to unlock the selected topic(s)?";
$lang['Confirm_move_topic'] = "Are you sure you want to move the selected topic(s)?";
//
// Old format ... _DON'T_add_any_ new entries here!!

View file

@ -270,6 +270,8 @@ switch($mode)
break;
case 'lock':
if($confirm)
{
if($HTTP_POST_VARS['preform_op'])
{
$topics = $HTTP_POST_VARS['preform_op'];
@ -298,9 +300,38 @@ switch($mode)
$msg = $lang['Topics_Locked'] . "<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);
}
}
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_lock_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;
case 'unlock':
if($confirm)
{
if($HTTP_POST_VARS['preform_op'])
{
$topics = $HTTP_POST_VARS['preform_op'];
@ -329,6 +360,34 @@ switch($mode)
$msg = $lang['Topics_Unlocked'] . "<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);
}
}
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_unlock_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;
case 'split':