Merge branch 'develop-ascraeus' into develop

This commit is contained in:
Marc Alexander 2014-11-22 00:15:24 +01:00
commit afc658c71a
2 changed files with 26 additions and 2 deletions

View file

@ -29,14 +29,31 @@ class acp_styles
protected $styles_path; protected $styles_path;
protected $styles_path_absolute = 'styles'; protected $styles_path_absolute = 'styles';
protected $default_style = 0; protected $default_style = 0;
protected $styles_list_cols = 0;
protected $reserved_style_names = array('adm', 'admin', 'all');
/** @var \phpbb\db\driver\driver_interface */
protected $db; protected $db;
/** @var \phpbb\user */
protected $user; protected $user;
/** @var \phpbb\template\template */
protected $template; protected $template;
/** @var \phpbb\request\request_interface */
protected $request; protected $request;
/** @var \phpbb\cache\driver\driver_interface */
protected $cache; protected $cache;
/** @var \phpbb\auth\auth */
protected $auth; protected $auth;
/** @var string */
protected $phpbb_root_path; protected $phpbb_root_path;
/** @var string */
protected $php_ext; protected $php_ext;
public function main($id, $mode) public function main($id, $mode)
@ -164,6 +181,12 @@ class acp_styles
$last_installed = false; $last_installed = false;
foreach ($dirs as $dir) foreach ($dirs as $dir)
{ {
if (in_array($dir, $this->reserved_style_names))
{
$messages[] = $this->user->lang('STYLE_NAME_RESERVED', htmlspecialchars($dir));
continue;
}
$found = false; $found = false;
foreach ($styles as &$style) foreach ($styles as &$style)
{ {
@ -809,7 +832,7 @@ class acp_styles
* Update styles tree * Update styles tree
* *
* @param array $styles Styles list, passed as reference * @param array $styles Styles list, passed as reference
* @param array $style Current style, false if root * @param array|false $style Current style, false if root
* @return bool True if something was updated, false if not * @return bool True if something was updated, false if not
*/ */
protected function update_styles_tree(&$styles, $style = false) protected function update_styles_tree(&$styles, $style = false)
@ -1091,7 +1114,7 @@ class acp_styles
/** /**
* Install style * Install style
* *
* @param $style style data * @param array $style style data
* @return int Style id * @return int Style id
*/ */
protected function install_style($style) protected function install_style($style)

View file

@ -74,6 +74,7 @@ $lang = array_merge($lang, array(
'STYLE_INSTALLED_RETURN_INSTALLED_STYLES' => 'Return to installed styles list', 'STYLE_INSTALLED_RETURN_INSTALLED_STYLES' => 'Return to installed styles list',
'STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES' => 'Install more styles', 'STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES' => 'Install more styles',
'STYLE_NAME' => 'Style name', 'STYLE_NAME' => 'Style name',
'STYLE_NAME_RESERVED' => 'Style "%s" can not be installed, because the name is reserved.',
'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.', 'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.',
'STYLE_PATH' => 'Style path', 'STYLE_PATH' => 'Style path',
'STYLE_UNINSTALL' => 'Uninstall', 'STYLE_UNINSTALL' => 'Uninstall',