aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/avatar/crop.php6
-rw-r--r--actions/friends/add.php4
-rw-r--r--engine/lib/group.php26
-rw-r--r--engine/lib/metadata.php7
-rw-r--r--engine/lib/plugins.php3
-rw-r--r--engine/lib/views.php5
-rw-r--r--languages/en.php14
-rw-r--r--mod/developers/views/default/theme_preview/components.php15
-rw-r--r--mod/developers/views/default/theme_preview/components/table.php2
-rw-r--r--mod/groups/lib/groups.php2
-rw-r--r--mod/messageboard/actions/delete.php1
-rw-r--r--mod/messageboard/views/default/messageboard/js.php3
-rw-r--r--mod/pages/manifest.xml2
-rw-r--r--mod/thewire/start.php8
-rw-r--r--pages/avatar/edit.php9
-rw-r--r--pages/friends/index.php3
-rw-r--r--pages/friends/of.php3
-rw-r--r--pages/river.php3
-rw-r--r--views/default/css/elements/components.php6
19 files changed, 76 insertions, 46 deletions
diff --git a/actions/avatar/crop.php b/actions/avatar/crop.php
index f2b812c4f..b9a80f331 100644
--- a/actions/avatar/crop.php
+++ b/actions/avatar/crop.php
@@ -22,6 +22,12 @@ $filehandler->owner_guid = $owner->getGUID();
$filehandler->setFilename("profile/" . $owner->guid . "master" . ".jpg");
$filename = $filehandler->getFilenameOnFilestore();
+// ensuring the avatar image exists in the first place
+if (!file_exists($filename)) {
+ register_error(elgg_echo('avatar:crop:fail'));
+ forward(REFERER);
+}
+
$icon_sizes = elgg_get_config('icon_sizes');
unset($icon_sizes['master']);
diff --git a/actions/friends/add.php b/actions/friends/add.php
index 7d38674c1..d1800ee14 100644
--- a/actions/friends/add.php
+++ b/actions/friends/add.php
@@ -9,6 +9,10 @@
// Get the GUID of the user to friend
$friend_guid = get_input('friend');
$friend = get_entity($friend_guid);
+if (!$friend) {
+ register_error(elgg_echo('error:missing_data'));
+ forward(REFERER);
+}
$errors = false;
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 29330eeca..feb1f1e7f 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -261,16 +261,24 @@ function group_gatekeeper($forward = true) {
if ($group = elgg_get_page_owner_entity()) {
if ($group instanceof ElggGroup) {
$url = $group->getURL();
- if (
- ((!elgg_is_logged_in()) && (!$group->isPublicMembership())) ||
- ((!$group->isMember(elgg_get_logged_in_user_entity()) && (!$group->isPublicMembership())))
- ) {
- $allowed = false;
- }
+ if (!$group->isPublicMembership()) {
+ // closed group so must be member or an admin
+
+ if (!elgg_is_logged_in()) {
+ $allowed = false;
+ if ($forward == true) {
+ $_SESSION['last_forward_from'] = current_page_url();
+ register_error(elgg_echo('loggedinrequired'));
+ forward('', 'login');
+ }
+ } else if (!$group->isMember(elgg_get_logged_in_user_entity())) {
+ $allowed = false;
+ }
- // Admin override
- if (elgg_is_admin_logged_in()) {
- $allowed = true;
+ // Admin override
+ if (elgg_is_admin_logged_in()) {
+ $allowed = true;
+ }
}
}
}
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 012c73ad9..34a36d86e 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -746,7 +746,7 @@ function export_metadata_plugin_hook($hook, $entity_type, $returnvalue, $params)
/**
* Takes in a comma-separated string and returns an array of tags
- * which have been trimmed and set to lower case
+ * which have been trimmed
*
* @param string $string Comma-separated tag string
*
@@ -755,12 +755,7 @@ function export_metadata_plugin_hook($hook, $entity_type, $returnvalue, $params)
function string_to_tag_array($string) {
if (is_string($string)) {
$ar = explode(",", $string);
- // trim blank spaces
$ar = array_map('trim', $ar);
- // make lower case : [Marcus Povey 20090605 - Using mb wrapper function
- // using UTF8 safe function where available]
- $ar = array_map('elgg_strtolower', $ar);
- // Remove null values
$ar = array_filter($ar, 'is_not_null');
return $ar;
}
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 70bfcb28b..123fb18d8 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -298,6 +298,9 @@ function elgg_load_plugins() {
// temporary disable all plugins if there is a file called 'disabled' in the plugin dir
if (file_exists("$plugins_path/disabled")) {
+ if (elgg_is_admin_logged_in() && elgg_in_context('admin')) {
+ system_message(elgg_echo('plugins:disabled'));
+ }
return false;
}
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 052387191..ca0ce7196 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -969,12 +969,7 @@ function elgg_view_annotation(ElggAnnotation $annotation, array $vars = array(),
return elgg_view($view, $vars, $bypass, $debug);
}
- // @todo would be better to always make sure name is initialized properly
$name = $annotation->name;
- $intname = (int) $name;
- if ("{$intname}" == "{$name}") {
- $name = get_metastring($intname);
- }
if (empty($name)) {
return false;
}
diff --git a/languages/en.php b/languages/en.php
index b34d1cc58..14df3db34 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -240,6 +240,7 @@ $english = array(
'viewfailure' => 'There was an internal failure in the view %s',
'changebookmark' => 'Please change your bookmark for this page',
'noaccess' => 'This content has been removed, is invalid, or you do not have permission to view it.',
+ 'error:missing_data' => 'There was some data missing in your request',
'error:default' => 'Oops...something went wrong.',
'error:404' => 'Sorry. We could not find the page that you requested.',
@@ -294,7 +295,7 @@ $english = array(
'widget' => "Widget",
'item:object:widget' => "Widgets",
'widgets:save:success' => "The widget was successfully saved.",
- 'widgets:save:failure' => "We could not save your widget. Please try again.",
+ 'widgets:save:failure' => "We could not save your widget.",
'widgets:add:success' => "The widget was successfully added.",
'widgets:add:failure' => "We could not add your widget.",
'widgets:move:failure' => "We could not store the new widget position.",
@@ -325,12 +326,12 @@ $english = array(
'friend:remove' => "Remove friend",
'friends:add:successful' => "You have successfully added %s as a friend.",
- 'friends:add:failure' => "We couldn't add %s as a friend. Please try again.",
+ 'friends:add:failure' => "We couldn't add %s as a friend.",
'friends:remove:successful' => "You have successfully removed %s from your friends.",
- 'friends:remove:failure' => "We couldn't remove %s from your friends. Please try again.",
+ 'friends:remove:failure' => "We couldn't remove %s from your friends.",
- 'friends:none' => "This user hasn't added anyone as a friend yet.",
+ 'friends:none' => "No friends yet.",
'friends:none:you' => "You don't have any friends yet.",
'friends:none:found' => "No friends were found.",
@@ -665,6 +666,7 @@ $english = array(
/**
* Plugins
*/
+ 'plugins:disabled' => 'Plugins are being loaded because a file named "disabled" is in the mod directory.',
'plugins:settings:save:ok' => "Settings for the %s plugin were saved successfully.",
'plugins:settings:save:fail' => "There was a problem saving settings for the %s plugin.",
'plugins:usersettings:save:ok' => "User settings for the %s plugin were saved successfully.",
@@ -1129,7 +1131,7 @@ If you requested this, click on the link below. Otherwise ignore this email.
'generic_comment:blank' => "Sorry, you need to actually put something in your comment before we can save it.",
'generic_comment:notfound' => "Sorry, we could not find the specified item.",
'generic_comment:notdeleted' => "Sorry, we could not delete this comment.",
- 'generic_comment:failure' => "An unexpected error occurred when adding your comment. Please try again.",
+ 'generic_comment:failure' => "An unexpected error occurred when adding your comment.",
'generic_comment:none' => 'No comments',
'generic_comment:title' => 'Comment by %s',
@@ -1165,7 +1167,7 @@ You cannot reply to this email.",
* Action gatekeeper
*/
'actiongatekeeper:missingfields' => 'Form is missing __token or __ts fields',
- 'actiongatekeeper:tokeninvalid' => "We encountered an error (token mismatch). This probably means that the page you were using expired. Please try again.",
+ 'actiongatekeeper:tokeninvalid' => "We encountered an error (token mismatch). This probably means that the page you were using expired.",
'actiongatekeeper:timeerror' => 'The page you were using has expired. Please refresh and try again.',
'actiongatekeeper:pluginprevents' => 'A extension has prevented this form from being submitted.',
diff --git a/mod/developers/views/default/theme_preview/components.php b/mod/developers/views/default/theme_preview/components.php
index ab5a6e941..45f520f2c 100644
--- a/mod/developers/views/default/theme_preview/components.php
+++ b/mod/developers/views/default/theme_preview/components.php
@@ -3,10 +3,17 @@
* CSS Objects: list, module, image_block, table, messages
*/
-echo elgg_view_module('info', 'Image Block (.elgg-image-block)', elgg_view('theme_preview/components/image_block'));
+$body = elgg_view('theme_preview/components/image_block');
+echo elgg_view_module('info', 'Image Block (.elgg-image-block)', $body);
-echo elgg_view_module('info', 'List (.elgg-list)', elgg_view('theme_preview/components/list'));
+$body = elgg_view('theme_preview/components/list');
+echo elgg_view_module('info', 'List (.elgg-list)', $body);
-echo elgg_view_module('info', 'Table (.elgg-table)', elgg_view('theme_preview/components/table'));
+$body = elgg_view('theme_preview/components/table', array('class' => 'elgg-table'));
+echo elgg_view_module('info', 'Table (.elgg-table)', $body);
-echo elgg_view_module('info', 'Messages (.elgg-message)', elgg_view('theme_preview/components/messages'));
+$body = elgg_view('theme_preview/components/table', array('class' => 'elgg-table-alt'));
+echo elgg_view_module('info', 'Table Alternate (.elgg-table-alt)', $body);
+
+$body = elgg_view('theme_preview/components/messages');
+echo elgg_view_module('info', 'Messages (.elgg-message)', $body);
diff --git a/mod/developers/views/default/theme_preview/components/table.php b/mod/developers/views/default/theme_preview/components/table.php
index e9ef32143..8b8b13e76 100644
--- a/mod/developers/views/default/theme_preview/components/table.php
+++ b/mod/developers/views/default/theme_preview/components/table.php
@@ -1,4 +1,4 @@
-<table class="elgg-table">
+<table class="<?php echo $vars['class']; ?>">
<?php
echo "<thead><tr><th>column 1</th><th>column 2</th></tr></thead>";
for ($i = 1; $i < 5; $i++) {
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 5d6083077..2fe9ae8e0 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -234,8 +234,6 @@ 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;
diff --git a/mod/messageboard/actions/delete.php b/mod/messageboard/actions/delete.php
index a40329cb5..a1f62278c 100644
--- a/mod/messageboard/actions/delete.php
+++ b/mod/messageboard/actions/delete.php
@@ -9,7 +9,6 @@ $annotation_id = (int) get_input('annotation_id');
$message = elgg_get_annotation_from_id($annotation_id);
if ($message && $message->canEdit() && $message->delete()) {
- remove_from_river_by_annotation($annotation_id);
system_message(elgg_echo("messageboard:deleted"));
} else {
system_message(elgg_echo("messageboard:notdeleted"));
diff --git a/mod/messageboard/views/default/messageboard/js.php b/mod/messageboard/views/default/messageboard/js.php
index 3295c68de..79472069d 100644
--- a/mod/messageboard/views/default/messageboard/js.php
+++ b/mod/messageboard/views/default/messageboard/js.php
@@ -44,7 +44,8 @@ elgg.messageboard.deletePost = function(e) {
if (confirm(confirmText)) {
elgg.action($(this).attr('href'), {
success: function() {
- $(link).closest('li').remove();
+ var item = $(link).closest('.elgg-item');
+ item.remove();
}
});
}
diff --git a/mod/pages/manifest.xml b/mod/pages/manifest.xml
index 6990bd6b0..4cf999f45 100644
--- a/mod/pages/manifest.xml
+++ b/mod/pages/manifest.xml
@@ -6,7 +6,7 @@
<category>bundled</category>
<category>content</category>
<category>widget</category>
- <description>Elgg Pages</description>
+ <description>Collaborative editing tool. Enables users to create pages similar to a wiki without having to know wiki syntax.</description>
<website>http://www.elgg.org</website>
<copyright>See COPYRIGHT.txt</copyright>
<license>GNU General Public License version 2</license>
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index fdaf91355..ebfe29538 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -18,12 +18,6 @@ elgg_register_event_handler('init', 'system', 'thewire_init');
* The Wire initialization
*/
function thewire_init() {
- global $CONFIG;
-
- // this can be removed in favor of activate/deactivate scripts
- if (!update_subtype('object', 'thewire', 'ElggWire')) {
- add_subtype('object', 'thewire', 'ElggWire');
- }
// register the wire's JavaScript
$thewire_js = elgg_get_simplecache_url('js', 'thewire');
@@ -68,7 +62,7 @@ function thewire_init() {
elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'thewire_notify_message');
// Register actions
- $action_base = $CONFIG->pluginspath . 'thewire/actions';
+ $action_base = elgg_get_plugins_path() . 'thewire/actions';
elgg_register_action("thewire/add", "$action_base/add.php");
elgg_register_action("thewire/delete", "$action_base/delete.php");
diff --git a/pages/avatar/edit.php b/pages/avatar/edit.php
index eef8f8f8b..c71633b8b 100644
--- a/pages/avatar/edit.php
+++ b/pages/avatar/edit.php
@@ -10,8 +10,13 @@ elgg_set_context('profile_edit');
$title = elgg_echo('avatar:edit');
-$content = elgg_view('core/avatar/upload', array('entity' => elgg_get_page_owner_entity()));
-$content .= elgg_view('core/avatar/crop', array('entity' => elgg_get_page_owner_entity()));
+$entity = elgg_get_page_owner_entity();
+$content = elgg_view('core/avatar/upload', array('entity' => $entity));
+
+// only offer the crop view if an avatar has been uploaded
+if (isset($entity->icontime)) {
+ $content .= elgg_view('core/avatar/crop', array('entity' => $entity));
+}
$params = array(
'content' => $content,
diff --git a/pages/friends/index.php b/pages/friends/index.php
index 707402c64..63518a413 100644
--- a/pages/friends/index.php
+++ b/pages/friends/index.php
@@ -22,6 +22,9 @@ $options = array(
'full_view' => FALSE
);
$content = elgg_list_entities_from_relationship($options);
+if (!$content) {
+ $content = elgg_echo('friends:none');
+}
$params = array(
'content' => $content,
diff --git a/pages/friends/of.php b/pages/friends/of.php
index 5bbfa6dff..aa9ee8bee 100644
--- a/pages/friends/of.php
+++ b/pages/friends/of.php
@@ -22,6 +22,9 @@ $options = array(
'full_view' => FALSE
);
$content = elgg_list_entities_from_relationship($options);
+if (!$content) {
+ $content = elgg_echo('friends:none');
+}
$params = array(
'content' => $content,
diff --git a/pages/river.php b/pages/river.php
index 601faf16f..0e1511334 100644
--- a/pages/river.php
+++ b/pages/river.php
@@ -40,6 +40,9 @@ switch ($page_type) {
}
$activity = elgg_list_river($options);
+if (!$activity) {
+ $activity = elgg_echo('river:none');
+}
$content = elgg_view('core/river/filter', array('selector' => $selector));
diff --git a/views/default/css/elements/components.php b/views/default/css/elements/components.php
index c71ef1de9..7fe535d57 100644
--- a/views/default/css/elements/components.php
+++ b/views/default/css/elements/components.php
@@ -85,7 +85,11 @@
width: 100%;
border-top: 1px solid #ccc;
}
-.elgg-table-alt td {
+.elgg-table-alt th {
+ background-color: #eee;
+ font-weight: bold;
+}
+.elgg-table-alt td, .elgg-table-alt th {
padding: 2px 4px 2px 4px;
border-bottom: 1px solid #ccc;
}