aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-08-21 13:06:43 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-08-21 13:06:43 +0200
commitbd6dfee23e0d3f11ff028d4376e73c9c1e770f2a (patch)
tree4b02f5bc0cfc7338455dd2284a6ed39265593456 /phpBB/includes
parent0fcbb40a0e1affcfa07a6d51ce273b73b3a95359 (diff)
downloadforums-bd6dfee23e0d3f11ff028d4376e73c9c1e770f2a.tar
forums-bd6dfee23e0d3f11ff028d4376e73c9c1e770f2a.tar.gz
forums-bd6dfee23e0d3f11ff028d4376e73c9c1e770f2a.tar.bz2
forums-bd6dfee23e0d3f11ff028d4376e73c9c1e770f2a.tar.xz
forums-bd6dfee23e0d3f11ff028d4376e73c9c1e770f2a.zip
[ticket/10714] Add event core.get_logs_modify_type
core.get_logs_switch_mode is superseded by this one and therefor removed PHPBB3-10714
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/log/log.php53
1 files changed, 30 insertions, 23 deletions
diff --git a/phpBB/includes/log/log.php b/phpBB/includes/log/log.php
index 752ed21955..97d0aac623 100644
--- a/phpBB/includes/log/log.php
+++ b/phpBB/includes/log/log.php
@@ -231,12 +231,7 @@ class phpbb_log implements phpbb_log_interface
*/
public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '')
{
- global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path;
- /**
- * @todo: enable when events are merged
- *
global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path, $phpbb_dispatcher;
- */
$this->logs_total = 0;
$this->logs_offset = $offset;
@@ -288,32 +283,44 @@ class phpbb_log implements phpbb_log_interface
default:
$log_type = null;
$sql_additional = '';
- /**
- * @todo: enable when events are merged
- *
- if ($phpbb_dispatcher != null)
- {
- $vars = array('mode', 'count_logs', 'limit', 'offset', 'forum_id', 'topic_id', 'user_id', 'log_time', 'sort_by', 'keywords', 'profile_url', 'log_type', 'sql_additional');
- extract($phpbb_dispatcher->trigger_event('core.get_logs_switch_mode', $vars, $vars));
- }
- */
-
- if (!isset($log_type))
- {
- $this->logs_offset = 0;
- return array();
- }
}
/**
- * @todo: enable when events are merged
+ * Overwrite log type and limitations before we count and get the logs
+ *
+ * NOTE: if log_type is not set, no entries will be returned.
*
+ * @event core.get_logs_modify_type
+ * @var string mode Mode of the entries we display
+ * @var bool count_logs Do we count all matching entries?
+ * @var int limit Limit the number of entries
+ * @var int offset Offset when fetching the entries
+ * @var mixed forum_id Limit entries to the forum_id,
+ * can also be an array of forum_ids
+ * @var int topic_id Limit entries to the topic_id
+ * @var int user_id Limit entries to the user_id
+ * @var int log_time Limit maximum age of log entries
+ * @var string sort_by SQL order option
+ * @var string keywords Will only return entries that have the
+ * keywords in log_operation or log_data
+ * @var string profile_url URL to the users profile
+ * @var int log_type Limit logs to a certain type. If log_type
+ * is not set, no entries will be returned.
+ * @var string sql_additional Additional conditions for the entries,
+ * e.g.: 'AND l.forum_id = 1'
+ * @since 3.1-A1
+ */
if ($phpbb_dispatcher != null)
{
$vars = array('mode', 'count_logs', 'limit', 'offset', 'forum_id', 'topic_id', 'user_id', 'log_time', 'sort_by', 'keywords', 'profile_url', 'log_type', 'sql_additional');
- extract($phpbb_dispatcher->trigger_event('core.get_logs_after_get_type', $vars, $vars));
+ extract($phpbb_dispatcher->trigger_event('core.get_logs_modify_type', $vars));
+ }
+
+ if (!isset($log_type))
+ {
+ $this->logs_offset = 0;
+ return array();
}
- */
$sql_keywords = '';
if (!empty($keywords))