diff options
Diffstat (limited to 'phpBB/mcp.php')
-rw-r--r-- | phpBB/mcp.php | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 313b24b6f1..3555eb3b48 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -186,7 +186,7 @@ if ($quickmod) // If needed, the flag can be set to true within event listener // to indicate that the action was handled properly // and to pass by the trigger_error() call below - $break = false; + $is_valid_action = false; /** * This event allows you to add custom quickmod options @@ -194,12 +194,13 @@ if ($quickmod) * @event core.modify_quickmod_options * @var object module Instance of module system class * @var string action Quickmod option - * @var bool break Flag indicating if the action was handled properly + * @var bool is_valid_action Flag indicating if the action was handled properly * @since 3.1.0-a4 */ - extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_options', compact(array('module', 'action', 'break')))); + $vars = array('module', 'action', 'is_valid_action'); + extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_options', compact($vars))); - if (!$break) + if (!$is_valid_action) { trigger_error($user->lang('QUICKMOD_ACTION_NOT_ALLOWED', $action), E_USER_ERROR); } @@ -252,6 +253,32 @@ if (!$user_id && $username == '') $module->set_display('warn', 'warn_user', false); } +/** +* This event allows you to set display option for custom MCP modules +* +* @event core.modify_mcp_modules_display_option +* @var p_master module Module system class +* @var string mode MCP mode +* @var int user_id User id +* @var int forum_id Forum id +* @var int topic_id Topic id +* @var int post_id Post id +* @var string username User name +* @var int id Parent module id +* @since 3.1.0-b2 +*/ +$vars = array( + 'module', + 'mode', + 'user_id', + 'forum_id', + 'topic_id', + 'post_id', + 'username', + 'id', +); +extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars))); + // Load and execute the relevant module $module->load_active(); @@ -267,7 +294,7 @@ $template->assign_vars(array( )); // Generate the page, do not display/query online list -$module->display($module->get_page_title(), false); +$module->display($module->get_page_title()); /** * Functions used to generate additional URL paramters @@ -660,7 +687,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, case 'unapproved_posts': case 'deleted_posts': - $visibility_const = ($mode == 'unapproved_posts') ? ITEM_UNAPPROVED : ITEM_DELETED; + $visibility_const = ($mode == 'unapproved_posts') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED; $type = 'posts'; $default_key = 't'; $default_dir = 'd'; @@ -669,7 +696,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sql = 'SELECT COUNT(p.post_id) AS total FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t $where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . ' - AND p.post_visibility = ' . $visibility_const . ' + AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) .' AND t.topic_id = p.topic_id AND t.topic_visibility <> p.post_visibility'; @@ -681,7 +708,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, case 'unapproved_topics': case 'deleted_topics': - $visibility_const = ($mode == 'unapproved_topics') ? ITEM_UNAPPROVED : ITEM_DELETED; + $visibility_const = ($mode == 'unapproved_topics') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED; $type = 'topics'; $default_key = 't'; $default_dir = 'd'; @@ -689,7 +716,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sql = 'SELECT COUNT(topic_id) AS total FROM ' . TOPICS_TABLE . " $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . ' - AND topic_visibility = ' . $visibility_const; + AND ' . $db->sql_in_set('topic_visibility', $visibility_const); if ($min_time) { |