aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/config/console.yml1
-rw-r--r--phpBB/includes/acp/acp_main.php2
-rw-r--r--phpBB/includes/acp/acp_styles.php1
-rw-r--r--phpBB/phpbb/console/command/cache/purge.php7
-rw-r--r--phpBB/phpbb/mimetype/guesser_interface.php1
-rw-r--r--phpBB/posting.php64
6 files changed, 61 insertions, 15 deletions
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
index 1340d9c0d7..d32befa15e 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/console.yml
@@ -7,6 +7,7 @@ services:
- @auth
- @log
- @user
+ - @config
tags:
- { name: console.command }
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 9c1613e24a..74ea095496 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -349,7 +349,7 @@ class acp_main
break;
case 'purge_cache':
- global $cache;
+ $config->increment('assets_version', 1);
$cache->purge();
// Clear permissions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3f9d21f56c..7b277da9f9 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -146,6 +146,7 @@ class acp_styles
{
global $db, $cache, $auth;
+ $this->config->increment('assets_version', 1);
$this->cache->purge();
// Clear permissions
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php
index 017bdc5144..013183cb35 100644
--- a/phpBB/phpbb/console/command/cache/purge.php
+++ b/phpBB/phpbb/console/command/cache/purge.php
@@ -28,13 +28,17 @@ class purge extends \phpbb\console\command\command
/** @var \phpbb\user */
protected $user;
- function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user)
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config)
{
$this->cache = $cache;
$this->db = $db;
$this->auth = $auth;
$this->log = $log;
$this->user = $user;
+ $this->config = $config;
$this->user->add_lang(array('acp/common'));
parent::__construct();
}
@@ -49,6 +53,7 @@ class purge extends \phpbb\console\command\command
protected function execute(InputInterface $input, OutputInterface $output)
{
+ $this->config->increment('assets_version', 1);
$this->cache->purge();
// Clear permissions
diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php
index 103689765e..3cbcfeabe3 100644
--- a/phpBB/phpbb/mimetype/guesser_interface.php
+++ b/phpBB/phpbb/mimetype/guesser_interface.php
@@ -26,6 +26,7 @@ interface guesser_interface
* Guess mimetype of supplied file
*
* @param string $file Path to file
+ * @param string $file_name The real file name
*
* @return string Guess for mimetype of file
*/
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 054f6edb50..d48157dcd6 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1491,8 +1491,8 @@ $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_up
add_form_key('posting');
-// Start assigning vars for main posting page ...
-$template->assign_vars(array(
+// Build array of variables for main posting page
+$page_data = array(
'L_POST_A' => $page_title,
'L_ICON' => ($mode == 'reply' || $mode == 'quote' || ($mode == 'edit' && $post_id != $post_data['topic_first_post_id'])) ? $user->lang['POST_ICON'] : $user->lang['TOPIC_ICON'],
'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']),
@@ -1560,24 +1560,46 @@ $template->assign_vars(array(
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_ATTACH_DATA' => json_encode($message_parser->attachment_data),
'S_IN_POSTING' => true,
-));
+);
/**
* This event allows you to modify template variables for the posting screen
*
* @event core.posting_modify_template_vars
-* @var array post_data Array with post data
-* @var array moderators Array with forum moderators
-* @var string mode What action to take if the form is submitted
-* post|reply|quote|edit|delete|bump|smilies|popup
-* @var string page_title Title of the mode page
+* @var array post_data Array with post data
+* @var array moderators Array with forum moderators
+* @var string mode What action to take if the form is submitted
+* post|reply|quote|edit|delete|bump|smilies|popup
+* @var string page_title Title of the mode page
* @var bool s_topic_icons Whether or not to show the topic icons
-* @var string form_enctype If attachments are allowed for this form the value of
-* this is "multipart/form-data" else it is the empty string
-* @var string s_action The URL to submit the POST data to
-* @var string s_hidden_fields The concatenated input tags of the form's hidden fields
+* @var string form_enctype If attachments are allowed for this form
+* "multipart/form-data" or empty string
+* @var string s_action The URL to submit the POST data to
+* @var string s_hidden_fields Concatenated hidden input tags of posting form
+* @var int post_id ID of the post
+* @var int topic_id ID of the topic
+* @var int forum_id ID of the forum
+* @var bool submit Whether or not the form has been submitted
+* @var bool preview Whether or not the post is being previewed
+* @var bool save Whether or not a draft is being saved
+* @var bool load Whether or not a draft is being loaded
+* @var bool delete Whether or not the post is being deleted
+* @var bool cancel Whether or not to cancel the form (returns to
+* viewtopic or viewforum depending on if the user
+* is posting a new topic or editing a post)
+* @var array error Any error strings; a non-empty array aborts
+* form submission.
+* NOTE: Should be actual language strings, NOT
+* language keys.
+* @var bool refresh Whether or not to retain previously submitted data
+* @var array page_data Posting page data that should be passed to the
+* posting page via $template->assign_vars()
+* @var object message_parser The message parser object
* @since 3.1.0-a1
-* @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title, s_topic_icons, form_enctype, s_action, s_hidden_fields
+* @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title,
+* s_topic_icons, form_enctype, s_action, s_hidden_fields,
+* post_id, topic_id, forum_id, submit, preview, save, load,
+* delete, cancel, refresh, error, page_data, message_parser
*/
$vars = array(
'post_data',
@@ -1588,9 +1610,25 @@ $vars = array(
'form_enctype',
's_action',
's_hidden_fields',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'delete',
+ 'cancel',
+ 'refresh',
+ 'error',
+ 'page_data',
+ 'message_parser',
);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars)));
+// Start assigning vars for main posting page ...
+$template->assign_vars($page_data);
+
// Build custom bbcodes array
display_custom_bbcodes();