From 3d3312d47597249def3ed8efdcbf68869e3fef31 Mon Sep 17 00:00:00 2001
From: cash
Date: Fri, 23 Dec 2011 15:07:03 -0500
Subject: Refs #4239 improved the documentation on ElggBatch for the limit
option
---
engine/classes/ElggBatch.php | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggBatch.php b/engine/classes/ElggBatch.php
index 62128e34f..2a97f9ff5 100644
--- a/engine/classes/ElggBatch.php
+++ b/engine/classes/ElggBatch.php
@@ -92,7 +92,7 @@ class ElggBatch
/**
* Stop after this many results.
*
- * @var unknown_type
+ * @var int
*/
private $limit = 0;
@@ -147,7 +147,9 @@ class ElggBatch
*
* @param string $getter The function used to get objects. Usually
* an elgg_get_*() function, but can be any valid PHP callback.
- * @param array $options The options array to pass to the getter function
+ * @param array $options The options array to pass to the getter function. If limit is
+ * not set, 10 is used as the default. In most cases that is not
+ * what you want.
* @param mixed $callback An optional callback function that all results will be passed
* to upon load. The callback needs to accept $result, $getter,
* $options.
@@ -319,13 +321,13 @@ class ElggBatch
*/
public function next() {
// if we'll be at the end.
- if ($this->processedResults + 1 >= $this->limit && $this->limit > 0) {
+ if (($this->processedResults + 1) >= $this->limit && $this->limit > 0) {
$this->results = array();
return false;
}
// if we'll need new results.
- if ($this->resultIndex + 1 >= $this->chunkSize) {
+ if (($this->resultIndex + 1) >= $this->chunkSize) {
if (!$this->getNextResultsChunk()) {
$this->results = array();
return false;
@@ -356,4 +358,4 @@ class ElggBatch
$key = key($this->results);
return ($key !== NULL && $key !== FALSE);
}
-}
\ No newline at end of file
+}
--
cgit v1.2.3
From a34a741acf7a6c9c468009f76d33ed4ee1fcfb65 Mon Sep 17 00:00:00 2001
From: Jeroen Dalsem
Date: Thu, 29 Dec 2011 11:19:32 +0100
Subject: Small typo. Seems to work, but i prefer it nice and tidy :)
---
engine/classes/ElggWidget.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index 0eb83913b..df807e3f7 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -140,7 +140,7 @@ class ElggWidget extends ElggObject {
$this->order = $widgets[$rank]->order;
for ($index = $rank; $index < count($widgets); $index++) {
if ($widgets[$index]->guid != $this->guid) {
- $widgets[$index]-> order += 10;
+ $widgets[$index]->order += 10;
}
}
}
--
cgit v1.2.3
From 8bb4bbe9fb32e0b0b0c8cf687d19f58a0e39f89a Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 31 Dec 2011 15:23:32 -0500
Subject: Fixes #4259 using container guid for widgets when moving
---
engine/classes/ElggWidget.php | 1 +
1 file changed, 1 insertion(+)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index df807e3f7..7a5a37ac8 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -115,6 +115,7 @@ class ElggWidget extends ElggObject {
$options = array(
'type' => 'object',
'subtype' => 'widget',
+ 'container_guid' => $this->container_guid,
'private_setting_name_value_pairs' => array(
array('name' => 'context', 'value' => $this->getContext()),
array('name' => 'column', 'value' => $column)
--
cgit v1.2.3
From 7684d074729c787c03dca4b394f9b0b6a3f108e9 Mon Sep 17 00:00:00 2001
From: Evan Winslow
Date: Sat, 31 Dec 2011 12:31:43 -0800
Subject: Refs #3209: Adds property docs for the four main entity classes
---
engine/classes/ElggGroup.php | 3 +++
engine/classes/ElggObject.php | 3 +++
engine/classes/ElggSite.php | 4 ++++
engine/classes/ElggUser.php | 9 +++++++++
4 files changed, 19 insertions(+)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggGroup.php b/engine/classes/ElggGroup.php
index 0190e5eac..ab223e1a4 100644
--- a/engine/classes/ElggGroup.php
+++ b/engine/classes/ElggGroup.php
@@ -5,6 +5,9 @@
*
* @package Elgg.Core
* @subpackage Groups
+ *
+ * @property string $name A short name that captures the purpose of the group
+ * @property string $description A longer body of content that gives more details about the group
*/
class ElggGroup extends ElggEntity
implements Friendable {
diff --git a/engine/classes/ElggObject.php b/engine/classes/ElggObject.php
index 0b8340697..582308f28 100644
--- a/engine/classes/ElggObject.php
+++ b/engine/classes/ElggObject.php
@@ -14,6 +14,9 @@
*
* @package Elgg.Core
* @subpackage DataModel.Object
+ *
+ * @property string $title The title, name, or summary of this object
+ * @property string $description The body, description, or content of the object
*/
class ElggObject extends ElggEntity {
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 3ccb146fb..686046512 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -21,6 +21,10 @@
* @package Elgg.Core
* @subpackage DataMode.Site
* @link http://docs.elgg.org/DataModel/Sites
+ *
+ * @property string $name The name or title of the website
+ * @property string $description A motto, mission statement, or description of the website
+ * @property string $url The root web address for the site, including trailing slash
*/
class ElggSite extends ElggEntity {
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index a1c7147a5..ab0610ac0 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -6,6 +6,15 @@
*
* @package Elgg.Core
* @subpackage DataModel.User
+ *
+ * @property string $name The display name that the user will be known by in the network
+ * @property string $username The short, reference name for the user in the network
+ * @property string $email The email address to which Elgg will send email notifications
+ * @property string $language The language preference of the user (ISO 639-1 formatted)
+ * @property string $banned 'yes' if the user is banned from the network, 'no' otherwise
+ * @property string $admin 'yes' if the user is an administrator of the network, 'no' otherwise
+ * @property string $password The hashed password of the user
+ * @property string $salt The salt used to secure the password before hashing
*/
class ElggUser extends ElggEntity
implements Friendable {
--
cgit v1.2.3
From dfcd3dafeeb61fe61fec96f4a0a6c09ed92deda7 Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 31 Dec 2011 17:22:55 -0500
Subject: Fixes #4255 new widget ordering code
---
engine/classes/ElggWidget.php | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index 7a5a37ac8..70eaf8a73 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -133,17 +133,30 @@ class ElggWidget extends ElggObject {
if ($rank == 0) {
// top of the column
$this->order = $widgets[0]->order - 10;
- } elseif ($rank == count($widgets)) {
+ } elseif ($rank == (count($widgets)-1)) {
// bottom of the column
$this->order = end($widgets)->order + 10;
} else {
- // reorder widgets that are below
- $this->order = $widgets[$rank]->order;
- for ($index = $rank; $index < count($widgets); $index++) {
- if ($widgets[$index]->guid != $this->guid) {
- $widgets[$index]->order += 10;
+ // reorder widgets
+
+ // remove the widget that's being moved from the array
+ foreach ($widgets as $index => $widget) {
+ if ($widget->guid == $this->guid) {
+ unset($widgets[$index]);
}
}
+
+ // split the array in two and recombine with the moved array in middle
+ $before = array_slice($widgets, 0, $rank);
+ array_push($before, $this);
+ $after = array_slice($widgets, $rank);
+ $widgets = array_merge($before, $after);
+ ksort($widgets);
+ $order = 0;
+ foreach ($widgets as $widget) {
+ $widget->order = $order;
+ $order += 10;
+ }
}
$this->column = $column;
}
--
cgit v1.2.3
From 7916edda4afa2c75654a120a40f2e04c46079b57 Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 31 Dec 2011 20:21:37 -0500
Subject: Fixes #4204 using only the relationship for getting members of a site
---
engine/classes/ElggSite.php | 2 ++
1 file changed, 2 insertions(+)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 686046512..7ea52a195 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -235,6 +235,7 @@ class ElggSite extends ElggEntity {
}
$defaults = array(
+ 'site_guids' => ELGG_ENTITIES_ANY_VALUE,
'relationship' => 'member_of_site',
'relationship_guid' => $this->getGUID(),
'inverse_relationship' => TRUE,
@@ -258,6 +259,7 @@ class ElggSite extends ElggEntity {
*/
public function listMembers($options = array()) {
$defaults = array(
+ 'site_guids' => ELGG_ENTITIES_ANY_VALUE,
'relationship' => 'member_of_site',
'relationship_guid' => $this->getGUID(),
'inverse_relationship' => TRUE,
--
cgit v1.2.3
From 3a58c21904d22c0e2f80891f265ba4d687f838e3 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 1 Jan 2012 17:40:17 -0500
Subject: Refs #2290 removes check for username
---
engine/classes/ElggDiskFilestore.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggDiskFilestore.php b/engine/classes/ElggDiskFilestore.php
index 11b2bd947..f00376481 100644
--- a/engine/classes/ElggDiskFilestore.php
+++ b/engine/classes/ElggDiskFilestore.php
@@ -205,7 +205,7 @@ class ElggDiskFilestore extends ElggFilestore {
$owner = elgg_get_logged_in_user_entity();
}
- if ((!$owner) || (!$owner->username)) {
+ if (!$owner) {
$msg = elgg_echo('InvalidParameterException:MissingOwner',
array($file->getFilename(), $file->guid));
throw new InvalidParameterException($msg);
--
cgit v1.2.3
From cfaa3452ae1e6035e5b9ecb668d29330b34499c2 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 1 Jan 2012 17:55:42 -0500
Subject: fixed copy and paste error in documentation of ElggCache
---
engine/classes/ElggCache.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggCache.php b/engine/classes/ElggCache.php
index 5c2cafcb7..dd53525b8 100644
--- a/engine/classes/ElggCache.php
+++ b/engine/classes/ElggCache.php
@@ -29,7 +29,7 @@ abstract class ElggCache implements ArrayAccess {
*
* @return void
*
- * @deprecated 1.8 Use ElggAccess:setVariable()
+ * @deprecated 1.8 Use ElggCache:setVariable()
*/
public function set_variable($variable, $value) {
elgg_deprecated_notice('ElggCache::set_variable() is deprecated by ElggCache::setVariable()', 1.8);
--
cgit v1.2.3
From ce691dd8c560abc48aaf578928d13dea6ef31565 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 1 Jan 2012 18:30:17 -0500
Subject: Fixes #3209 finished adding class properties documentation
---
engine/classes/ElggExtender.php | 11 +++++++++--
engine/classes/ElggObject.php | 1 +
engine/classes/ElggRelationship.php | 6 ++++++
engine/classes/ElggRiverItem.php | 11 +++++++++++
mod/blog/classes/ElggBlog.php | 4 ++++
mod/thewire/classes/ElggWire.php | 4 ++++
6 files changed, 35 insertions(+), 2 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggExtender.php b/engine/classes/ElggExtender.php
index d6f79d18d..bc2d67ae2 100644
--- a/engine/classes/ElggExtender.php
+++ b/engine/classes/ElggExtender.php
@@ -3,8 +3,7 @@
* The base class for ElggEntity extenders.
*
* Extenders allow you to attach extended information to an
- * ElggEntity. Core supports two: ElggAnnotation, ElggMetadata,
- * and ElggRelationship
+ * ElggEntity. Core supports two: ElggAnnotation and ElggMetadata.
*
* Saving the extender data to database is handled by the child class.
*
@@ -16,6 +15,14 @@
* @link http://docs.elgg.org/DataModel/Extenders
* @see ElggAnnotation
* @see ElggMetadata
+ *
+ * @property string $type annotation or metadata (read-only after save)
+ * @property int $id The unique identifier (read-only)
+ * @property int $entity_guid The GUID of the entity that this extender describes
+ * @property int $access_id Specifies the visibility level of this extender
+ * @property string $name The name of this extender
+ * @property mixed $value The value of the extender (int or string)
+ * @property int $time_created A UNIX timestamp of when the extender was created (read-only, set on first save)
*/
abstract class ElggExtender extends ElggData
{
diff --git a/engine/classes/ElggObject.php b/engine/classes/ElggObject.php
index 582308f28..649e32490 100644
--- a/engine/classes/ElggObject.php
+++ b/engine/classes/ElggObject.php
@@ -17,6 +17,7 @@
*
* @property string $title The title, name, or summary of this object
* @property string $description The body, description, or content of the object
+ * @property array $tags Array of tags that describe the object
*/
class ElggObject extends ElggEntity {
diff --git a/engine/classes/ElggRelationship.php b/engine/classes/ElggRelationship.php
index 2d9a32cbd..efc0f7eff 100644
--- a/engine/classes/ElggRelationship.php
+++ b/engine/classes/ElggRelationship.php
@@ -4,6 +4,12 @@
*
* @package Elgg.Core
* @subpackage Core
+ *
+ * @property int $id The unique identifier (read-only)
+ * @property int $guid_one The GUID of the subject of the relationship
+ * @property string $relationship The name of the relationship
+ * @property int $guid_two The GUID of the object of the relationship
+ * @property int $time_created A UNIX timestamp of when the relationship was created (read-only, set on first save)
*/
class ElggRelationship extends ElggData implements
Importable
diff --git a/engine/classes/ElggRiverItem.php b/engine/classes/ElggRiverItem.php
index fcc8f9c85..8fef6bb9d 100644
--- a/engine/classes/ElggRiverItem.php
+++ b/engine/classes/ElggRiverItem.php
@@ -4,6 +4,17 @@
*
* @package Elgg.Core
* @subpackage Core
+ *
+ * @property int $id The unique identifier (read-only)
+ * @property int $subject_guid The GUID of the actor
+ * @property int $object_guid The GUID of the object
+ * @property int $annotation_id The ID of the annotation involved in the action
+ * @property string $type The type of one of the entities involved in the action
+ * @property string $subtype The subtype of one of the entities involved in the action
+ * @property string $action_type The name of the action
+ * @property string $view The view for displaying this river item
+ * @property int $access_id The visibility of the river item
+ * @property int $posted UNIX timestamp when the action occurred
*/
class ElggRiverItem
{
diff --git a/mod/blog/classes/ElggBlog.php b/mod/blog/classes/ElggBlog.php
index ee2ec73ef..8d4401c57 100644
--- a/mod/blog/classes/ElggBlog.php
+++ b/mod/blog/classes/ElggBlog.php
@@ -1,6 +1,10 @@
Date: Sat, 7 Jan 2012 11:31:03 -0500
Subject: pulled ODD classes out of ODDEntity
---
engine/classes/ODDEntity.php | 72 --------------------------------------
engine/classes/ODDMetaData.php | 39 +++++++++++++++++++++
engine/classes/ODDRelationship.php | 33 +++++++++++++++++
3 files changed, 72 insertions(+), 72 deletions(-)
create mode 100644 engine/classes/ODDMetaData.php
create mode 100644 engine/classes/ODDRelationship.php
(limited to 'engine/classes')
diff --git a/engine/classes/ODDEntity.php b/engine/classes/ODDEntity.php
index ab3a49168..e9bb5da6a 100644
--- a/engine/classes/ODDEntity.php
+++ b/engine/classes/ODDEntity.php
@@ -32,75 +32,3 @@ class ODDEntity extends ODD {
return "entity";
}
}
-
-/**
- * ODD Metadata class.
- *
- * @package Elgg.Core
- * @subpackage ODD
- */
-class ODDMetaData extends ODD {
-
- /**
- * New ODD metadata
- *
- * @param unknown_type $uuid Unique ID
- * @param unknown_type $entity_uuid Another unique ID
- * @param unknown_type $name Name
- * @param unknown_type $value Value
- * @param unknown_type $type Type
- * @param unknown_type $owner_uuid Owner ID
- */
- function __construct($uuid, $entity_uuid, $name, $value, $type = "", $owner_uuid = "") {
- parent::__construct();
-
- $this->setAttribute('uuid', $uuid);
- $this->setAttribute('entity_uuid', $entity_uuid);
- $this->setAttribute('name', $name);
- $this->setAttribute('type', $type);
- $this->setAttribute('owner_uuid', $owner_uuid);
- $this->setBody($value);
- }
-
- /**
- * Returns 'metadata'
- *
- * @return 'metadata'
- */
- protected function getTagName() {
- return "metadata";
- }
-}
-
-/**
- * ODD Relationship class.
- *
- * @package Elgg
- * @subpackage Core
- */
-class ODDRelationship extends ODD {
-
- /**
- * New ODD Relationship
- *
- * @param unknown_type $uuid1 First UUID
- * @param unknown_type $type Type of telationship
- * @param unknown_type $uuid2 Second UUId
- */
- function __construct($uuid1, $type, $uuid2) {
- parent::__construct();
-
- $this->setAttribute('uuid1', $uuid1);
- $this->setAttribute('type', $type);
- $this->setAttribute('uuid2', $uuid2);
- }
-
- /**
- * Returns 'relationship'
- *
- * @return 'relationship'
- */
- protected function getTagName() {
- return "relationship";
- }
-}
diff --git a/engine/classes/ODDMetaData.php b/engine/classes/ODDMetaData.php
new file mode 100644
index 000000000..58862e0fb
--- /dev/null
+++ b/engine/classes/ODDMetaData.php
@@ -0,0 +1,39 @@
+setAttribute('uuid', $uuid);
+ $this->setAttribute('entity_uuid', $entity_uuid);
+ $this->setAttribute('name', $name);
+ $this->setAttribute('type', $type);
+ $this->setAttribute('owner_uuid', $owner_uuid);
+ $this->setBody($value);
+ }
+
+ /**
+ * Returns 'metadata'
+ *
+ * @return 'metadata'
+ */
+ protected function getTagName() {
+ return "metadata";
+ }
+}
diff --git a/engine/classes/ODDRelationship.php b/engine/classes/ODDRelationship.php
new file mode 100644
index 000000000..2906b1c73
--- /dev/null
+++ b/engine/classes/ODDRelationship.php
@@ -0,0 +1,33 @@
+setAttribute('uuid1', $uuid1);
+ $this->setAttribute('type', $type);
+ $this->setAttribute('uuid2', $uuid2);
+ }
+
+ /**
+ * Returns 'relationship'
+ *
+ * @return 'relationship'
+ */
+ protected function getTagName() {
+ return "relationship";
+ }
+}
--
cgit v1.2.3
From 1973a28f46d8678c79721aeca63b007f2b20bdcb Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sat, 7 Jan 2012 11:38:00 -0500
Subject: Refs #3209 fixed spacing and added options for wire method
---
engine/classes/ElggRiverItem.php | 23 +++++++++++------------
mod/thewire/classes/ElggWire.php | 2 +-
2 files changed, 12 insertions(+), 13 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggRiverItem.php b/engine/classes/ElggRiverItem.php
index 8fef6bb9d..d3d09cd91 100644
--- a/engine/classes/ElggRiverItem.php
+++ b/engine/classes/ElggRiverItem.php
@@ -5,19 +5,18 @@
* @package Elgg.Core
* @subpackage Core
*
- * @property int $id The unique identifier (read-only)
- * @property int $subject_guid The GUID of the actor
- * @property int $object_guid The GUID of the object
- * @property int $annotation_id The ID of the annotation involved in the action
- * @property string $type The type of one of the entities involved in the action
- * @property string $subtype The subtype of one of the entities involved in the action
- * @property string $action_type The name of the action
- * @property string $view The view for displaying this river item
- * @property int $access_id The visibility of the river item
- * @property int $posted UNIX timestamp when the action occurred
+ * @property int $id The unique identifier (read-only)
+ * @property int $subject_guid The GUID of the actor
+ * @property int $object_guid The GUID of the object
+ * @property int $annotation_id The ID of the annotation involved in the action
+ * @property string $type The type of one of the entities involved in the action
+ * @property string $subtype The subtype of one of the entities involved in the action
+ * @property string $action_type The name of the action
+ * @property string $view The view for displaying this river item
+ * @property int $access_id The visibility of the river item
+ * @property int $posted UNIX timestamp when the action occurred
*/
-class ElggRiverItem
-{
+class ElggRiverItem {
public $id;
public $subject_guid;
public $object_guid;
diff --git a/mod/thewire/classes/ElggWire.php b/mod/thewire/classes/ElggWire.php
index 5155a7f97..9c92dd8f2 100644
--- a/mod/thewire/classes/ElggWire.php
+++ b/mod/thewire/classes/ElggWire.php
@@ -2,7 +2,7 @@
/**
* ElggWire Class
*
- * @property string $method The method used to create the wire post
+ * @property string $method The method used to create the wire post (site, sms, api)
* @property bool $reply Whether this wire post was a reply to another post
* @property int $wire_thread The identifier of the thread for this wire post
*/
--
cgit v1.2.3
From 3b496d923045770bdf4b25452fa63253927ee56a Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 8 Jan 2012 10:05:45 -0500
Subject: Refs #4271 integrates fix to 1.8 branch for ODDDocument
---
engine/classes/ODDDocument.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ODDDocument.php b/engine/classes/ODDDocument.php
index 4d185aba5..540c35a3b 100644
--- a/engine/classes/ODDDocument.php
+++ b/engine/classes/ODDDocument.php
@@ -70,8 +70,8 @@ class ODDDocument implements Iterator {
public function addElement(ODD $element) {
if (!is_array($this->elements)) {
$this->elements = array();
- $this->elements[] = $element;
}
+ $this->elements[] = $element;
}
/**
--
cgit v1.2.3
From b2bcd510b040b6d065a3a6ad5a4ea36e43db0446 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 8 Jan 2012 17:48:29 -0500
Subject: coding standards fixes - comments
---
engine/classes/ElggCache.php | 6 +++---
engine/classes/ElggMenuBuilder.php | 7 ++++---
engine/classes/ElggMenuItem.php | 22 +++++++++++-----------
engine/classes/ElggPlugin.php | 6 +++---
engine/classes/ElggPluginPackage.php | 2 ++
engine/classes/ElggSite.php | 4 ++--
engine/lib/access.php | 6 +++---
engine/lib/admin.php | 8 ++++----
engine/lib/database.php | 14 +++++++-------
engine/lib/extender.php | 2 +-
engine/lib/input.php | 4 ++--
engine/lib/relationships.php | 2 +-
engine/lib/river.php | 6 +++---
13 files changed, 46 insertions(+), 43 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggCache.php b/engine/classes/ElggCache.php
index dd53525b8..4317f4be9 100644
--- a/engine/classes/ElggCache.php
+++ b/engine/classes/ElggCache.php
@@ -191,8 +191,8 @@ abstract class ElggCache implements ArrayAccess {
*
* @see ArrayAccess::offsetSet()
*
- * @param mixed $key The key (offset) to assign the value to.
- * @param mixed $value The value to set.
+ * @param mixed $key The key (offset) to assign the value to.
+ * @param mixed $value The value to set.
*
* @return void
*/
@@ -205,7 +205,7 @@ abstract class ElggCache implements ArrayAccess {
*
* @see ArrayAccess::offsetGet()
*
- * @param mixed $offset The key (offset) to retrieve.
+ * @param mixed $key The key (offset) to retrieve.
*
* @return mixed
*/
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php
index cadfee7f5..6f4ac702e 100644
--- a/engine/classes/ElggMenuBuilder.php
+++ b/engine/classes/ElggMenuBuilder.php
@@ -16,16 +16,16 @@ class ElggMenuBuilder {
/**
* ElggMenuBuilder constructor
*
- * @param string $name Identifier of the menu
+ * @param array $menu Array of ElggMenuItem objects
*/
- public function __construct($menu) {
+ public function __construct(array $menu) {
$this->menu = $menu;
}
/**
* Get a prepared menu array
*
- * @param mixed $sort_by
+ * @param mixed $sort_by Method to sort the menu by. @see ElggMenuBuilder::sort()
* @return array
*/
public function getMenu($sort_by = 'text') {
@@ -80,6 +80,7 @@ class ElggMenuBuilder {
/**
* Group the menu items into sections
+ *
* @return void
*/
protected function setupSections() {
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 62547134a..2512392ad 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -2,12 +2,12 @@
/**
* Elgg Menu Item
*
- * @package Elgg.Core
- * @subpackage Navigation
- *
* To create a menu item that is not a link, pass false for $href.
*
* @since 1.8.0
+ *
+ * @package Elgg.Core
+ * @subpackage Navigation
*/
class ElggMenuItem {
@@ -70,9 +70,9 @@ class ElggMenuItem {
/**
* ElggMenuItem constructor
*
- * @param string $name Identifier of the menu item
- * @param string $text Display text of the menu item
- * @param string $href URL of the menu item (false if not a link)
+ * @param string $name Identifier of the menu item
+ * @param string $text Display text of the menu item
+ * @param string $href URL of the menu item (false if not a link)
*/
public function __construct($name, $text, $href) {
//$this->name = $name;
@@ -182,7 +182,7 @@ class ElggMenuItem {
/**
* Set the identifier of the menu item
*
- * @param string Unique identifier
+ * @param string $name Unique identifier
* @return void
*/
public function setName($name) {
@@ -491,7 +491,7 @@ class ElggMenuItem {
/**
* Set the parent menu item
*
- * @param ElggMenuItem $parent
+ * @param ElggMenuItem $parent The parent of this menu item
* @return void
*/
public function setParent($parent) {
@@ -510,7 +510,7 @@ class ElggMenuItem {
/**
* Add a child menu item
*
- * @param ElggMenuItem $item
+ * @param ElggMenuItem $item A child menu item
* @return void
*/
public function addChild($item) {
@@ -549,10 +549,10 @@ class ElggMenuItem {
/**
* Get the menu item content (usually a link)
*
+ * @todo View code in a model. How do we feel about that?
+ *
* @params array $vars Options to pass to output/url if a link
* @return string
- *
- * @todo View code in a model. How do we feel about that?
*/
public function getContent(array $vars = array()) {
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php
index c4d6ec034..33f14ae37 100644
--- a/engine/classes/ElggPlugin.php
+++ b/engine/classes/ElggPlugin.php
@@ -707,9 +707,9 @@ class ElggPlugin extends ElggObject {
* @throws PluginException
*/
public function start($flags) {
-// if (!$this->canActivate()) {
-// return false;
-// }
+ //if (!$this->canActivate()) {
+ // return false;
+ //}
// include classes
if ($flags & ELGG_PLUGIN_REGISTER_CLASSES) {
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index d240af477..2dc4bdb3d 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -303,6 +303,8 @@ class ElggPluginPackage {
/**
* Returns an array of present and readable text files
+ *
+ * @return array
*/
public function getTextFilenames() {
return $this->textFiles;
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 7ea52a195..b13683a56 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -196,7 +196,7 @@ class ElggSite extends ElggEntity {
*
* @note You cannot disable the current site.
*
- * @param string $reason Optional reason for disabling
+ * @param string $reason Optional reason for disabling
* @param bool $recursive Recursively disable all contained entities?
*
* @return bool
@@ -219,7 +219,7 @@ class ElggSite extends ElggEntity {
* accepted by elgg_get_entities(). Common parameters
* include 'limit', and 'offset'.
* Note: this was $limit before version 1.8
- * @param int $offset Offset @deprecated parameter
+ * @param int $offset Offset @deprecated parameter
*
* @todo remove $offset in 2.0
*
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 7be92fbfc..dba1e1ec6 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -984,9 +984,9 @@ function elgg_override_permissions($hook, $type, $value, $params) {
}
// don't do this so ignore access still works with no one logged in
-// if (!$user instanceof ElggUser) {
-// return false;
-// }
+ //if (!$user instanceof ElggUser) {
+ // return false;
+ //}
// check for admin
if ($user_guid && elgg_is_admin_user($user_guid)) {
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 1f085eee4..a573e79d6 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -179,10 +179,10 @@ function elgg_admin_notice_exists($id) {
*
* This function handles registering the parent if it has not been registered.
*
- * @param string $section The menu section to add to
- * @param string $menu_id The unique ID of section
- * @param string $parent_id If a child section, the parent section id
- * @param int $priority The menu item priority
+ * @param string $section The menu section to add to
+ * @param string $menu_id The unique ID of section
+ * @param string $parent_id If a child section, the parent section id
+ * @param int $priority The menu item priority
*
* @return bool
* @since 1.8.0
diff --git a/engine/lib/database.php b/engine/lib/database.php
index c44fdf1fd..444bb7cc4 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -728,9 +728,9 @@ function sanitize_string($string) {
/**
* Sanitises an integer for database use.
*
- * @param int $int Integer
- * @param bool[optional] $signed Whether negative values should be allowed (true)
- * @return int Sanitised integer
+ * @param int $int Value to be sanitized
+ * @param bool $signed Whether negative values should be allowed (true)
+ * @return int
*/
function sanitise_int($int, $signed = true) {
$int = (int) $int;
@@ -745,12 +745,12 @@ function sanitise_int($int, $signed = true) {
}
/**
- * Sanitises an integer for database use.
+ * Sanitizes an integer for database use.
* Wrapper function for alternate English spelling (@see sanitise_int)
*
- * @param int $int Integer
- * @param bool[optional] $signed Whether negative values should be allowed (true)
- * @return int Sanitised integer
+ * @param int $int Value to be sanitized
+ * @param bool $signed Whether negative values should be allowed (true)
+ * @return int
*/
function sanitize_int($int, $signed = true) {
return sanitise_int($int, $signed);
diff --git a/engine/lib/extender.php b/engine/lib/extender.php
index 51fc62c30..ffd3c1357 100644
--- a/engine/lib/extender.php
+++ b/engine/lib/extender.php
@@ -164,9 +164,9 @@ function can_edit_extender($extender_id, $type, $user_guid = 0) {
* It is recommended that you do not call this directly, instead use
* one of the wrapper functions such as elgg_register_annotation_url_handler().
*
- * @param string $function_name The function to register
* @param string $extender_type Extender type ('annotation', 'metadata')
* @param string $extender_name The name of the extender
+ * @param string $function_name The function to register
*
* @return bool
*/
diff --git a/engine/lib/input.php b/engine/lib/input.php
index 57e35786f..dda8211b6 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -188,8 +188,8 @@ function elgg_get_sticky_value($form_name, $variable = '', $default = NULL, $fil
/**
* Get all the values in a sticky form in an array
*
- * @param string $form_name The name of the form
- * @param bool $filter_result Filter for bad input if true
+ * @param string $form_name The name of the form
+ * @param bool $filter_result Filter for bad input if true
*
* @return array
* @since 1.8.0
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 5b7080b56..fabe2d2d6 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -399,8 +399,8 @@ function elgg_list_entities_from_relationship_count($options) {
/**
* Sets the URL handler for a particular relationship type
*
- * @param string $function_name The function to register
* @param string $relationship_type The relationship type.
+ * @param string $function_name The function to register
*
* @return bool Depending on success
*/
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 63625878f..547d9495e 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -108,7 +108,7 @@ $posted = 0, $annotation_id = 0) {
*
* @warning not checking access (should we?)
*
- * @param array $options
+ * @param array $options Parameters:
* ids => INT|ARR River item id(s)
* subject_guids => INT|ARR Subject guid(s)
* object_guids => INT|ARR Object guid(s)
@@ -215,7 +215,7 @@ function elgg_delete_river(array $options = array()) {
*
* @note If using types and subtypes in a query, they are joined with an AND.
*
- * @param array $options
+ * @param array $options Parameters:
* ids => INT|ARR River item id(s)
* subject_guids => INT|ARR Subject guid(s)
* object_guids => INT|ARR Object guid(s)
@@ -548,7 +548,7 @@ function elgg_river_get_action_where_sql($types) {
/**
* Get the where clause based on river view strings
*
- * @param array $types Array of view strings
+ * @param array $views Array of view strings
*
* @return string
* @since 1.8.0
--
cgit v1.2.3
From c4b49227819624b14b61e6eedbfa6779cd794d45 Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Sun, 8 Jan 2012 19:33:21 -0500
Subject: most of the comments in the engine now past the sniffer
---
engine/classes/ElggExtender.php | 11 +++++++++--
engine/classes/ElggMenuBuilder.php | 3 +--
engine/classes/ElggMenuItem.php | 8 +++-----
engine/classes/ElggMetadata.php | 7 +++++++
engine/classes/ElggUser.php | 21 ++++++++++-----------
engine/classes/SuccessResult.php | 2 +-
engine/lib/annotations.php | 2 +-
engine/lib/cache.php | 7 ++++---
engine/lib/metadata.php | 2 +-
engine/lib/output.php | 8 ++++----
engine/lib/pagehandler.php | 1 +
engine/lib/pageowner.php | 7 ++++---
engine/lib/plugins.php | 7 ++++---
engine/lib/users.php | 8 ++++----
14 files changed, 54 insertions(+), 40 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggExtender.php b/engine/classes/ElggExtender.php
index bc2d67ae2..d94bad837 100644
--- a/engine/classes/ElggExtender.php
+++ b/engine/classes/ElggExtender.php
@@ -24,8 +24,15 @@
* @property mixed $value The value of the extender (int or string)
* @property int $time_created A UNIX timestamp of when the extender was created (read-only, set on first save)
*/
-abstract class ElggExtender extends ElggData
-{
+abstract class ElggExtender extends ElggData {
+
+ /**
+ * (non-PHPdoc)
+ *
+ * @see ElggData::initializeAttributes()
+ *
+ * @return void
+ */
protected function initializeAttributes() {
parent::initializeAttributes();
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php
index 6f4ac702e..de0017599 100644
--- a/engine/classes/ElggMenuBuilder.php
+++ b/engine/classes/ElggMenuBuilder.php
@@ -4,8 +4,7 @@
*
* @package Elgg.Core
* @subpackage Navigation
- *
- * @since 1.8.0
+ * @since 1.8.0
*/
class ElggMenuBuilder {
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 2512392ad..4bc9144d4 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -4,10 +4,9 @@
*
* To create a menu item that is not a link, pass false for $href.
*
- * @since 1.8.0
- *
* @package Elgg.Core
* @subpackage Navigation
+ * @since 1.8.0
*/
class ElggMenuItem {
@@ -549,10 +548,9 @@ class ElggMenuItem {
/**
* Get the menu item content (usually a link)
*
- * @todo View code in a model. How do we feel about that?
- *
- * @params array $vars Options to pass to output/url if a link
+ * @param array $vars Options to pass to output/url if a link
* @return string
+ * @todo View code in a model. How do we feel about that?
*/
public function getContent(array $vars = array()) {
diff --git a/engine/classes/ElggMetadata.php b/engine/classes/ElggMetadata.php
index 32e7b32f1..634a122e5 100644
--- a/engine/classes/ElggMetadata.php
+++ b/engine/classes/ElggMetadata.php
@@ -9,6 +9,13 @@
*/
class ElggMetadata extends ElggExtender {
+ /**
+ * (non-PHPdoc)
+ *
+ * @see ElggData::initializeAttributes()
+ *
+ * @return void
+ */
protected function initializeAttributes() {
parent::initializeAttributes();
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index ab0610ac0..bdf57c2c3 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -105,7 +105,7 @@ class ElggUser extends ElggEntity
*
* @param int $guid ElggUser GUID
*
- * @return true|false
+ * @return bool
*/
protected function load($guid) {
// Test to see if we have the generic stuff
@@ -141,7 +141,7 @@ class ElggUser extends ElggEntity
/**
* Saves this user to the database.
*
- * @return true|false
+ * @return bool
*/
public function save() {
// Save generic stuff
@@ -261,7 +261,7 @@ class ElggUser extends ElggEntity
* @param int $limit The number of results to return
* @param int $offset Any indexing offset
*
- * @return bool
+ * @return array
*/
function getSites($subtype = "", $limit = 10, $offset = 0) {
return get_user_sites($this->getGUID(), $subtype, $limit, $offset);
@@ -272,7 +272,7 @@ class ElggUser extends ElggEntity
*
* @param int $site_guid The guid of the site to add it to
*
- * @return true|false
+ * @return bool
*/
function addToSite($site_guid) {
return add_site_user($site_guid, $this->getGUID());
@@ -283,7 +283,7 @@ class ElggUser extends ElggEntity
*
* @param int $site_guid The guid of the site to remove it from
*
- * @return true|false
+ * @return bool
*/
function removeFromSite($site_guid) {
return remove_site_user($site_guid, $this->getGUID());
@@ -294,7 +294,7 @@ class ElggUser extends ElggEntity
*
* @param int $friend_guid The GUID of the user to add
*
- * @return true|false Depending on success
+ * @return bool
*/
function addFriend($friend_guid) {
return user_add_friend($this->getGUID(), $friend_guid);
@@ -305,7 +305,7 @@ class ElggUser extends ElggEntity
*
* @param int $friend_guid The GUID of the user to remove
*
- * @return true|false Depending on success
+ * @return bool
*/
function removeFriend($friend_guid) {
return user_remove_friend($this->getGUID(), $friend_guid);
@@ -314,8 +314,7 @@ class ElggUser extends ElggEntity
/**
* Determines whether or not this user is a friend of the currently logged in user
*
- *
- * @return true|false
+ * @return bool
*/
function isFriend() {
return $this->isFriendOf(elgg_get_logged_in_user_guid());
@@ -326,7 +325,7 @@ class ElggUser extends ElggEntity
*
* @param int $user_guid The GUID of the user to check against
*
- * @return true|false
+ * @return bool
*/
function isFriendsWith($user_guid) {
return user_is_friend($this->getGUID(), $user_guid);
@@ -337,7 +336,7 @@ class ElggUser extends ElggEntity
*
* @param int $user_guid The GUID of the user to check against
*
- * @return true|false
+ * @return bool
*/
function isFriendOf($user_guid) {
return user_is_friend($user_guid, $this->getGUID());
diff --git a/engine/classes/SuccessResult.php b/engine/classes/SuccessResult.php
index c8578a2cf..ab5468ad8 100644
--- a/engine/classes/SuccessResult.php
+++ b/engine/classes/SuccessResult.php
@@ -15,7 +15,7 @@ class SuccessResult extends GenericResult {
*
* @param string $result The result
*/
- public function SuccessResult($result) {
+ public function __construct($result) {
$this->setResult($result);
$this->setStatusCode(SuccessResult::$RESULT_SUCCESS);
}
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index bb7d836cc..30ef7f17b 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -549,8 +549,8 @@ function elgg_comment_url_handler(ElggAnnotation $comment) {
/**
* Register an annotation url handler.
*
- * @param string $function_name The function.
* @param string $extender_name The name, default 'all'.
+ * @param string $function_name The function.
*
* @return string
*/
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index a6ebe2a30..e71ef332d 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -34,8 +34,9 @@ function elgg_get_filepath_cache() {
}
/**
- * Function which resets the file path cache.
+ * Reset the file path cache.
*
+ * @return bool
*/
function elgg_filepath_cache_reset() {
$cache = elgg_get_filepath_cache();
@@ -47,8 +48,8 @@ function elgg_filepath_cache_reset() {
/**
* Saves a filepath cache.
*
- * @param string $type
- * @param string $data
+ * @param string $type The type or identifier of the cache
+ * @param string $data The data to be saved
* @return bool
*/
function elgg_filepath_cache_save($type, $data) {
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 4908b3e88..352e98a61 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -871,8 +871,8 @@ function metadata_update($event, $object_type, $object) {
/**
* Register a metadata url handler.
*
- * @param string $function_name The function.
* @param string $extender_name The name, default 'all'.
+ * @param string $function The function name.
*
* @return bool
*/
diff --git a/engine/lib/output.php b/engine/lib/output.php
index 6554481f5..65f51f854 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -81,10 +81,10 @@ function autop($pee, $br = 1) {
}
$pee = preg_replace('!(?' . $allblocks . '[^>]*>)\s*
!', "$1", $pee);
$pee = preg_replace('!
(\s*?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
-// if (strpos($pee, '. Only there because of the comment.
-// $pee = preg_replace_callback('!()(.*?)
!is', 'clean_pre', $pee );
-// }
+ //if (strpos($pee, '. Only there because of the comment.
+ // $pee = preg_replace_callback('!()(.*?)
!is', 'clean_pre', $pee );
+ //}
$pee = preg_replace( "|\n
$|", '', $pee );
return $pee;
diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php
index ffcfc5b6a..a675d976a 100644
--- a/engine/lib/pagehandler.php
+++ b/engine/lib/pagehandler.php
@@ -120,6 +120,7 @@ function elgg_unregister_page_handler($handler) {
* @param string $type The type of the hook
* @param bool $result The current value of the hook
* @param array $params Parameters related to the hook
+ * @return void
*/
function elgg_error_page_handler($hook, $type, $result, $params) {
if (elgg_view_exists("errors/$type")) {
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index 9d41d74c1..0cf0e0625 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -54,7 +54,7 @@ function elgg_get_page_owner_entity() {
* Set the guid of the entity that owns this page
*
* @param int $guid The guid of the page owner
- *
+ * @return void
* @since 1.8.0
*/
function elgg_set_page_owner_guid($guid) {
@@ -173,7 +173,7 @@ function default_page_owner_handler($hook, $entity_type, $returnvalue, $params)
* @warning The context is not available until the page_handler runs (after
* the 'init, system' event processing has completed).
*
- * @param string $context The context of the page
+ * @param string $context The context of the page
* @return bool
* @since 1.8.0
*/
@@ -216,6 +216,7 @@ function elgg_get_context() {
* Push a context onto the top of the stack
*
* @param string $context The context string to add to the context stack
+ * @return void
* @since 1.8.0
*/
function elgg_push_context($context) {
@@ -244,7 +245,7 @@ function elgg_pop_context() {
* itself differently based on being on the dashboard or profile pages, it
* can check the stack.
*
- * @param string $context The context string to check for
+ * @param string $context The context string to check for
* @return bool
* @since 1.8.0
*/
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 026bc171b..7968f4a6e 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -480,9 +480,10 @@ function elgg_reindex_plugin_priorities() {
*/
function elgg_namespace_plugin_private_setting($type, $name, $id = null) {
switch ($type) {
-// case 'setting':
-// $name = ELGG_PLUGIN_SETTING_PREFIX . $name;
-// break;
+ // commented out because it breaks $plugin->$name access to variables
+ //case 'setting':
+ // $name = ELGG_PLUGIN_SETTING_PREFIX . $name;
+ // break;
case 'user_setting':
if (!$id) {
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 362488718..c03052172 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -630,10 +630,10 @@ function get_user_by_email($email) {
* A function that returns a maximum of $limit users who have done something within the last
* $seconds seconds or the total count of active users.
*
- * @param int $seconds Number of seconds (default 600 = 10min)
- * @param int $limit Limit, default 10.
- * @param int $offset Offset, default 0.
- * @param bool $count Count, default false.
+ * @param int $seconds Number of seconds (default 600 = 10min)
+ * @param int $limit Limit, default 10.
+ * @param int $offset Offset, default 0.
+ * @param bool $count Count, default false.
*
* @return mixed
*/
--
cgit v1.2.3
From 66953a2148bb7a19ac79c1a4ccda2852ee87501e Mon Sep 17 00:00:00 2001
From: Cash Costello
Date: Mon, 9 Jan 2012 18:53:19 -0500
Subject: coding standard fixes to engine
---
engine/classes/ElggBatch.php | 8 +++-----
engine/classes/ElggEntity.php | 28 ++++++++++++++--------------
engine/classes/ElggMemcache.php | 24 ++++--------------------
engine/classes/ElggWidget.php | 2 +-
engine/classes/XMLRPCCall.php | 4 ++--
engine/handlers/export_handler.php | 6 ++++--
engine/lib/actions.php | 3 +--
engine/lib/configuration.php | 2 +-
engine/lib/filestore.php | 2 +-
engine/lib/metadata.php | 16 ++++++++--------
engine/lib/navigation.php | 2 +-
engine/lib/output.php | 4 ++--
engine/lib/private_settings.php | 2 +-
engine/lib/users.php | 2 +-
engine/lib/views.php | 13 ++++++-------
15 files changed, 50 insertions(+), 68 deletions(-)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggBatch.php b/engine/classes/ElggBatch.php
index 2a97f9ff5..3d01133fa 100644
--- a/engine/classes/ElggBatch.php
+++ b/engine/classes/ElggBatch.php
@@ -236,13 +236,11 @@ class ElggBatch
}
// if original limit < chunk size, set limit to original limit
+ // else if the number of results we'll fetch if greater than the original limit
if ($this->limit < $this->chunkSize) {
$limit = $this->limit;
- }
-
- // if the number of results we'll fetch is greater than the original limit,
- // set the limit to the number of results remaining in the original limit
- elseif ($this->retrievedResults + $this->chunkSize > $this->limit) {
+ } elseif ($this->retrievedResults + $this->chunkSize > $this->limit) {
+ // set the limit to the number of results remaining in the original limit
$limit = $this->limit - $this->retrievedResults;
}
}
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index df87082fe..2fa8e9939 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -1583,36 +1583,36 @@ abstract class ElggEntity extends ElggData implements
foreach ($this->attributes as $k => $v) {
$meta = NULL;
- if (in_array( $k, $exportable_values)) {
+ if (in_array($k, $exportable_values)) {
switch ($k) {
- case 'guid' : // Dont use guid in OpenDD
- case 'type' : // Type and subtype already taken care of
- case 'subtype' :
- break;
+ case 'guid': // Dont use guid in OpenDD
+ case 'type': // Type and subtype already taken care of
+ case 'subtype':
+ break;
- case 'time_created' : // Created = published
+ case 'time_created': // Created = published
$odd->setAttribute('published', date("r", $v));
- break;
+ break;
- case 'site_guid' : // Container
+ case 'site_guid': // Container
$k = 'site_uuid';
$v = guid_to_uuid($v);
$meta = new ODDMetaData($uuid . "attr/$k/", $uuid, $k, $v);
- break;
+ break;
- case 'container_guid' : // Container
+ case 'container_guid': // Container
$k = 'container_uuid';
$v = guid_to_uuid($v);
$meta = new ODDMetaData($uuid . "attr/$k/", $uuid, $k, $v);
- break;
+ break;
- case 'owner_guid' : // Convert owner guid to uuid, this will be stored in metadata
+ case 'owner_guid': // Convert owner guid to uuid, this will be stored in metadata
$k = 'owner_uuid';
$v = guid_to_uuid($v);
$meta = new ODDMetaData($uuid . "attr/$k/", $uuid, $k, $v);
- break;
+ break;
- default :
+ default:
$meta = new ODDMetaData($uuid . "attr/$k/", $uuid, $k, $v);
}
diff --git a/engine/classes/ElggMemcache.php b/engine/classes/ElggMemcache.php
index a54c29723..f27b017d0 100644
--- a/engine/classes/ElggMemcache.php
+++ b/engine/classes/ElggMemcache.php
@@ -110,22 +110,6 @@ class ElggMemcache extends ElggSharedMemoryCache {
$this->expires = $expires;
}
- /**
- * Combine a key with the namespace.
- * Memcache can only accept <250 char key. If the given key is too long it is shortened.
- *
- * @deprecated 1.8 Use ElggMemcache::_makeMemcacheKey()
- *
- * @param string $key The key
- *
- * @return string The new key.
- */
- private function make_memcache_key($key) {
- elgg_deprecated_notice('ElggMemcache::make_memcache_key() is deprecated by ::_makeMemcacheKey()', 1.8);
-
- return $this->_makeMemcacheKey($key);
- }
-
/**
* Combine a key with the namespace.
* Memcache can only accept <250 char key. If the given key is too long it is shortened.
@@ -134,7 +118,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
*
* @return string The new key.
*/
- private function _makeMemcacheKey($key) {
+ private function makeMemcacheKey($key) {
$prefix = $this->getNamespace() . ":";
if (strlen($prefix . $key) > 250) {
@@ -154,7 +138,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
* @return bool
*/
public function save($key, $data, $expires = null) {
- $key = $this->_makeMemcacheKey($key);
+ $key = $this->makeMemcacheKey($key);
if ($expires === null) {
$expires = $this->expires;
@@ -178,7 +162,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
* @return mixed
*/
public function load($key, $offset = 0, $limit = null) {
- $key = $this->_makeMemcacheKey($key);
+ $key = $this->makeMemcacheKey($key);
$result = $this->memcache->get($key);
if ($result === false) {
@@ -196,7 +180,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
* @return bool
*/
public function delete($key) {
- $key = $this->_makeMemcacheKey($key);
+ $key = $this->makeMemcacheKey($key);
return $this->memcache->delete($key, 0);
}
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index 70eaf8a73..e703b84cb 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -133,7 +133,7 @@ class ElggWidget extends ElggObject {
if ($rank == 0) {
// top of the column
$this->order = $widgets[0]->order - 10;
- } elseif ($rank == (count($widgets)-1)) {
+ } elseif ($rank == (count($widgets) - 1)) {
// bottom of the column
$this->order = end($widgets)->order + 10;
} else {
diff --git a/engine/classes/XMLRPCCall.php b/engine/classes/XMLRPCCall.php
index 8eeba0c29..fd28f1e3e 100644
--- a/engine/classes/XMLRPCCall.php
+++ b/engine/classes/XMLRPCCall.php
@@ -18,7 +18,7 @@ class XMLRPCCall {
* @param string $xml XML
*/
function __construct($xml) {
- $this->_parse($xml);
+ $this->parse($xml);
}
/**
@@ -45,7 +45,7 @@ class XMLRPCCall {
*
* @return void
*/
- private function _parse($xml) {
+ private function parse($xml) {
$xml = xml_to_object($xml);
// sanity check
diff --git a/engine/handlers/export_handler.php b/engine/handlers/export_handler.php
index b91a037e8..aa5214c23 100644
--- a/engine/handlers/export_handler.php
+++ b/engine/handlers/export_handler.php
@@ -72,8 +72,10 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
$r = get_relationship($id_or_name);
break;
case 'volatile' :
- $m = elgg_trigger_plugin_hook('volatile', 'metadata',
- array('guid' => $guid, 'varname' => $id_or_name));
+ $m = elgg_trigger_plugin_hook('volatile', 'metadata', array(
+ 'guid' => $guid,
+ 'varname' => $id_or_name,
+ ));
break;
default :
diff --git a/engine/lib/actions.php b/engine/lib/actions.php
index f415842ab..c6613e6d6 100644
--- a/engine/lib/actions.php
+++ b/engine/lib/actions.php
@@ -459,8 +459,7 @@ function ajax_forward_hook($hook, $type, $reason, $params) {
// however some browsers will not accept the JSON MIME type.
if (stripos($_SERVER['HTTP_ACCEPT'], 'application/json') === FALSE) {
header("Content-type: text/plain");
- }
- else {
+ } else {
header("Content-type: application/json");
}
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index 615063f3d..3fade8155 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -555,7 +555,7 @@ function set_default_config() {
'path' => "$install_root/",
'view_path' => "$install_root/views/",
'plugins_path' => "$install_root/mod/",
- 'wwwroot' => $www_root,
+ 'wwwroot' => $www_root,
'url' => $www_root,
'site_name' => 'New Elgg site',
'language' => 'en',
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index a13d8aa27..86f6d9baa 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -18,7 +18,7 @@
*/
function get_dir_size($dir, $totalsize = 0) {
$handle = @opendir($dir);
- while ($file = @readdir ($handle)) {
+ while ($file = @readdir($handle)) {
if (eregi("^\.{1,2}$", $file)) {
continue;
}
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 352e98a61..6e1b8b39c 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -402,15 +402,15 @@ function elgg_enable_metadata(array $options) {
*/
function elgg_get_entities_from_metadata(array $options = array()) {
$defaults = array(
- 'metadata_names' => ELGG_ENTITIES_ANY_VALUE,
- 'metadata_values' => ELGG_ENTITIES_ANY_VALUE,
- 'metadata_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
+ 'metadata_names' => ELGG_ENTITIES_ANY_VALUE,
+ 'metadata_values' => ELGG_ENTITIES_ANY_VALUE,
+ 'metadata_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
- 'metadata_name_value_pairs_operator'=> 'AND',
- 'metadata_case_sensitive' => TRUE,
- 'order_by_metadata' => array(),
+ 'metadata_name_value_pairs_operator' => 'AND',
+ 'metadata_case_sensitive' => TRUE,
+ 'order_by_metadata' => array(),
- 'metadata_owner_guids' => ELGG_ENTITIES_ANY_VALUE,
+ 'metadata_owner_guids' => ELGG_ENTITIES_ANY_VALUE,
);
$options = array_merge($defaults, $options);
@@ -633,7 +633,7 @@ $owner_guids = NULL) {
$i++;
}
- if ($where = implode (" $pair_operator ", $pair_wheres)) {
+ if ($where = implode(" $pair_operator ", $pair_wheres)) {
$wheres[] = "($where)";
}
}
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index 956ca220a..dcbd7b397 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -301,7 +301,7 @@ function elgg_site_menu_setup($hook, $type, $return, $params) {
// if only one item on more menu, stick it with the rest
$num_menu_items = count($return['default']);
if ($num_menu_items > ($max_display_items + 1)) {
- $return['more'] = array_splice($return['default'], $max_display_items);
+ $return['more'] = array_splice($return['default'], $max_display_items);
}
}
diff --git a/engine/lib/output.php b/engine/lib/output.php
index 65f51f854..b96cf354c 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -67,7 +67,7 @@ function autop($pee, $br = 1) {
$pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "$1
\n", $pee); // make paragraphs, including one at the end
$pee = preg_replace('|\s*?
|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
$pee = preg_replace('!([^<]+)\s*?((?:div|address|form)[^>]*>)!', "
$1
$2", $pee);
- $pee = preg_replace( '||', "$1
", $pee );
+ $pee = preg_replace('|
|', "$1
", $pee);
$pee = preg_replace('!
\s*(?' . $allblocks . '[^>]*>)\s*
!', "$1", $pee); // don't pee all over a tag
$pee = preg_replace("|(
|", "$1", $pee); // problem with nested lists
$pee = preg_replace('|]*)>|i', "", $pee);
@@ -85,7 +85,7 @@ function autop($pee, $br = 1) {
// mind the space between the ? and >. Only there because of the comment.
// $pee = preg_replace_callback('!(
)(.*?)!is', 'clean_pre', $pee );
//}
- $pee = preg_replace( "|\n$|", '', $pee );
+ $pee = preg_replace("|\n$|", '', $pee);
return $pee;
}
diff --git a/engine/lib/private_settings.php b/engine/lib/private_settings.php
index 386af5279..1fa9bdb66 100644
--- a/engine/lib/private_settings.php
+++ b/engine/lib/private_settings.php
@@ -240,7 +240,7 @@ $pairs = NULL, $pair_operator = 'AND', $name_prefix = '') {
$i++;
}
- $where = implode (" $pair_operator ", $pair_wheres);
+ $where = implode(" $pair_operator ", $pair_wheres);
if ($where) {
$wheres[] = "($where)";
}
diff --git a/engine/lib/users.php b/engine/lib/users.php
index c03052172..c38bb676e 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1486,7 +1486,7 @@ function users_pagesetup() {
if ($viewer) {
elgg_register_menu_item('topbar', array(
'name' => 'profile',
- 'href' => $viewer->getURL(),
+ 'href' => $viewer->getURL(),
'text' => elgg_view('output/img', array(
'src' => $viewer->getIconURL('topbar'),
'alt' => $viewer->name,
diff --git a/engine/lib/views.php b/engine/lib/views.php
index b938dd60e..85319b2d7 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -415,7 +415,6 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie
if (isset($vars['internalname']) && !isset($vars['__ignoreInternalname']) && !isset($vars['name'])) {
elgg_deprecated_notice('You should pass $vars[\'name\'] now instead of $vars[\'internalname\']', 1.8, 2);
$vars['name'] = $vars['internalname'];
- $test=false;
} elseif (isset($vars['name'])) {
if (!isset($vars['internalname'])) {
$vars['__ignoreInternalname'] = '';
@@ -1628,12 +1627,12 @@ function elgg_views_boot() {
// set default icon sizes - can be overridden in settings.php or with plugin
if (!elgg_get_config('icon_sizes')) {
$icon_sizes = array(
- 'topbar' => array('w'=>16, 'h'=>16, 'square'=>TRUE, 'upscale'=>TRUE),
- 'tiny' => array('w'=>25, 'h'=>25, 'square'=>TRUE, 'upscale'=>TRUE),
- 'small' => array('w'=>40, 'h'=>40, 'square'=>TRUE, 'upscale'=>TRUE),
- 'medium' => array('w'=>100, 'h'=>100, 'square'=>TRUE, 'upscale'=>TRUE),
- 'large' => array('w'=>200, 'h'=>200, 'square'=>FALSE, 'upscale'=>FALSE),
- 'master' => array('w'=>550, 'h'=>550, 'square'=>FALSE, 'upscale'=>FALSE),
+ 'topbar' => array('w' => 16, 'h' => 16, 'square' => TRUE, 'upscale' => TRUE),
+ 'tiny' => array('w' => 25, 'h' => 25, 'square' => TRUE, 'upscale' => TRUE),
+ 'small' => array('w' => 40, 'h' => 40, 'square' => TRUE, 'upscale' => TRUE),
+ 'medium' => array('w' => 100, 'h' => 100, 'square' => TRUE, 'upscale' => TRUE),
+ 'large' => array('w' => 200, 'h' => 200, 'square' => FALSE, 'upscale' => FALSE),
+ 'master' => array('w' => 550, 'h' => 550, 'square' => FALSE, 'upscale' => FALSE),
);
elgg_set_config('icon_sizes', $icon_sizes);
}
--
cgit v1.2.3
From 0980beffc887277c6856f53d96d6d7fa5f624154 Mon Sep 17 00:00:00 2001
From: Jeroen Dalsem
Date: Mon, 9 Jan 2012 11:45:00 +0100
Subject: Fixes #4285 move only fetches 10 items
---
engine/classes/ElggWidget.php | 1 +
1 file changed, 1 insertion(+)
(limited to 'engine/classes')
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index e703b84cb..7914fa140 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -116,6 +116,7 @@ class ElggWidget extends ElggObject {
'type' => 'object',
'subtype' => 'widget',
'container_guid' => $this->container_guid,
+ 'limit' => false,
'private_setting_name_value_pairs' => array(
array('name' => 'context', 'value' => $this->getContext()),
array('name' => 'column', 'value' => $column)
--
cgit v1.2.3