aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/avatar/revert.php15
-rw-r--r--documentation/examples/plugins/start.php12
-rw-r--r--engine/classes/ElggBatch.php12
-rw-r--r--engine/classes/ElggCache.php2
-rw-r--r--engine/classes/ElggDiskFilestore.php2
-rw-r--r--engine/classes/ElggExtender.php11
-rw-r--r--engine/classes/ElggGroup.php3
-rw-r--r--engine/classes/ElggObject.php4
-rw-r--r--engine/classes/ElggRelationship.php6
-rw-r--r--engine/classes/ElggRiverItem.php11
-rw-r--r--engine/classes/ElggSite.php6
-rw-r--r--engine/classes/ElggUser.php9
-rw-r--r--engine/classes/ElggWidget.php26
-rw-r--r--engine/lib/access.php15
-rw-r--r--engine/lib/admin.php13
-rw-r--r--engine/lib/annotations.php8
-rw-r--r--engine/lib/elgglib.php5
-rw-r--r--engine/lib/entities.php57
-rw-r--r--engine/lib/metadata.php9
-rw-r--r--engine/lib/notification.php1
-rw-r--r--engine/lib/objects.php7
-rw-r--r--engine/lib/plugins.php4
-rw-r--r--engine/lib/river.php8
-rw-r--r--engine/lib/upgrades/2011030700-1.8_svn-blog_status_metadata-4645225d7b440876.php3
-rw-r--r--engine/lib/upgrades/2011061200-1.8b1-sites_need_a_site_guid-6d9dcbf46c0826cc.php1
-rw-r--r--engine/lib/upgrades/2011123100-1.8.2-fix_friend_river-b17e7ff8345c2269.php12
-rw-r--r--engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php25
-rw-r--r--engine/lib/users.php18
-rw-r--r--engine/lib/widgets.php5
-rw-r--r--engine/tests/objects/entities.php33
-rw-r--r--js/lib/ui.widgets.js2
-rw-r--r--languages/en.php6
-rw-r--r--mod/blog/actions/blog/save.php6
-rw-r--r--mod/blog/classes/ElggBlog.php4
-rw-r--r--mod/blog/lib/blog.php13
-rw-r--r--mod/blog/start.php26
-rw-r--r--mod/blog/views/default/blog/group_module.php3
-rw-r--r--mod/blog/views/default/blog/sidebar.php2
-rw-r--r--mod/blog/views/default/blog/sidebar/archives.php10
-rw-r--r--mod/blog/views/default/object/blog.php3
-rw-r--r--mod/developers/languages/en.php6
-rw-r--r--mod/developers/start.php9
-rw-r--r--mod/developers/views/default/admin/develop_tools/unit_tests.php17
-rw-r--r--mod/diagnostics/languages/en.php66
-rw-r--r--mod/diagnostics/start.php2
-rw-r--r--mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php17
-rw-r--r--mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php38
-rw-r--r--mod/externalpages/actions/edit.php24
-rw-r--r--mod/externalpages/views/default/expages/menu.php4
-rw-r--r--mod/externalpages/views/default/forms/expages/edit.php4
-rw-r--r--mod/groups/actions/groups/edit.php20
-rw-r--r--mod/groups/actions/groups/membership/delete_invite.php4
-rw-r--r--mod/groups/languages/en.php2
-rw-r--r--mod/groups/lib/groups.php8
-rw-r--r--mod/groups/start.php2
-rw-r--r--mod/groups/upgrades/2011030101.php16
-rw-r--r--mod/groups/views/default/forms/groups/find.php16
-rw-r--r--mod/groups/views/default/forms/groups/search.php14
-rw-r--r--mod/groups/views/default/groups/group_sort_menu.php10
-rw-r--r--mod/groups/views/default/groups/sidebar/find.php2
-rw-r--r--mod/groups/views/default/groups/sidebar/search.php15
-rw-r--r--mod/thewire/classes/ElggWire.php4
-rw-r--r--version.php2
-rw-r--r--views/default/core/avatar/upload.php12
-rw-r--r--views/default/css/admin.php46
-rw-r--r--views/default/css/elements/modules.php2
-rw-r--r--views/default/object/widget.php3
-rw-r--r--views/default/output/access.php5
68 files changed, 528 insertions, 260 deletions
diff --git a/actions/avatar/revert.php b/actions/avatar/revert.php
new file mode 100644
index 000000000..8cff40a68
--- /dev/null
+++ b/actions/avatar/revert.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Avatar revert action
+ */
+
+$guid = get_input('guid');
+$user = get_entity($guid);
+if ($user) {
+ unset($user->icontime);
+ system_message(elgg_echo('avatar:revert:success'));
+} else {
+ register_error(elgg_echo('avatar:revert:fail'));
+}
+
+forward(REFERER);
diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php
index ea1e894b2..3af50ce38 100644
--- a/documentation/examples/plugins/start.php
+++ b/documentation/examples/plugins/start.php
@@ -8,5 +8,15 @@ elgg_register_event_handler('init', 'system', 'my_plugin_init');
function my_plugin_init() {
// Rename this function based on the name of your plugin and update the
// elgg_register_event_handler() call accordingly
-
+
+ // Register a script to handle (usually) a POST request (an action)
+ $base_dir = elgg_get_plugins_path() . 'my_plugin/actions/my_plugin';
+ elgg_register_action('my_plugin', "$base_dir/my_action.php");
+
+ // Extend the main CSS file
+ elgg_extend_view('css/elgg', 'my_plugin/css');
+
+ // Add a menu item to the main site menu
+ $item = new ElggMenuItem('my_plugin', elgg_echo('my_plugin:menu'), 'my_url');
+ elgg_register_menu_item('site', $item);
}
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
+}
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);
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);
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/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..649e32490 100644
--- a/engine/classes/ElggObject.php
+++ b/engine/classes/ElggObject.php
@@ -14,6 +14,10 @@
*
* @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
+ * @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/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 3ccb146fb..7ea52a195 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 {
@@ -231,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,
@@ -254,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,
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 {
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index 0eb83913b..70eaf8a73 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)
@@ -132,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;
}
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 08b9283cd..7be92fbfc 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -838,7 +838,7 @@ function elgg_list_entities_from_access_id(array $options = array()) {
*
* @param int $entity_access_id The entity's access id
*
- * @return string 'Public', 'Private', etc. or false if error.
+ * @return string 'Public', 'Private', etc.
* @since 1.7.0
* @todo I think this probably wants get_access_array() instead of get_write_access_array(),
* but those two functions return different types of arrays.
@@ -849,15 +849,12 @@ function get_readable_access_level($entity_access_id) {
//get the access level for object in readable string
$options = get_write_access_array();
- //@todo Really? Use array_key_exists()
- foreach ($options as $key => $option) {
- if ($key == $access) {
- $entity_acl = htmlentities($option, ENT_QUOTES, 'UTF-8');
- return $entity_acl;
- break;
- }
+ if (array_key_exists($access, $options)) {
+ return $options[$access];
}
- return false;
+
+ // return 'Limited' if the user does not have access to the access collection
+ return elgg_echo('access:limited:label');
}
/**
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index a191d740b..1f085eee4 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -79,6 +79,10 @@ function elgg_add_admin_notice($id, $message) {
if (elgg_admin_notice_exists($id)) {
return false;
}
+
+ // need to handle when no one is logged in
+ $old_ia = elgg_set_ignore_access(true);
+
$admin_notice = new ElggObject();
$admin_notice->subtype = 'admin_notice';
// admins can see ACCESS_PRIVATE but no one else can.
@@ -86,13 +90,16 @@ function elgg_add_admin_notice($id, $message) {
$admin_notice->admin_notice_id = $id;
$admin_notice->description = $message;
- return $admin_notice->save();
+ $result = $admin_notice->save();
+
+ elgg_set_ignore_access($old_ia);
+
+ return (bool)$result;
}
- return FALSE;
+ return false;
}
-
/**
* Remove an admin notice by ID.
*
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index bfd40d1e8..6e0402804 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -163,13 +163,9 @@ function update_annotation($annotation_id, $name, $value, $value_type, $owner_gu
where id=$annotation_id and $access");
if ($result !== false) {
+ // @todo add plugin hook that sends old and new annotation information before db access
$obj = elgg_get_annotation_from_id($annotation_id);
- if (elgg_trigger_event('update', 'annotation', $obj)) {
- return true;
- } else {
- // @todo add plugin hook that sends old and new annotation information before db access
- elgg_delete_annotation_by_id($annotation_id);
- }
+ elgg_trigger_event('update', 'annotation', $obj);
}
return $result;
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 57d602450..c32f7fa0c 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1996,9 +1996,7 @@ function elgg_is_valid_options_for_batch_operation($options, $type) {
* @access private
*/
function elgg_walled_garden_index() {
- elgg_register_css('elgg.walled_garden', '/css/walled_garden.css');
elgg_load_css('elgg.walled_garden');
- elgg_register_js('elgg.walled_garden', '/js/walled_garden.js');
elgg_load_js('elgg.walled_garden');
$body = elgg_view('core/walled_garden/body');
@@ -2026,6 +2024,9 @@ function elgg_walled_garden_index() {
function elgg_walled_garden() {
global $CONFIG;
+ elgg_register_css('elgg.walled_garden', '/css/walled_garden.css');
+ elgg_register_js('elgg.walled_garden', '/js/walled_garden.js');
+
// check for external page view
if (isset($CONFIG->site) && $CONFIG->site instanceof ElggSite) {
$CONFIG->site->checkWalledGarden();
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index daced6740..48c2e72b8 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1378,34 +1378,27 @@ function disable_entity($guid, $reason = "", $recursive = true) {
}
if ($recursive) {
- // Temporary token overriding access controls
- // @todo Do this better.
- static $__RECURSIVE_DELETE_TOKEN;
- // Make it slightly harder to guess
- $__RECURSIVE_DELETE_TOKEN = md5(elgg_get_logged_in_user_guid());
-
- $sub_entities = get_data("SELECT * from {$CONFIG->dbprefix}entities
- WHERE container_guid=$guid
- or owner_guid=$guid
- or site_guid=$guid", 'entity_row_to_elggstar');
+ $sub_entities = get_data("SELECT * FROM {$CONFIG->dbprefix}entities
+ WHERE (
+ container_guid = $guid
+ OR owner_guid = $guid
+ OR site_guid = $guid
+ ) AND enabled='yes'", 'entity_row_to_elggstar');
if ($sub_entities) {
foreach ($sub_entities as $e) {
+ add_entity_relationship($e->guid, 'disabled_with', $entity->guid);
$e->disable($reason);
}
}
-
- $__RECURSIVE_DELETE_TOKEN = null;
}
$entity->disableMetadata();
$entity->disableAnnotations();
- // relationships can't be disabled. hope they join to the entities table.
- //$entity->disableRelationships();
$res = update_data("UPDATE {$CONFIG->dbprefix}entities
- set enabled='no'
- where guid={$guid}");
+ SET enabled = 'no'
+ WHERE guid = $guid");
return $res;
}
@@ -1420,40 +1413,51 @@ function disable_entity($guid, $reason = "", $recursive = true) {
* @warning In order to enable an entity using ElggEntity::enable(),
* you must first use {@link access_show_hidden_entities()}.
*
- * @param int $guid GUID of entity to enable
+ * @param int $guid GUID of entity to enable
+ * @param bool $recursive Recursively enable all entities disabled with the entity?
*
* @return bool
*/
-function enable_entity($guid) {
+function enable_entity($guid, $recursive = true) {
global $CONFIG;
$guid = (int)$guid;
// Override access only visible entities
- $access_status = access_get_show_hidden_status();
+ $old_access_status = access_get_show_hidden_status();
access_show_hidden_entities(true);
+ $result = false;
if ($entity = get_entity($guid)) {
if (elgg_trigger_event('enable', $entity->type, $entity)) {
if ($entity->canEdit()) {
- access_show_hidden_entities($access_status);
-
$result = update_data("UPDATE {$CONFIG->dbprefix}entities
- set enabled='yes'
- where guid={$guid}");
+ SET enabled = 'yes'
+ WHERE guid = $guid");
$entity->deleteMetadata('disable_reason');
$entity->enableMetadata();
$entity->enableAnnotations();
- return $result;
+ if ($recursive) {
+ $disabled_with_it = elgg_get_entities_from_relationship(array(
+ 'relationship' => 'disabled_with',
+ 'relationship_guid' => $entity->guid,
+ 'inverse_relationship' => true,
+ ));
+
+ foreach ($disabled_with_it as $e) {
+ $e->enable();
+ remove_entity_relationship($e->guid, 'disabled_with', $entity->guid);
+ }
+ }
}
}
}
- access_show_hidden_entities($access_status);
- return false;
+ access_show_hidden_entities($old_access_status);
+ return $result;
}
/**
@@ -2318,3 +2322,4 @@ elgg_register_plugin_hook_handler('volatile', 'metadata', 'volatile_data_export_
/** Register init system event **/
elgg_register_event_handler('init', 'system', 'entities_init');
+
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 050e69526..4908b3e88 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -216,12 +216,11 @@ function update_metadata($id, $name, $value, $value_type, $owner_guid, $access_i
$result = update_data($query);
if ($result !== false) {
+ // @todo this event tells you the metadata has been updated, but does not
+ // let you do anything about it. What is needed is a plugin hook before
+ // the update that passes old and new values.
$obj = elgg_get_metadata_from_id($id);
- if (elgg_trigger_event('update', 'metadata', $obj)) {
- return true;
- } else {
- elgg_delete_metadata_by_id($id);
- }
+ elgg_trigger_event('update', 'metadata', $obj);
}
return $result;
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index eb7e594c6..5a2f5f8ac 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -487,6 +487,7 @@ function object_notifications($event, $object_type, $object) {
// (Person defined by container_guid so we can also subscribe to groups if we want)
foreach ($NOTIFICATION_HANDLERS as $method => $foo) {
$interested_users = elgg_get_entities_from_relationship(array(
+ 'site_guids' => ELGG_ENTITIES_ANY_VALUE,
'relationship' => 'notify' . $method,
'relationship_guid' => $object->container_guid,
'inverse_relationship' => TRUE,
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 63d0f5cef..f186c66cb 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -52,11 +52,8 @@ function create_object_entity($guid, $title, $description) {
if ($result != false) {
// Update succeeded, continue
$entity = get_entity($guid);
- if (elgg_trigger_event('update', $entity->type, $entity)) {
- return $guid;
- } else {
- $entity->delete();
- }
+ elgg_trigger_event('update', $entity->type, $entity);
+ return $guid;
}
} else {
// Update failed, attempt an insert.
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index be871d025..026bc171b 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -439,9 +439,9 @@ function elgg_set_plugin_priorities(array $order) {
}
}
- // set the missing plugins priorities
+ // set the missing plugins' priorities
if ($return && $missing_plugins) {
- if (!$priority) {
+ if (!isset($priority)) {
$priority = 0;
}
foreach ($missing_plugins as $plugin) {
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 421813441..63625878f 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -44,10 +44,16 @@ $posted = 0, $annotation_id = 0) {
if ($access_id === "") {
$access_id = $object->access_id;
}
- $annotation_id = (int)$annotation_id;
$type = $object->getType();
$subtype = $object->getSubtype();
+
+ $view = sanitise_string($view);
$action_type = sanitise_string($action_type);
+ $subject_guid = sanitise_int($subject_guid);
+ $object_guid = sanitise_int($object_guid);
+ $access_id = sanitise_int($access_id);
+ $posted = sanitise_int($posted);
+ $annotation_id = sanitise_int($annotation_id);
$params = array(
'type' => $type,
diff --git a/engine/lib/upgrades/2011030700-1.8_svn-blog_status_metadata-4645225d7b440876.php b/engine/lib/upgrades/2011030700-1.8_svn-blog_status_metadata-4645225d7b440876.php
index e4ab9c137..fe2af9928 100644
--- a/engine/lib/upgrades/2011030700-1.8_svn-blog_status_metadata-4645225d7b440876.php
+++ b/engine/lib/upgrades/2011030700-1.8_svn-blog_status_metadata-4645225d7b440876.php
@@ -9,7 +9,8 @@
$ia = elgg_set_ignore_access(true);
$options = array(
'type' => 'object',
- 'subtype' => 'blog'
+ 'subtype' => 'blog',
+ 'limit' => 0,
);
$batch = new ElggBatch('elgg_get_entities', $options);
diff --git a/engine/lib/upgrades/2011061200-1.8b1-sites_need_a_site_guid-6d9dcbf46c0826cc.php b/engine/lib/upgrades/2011061200-1.8b1-sites_need_a_site_guid-6d9dcbf46c0826cc.php
index 4fc59ac41..41ab29998 100644
--- a/engine/lib/upgrades/2011061200-1.8b1-sites_need_a_site_guid-6d9dcbf46c0826cc.php
+++ b/engine/lib/upgrades/2011061200-1.8b1-sites_need_a_site_guid-6d9dcbf46c0826cc.php
@@ -16,6 +16,7 @@ access_show_hidden_entities(true);
$options = array(
'type' => 'site',
'site_guid' => 0,
+ 'limit' => 0,
);
$batch = new ElggBatch('elgg_get_entities', $options);
diff --git a/engine/lib/upgrades/2011123100-1.8.2-fix_friend_river-b17e7ff8345c2269.php b/engine/lib/upgrades/2011123100-1.8.2-fix_friend_river-b17e7ff8345c2269.php
new file mode 100644
index 000000000..4dc43cd32
--- /dev/null
+++ b/engine/lib/upgrades/2011123100-1.8.2-fix_friend_river-b17e7ff8345c2269.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Elgg 1.8.2 upgrade 2011123100
+ * fix_friend_river
+ *
+ * Action type was incorrect due to previoud friends river upgrade
+ */
+
+$query = "UPDATE {$CONFIG->dbprefix}river
+ SET action_type='friend'
+ WHERE view='river/relationship/friend/create' AND action_type='create'";
+update_data($query);
diff --git a/engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php b/engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php
new file mode 100644
index 000000000..e351c6ac9
--- /dev/null
+++ b/engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg 1.8.2 upgrade 2011123101
+ * fix_blog_status
+ *
+ * Most blog posts did not have their status properly set with 1.8 upgrade so we run
+ * the blog status upgrade again
+ */
+
+$ia = elgg_set_ignore_access(true);
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'blog',
+ 'limit' => 0,
+);
+$batch = new ElggBatch('elgg_get_entities', $options);
+
+foreach ($batch as $entity) {
+ if (!$entity->status) {
+ // create metadata owned by the original owner
+ create_metadata($entity->getGUID(), 'status', 'published', '', $entity->owner_guid,
+ $entity->access_id);
+ }
+}
+elgg_set_ignore_access($ia); \ No newline at end of file
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 1b3cca799..362488718 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -60,13 +60,12 @@ function create_user_entity($guid, $name, $username, $password, $salt, $email, $
$row = get_entity_as_row($guid);
if ($row) {
// Exists and you have access to it
-
$query = "SELECT guid from {$CONFIG->dbprefix}users_entity where guid = {$guid}";
if ($exists = get_data_row($query)) {
$query = "UPDATE {$CONFIG->dbprefix}users_entity
- set name='$name', username='$username', password='$password', salt='$salt',
- email='$email', language='$language', code='$code', last_action = "
- . time() . " where guid = {$guid}";
+ SET name='$name', username='$username', password='$password', salt='$salt',
+ email='$email', language='$language', code='$code'
+ WHERE guid = $guid";
$result = update_data($query);
if ($result != false) {
@@ -79,7 +78,7 @@ function create_user_entity($guid, $name, $username, $password, $salt, $email, $
}
}
} else {
- // Update failed, attempt an insert.
+ // Exists query failed, attempt an insert.
$query = "INSERT into {$CONFIG->dbprefix}users_entity
(guid, name, username, password, salt, email, language, code)
values ($guid, '$name', '$username', '$password', '$salt', '$email', '$language', '$code')";
@@ -90,7 +89,7 @@ function create_user_entity($guid, $name, $username, $password, $salt, $email, $
if (elgg_trigger_event('create', $entity->type, $entity)) {
return $guid;
} else {
- $entity->delete(); //delete_entity($guid);
+ $entity->delete();
}
}
}
@@ -299,13 +298,14 @@ function get_user_sites($user_guid, $limit = 10, $offset = 0) {
$offset = (int)$offset;
return elgg_get_entities_from_relationship(array(
+ 'site_guids' => ELGG_ENTITIES_ANY_VALUE,
'relationship' => 'member_of_site',
'relationship_guid' => $user_guid,
'inverse_relationship' => FALSE,
'types' => 'site',
'limit' => $limit,
- 'offset' => $offset)
- );
+ 'offset' => $offset,
+ ));
}
/**
@@ -952,6 +952,7 @@ $allow_multiple_emails = false, $friend_guid = 0, $invitecode = '') {
$user->password = generate_user_password($user, $password);
$user->owner_guid = 0; // Users aren't owned by anyone, even if they are admin created.
$user->container_guid = 0; // Users aren't contained by anyone, even if they are admin created.
+ $user->language = get_current_language();
$user->save();
// If $friend_guid has been set, make mutual friends
@@ -1549,6 +1550,7 @@ function users_init() {
elgg_register_action('friends/remove');
elgg_register_action('avatar/upload');
elgg_register_action('avatar/crop');
+ elgg_register_action('avatar/revert');
elgg_register_action('profile/edit');
elgg_register_action('friends/collections/add');
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 46f34391a..d73dd6330 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -316,7 +316,12 @@ function elgg_default_widgets_init() {
// override permissions for creating widget on logged out / just created entities
elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'elgg_default_widgets_permissions_override');
+ // only register the callback once per event
+ $events = array();
foreach ($default_widgets as $info) {
+ $events[$info['event'] . ',' . $info['entity_type']] = $info;
+ }
+ foreach ($events as $info) {
elgg_register_event_handler($info['event'], $info['entity_type'], 'elgg_create_default_widgets');
}
}
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index 1772f7c1a..a4dc7946c 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -226,6 +226,39 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->assertTrue($this->entity->delete());
}
+ public function testElggEntityRecursiveDisableAndEnable() {
+ global $CONFIG;
+
+ $this->save_entity();
+ $obj1 = new ElggObject();
+ $obj1->container_guid = $this->entity->getGUID();
+ $obj1->save();
+ $obj2 = new ElggObject();
+ $obj2->container_guid = $this->entity->getGUID();
+ $obj2->save();
+
+ // disable $obj2 before disabling the container
+ $this->assertTrue($obj2->disable());
+
+ // disable entities container by $this->entity
+ $this->assertTrue($this->entity->disable());
+ $entity = get_data_row("SELECT * FROM {$CONFIG->dbprefix}entities WHERE guid = '{$obj1->guid}'");
+ $this->assertIdentical($entity->enabled, 'no');
+
+ // enable entities that were disabled with the container (but not $obj2)
+ $this->assertTrue($this->entity->enable());
+ $entity = get_data_row("SELECT * FROM {$CONFIG->dbprefix}entities WHERE guid = '{$obj1->guid}'");
+ $this->assertIdentical($entity->enabled, 'yes');
+ $entity = get_data_row("SELECT * FROM {$CONFIG->dbprefix}entities WHERE guid = '{$obj2->guid}'");
+ $this->assertIdentical($entity->enabled, 'no');
+
+ // cleanup
+ $this->assertTrue($obj2->enable());
+ $this->assertTrue($obj2->delete());
+ $this->assertTrue($obj1->delete());
+ $this->assertTrue($this->entity->delete());
+ }
+
public function testElggEntityMetadata() {
// let's delete a non-existent metadata
$this->assertFalse($this->entity->deleteMetadata('important'));
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js
index 47e43c876..6114aeacd 100644
--- a/js/lib/ui.widgets.js
+++ b/js/lib/ui.widgets.js
@@ -15,7 +15,7 @@ elgg.ui.widgets.init = function() {
$(".elgg-widgets").sortable({
items: 'div.elgg-module-widget.elgg-state-draggable',
connectWith: '.elgg-widgets',
- handle: 'div.elgg-head',
+ handle: '.elgg-widget-handle',
forcePlaceholderSize: true,
placeholder: 'elgg-widget-placeholder',
opacity: 0.8,
diff --git a/languages/en.php b/languages/en.php
index 93099c98f..acc8e0bc0 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -270,6 +270,8 @@ $english = array(
'PUBLIC' => "Public",
'access:friends:label' => "Friends",
'access' => "Access",
+ 'access:limited:label' => "Limited",
+ 'access:help' => "The access level",
/**
* Dashboard and widgets
@@ -363,6 +365,7 @@ $english = array(
'avatar:preview' => 'Preview',
'avatar:upload' => 'Upload a new avatar',
'avatar:current' => 'Current avatar',
+ 'avatar:revert' => 'Revert your avatar to the default icon',
'avatar:crop:title' => 'Avatar cropping tool',
'avatar:upload:instructions' => "Your avatar is displayed throughout the site. You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)",
'avatar:create:instructions' => 'Click and drag a square below to match how you want your avatar cropped. A preview will appear in the box on the right. When you are happy with the preview, click \'Create your avatar\'. This cropped version will be used throughout the site as your avatar.',
@@ -371,6 +374,8 @@ $english = array(
'avatar:resize:fail' => 'Resize of the avatar failed',
'avatar:crop:success' => 'Cropping the avatar succeeded',
'avatar:crop:fail' => 'Avatar cropping failed',
+ 'avatar:revert:success' => 'Reverting the avatar succeeded',
+ 'avatar:revert:fail' => 'Avatar revert failed',
'profile:edit' => 'Edit profile',
'profile:aboutme' => "About me",
@@ -840,6 +845,7 @@ $english = array(
'new' => 'New',
'add' => 'Add',
'create' => 'Create',
+ 'revert' => 'Revert',
'site' => 'Site',
'activity' => 'Activity',
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index 8ca8ce846..8923cd0d2 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -78,11 +78,8 @@ foreach ($values as $name => $default) {
case 'excerpt':
if ($value) {
- $value = elgg_get_excerpt($value);
- } else {
- $value = elgg_get_excerpt($values['description']);
+ $values[$name] = elgg_get_excerpt($value);
}
- $values[$name] = $value;
break;
case 'container_guid':
@@ -144,7 +141,6 @@ if (!$error) {
system_message(elgg_echo('blog:message:saved'));
$status = $blog->status;
- $db_prefix = elgg_get_config('dbprefix');
// add to river if changing status or published, regardless of new post
// because we remove it for drafts.
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 @@
<?php
/**
* Extended class to override the time_created
+ *
+ * @property string $status The published status of the blog post (published, draft)
+ * @property string $comments_on Whether commenting is allowed (Off, On)
+ * @property string $excerpt An excerpt of the blog post used when displaying the post
*/
class ElggBlog extends ElggObject {
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 590547a8c..286fe1832 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -187,11 +187,16 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
$now = time();
- $user = get_user($owner_guid);
+ $owner = get_entity($owner_guid);
elgg_set_page_owner_guid($owner_guid);
- $crumbs_title = $user->name;
- elgg_push_breadcrumb($crumbs_title, "blog/owner/{$user->username}");
+ $crumbs_title = $owner->name;
+ if (elgg_instanceof($owner, 'user')) {
+ $url = "blog/owner/{$owner->username}";
+ } else {
+ $url = "blog/group/$owner->guid/all";
+ }
+ elgg_push_breadcrumb($crumbs_title, $url);
elgg_push_breadcrumb(elgg_echo('blog:archives'));
if ($lower) {
@@ -209,7 +214,7 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
);
if ($owner_guid) {
- $options['owner_guid'] = $owner_guid;
+ $options['container_guid'] = $owner_guid;
}
// admin / owners can see any posts
diff --git a/mod/blog/start.php b/mod/blog/start.php
index fa57e7b96..a8553b4b8 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -125,6 +125,7 @@ function blog_page_handler($page) {
$params = blog_get_page_content_archive($user->guid, $page[2], $page[3]);
break;
case 'view':
+ case 'read': // Elgg 1.7 compatibility
$params = blog_get_page_content_read($page[1]);
break;
case 'add':
@@ -136,7 +137,11 @@ function blog_page_handler($page) {
$params = blog_get_page_content_edit($page_type, $page[1], $page[2]);
break;
case 'group':
- $params = blog_get_page_content_list($page[1]);
+ if ($page[2] == 'all') {
+ $params = blog_get_page_content_list($page[1]);
+ } else {
+ $params = blog_get_page_content_archive($page[1], $page[3], $page[4]);
+ }
break;
case 'all':
$params = blog_get_page_content_list();
@@ -234,7 +239,7 @@ function blog_ecml_views_hook($hook, $entity_type, $return_value, $params) {
* Upgrade from 1.7 to 1.8.
*/
function blog_run_upgrades($event, $type, $details) {
- $blog_upgrade_version = get_plugin_setting('upgrade_version', 'blogs');
+ $blog_upgrade_version = elgg_get_plugin_setting('upgrade_version', 'blogs');
if (!$blog_upgrade_version) {
// When upgrading, check if the ElggBlog class has been registered as this
@@ -243,23 +248,6 @@ function blog_run_upgrades($event, $type, $details) {
add_subtype('object', 'blog', 'ElggBlog');
}
- // only run this on the first migration to 1.8
- // add excerpt to all blogs that don't have it.
- $ia = elgg_set_ignore_access(true);
- $options = array(
- 'type' => 'object',
- 'subtype' => 'blog'
- );
-
- $blogs = new ElggBatch('elgg_get_entities', $options);
- foreach ($blogs as $blog) {
- if (!$blog->excerpt) {
- $blog->excerpt = elgg_get_excerpt($blog->description);
- }
- }
-
- elgg_set_ignore_access($ia);
-
elgg_set_plugin_setting('upgrade_version', 1, 'blogs');
}
}
diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php
index 028827178..6082cdafd 100644
--- a/mod/blog/views/default/blog/group_module.php
+++ b/mod/blog/views/default/blog/group_module.php
@@ -20,11 +20,12 @@ $options = array(
'type' => 'object',
'subtype' => 'blog',
'container_guid' => elgg_get_page_owner_guid(),
+ 'metadata_name_value_pairs' => array('name' => 'status', 'value' => 'published'),
'limit' => 6,
'full_view' => false,
'pagination' => false,
);
-$content = elgg_list_entities($options);
+$content = elgg_list_entities_from_metadata($options);
elgg_pop_context();
if (!$content) {
diff --git a/mod/blog/views/default/blog/sidebar.php b/mod/blog/views/default/blog/sidebar.php
index 97a23c17e..0ae2b431c 100644
--- a/mod/blog/views/default/blog/sidebar.php
+++ b/mod/blog/views/default/blog/sidebar.php
@@ -18,7 +18,7 @@ if ($vars['page'] == 'all') {
}
// only users can have archives at present
-if (elgg_instanceof(elgg_get_page_owner_entity(), 'user')) {
+if ($vars['page'] == 'owner' || $vars['page'] == 'group') {
echo elgg_view('blog/sidebar/archives', $vars);
}
diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php
index 3aa3db44f..3d8f28ca4 100644
--- a/mod/blog/views/default/blog/sidebar/archives.php
+++ b/mod/blog/views/default/blog/sidebar/archives.php
@@ -6,6 +6,12 @@
$loggedin_user = elgg_get_logged_in_user_entity();
$page_owner = elgg_get_page_owner_entity();
+if (elgg_instanceof($page_owner, 'user')) {
+ $url_segment = 'blog/archive/' . $page_owner->username;
+} else {
+ $url_segment = 'blog/group/' . $page_owner->getGUID() . '/archive';
+}
+
// This is a limitation of the URL schema.
if ($page_owner && $vars['page'] != 'friends') {
$dates = get_entity_dates('object', 'blog', $page_owner->getGUID());
@@ -13,11 +19,11 @@ if ($page_owner && $vars['page'] != 'friends') {
if ($dates) {
$title = elgg_echo('blog:archives');
$content = '<ul class="blog-archives">';
- foreach($dates as $date) {
+ foreach ($dates as $date) {
$timestamplow = mktime(0, 0, 0, substr($date,4,2) , 1, substr($date, 0, 4));
$timestamphigh = mktime(0, 0, 0, ((int) substr($date, 4, 2)) + 1, 1, substr($date, 0, 4));
- $link = elgg_get_site_url() . 'blog/archive/' . $page_owner->username . '/' . $timestamplow . '/' . $timestamphigh;
+ $link = elgg_get_site_url() . $url_segment . '/' . $timestamplow . '/' . $timestamphigh;
$month = elgg_echo('date:month:' . substr($date, 4, 2), array(substr($date, 0, 4)));
$content .= "<li><a href=\"$link\" title=\"$month\">$month</a></li>";
}
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 3525b3d48..aa8074a69 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -16,6 +16,9 @@ $owner = $blog->getOwnerEntity();
$container = $blog->getContainerEntity();
$categories = elgg_view('output/categories', $vars);
$excerpt = $blog->excerpt;
+if (!$excerpt) {
+ $excerpt = elgg_get_excerpt($blog->description);
+}
$owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array(
diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php
index a2682363c..812f779fa 100644
--- a/mod/developers/languages/en.php
+++ b/mod/developers/languages/en.php
@@ -9,6 +9,7 @@ $english = array(
'admin:develop_tools' => 'Tools',
'admin:develop_tools:preview' => 'Theming Sandbox',
'admin:develop_tools:inspect' => 'Inspect',
+ 'admin:develop_tools:unit_tests' => 'Unit Tests',
'admin:developers' => 'Developers',
'admin:developers:settings' => 'Settings',
@@ -54,6 +55,11 @@ $english = array(
'theme_preview:navigation' => 'Navigation',
'theme_preview:typography' => 'Typography',
+ // unit tests
+ 'developers:unit_tests:description' => 'Elgg has unit and integration tests for detecting bugs in its core classes and functions.',
+ 'developers:unit_tests:warning' => 'Warning: Do Not Run These Tests on a Production Site. They can corrupt your database.',
+ 'developers:unit_tests:run' => 'Run',
+
// status messages
'developers:settings:success' => 'Settings saved',
);
diff --git a/mod/developers/start.php b/mod/developers/start.php
index 79ec0655a..d77a96b36 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -63,6 +63,7 @@ function developers_setup_menu() {
if (elgg_in_context('admin')) {
elgg_register_admin_menu_item('develop', 'inspect', 'develop_tools');
elgg_register_admin_menu_item('develop', 'preview', 'develop_tools');
+ elgg_register_admin_menu_item('develop', 'unit_tests', 'develop_tools');
elgg_register_menu_item('page', array(
'name' => 'dev_settings',
@@ -76,8 +77,8 @@ function developers_setup_menu() {
}
/**
-* Clear all the strings so the raw descriptor strings are displayed
-*/
+ * Clear all the strings so the raw descriptor strings are displayed
+ */
function developers_clear_strings() {
global $CONFIG;
@@ -121,8 +122,8 @@ function developers_wrap_views($hook, $type, $result, $params) {
}
/**
-* Log the events and plugin hooks
-*/
+ * Log the events and plugin hooks
+ */
function developers_log_events($name, $type) {
// filter out some very common events
diff --git a/mod/developers/views/default/admin/develop_tools/unit_tests.php b/mod/developers/views/default/admin/develop_tools/unit_tests.php
new file mode 100644
index 000000000..81658e88b
--- /dev/null
+++ b/mod/developers/views/default/admin/develop_tools/unit_tests.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Elgg unit and integration tests
+ *
+ */
+
+echo '<p>' . elgg_echo('developers:unit_tests:description') . '</p>';
+echo '<p><strong>' . elgg_echo('developers:unit_tests:warning') . '</strong></p>';
+
+// create a button to run tests
+$params = array(
+ 'text' => elgg_echo('developers:unit_tests:run'),
+ 'href' => 'engine/tests/suite.php',
+ 'class' => 'elgg-button elgg-button-submit',
+ 'is_trusted' => true,
+);
+echo '<p>' . elgg_view('output/url', $params) . '</p>';
diff --git a/mod/diagnostics/languages/en.php b/mod/diagnostics/languages/en.php
index c4e337b50..54859941d 100644
--- a/mod/diagnostics/languages/en.php
+++ b/mod/diagnostics/languages/en.php
@@ -1,71 +1,45 @@
<?php
- /**
- * Elgg diagnostics language pack.
- *
- * @package ElggDiagnostics
- */
-
- $english = array(
-
- 'admin:develop_utilities:diagnostics' => 'System Diagnostics',
- 'diagnostics' => 'System diagnostics',
- 'diagnostics:report' => 'Diagnostics Report',
- 'diagnostics:unittester' => 'Unit Tests',
-
- 'diagnostics:description' => 'The following diagnostic report is useful for diagnosing any problems with Elgg, and should be attached to any bug reports you file.',
- 'diagnostics:unittester:description' => 'The following are diagnostic tests which are registered by plugins and may be performed in order to debug parts of the Elgg framework.',
-
- 'diagnostics:unittester:description' => 'Unit tests check Elgg Core for broken or buggy APIs.',
- 'diagnostics:unittester:debug' => 'The site must be in debug mode to run unit tests.',
- 'diagnostics:unittester:warning' => 'WARNING: These tests can leave behind debugging objects in your database.<br />DO NOT USE ON A PRODUCTION SITE!',
-
- 'diagnostics:test:executetest' => 'Execute test',
- 'diagnostics:test:executeall' => 'Execute All',
- 'diagnostics:unittester:notests' => 'Sorry, there are no unit test modules currently installed.',
- 'diagnostics:unittester:testnotfound' => 'Sorry, the report could not be generated because that test was not found',
-
- 'diagnostics:unittester:testresult:nottestclass' => 'FAIL - Result not a test class',
- 'diagnostics:unittester:testresult:fail' => 'FAIL',
- 'diagnostics:unittester:testresult:success' => 'SUCCESS',
-
- 'diagnostics:unittest:example' => 'Example unit test, only available in debug mode.',
-
- 'diagnostics:unittester:report' => 'Test report for %s',
-
- 'diagnostics:download' => 'Download',
-
-
- 'diagnostics:header' => '========================================================================
+/**
+ * Elgg diagnostics language pack.
+ *
+ * @package ElggDiagnostics
+ */
+
+$english = array(
+ 'admin:administer_utilities:diagnostics' => 'System Diagnostics',
+ 'diagnostics' => 'System diagnostics',
+ 'diagnostics:report' => 'Diagnostics Report',
+ 'diagnostics:description' => 'The following diagnostic report can be useful for diagnosing problems with Elgg. The developers of Elgg may request that you attach it to a bug report.',
+ 'diagnostics:download' => 'Download',
+ 'diagnostics:header' => '========================================================================
Elgg Diagnostic Report
Generated %s by %s
========================================================================
',
- 'diagnostics:report:basic' => '
+ 'diagnostics:report:basic' => '
Elgg Release %s, version %s
------------------------------------------------------------------------',
- 'diagnostics:report:php' => '
+ 'diagnostics:report:php' => '
PHP info:
%s
------------------------------------------------------------------------',
- 'diagnostics:report:plugins' => '
+ 'diagnostics:report:plugins' => '
Installed plugins and details:
%s
------------------------------------------------------------------------',
- 'diagnostics:report:md5' => '
+ 'diagnostics:report:md5' => '
Installed files and checksums:
%s
------------------------------------------------------------------------',
- 'diagnostics:report:globals' => '
+ 'diagnostics:report:globals' => '
Global variables:
%s
------------------------------------------------------------------------',
+);
- );
-
- add_translation("en",$english);
-?> \ No newline at end of file
+add_translation("en", $english);
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index 0bcc08bd9..55842800a 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -13,7 +13,7 @@ elgg_register_event_handler('init', 'system', 'diagnostics_init');
function diagnostics_init() {
// Add admin menu item
- elgg_register_admin_menu_item('develop', 'diagnostics', 'develop_utilities');
+ elgg_register_admin_menu_item('administer', 'diagnostics', 'administer_utilities');
// Register some actions
$file = elgg_get_plugins_path() . "diagnostics/actions/download.php";
diff --git a/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php b/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php
new file mode 100644
index 000000000..c7ff3d5fc
--- /dev/null
+++ b/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Diagnostics admin page
+ */
+
+$diagnostics_title = elgg_echo('diagnostics:report');
+$diagnostics = '<p>' . elgg_echo('diagnostics:description') .'</p>';
+$params = array(
+ 'text' => elgg_echo('diagnostics:download'),
+ 'href' => 'action/diagnostics/download',
+ 'class' => 'elgg-button elgg-button-submit',
+ 'is_action' => true,
+ 'is_trusted' => true,
+);
+$diagnostics .= '<p>' . elgg_view('output/url', $params) . '</p>';
+
+echo elgg_view_module('inline', $diagnostics_title, $diagnostics, array('class' => 'elgg-form-settings'));
diff --git a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
deleted file mode 100644
index 89e235279..000000000
--- a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * Diagnostics admin page
- */
-
-$diagnostics_title = elgg_echo('diagnostics:report');
-$diagnostics = '<p>' . elgg_echo('diagnostics:description') .'</p>';
-$params = array(
- 'text' => elgg_echo('diagnostics:download'),
- 'href' => 'action/diagnostics/download',
- 'class' => 'elgg-button elgg-button-submit',
- 'is_action' => true,
- 'is_trusted' => true,
-);
-$diagnostics .= '<p>' . elgg_view('output/url', $params) . '</p>';
-
-// unit tests
-$unit_tests_title = elgg_echo('diagnostics:unittester');
-$unit_tests .= '<p>' . elgg_echo('diagnostics:unittester:description') . '</p>';
-$unit_tests .= '<p>' . elgg_echo('diagnostics:unittester:warning') . '</p>';
-
-if (elgg_get_config('debug')) {
- // create a button to run tests
- $params = array(
- 'text' => elgg_echo('diagnostics:test:executeall'),
- 'href' => 'engine/tests/suite.php',
- 'class' => 'elgg-button elgg-button-submit',
- 'is_trusted' => true,
- );
- $unit_tests .= '<p>' . elgg_view('output/url', $params) . '</p>';
-} else {
- // no tests when not in debug mode
- $unit_tests .= elgg_echo('diagnostics:unittester:debug');
-}
-
-// display admin body
-echo elgg_view_module('inline', $diagnostics_title, $diagnostics, array('class' => 'elgg-form-settings'));
-echo elgg_view_module('inline', $unit_tests_title, $unit_tests, array('class' => 'elgg-form-settings'));
diff --git a/mod/externalpages/actions/edit.php b/mod/externalpages/actions/edit.php
index edfffe168..184aa3d82 100644
--- a/mod/externalpages/actions/edit.php
+++ b/mod/externalpages/actions/edit.php
@@ -1,18 +1,28 @@
<?php
/**
- * Elgg external pages: add/edit
+ * Elgg external pages: create or update
*
*/
-// Get input data
+// Get input data and don't filter the content
$contents = get_input('expagescontent', '', false);
$type = get_input('content_type');
-$previous_guid = get_input('expage_guid');
+$guid = get_input('guid');
-// create object to hold the page details
-$expages = new ElggObject();
-$expages->subtype = $type;
-$expages->owner_guid = get_loggedin_userid();
+if ($guid) {
+ // update
+ $expages = get_entity($guid);
+ if (!$expages) {
+ register_error(elgg_echo("expages:error"));
+ forward(REFERER);
+ }
+} else {
+ // create
+ $expages = new ElggObject();
+ $expages->subtype = $type;
+}
+
+$expages->owner_guid = elgg_get_logged_in_user_guid();
$expages->access_id = ACCESS_PUBLIC;
$expages->title = $type;
$expages->description = $contents;
diff --git a/mod/externalpages/views/default/expages/menu.php b/mod/externalpages/views/default/expages/menu.php
index 6ed521629..831be9125 100644
--- a/mod/externalpages/views/default/expages/menu.php
+++ b/mod/externalpages/views/default/expages/menu.php
@@ -7,8 +7,8 @@
$type = $vars['type'];
- //set the url
- $url = $vars['url'] . "admin/site/expages?type=";
+//set the url
+$url = $vars['url'] . "admin/site/expages?type=";
$pages = array('about', 'terms', 'privacy');
$tabs = array();
diff --git a/mod/externalpages/views/default/forms/expages/edit.php b/mod/externalpages/views/default/forms/expages/edit.php
index ca83ea7df..a15f2a7aa 100644
--- a/mod/externalpages/views/default/forms/expages/edit.php
+++ b/mod/externalpages/views/default/forms/expages/edit.php
@@ -50,9 +50,9 @@ echo <<<EOT
$input_area
</div>
<div class="elgg-foot">
-$hidden_value
+$hidden_guid
$hidden_type
$submit_input
-<div>
+</div>
EOT;
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index c4cf6667e..b513a6098 100644
--- a/mod/groups/actions/groups/edit.php
+++ b/mod/groups/actions/groups/edit.php
@@ -89,14 +89,10 @@ if ($new_group_flag) {
$group->save();
-// group creator needs to be member of new group and river entry created
-if ($new_group_flag) {
- elgg_set_page_owner_guid($group->guid);
- $group->join($user);
- add_to_river('river/group/create', 'create', $user->guid, $group->guid);
-}
-
// Invisible group support
+// @todo this requires save to be called to create the acl for the group. This
+// is an odd requirement and should be removed. Either the acl creation happens
+// in the action or the visibility moves to a plugin hook
if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
$visibility = (int)get_input('vis', '', false);
if ($visibility != ACCESS_PUBLIC && $visibility != ACCESS_LOGGED_IN) {
@@ -105,10 +101,18 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
if ($group->access_id != $visibility) {
$group->access_id = $visibility;
- $group->save();
}
}
+$group->save();
+
+// group creator needs to be member of new group and river entry created
+if ($new_group_flag) {
+ elgg_set_page_owner_guid($group->guid);
+ $group->join($user);
+ add_to_river('river/group/create', 'create', $user->guid, $group->guid, $group->access_id);
+}
+
// Now see if we have a file icon
if ((isset($_FILES['icon'])) && (substr_count($_FILES['icon']['type'],'image/'))) {
diff --git a/mod/groups/actions/groups/membership/delete_invite.php b/mod/groups/actions/groups/membership/delete_invite.php
index 4b654f0b6..d21aa0309 100644
--- a/mod/groups/actions/groups/membership/delete_invite.php
+++ b/mod/groups/actions/groups/membership/delete_invite.php
@@ -9,7 +9,11 @@ $user_guid = get_input('user_guid', elgg_get_logged_in_user_guid());
$group_guid = get_input('group_guid');
$user = get_entity($user_guid);
+
+// invisible groups require overriding access to delete invite
+$old_access = elgg_set_ignore_access(true);
$group = get_entity($group_guid);
+elgg_set_ignore_access($old_access);
// If join request made
if (check_entity_relationship($group->guid, 'invited', $user->guid)) {
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 09feaf8d1..a4a9e2b2b 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -61,6 +61,8 @@ $english = array(
'groups:search:tags' => "tag",
'groups:search:title' => "Search for groups tagged with '%s'",
'groups:search:none' => "No matching groups were found",
+ 'groups:search_in_group' => "Search in this group",
+ 'groups:acl' => "Group: %s",
'groups:activity' => "Group activity",
'groups:enableactivity' => 'Enable group activity',
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 7798e5dc3..5d6083077 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -234,6 +234,8 @@ function groups_handle_invitations_page() {
function groups_handle_profile_page($guid) {
elgg_set_page_owner_guid($guid);
+ elgg_push_context('group_profile');
+
// turn this into a core function
global $autofeed;
$autofeed = true;
@@ -247,7 +249,11 @@ function groups_handle_profile_page($guid) {
$content = elgg_view('groups/profile/layout', array('entity' => $group));
if (group_gatekeeper(false)) {
- $sidebar = elgg_view('groups/sidebar/members', array('entity' => $group));
+ $sidebar = '';
+ if (elgg_is_active_plugin('search')) {
+ $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group));
+ }
+ $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group));
} else {
$sidebar = '';
}
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 09362cbbc..86a1da279 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -663,7 +663,7 @@ function group_access_options($group) {
ACCESS_PRIVATE => 'private',
ACCESS_LOGGED_IN => 'logged in users',
ACCESS_PUBLIC => 'public',
- $group->group_acl => 'Group: ' . $group->name,
+ $group->group_acl => elgg_echo('groups:acl', array($group->name)),
);
return $access_array;
}
diff --git a/mod/groups/upgrades/2011030101.php b/mod/groups/upgrades/2011030101.php
index c2a80c08c..55edb1a16 100644
--- a/mod/groups/upgrades/2011030101.php
+++ b/mod/groups/upgrades/2011030101.php
@@ -9,6 +9,7 @@ $topics = elgg_get_entities(array(
'type' => 'object',
'subtype' => 'groupforumtopic',
'limit' => 5,
+ 'order_by' => 'e.time_created asc',
));
// if not topics, no upgrade required
@@ -25,12 +26,17 @@ foreach ($topics as $topic) {
/**
- * Condense annotation into object
+ * Condense first annotation into object
*
* @param ElggObject $topic
*/
function groups_2011030101($topic) {
+ // do not upgrade topics that have already been upgraded
+ if ($topic->description) {
+ return true;
+ }
+
$annotation = $topic->getAnnotations('group_topic_post', 1);
if (!$annotation) {
// no text for this forum post so we delete (probably caused by #2624)
@@ -43,8 +49,14 @@ function groups_2011030101($topic) {
return $annotation[0]->delete();
}
-$options = array('type' => 'object', 'subtype' => 'groupforumtopic');
+$previous_access = elgg_set_ignore_access(true);
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'groupforumtopic',
+ 'limit' => 0,
+);
$batch = new ElggBatch('elgg_get_entities', $options, 'groups_2011030101', 100);
+elgg_set_ignore_access($previous_access);
if ($batch->callbackResult) {
error_log("Elgg Groups upgrade (2011030101) succeeded");
diff --git a/mod/groups/views/default/forms/groups/find.php b/mod/groups/views/default/forms/groups/find.php
new file mode 100644
index 000000000..ddf639b74
--- /dev/null
+++ b/mod/groups/views/default/forms/groups/find.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Group tag-based search form body
+ */
+
+$tag_string = elgg_echo('groups:search:tags');
+
+$params = array(
+ 'name' => 'tag',
+ 'class' => 'elgg-input-search mbm',
+ 'value' => $tag_string,
+ 'onclick' => "if (this.value=='$tag_string') { this.value='' }",
+);
+echo elgg_view('input/text', $params);
+
+echo elgg_view('input/submit', array('value' => elgg_echo('search:go')));
diff --git a/mod/groups/views/default/forms/groups/search.php b/mod/groups/views/default/forms/groups/search.php
index ddf639b74..850b6088e 100644
--- a/mod/groups/views/default/forms/groups/search.php
+++ b/mod/groups/views/default/forms/groups/search.php
@@ -1,16 +1,20 @@
<?php
/**
- * Group tag-based search form body
+ * Group search form
+ *
+ * @uses $vars['entity'] ElggGroup
*/
-$tag_string = elgg_echo('groups:search:tags');
-
$params = array(
- 'name' => 'tag',
+ 'name' => 'q',
'class' => 'elgg-input-search mbm',
'value' => $tag_string,
- 'onclick' => "if (this.value=='$tag_string') { this.value='' }",
);
echo elgg_view('input/text', $params);
+echo elgg_view('input/hidden', array(
+ 'name' => 'container_guid',
+ 'value' => $vars['entity']->getGUID(),
+));
+
echo elgg_view('input/submit', array('value' => elgg_echo('search:go')));
diff --git a/mod/groups/views/default/groups/group_sort_menu.php b/mod/groups/views/default/groups/group_sort_menu.php
index c53b49c8e..f5631a31f 100644
--- a/mod/groups/views/default/groups/group_sort_menu.php
+++ b/mod/groups/views/default/groups/group_sort_menu.php
@@ -2,6 +2,7 @@
/**
* All groups listing page navigation
*
+ * @uses $vars['selected'] Name of the tab that has been selected
*/
$tabs = array(
@@ -22,14 +23,13 @@ $tabs = array(
),
);
-// sets default selected item
-if (strpos(full_url(), 'filter') === false) {
- $tabs['newest']['selected'] = true;
-}
-
foreach ($tabs as $name => $tab) {
$tab['name'] = $name;
+ if ($vars['selected'] == $name) {
+ $tab['selected'] = true;
+ }
+
elgg_register_menu_item('filter', $tab);
}
diff --git a/mod/groups/views/default/groups/sidebar/find.php b/mod/groups/views/default/groups/sidebar/find.php
index c5c986759..c1a8da3c2 100644
--- a/mod/groups/views/default/groups/sidebar/find.php
+++ b/mod/groups/views/default/groups/sidebar/find.php
@@ -5,7 +5,7 @@
* @package ElggGroups
*/
$url = elgg_get_site_url() . 'groups/search';
-$body = elgg_view_form('groups/search', array(
+$body = elgg_view_form('groups/find', array(
'action' => $url,
'method' => 'get',
'disable_security' => true,
diff --git a/mod/groups/views/default/groups/sidebar/search.php b/mod/groups/views/default/groups/sidebar/search.php
new file mode 100644
index 000000000..226835715
--- /dev/null
+++ b/mod/groups/views/default/groups/sidebar/search.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Search for content in this group
+ *
+ * @uses vars['entity'] ElggGroup
+ */
+
+$url = elgg_get_site_url() . 'search';
+$body = elgg_view_form('groups/search', array(
+ 'action' => $url,
+ 'method' => 'get',
+ 'disable_security' => true,
+), $vars);
+
+echo elgg_view_module('aside', elgg_echo('groups:search_in_group'), $body); \ No newline at end of file
diff --git a/mod/thewire/classes/ElggWire.php b/mod/thewire/classes/ElggWire.php
index 3242dd5cb..5155a7f97 100644
--- a/mod/thewire/classes/ElggWire.php
+++ b/mod/thewire/classes/ElggWire.php
@@ -1,6 +1,10 @@
<?php
/**
* ElggWire Class
+ *
+ * @property string $method The method used to create the wire post
+ * @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
*/
class ElggWire extends ElggObject {
diff --git a/version.php b/version.php
index 29870f93f..455f77ad1 100644
--- a/version.php
+++ b/version.php
@@ -11,7 +11,7 @@
// YYYYMMDD = Elgg Date
// XX = Interim incrementer
-$version = 2011122100;
+$version = 2011123101;
// Human-friendly version name
$release = '1.8.2';
diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php
index 4aa86373a..29aa59c9c 100644
--- a/views/default/core/avatar/upload.php
+++ b/views/default/core/avatar/upload.php
@@ -12,6 +12,17 @@ $user_avatar = elgg_view('output/img', array(
$current_label = elgg_echo('avatar:current');
+$revert_button = '';
+if ($vars['entity']->icontime) {
+ $revert_button = elgg_view('output/url', array(
+ 'text' => elgg_echo('revert'),
+ 'title' => elgg_echo('avatar:revert'),
+ 'href' => 'action/avatar/revert?guid=' . elgg_get_page_owner_guid(),
+ 'is_action' => true,
+ 'class' => 'elgg-button elgg-button-cancel mll',
+ ));
+}
+
$form_params = array('enctype' => 'multipart/form-data');
$upload_form = elgg_view_form('avatar/upload', $form_params, $vars);
@@ -28,6 +39,7 @@ $image = <<<HTML
<label>$current_label</label><br />
$user_avatar
</div>
+$revert_button
HTML;
$body = <<<HTML
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index dc1b503cb..6deceb14e 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -106,7 +106,12 @@ a:hover {
text-decoration: underline;
}
pre, code {
- background: #EBF5FF;
+ background-color: #EEE;
+ border: 1px solid #DDD;
+ color: #444;
+ overflow: auto;
+ margin: 15px 0;
+ padding: 5px;
}
blockquote {
background: #EBF5FF;
@@ -817,6 +822,27 @@ a.elgg-button {
}
/* ***************************************
+ WIDGET MENU
+*************************************** */
+.elgg-menu-widget > li {
+ position: absolute;
+ top: 4px;
+ display: inline-block;
+ width: 18px;
+ height: 18px;
+ padding: 2px 2px 0 0;
+}
+.elgg-menu-widget > .elgg-menu-item-collapse {
+ left: 5px;
+}
+.elgg-menu-widget > .elgg-menu-item-delete {
+ right: 5px;
+}
+.elgg-menu-widget > .elgg-menu-item-settings {
+ right: 25px;
+}
+
+/* ***************************************
MORE MENUS
*************************************** */
/* Horizontal menus w/ separator support */
@@ -915,22 +941,16 @@ a.elgg-button {
height: 26px;
overflow: hidden;
}
+.elgg-module-widget.elgg-state-draggable .elgg-widget-handle {
+ cursor: move;
+}
.elgg-module-widget > .elgg-head h3 {
float: left;
padding: 4px 45px 0 20px;
color: #333;
}
-.elgg-module-widget > .elgg-head a {
- position: absolute;
- top: 4px;
- display: inline-block;
- width: 18px;
- height: 18px;
- padding: 2px 2px 0 0;
-}
.elgg-widget-collapse-button {
- left: 5px;
color: #c5c5c5;
text-decoration: none;
}
@@ -945,12 +965,6 @@ a.elgg-widget-collapse-button:before {
a.elgg-widget-collapsed:before {
content: "\25BA";
}
-.elgg-widget-delete-button {
- right: 5px;
-}
-.elgg-widget-edit-button {
- right: 25px;
-}
.elgg-module-widget > .elgg-body {
border-top: 1px solid #dedede;
background-color: white;
diff --git a/views/default/css/elements/modules.php b/views/default/css/elements/modules.php
index 7750c208f..74092c774 100644
--- a/views/default/css/elements/modules.php
+++ b/views/default/css/elements/modules.php
@@ -155,7 +155,7 @@
padding: 4px 45px 0 20px;
color: #666;
}
-.elgg-module-widget.elgg-state-draggable > .elgg-head {
+.elgg-module-widget.elgg-state-draggable .elgg-widget-handle {
cursor: move;
}
a.elgg-widget-collapse-button {
diff --git a/views/default/object/widget.php b/views/default/object/widget.php
index f84c44e1c..8c7ec2a03 100644
--- a/views/default/object/widget.php
+++ b/views/default/object/widget.php
@@ -55,8 +55,9 @@ if ($can_edit) {
}
$widget_header = <<<HEADER
- <h3>$title</h3>
+ <div class="elgg-widget-handle"><h3>$title</h3>
$controls
+ </div>
HEADER;
$widget_body = <<<BODY
diff --git a/views/default/output/access.php b/views/default/output/access.php
index 811948323..91c5c721e 100644
--- a/views/default/output/access.php
+++ b/views/default/output/access.php
@@ -11,6 +11,7 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) {
$access_id = $vars['entity']->access_id;
$access_class = 'elgg-access';
$access_id_string = get_readable_access_level($access_id);
+ $access_id_string = htmlentities($access_id_string, ENT_QUOTES, 'UTF-8');
// if within a group or shared access collection display group name and open/closed membership status
// @todo have a better way to do this instead of checking against subtype / class.
@@ -35,5 +36,7 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) {
$access_class .= ' elgg-access-private';
}
- echo "<span class=\"$access_class\">$access_id_string</span>";
+ $help_text = elgg_echo('access:help');
+
+ echo "<span title=\"$help_text\" class=\"$access_class\">$access_id_string</span>";
}