aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggPluginManifest.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 23:00:23 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-02 23:00:23 +0000
commitfc21edb0785f2cac11dc592278fad97fffeeb082 (patch)
tree24047873840c5931766abaa5b15a73c0692e7565 /engine/classes/ElggPluginManifest.php
parenta826bea54e8934c19b2ada619d966cc7d9628b42 (diff)
downloadelgg-fc21edb0785f2cac11dc592278fad97fffeeb082.tar.gz
elgg-fc21edb0785f2cac11dc592278fad97fffeeb082.tar.bz2
Fixes #1986, #2170, #2225, #2759. Integrated ElggPluginPackage and ElggPluginManifest with ElggPlugin. System now uses ElggPlugin objects to determin plugins. Order is stored in private settings. This absolutely requires running upgrade.php.
git-svn-id: http://code.elgg.org/elgg/trunk@7817 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPluginManifest.php')
-rw-r--r--engine/classes/ElggPluginManifest.php71
1 files changed, 71 insertions, 0 deletions
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index 801769eb9..9fcdaaf55 100644
--- a/engine/classes/ElggPluginManifest.php
+++ b/engine/classes/ElggPluginManifest.php
@@ -481,6 +481,77 @@ class ElggPluginManifest {
}
/**
+ * Returns the functions to run upon activation
+ *
+ * @return array
+ */
+ public function getOnActivate() {
+ $functions = $this->parser->getAttribute('on_activate');
+
+ if (!$functions) {
+ $functions = array();
+ }
+
+ return $functions;
+ }
+
+ /**
+ * Returns the functions to run upon deactivation
+ *
+ * @return array
+ */
+ public function getOnDeactivate() {
+ $functions = $this->parser->getAttribute('on_deactivate');
+
+ if (!$functions) {
+ $functions = array();
+ }
+
+ return $functions;
+ }
+
+ /**
+ * Returns the admin interface to use.
+ *
+ * @return string simple or advanced
+ */
+ public function getAdminInterface() {
+ $interface = $this->parser->getAttribute('admin_interface');
+
+ switch ($interface) {
+ case 'simple':
+ case 'advanced':
+ return $interface;
+
+ default:
+ return 'advanced';
+ }
+ }
+
+ /**
+ * Returns the admin interface to use.
+ *
+ * @return bool
+ */
+ public function getActivateOnInstall() {
+ $activate = $this->parser->getAttribute('activate_on_install');
+ switch (strtolower($activate)) {
+ case 'yes':
+ case 'true':
+ case 'on':
+ case 1:
+ return true;
+
+ case 'no':
+ case 'false':
+ case 'off':
+ case 0:
+ case '':
+ return false;
+ }
+ }
+
+ /**
* Normalizes an array into the structure specified
*
* @param array $struct The struct to normalize $element to.