aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/widgets.php
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-09-06 02:42:09 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-09-06 02:42:09 +0000
commit76dac45ebaf104b312a8527a05424601ca9d520a (patch)
tree7440558a893ebf1d3816829ecbb96c3b0df9b4f0 /engine/lib/widgets.php
parent9e8baf614938dfd1687ddce39b409c3c0e5c5753 (diff)
downloadelgg-76dac45ebaf104b312a8527a05424601ca9d520a.tar.gz
elgg-76dac45ebaf104b312a8527a05424601ca9d520a.tar.bz2
Refs #2220: Pulled most classes / interfaces out of lib files (except query.php and exception.php) into "classes" folder. Replaced inline classes with "require_once" statements for now. Ran unit tests to verify functionality before committing.
git-svn-id: http://code.elgg.org/elgg/trunk@6908 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r--engine/lib/widgets.php52
1 files changed, 1 insertions, 51 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 03524da62..210aa198f 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -8,57 +8,7 @@
* @link http://elgg.org/
*/
-/**
- * Override ElggObject in order to store widget data in ultra-private stores.
- */
-class ElggWidget extends ElggObject {
- protected function initialise_attributes() {
- parent::initialise_attributes();
-
- $this->attributes['subtype'] = "widget";
- }
-
- public function __construct($guid = null) {
- parent::__construct($guid);
- }
-
- /**
- * Override entity get and sets in order to save data to private data store.
- */
- 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.
- $meta = get_private_setting($this->guid, $name);
- if ($meta) {
- return $meta;
- }
-
- // Can't find it, so return null
- return null;
- }
-
- /**
- * Override entity get and sets in order to save data to private data store.
- */
- 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;
- }
-}
+require_once dirname(dirname(__FILE__)).'/classes/ElggWidget.php';
/**
* Register a particular context for use with widgets.