aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_main.php10
-rw-r--r--phpBB/includes/functions.php14
-rw-r--r--phpBB/includes/functions_posting.php16
3 files changed, 31 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 0d0d49774c..2a28226d6c 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -26,7 +26,7 @@ class acp_main
function main($id, $mode)
{
global $config, $db, $cache, $user, $auth, $template, $request;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -445,6 +445,14 @@ class acp_main
));
}
+ /**
+ * Notice admin
+ *
+ * @event core.acp_main_notice
+ * @since 3.1.0-RC3
+ */
+ $phpbb_dispatcher->dispatch('core.acp_main_notice');
+
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 8b9969aced..3402a618b0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1067,7 +1067,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
$offset_string = phpbb_format_timezone_offset($offset);
$timezones['GMT' . $offset_string . ' - ' . $timezone] = array(
'tz' => $timezone,
- 'offest' => 'GMT' . $offset_string,
+ 'offset' => 'GMT' . $offset_string,
'current' => $current_time,
);
if ($timezone === $default)
@@ -1084,14 +1084,14 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
foreach ($timezones as $timezone)
{
- if ($opt_group != $timezone['offest'])
+ if ($opt_group != $timezone['offset'])
{
$tz_select .= ($opt_group) ? '</optgroup>' : '';
- $tz_select .= '<optgroup label="' . $timezone['offest'] . ' - ' . $timezone['current'] . '">';
- $opt_group = $timezone['offest'];
+ $tz_select .= '<optgroup label="' . $timezone['offset'] . ' - ' . $timezone['current'] . '">';
+ $opt_group = $timezone['offset'];
- $selected = ($default_offset == $timezone['offest']) ? ' selected="selected"' : '';
- $tz_dates .= '<option value="' . $timezone['offest'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offest'] . ' - ' . $timezone['current'] . '</option>';
+ $selected = ($default_offset == $timezone['offset']) ? ' selected="selected"' : '';
+ $tz_dates .= '<option value="' . $timezone['offset'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offset'] . ' - ' . $timezone['current'] . '</option>';
}
$label = $timezone['tz'];
@@ -1099,7 +1099,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)
{
$label = $user->lang['timezones'][$label];
}
- $title = $timezone['offest'] . ' - ' . $label;
+ $title = $timezone['offset'] . ' - ' . $label;
if ($truncate)
{
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 0b37af0ee0..04e28fb865 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -405,7 +405,7 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false, \phpbb\plupload\plupload $plupload = null)
{
global $auth, $user, $config, $db, $cache;
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
$filedata = array(
'error' => array()
@@ -506,6 +506,20 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
$filedata['real_filename'] = $file->get('uploadname');
$filedata['filetime'] = time();
+ /**
+ * Event to modify uploaded file before submit to the post
+ *
+ * @event core.modify_uploaded_file
+ * @var array filedata Array containing uploaded file data
+ * @var bool is_image Flag indicating if the file is an image
+ * @since 3.1.0-RC3
+ */
+ $vars = array(
+ 'filedata',
+ 'is_image',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_uploaded_file', compact($vars)));
+
// Check our complete quota
if ($config['attachment_quota'])
{