aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-07-22 20:24:20 -0500
committerUnknown Bliss <m@michaelcullum.com>2012-09-01 15:05:16 +0100
commitbf6e91b5f3f6d56c1a38cbff0ccf206f13202e50 (patch)
tree270eac088df9d0f82ccac223851f4a0f952acb99
parent6b12f71b94faa8cf0d7d65661650bb2d1e5381d9 (diff)
downloadforums-bf6e91b5f3f6d56c1a38cbff0ccf206f13202e50.tar
forums-bf6e91b5f3f6d56c1a38cbff0ccf206f13202e50.tar.gz
forums-bf6e91b5f3f6d56c1a38cbff0ccf206f13202e50.tar.bz2
forums-bf6e91b5f3f6d56c1a38cbff0ccf206f13202e50.tar.xz
forums-bf6e91b5f3f6d56c1a38cbff0ccf206f13202e50.zip
[ticket/10631] Fixing some more issues
PHPBB3-10631
-rw-r--r--phpBB/adm/style/acp_ext_details.html186
-rw-r--r--phpBB/includes/extension/metadata_manager.php35
2 files changed, 111 insertions, 110 deletions
diff --git a/phpBB/adm/style/acp_ext_details.html b/phpBB/adm/style/acp_ext_details.html
index b8302de329..776c44711c 100644
--- a/phpBB/adm/style/acp_ext_details.html
+++ b/phpBB/adm/style/acp_ext_details.html
@@ -1,93 +1,93 @@
-<!-- INCLUDE overall_header.html -->
-
-<a name="maincontent"></a>
-
- <h1>{L_EXTENSIONS_ADMIN}</h1>
-
- <p>{L_EXTENSIONS_EXPLAIN}</p>
-
- <fieldset>
- <legend>{L_EXT_DETAILS}</legend>
- <dl>
- <dt><label for="md_display_name">{L_DISPLAY_NAME}:</label></dt>
- <dd><strong id="md_display_name">{MD_DISPLAY_NAME}</strong></dd>
- </dl>
- <dl>
- <dt><label for="md_name">{L_CLEAN_NAME}:</label></dt>
- <dd><strong id="md_name">{MD_NAME}</strong></dd>
- </dl>
- <dl>
- <dt><label for="md_type">{L_TYPE}:</label></dt>
- <dd><p id="md_type">{MD_TYPE}</p></dd>
- </dl>
- <dl>
- <dt><label for="md_description">{L_DESCRIPTION}:</label></dt>
- <dd><p id="md_description">{MD_DESCRIPTION}</p></dd>
- </dl>
- <dl>
- <dt><label for="md_version">{L_VERSION}:</label></dt>
- <dd><p id="md_version">{MD_VERSION}</p></dd>
- </dl>
- <dl>
- <dt><label for="md_homepage">{L_HOMEPAGE}:</label></dt>
- <dd><p id="md_homepage">{MD_HOMEPAGE}</p></dd>
- </dl>
-<!-- <dl>
- <dt><label for="path">{L_PATH}:</label></dt>
- <dd><p id="path">{PATH}</p></dd>
- </dl> -->
- <dl>
- <dt><label for="md_time">{L_TIME}:</label></dt>
- <dd><p id="md_time">{MD_TIME}</p></dd>
- </dl>
- <dl>
- <dt><label for="md_license">{L_LICENSE}:</label></dt>
- <dd><p id="md_license">{MD_LICENSE}</p></dd>
- </dl>
- </fieldset>
-
- <fieldset>
- <legend>{L_REQUIREMENTS}</legend>
- <!-- IF MD_REQUIRE_PHPBB -->
- <dl>
- <dt><label for="require_phpbb">{L_PHPBB_VERSION}:</label></dt>
- <dd><p id="require_phpbb">{MD_REQUIRE_PHPBB}</p></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF MD_REQUIRE_PHP -->
- <dl>
- <dt><label for="require_php">{L_PHP_VERSION}:</label></dt>
- <dd><p id="require_php">{MD_REQUIRE_PHP}</p></dd>
- </dl>
- <!-- ENDIF -->
- </fieldset>
-
- <fieldset>
- <legend>{L_AUTHOR_INFORMATION}</legend>
- <!-- BEGIN md_authors -->
- <dl>
- <dt><label for="md_author_name">{L_AUTHOR_NAME}:</label></dt>
- <dd><strong id="md_author_name">{md_authors.AUTHOR_NAME}</strong></dd>
- </dl>
- <!-- IF md_authors.AUTHOR_EMAIL -->
- <dl>
- <dt><label for="md_author_email">{L_AUTHOR_EMAIL}:</label></dt>
- <dd><strong id="md_author_email"><a href="mailto:{md_authors.AUTHOR_EMAIL}">{md_authors.AUTHOR_EMAIL}</a></strong></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF md_authors.AUTHOR_HOMEPAGE -->
- <dl>
- <dt><label for="md_author_url">{L_AUTHOR_HOMEPAGE}:</label></dt>
- <dd><strong id="md_author_url"><a href="{md_authors.AUTHOR_HOMEPAGE}">{md_authors.AUTHOR_HOMEPAGE}</a></strong></dd>
- </dl>
- <!-- ENDIF -->
- <!-- IF md_authors.AUTHOR_ROLE -->
- <dl>
- <dt><label for="author_role">{L_AUTHOR_ROLE}:</label></dt>
- <dd><strong id="md_author_role">{md_authors.AUTHOR_ROLE}</strong></dd>
- </dl>
- <!-- ENDIF -->
- <!-- END md_authors -->
- </fieldset>
-
-<!-- INCLUDE overall_footer.html -->
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+
+ <h1>{L_EXTENSIONS_ADMIN}</h1>
+
+ <fieldset>
+ <legend>{L_EXT_DETAILS}</legend>
+ <dl>
+ <dt><label for="md_display_name">{L_DISPLAY_NAME}:</label></dt>
+ <dd><strong id="md_display_name">{MD_DISPLAY_NAME}</strong></dd>
+ </dl>
+ <dl>
+ <dt><label for="md_name">{L_CLEAN_NAME}:</label></dt>
+ <dd><strong id="md_name">{MD_NAME}</strong></dd>
+ </dl>
+ <dl>
+ <dt><label for="md_type">{L_TYPE}:</label></dt>
+ <dd><p id="md_type">{MD_TYPE}</p></dd>
+ </dl>
+ <dl>
+ <dt><label for="md_description">{L_DESCRIPTION}:</label></dt>
+ <dd><p id="md_description">{MD_DESCRIPTION}</p></dd>
+ </dl>
+ <dl>
+ <dt><label for="md_version">{L_VERSION}:</label></dt>
+ <dd><p id="md_version">{MD_VERSION}</p></dd>
+ </dl>
+ <dl>
+ <dt><label for="md_homepage">{L_HOMEPAGE}:</label></dt>
+ <dd><p id="md_homepage">{MD_HOMEPAGE}</p></dd>
+ </dl>
+<!-- <dl>
+ <dt><label for="path">{L_PATH}:</label></dt>
+ <dd><p id="path">{PATH}</p></dd>
+ </dl> -->
+ <dl>
+ <dt><label for="md_time">{L_TIME}:</label></dt>
+ <dd><p id="md_time">{MD_TIME}</p></dd>
+ </dl>
+ <dl>
+ <dt><label for="md_license">{L_LICENCE}:</label></dt>
+ <dd><p id="md_license">{MD_LICENCE}</p></dd>
+ </dl>
+ </fieldset>
+
+ <fieldset>
+ <legend>{L_REQUIREMENTS}</legend>
+ <!-- IF MD_REQUIRE_PHPBB -->
+ <dl>
+ <dt><label for="require_phpbb">{L_PHPBB_VERSION}:</label></dt>
+ <dd><p id="require_phpbb">{MD_REQUIRE_PHPBB}</p></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF MD_REQUIRE_PHP -->
+ <dl>
+ <dt><label for="require_php">{L_PHP_VERSION}:</label></dt>
+ <dd><p id="require_php">{MD_REQUIRE_PHP}</p></dd>
+ </dl>
+ <!-- ENDIF -->
+ </fieldset>
+
+ <fieldset>
+ <legend>{L_AUTHOR_INFORMATION}</legend>
+ <!-- BEGIN md_authors -->
+ <dl>
+ <dt><label for="md_author_name">{L_AUTHOR_NAME}:</label></dt>
+ <dd><strong id="md_author_name">{md_authors.AUTHOR_NAME}</strong></dd>
+ </dl>
+ <!-- IF md_authors.AUTHOR_EMAIL -->
+ <dl>
+ <dt><label for="md_author_email">{L_AUTHOR_EMAIL}:</label></dt>
+ <dd><strong id="md_author_email"><a href="mailto:{md_authors.AUTHOR_EMAIL}">{md_authors.AUTHOR_EMAIL}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF md_authors.AUTHOR_HOMEPAGE -->
+ <dl>
+ <dt><label for="md_author_url">{L_AUTHOR_HOMEPAGE}:</label></dt>
+ <dd><strong id="md_author_url"><a href="{md_authors.AUTHOR_HOMEPAGE}">{md_authors.AUTHOR_HOMEPAGE}</a></strong></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF md_authors.AUTHOR_ROLE -->
+ <dl>
+ <dt><label for="author_role">{L_AUTHOR_ROLE}:</label></dt>
+ <dd><strong id="md_author_role">{md_authors.AUTHOR_ROLE}</strong></dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <br /><br />
+ <!-- END md_authors -->
+ </fieldset>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/includes/extension/metadata_manager.php b/phpBB/includes/extension/metadata_manager.php
index a9dcd89592..ddec918732 100644
--- a/phpBB/includes/extension/metadata_manager.php
+++ b/phpBB/includes/extension/metadata_manager.php
@@ -82,7 +82,7 @@ class phpbb_extension_metadata_manager
if ($template_output)
{
- $this->output_template_data($template);
+ $this->output_template_data();
}
return $this->metadata;
@@ -138,7 +138,7 @@ class phpbb_extension_metadata_manager
*/
private function clean_metadata_array()
{
- if (!$this->validate_name() || !$this->validate_type() || !$this->validate_license() || !$this->validate_description() || !$this->validate_version() || !$this->validate_require_phpbb() || !$this->validate_extra_display_name())
+ if (!$this->validate_name() || !$this->validate_type() || !$this->validate_licence() || !$this->validate_description() || !$this->validate_version() || !$this->validate_require_phpbb() || !$this->validate_extra_display_name())
{
return false;
}
@@ -178,7 +178,7 @@ class phpbb_extension_metadata_manager
*/
private function validate_description()
{
- return preg_match('#^{10,}$#', $this->metadata['description']);
+ return true;//preg_match('#^{10,}$#', $this->metadata['description']);
}
/**
@@ -196,10 +196,10 @@ class phpbb_extension_metadata_manager
*
* @return boolean True when passes validation
*/
- private function validate_license()
+ private function validate_licence()
{
// Nothing to validate except existence
- return isset($this->metadata['version']);
+ return isset($this->metadata['licence']);
}
/**
@@ -219,7 +219,7 @@ class phpbb_extension_metadata_manager
*/
private function validate_extra_display_name()
{
- return preg_match('#^[a-zA-Z0-9_]{2,0}$#', $this->metadata['name']);
+ return true;//preg_match('#^[a-zA-Z0-9_]{2,0}$#', $this->metadata['name']);
}
/**
@@ -328,31 +328,32 @@ class phpbb_extension_metadata_manager
*
* @return null
*/
- public function output_template_data(phpbb_template $template)
+ public function output_template_data()
{
- $template->assign_vars(array(
+
+ $this->template->assign_vars(array(
'MD_NAME' => htmlspecialchars($this->metadata['name']),
'MD_TYPE' => htmlspecialchars($this->metadata['type']),
'MD_DESCRIPTION' => htmlspecialchars($this->metadata['description']),
- 'MD_HOMEPAGE' => $this->metadata['homepage'],
+ 'MD_HOMEPAGE' => (isset($this->metadata['homepage'])) ? $this->metadata['homepage'] : '',
'MD_VERSION' => htmlspecialchars($this->metadata['version']),
'MD_TIME' => htmlspecialchars($this->metadata['time']),
- 'MD_LICENSE' => htmlspecialchars($this->metadata['license']),
- 'MD_REQUIRE_PHP' => htmlspecialchars($this->metadata['require']['php']),
- 'MD_REQUIRE_PHPBB' => htmlspecialchars($this->metadata['require']['phpbb']),
- 'MD_DISPLAY_NAME' => htmlspecialchars($this->metadata['extra']['display-name']),
+ 'MD_LICENCE' => htmlspecialchars($this->metadata['licence']),
+ 'MD_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
+ 'MD_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb']) : '',
+ 'MD_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '',
));
foreach ($this->metadata['authors'] as $author)
{
- $template->assign_block_vars('md_authors', array(
+ $this->template->assign_block_vars('md_authors', array(
'AUTHOR_NAME' => htmlspecialchars($author['name']),
'AUTHOR_EMAIL' => $author['email'],
- 'AUTHOR_HOMEPAGE' => $author['homepage'],
- 'AUTHOR_ROLE' => htmlspecialchars($author['role']),
+ 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '',
+ 'AUTHOR_ROLE' => (isset($author['role'])) ? htmlspecialchars($author['role']) : '',
));
}
-
+
return;
}
}