diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-04 21:04:34 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-04 21:04:34 +0000 |
commit | 1026deb7ef24677a2a0b48b4297911a4c2eceb6d (patch) | |
tree | f155d96d9369aab9adae2f2c07c69fac1fd84914 /engine/lib | |
parent | 21874b0235acfe83d9f260d9bc71489dbce9172f (diff) | |
download | elgg-1026deb7ef24677a2a0b48b4297911a4c2eceb6d.tar.gz elgg-1026deb7ef24677a2a0b48b4297911a4c2eceb6d.tar.bz2 |
Added new priority 'requires' for plugin dep system. You can now say that a plugin is required to be after / before another plugin in the system.
git-svn-id: http://code.elgg.org/elgg/trunk@8016 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/plugins.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 2174814bd..e61874ebc 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -669,6 +669,7 @@ function elgg_get_plugin_dependency_strings($dep) { 'requires' 'php setting bob' >3 3 'change it' 'conflicts' 'php setting' >3 4 'change it' 'provides' 'plugin oauth_lib' 1.3 -- -- + 'priority' 'before blog' -- after 'move it' */ $strings = array(); $strings['type'] = elgg_echo('ElggPlugin:Dependencies:' . ucwords($dep_system)); @@ -678,7 +679,7 @@ function elgg_get_plugin_dependency_strings($dep) { case 'elgg_release': // 'Elgg Version' $strings['name'] = elgg_echo('ElggPlugin:Dependencies:Elgg'); - $strings['value'] = "$comparison {$info['version']}"; + $strings['expected_value'] = "$comparison {$info['version']}"; $strings['local_value'] = $dep['value']; $strings['comment'] = ''; break; @@ -687,10 +688,10 @@ function elgg_get_plugin_dependency_strings($dep) { // PHP Extension %s [version] $strings['name'] = elgg_echo('ElggPlugin:Dependencies:PhpExtension', array($info['name'])); if ($info['version']) { - $strings['value'] = "$comparison {$info['version']}"; + $strings['expected_value'] = "$comparison {$info['version']}"; $strings['local_value'] = $dep['value']; } else { - $strings['value'] = ''; + $strings['expected_value'] = ''; $strings['local_value'] = ''; } $strings['comment'] = ''; @@ -698,17 +699,26 @@ function elgg_get_plugin_dependency_strings($dep) { case 'php_ini': $strings['name'] = elgg_echo('ElggPlugin:Dependencies:PhpIni', array($info['name'])); - $strings['value'] = "$comparison {$info['value']}"; + $strings['expected_value'] = "$comparison {$info['value']}"; $strings['local_value'] = $dep['value']; $strings['comment'] = ''; break; case 'plugin': $strings['name'] = elgg_echo('ElggPlugin:Dependencies:Plugin', array($info['name'])); - $strings['value'] = "$comparison {$info['version']}"; + $strings['expected_value'] = "$comparison {$info['version']}"; $strings['local_value'] = $dep['version']; $strings['comment'] = ''; break; + + case 'priority': + $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['comment'] = ''; + break; } if ($dep['status']) { |