From e5e7238d0f83789217950441aefb4c70e47eac1c Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Sun, 4 Mar 2012 20:43:05 -0800 Subject: Pulls river js out into external file --- engine/lib/elgglib.php | 1 + js/lib/ui.river.js | 14 ++++++++++++++ views/default/core/river/filter.php | 16 ++-------------- 3 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 js/lib/ui.river.js diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 11bdc7285..720e69906 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -2111,6 +2111,7 @@ function elgg_init() { elgg_register_js('jquery.easing', 'vendors/jquery/jquery.easing.1.3.packed.js'); elgg_register_js('elgg.avatar_cropper', 'js/lib/ui.avatar_cropper.js'); elgg_register_js('jquery.imgareaselect', 'vendors/jquery/jquery.imgareaselect-0.9.8/scripts/jquery.imgareaselect.min.js'); + elgg_register_js('elgg.ui.river', 'js/lib/ui.river.js'); elgg_register_css('jquery.imgareaselect', 'vendors/jquery/jquery.imgareaselect-0.9.8/css/imgareaselect-deprecated.css'); diff --git a/js/lib/ui.river.js b/js/lib/ui.river.js new file mode 100644 index 000000000..a56a664a4 --- /dev/null +++ b/js/lib/ui.river.js @@ -0,0 +1,14 @@ +elgg.provide('elgg.ui.river'); + +elgg.ui.river.init = function() { + $('#elgg-river-selector').change(function() { + var url = window.location.href; + if (window.location.search.length) { + url = url.substring(0, url.indexOf('?')); + } + url += '?' + $(this).val(); + elgg.forward(url); + }); +}; + +elgg.register_hook_handler('init', 'system', elgg.ui.river.init); \ No newline at end of file diff --git a/views/default/core/river/filter.php b/views/default/core/river/filter.php index 87380b561..9b7fadaa8 100644 --- a/views/default/core/river/filter.php +++ b/views/default/core/river/filter.php @@ -34,17 +34,5 @@ if ($selector) { $params['value'] = $selector; } echo elgg_view('input/dropdown', $params); -?> - - + +elgg_load_js('elgg.ui.river'); -- cgit v1.2.3 From 88f1e8307f9a83b506ecae2e013125389310fed6 Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Wed, 18 Apr 2012 15:19:34 +0200 Subject: fixes #4406: validate username for max chars --- engine/lib/users.php | 6 ++++++ languages/en.php | 1 + 2 files changed, 7 insertions(+) diff --git a/engine/lib/users.php b/engine/lib/users.php index f1d42e25e..79a054938 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -810,6 +810,12 @@ function validate_username($username) { $msg = elgg_echo('registration:usernametooshort', array($CONFIG->minusername)); throw new RegistrationException($msg); } + + // username in the database has a limit of 128 characters + if (strlen($username) > 128) { + $msg = elgg_echo('registration:usernametoolong', array(128)); + throw new RegistrationException($msg); + } // Blacklist for bad characters (partially nicked from mediawiki) $blacklist = '/[' . diff --git a/languages/en.php b/languages/en.php index 14df3db34..25edfa149 100644 --- a/languages/en.php +++ b/languages/en.php @@ -503,6 +503,7 @@ $english = array( 'registration:notemail' => 'The email address you provided does not appear to be a valid email address.', 'registration:userexists' => 'That username already exists', 'registration:usernametooshort' => 'Your username must be a minimum of %u characters long.', + 'registration:usernametoolong' => 'Your username is too long it can have a maximum of %u characters.', 'registration:passwordtooshort' => 'The password must be a minimum of %u characters long.', 'registration:dupeemail' => 'This email address has already been registered.', 'registration:invalidchars' => 'Sorry, your username contains the character %s which is invalid. The following characters are invalid: %s', -- cgit v1.2.3 From e3b0662aec78a46357843d0f88e385d488ceba4a Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 17 Apr 2012 23:33:20 -0300 Subject: Fixes #4447: Error handler takes type hint violations seriously --- engine/lib/elgglib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 11bdc7285..616d4d4cf 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1053,12 +1053,14 @@ function _elgg_php_exception_handler($exception) { * * @return true * @access private + * @todo Replace error_log calls with elgg_log calls. */ function _elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) { $error = date("Y-m-d H:i:s (T)") . ": \"$errmsg\" in file $filename (line $linenum)"; switch ($errno) { case E_USER_ERROR: + case E_RECOVERABLE_ERROR: // (e.g. type hint violation) error_log("PHP ERROR: $error"); register_error("ERROR: $error"); @@ -1092,8 +1094,8 @@ function _elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) { * * @note No messages will be displayed unless debugging has been enabled. * - * @param str $message User message - * @param str $level NOTICE | WARNING | ERROR | DEBUG + * @param string $message User message + * @param string $level NOTICE | WARNING | ERROR | DEBUG * * @return bool * @since 1.7.0 -- cgit v1.2.3 From cffe06e9090b9f7eaf6d07d3381c7ac4f87bb100 Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Tue, 1 May 2012 09:51:49 +0200 Subject: fixed pagination in group profile members sidebar --- mod/groups/views/default/groups/sidebar/members.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php index 49f14697c..11273d0e6 100644 --- a/mod/groups/views/default/groups/sidebar/members.php +++ b/mod/groups/views/default/groups/sidebar/members.php @@ -8,7 +8,7 @@ * @uses $vars['limit'] The number of members to display */ -$limit = elgg_extract('limit', $vars, 10); +$limit = elgg_extract('limit', $vars, 14); $all_link = elgg_view('output/url', array( 'href' => 'groups/members/' . $vars['entity']->guid, @@ -24,6 +24,7 @@ $body = elgg_list_entities_from_relationship(array( 'limit' => $limit, 'list_type' => 'gallery', 'gallery_class' => 'elgg-gallery-users', + 'pagination' => false )); $body .= "
$all_link
"; -- cgit v1.2.3 From 8187d40ea2d8486eec2518b72166d82ace18475f Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Tue, 1 May 2012 15:37:52 +0200 Subject: added /login to the default public pages --- engine/classes/ElggSite.php | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php index 6d07778a9..e793ab9c6 100644 --- a/engine/classes/ElggSite.php +++ b/engine/classes/ElggSite.php @@ -423,6 +423,7 @@ class ElggSite extends ElggEntity { // default public pages $defaults = array( 'walled_garden/.*', + 'login', 'action/login', 'register', 'action/register', -- cgit v1.2.3 From 7c0215018897bfb578e6116ef9d36e5edc1fe5cf Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Wed, 16 May 2012 11:27:25 -0400 Subject: Fixes #2411: Show message when upload exceeds PHP limits, and show limits in Server Info --- engine/lib/actions.php | 15 +++++++++++++-- languages/en.php | 4 ++++ views/default/admin/statistics/server/php.php | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/engine/lib/actions.php b/engine/lib/actions.php index c6613e6d6..3a7c02488 100644 --- a/engine/lib/actions.php +++ b/engine/lib/actions.php @@ -273,8 +273,19 @@ function validate_action_token($visibleerrors = TRUE, $token = NULL, $ts = NULL) } else if ($visibleerrors) { register_error(elgg_echo('actiongatekeeper:tokeninvalid')); } - } else if ($visibleerrors) { - register_error(elgg_echo('actiongatekeeper:missingfields')); + } else { + if (! empty($_SERVER['CONTENT_LENGTH']) && empty($_POST)) { + // The size of $_POST or uploaded file has exceed the size limit + $error_msg = elgg_trigger_plugin_hook('action_gatekeeper:upload_exceeded_msg', 'all', array( + 'post_size' => $_SERVER['CONTENT_LENGTH'], + 'visible_errors' => $visibleerrors, + ), elgg_echo('actiongatekeeper:uploadexceeded')); + } else { + $error_msg = elgg_echo('actiongatekeeper:missingfields'); + } + if ($visibleerrors) { + register_error($error_msg); + } } return FALSE; diff --git a/languages/en.php b/languages/en.php index 7b51b0c7d..ff730a018 100644 --- a/languages/en.php +++ b/languages/en.php @@ -741,6 +741,9 @@ $english = array( 'admin:server:label:mem_avail' => 'Memory available', 'admin:server:label:mem_used' => 'Memory used', 'admin:server:error_log' => "Web server's error log", + 'admin:server:label:post_max_size' => 'POST maximum size', + 'admin:server:label:upload_max_filesize' => 'Upload maximum size', + 'admin:server:warning:post_max_too_small' => '(Note: post_max_size must be larger than this value to support uploads of this size)', 'admin:user:label:search' => "Find users:", 'admin:user:label:searchbutton' => "Search", @@ -1171,6 +1174,7 @@ You cannot reply to this email.", '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.', + 'actiongatekeeper:uploadexceeded' => 'The size of file(s) uploaded exceeded the limit set by your site administrator', /** diff --git a/views/default/admin/statistics/server/php.php b/views/default/admin/statistics/server/php.php index 4a59b95fb..7c6a51383 100644 --- a/views/default/admin/statistics/server/php.php +++ b/views/default/admin/statistics/server/php.php @@ -8,6 +8,15 @@ if (!$php_log) { $php_log = elgg_echo('admin:server:error_log'); } +$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size'); +$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize'); + +$post_max_size_warning = ''; +if ($upload_max_filesize > $post_max_size) { + // @todo show a link to something like http://nigel.mcnie.name/blog/uploadmaxfilesizepostmaxsize-experimentation ? + $post_max_size_warning = elgg_echo('admin:server:warning:post_max_too_small'); +} + ?> @@ -30,4 +39,12 @@ if (!$php_log) { + + + + + + + +
:
:
:
-- cgit v1.2.3 From 7c6b386cbbc7a3866a59e58498a6c127216cac72 Mon Sep 17 00:00:00 2001 From: Sem Date: Thu, 17 May 2012 13:21:53 +0200 Subject: Fixes #3583. Added hidden input in search box to add the &search_type=all in search urls, and highlight the All menu item. --- mod/search/views/default/search/search_box.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/search/views/default/search/search_box.php b/mod/search/views/default/search/search_box.php index 87d59519c..ff12ae4f0 100644 --- a/mod/search/views/default/search/search_box.php +++ b/mod/search/views/default/search/search_box.php @@ -38,6 +38,7 @@ $display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
+
-
\ No newline at end of file + -- cgit v1.2.3 From 3643efd144c3a9190018100665d02ec798989bfd Mon Sep 17 00:00:00 2001 From: Sem Date: Thu, 17 May 2012 13:43:27 +0200 Subject: Fixes #4396. Revert avatar also deletes avatar's files and crop coords now. --- actions/avatar/revert.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/actions/avatar/revert.php b/actions/avatar/revert.php index 8cff40a68..bc84e9298 100644 --- a/actions/avatar/revert.php +++ b/actions/avatar/revert.php @@ -6,6 +6,25 @@ $guid = get_input('guid'); $user = get_entity($guid); if ($user) { + // Delete all icons from diskspace + $icon_sizes = elgg_get_config('icon_sizes'); + foreach ($icon_sizes as $name => $size_info) { + $file = new ElggFile(); + $file->owner_guid = $guid; + $file->setFilename("profile/{$guid}{$name}.jpg"); + $filepath = $file->getFilenameOnFilestore(); + if (!$file->delete()) { + elgg_log("Avatar file revert failed. Remove $filepath manually, please.", 'WARNING'); + } + } + + // Revert crop coords + unset($user->x1); + unset($user->x2); + unset($user->y1); + unset($user->y2); + + // Revert icon unset($user->icontime); system_message(elgg_echo('avatar:revert:success')); } else { -- cgit v1.2.3 From f848e3ada3e29c17cc5028d7d9edad8035706334 Mon Sep 17 00:00:00 2001 From: Sem Date: Thu, 17 May 2012 13:48:57 +0200 Subject: Refs #4396. No revert, remove. --- actions/avatar/remove.php | 34 ++++++++++++++++++++++++++++++++++ actions/avatar/revert.php | 34 ---------------------------------- engine/lib/users.php | 2 +- languages/en.php | 7 ++++--- views/default/core/avatar/upload.php | 12 ++++++------ 5 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 actions/avatar/remove.php delete mode 100644 actions/avatar/revert.php diff --git a/actions/avatar/remove.php b/actions/avatar/remove.php new file mode 100644 index 000000000..cd38e456a --- /dev/null +++ b/actions/avatar/remove.php @@ -0,0 +1,34 @@ + $size_info) { + $file = new ElggFile(); + $file->owner_guid = $guid; + $file->setFilename("profile/{$guid}{$name}.jpg"); + $filepath = $file->getFilenameOnFilestore(); + if (!$file->delete()) { + elgg_log("Avatar file remove failed. Remove $filepath manually, please.", 'WARNING'); + } + } + + // Remove crop coords + unset($user->x1); + unset($user->x2); + unset($user->y1); + unset($user->y2); + + // Remove icon + unset($user->icontime); + system_message(elgg_echo('avatar:remove:success')); +} else { + register_error(elgg_echo('avatar:remove:fail')); +} + +forward(REFERER); diff --git a/actions/avatar/revert.php b/actions/avatar/revert.php deleted file mode 100644 index bc84e9298..000000000 --- a/actions/avatar/revert.php +++ /dev/null @@ -1,34 +0,0 @@ - $size_info) { - $file = new ElggFile(); - $file->owner_guid = $guid; - $file->setFilename("profile/{$guid}{$name}.jpg"); - $filepath = $file->getFilenameOnFilestore(); - if (!$file->delete()) { - elgg_log("Avatar file revert failed. Remove $filepath manually, please.", 'WARNING'); - } - } - - // Revert crop coords - unset($user->x1); - unset($user->x2); - unset($user->y1); - unset($user->y2); - - // Revert icon - unset($user->icontime); - system_message(elgg_echo('avatar:revert:success')); -} else { - register_error(elgg_echo('avatar:revert:fail')); -} - -forward(REFERER); diff --git a/engine/lib/users.php b/engine/lib/users.php index e209f2c38..7d427e743 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1556,7 +1556,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('avatar/remove'); elgg_register_action('profile/edit'); elgg_register_action('friends/collections/add'); diff --git a/languages/en.php b/languages/en.php index 7b51b0c7d..4fa7506e8 100644 --- a/languages/en.php +++ b/languages/en.php @@ -367,7 +367,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:remove' => 'Remove your avatar and set 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.', @@ -376,8 +376,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', + 'avatar:remove:success' => 'Removing the avatar succeeded', + 'avatar:remove:fail' => 'Avatar remove failed', 'profile:edit' => 'Edit profile', 'profile:aboutme' => "About me", @@ -861,6 +861,7 @@ $english = array( 'new' => 'New', 'add' => 'Add', 'create' => 'Create', + 'remove' => 'Remove', 'revert' => 'Revert', 'site' => 'Site', diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php index 29aa59c9c..6f9124192 100644 --- a/views/default/core/avatar/upload.php +++ b/views/default/core/avatar/upload.php @@ -12,12 +12,12 @@ $user_avatar = elgg_view('output/img', array( $current_label = elgg_echo('avatar:current'); -$revert_button = ''; +$remove_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(), + $remove_button = elgg_view('output/url', array( + 'text' => elgg_echo('remove'), + 'title' => elgg_echo('avatar:remove'), + 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(), 'is_action' => true, 'class' => 'elgg-button elgg-button-cancel mll', )); @@ -39,7 +39,7 @@ $image = <<$current_label
$user_avatar -$revert_button +$remove_button HTML; $body = << Date: Thu, 17 May 2012 19:32:24 -0400 Subject: Fixes #4481: In can_edit_extender, correctly pass entity to permissions hook. Also fixes missing attribute name in ProblemUpdatingMeta import exception. --- engine/lib/extender.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/lib/extender.php b/engine/lib/extender.php index ffd3c1357..43421342c 100644 --- a/engine/lib/extender.php +++ b/engine/lib/extender.php @@ -105,6 +105,7 @@ function import_extender_plugin_hook($hook, $entity_type, $returnvalue, $params) // Save if (!$entity->save()) { + $attr_name = $element->getAttribute('name'); $msg = elgg_echo('ImportException:ProblemUpdatingMeta', array($attr_name, $entity_uuid)); throw new ImportException($msg); } @@ -120,7 +121,7 @@ function import_extender_plugin_hook($hook, $entity_type, $returnvalue, $params) * @param string $type 'metadata' or 'annotation' * @param int $user_guid The GUID of the user * - * @return true|false + * @return bool */ function can_edit_extender($extender_id, $type, $user_guid = 0) { if (!elgg_is_logged_in()) { @@ -155,7 +156,7 @@ function can_edit_extender($extender_id, $type, $user_guid = 0) { } // Trigger plugin hooks - $params = array('entity' => $entity, 'user' => $user); + $params = array('entity' => $extender->getEntity(), 'user' => $user); return elgg_trigger_plugin_hook('permissions_check', $type, $params, false); } -- cgit v1.2.3 From 5a432ff2474e70caf88c19a8b413405d14e61d4d Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Fri, 18 May 2012 11:44:19 -0300 Subject: Fixes #4480: Forward to REFERER after comment delete --- actions/comments/delete.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/actions/comments/delete.php b/actions/comments/delete.php index f8458a152..f2c058ff4 100644 --- a/actions/comments/delete.php +++ b/actions/comments/delete.php @@ -12,19 +12,12 @@ if (!elgg_is_logged_in()) { // Make sure we can get the comment in question $annotation_id = (int) get_input('annotation_id'); -if ($comment = elgg_get_annotation_from_id($annotation_id)) { - - $entity = get_entity($comment->entity_guid); - - if ($comment->canEdit()) { - $comment->delete(); - system_message(elgg_echo("generic_comment:deleted")); - forward($entity->getURL()); - } - +$comment = elgg_get_annotation_from_id($annotation_id); +if ($comment && $comment->canEdit()) { + $comment->delete(); + system_message(elgg_echo("generic_comment:deleted")); } else { - $url = ""; + register_error(elgg_echo("generic_comment:notdeleted")); } -register_error(elgg_echo("generic_comment:notdeleted")); forward(REFERER); \ No newline at end of file -- cgit v1.2.3 From b546494ea20aad1514f4127341a303c435e0d8f4 Mon Sep 17 00:00:00 2001 From: Jeff Tilson Date: Wed, 16 May 2012 14:45:03 -0400 Subject: Call elgg_register_simplecache_view('css/admin') to register admin css with simplecache --- engine/lib/admin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 928101fc5..1528d97c5 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -244,6 +244,7 @@ function admin_init() { elgg_register_action('profile/fields/delete', '', 'admin'); elgg_register_action('profile/fields/reorder', '', 'admin'); + elgg_register_simplecache_view('css/admin'); elgg_register_simplecache_view('js/admin'); $url = elgg_get_simplecache_url('js', 'admin'); elgg_register_js('elgg.admin', $url); -- cgit v1.2.3 From b43e6c7d5550aef3d319148de37fa49cadc33855 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 10:23:49 -0400 Subject: Refs #2411 removed in warning as it was causing a display issue in server info table --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/en.php b/languages/en.php index ff730a018..406179940 100644 --- a/languages/en.php +++ b/languages/en.php @@ -743,7 +743,7 @@ $english = array( 'admin:server:error_log' => "Web server's error log", 'admin:server:label:post_max_size' => 'POST maximum size', 'admin:server:label:upload_max_filesize' => 'Upload maximum size', - 'admin:server:warning:post_max_too_small' => '(Note: post_max_size must be larger than this value to support uploads of this size)', + 'admin:server:warning:post_max_too_small' => '(Note: post_max_size must be larger than this value to support uploads of this size)', 'admin:user:label:search' => "Find users:", 'admin:user:label:searchbutton' => "Search", -- cgit v1.2.3 From d06b10d5f084aceecdd302036697212a8d8d08e5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 11:28:32 -0400 Subject: Fixes #2424 confirmation message when deleting multiple messages --- languages/en.php | 1 + mod/messages/views/default/forms/messages/process.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/languages/en.php b/languages/en.php index 6c06d70b5..1865f6ecd 100644 --- a/languages/en.php +++ b/languages/en.php @@ -938,6 +938,7 @@ $english = array( */ 'deleteconfirm' => "Are you sure you want to delete this item?", + 'deleteconfirm:plural' => "Are you sure you want to delete these items?", 'fileexists' => "A file has already been uploaded. To replace it, select it below:", /** diff --git a/mod/messages/views/default/forms/messages/process.php b/mod/messages/views/default/forms/messages/process.php index f86c3217a..cb30792e9 100644 --- a/mod/messages/views/default/forms/messages/process.php +++ b/mod/messages/views/default/forms/messages/process.php @@ -19,10 +19,12 @@ echo $messages; echo ''; echo '
'; + echo elgg_view('input/submit', array( 'value' => elgg_echo('delete'), 'name' => 'delete', - 'class' => 'elgg-button-delete', + 'class' => 'elgg-button-delete elgg-requires-confirmation', + 'title' => elgg_echo('deleteconfirm:plural'), )); if ($vars['folder'] == "inbox") { -- cgit v1.2.3 From 0792a587b24f47d9e3755eaca0398d263c223aab Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 11:48:25 -0400 Subject: added 2 missing language strings for profile editing - thanks to webgalli for reporting these --- languages/en.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/languages/en.php b/languages/en.php index 1865f6ecd..a40baa61a 100644 --- a/languages/en.php +++ b/languages/en.php @@ -412,6 +412,8 @@ $english = array( 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will lose any information already entered into custom fields on profile pages.", 'profile:editdefault:success' => 'New profile field added', 'profile:editdefault:fail' => 'Default profile could not be saved', + 'profile:field_too_long' => 'Cannot save your profile information because the "%s" section is too long.', + 'profile:noaccess' => "You do not have permission to edit this profile.", /** -- cgit v1.2.3 From 8f515b3d22d4fb6403d078d066b265654fb9a0bd Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 13:55:49 -0400 Subject: renamed variable to cause less confusion with the arguments elgg_trigger_plugin_hook() --- engine/lib/river.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/lib/river.php b/engine/lib/river.php index 547d9495e..711832f70 100644 --- a/engine/lib/river.php +++ b/engine/lib/river.php @@ -55,7 +55,7 @@ $posted = 0, $annotation_id = 0) { $posted = sanitise_int($posted); $annotation_id = sanitise_int($annotation_id); - $params = array( + $values = array( 'type' => $type, 'subtype' => $subtype, 'action_type' => $action_type, @@ -68,13 +68,13 @@ $posted = 0, $annotation_id = 0) { ); // return false to stop insert - $params = elgg_trigger_plugin_hook('creating', 'river', null, $params); - if ($params == false) { + $values = elgg_trigger_plugin_hook('creating', 'river', null, $values); + if ($values == false) { // inserting did not fail - it was just prevented return true; } - extract($params); + extract($values); // Attempt to save river item; return success status $id = insert_data("insert into {$CONFIG->dbprefix}river " . -- cgit v1.2.3 From 0db4a78e6ac5b574e2f63309d4923e5ff4450800 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 14:54:44 -0400 Subject: Fixes #4437 allowing plugins to pass tag HTML to the view object/elements/summary --- views/default/object/elements/summary.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php index 22db03f51..c0f3ad340 100644 --- a/views/default/object/elements/summary.php +++ b/views/default/object/elements/summary.php @@ -13,7 +13,7 @@ * @uses $vars['title'] Title link (optional) false = no title, '' = default * @uses $vars['metadata'] HTML for entity menu and metadata (optional) * @uses $vars['subtitle'] HTML for the subtitle (optional) - * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['tags'] HTML for the tags (default is tags on entity, pass false for no tags) * @uses $vars['content'] HTML for the entity content (optional) */ @@ -39,7 +39,7 @@ $subtitle = elgg_extract('subtitle', $vars, ''); $content = elgg_extract('content', $vars, ''); $tags = elgg_extract('tags', $vars, ''); -if ($tags !== false) { +if ($tags === '') { $tags = elgg_view('output/tags', array('tags' => $entity->tags)); } -- cgit v1.2.3 From 03eb23688a2e9192f592c5f05c7eba693dc50d5a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 15:07:05 -0400 Subject: Refs #4437 let the object/elements/summary view handle the tags --- mod/blog/views/default/object/blog.php | 3 --- mod/bookmarks/views/default/object/bookmarks.php | 3 --- mod/file/views/default/object/file.php | 3 --- mod/pages/views/default/object/page_top.php | 3 --- 4 files changed, 12 deletions(-) diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index aa8074a69..4403a6006 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -27,7 +27,6 @@ $owner_link = elgg_view('output/url', array( 'is_trusted' => true, )); $author_text = elgg_echo('byline', array($owner_link)); -$tags = elgg_view('output/tags', array('tags' => $blog->tags)); $date = elgg_view_friendly_time($blog->time_created); // The "on" status changes for comments, so best to check for !Off @@ -74,7 +73,6 @@ if ($full) { 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, ); $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); @@ -92,7 +90,6 @@ if ($full) { 'entity' => $blog, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, 'content' => $excerpt, ); $params = $params + $vars; diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index 89a0d03e0..83bae2b13 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -27,7 +27,6 @@ $owner_link = elgg_view('output/url', array( )); $author_text = elgg_echo('byline', array($owner_link)); -$tags = elgg_view('output/tags', array('tags' => $bookmark->tags)); $date = elgg_view_friendly_time($bookmark->time_created); $comments_count = $bookmark->countComments(); @@ -64,7 +63,6 @@ if ($full && !elgg_in_context('gallery')) { 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, ); $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); @@ -120,7 +118,6 @@ HTML; 'entity' => $bookmark, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, 'content' => $content, ); $params = $params + $vars; diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 1db9863c9..b3f530183 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -28,7 +28,6 @@ $author_text = elgg_echo('byline', array($owner_link)); $file_icon = elgg_view_entity_icon($file, 'small'); -$tags = elgg_view('output/tags', array('tags' => $file->tags)); $date = elgg_view_friendly_time($file->time_created); $comments_count = $file->countComments(); @@ -71,7 +70,6 @@ if ($full && !elgg_in_context('gallery')) { 'entity' => $file, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, ); $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); @@ -100,7 +98,6 @@ if ($full && !elgg_in_context('gallery')) { 'entity' => $file, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, 'content' => $excerpt, ); $params = $params + $vars; diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php index e78289f28..945a22eed 100644 --- a/mod/pages/views/default/object/page_top.php +++ b/mod/pages/views/default/object/page_top.php @@ -45,7 +45,6 @@ $editor_link = elgg_view('output/url', array( $date = elgg_view_friendly_time($annotation->time_created); $editor_text = elgg_echo('pages:strapline', array($date, $editor_link)); -$tags = elgg_view('output/tags', array('tags' => $page->tags)); $categories = elgg_view('output/categories', $vars); $comments_count = $page->countComments(); @@ -82,7 +81,6 @@ if ($full) { 'entity' => $page, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, ); $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); @@ -104,7 +102,6 @@ if ($full) { 'entity' => $page, 'metadata' => $metadata, 'subtitle' => $subtitle, - 'tags' => $tags, 'content' => $excerpt, ); $params = $params + $vars; -- cgit v1.2.3 From 2f4ca1e52663ae9c991408e2035217a810b0e7a1 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 15:09:59 -0400 Subject: fixed typo for friends activity string --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/en.php b/languages/en.php index a40baa61a..d7de34015 100644 --- a/languages/en.php +++ b/languages/en.php @@ -813,7 +813,7 @@ $english = array( */ 'river:all' => 'All Site Activity', 'river:mine' => 'My Activity', - 'river:friends' => 'Friends Activty', + 'river:friends' => 'Friends Activity', 'river:select' => 'Show %s', 'river:comments:more' => '+%u more', 'river:generic_comment' => 'commented on %s %s', -- cgit v1.2.3 From b9a0b5be0e427a8bab2a49a2bda6a6bb7c114045 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 15:12:27 -0400 Subject: allow blog widget on dashboard --- mod/blog/start.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/blog/start.php b/mod/blog/start.php index 73056f1c9..9faf1794e 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -60,7 +60,7 @@ function blog_init() { elgg_extend_view('groups/tool_latest', 'blog/group_module'); // add a blog widget - elgg_register_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), 'profile'); + elgg_register_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description')); // register actions $action_path = elgg_get_plugins_path() . 'blog/actions/blog'; -- cgit v1.2.3 From 4e2fc235506adf2602282b40ce924d89451cce0a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 15:15:44 -0400 Subject: fixed typo in categories plugin --- mod/categories/languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/categories/languages/en.php b/mod/categories/languages/en.php index eaa65b13e..422fe81a4 100644 --- a/mod/categories/languages/en.php +++ b/mod/categories/languages/en.php @@ -9,7 +9,7 @@ $english = array( 'categories:explanation' => 'To set some predefined site-wide categories that will be used throughout your system, enter them below, separated with commas. Compatible tools will then display them when the user creates or edits content.', 'categories:save:success' => 'Site categories were successfully saved.', 'categories:results' => "Results for the site category: %s", - 'categories:on_activate_reminder' => "Site-wide Cateogires won't work until you add categories. Add categories now.", + 'categories:on_activate_reminder' => "Site-wide Categories won't work until you add categories. Add categories now.", ); add_translation("en", $english); \ No newline at end of file -- cgit v1.2.3 From 7c18f2d39699fa298227d87ac531305de296c747 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 16:08:16 -0400 Subject: Refs #4406 fixed grammar in error message --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/en.php b/languages/en.php index 81852107b..f1de1f202 100644 --- a/languages/en.php +++ b/languages/en.php @@ -505,7 +505,7 @@ $english = array( 'registration:notemail' => 'The email address you provided does not appear to be a valid email address.', 'registration:userexists' => 'That username already exists', 'registration:usernametooshort' => 'Your username must be a minimum of %u characters long.', - 'registration:usernametoolong' => 'Your username is too long it can have a maximum of %u characters.', + 'registration:usernametoolong' => 'Your username is too long. It can have a maximum of %u characters.', 'registration:passwordtooshort' => 'The password must be a minimum of %u characters long.', 'registration:dupeemail' => 'This email address has already been registered.', 'registration:invalidchars' => 'Sorry, your username contains the character %s which is invalid. The following characters are invalid: %s', -- cgit v1.2.3 From 30452bdc98cbc7eb913d5790ffb53ecd51615747 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 17:08:42 -0400 Subject: Fixes #4498 special check for admin pages that are throwing 404 errors - this won't be needed once we get rid of the admin context reminder. We may want to use the admin page shell for the 404 errors then. --- views/default/page/default.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/default/page/default.php b/views/default/page/default.php index 892069fad..3724bffd8 100644 --- a/views/default/page/default.php +++ b/views/default/page/default.php @@ -14,7 +14,9 @@ // backward compatability support for plugins that are not using the new approach // of routing through admin. See reportedcontent plugin for a simple example. if (elgg_get_context() == 'admin') { - elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8); + if (get_input('handler') != 'admin') { + elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8); + } elgg_admin_add_plugin_settings_menu(); elgg_unregister_css('elgg'); echo elgg_view('page/admin', $vars); -- cgit v1.2.3 From 15af429ad8a760179bab0b7ffed546735949f8f6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 17:44:39 -0400 Subject: Fixes #4536 removes use of deprecated list_annotations() from pages plugin --- mod/pages/pages/pages/history.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mod/pages/pages/pages/history.php b/mod/pages/pages/pages/history.php index a63b37a7a..872596179 100644 --- a/mod/pages/pages/pages/history.php +++ b/mod/pages/pages/pages/history.php @@ -30,7 +30,12 @@ elgg_push_breadcrumb(elgg_echo('pages:history')); $title = $page->title . ": " . elgg_echo('pages:history'); -$content = list_annotations($page_guid, 'page', 20, false); +$content = elgg_list_annotations(array( + 'guid' => $page_guid, + 'annotation_name' => 'page', + 'limit' => 20, + 'order_by' => "n_table.time_created desc" +)); $body = elgg_view_layout('content', array( 'filter' => '', -- cgit v1.2.3 From a333c200e30fc85c2c4b43f7b665561146a61334 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 18:21:46 -0400 Subject: Fixes #4539 debrand ajax spinner --- _graphics/ajax_loader.gif | Bin 4421 -> 2608 bytes _graphics/ajax_loader_bw.gif | Bin 3394 -> 2608 bytes views/default/css/elements/icons.php | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_graphics/ajax_loader.gif b/_graphics/ajax_loader.gif index 5a9af96d2..b55e148bb 100644 Binary files a/_graphics/ajax_loader.gif and b/_graphics/ajax_loader.gif differ diff --git a/_graphics/ajax_loader_bw.gif b/_graphics/ajax_loader_bw.gif index 95bad9128..e195e1fd8 100644 Binary files a/_graphics/ajax_loader_bw.gif and b/_graphics/ajax_loader_bw.gif differ diff --git a/views/default/css/elements/icons.php b/views/default/css/elements/icons.php index f7c789e33..9b12e0a57 100644 --- a/views/default/css/elements/icons.php +++ b/views/default/css/elements/icons.php @@ -288,8 +288,8 @@ .elgg-ajax-loader { background: white url(_graphics/ajax_loader_bw.gif) no-repeat center center; - min-height: 33px; - min-width: 33px; + min-height: 31px; + min-width: 31px; } /* *************************************** -- cgit v1.2.3 From 07ad752820ef2398c0d9dfda630d2fb20b454d1f Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Mon, 4 Jun 2012 14:41:26 +0200 Subject: fixed: uncaught exception in uservalidationbyemail --- mod/uservalidationbyemail/start.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index ea59a2e7b..f98f57faf 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -184,7 +184,11 @@ function uservalidationbyemail_page_handler($page) { $user->enable(); elgg_pop_context(); - login($user); + try { + login($user); + } catch(LoginException $e){ + register_error($e->getMessage()); + } } else { register_error(elgg_echo('email:confirm:fail')); } -- cgit v1.2.3 From 918ea05afd0e13e121bf9f40e2f2db894e477f58 Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Tue, 12 Jun 2012 09:29:49 +0200 Subject: fixes: blog title encoding issue --- mod/blog/lib/blog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 286fe1832..e0b09f897 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -26,7 +26,7 @@ function blog_get_page_content_read($guid = NULL) { return $return; } - $return['title'] = htmlspecialchars($blog->title); + $return['title'] = $blog->title; $container = $blog->getContainerEntity(); $crumbs_title = $container->name; -- cgit v1.2.3 From fd4f7ef53452f8ccd1c53b82e6b2cc0c86788e3f Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 12 Jun 2012 21:56:35 -0400 Subject: Fixes #4567 adds a wire post view --- mod/thewire/pages/thewire/view.php | 30 ++++++++++++++++++++++++++++++ mod/thewire/start.php | 9 ++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 mod/thewire/pages/thewire/view.php diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php new file mode 100644 index 000000000..f45f94bfe --- /dev/null +++ b/mod/thewire/pages/thewire/view.php @@ -0,0 +1,30 @@ +getOwnerEntity(); +if (!$owner) { + forward(); +} + +$title = elgg_echo('thewire:by', array($owner->name)); + +elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all'); +elgg_push_breadcrumb($owner->name, 'thewire/owner/' . $owner->username); +elgg_push_breadcrumb($title); + +$content = elgg_view_entity($post); + +$body = elgg_view_layout('content', array( + 'filter' => false, + 'content' => $content, + 'title' => $title, +)); + +echo elgg_view_page($title, $body); diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 5d5786e2f..8e3b5224a 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -77,7 +77,8 @@ function thewire_init() { * thewire/owner/ View this user's wire posts * thewire/following/ View the posts of those this user follows * thewire/reply/ Reply to a post - * thewire/view/ View a conversation thread + * thewire/view/ View a post + * thewire/thread/ View a conversation thread * thewire/tag/ View wire posts tagged with * * @param array $page From the page_handler function @@ -104,6 +105,12 @@ function thewire_page_handler($page) { include "$base_dir/owner.php"; break; + case "view": + if (isset($page[1])) { + set_input('guid', $page[1]); + } + include "$base_dir/view.php"; + case "thread": if (isset($page[1])) { set_input('thread_id', $page[1]); -- cgit v1.2.3 From 9607776966d5c0f8a132dd4275841298619907ea Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Thu, 14 Jun 2012 11:09:40 -0400 Subject: Fixes #4577: Transparency converted to white instead of black --- engine/lib/filestore.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index 86f6d9baa..93a127257 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -149,6 +149,12 @@ $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0, $upscale = FALSE) { return FALSE; } + // color transparencies white (default is black) + imagefilledrectangle( + $new_image, 0, 0, $params['newwidth'], $params['newheight'], + imagecolorallocate($new_image, 255, 255, 255) + ); + $rtn_code = imagecopyresampled( $new_image, $original_image, 0, -- cgit v1.2.3 From 4c391e8cbdfb7a51392244d3f3ff0af35b1adb88 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 14 Jun 2012 21:05:11 -0400 Subject: rewrote the language caching - now not calling register_translations() if we can load the language data from cache --- engine/lib/cache.php | 1 + engine/lib/elgglib.php | 6 +- engine/lib/languages.php | 156 ++++++++++++++++++++++------------------------- engine/lib/plugins.php | 4 ++ engine/lib/sessions.php | 11 +--- 5 files changed, 84 insertions(+), 94 deletions(-) diff --git a/engine/lib/cache.php b/engine/lib/cache.php index c117b9ec9..be1c43e14 100644 --- a/engine/lib/cache.php +++ b/engine/lib/cache.php @@ -442,6 +442,7 @@ function _elgg_cache_init() { } if ($CONFIG->system_cache_enabled && !$CONFIG->i18n_loaded_from_cache) { + reload_all_translations(); foreach ($CONFIG->translations as $lang => $map) { elgg_save_system_cache("$lang.php", serialize($map)); } diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index db1464bd8..8d4bbd64d 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -2106,11 +2106,13 @@ function _elgg_engine_boot() { _elgg_load_application_config(); - register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); - _elgg_load_site_config(); + _elgg_session_boot(); + _elgg_load_cache(); + + _elgg_load_translations(); } /** diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 7a508d298..e55d5622a 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -7,6 +7,57 @@ * @subpackage Languages */ +/** + * Given a message key, returns an appropriately translated full-text string + * + * @param string $message_key The short message code + * @param array $args An array of arguments to pass through vsprintf(). + * @param string $language Optionally, the standard language code + * (defaults to site/user default, then English) + * + * @return string Either the translated string, the English string, + * or the original language string. + */ +function elgg_echo($message_key, $args = array(), $language = "") { + global $CONFIG; + + static $CURRENT_LANGUAGE; + + // old param order is deprecated + if (!is_array($args)) { + elgg_deprecated_notice( + 'As of Elgg 1.8, the 2nd arg to elgg_echo() is an array of string replacements and the 3rd arg is the language.', + 1.8 + ); + + $language = $args; + $args = array(); + } + + if (!$CURRENT_LANGUAGE) { + $CURRENT_LANGUAGE = get_language(); + } + if (!$language) { + $language = $CURRENT_LANGUAGE; + } + + if (isset($CONFIG->translations[$language][$message_key])) { + $string = $CONFIG->translations[$language][$message_key]; + } else if (isset($CONFIG->translations["en"][$message_key])) { + $string = $CONFIG->translations["en"][$message_key]; + } else { + $string = $message_key; + } + + // only pass through if we have arguments to allow backward compatibility + // with manual sprintf() calls. + if ($args) { + $string = vsprintf($string, $args); + } + + return $string; +} + /** * Add a translation. * @@ -82,56 +133,34 @@ function get_language() { return false; } -/** - * Given a message shortcode, returns an appropriately translated full-text string - * - * @param string $message_key The short message code - * @param array $args An array of arguments to pass through vsprintf(). - * @param string $language Optionally, the standard language code - * (defaults to site/user default, then English) - * - * @return string Either the translated string, the English string, - * or the original language string. - */ -function elgg_echo($message_key, $args = array(), $language = "") { +function _elgg_load_translations() { global $CONFIG; - static $CURRENT_LANGUAGE; - - // old param order is deprecated - if (!is_array($args)) { - elgg_deprecated_notice( - 'As of Elgg 1.8, the 2nd arg to elgg_echo() is an array of string replacements and the 3rd arg is the language.', - 1.8 - ); - - $language = $args; - $args = array(); - } + if ($CONFIG->system_cache_enabled) { + $loaded = true; + $languages = array_unique(array('en', get_current_language())); + foreach ($languages as $language) { + $data = elgg_load_system_cache("$language.php"); + if ($data) { + add_translation($language, unserialize($data)); + } else { + $loaded = false; + } + } - if (!$CURRENT_LANGUAGE) { - $CURRENT_LANGUAGE = get_language(); - } - if (!$language) { - $language = $CURRENT_LANGUAGE; + if ($loaded) { + $CONFIG->i18n_loaded_from_cache = true; + // this is here to force + $CONFIG->language_paths[dirname(dirname(dirname(__FILE__))) . "/languages/"] = true; + return; + } } - if (isset($CONFIG->translations[$language][$message_key])) { - $string = $CONFIG->translations[$language][$message_key]; - } else if (isset($CONFIG->translations["en"][$message_key])) { - $string = $CONFIG->translations["en"][$message_key]; - } else { - $string = $message_key; - } + // load core translations from languages directory + register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); +} - // only pass through if we have arguments to allow backward compatibility - // with manual sprintf() calls. - if ($args) { - $string = vsprintf($string, $args); - } - return $string; -} /** * When given a full path, finds translation files and loads them @@ -145,16 +174,9 @@ function elgg_echo($message_key, $args = array(), $language = "") { function register_translations($path, $load_all = false) { global $CONFIG; - static $load_from_cache; - static $cache_loaded_langs; - if (!isset($load_from_cache)) { - $load_from_cache = $CONFIG->system_cache_enabled; - $cache_loaded_langs = array(); - } - $path = sanitise_filepath($path); - // Make a note of this path just in case we need to register this language later + // Make a note of this path just incase we need to register this language later if (!isset($CONFIG->language_paths)) { $CONFIG->language_paths = array(); } @@ -162,6 +184,7 @@ function register_translations($path, $load_all = false) { // Get the current language based on site defaults and user preference $current_language = get_current_language(); + elgg_log("Translations loaded from: $path"); // only load these files unless $load_all is true. $load_language_files = array( @@ -171,32 +194,6 @@ function register_translations($path, $load_all = false) { $load_language_files = array_unique($load_language_files); - if ($load_from_cache && !$load_all) { - // load language files from cache - $data = array(); - foreach ($load_language_files as $lang_file) { - $lang = substr($lang_file, 0, strpos($lang_file, '.')); - if (!isset($cache_loaded_langs[$lang])) { - $data[$lang] = elgg_load_system_cache($lang_file); - if ($data[$lang]) { - $cache_loaded_langs[$lang] = true; - } else { - // this language file not cached yet - $load_from_cache = false; - } - } - } - - // are we still suppose to load from cache - if ($load_from_cache) { - foreach ($data as $lang => $map) { - add_translation($lang, unserialize($map)); - } - $CONFIG->i18n_loaded_from_cache = true; - return true; - } - } - $handle = opendir($path); if (!$handle) { elgg_log("Could not open language path: $path", 'ERROR'); @@ -218,11 +215,6 @@ function register_translations($path, $load_all = false) { } } - elgg_log("Translations loaded from: $path"); - - // make sure caching code saves language data if system cache is on - $CONFIG->i18n_loaded_from_cache = false; - return $return; } diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 39a76db5d..d5cd4fe76 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -311,6 +311,10 @@ function elgg_load_plugins() { $start_flags = $start_flags & ~ELGG_PLUGIN_REGISTER_VIEWS; } + if (elgg_get_config('i18n_loaded_from_cache')) { + $start_flags = $start_flags & ~ELGG_PLUGIN_REGISTER_LANGUAGES; + } + $return = true; $plugins = elgg_get_plugins('active'); if ($plugins) { diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 419d36707..72ca0a1c2 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -376,14 +376,10 @@ function logout() { * * @uses $_SESSION * - * @param string $event Event name - * @param string $object_type Object type - * @param mixed $object Object - * * @return bool * @access private */ -function _elgg_session_boot($event, $object_type, $object) { +function _elgg_session_boot() { global $DB_PREFIX, $CONFIG; // Use database for sessions @@ -464,9 +460,6 @@ function _elgg_session_boot($event, $object_type, $object) { return false; } - // Since we have loaded a new user, this user may have different language preferences - register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); - return true; } @@ -658,5 +651,3 @@ function _elgg_session_gc($maxlifetime) { return true; } - -elgg_register_event_handler('boot', 'system', '_elgg_session_boot', 2); -- cgit v1.2.3 From 34de6036015f072cd809c3240228f56b23c7de91 Mon Sep 17 00:00:00 2001 From: Srokap Date: Fri, 15 Jun 2012 17:43:50 +0200 Subject: Fixes #450 Enabling entity doesn't enable it's children entities. --- engine/lib/entities.php | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 4875b2c2f..c06e7fb99 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1452,6 +1452,7 @@ function enable_entity($guid, $recursive = true) { 'relationship' => 'disabled_with', 'relationship_guid' => $entity->guid, 'inverse_relationship' => true, + 'limit' => 0, )); foreach ($disabled_with_it as $e) { -- cgit v1.2.3 From 5d682dcba36428f5c4af113104fdb69a8d0c8c0d Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Fri, 15 Jun 2012 17:33:12 -0300 Subject: Fixes #4581: elgg_pop_breadcrumb now returns the item --- engine/lib/navigation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index a7984ce5a..4ff009bfb 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -230,7 +230,7 @@ function elgg_pop_breadcrumb() { global $CONFIG; if (is_array($CONFIG->breadcrumbs)) { - array_pop($CONFIG->breadcrumbs); + return array_pop($CONFIG->breadcrumbs); } return FALSE; -- cgit v1.2.3 From 460b47b7cedb7b9af16d8d62e5b7b8b9eadff508 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 15 Jun 2012 18:04:59 -0400 Subject: load translations when an exception is thrown before engine boot finishes --- engine/lib/languages.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/lib/languages.php b/engine/lib/languages.php index e55d5622a..15c48f902 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -34,6 +34,11 @@ function elgg_echo($message_key, $args = array(), $language = "") { $args = array(); } + if (!isset($CONFIG->translations)) { + // this means we probably had an exception before translations were initialized + register_translations(dirname(dirname(dirname(__FILE__))) . "/languages/"); + } + if (!$CURRENT_LANGUAGE) { $CURRENT_LANGUAGE = get_language(); } -- cgit v1.2.3 From 3945ddea5f7b5bef5b5b67f8406ab9bbd5514955 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 15 Jun 2012 22:09:41 -0400 Subject: Fixes #4343 a user that can write to group can create subpages (sem's pull request plus comment) --- mod/pages/pages/pages/view.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php index 81477a8d4..9bfd67a12 100644 --- a/mod/pages/pages/pages/view.php +++ b/mod/pages/pages/pages/view.php @@ -32,7 +32,8 @@ elgg_push_breadcrumb($title); $content = elgg_view_entity($page, array('full_view' => true)); $content .= elgg_view_comments($page); -if (elgg_is_admin_logged_in() || elgg_get_logged_in_user_guid() == $page->getOwnerGuid()) { +// can add subpage if can edit this page and write to container (such as a group) +if ($page->canEdit() && $container->canWriteToContainer(0, 'object', 'page')) { $url = "pages/add/$page->guid"; elgg_register_menu_item('title', array( 'name' => 'subpage', -- cgit v1.2.3 From 81dac97890197658e5446e464604c2bc15903e5a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 15 Jun 2012 22:28:46 -0400 Subject: Fixes #4582 using output/url for links in pagination --- views/default/navigation/pagination.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/views/default/navigation/pagination.php b/views/default/navigation/pagination.php index e0d355327..04044c51c 100644 --- a/views/default/navigation/pagination.php +++ b/views/default/navigation/pagination.php @@ -113,7 +113,12 @@ foreach ($pages->items as $page) { } else { $page_offset = (($page - 1) * $limit); $url = elgg_http_add_url_query_elements($base_url, array($offset_key => $page_offset)); - echo "
  • $page
  • "; + $link = elgg_view('output/url', array( + 'href' => $url, + 'text' => $page, + 'is_trusted' => true, + )); + echo "
  • $link
  • "; } } -- cgit v1.2.3 From eb9f207972cf4ebeec71cf7e3a0e762df5d4c40a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 15 Jun 2012 22:55:21 -0400 Subject: Fixes #4496, #4500 Refs #2814 Add consistent error message when content does not exist or user does not have access --- languages/en.php | 2 +- mod/blog/languages/en.php | 1 - mod/blog/lib/blog.php | 2 +- mod/bookmarks/pages/bookmarks/view.php | 4 ++++ mod/file/pages/file/view.php | 4 ++++ mod/pages/pages/pages/view.php | 1 + mod/thewire/pages/thewire/view.php | 4 ++-- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/languages/en.php b/languages/en.php index f1de1f202..ae874a550 100644 --- a/languages/en.php +++ b/languages/en.php @@ -239,7 +239,7 @@ $english = array( 'pageownerunavailable' => 'Warning: The page owner %d is not accessible!', '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.', + 'noaccess' => 'The content you were trying to view has been removed 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.', diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php index e1930b916..5248a6f51 100644 --- a/mod/blog/languages/en.php +++ b/mod/blog/languages/en.php @@ -41,7 +41,6 @@ $english = array( 'blog:message:saved' => 'Blog post saved.', 'blog:error:cannot_save' => 'Cannot save blog post.', 'blog:error:cannot_write_to_container' => 'Insufficient access to save blog to group.', - 'blog:error:post_not_found' => 'This post has been removed, is invalid, or you do not have permission to view it.', 'blog:messages:warning:draft' => 'There is an unsaved draft of this post!', 'blog:edit_revision_notice' => '(Old version)', 'blog:message:deleted_post' => 'Blog post deleted.', diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 286fe1832..9d6cb37e7 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -22,7 +22,7 @@ function blog_get_page_content_read($guid = NULL) { $return['filter'] = ''; if (!elgg_instanceof($blog, 'object', 'blog')) { - $return['content'] = elgg_echo('blog:error:post_not_found'); + $return['content'] = elgg_echo('noaccess'); return $return; } diff --git a/mod/bookmarks/pages/bookmarks/view.php b/mod/bookmarks/pages/bookmarks/view.php index 2439d2ee8..c819b8b41 100644 --- a/mod/bookmarks/pages/bookmarks/view.php +++ b/mod/bookmarks/pages/bookmarks/view.php @@ -6,6 +6,10 @@ */ $bookmark = get_entity(get_input('guid')); +if (!$bookmark) { + register_error(elgg_echo('noaccess')); + forward(''); +} $page_owner = elgg_get_page_owner_entity(); diff --git a/mod/file/pages/file/view.php b/mod/file/pages/file/view.php index a571c9d68..ec51b30e6 100644 --- a/mod/file/pages/file/view.php +++ b/mod/file/pages/file/view.php @@ -6,6 +6,10 @@ */ $file = get_entity(get_input('guid')); +if (!$file) { + register_error(elgg_echo('noaccess')); + forward(''); +} $owner = elgg_get_page_owner_entity(); diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php index 9bfd67a12..6b9d03f49 100644 --- a/mod/pages/pages/pages/view.php +++ b/mod/pages/pages/pages/view.php @@ -8,6 +8,7 @@ $page_guid = get_input('guid'); $page = get_entity($page_guid); if (!$page) { + register_error(elgg_echo('noaccess')); forward(); } diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php index f45f94bfe..1818e725a 100644 --- a/mod/thewire/pages/thewire/view.php +++ b/mod/thewire/pages/thewire/view.php @@ -5,8 +5,8 @@ $post = get_entity(get_input('guid')); if (!$post) { - // @todo need special handling for not getting access to entity (check for existence, access) - forward(); + register_error(elgg_echo('noaccess')); + forward(''); } $owner = $post->getOwnerEntity(); if (!$owner) { -- cgit v1.2.3 From c58102ebcf60334f6902ba1df1aaee7104f6ba0d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 11:47:16 -0400 Subject: Fixes #3242 removed metastring clean up in one of the unit tests --- engine/tests/api/metadata.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/engine/tests/api/metadata.php b/engine/tests/api/metadata.php index 2461e975e..244036f80 100644 --- a/engine/tests/api/metadata.php +++ b/engine/tests/api/metadata.php @@ -43,9 +43,6 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { { $this->assertTrue(in_array($string, $this->metastrings)); } - - // clean up - $this->delete_metastrings(); } public function testElggGetEntitiesFromMetadata() { @@ -77,7 +74,6 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { // clean up $this->object->delete(); - $this->delete_metastrings(); } public function testElggGetMetadataCount() { @@ -206,12 +202,4 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { mysql_query("INSERT INTO {$CONFIG->dbprefix}metastrings (string) VALUES ('$string')"); $this->metastrings[$string] = mysql_insert_id(); } - - protected function delete_metastrings() { - global $CONFIG, $METASTRINGS_CACHE, $METASTRINGS_DEADNAME_CACHE; - $METASTRINGS_CACHE = $METASTRINGS_DEADNAME_CACHE = array(); - - $strings = implode(', ', $this->metastrings); - mysql_query("DELETE FROM {$CONFIG->dbprefix}metastrings WHERE id IN ($strings)"); - } } -- cgit v1.2.3 From 7d8064039f17059c4d87112dd107f828cf6c661a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 12:33:57 -0400 Subject: Fixes #3463 not showing edit icon for widgets when nothing to edit --- views/default/object/widget/elements/controls.php | 4 +--- views/default/object/widget/elements/settings.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php index d1d630c4f..57a935f62 100644 --- a/views/default/object/widget/elements/controls.php +++ b/views/default/object/widget/elements/controls.php @@ -8,9 +8,7 @@ echo elgg_view_menu('widget', array( 'entity' => elgg_extract('widget', $vars), - 'params' => array( - 'show_edit' => elgg_extract('show_edit', $vars, true) - ), + 'show_edit' => elgg_extract('show_edit', $vars, true), 'sort_by' => 'priority', 'class' => 'elgg-menu-hz', )); diff --git a/views/default/object/widget/elements/settings.php b/views/default/object/widget/elements/settings.php index 5afe56ed8..25cda58c9 100644 --- a/views/default/object/widget/elements/settings.php +++ b/views/default/object/widget/elements/settings.php @@ -6,8 +6,20 @@ */ $widget = elgg_extract('widget', $vars); + +// not using elgg_view_form() so that we can detect if the form is empty +$form_body = elgg_view('forms/widgets/save', $vars); +if (!$form_body) { + return true; +} + +$form = elgg_view('input/form', array( + 'action' => 'action/widgets/save', + 'body' => $form_body, + 'class' => 'elgg-form-widgets-save', +)); ?>
    - +
    -- cgit v1.2.3 From b6daeeff44535de77f81396d6690f6eedbf57708 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 13:16:21 -0400 Subject: Fixes #4502 selected menu items maintain plugin provided classes --- views/default/navigation/menu/elements/item.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php index 22383ce0b..fd9738826 100644 --- a/views/default/navigation/menu/elements/item.php +++ b/views/default/navigation/menu/elements/item.php @@ -13,7 +13,8 @@ $item = $vars['item']; $link_class = 'elgg-menu-closed'; if ($item->getSelected()) { - $item->setItemClass('elgg-state-selected'); + // @todo switch to addItemClass when that is implemented + //$item->setItemClass('elgg-state-selected'); $link_class = 'elgg-menu-opened'; } @@ -24,6 +25,9 @@ if ($children) { } $item_class = $item->getItemClass(); +if ($item->getSelected()) { + $item_class = "$item_class elgg-state-selected"; +} if (isset($vars['item_class']) && $vars['item_class']) { $item_class .= ' ' . $vars['item_class']; } -- cgit v1.2.3 From 0f64abea5d18ea883bf40c1712f72423a1d1317b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 13:23:52 -0400 Subject: Fixes #4485 walled garden lets a plugin take over index page --- engine/lib/elgglib.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index db1464bd8..4bbe87f57 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -2016,10 +2016,20 @@ function elgg_is_valid_options_for_batch_operation($options, $type) { * * @link http://docs.elgg.org/Tutorials/WalledGarden * @elgg_plugin_hook index system + * + * @param string $hook The name of the hook + * @param string $type The type of hook + * @param bool $value Has a plugin already rendered an index page? + * @param array $params Array of parameters (should be empty) * @return bool * @access private */ -function elgg_walled_garden_index() { +function elgg_walled_garden_index($hook, $type, $value, $params) { + if ($value) { + // do not create a second index page so return + return; + } + elgg_load_css('elgg.walled_garden'); elgg_load_js('elgg.walled_garden'); -- cgit v1.2.3 From 65c3cca827ba5471cc1a49ad13178fc1aba6c964 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 17:22:42 -0400 Subject: Fixes #4157 setting class name in cache when update_subtype() is called --- engine/lib/entities.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index c06e7fb99..ae5df66f7 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -331,7 +331,7 @@ function remove_subtype($type, $subtype) { } /** - * Update a registered ElggEntity type, subtype, and classname + * Update a registered ElggEntity type, subtype, and class name * * @param string $type Type * @param string $subtype Subtype @@ -340,7 +340,7 @@ function remove_subtype($type, $subtype) { * @return bool */ function update_subtype($type, $subtype, $class = '') { - global $CONFIG; + global $CONFIG, $SUBTYPE_CACHE; if (!$id = get_subtype_id($type, $subtype)) { return FALSE; @@ -348,10 +348,16 @@ function update_subtype($type, $subtype, $class = '') { $type = sanitise_string($type); $subtype = sanitise_string($subtype); - return update_data("UPDATE {$CONFIG->dbprefix}entity_subtypes + $result = update_data("UPDATE {$CONFIG->dbprefix}entity_subtypes SET type = '$type', subtype = '$subtype', class = '$class' WHERE id = $id "); + + if ($result && isset($SUBTYPE_CACHE[$id])) { + $SUBTYPE_CACHE[$id]->class = $class; + } + + return $result; } /** -- cgit v1.2.3 From 61bc345d16a51c44078d684032ec50bb16b2bc47 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 17:36:56 -0400 Subject: Fixes #4586 properly accessing ip address in refine form --- .../views/default/admin/administer_utilities/logbrowser.php | 1 + mod/logbrowser/views/default/forms/logbrowser/refine.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php index 89894e3d2..2581f954c 100644 --- a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php +++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php @@ -41,6 +41,7 @@ $refine = elgg_view('logbrowser/refine', array( 'user_guid' => $user_guid, 'timeupper' => $timeupper, 'timelower' => $timelower, + 'ip_address' => $ip_address, )); // Get log entries diff --git a/mod/logbrowser/views/default/forms/logbrowser/refine.php b/mod/logbrowser/views/default/forms/logbrowser/refine.php index 6ec5907b6..3c6528d21 100644 --- a/mod/logbrowser/views/default/forms/logbrowser/refine.php +++ b/mod/logbrowser/views/default/forms/logbrowser/refine.php @@ -6,15 +6,16 @@ * @uses $vars['user_guid'] * @uses $vars['timelower'] * @uses $vars['timeupper'] + * @uses $vars['ip_address'] */ if (isset($vars['timelower'])) { - $lowerval = date('r',$vars['timelower']); + $lowerval = date('r', $vars['timelower']); } else { $lowerval = ""; } if (isset($vars['timeupper'])) { - $upperval = date('r',$vars['timeupper']); + $upperval = date('r', $vars['timeupper']); } else { $upperval = ""; } @@ -26,7 +27,7 @@ if (isset($vars['user_guid'])) { } else { $userval = ""; } -$ip_address = elgg_extract('ip_address', ''); +$ip_address = elgg_extract('ip_address', $vars); $form = "
    " . elgg_echo('logbrowser:user'); $form .= elgg_view('input/text', array( -- cgit v1.2.3 From b06fec41d7f0e4b998dc6753a3d4c50b16621000 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 17:55:08 -0400 Subject: Fixes #3787 not showing all logs if user does not exist --- mod/logbrowser/languages/en.php | 2 ++ .../default/admin/administer_utilities/logbrowser.php | 14 +++++++++++++- mod/logbrowser/views/default/forms/logbrowser/refine.php | 15 ++++----------- mod/logbrowser/views/default/logbrowser/table.php | 7 ++++++- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/mod/logbrowser/languages/en.php b/mod/logbrowser/languages/en.php index f36b4bc6b..b1d2681dd 100644 --- a/mod/logbrowser/languages/en.php +++ b/mod/logbrowser/languages/en.php @@ -23,6 +23,8 @@ $english = array( 'logbrowser:object' => 'Object type', 'logbrowser:object:guid' => 'Object GUID', 'logbrowser:action' => 'Action', + + 'logbrowser:no_result' => 'No results', ); add_translation("en", $english); \ No newline at end of file diff --git a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php index 2581f954c..9506c9d9f 100644 --- a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php +++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php @@ -15,11 +15,17 @@ if ($search_username) { $user = get_user_by_username($search_username); if ($user) { $user_guid = $user->guid; + } else { + $user_guid = null; } } else { $user_guid = get_input('user_guid', null); if ($user_guid) { $user_guid = (int) $user_guid; + $user = get_entity($user_guid); + if ($user) { + $search_username = $user->username; + } } else { $user_guid = null; } @@ -38,10 +44,10 @@ if ($timeupper) { $ip_address = get_input('ip_address'); $refine = elgg_view('logbrowser/refine', array( - 'user_guid' => $user_guid, 'timeupper' => $timeupper, 'timelower' => $timelower, 'ip_address' => $ip_address, + 'username' => $search_username, )); // Get log entries @@ -50,6 +56,12 @@ $log = get_system_log($user_guid, "", "", "","", $limit, $offset, false, $timeup $count = get_system_log($user_guid, "", "", "","", $limit, $offset, true, $timeupper, $timelower, 0, $ip_address); +// if user does not exist, we have no results +if ($search_username && is_null($user_guid)) { + $log = false; + $count = 0; +} + $table = elgg_view('logbrowser/table', array('log_entries' => $log)); $nav = elgg_view('navigation/pagination',array( diff --git a/mod/logbrowser/views/default/forms/logbrowser/refine.php b/mod/logbrowser/views/default/forms/logbrowser/refine.php index 3c6528d21..ebf7f10ed 100644 --- a/mod/logbrowser/views/default/forms/logbrowser/refine.php +++ b/mod/logbrowser/views/default/forms/logbrowser/refine.php @@ -3,10 +3,10 @@ * Form body for refining the log browser search. * Look for a particular person or in a time window. * - * @uses $vars['user_guid'] + * @uses $vars['username'] + * @uses $vars['ip_address'] * @uses $vars['timelower'] * @uses $vars['timeupper'] - * @uses $vars['ip_address'] */ if (isset($vars['timelower'])) { @@ -19,20 +19,13 @@ if (isset($vars['timeupper'])) { } else { $upperval = ""; } -if (isset($vars['user_guid'])) { - $user = get_entity($vars['user_guid']); - if ($user) { - $userval = $user->username; - } -} else { - $userval = ""; -} $ip_address = elgg_extract('ip_address', $vars); +$username = elgg_extract('username', $vars); $form = "
    " . elgg_echo('logbrowser:user'); $form .= elgg_view('input/text', array( 'name' => 'search_username', - 'value' => $userval, + 'value' => $username, )) . "
    "; $form .= "
    " . elgg_echo('logbrowser:ip_address'); diff --git a/mod/logbrowser/views/default/logbrowser/table.php b/mod/logbrowser/views/default/logbrowser/table.php index 9a867e080..1223c1456 100644 --- a/mod/logbrowser/views/default/logbrowser/table.php +++ b/mod/logbrowser/views/default/logbrowser/table.php @@ -82,4 +82,9 @@ $log_entries = $vars['log_entries']; $alt = $alt ? '' : 'class="alt"'; } ?> - \ No newline at end of file + + Date: Sat, 16 Jun 2012 18:11:57 -0400 Subject: Fixes #3684 prevent pagesetup, system event from firing during the init, system event --- engine/lib/views.php | 2 +- engine/start.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/lib/views.php b/engine/lib/views.php index 1b013be6f..c98ad4e78 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -403,7 +403,7 @@ function elgg_view($view, $vars = array(), $bypass = false, $debug = false, $vie $view_orig = $view; // Trigger the pagesetup event - if (!isset($CONFIG->pagesetupdone)) { + if (!isset($CONFIG->pagesetupdone) && $CONFIG->boot_complete) { $CONFIG->pagesetupdone = true; elgg_trigger_event('pagesetup', 'system'); } diff --git a/engine/start.php b/engine/start.php index 506e27380..5f4bded45 100644 --- a/engine/start.php +++ b/engine/start.php @@ -49,6 +49,7 @@ global $CONFIG; if (!isset($CONFIG)) { $CONFIG = new stdClass; } +$CONFIG->boot_complete = false; $lib_dir = dirname(__FILE__) . '/lib/'; @@ -105,5 +106,7 @@ elgg_trigger_event('plugins_boot', 'system'); // Complete the boot process for both engine and plugins elgg_trigger_event('init', 'system'); +$CONFIG->boot_complete = true; + // System loaded and ready elgg_trigger_event('ready', 'system'); -- cgit v1.2.3 From 3f42ca11e752696d9aaafe9b006d8e0f07136928 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 16 Jun 2012 22:05:07 -0400 Subject: Fixes #4079 detecting docx, xlsx, and pptx files in file plugin --- mod/file/actions/file/upload.php | 25 ++++++++++++++++++++++++- mod/file/start.php | 8 ++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index 5242cbda2..d72d04eb7 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -94,8 +94,31 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) { $filestorename = elgg_strtolower(time().$_FILES['upload']['name']); } - $mime_type = $file->detectMimeType($_FILES['upload']['tmp_name'], $_FILES['upload']['type']); $file->setFilename($prefix . $filestorename); + $mime_type = ElggFile::detectMimeType($_FILES['upload']['tmp_name'], $_FILES['upload']['type']); + + // hack for Microsoft zipped formats + $info = pathinfo($_FILES['upload']['name']); + $office_formats = array('docx', 'xlsx', 'pptx'); + if ($mime_type == "application/zip" && in_array($info['extension'], $office_formats)) { + switch ($info['extension']) { + case 'docx': + $mime_type = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; + break; + case 'xlsx': + $mime_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + break; + case 'pptx': + $mime_type = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; + break; + } + } + + // check for bad ppt detection + if ($mime_type == "application/vnd.ms-office" && $info['extension'] == "ppt") { + $mime_type = "application/vnd.ms-powerpoint"; + } + $file->setMimeType($mime_type); $file->originalfilename = $_FILES['upload']['name']; $file->simpletype = file_get_simple_type($mime_type); diff --git a/mod/file/start.php b/mod/file/start.php index 120129276..172042332 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -240,11 +240,15 @@ function file_get_simple_type($mimetype) { switch ($mimetype) { case "application/msword": + case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return "document"; break; case "application/pdf": return "document"; break; + case "application/ogg": + return "audio"; + break; } if (substr_count($mimetype, 'text/')) { @@ -357,11 +361,15 @@ function file_icon_url_override($hook, $type, $returnvalue, $params) { $mapping = array( 'application/excel' => 'excel', 'application/msword' => 'word', + 'application/ogg' => 'music', 'application/pdf' => 'pdf', 'application/powerpoint' => 'ppt', 'application/vnd.ms-excel' => 'excel', 'application/vnd.ms-powerpoint' => 'ppt', 'application/vnd.oasis.opendocument.text' => 'openoffice', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'word', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'ppt', 'application/x-gzip' => 'archive', 'application/x-rar-compressed' => 'archive', 'application/x-stuffit' => 'archive', -- cgit v1.2.3 From f817ef90978ba19aee2273872ff2d75c4b4c2c65 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 17 Jun 2012 08:26:21 -0400 Subject: Fixes #4383 hard codes bundled plugin list and also removes really ugly color for highlighting them in plugin list --- engine/classes/ElggPluginManifest.php | 14 ++++++++++++++ views/default/css/admin.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 7aa702d47..7e79c15c8 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -319,12 +319,26 @@ class ElggPluginManifest { * @return array */ public function getCategories() { + $bundled_plugins = array('blog', 'bookmarks', 'categories', + 'custom_index', 'dashboard', 'developers', 'diagnostics', + 'embed', 'externalpages', 'file', 'garbagecollector', + 'groups', 'htmlawed', 'invitefriends', 'likes', + 'logbrowser', 'logrotate', 'members', 'messageboard', + 'messages', 'notifications', 'oauth_api', 'pages', 'profile', + 'reportedcontent', 'search', 'tagcloud', 'thewire', 'tinymce', + 'twitter', 'twitter_api', 'uservalidationbyemail', 'zaudio', + ); + $cats = $this->parser->getAttribute('category'); if (!$cats) { $cats = array(); } + if (in_array('bundled', $cats) && !in_array($this->getPluginID(), $bundled_plugins)) { + unset($cats[array_search('bundled', $cats)]); + } + return $cats; } diff --git a/views/default/css/admin.php b/views/default/css/admin.php index e3205ca4e..65797172f 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1267,7 +1267,7 @@ ul.elgg-plugin-categories, ul.elgg-plugin-categories > li { } .elgg-plugin-category-bundled { border-width: 2px; - border-color: #DAA520; + border-color: #0054A7; } /**************************************** -- cgit v1.2.3 From 03b11429979e2bc35233af695ae98414ef9a4fd4 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 17 Jun 2012 08:55:07 -0400 Subject: Fixes #3755 adds ajax loader when uploading files in embed plugin --- mod/embed/views/default/embed/layout.php | 3 +++ mod/embed/views/default/js/embed/embed.php | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mod/embed/views/default/embed/layout.php b/mod/embed/views/default/embed/layout.php index e906160b1..1ca263037 100644 --- a/mod/embed/views/default/embed/layout.php +++ b/mod/embed/views/default/embed/layout.php @@ -21,6 +21,9 @@ if ($selected->getData('view')) { } } +$tab .= elgg_view('graphics/ajax_loader', array( + 'class' => 'embed-throbber mtl', +)); $container_info = elgg_view('input/hidden', array( 'name' => 'embed_container_guid', diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php index 5fd534a09..0c8442292 100644 --- a/mod/embed/views/default/js/embed/embed.php +++ b/mod/embed/views/default/js/embed/embed.php @@ -85,11 +85,14 @@ elgg.embed.submit = function(event) { } } }, - error: function(xhr, status) { - // nothing for now + error : function(xhr, status) { + // @todo nothing for now } }); + $('.elgg-form-file-upload').hide(); + $('.embed-throbber').show(); + // this was bubbling up the DOM causing a submission event.preventDefault(); event.stopPropagation(); -- cgit v1.2.3 From cfd0169e52aa9dcbfde5148ad3d6b89684e6bb28 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 17 Jun 2012 09:34:47 -0400 Subject: Fixes #4422 pulling in Ismayil's changes so that we use the module view for settings --- languages/en.php | 2 +- .../core/settings/account/default_access.php | 24 +++------ views/default/core/settings/account/email.php | 24 +++------ views/default/core/settings/account/language.php | 29 ++++------ views/default/core/settings/account/name.php | 29 +++++----- .../core/settings/account/notifications.php | 45 ++++++---------- views/default/core/settings/account/password.php | 54 ++++++++----------- .../core/settings/statistics/numentities.php | 63 ++++++++++------------ views/default/core/settings/statistics/online.php | 48 +++++++++++------ 9 files changed, 137 insertions(+), 181 deletions(-) diff --git a/languages/en.php b/languages/en.php index ae874a550..e9c333041 100644 --- a/languages/en.php +++ b/languages/en.php @@ -452,7 +452,7 @@ $english = array( * Notifications */ 'notifications:usersettings' => "Notification settings", - 'notifications:methods' => "Please specify which methods you want to permit.", + 'notifications:methods' => "Select your notification methods.", 'notification:method:email' => 'Email', 'notifications:usersettings:save:ok' => "Your notification settings were successfully saved.", diff --git a/views/default/core/settings/account/default_access.php b/views/default/core/settings/account/default_access.php index e33211460..690f2714a 100644 --- a/views/default/core/settings/account/default_access.php +++ b/views/default/core/settings/account/default_access.php @@ -12,22 +12,14 @@ if (elgg_get_config('allow_user_default_access')) { if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { $default_access = elgg_get_config('default_access'); } -?> -
    -
    -

    -
    -
    -

    - : - 'default_access', 'value' => $default_access)); + $title = elgg_echo('default_access:settings'); + $content = elgg_echo('default_access:label') . ': '; + $content .= elgg_view('input/access', array( + 'name' => 'default_access', + 'value' => $default_access, + )); - ?> -

    -
    -
    - -
    -
    -

    -
    -
    -

    - : - 'email', 'value' => $user->email)); - ?> -

    -
    -
    - 'email', + 'value' => $user->email, + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php index 3a992966f..b36057422 100644 --- a/views/default/core/settings/account/language.php +++ b/views/default/core/settings/account/language.php @@ -9,23 +9,12 @@ $user = elgg_get_page_owner_entity(); if ($user) { -?> -
    -
    -

    -
    -
    -

    - : - 'language', - 'value' => $user->language, - 'options_values' => get_installed_translations() - )); - ?> -

    -
    -
    - 'language', + 'value' => $user->language, + 'options_values' => get_installed_translations() + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php index f719a84de..e356146a3 100644 --- a/views/default/core/settings/account/name.php +++ b/views/default/core/settings/account/name.php @@ -7,20 +7,15 @@ */ $user = elgg_get_page_owner_entity(); -?> -
    -
    -

    -
    -
    -

    - : - 'name', 'value' => $user->name)); - ?> -

    -
    -
    - 'guid', 'value' => $user->guid)); +if ($user) { + $title = elgg_echo('user:name:label'); + $content = elgg_echo('name') . ': '; + $content .= elgg_view('input/text', array( + 'name' => 'name', + 'value' => $user->name, + )); + echo elgg_view_module('info', $title, $content); + + // need the user's guid to make sure the correct user gets updated + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid)); +} diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php index 51292b2c9..c212b3886 100644 --- a/views/default/core/settings/account/notifications.php +++ b/views/default/core/settings/account/notifications.php @@ -9,33 +9,20 @@ global $NOTIFICATION_HANDLERS; $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid()); -?> -
    -
    -

    -
    -
    +$title = elgg_echo('notifications:usersettings'); -

    +$rows = ''; - - $v) { -?> - - - - - - -
    : - $v) { if ($notification_settings->$k) { $val = "yes"; } else { $val = "no"; } - - echo elgg_view('input/radio', array( + + $radio = elgg_view('input/radio', array( 'name' => "method[$k]", 'value' => $val, 'options' => array( @@ -44,12 +31,14 @@ $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid ), )); -?> -
    -

    -
    \ No newline at end of file + $cells = '' . elgg_echo("notification:method:$k") . ': '; + $cells .= "$radio"; + + $rows .= "$cells"; +} + + +$content = elgg_echo('notifications:methods'); +$content .= "$rows
    "; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php index a80f3df6b..4857034b2 100644 --- a/views/default/core/settings/account/password.php +++ b/views/default/core/settings/account/password.php @@ -1,45 +1,33 @@ -
    -
    -

    -
    -
    - guid == elgg_get_logged_in_user_guid()) { - ?> -

    - : - 'current_password')); - ?> -

    - + $title = elgg_echo('user:set:password'); -

    - : - 'password')); - ?> -

    + // only make the admin user enter current password for changing his own password. + $admin = ''; + if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) { + $admin .= elgg_echo('user:current_password:label') . ': '; + $admin .= elgg_view('input/password', array('name' => 'current_password')); + $admin = "

    $admin

    "; + } -

    - : 'password2')); - ?> -

    -
    -
    - 'password')); + $password = "

    $password

    "; + + $password2 = elgg_echo('user:password2:label') . ': '; + $password2 .= elgg_view('input/password', array('name' => 'password2')); + $password2 = "

    $password2

    "; + + $content = $admin . $password . $password2; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php index 245fd67be..ce1705a2e 100644 --- a/views/default/core/settings/statistics/numentities.php +++ b/views/default/core/settings/statistics/numentities.php @@ -10,42 +10,35 @@ $entity_stats = get_entity_statistics(elgg_get_logged_in_user_guid()); if ($entity_stats) { -?> -
    -
    -

    -
    -
    - - $entry) { - foreach ($entry as $a => $b) { + $rows = ''; + foreach ($entity_stats as $k => $entry) { + foreach ($entry as $a => $b) { - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + // This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - if ($a == "__base__") { - $a = elgg_echo("item:{$k}"); - if (empty($a)) { - $a = $k; - } - } else { - $a = elgg_echo("item:{$k}:{$a}"); - if (empty($a)) { - $a = "$k $a"; - } - } - echo <<< END - - - - -END; + if ($a == "__base__") { + $a = elgg_echo("item:{$k}"); + if (empty($a)) { + $a = $k; + } + } else { + $a = elgg_echo("item:{$k}:{$a}"); + if (empty($a)) { + $a = "$k $a"; } } - ?> -
    {$a}:{$b}
    -
    -
    - + {$a}: + {$b} + +END; + } + } + + $title = elgg_echo('usersettings:statistics:label:numentities'); + $content = "$rows
    "; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php index 65db42cb1..ce7ff35fb 100644 --- a/views/default/core/settings/statistics/online.php +++ b/views/default/core/settings/statistics/online.php @@ -1,6 +1,6 @@ time_created; } -?> -
    -
    -

    -
    -
    - - - - - -
    name; ?>
    email; ?>
    time_created); ?>
    -
    -
    \ No newline at end of file +$label_name = elgg_echo('usersettings:statistics:label:name'); +$label_email = elgg_echo('usersettings:statistics:label:email'); +$label_member_since = elgg_echo('usersettings:statistics:label:membersince'); +$label_last_login = elgg_echo('usersettings:statistics:label:lastlogin'); + +$time_created = date("r", $user->time_created); +$last_login = date("r", $logged_in); + +$title = elgg_echo('usersettings:statistics:yourdetails'); + +$content = <<<__HTML + + + + + + + + + + + + + + + + + +
    $label_name$user->name
    $label_email$user->email
    $label_member_since$time_created
    $label_last_login$last_login
    +__HTML; + +echo elgg_view_module('info', $title, $content); -- cgit v1.2.3 From 242ea5fa2b1ac775b74cf118a8b81d79e531104a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 17 Jun 2012 18:53:37 -0400 Subject: Fixes #4487 turned off logging for sites that haven't been upgraded with ip address column --- engine/lib/system_log.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php index 28d90be56..53fa24557 100644 --- a/engine/lib/system_log.php +++ b/engine/lib/system_log.php @@ -156,9 +156,8 @@ function get_object_from_log_entry($entry_id) { * This is called by the event system and should not be called directly. * * @param object $object The object you're talking about. - * @param string $event String The event being logged - * - * @return mixed + * @param string $event The event being logged + * @return void */ function system_log($object, $event) { global $CONFIG; @@ -166,6 +165,12 @@ function system_log($object, $event) { static $cache_size = 0; if ($object instanceof Loggable) { + + if (datalist_get('version') < 2012012000) { + // this is a site that doesn't have the ip_address column yet + return; + } + // reset cache if it has grown too large if (!is_array($log_cache) || $cache_size > 500) { $log_cache = array(); @@ -213,8 +218,6 @@ function system_log($object, $event) { $log_cache[$time][$object_id][$event] = true; $cache_size += 1; } - - return true; } } -- cgit v1.2.3 From 098976fd34e6c98675a20c19fd54329ec44f6261 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 06:58:45 -0400 Subject: Fixes #4478 corrected license of htmlawed plugin --- mod/htmlawed/manifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/htmlawed/manifest.xml b/mod/htmlawed/manifest.xml index 5c1f14cb5..074f98fb3 100644 --- a/mod/htmlawed/manifest.xml +++ b/mod/htmlawed/manifest.xml @@ -8,7 +8,7 @@ Provides security filtering. Disabling this plugin is extremely insecure. DO NOT DISABLE. http://www.elgg.org/ See COPYRIGHT.txt - GNU General Public License version 3 + GNU General Public License version 2 elgg_release 1.8 -- cgit v1.2.3 From 0ac3aa92df97ea7fd06bdcbb744b6c910cdb09ed Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 07:20:54 -0400 Subject: Fixes #4483 fixes undefined variable errors for non-deprecated functions in engine --- engine/lib/admin.php | 2 +- engine/lib/configuration.php | 4 +++- engine/lib/entities.php | 2 +- engine/lib/pagehandler.php | 2 +- engine/lib/statistics.php | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 1528d97c5..b65d98c95 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -572,7 +572,7 @@ function admin_markdown_page_handler($pages) { if (!$plugin) { $error = elgg_echo('admin:plugins:markdown:unknown_plugin'); $body = elgg_view_layout('admin', array('content' => $error, 'title' => $error)); - echo elgg_view_page($title, $body, 'admin'); + echo elgg_view_page($error, $body, 'admin'); return true; } diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php index 9bf1529d6..305aa00b6 100644 --- a/engine/lib/configuration.php +++ b/engine/lib/configuration.php @@ -476,10 +476,12 @@ function get_config($name, $site_guid = 0) { break; } + // @todo these haven't really been implemented in Elgg 1.8. Complete in 1.9. // show dep message if ($new_name) { + // $msg = "Config value $name has been renamed as $new_name"; $name = $new_name; - elgg_deprecated_notice($msg, $dep_version); + // elgg_deprecated_notice($msg, $dep_version); } // decide from where to return the value diff --git a/engine/lib/entities.php b/engine/lib/entities.php index ae5df66f7..d950261a2 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1774,7 +1774,7 @@ function import_entity_plugin_hook($hook, $entity_type, $returnvalue, $params) { if ($tmp) { // Make sure its saved if (!$tmp->save()) { - elgg_echo('ImportException:ProblemSaving', array($element->getAttribute('uuid'))); + $msg = elgg_echo('ImportException:ProblemSaving', array($element->getAttribute('uuid'))); throw new ImportException($msg); } diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index a675d976a..46c7d059e 100644 --- a/engine/lib/pagehandler.php +++ b/engine/lib/pagehandler.php @@ -129,7 +129,7 @@ function elgg_error_page_handler($hook, $type, $result, $params) { $content = elgg_view("errors/default", $params); } $body = elgg_view_layout('error', array('content' => $content)); - echo elgg_view_page($title, $body, 'error'); + echo elgg_view_page('', $body, 'error'); exit; } diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php index e1f95ed97..5ee640549 100644 --- a/engine/lib/statistics.php +++ b/engine/lib/statistics.php @@ -95,8 +95,8 @@ function get_number_users($show_deactivated = false) { * @return string */ function get_online_users() { - $count = find_active_users(600, 10, $offset, true); - $objects = find_active_users(600, 10, $offset); + $count = find_active_users(600, 10, 0, true); + $objects = find_active_users(600, 10); if ($objects) { return elgg_view_entity_list($objects, array( -- cgit v1.2.3 From f55c90daea1c68e222d8ce6c0065284bfcefa39e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 17:02:14 -0400 Subject: updated install instructions --- INSTALL.txt | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index f558a26e2..f4ecbffe1 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -11,7 +11,8 @@ TECHNICAL REQUIREMENTS Elgg runs on a combination of the Apache web server, MySQL database system and the PHP interpreted scripting language. This is the most -popular web server environment in the world. +popular web server environment in the world. (Elgg can also run on +other web servers such a nginx and IIS, but requires further configuration). Due to Elgg's advanced functionality, there are some extra configuration requirements: @@ -20,25 +21,17 @@ configuration requirements: modules: o mod_rewrite o PHP - * MySQL 5+ with sql_mode in standard mode (ie not in traditional - or any other mode). - * PHP 5.2+ needs to be installed as an Apache module (not in CGI - mode or safe mode) with the following libraries: - o GD (for graphics processing, eg user icon rescaling) - o JSON (for API functionality) - o XML (not installed/compiled by default on all systems) - o Multibyte String support (for internationalisation) + * MySQL 5+. + * PHP 5.2+ needs to be installed as an Apache module + with the following libraries: + o GD (for graphics processing such as avatar cropping) + o Multibyte String support (for internationalization) It is recommended that you increase the memory available to PHP threads beyond the standard 8 or 12M, and increase the maximum uploaded filesize (which defaults to 2M). In both cases, this can be found in your php.ini. - * The following PHP libraries are also recommended for some - plugins and extra functionality: - o SOAP - o DOM - INSTALLING ELGG @@ -104,7 +97,8 @@ If your web server does not have permission to create these files, you will need to either 1. Change the permissions on the directory where you are installing - Elgg and the engine directory and try again. + Elgg and the engine directory and try again. Remember to change the + permissions back to the original values after installation is complete. 2. Copy engine/settings.example.php to engine/settings.php, open it up in a text editor and fill in your database details. Then -- cgit v1.2.3 From d06db9652acfa318bb1135caa3c3030cc9bbfd51 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 17:04:30 -0400 Subject: updated copyright date --- README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index 3cffcc8c7..5d9261ee4 100644 --- a/README.txt +++ b/README.txt @@ -1,12 +1,12 @@ Elgg -Copyright (c) 2008-2011 See COPYRIGHT.txt +Copyright (c) 2008-2012 See COPYRIGHT.txt See CONTRIBUTORS.txt for development credits. Elgg is managed by the Elgg Foundation, a nonprofit organization that was founded to govern, protect, and promote the Elgg open source social network engine. The Foundation aims to provide a stable, commercially and -individually independent organization that moves in the best interest of Elgg +individually independent organization that operates in the best interest of Elgg as an open source project. The project site can be found at http://elgg.org/ -- cgit v1.2.3 From e991b83d8ee2a549dabba2e88645dd31af235097 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 17:24:58 -0400 Subject: updated changes.txt --- CHANGES.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 870c4f57d..b502b8411 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,27 @@ +Version 1.8.6 +(June 18, 2012 from https://github.com/Elgg/Elgg/tree/1.8) + + Contributing Developers: + * Cash Costello + * Evan Winslow + * Ismayil Khayredinov + * Jeff Tilson + * Jerome Bakker + * Paweł Sroka + * Sem + * Steve Clay + + Enhancements: + * New ajax spinner + * Detecting docx, xlsx, and pptx files in file plugin + * Showing ajax spinner when uploading file with embed plugin + + Bugfixes: + * Fixed some language caching issues. + * Users can add sub-pages to another user's page in a group. + * Over 30 other bug fixes. + + Version 1.8.5 (May 17, 2012 from https://github.com/Elgg/Elgg/tree/1.8) @@ -27,6 +51,7 @@ Version 1.8.5 * River entries' timestamps use elgg_view_friendly_time() and can be overridden with the friendly time output view. + Version 1.8.4 (April 24, 2012 from https://github.com/Elgg/Elgg/tree/1.8) -- cgit v1.2.3 From 3ad8110fdb13925292cfbebc672bb4bbae992ed5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 17:45:08 -0400 Subject: fixed a language string for installer --- views/installation/forms/install/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/installation/forms/install/template.php b/views/installation/forms/install/template.php index 385168fe4..a01914f12 100644 --- a/views/installation/forms/install/template.php +++ b/views/installation/forms/install/template.php @@ -23,7 +23,7 @@ foreach ($variables as $field => $params) { } $submit_params = array( - 'value' => elgg_echo('next'), + 'value' => elgg_echo('install:next'), ); $form_body .= elgg_view('input/submit', $submit_params); -- cgit v1.2.3 From f7fa256e09694c2ed18663bd8e3e0c0ffd20b9e5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 17:59:26 -0400 Subject: fixed a warning due to foreach over empty array --- mod/pages/lib/pages.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php index dbf7b8917..3f27118a6 100644 --- a/mod/pages/lib/pages.php +++ b/mod/pages/lib/pages.php @@ -81,6 +81,10 @@ function pages_register_navigation_tree($container) { 'limit' => 0, )); + if (!$top_pages) { + return; + } + foreach ($top_pages as $page) { elgg_register_menu_item('pages_nav', array( 'name' => $page->getGUID(), -- cgit v1.2.3 From b91d8bb0fea5cef9fafea72181a0007cfaa54725 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 18 Jun 2012 18:00:00 -0400 Subject: Elgg 1.8.6 --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 4f028bfd6..0fb757b9c 100644 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ // YYYYMMDD = Elgg Date // XX = Interim incrementer -$version = 2012041801; +$version = 2012061800; // Human-friendly version name -$release = '1.8.5'; +$release = '1.8.6'; -- cgit v1.2.3