diff options
-rw-r--r-- | phpBB/adm/index.php | 8 | ||||
-rw-r--r-- | phpBB/adm/style/acp_groups.html | 2 | ||||
-rw-r--r-- | phpBB/docs/events.md | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 7 | ||||
-rw-r--r-- | phpBB/includes/functions_module.php | 7 | ||||
-rw-r--r-- | phpBB/install/index.php | 7 | ||||
-rw-r--r-- | phpBB/install/install_update.php | 7 | ||||
-rw-r--r-- | phpBB/phpbb/template/twig/twig.php | 32 | ||||
-rw-r--r-- | phpBB/phpbb/version_helper.php | 5 | ||||
-rw-r--r-- | tests/version/version_test.php | 10 |
10 files changed, 85 insertions, 12 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index f7343accef..519f6c8310 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -54,7 +54,13 @@ $module_id = request_var('i', ''); $mode = request_var('mode', ''); // Set custom style for admin area -$template->set_custom_style('adm', $phpbb_admin_path . 'style'); +$template->set_custom_style(array( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), +), $phpbb_admin_path . 'style'); + $template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index cf189f979f..f9846ea7cd 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -56,6 +56,7 @@ <fieldset> <legend>{L_GROUP_OPTIONS_SAVE}</legend> + <!-- EVENT acp_group_options_before --> <!-- IF S_USER_FOUNDER --> <dl> <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}{L_COLON}</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt> @@ -78,6 +79,7 @@ <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}{L_COLON}</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt> <dd><input name="group_receive_pm" type="checkbox" value="1" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd> </dl> + <!-- EVENT acp_group_options_after --> </fieldset> <fieldset> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 4a6a1895dd..4dc55540f3 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -22,6 +22,18 @@ acp_forums_normal_settings_append * Since: 3.1.0-a1 * Purpose: Add settings to forums +acp_group_options_before +=== +* Location: adm/style/acp_groups.html +* Since: 3.1.0-b4 +* Purpose: Add addtional options to group settings (before GROUP_FOUNDER_MANAGE) + +acp_group_options_after +=== +* Location: adm/style/acp_groups.html +* Since: 3.1.0-b4 +* Purpose: Add addtional options to group settings (after GROUP_RECEIVE_PM) + acp_main_actions_append === * Location: adm/style/acp_main.html diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index d170a689b6..3657a89aa0 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -255,7 +255,12 @@ class messenger } } - $this->set_template_paths($template_lang . '_email', $template_paths); + $this->set_template_paths(array( + array( + 'name' => $template_lang . '_email', + 'ext_path' => 'language/' . $template_lang . '/email' + ), + ), $template_paths); $this->template->set_filenames(array( 'body' => $template_file . '.txt', diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 5d456e6355..51284af233 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -584,7 +584,12 @@ class p_master if (is_dir($module_style_dir)) { - $template->set_custom_style('adm', array($module_style_dir, $phpbb_admin_path . 'style')); + $template->set_custom_style(array( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), + ), array($module_style_dir, $phpbb_admin_path . 'style')); } } diff --git a/phpBB/install/index.php b/phpBB/install/index.php index e683324bdf..43970029cb 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -254,7 +254,12 @@ $phpbb_path_helper = $phpbb_container->get('path_helper'); $template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context()); $paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style'); $paths = array_filter($paths, 'is_dir'); -$template->set_custom_style('adm', $paths); +$template->set_custom_style(array( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), +), $paths); $path = array_shift($paths); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 1a90efc2b4..ab5fcc3f2b 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -145,7 +145,12 @@ class install_update extends module // Set custom template again. ;) $paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style'); $paths = array_filter($paths, 'is_dir'); - $template->set_custom_style('adm', $paths); + $template->set_custom_style(array( + array( + 'name' => 'adm', + 'ext_path' => 'adm/style/', + ), + ), $paths); $template->assign_vars(array( 'S_USER_LANG' => $user->lang['USER_LANG'], diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 9d3b994ce6..bf27dd5f20 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -214,9 +214,13 @@ class twig extends \phpbb\template\base * * Note: Templates are still compiled to phpBB's cache directory. * - * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions. - * @param string|array or string $paths Array of style paths, relative to current root directory - * @return phpbb_template $this + * @param string|array $names Array of names (or detailed names) or string of name of template(s) in inheritance tree order, used by extensions. + * E.g. array( + * 'name' => 'adm', + * 'ext_path' => 'adm/style/', + * ) + * @param string|array of string $paths Array of style paths, relative to current root directory + * @return \phpbb\template\template $this */ public function set_custom_style($names, $paths) { @@ -237,10 +241,26 @@ class twig extends \phpbb\template\base $namespace = str_replace('/', '_', $ext_namespace); $paths = array(); - foreach ($names as $style_name) + foreach ($names as $template_dir) { - $ext_style_path = $ext_path . 'styles/' . $style_name . '/'; - $ext_style_template_path = $ext_style_path . 'template/'; + if (is_array($template_dir)) + { + if (isset($template_dir['ext_path'])) + { + $ext_style_template_path = $ext_path . $template_dir['ext_path']; + $ext_style_path = dirname($ext_style_template_path); + } + else + { + $ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/'; + $ext_style_template_path = $ext_style_path . 'template/'; + } + } + else + { + $ext_style_path = $ext_path . 'styles/' . $template_dir . '/'; + $ext_style_template_path = $ext_style_path . 'template/'; + } if (is_dir($ext_style_template_path)) { diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index 47e9bbe0f3..5991744e76 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -251,7 +251,7 @@ class version_helper $info = json_decode($info, true); - if (empty($info['stable']) || empty($info['unstable'])) + if (empty($info['stable']) && empty($info['unstable'])) { $this->user->add_lang('acp/common'); @@ -267,6 +267,9 @@ class version_helper } } + $info['stable'] = (empty($info['stable'])) ? array() : $info['stable']; + $info['unstable'] = (empty($info['unstable'])) ? $info['stable'] : $info['unstable']; + $this->cache->put($cache_file, $info, 86400); // 24 hours } diff --git a/tests/version/version_test.php b/tests/version/version_test.php index 142fd88636..bc4f2c0294 100644 --- a/tests/version/version_test.php +++ b/tests/version/version_test.php @@ -185,6 +185,11 @@ class phpbb_version_helper_test extends phpbb_test_case ), ), ), + array( + '1.1.0', + array(), + array(), + ), ); } @@ -290,6 +295,11 @@ class phpbb_version_helper_test extends phpbb_test_case ), '1.1.0-a2', ), + array( + '1.1.0', + array(), + null, + ), ); } |