From 595ebfe0b3771df92055334bfe5da8b29c840c3b Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 4 Feb 2011 21:45:55 +0000 Subject: Renamed 'name' to 'plugin' for priority req. Updated unit tests and docs. git-svn-id: http://code.elgg.org/elgg/trunk@8019 36083f99-b078-4883-b0ff-0f9b5a30f544 --- documentation/examples/plugins/manifest.xml | 2 +- engine/classes/ElggPluginManifest.php | 2 +- engine/classes/ElggPluginPackage.php | 2 +- engine/lib/plugins.php | 4 ++-- engine/tests/api/plugins.php | 2 ++ engine/tests/test_files/plugin_18/manifest.xml | 6 ++++++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/documentation/examples/plugins/manifest.xml b/documentation/examples/plugins/manifest.xml index 1c14a3990..a61106e62 100644 --- a/documentation/examples/plugins/manifest.xml +++ b/documentation/examples/plugins/manifest.xml @@ -75,7 +75,7 @@ priority after - blog + blog diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 95f008f98..34af6cd21 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -37,8 +37,8 @@ class ElggPluginManifest { */ private $depsRequiresStructPriority = array( 'type' => '', - 'name' => '', 'priority' => '', + 'plugin' => '' ); /* diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index db62620a8..84cb8c1db 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -411,7 +411,7 @@ class ElggPluginPackage { $this_priority = $this_plugin->getPriority(); foreach ($plugins as $test_plugin) { - if ($test_plugin->getID() == $dep['name']) { + if ($test_plugin->getID() == $dep['plugin']) { break; } } diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 01cbf631a..cf0ac5af1 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -715,8 +715,8 @@ function elgg_get_plugin_dependency_strings($dep) { $expected_priority = ucwords($info['priority']); $real_priority = ucwords($dep['value']); $strings['name'] = elgg_echo('ElggPlugin:Dependencies:Priority'); - $strings['expected_value'] = elgg_echo("ElggPlugin:Dependencies:Priority:$expected_priority", array($info['name'])); - $strings['local_value'] = elgg_echo("ElggPlugin:Dependencies:Priority:$real_priority", array($info['name'])); + $strings['expected_value'] = elgg_echo("ElggPlugin:Dependencies:Priority:$expected_priority", array($info['plugin'])); + $strings['local_value'] = elgg_echo("ElggPlugin:Dependencies:Priority:$real_priority", array($info['plugin'])); $strings['comment'] = ''; break; } diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 997d69fb7..ac1278410 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -80,6 +80,7 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'plugin', 'name' => 'fake_plugin', 'version' => '1.0'), array('type' => 'plugin', 'name' => 'profile', 'version' => '1.0'), array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.3', 'comparison' => 'lt'), + array('type' => 'priority', 'priority' => 'after', 'plugin' => 'profile'), ), 'screenshot' => array( @@ -183,6 +184,7 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'plugin', 'name' => 'fake_plugin', 'version' => '1.0', 'comparison' => 'ge'), array('type' => 'plugin', 'name' => 'profile', 'version' => '1.0', 'comparison' => 'ge'), array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.3', 'comparison' => 'lt'), + array('type' => 'priority', 'priority' => 'after', 'plugin' => 'profile'), ); $this->assertEqual($this->package18->getManifest()->getRequires(), $requires); diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml index 69166c89c..2a4d72c65 100644 --- a/engine/tests/test_files/plugin_18/manifest.xml +++ b/engine/tests/test_files/plugin_18/manifest.xml @@ -75,6 +75,12 @@ lt + + priority + after + profile + + plugin profile_api -- cgit v1.2.3