aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/friends/collections/add.php38
-rw-r--r--actions/friends/collections/delete.php34
-rw-r--r--actions/friends/collections/edit.php20
-rw-r--r--engine/classes/ElggCache.php37
-rw-r--r--engine/classes/ElggUser.php3
-rw-r--r--engine/lib/access.php178
-rw-r--r--engine/tests/api/access_collections.php260
-rw-r--r--languages/en.php3
-rw-r--r--mod/blog/languages/en.php4
-rw-r--r--mod/custom_index/views/default/page/layouts/custom_index.php2
-rw-r--r--mod/notifications/start.php4
-rw-r--r--mod/tinymce/start.php4
-rw-r--r--views/default/css/admin.php7
-rw-r--r--views/default/page/elements/header_logo.php6
14 files changed, 440 insertions, 160 deletions
diff --git a/actions/friends/collections/add.php b/actions/friends/collections/add.php
index 8ec6a085f..8383e4db2 100644
--- a/actions/friends/collections/add.php
+++ b/actions/friends/collections/add.php
@@ -2,35 +2,31 @@
/**
* Elgg collection add page
*
- * @package Elgg.Core
- * @subpackage Friends.Collections
+ * @package Elgg
+ * @subpackage Core
*/
$collection_name = get_input('collection_name');
$friends = get_input('friends_collection');
-//first check to make sure that a collection name has been set and create the new colection
-if ($collection_name) {
+if (!$collection_name) {
+ register_error(elgg_echo("friends:nocollectionname"));
+ forward(REFERER);
+}
- //create the collection
- $create_collection = create_access_collection($collection_name, elgg_get_logged_in_user_guid());
+$id = create_access_collection($collection_name);
- //if the collection was created and the user passed some friends from the form, add them
- if ($create_collection && (!empty($friends))) {
- //add friends to the collection
- foreach ($friends as $friend) {
- add_user_to_access_collection($friend, $create_collection);
- }
+if ($id) {
+ $result = update_access_collection($id, $friends);
+ if ($result) {
+ system_message(elgg_echo("friends:collectionadded"));
+ // go to the collections page
+ forward("pg/collections/" . get_loggedin_user()->username);
+ } else {
+ register_error(elgg_echo("friends:nocollectionname"));
+ forward(REFERER);
}
-
- // Success message
- system_message(elgg_echo("friends:collectionadded"));
- // Forward to the collections page
- forward("collections/" . elgg_get_logged_in_user_entity()->username);
-
} else {
register_error(elgg_echo("friends:nocollectionname"));
-
- // Forward to the add collection page
- forward("collections/add");
+ forward(REFERER);
}
diff --git a/actions/friends/collections/delete.php b/actions/friends/collections/delete.php
index fe719d74b..5b0aa8e10 100644
--- a/actions/friends/collections/delete.php
+++ b/actions/friends/collections/delete.php
@@ -1,36 +1,24 @@
<?php
+
/**
* Elgg friends: delete collection action
*
- * @package Elgg.Core
- * @subpackage Friends.Collections
+ * @package Elgg
+ * @subpackage Core
*/
$collection_id = (int) get_input('collection');
-// Check to see that the access collection exist and grab its owner
-$get_collection = get_access_collection($collection_id);
-
-if ($get_collection) {
-
- if ($get_collection->owner_guid == elgg_get_logged_in_user_guid()) {
-
- $delete_collection = delete_access_collection($collection_id);
+// check the ACL exists and we can edit
+if (!can_edit_access_collection($collection_id)) {
+ register_error(elgg_echo("friends:collectiondeletefailed"));
+ forward(REFERER);
+}
- // Success message
- if ($delete_collection) {
- system_message(elgg_echo("friends:collectiondeleted"));
- } else {
- register_error(elgg_echo("friends:collectiondeletefailed"));
- }
- } else {
- // Failure message
- register_error(elgg_echo("friends:collectiondeletefailed"));
- }
+if (delete_access_collection($collection_id)) {
+ system_message(elgg_echo("friends:collectiondeleted"));
} else {
- // Failure message
register_error(elgg_echo("friends:collectiondeletefailed"));
}
-// Forward to the collections page
-forward("collections/" . elgg_get_logged_in_user_entity()->username);
+forward(REFERER);
diff --git a/actions/friends/collections/edit.php b/actions/friends/collections/edit.php
index b7fb716f2..581b21353 100644
--- a/actions/friends/collections/edit.php
+++ b/actions/friends/collections/edit.php
@@ -1,15 +1,23 @@
<?php
/**
- * Friends collection edit action
+ * Elgg collection add page
*
- * @package Elgg.Core
- * @subpackage Friends.Collections
+ * @package Elgg
+ * @subpackage Core
*/
$collection_id = get_input('collection_id');
$friends = get_input('friend');
-//chech the collection exists and the current user owners it
-update_access_collection($collection_id, $friends);
+// check it exists and we can edit
+if (!can_edit_access_collection($collection_id)) {
+ system_message(elgg_echo('friends:collection:edit_failed'));
+}
-exit;
+if (update_access_collection($collection_id, $friends)) {
+ system_message(elgg_echo('friends:collections:edited'));
+} else {
+ system_message(elgg_echo('friends:collection:edit_failed'));
+}
+
+forward(REFERER); \ No newline at end of file
diff --git a/engine/classes/ElggCache.php b/engine/classes/ElggCache.php
index 2e697e0bb..5c2cafcb7 100644
--- a/engine/classes/ElggCache.php
+++ b/engine/classes/ElggCache.php
@@ -6,9 +6,7 @@
* @package Elgg.Core
* @subpackage Cache
*/
-abstract class ElggCache implements
- // Override for array access
- ArrayAccess {
+abstract class ElggCache implements ArrayAccess {
/**
* Variables for the cache object.
*
@@ -141,6 +139,9 @@ abstract class ElggCache implements
/**
* Load data from the cache using a given key.
*
+ * @todo $offset is a horrible variable name because it creates confusion
+ * with the ArrayAccess methods
+ *
* @param string $key Name
* @param int $offset Offset
* @param int $limit Limit
@@ -186,12 +187,12 @@ abstract class ElggCache implements
// ARRAY ACCESS INTERFACE //////////////////////////////////////////////////////////
/**
- * Set offset
+ * Assigns a value for the specified key
*
* @see ArrayAccess::offsetSet()
*
- * @param mixed $key Name
- * @param mixed $value Value
+ * @param mixed $key The key (offset) to assign the value to.
+ * @param mixed $value The value to set.
*
* @return void
*/
@@ -200,43 +201,43 @@ abstract class ElggCache implements
}
/**
- * Get offset
+ * Get the value for specified key
*
* @see ArrayAccess::offsetGet()
*
- * @param mixed $key Name
+ * @param mixed $offset The key (offset) to retrieve.
*
- * @return void
+ * @return mixed
*/
function offsetGet($key) {
return $this->load($key);
}
/**
- * Unsets offset
+ * Unsets a key.
*
* @see ArrayAccess::offsetUnset()
*
- * @param mixed $key Name
+ * @param mixed $key The key (offset) to unset.
*
* @return void
*/
function offsetUnset($key) {
- if (isset($this->key)) {
- unset($this->key);
+ if (isset($this->$key)) {
+ unset($this->$key);
}
}
/**
- * Does offset exist
+ * Does key exist
*
* @see ArrayAccess::offsetExists()
*
- * @param mixed $offset Offset
+ * @param mixed $key A key (offset) to check for.
*
- * @return void
+ * @return bool
*/
- function offsetExists($offset) {
- return isset($this->$offset);
+ function offsetExists($key) {
+ return isset($this->$key);
}
}
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index 1af4cdc3a..75ac008f6 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -484,7 +484,8 @@ class ElggUser extends ElggEntity
* @return array|false
*/
public function getCollections($subtype = "", $limit = 10, $offset = 0) {
- return get_user_collections($this->getGUID(), $subtype, $limit, $offset);
+ elgg_deprecated_notice("ElggUser::getCollections() has been deprecated", 1.8);
+ return false;
}
/**
diff --git a/engine/lib/access.php b/engine/lib/access.php
index cde3d256f..ab4580bae 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -411,7 +411,43 @@ function get_write_access_array($user_id = 0, $site_id = 0, $flush = false) {
}
/**
- * Creates a new access collection.
+ * Can the user write to the access collection?
+ *
+ * Hook into the access:collections:write, user to change this.
+ *
+ * Respects access control disabling for admin users and {@see elgg_set_ignore_access()}
+ *
+ * @see get_write_access_array()
+ *
+ * @param int $collection_id The collection id
+ * @param mixed $user_guid The user GUID to check for. Defaults to logged in user.
+ * @return bool
+ */
+function can_edit_access_collection($collection_id, $user_guid = null) {
+ if ($user_guid) {
+ $user = get_entity((int) $user_guid);
+ } else {
+ $user = get_loggedin_user();
+ }
+
+ $collection = get_access_collection($collection_id);
+
+ if (!($user instanceof ElggUser) || !$collection) {
+ return false;
+ }
+
+ $write_access = get_write_access_array($user->getGUID(), null, true);
+
+ // don't ignore access when checking users.
+ if ($user_guid) {
+ return array_key_exists($collection_id, $write_access);
+ } else {
+ return elgg_get_ignore_access() || array_key_exists($collection_id, $write_access);
+ }
+}
+
+/**
+ * Creates a new access control collection owned by the specified user.
*
* Access colletions allow plugins and users to create granular access
* for entities.
@@ -448,6 +484,7 @@ function create_access_collection($name, $owner_guid = 0, $site_guid = 0) {
SET name = '{$name}',
owner_guid = {$owner_guid},
site_guid = {$site_guid}";
+
if (!$id = insert_data($q)) {
return false;
}
@@ -483,37 +520,31 @@ function create_access_collection($name, $owner_guid = 0, $site_guid = 0) {
function update_access_collection($collection_id, $members) {
global $CONFIG;
- $collection_id = (int) $collection_id;
- $members = (is_array($members)) ? $members : array();
+ $acl = get_access_collection($collection_id);
- $collections = get_write_access_array();
+ if (!$acl) {
+ return false;
+ }
- if (array_key_exists($collection_id, $collections)) {
- $cur_members = get_members_of_access_collection($collection_id, true);
- $cur_members = (is_array($cur_members)) ? $cur_members : array();
+ $members = (is_array($members)) ? $members : array();
- $remove_members = array_diff($cur_members, $members);
- $add_members = array_diff($members, $cur_members);
+ $cur_members = get_members_of_access_collection($collection_id, true);
+ $cur_members = (is_array($cur_members)) ? $cur_members : array();
- $params = array(
- 'collection_id' => $collection_id,
- 'members' => $members,
- 'add_members' => $add_members,
- 'remove_members' => $remove_members
- );
+ $remove_members = array_diff($cur_members, $members);
+ $add_members = array_diff($members, $cur_members);
- foreach ($add_members as $guid) {
- add_user_to_access_collection($guid, $collection_id);
- }
+ $result = true;
- foreach ($remove_members as $guid) {
- remove_user_from_access_collection($guid, $collection_id);
- }
+ foreach ($add_members as $guid) {
+ $result = $result && add_user_to_access_collection($guid, $collection_id);
+ }
- return true;
+ foreach ($remove_members as $guid) {
+ $result = $result && remove_user_from_access_collection($guid, $collection_id);
}
- return false;
+ return $result;
}
/**
@@ -527,27 +558,25 @@ function update_access_collection($collection_id, $members) {
* @see update_access_collection()
*/
function delete_access_collection($collection_id) {
+ global $CONFIG;
+
$collection_id = (int) $collection_id;
- $collections = get_write_access_array(null, null, TRUE);
$params = array('collection_id' => $collection_id);
if (!elgg_trigger_plugin_hook('access:collections:deletecollection', 'collection', $params, true)) {
return false;
}
- if (array_key_exists($collection_id, $collections)) {
- global $CONFIG;
- $query = "delete from {$CONFIG->dbprefix}access_collection_membership"
- . " where access_collection_id = {$collection_id}";
- delete_data($query);
+ // Deleting membership doesn't affect result of deleting ACL.
+ $q = "DELETE FROM {$CONFIG->dbprefix}access_collection_membership
+ WHERE access_collection_id = {$collection_id}";
+ delete_data($q);
- $query = "delete from {$CONFIG->dbprefix}access_collections where id = {$collection_id}";
- delete_data($query);
- return true;
- } else {
- return false;
- }
+ $q = "DELETE FROM {$CONFIG->dbprefix}access_collections
+ WHERE id = {$collection_id}";
+ $result = delete_data($q);
+ return $result;
}
/**
@@ -584,45 +613,33 @@ function get_access_collection($collection_id) {
* @see remove_user_from_access_collection()
*/
function add_user_to_access_collection($user_guid, $collection_id) {
+ global $CONFIG;
+
$collection_id = (int) $collection_id;
$user_guid = (int) $user_guid;
- $collections = get_write_access_array();
+ $user = get_user($user_guid);
- if (!($collection = get_access_collection($collection_id))) {
- return false;
- }
+ $collection = get_access_collection($collection_id);
- $user = get_user($user_guid);
- if (!$user) {
+ if (!($user instanceof Elgguser) || !$collection) {
return false;
}
- // to add someone to a collection, the user must be a member of the collection or
- // no one must own it
- if ((array_key_exists($collection_id, $collections) || $collection->owner_guid == 0)) {
- $result = true;
- } else {
- $result = false;
- }
-
$params = array(
'collection_id' => $collection_id,
- 'collection' => $collection,
'user_guid' => $user_guid
);
- $result = elgg_trigger_plugin_hook('access:collections:add_user', 'collection', $params, $result);
- if ($result == false) {
+ if (!elgg_trigger_plugin_hook('access:collections:add_user', 'collection', $params, true)) {
return false;
}
try {
- global $CONFIG;
- $query = "insert into {$CONFIG->dbprefix}access_collection_membership"
- . " set access_collection_id = {$collection_id}, user_guid = {$user_guid}";
- insert_data($query);
+ $q = "INSERT INTO {$CONFIG->dbprefix}access_collection_membership
+ SET access_collection_id = {$collection_id},
+ user_guid = {$user_guid}";
+ insert_data($q);
} catch (DatabaseException $e) {
- // nothing.
return false;
}
@@ -640,34 +657,32 @@ function add_user_to_access_collection($user_guid, $collection_id) {
* @return true|false Depending on success
*/
function remove_user_from_access_collection($user_guid, $collection_id) {
+ global $CONFIG;
+
$collection_id = (int) $collection_id;
$user_guid = (int) $user_guid;
- $collections = get_write_access_array();
- $user = $user = get_user($user_guid);
+ $user = get_user($user_guid);
+
+ $collection = get_access_collection($collection_id);
- if (!($collection = get_access_collection($collection_id))) {
+ if (!($user instanceof Elgguser) || !$collection) {
return false;
}
- if ((array_key_exists($collection_id, $collections) || $collection->owner_guid == 0) && $user) {
- global $CONFIG;
- $params = array(
- 'collection_id' => $collection_id,
- 'user_guid' => $user_guid
- );
-
- if (!elgg_trigger_plugin_hook('access:collections:remove_user', 'collection', $params, true)) {
- return false;
- }
-
- delete_data("delete from {$CONFIG->dbprefix}access_collection_membership "
- . "where access_collection_id = {$collection_id} and user_guid = {$user_guid}");
-
- return true;
+ $params = array(
+ 'collection_id' => $collection_id,
+ 'user_guid' => $user_guid
+ );
+ if (!elgg_trigger_plugin_hook('access:collections:remove_user', 'collection', $params, true)) {
+ return false;
}
- return false;
+ $q = "DELETE FROM {$CONFIG->dbprefix}access_collection_membership
+ WHERE access_collection_id = {$collection_id}
+ AND user_guid = {$user_guid}";
+
+ return delete_data($q);
}
/**
@@ -956,9 +971,20 @@ function elgg_override_permissions_hook() {
return NULL;
}
+/**
+ * Runs unit tests for the entities object.
+ */
+function access_test($hook, $type, $value, $params) {
+ global $CONFIG;
+ $value[] = $CONFIG->path . 'engine/tests/api/access_collections.php';
+ return $value;
+}
+
// This function will let us know when 'init' has finished
elgg_register_event_handler('init', 'system', 'access_init', 9999);
// For overrided permissions
elgg_register_plugin_hook_handler('permissions_check', 'all', 'elgg_override_permissions_hook');
elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'elgg_override_permissions_hook');
+
+elgg_register_plugin_hook_handler('unit_test', 'system', 'access_test');
diff --git a/engine/tests/api/access_collections.php b/engine/tests/api/access_collections.php
new file mode 100644
index 000000000..d81589cc1
--- /dev/null
+++ b/engine/tests/api/access_collections.php
@@ -0,0 +1,260 @@
+<?php
+/**
+ * Access Collections tests
+ *
+ * @package Elgg
+ * @subpackage Test
+ */
+class ElggCoreAccessCollectionsTest extends ElggCoreUnitTest {
+
+ /**
+ * Called before each test object.
+ */
+ public function __construct() {
+ parent::__construct();
+
+ $this->dbPrefix = get_config("dbprefix");
+
+ $user = new ElggUser();
+ $user->username = 'test_user_' . rand();
+ $user->email = 'fake_email@fake.com' . rand();
+ $user->name = 'fake user';
+ $user->access_id = ACCESS_PUBLIC;
+ $user->salt = generate_random_cleartext_password();
+ $user->password = generate_user_password($user, rand());
+ $user->owner_guid = 0;
+ $user->container_guid = 0;
+ $user->save();
+
+ $this->user = $user;
+ }
+
+ /**
+ * Called before each test method.
+ */
+ public function setUp() {
+
+ }
+
+ /**
+ * Called after each test method.
+ */
+ public function tearDown() {
+ // do not allow SimpleTest to interpret Elgg notices as exceptions
+ $this->swallowErrors();
+ }
+
+ /**
+ * Called after each test object.
+ */
+ public function __destruct() {
+ // all __destruct() code should go above here
+ $this->user->delete();
+ parent::__destruct();
+ }
+
+ public function testCreateGetDeleteACL() {
+ global $DB_QUERY_CACHE;
+
+ $acl_name = 'test access collection';
+ $acl_id = create_access_collection($acl_name);
+
+ $this->assertTrue(is_int($acl_id));
+
+ $q = "SELECT * FROM {$this->dbPrefix}access_collections WHERE id = $acl_id";
+ $acl = get_data_row($q);
+
+ $this->assertEqual($acl->id, $acl_id);
+
+ if ($acl) {
+ $DB_QUERY_CACHE = array();
+
+ $this->assertEqual($acl->name, $acl_name);
+
+ $result = delete_access_collection($acl_id);
+ $this->assertTrue($result);
+
+ $q = "SELECT * FROM {$this->dbPrefix}access_collections WHERE id = $acl_id";
+ $data = get_data($q);
+ $this->assertFalse($data);
+ }
+ }
+
+ public function testAddRemoveUserToACL() {
+ $acl_id = create_access_collection('test acl');
+
+ $result = add_user_to_access_collection($this->user->guid, $acl_id);
+ $this->assertTrue($result);
+
+ if ($result) {
+ $result = remove_user_from_access_collection($this->user->guid, $acl_id);
+ $this->assertTrue($result);
+ }
+
+ delete_access_collection($acl_id);
+ }
+
+ public function testUpdateACL() {
+ // another fake user to test with
+ $user = new ElggUser();
+ $user->username = 'test_user_' . rand();
+ $user->email = 'fake_email@fake.com' . rand();
+ $user->name = 'fake user';
+ $user->access_id = ACCESS_PUBLIC;
+ $user->salt = generate_random_cleartext_password();
+ $user->password = generate_user_password($user, rand());
+ $user->owner_guid = 0;
+ $user->container_guid = 0;
+ $user->save();
+
+ $acl_id = create_access_collection('test acl');
+
+ $member_lists = array(
+ // adding
+ array(
+ $this->user->guid,
+ $user->guid
+ ),
+ // removing one, keeping one.
+ array(
+ $user->guid
+ ),
+ // removing one, adding one
+ array(
+ $this->user->guid,
+ ),
+ // removing all.
+ array()
+ );
+
+ foreach ($member_lists as $members) {
+ $result = update_access_collection($acl_id, $members);
+ $this->assertTrue($result);
+
+ if ($result) {
+ $q = "SELECT * FROM {$this->dbPrefix}access_collection_membership
+ WHERE access_collection_id = $acl_id";
+ $data = get_data($q);
+
+ if (count($members) == 0) {
+ $this->assertFalse($data);
+ } else {
+ $this->assertEqual(count($members), count($data));
+ }
+ foreach ($data as $row) {
+ $this->assertTrue(in_array($row->user_guid, $members));
+ }
+ }
+ }
+
+ delete_access_collection($acl_id);
+ $user->delete();
+ }
+
+ public function testCanEditACL() {
+ $acl_id = create_access_collection('test acl', $this->user->guid);
+
+ // should be true since it's the owner
+ $result = can_edit_access_collection($acl_id, $this->user->guid);
+ $this->assertTrue($result);
+
+ // should be true since IA is on.
+ $ia = elgg_set_ignore_access(true);
+ $result = can_edit_access_collection($acl_id);
+ $this->assertTrue($result);
+ elgg_set_ignore_access($ia);
+
+ // should be false since IA is off
+ $ia = elgg_set_ignore_access(false);
+ $result = can_edit_access_collection($acl_id);
+ $this->assertFalse($result);
+ elgg_set_ignore_access($ia);
+
+ delete_access_collection($acl_id);
+ }
+
+ public function testCanEditACLHook() {
+ // if only we supported closures!
+ global $acl_test_info;
+
+ $acl_id = create_access_collection('test acl');
+
+ $acl_test_info = array(
+ 'acl_id' => $acl_id,
+ 'user' => $this->user
+ );
+
+ function test_acl_access_hook($hook, $type, $value, $params) {
+ global $acl_test_info;
+ if ($params['user_id'] == $acl_test_info['user']->guid) {
+ $acl = get_access_collection($acl_test_info['acl_id']);
+ $value[$acl->id] = $acl->name;
+ }
+
+ return $value;
+ }
+
+ register_plugin_hook('access:collections:write', 'all', 'test_acl_access_hook');
+
+ // enable security since we usually run as admin
+ $ia = elgg_set_ignore_access(false);
+ $result = can_edit_access_collection($acl_id, $this->user->guid);
+ $this->assertTrue($result);
+ $ia = elgg_set_ignore_access($ia);
+
+ unregister_plugin_hook('access:collections:write', 'all', 'test_acl_access_hook');
+ }
+
+ // groups interface
+ // only runs if the groups plugin is enabled because implementation is split between
+ // core and the plugin.
+ public function testCreateDeleteGroupACL() {
+ if (!is_plugin_enabled('groups')) {
+ return;
+ }
+
+ $group = new ElggGroup();
+ $group->name = 'Test group';
+ $group->save();
+ $acl = get_access_collection($group->group_acl);
+
+ // ACLs are owned by groups
+ $this->assertEqual($acl->owner_guid, $group->guid);
+
+ // removing group and acl
+ $this->assertTrue($group->delete());
+
+ $acl = get_access_collection($group->group_acl);
+ $this->assertFalse($acl);
+
+ $group->delete();
+ }
+
+ public function testJoinLeaveGroupACL() {
+ if (!is_plugin_enabled('groups')) {
+ return;
+ }
+
+ $group = new ElggGroup();
+ $group->name = 'Test group';
+ $group->save();
+
+ $result = $group->join($this->user);
+ $this->assertTrue($result);
+
+ if ($result) {
+ $can_edit = can_edit_access_collection($group->group_acl, $this->user->guid);
+ $this->assertTrue($can_edit);
+ }
+
+ $result = $group->leave($this->user);
+ $this->assertTrue($result);
+
+ if ($result) {
+ $can_edit = can_edit_access_collection($group->group_acl, $this->user->guid);
+ $this->assertFalse($can_edit);
+ }
+
+ $group->delete();
+ }
+}
diff --git a/languages/en.php b/languages/en.php
index 72369c82f..b525a2043 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -343,6 +343,8 @@ $english = array(
'friends:nocollectionname' => "You need to give your collection a name before it can be created.",
'friends:collections:members' => "Collection members",
'friends:collections:edit' => "Edit collection",
+ 'friends:collections:edited' => "Saved collection",
+ 'friends:collection:edit_failed' => 'Could not save collection.',
'friendspicker:chararray' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
@@ -857,6 +859,7 @@ $english = array(
'mine' => "Mine",
'by' => 'by',
+ 'none' => 'none',
'annotations' => "Annotations",
'relationships' => "Relationships",
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php
index 47dc57dda..8a21c1f8d 100644
--- a/mod/blog/languages/en.php
+++ b/mod/blog/languages/en.php
@@ -53,10 +53,12 @@ $english = array(
'blog:error:revision_not_found' => 'Cannot find this revision.',
// river
-
'river:create:object:blog' => '%s published a blog post %s',
'river:comment:object:blog' => '%s commented on the blog %s',
+ // notifications
+ 'blog:newpost' => 'A new blog post',
+
// widget
'blog:widget:description' => 'Display your latest blog posts',
'blog:moreblogs' => 'More blog posts',
diff --git a/mod/custom_index/views/default/page/layouts/custom_index.php b/mod/custom_index/views/default/page/layouts/custom_index.php
index 0883e7274..6b3f6d739 100644
--- a/mod/custom_index/views/default/page/layouts/custom_index.php
+++ b/mod/custom_index/views/default/page/layouts/custom_index.php
@@ -17,7 +17,7 @@
// Top box for login or welcome message
if (elgg_is_logged_in()) {
$top_box = "<h2>" . elgg_echo("welcome") . " ";
- $top_box .= get_loggedin_user()->name;
+ $top_box .= elgg_get_logged_in_user_entity()->name;
$top_box .= "</h2>";
} else {
$top_box = $vars['login'];
diff --git a/mod/notifications/start.php b/mod/notifications/start.php
index 0f1e11a57..c6701cc3e 100644
--- a/mod/notifications/start.php
+++ b/mod/notifications/start.php
@@ -1,11 +1,11 @@
<?php
-
/**
* Elgg notifications plugin
*
* @package ElggNotifications
*/
+elgg_register_event_handler('init', 'system', 'notifications_plugin_init');
function notifications_plugin_init() {
@@ -187,5 +187,3 @@ function notifications_update_collection_notify($event, $object_type, $returnval
}
}
}
-
-elgg_register_event_handler('init', 'system', 'notifications_plugin_init', 1000);
diff --git a/mod/tinymce/start.php b/mod/tinymce/start.php
index 3b662308a..ee7154d22 100644
--- a/mod/tinymce/start.php
+++ b/mod/tinymce/start.php
@@ -5,6 +5,8 @@
* @package ElggTinyMCE
*/
+elgg_register_event_handler('init', 'system', 'tinymce_init');
+
function tinymce_init() {
elgg_extend_view('css/elgg', 'tinymce/css');
elgg_extend_view('css/admin', 'tinymce/css');
@@ -30,5 +32,3 @@ function tinymce_longtext_menu($hook, $type, $items, $vars) {
return $items;
}
-
-elgg_register_event_handler('init', 'system', 'tinymce_init', 9999);
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index e8705583f..2d587fcbe 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -428,15 +428,10 @@ input {
border-radius: 5px;
}
/* default elgg core input field classes */
-.input-text,
-.input-tags,
-.input-url,
-.input-textarea,
-<?php // until we're all on elgg-, need to duplicate ?>
.elgg-input-text,
.elgg-input-tags,
.elgg-input-url,
-.elgg-input-textarea {
+.elgg-input-plaintext {
width:98%;
}
textarea {
diff --git a/views/default/page/elements/header_logo.php b/views/default/page/elements/header_logo.php
index 4295deaa4..7fe721c40 100644
--- a/views/default/page/elements/header_logo.php
+++ b/views/default/page/elements/header_logo.php
@@ -1,13 +1,15 @@
<?php
/**
* Elgg header logo
- * The logo to display in elgg-header.
*/
$site = elgg_get_site_entity();
$site_name = $site->name;
+$site_url = elgg_get_site_url();
?>
<h1>
- <a class="elgg-heading-site" href="<?php echo elgg_get_site_url(); ?>"><?php echo $site_name; ?></a>
+ <a class="elgg-heading-site" href="<?php echo $site_url; ?>">
+ <?php echo $site_name; ?>
+ </a>
</h1>