[ticket/10631] Fixing some more issues

PHPBB3-10631
This commit is contained in:
Nathan Guse 2012-07-22 20:24:20 -05:00 committed by Unknown Bliss
parent 6b12f71b94
commit bf6e91b5f3
2 changed files with 111 additions and 110 deletions

View file

@ -1,93 +1,93 @@
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<a name="maincontent"></a> <a name="maincontent"></a>
<h1>{L_EXTENSIONS_ADMIN}</h1> <h1>{L_EXTENSIONS_ADMIN}</h1>
<p>{L_EXTENSIONS_EXPLAIN}</p> <fieldset>
<legend>{L_EXT_DETAILS}</legend>
<fieldset> <dl>
<legend>{L_EXT_DETAILS}</legend> <dt><label for="md_display_name">{L_DISPLAY_NAME}:</label></dt>
<dl> <dd><strong id="md_display_name">{MD_DISPLAY_NAME}</strong></dd>
<dt><label for="md_display_name">{L_DISPLAY_NAME}:</label></dt> </dl>
<dd><strong id="md_display_name">{MD_DISPLAY_NAME}</strong></dd> <dl>
</dl> <dt><label for="md_name">{L_CLEAN_NAME}:</label></dt>
<dl> <dd><strong id="md_name">{MD_NAME}</strong></dd>
<dt><label for="md_name">{L_CLEAN_NAME}:</label></dt> </dl>
<dd><strong id="md_name">{MD_NAME}</strong></dd> <dl>
</dl> <dt><label for="md_type">{L_TYPE}:</label></dt>
<dl> <dd><p id="md_type">{MD_TYPE}</p></dd>
<dt><label for="md_type">{L_TYPE}:</label></dt> </dl>
<dd><p id="md_type">{MD_TYPE}</p></dd> <dl>
</dl> <dt><label for="md_description">{L_DESCRIPTION}:</label></dt>
<dl> <dd><p id="md_description">{MD_DESCRIPTION}</p></dd>
<dt><label for="md_description">{L_DESCRIPTION}:</label></dt> </dl>
<dd><p id="md_description">{MD_DESCRIPTION}</p></dd> <dl>
</dl> <dt><label for="md_version">{L_VERSION}:</label></dt>
<dl> <dd><p id="md_version">{MD_VERSION}</p></dd>
<dt><label for="md_version">{L_VERSION}:</label></dt> </dl>
<dd><p id="md_version">{MD_VERSION}</p></dd> <dl>
</dl> <dt><label for="md_homepage">{L_HOMEPAGE}:</label></dt>
<dl> <dd><p id="md_homepage">{MD_HOMEPAGE}</p></dd>
<dt><label for="md_homepage">{L_HOMEPAGE}:</label></dt> </dl>
<dd><p id="md_homepage">{MD_HOMEPAGE}</p></dd> <!-- <dl>
</dl> <dt><label for="path">{L_PATH}:</label></dt>
<!-- <dl> <dd><p id="path">{PATH}</p></dd>
<dt><label for="path">{L_PATH}:</label></dt> </dl> -->
<dd><p id="path">{PATH}</p></dd> <dl>
</dl> --> <dt><label for="md_time">{L_TIME}:</label></dt>
<dl> <dd><p id="md_time">{MD_TIME}</p></dd>
<dt><label for="md_time">{L_TIME}:</label></dt> </dl>
<dd><p id="md_time">{MD_TIME}</p></dd> <dl>
</dl> <dt><label for="md_license">{L_LICENCE}:</label></dt>
<dl> <dd><p id="md_license">{MD_LICENCE}</p></dd>
<dt><label for="md_license">{L_LICENSE}:</label></dt> </dl>
<dd><p id="md_license">{MD_LICENSE}</p></dd> </fieldset>
</dl>
</fieldset> <fieldset>
<legend>{L_REQUIREMENTS}</legend>
<fieldset> <!-- IF MD_REQUIRE_PHPBB -->
<legend>{L_REQUIREMENTS}</legend> <dl>
<!-- IF MD_REQUIRE_PHPBB --> <dt><label for="require_phpbb">{L_PHPBB_VERSION}:</label></dt>
<dl> <dd><p id="require_phpbb">{MD_REQUIRE_PHPBB}</p></dd>
<dt><label for="require_phpbb">{L_PHPBB_VERSION}:</label></dt> </dl>
<dd><p id="require_phpbb">{MD_REQUIRE_PHPBB}</p></dd> <!-- ENDIF -->
</dl> <!-- IF MD_REQUIRE_PHP -->
<!-- ENDIF --> <dl>
<!-- IF MD_REQUIRE_PHP --> <dt><label for="require_php">{L_PHP_VERSION}:</label></dt>
<dl> <dd><p id="require_php">{MD_REQUIRE_PHP}</p></dd>
<dt><label for="require_php">{L_PHP_VERSION}:</label></dt> </dl>
<dd><p id="require_php">{MD_REQUIRE_PHP}</p></dd> <!-- ENDIF -->
</dl> </fieldset>
<!-- ENDIF -->
</fieldset> <fieldset>
<legend>{L_AUTHOR_INFORMATION}</legend>
<fieldset> <!-- BEGIN md_authors -->
<legend>{L_AUTHOR_INFORMATION}</legend> <dl>
<!-- BEGIN md_authors --> <dt><label for="md_author_name">{L_AUTHOR_NAME}:</label></dt>
<dl> <dd><strong id="md_author_name">{md_authors.AUTHOR_NAME}</strong></dd>
<dt><label for="md_author_name">{L_AUTHOR_NAME}:</label></dt> </dl>
<dd><strong id="md_author_name">{md_authors.AUTHOR_NAME}</strong></dd> <!-- IF md_authors.AUTHOR_EMAIL -->
</dl> <dl>
<!-- IF md_authors.AUTHOR_EMAIL --> <dt><label for="md_author_email">{L_AUTHOR_EMAIL}:</label></dt>
<dl> <dd><strong id="md_author_email"><a href="mailto:{md_authors.AUTHOR_EMAIL}">{md_authors.AUTHOR_EMAIL}</a></strong></dd>
<dt><label for="md_author_email">{L_AUTHOR_EMAIL}:</label></dt> </dl>
<dd><strong id="md_author_email"><a href="mailto:{md_authors.AUTHOR_EMAIL}">{md_authors.AUTHOR_EMAIL}</a></strong></dd> <!-- ENDIF -->
</dl> <!-- IF md_authors.AUTHOR_HOMEPAGE -->
<!-- ENDIF --> <dl>
<!-- IF md_authors.AUTHOR_HOMEPAGE --> <dt><label for="md_author_url">{L_AUTHOR_HOMEPAGE}:</label></dt>
<dl> <dd><strong id="md_author_url"><a href="{md_authors.AUTHOR_HOMEPAGE}">{md_authors.AUTHOR_HOMEPAGE}</a></strong></dd>
<dt><label for="md_author_url">{L_AUTHOR_HOMEPAGE}:</label></dt> </dl>
<dd><strong id="md_author_url"><a href="{md_authors.AUTHOR_HOMEPAGE}">{md_authors.AUTHOR_HOMEPAGE}</a></strong></dd> <!-- ENDIF -->
</dl> <!-- IF md_authors.AUTHOR_ROLE -->
<!-- ENDIF --> <dl>
<!-- IF md_authors.AUTHOR_ROLE --> <dt><label for="author_role">{L_AUTHOR_ROLE}:</label></dt>
<dl> <dd><strong id="md_author_role">{md_authors.AUTHOR_ROLE}</strong></dd>
<dt><label for="author_role">{L_AUTHOR_ROLE}:</label></dt> </dl>
<dd><strong id="md_author_role">{md_authors.AUTHOR_ROLE}</strong></dd> <!-- ENDIF -->
</dl>
<!-- ENDIF --> <br /><br />
<!-- END md_authors --> <!-- END md_authors -->
</fieldset> </fieldset>
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View file

@ -82,7 +82,7 @@ class phpbb_extension_metadata_manager
if ($template_output) if ($template_output)
{ {
$this->output_template_data($template); $this->output_template_data();
} }
return $this->metadata; return $this->metadata;
@ -138,7 +138,7 @@ class phpbb_extension_metadata_manager
*/ */
private function clean_metadata_array() 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; return false;
} }
@ -178,7 +178,7 @@ class phpbb_extension_metadata_manager
*/ */
private function validate_description() 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 * @return boolean True when passes validation
*/ */
private function validate_license() private function validate_licence()
{ {
// Nothing to validate except existence // 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() 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 * @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_NAME' => htmlspecialchars($this->metadata['name']),
'MD_TYPE' => htmlspecialchars($this->metadata['type']), 'MD_TYPE' => htmlspecialchars($this->metadata['type']),
'MD_DESCRIPTION' => htmlspecialchars($this->metadata['description']), '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_VERSION' => htmlspecialchars($this->metadata['version']),
'MD_TIME' => htmlspecialchars($this->metadata['time']), 'MD_TIME' => htmlspecialchars($this->metadata['time']),
'MD_LICENSE' => htmlspecialchars($this->metadata['license']), 'MD_LICENCE' => htmlspecialchars($this->metadata['licence']),
'MD_REQUIRE_PHP' => htmlspecialchars($this->metadata['require']['php']), 'MD_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
'MD_REQUIRE_PHPBB' => htmlspecialchars($this->metadata['require']['phpbb']), 'MD_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb']) : '',
'MD_DISPLAY_NAME' => htmlspecialchars($this->metadata['extra']['display-name']), 'MD_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '',
)); ));
foreach ($this->metadata['authors'] as $author) 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_NAME' => htmlspecialchars($author['name']),
'AUTHOR_EMAIL' => $author['email'], 'AUTHOR_EMAIL' => $author['email'],
'AUTHOR_HOMEPAGE' => $author['homepage'], 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '',
'AUTHOR_ROLE' => htmlspecialchars($author['role']), 'AUTHOR_ROLE' => (isset($author['role'])) ? htmlspecialchars($author['role']) : '',
)); ));
} }
return; return;
} }
} }