phpBB

Code Changes

File: includes/mcp/mcp_main.php

  Unmodified   Added   Modified   Removed
Line 28Line 28
	var $p_master;
var $u_action;


	var $p_master;
var $u_action;


	function __construct(&$p_master)

	function __construct($p_master)

	{

	{

		$this->p_master = &$p_master;

		$this->p_master = $p_master;

	}

function main($id, $mode)

	}

function main($id, $mode)

Line 40Line 40
		global $phpbb_dispatcher;

$quickmod = ($mode == 'quickmod') ? true : false;

		global $phpbb_dispatcher;

$quickmod = ($mode == 'quickmod') ? true : false;

 

/**
* Event to perform additional actions before an MCP action is executed.
*
* @event core.mcp_main_before
* @var string action The action that is about to be performed
* @var string mode The mode in which the MCP is accessed, e.g. front, forum_view, topic_view, post_details, quickmod
* @var boolean quickmod Whether or not the action is performed via QuickMod
* @since 3.2.8-RC1
*/
$vars = [
'action',
'mode',
'quickmod',
];
extract($phpbb_dispatcher->trigger_event('core.mcp_main_before', compact($vars)));


switch ($action)
{


switch ($action)
{

Line 174Line 190
		switch ($mode)
{
case 'front':

		switch ($mode)
{
case 'front':

 
				if (!function_exists('mcp_front_view'))
{

				include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);

				include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx);

 
				}


$user->add_lang('acp/common');



$user->add_lang('acp/common');


Line 185Line 204
			break;

case 'forum_view':

			break;

case 'forum_view':

 
				if (!function_exists('mcp_forum_view'))
{

				include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);

				include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx);

 
				}


$user->add_lang('viewforum');



$user->add_lang('viewforum');


Line 208Line 230
			break;

case 'topic_view':

			break;

case 'topic_view':

 
				if (!function_exists('mcp_topic_view'))
{

				include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);

				include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx);

 
				}


mcp_topic_view($id, $mode, $action);



mcp_topic_view($id, $mode, $action);


Line 217Line 242
			break;

case 'post_details':

			break;

case 'post_details':

 
				if (!function_exists('mcp_post_details'))
{

				include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);

				include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx);

 
				}


mcp_post_details($id, $mode, $action);



mcp_post_details($id, $mode, $action);


Line 366Line 394
*/
function change_topic_type($action, $topic_ids)
{

*/
function change_topic_type($action, $topic_ids)
{

	global $user, $db, $request, $phpbb_log;

	global $user, $db, $request, $phpbb_log, $phpbb_dispatcher;


switch ($action)
{


switch ($action)
{

Line 414Line 442

if (confirm_box(true))
{


if (confirm_box(true))
{

 

/**
* Perform additional actions before changing topic(s) type
*
* @event core.mcp_change_topic_type_before
* @var int new_topic_type The candidated topic type.
* @var int forum_id The forum ID for the topic ID(s).
* @var array topic_ids Array containing the topic ID(s) that will be changed
* @since 3.2.6-RC1
*/
$vars = array(
'new_topic_type',
'forum_id',
'topic_ids',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_change_topic_type_before', compact($vars)));

$db->sql_transaction('begin');


		$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids);

		$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids);

Line 424Line 471
			// Delete topic shadows for global announcements
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);

			// Delete topic shadows for global announcements
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids);

			$db->sql_query($sql);

$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_type = $new_topic_type
WHERE " . $db->sql_in_set('topic_id', $topic_ids);

 
			$db->sql_query($sql);
}

			$db->sql_query($sql);
}

 

$db->sql_transaction('commit');


$success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';



$success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED';


Line 447Line 491
				));
}
}

				));
}
}

 

/**
* Perform additional actions after changing topic types
*
* @event core.mcp_change_topic_type_after
* @var int new_topic_type The newly changed topic type.
* @var int forum_id The forum ID where the newly changed topic type belongs to.
* @var array topic_ids Array containing the topic IDs that have been changed
* @since 3.2.6-RC1
*/
$vars = array(
'new_topic_type',
'forum_id',
'topic_ids',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_change_topic_type_after', compact($vars)));


meta_refresh(2, $redirect);
$message = $user->lang[$success_msg];


meta_refresh(2, $redirect);
$message = $user->lang[$success_msg];

Line 930Line 990
			'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 .= '_PERMANENTLY';

			$l_confirm = array($l_confirm . '_PERMANENTLY', $count);

			$s_hidden_fields['delete_permanent'] = '1';
}
else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))

			$s_hidden_fields['delete_permanent'] = '1';
}
else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))

Line 1184Line 1245
			'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 .= '_PERMANENTLY';

			$l_confirm = array($l_confirm . '_PERMANENTLY', $count);

			$s_hidden_fields['delete_permanent'] = '1';
}
else if (!$auth->acl_get('m_softdelete', $forum_id))

			$s_hidden_fields['delete_permanent'] = '1';
}
else if (!$auth->acl_get('m_softdelete', $forum_id))