diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-09-22 17:01:17 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-09-22 17:01:17 +0000 |
commit | 965cbe52f22809f19ca150feb585b0218aa89f85 (patch) | |
tree | fc1b59b44c5ecbaedf27cc8c71e7abc80a15305e /engine/classes/ElggPlugin.php | |
parent | 56b3e3dcd833a8a9124581b536c69806962b9640 (diff) | |
download | elgg-965cbe52f22809f19ca150feb585b0218aa89f85.tar.gz elgg-965cbe52f22809f19ca150feb585b0218aa89f85.tar.bz2 |
Converted line endings to unix.
git-svn-id: http://code.elgg.org/elgg/trunk@6957 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggPlugin.php')
-rw-r--r-- | engine/classes/ElggPlugin.php | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php index c666b8438..3bbbc02fe 100644 --- a/engine/classes/ElggPlugin.php +++ b/engine/classes/ElggPlugin.php @@ -1,66 +1,66 @@ -<?php
-/**
- * Stores site-side plugin settings as private data.
- *
- * This class is currently a stub, allowing a plugin to
- * save settings in an object's private settings for each site.
- *
- * @package Elgg.Core
- * @subpackage Plugins.Settings
- */
-class ElggPlugin extends ElggObject {
- protected function initialise_attributes() {
- parent::initialise_attributes();
-
- $this->attributes['subtype'] = "plugin";
- }
-
- public function __construct($guid = null) {
- parent::__construct($guid);
- }
-
- /**
- * Get a value from private settings.
- *
- * @param string $name
- * @return mixed
- */
- public function get($name) {
- // See if its in our base attribute
- if (isset($this->attributes[$name])) {
- return $this->attributes[$name];
- }
-
- // No, so see if its in the private data store.
- // get_private_setting() returns false if it doesn't exist
- $meta = get_private_setting($this->guid, $name);
-
- if ($meta === false) {
- // Can't find it, so return null
- return NULL;
- }
-
- return $meta;
- }
-
- /**
- * Save a value to private settings.
- *
- * @param string $name
- * @param mixed $value
- */
- public function set($name, $value) {
- if (array_key_exists($name, $this->attributes)) {
- // Check that we're not trying to change the guid!
- if ((array_key_exists('guid', $this->attributes)) && ($name=='guid')) {
- return false;
- }
-
- $this->attributes[$name] = $value;
- } else {
- return set_private_setting($this->guid, $name, $value);
- }
-
- return true;
- }
+<?php +/** + * Stores site-side plugin settings as private data. + * + * This class is currently a stub, allowing a plugin to + * save settings in an object's private settings for each site. + * + * @package Elgg.Core + * @subpackage Plugins.Settings + */ +class ElggPlugin extends ElggObject { + protected function initialise_attributes() { + parent::initialise_attributes(); + + $this->attributes['subtype'] = "plugin"; + } + + public function __construct($guid = null) { + parent::__construct($guid); + } + + /** + * Get a value from private settings. + * + * @param string $name + * @return mixed + */ + public function get($name) { + // See if its in our base attribute + if (isset($this->attributes[$name])) { + return $this->attributes[$name]; + } + + // No, so see if its in the private data store. + // get_private_setting() returns false if it doesn't exist + $meta = get_private_setting($this->guid, $name); + + if ($meta === false) { + // Can't find it, so return null + return NULL; + } + + return $meta; + } + + /** + * Save a value to private settings. + * + * @param string $name + * @param mixed $value + */ + public function set($name, $value) { + if (array_key_exists($name, $this->attributes)) { + // Check that we're not trying to change the guid! + if ((array_key_exists('guid', $this->attributes)) && ($name=='guid')) { + return false; + } + + $this->attributes[$name] = $value; + } else { + return set_private_setting($this->guid, $name, $value); + } + + return true; + } }
\ No newline at end of file |