diff options
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
| -rw-r--r-- | phpBB/includes/acp/acp_styles.php | 30 | 
1 files changed, 25 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 6bd27a8bca..b652fd6587 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -32,6 +32,9 @@ class acp_styles  	protected $styles_list_cols = 0;  	protected $reserved_style_names = array('adm', 'admin', 'all'); +	/** @var \phpbb\config\config */ +	protected $config; +  	/** @var \phpbb\db\driver\driver_interface */  	protected $db; @@ -50,6 +53,9 @@ class acp_styles  	/** @var \phpbb\auth\auth */  	protected $auth; +	/** @var \phpbb\textformatter\cache_interface */ +	protected $text_formatter_cache; +  	/** @var string */  	protected $phpbb_root_path; @@ -58,7 +64,7 @@ class acp_styles  	public function main($id, $mode)  	{ -		global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config; +		global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config, $phpbb_container;  		$this->db = $db;  		$this->user = $user; @@ -66,6 +72,7 @@ class acp_styles  		$this->request = $request;  		$this->cache = $cache;  		$this->auth = $auth; +		$this->text_formatter_cache = $phpbb_container->get('text_formatter.cache');  		$this->config = $config;  		$this->phpbb_root_path = $phpbb_root_path;  		$this->php_ext = $phpEx; @@ -213,6 +220,12 @@ class acp_styles  			}  		} +		// Invalidate the text formatter's cache for the new styles to take effect +		if (!empty($installed_names)) +		{ +			$this->text_formatter_cache->invalidate(); +		} +  		// Show message  		if (!count($messages))  		{ @@ -260,6 +273,8 @@ class acp_styles  	*/  	protected function action_uninstall_confirmed($ids, $delete_files)  	{ +		global $user, $phpbb_log; +  		$default = $this->default_style;  		$uninstalled = array();  		$messages = array(); @@ -319,7 +334,7 @@ class acp_styles  		// Log action  		if (count($uninstalled))  		{ -			add_log('admin', 'LOG_STYLE_DELETE', implode(', ', $uninstalled)); +			$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_STYLE_DELETE', false, array(implode(', ', $uninstalled)));  		}  		// Clear cache @@ -391,6 +406,8 @@ class acp_styles  	*/  	protected function action_details()  	{ +		global $user, $phpbb_log; +  		$id = $this->request->variable('id', 0);  		if (!$id)  		{ @@ -522,7 +539,8 @@ class acp_styles  						$this->cache->purge();  					}  				} -				add_log('admin', 'LOG_STYLE_EDIT_DETAILS', $style['style_name']); + +				$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_STYLE_EDIT_DETAILS', false, array($style['style_name']));  			}  			// Update default style @@ -533,7 +551,7 @@ class acp_styles  				{  					trigger_error($this->user->lang['STYLE_DEFAULT_CHANGE_INACTIVE'] . adm_back_link($update_action), E_USER_WARNING);  				} -				set_config('default_style', $id); +				$this->config->set('default_style', $id);  				$this->cache->purge();  			} @@ -1119,6 +1137,8 @@ class acp_styles  	*/  	protected function install_style($style)  	{ +		global $user, $phpbb_log; +  		// Generate row  		$sql_ary = array();  		foreach ($style as $key => $value) @@ -1140,7 +1160,7 @@ class acp_styles  		$this->db->sql_transaction('commit'); -		add_log('admin', 'LOG_STYLE_ADD', $sql_ary['style_name']); +		$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_STYLE_ADD', false, array($sql_ary['style_name']));  		return $id;  	}  | 
