aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-08 18:33:37 -0400
committerCash Costello <cash.costello@gmail.com>2011-10-08 18:33:37 -0400
commitc8bbc359656ced62de84511bb7bd8cb304609abb (patch)
treee387e829680515a7e085be51f832f4b85e204e9e /engine/classes
parentf7ae8c1440dcb56dc7a2133d46ab50abf80398d8 (diff)
downloadelgg-c8bbc359656ced62de84511bb7bd8cb304609abb.tar.gz
elgg-c8bbc359656ced62de84511bb7bd8cb304609abb.tar.bz2
Fixes #3743 returning bool instead of int when setting a private setting
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggPlugin.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php
index 4aee1e898..c4d6ec034 100644
--- a/engine/classes/ElggPlugin.php
+++ b/engine/classes/ElggPlugin.php
@@ -264,8 +264,6 @@ class ElggPlugin extends ElggObject {
/**
* Returns a plugin setting
*
- * @todo These need to be namespaced
- *
* @param string $name The setting name
* @return mixed
*/
@@ -318,7 +316,6 @@ class ElggPlugin extends ElggObject {
* Set a plugin setting for the plugin
*
* @todo This will only work once the plugin has a GUID.
- * @todo These need to be namespaced.
*
* @param string $name The name to set
* @param string $value The value to set
@@ -329,13 +326,6 @@ class ElggPlugin extends ElggObject {
if (!$this->guid) {
return false;
}
- // Hook to validate setting
- $value = elgg_trigger_plugin_hook('setting', 'plugin', array(
- 'plugin_id' => $this->pluginID,
- 'plugin' => $this,
- 'name' => $name,
- 'value' => $value
- ), $value);
return $this->set($name, $value);
}
@@ -902,7 +892,9 @@ class ElggPlugin extends ElggObject {
}
/**
- * Save a value to private settings.
+ * Save a value as private setting or attribute.
+ *
+ * Attributes include title and description.
*
* @param string $name Name
* @param mixed $value Value
@@ -920,6 +912,14 @@ class ElggPlugin extends ElggObject {
return true;
} else {
+ // Hook to validate setting
+ $value = elgg_trigger_plugin_hook('setting', 'plugin', array(
+ 'plugin_id' => $this->pluginID,
+ 'plugin' => $this,
+ 'name' => $name,
+ 'value' => $value
+ ), $value);
+
return $this->setPrivateSetting($name, $value);
}
}