aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPluginManifestParser18.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-03 03:11:49 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-03 03:11:49 +0000
commit4b10b550a2449827c643c896424eb0277c43b049 (patch)
treea0b563666d98f3e32f2b502c2d6474afa3d17d86 /engine/classes/ElggPluginManifestParser18.php
parent4ad5937e6077a60ecc7ee7828fb8975af7491862 (diff)
downloadelgg-4b10b550a2449827c643c896424eb0277c43b049.tar.gz
elgg-4b10b550a2449827c643c896424eb0277c43b049.tar.bz2
Refs #1986 #2170 #2225. Added semantic manifest.xml support and unit tests. Also added plugin dependencies system. See engine/tests/test_files/plugin_18/manifest.xml for examples. Not closing tickets pending discussion.
git-svn-id: http://code.elgg.org/elgg/trunk@7512 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPluginManifestParser18.php')
-rw-r--r--engine/classes/ElggPluginManifestParser18.php43
1 files changed, 12 insertions, 31 deletions
diff --git a/engine/classes/ElggPluginManifestParser18.php b/engine/classes/ElggPluginManifestParser18.php
index 1d4e9daed..54aa9603f 100644
--- a/engine/classes/ElggPluginManifestParser18.php
+++ b/engine/classes/ElggPluginManifestParser18.php
@@ -4,6 +4,7 @@
*
* @package Elgg.Core
* @subpackage Plugins
+ * @since 1.8
*/
class ElggPluginManifestParser18 extends ElggPluginManifestParser {
/**
@@ -12,23 +13,9 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
* @var array
*/
protected $validAttributes = array(
- 'name' => null,
- 'author' => null,
- 'version' => null,
- 'blurb' => null,
- 'description' => null,
- 'website' => null,
- 'copyright' => null,
- 'license' => 'GNU Public License version 2',
- 'depends' => array(),
- 'screenshots' => array(),
- 'conflicts' => array(),
- 'provides' => array(),
- 'admin' => array(
- 'on_enable' => null,
- 'on_disable' => null,
- 'interface_type' => 'advanced'
- )
+ 'name', 'author', 'version', 'blurb', 'description',
+ 'website', 'copyright', 'license', 'requires', 'screenshot',
+ 'category', 'conflicts', 'provides', 'admin'
);
/**
@@ -37,7 +24,7 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
* @var array
*/
protected $requiredAttributes = array(
- 'name', 'author', 'version', 'description', 'depends'
+ 'name', 'author', 'version', 'description', 'requires'
);
/**
@@ -50,11 +37,8 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
foreach ($this->manifestObject->children as $element) {
switch ($element->name) {
// single elements
- // translatable
case 'blurb':
case 'description':
- $element->content = elgg_echo($element->content);
-
case 'name':
case 'author':
case 'version':
@@ -65,14 +49,8 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
break;
// arrays
- case 'screenshot':
- if (isset($element->attributes['description'])) {
- $description = elgg_echo($element->attributes['description']);
- }
- $parsed['screenshots'][] = array(
- 'description' => $description,
- 'path' => $element->content
- );
+ case 'category':
+ $parsed['category'][] = $element->content;
break;
case 'admin':
@@ -87,9 +65,10 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
break;
+ case 'screenshot':
case 'provides':
case 'conflicts':
- case 'depends':
+ case 'requires':
if (!isset($element->children)) {
return false;
}
@@ -112,7 +91,9 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
}
}
- $this->manifest = $parsed;
+ if (!$this->manifest = $parsed) {
+ return false;
+ }
return true;
}