aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-11 13:04:00 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-28 22:16:48 +0200
commit5e29ea77d813fb6f10583fa440ed4e55e78bd28d (patch)
treeabfca48dc000aba18c55d53d2b43f596fa5856d3
parenta80a9efa8de086e0100b1a6d33ac349e955e9d18 (diff)
downloadforums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar.gz
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar.bz2
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar.xz
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.zip
[ticket/11366] Coding style
PHPBB3-11366
-rw-r--r--phpBB/adm/style/acp_ext_details.html6
-rw-r--r--phpBB/adm/style/acp_ext_list.html2
-rw-r--r--phpBB/includes/acp/acp_extensions.php66
-rw-r--r--phpBB/language/en/acp/extensions.php2
4 files changed, 40 insertions, 36 deletions
diff --git a/phpBB/adm/style/acp_ext_details.html b/phpBB/adm/style/acp_ext_details.html
index 95b23395dd..65a9d3c774 100644
--- a/phpBB/adm/style/acp_ext_details.html
+++ b/phpBB/adm/style/acp_ext_details.html
@@ -6,12 +6,16 @@
<h1>{L_EXTENSIONS_ADMIN}</h1>
- <!-- IF S_VERSIONCHECK_FAIL -->
+ <!-- IF S_VERSIONCHECK_STATUS == 0 -->
<div class="errorbox notice">
<p>{L_VERSIONCHECK_FAIL}</p>
<p>{VERSIONCHECK_FAIL_REASON}</p>
<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
</div>
+ <!-- ELSE IF S_VERSIONCHECK_STATUS == 1 -->
+ <div class="errorbox notice">
+ <p>{VERSIONCHECK_FAIL_REASON}</p>
+ </div>
<!-- ENDIF -->
<!-- IF S_VERSIONCHECK -->
<div class="<!-- IF S_UP_TO_DATE -->successbox<!-- ELSE -->errorbox<!-- ENDIF -->">
diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html
index a47b1bd576..0aed0243d9 100644
--- a/phpBB/adm/style/acp_ext_list.html
+++ b/phpBB/adm/style/acp_ext_list.html
@@ -13,7 +13,7 @@
<th>{L_EXTENSION_NAME}</th>
<th width="20%">{L_CURRENT_VERSION}</th>
<th width="10%">{L_EXTENSION_OPTIONS}</th>
- <th width="10%">{L_EXTENSION_ACTIONS}</th>
+ <th width="25%">{L_EXTENSION_ACTIONS}</th>
</tr>
</thead>
<tbody>
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index 4db4d38f3a..b74e020edd 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -267,8 +267,8 @@ class acp_extensions
catch (\RuntimeException $e)
{
$template->assign_vars(array(
- 'S_VERSIONCHECK_FAIL' => true,
- 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
+ 'S_VERSIONCHECK_STATUS' => $e->getCode(),
+ 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
));
}
@@ -283,11 +283,11 @@ class acp_extensions
}
/**
- * Lists all the enabled extensions and dumps to the template
- *
- * @param $phpbb_extension_manager An instance of the extension manager
- * @return null
- */
+ * Lists all the enabled extensions and dumps to the template
+ *
+ * @param $phpbb_extension_manager An instance of the extension manager
+ * @return null
+ */
public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$enabled_extension_meta_data = array();
@@ -323,7 +323,7 @@ class acp_extensions
}
}
- uasort($enabled_extension_meta_data, array('self', 'sort_extension_meta_data_table'));
+ uasort($enabled_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
foreach ($enabled_extension_meta_data as $name => $infos)
{
@@ -339,11 +339,11 @@ class acp_extensions
}
/**
- * Lists all the disabled extensions and dumps to the template
- *
- * @param $phpbb_extension_manager An instance of the extension manager
- * @return null
- */
+ * Lists all the disabled extensions and dumps to the template
+ *
+ * @param $phpbb_extension_manager An instance of the extension manager
+ * @return null
+ */
public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$disabled_extension_meta_data = array();
@@ -379,7 +379,7 @@ class acp_extensions
}
}
- uasort($disabled_extension_meta_data, array('self', 'sort_extension_meta_data_table'));
+ uasort($disabled_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
foreach ($disabled_extension_meta_data as $name => $infos)
{
@@ -396,11 +396,11 @@ class acp_extensions
}
/**
- * Lists all the available extensions and dumps to the template
- *
- * @param $phpbb_extension_manager An instance of the extension manager
- * @return null
- */
+ * Lists all the available extensions and dumps to the template
+ *
+ * @param $phpbb_extension_manager An instance of the extension manager
+ * @return null
+ */
public function list_available_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured());
@@ -438,7 +438,7 @@ class acp_extensions
}
}
- uasort($available_extension_meta_data, array('self', 'sort_extension_meta_data_table'));
+ uasort($available_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
foreach ($available_extension_meta_data as $name => $infos)
{
@@ -472,33 +472,33 @@ class acp_extensions
}
/**
- * Check the version and return the availables updates.
- *
- * @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check.
- * @param bool $force Ignores cached data. Default to false.
- */
- private function version_check(\phpbb\extension\metadata_manager $md_manager, $force = false)
+ * Check the version and return the availables updates.
+ *
+ * @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check.
+ * @param bool $force Ignores cached data. Default to false.
+ */
+ protected function version_check(\phpbb\extension\metadata_manager $md_manager, $force = false)
{
$meta = $md_manager->get_metadata('all');
- if (! isset($meta['extra']['version-check']))
+ if (!isset($meta['extra']['version-check']))
{
- throw new \RuntimeException($this->user->lang('NO_VERSIONCHECK'));
+ throw new \RuntimeException($this->user->lang('NO_VERSIONCHECK'), 1);
}
- $meta_vc = $meta['extra']['version-check'];
+ $version_check = $meta['extra']['version-check'];
$version_helper = new \phpbb\version_helper($this->cache, $this->config, $this->user);
$version_helper->set_current_version($meta['version']);
- $version_helper->set_file_location($meta_vc['host'], $meta_vc['directory'], $meta_vc['filename']);
+ $version_helper->set_file_location($version_check ['host'], $version_check ['directory'], $version_check ['filename']);
return $updates = $version_helper->get_suggested_updates(true);
}
/**
- * Sort helper for the table containing the metadata about the extensions.
- */
- static private function sort_extension_meta_data_table($val1, $val2)
+ * Sort helper for the table containing the metadata about the extensions.
+ */
+ protected function sort_extension_meta_data_table($val1, $val2)
{
return strnatcasecmp($val1['META_DISPLAY_NAME'], $val2['META_DISPLAY_NAME']);
}
diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php
index 476f4352a3..1df030cfca 100644
--- a/phpBB/language/en/acp/extensions.php
+++ b/phpBB/language/en/acp/extensions.php
@@ -111,5 +111,5 @@ $lang = array_merge($lang, array(
'UP_TO_DATE' => '%s is up to date',
'ANNOUNCEMENT_TOPIC' => 'Release Announcement',
'DOWNLOAD_LATEST' => 'Download Version',
- 'NO_VERSIONCHECK' => 'No information on how to check the version.',
+ 'NO_VERSIONCHECK' => 'No version check information given.',
));