From b31a784ea72a435908fdd572ab46395f084f7f4e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 06:23:47 -0500 Subject: incremented version number --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 5a59b7f83..59b5305dd 100644 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ // YYYYMMDD = Elgg Date // XX = Interim incrementer -$version = 2011092500; +$version = 2011110700; // Human-friendly version name -$release = '1.8.1b1'; +$release = '1.8.1'; -- cgit v1.2.3 From 20aadaec9bf076560a6087eb4195f536f9c3053e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 06:47:11 -0500 Subject: Updated change log --- CHANGES.txt | 366 +++++------------------------------------------------------- 1 file changed, 26 insertions(+), 340 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index fb5870700..25df5faf6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,29 @@ +Version 1.8.1 +(November xx, 2011 from https://github.com/Elgg/Elgg/tree/1.8) + + Enhancements: + * Completed styling of user validation admin page + * Adding rel=nofollow for non-trusted links + * Added direct icon loading for profile avatars in profile plugin + * Improved the structure of content views to make styling easier + * Updated version of jQuery to 1.6.4 + * Added basic support for icon size customization + * Added a toggle for gallery/list view in file plugin + * Added support for passing CSS classes to icon views + * Added support for non http URLs to Elgg's normalize functions + * Added better support for the 404 forward if a page handler does handle a request + + Bugfixes: + * Fixed autocomplete and userpicker + * Fixed RSS and web service-related view types + * Fixed walled garden display issues + * Added work around for IE/TinyMCE/embed insert problem + * Implemented ElggUser.isAdmin() JavaScript method + * Fixed the date views and JavaScript datepicker + * Fixed horizontal radio buttons styling + * Modules only display header if there is content for it + + Version 1.8.1b (October 11, 2011 from git://github.com/Elgg/Elgg.git) @@ -152,343 +178,3 @@ Version 1.8.0 (Jackie) Elgg 1.8.0.1 was released immediately after 1.8.0 to correct a problem in installation. - - -Previous and Merged Changes: - -Version 1.7.11 -(August 15, 2011 from http://github.com/Elgg/elgg) - - Security Enhancements: - * Fixed possible XSS vector in the embed plugin. Thanks to Aung Khant from YEHG for the report. - * Fixed possible SQL exposure exploit in the search plugin. Thanks again to Aung Khant. - * Fixed possible SQL injection vector in the search plugin. Thanks to Lostmon Lords for the report. - - Bugfixes: - * Filtering by content works in the dashboard again. - * Dragging widgets works in IE9. - - API Changes: - * Deleting a container will delete all contained objects regardless of access_id. - * setLocation() and setLatLong() no longer double escapes strings. - * Calling elgg_list_entities() with count set no longer breaks the display. - - -Version 1.7.10 -(June 14, 2011 from http://code.elgg.org/branches/1.7) - - Security Enhancements: - * Changes to prevent numerous reflected cross site scripting vectors. Thanks to Aung Khant for - the reports! - - Enhancements: - * Banned users are more apparent in user lists and profiles. - - Bugfixes: - * TinyMCE: Using Elgg's default font to prevent small font sizes. - * Files: Optimizations to allow uploading and downloading larger files. - * Fixed bugs preventing users from adding and removing friends in Friends Collections. - * $CONFIG->lastcache is correctly set for pages that regenerate the cache. - - API Changes: - * Added unit tests for access collections. - * Added can_edit_access_collection(). - * Access collection functions no longer check permissions. Do this in actions instead. - - -Version 1.7.9 -(June 1, 2011 from http://code.elgg.org/branches/1.7) - - Security Enhancements: - * Blocking possible access to restricted pages if headers are output too early. Thanks to Vazco - for reporting! - - Bugfixes: - * Admins can delete Pages again. - * TinyMCE upgraded to 3.4.2 to fix IE support. - * Autocomplete input works correctly. - * Fixed Message Board "all" posts. - * Fixed deleting internal messages on some non-English sites. - * Better feedback if an error occurs when saving widgets. - * Messages from deleted users no longer show the recipient's avatar. - * Https logins on fully https sites work correctly. - - API Changes: - * Added "creating", "river" plugin hook. - * User metadata is registered as independent higher in the boot sequence. - * Group ACLs are updated correctly when joining a non-logged in user to a group. - * Can return 0 for plugin hook 'comments', 'count'. - - -Version 1.7.8 -(April 4, 2011 from http://code.elgg.org/branches/1.7) - - Security Enhancements: - * Properly encoding search queries (Thanks to lord epsylon (of Lorea) for the report!) - - Bugfixes: - * Blogs - Fixed disappearing blog draft issue. - * Groups - Editing a topic from discussion list page works now. - * Search - Group names used in titles. - * InviteFriends - Invitation link no longer shows up when logged out. - * Messages - Denormalized the message calculation for better performance. - * Sorting by time_created in relationship functions supported. - * Metadata and annotation names can now be updated. - * Fixed error with deleting a user with disabled entities. - * Removed unnecessary executable permissions on a number of files. (Thanks to - pauloortiz for the report!) - - API Changes: - * Added delete_submenu_item() for removing sidebar menu items. - - -Version 1.7.7 -(January 31, 2011 from http://code.elgg.org/branches/1.7) - - Security Enhancements: - * Only admins can view the unvalidated users page (Thanks to Manacim - Medriano for the report!) - - Bugfixes: - * Fixed deprecation notices for locales that use comma as radix point. - * Groups - Files can be completely disabled per group. - * Pages - Deleting and creating subpages is restricted to owner or group member. - * Groups - group icons deleted when group is deleted. - * Pagination will not display when all content id displayed. - * Fixed issue with get_context() when trailing slash is missing. - - API Changes: - * Added $CONFIG->action_token_timeout. - * Added callback option to elgg_get_entities(). - - -Version 1.7.6 -(December 23, 2010 from http://code.elgg.org/branches/1.7) - - Security Enhancements: - * Fixed a possible SQL injection attack when using a crafted - URL. Thanks to Gerrit Venema from Gol Gol (golgol.nl) for - the report. - - Bugfixes: - * Pages - Fixed "All Pages" link on "All Site Pages" page. - * Messages - Fixed invalid URLs when using old-style - pg/messages/ links. - * Messages - Fixed redirect after deleting a message. - - API Changes: - * Added get_entities_from_access_collection() and deprecated it. - * is_registered_entity_type() returns correctly when requesting - just a type and not a subtype. - - -Version 1.7.5 -(November 26, 2010 from http://code.elgg.org/branches/1.7) - - Security Enhancements: - * Fixed a security flaw in the Bookmarks plugin that could - allow an XSS attack using crafted URLs. Thanks to Akhilesh - Gupta for the bug report. - * Fixed a security flaw in the widgets system that could allow - an XSS attack using crafted URLs. - - Bugfixes: - * Checking for mismatched passwords before creating user when - manually adding users. - * 'large' size profile icons created when cropped. - * Fixed menu entry for user's files link. - * Fixed caching issues with plugin-added view types. - * Fixed XFN links on profile page and user lists. - * Fixed PHP warnings about invalid foreaches in plugins.php - * Fixed problems in elgg_get_entities_*() when using an array - for owner_guid. - * Group profile edit action correctly encodes and saves array input. - * Language string corrections. - - UI/UX Changes: - * Users must verify their current password before they can changing - passwords. - * Using pagehandlers instead of mod/mod_name/ calls in Blogs, - Bookmarks, Members, Pages, The Wire, Groups, Invite Friends, - and Messages. - * Added a page to view Wire posts by user. - - API Changes: - * Added remove_group_tool_option(). - * Wrapped Twitter Service's vendor's oAuth lib in class_exists(). - * Added elgg_list_entities_from_relationship(). - * Exposed order_by param in list_entities_from_relationship(). - * Added a default annotation view. - - -Version 1.7.4 -(October 14, 2010 from http://code.elgg.org/branches/1.7) - - Bugfixes: - * Upgrade Twitter Services to use oAuth so The Wire can post - to Twitter. See http://el.gg/twitteroauth for instructions. - * WSOD fixed when viewing an invalid profile page. - * Checking for mismatched passwords earlier in registration to avoid - creating a user who can never log in and wasting a username/email. - * POST data in the web services API is correctly quoted on servers - with magic quotes enabled. - * WSOD fixed when trying to update an invalid entity. - * Group file widget only shows when Files are enabled for the group. - * Fixed misformatting of some group forum posts in the River. - * Fixed resizing tall non-square images. - * Non-English languages work when using memcache. - * User avatar menus work when switching filters on River Dashboard page. - * CSS is correctly cached for newly enabled plugins. - * Can no longer add bookmarks without a title. Previous bookmarks with - out titles can now be deleted. - - UI/UX Changes: - * Pages: Admin users can edit user-defined "Welcome page." - * Pages: Group "Welcome page" can be edited. - * User Validation: Added an admin section for unvalidated users. An - admin user can resend validation request, validate, or delete - unvalidated users. - - API Changes: - * test_ip() removed. - * is_ip_in_range() removed. - * Read/write DB connections can use different credentials. - * Twitter services plugin allows other plugins to tweet - if the user authorizes them. See twitterservice/README.txt - - -Version 1.7.3 -(September 2, 2010 from http://code.elgg.org/branches/1.7) - - Security enhancements: - * Fixed a security flaw that allowed an SQL injection attack - using crafted POSTs. Thanks to Georg-Christian Pranschke of - www.sensepost.com for the bug report. - - UI/UX Changes: - * Entering an invalid captcha now forwards to referring page. - - Bugfixes: - * Multiple owners support fixed for legacy get_entity*() functions. - * "Edit details" and "Edit profile icon" only show up for user's own - profile. - * get_objects_in_group() works correctly. - - -Version 1.7.2 -(August 18, 2010 from http://code.elgg.org/elgg/branches/1.7) - - UI Changes: - * Group "widgets" have been standardized with new blog and bookmark widgets. - * New group member listing page. - * Group forum topics can be edited including title and status. - * Added a group creation river entry. - - Bugfixes: - * Fixed preview and draft saving for blog plugin. - * Page titles are now editable. - * Fixed several bugs with the new elgg_get* and elgg_list* functions. - * Groups do not show up as personal friend collections anymore. - * Fixed an upgrade issue with utf8 usernames. - * Encoding of & in group forums is fixed. - - API changes: - * Added elgg_list_entities_from_metadata(). - * Added elgg_send_email(). - * Added remove_from_river_by_id(). - * Added remove_from_register() for removing menu items. - * Added elgg_get_excerpt(). - * Added elgg_get_friendly_title() and elgg_get_friendly_time(). - - -Version 1.7.1 -(April 21, 2010 from http://code.elgg.org/elgg/branches/1.7) - - UI changes: - * (Unused) tags field removed from external pages. - * Languages fixes in groups. - * Installation checks database settings before writing settings.php. - * Made the widgets more consistent in their UI. - - Bugfixes: - * Pagination fixed. - * Profile icons fixed for PHP-CGI users who were seeing incorrect avatars. - * Tag search works in groups and members. - * Tag clouds correctly link to tag search. - * RSS views added to search. - * Wrapper function for get_entities() correctly rewrites container_guid to - owner_guid. - * output/url correctly appends http:// again. - * full_url() urlencode()'s ' and " to avoid a security problem in IE. - - API changes: - * Moved admin flag to users_entity table and added ElggUser->isAdmin(), - ->makeAdmin(), and ->removeAdmin() to replace the metadata. - * Plugin hook for reported content includes the report object. - * UTF8 upgrade checks server defaults before running to avoid - corrupted strings. - * Tags lib updated to elgg_get_*() interface. - * Can get entities based upon annotation/metadata owner_guid. - * Moved friendly time and friendly title into overridable views. - * Added unregister_notification_handler(). - * Added remove_widget_type(). - * Search supports container_guid. - - -Version 1.7.0 -(March 2, 2010 from http://code.elgg.org/elgg/trunk/) - - User-visible changes: - * UTF8 now saved correctly in database. #1151 - * Unit tests added to System diagnostics. - * Debug values output to screen when enabled in admin settings. - * Users can now log in from multiple computers or browsers concurrently. - * Misconfigured plugins no longer break the site. #1454 - * User display names cannot have HTML or be longer than 50 characters. - * New search system. - - Bugfixes: - * Searching by tag with extended characters now works. #1151, #1231 - * Searching for entities works properly with case-insensitive metadata. #1326 - * Invalid views now default to 'default' view. #1161. - * Metadata cache now handles a 0 string. #1227 - * ElggPlugin get() now works with 0. #1286 - * Metadata __isset() now works for falsy values (except NULL). #1414 - * clear_plugin_setting() now only clears a single setting. - * Submenu entries are correctly calculated after a simplecache refresh. - - API changes: - * New plugin hook system:unit_test for adding files to unit tests. - * $is_admin global deprecated; use elgg_set_ignore_access() instead. - * Deprecated get_entities(). Use elgg_get_entities(). - * Deprecated get_entities_from_metadata(). Use elgg_get_entities_from_metadata(). - * Deprecated get_entities_from_relationship() and g_e_f_relationships_and_meta(). Use elgg_get_entities_from_relationship(). - * Deprecated get_entities_from_access_id(). Use elgg_get_entities_from_access_id(). - * Deprecated get_entities_from_annotations(). Use elgg_get_entities_from_annotations(). - * Reorganized directory file path to rely on GUID instead of username. - * annotation_id column added to the river database table. - * remove_from_river_by_annotation() added. - * unregister_elgg_event_handler() and unregister_plugin_hook() added. #1465 - * clear_all_plugin_settings() added. - * get_entity_relationships() supports inverse relationships. #1472. - * can_write_to_container() can be overridden with the container_permissions_check hook. #1164 (part 2). - * Deprecated search_for_*(). - * Deprecated search_list*(). - * Added elgg_deprecated_notice(). - * ElggEntity::countEntitiesFromRelationship() supports inverse relationships. #1325 - * delete_relationship() triggers the hook delete:relationship and passes the relationship object. #1213 - * added ElggEntity::removeRelationship(). #1376. - * get_entity_dates() supports order by. #1406. - * Added elgg_http_add_url_query_elements(). - * Added elgg_register_tag_metadata_name() and elgg_get_registered_tag_metadata_names(); - * Added ElggEntity::getTags(). - * Added elgg_add_action_tokens_to_url(). - - Services API: - * Separated user and api authenticate processing - * hmac signature encoding now compatible with OAuth - * New plugin hook api_key:use for keeping stats on key usage - * New plugin hook rest:init so plugins can configure authentication modules - * Moved auth.gettoken to POST for increased security - * Fixed REST POST bug #1114 - * Fixed #881, #1214, #1215, #1216, #1217, #1218, #1219, #1220, #1298, #1364 -- cgit v1.2.3 From 0523e5ac2541a84b9538d0366f86b8dd83a6de1c Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 07:34:38 -0500 Subject: removing deprecated functions from custom_index plugin --- mod/custom_index/start.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/custom_index/start.php b/mod/custom_index/start.php index 857798798..48d03f27b 100644 --- a/mod/custom_index/start.php +++ b/mod/custom_index/start.php @@ -4,7 +4,7 @@ * */ -register_elgg_event_handler('init', 'system', 'custom_index_init'); +elgg_register_event_handler('init', 'system', 'custom_index_init'); function custom_index_init() { @@ -12,7 +12,7 @@ function custom_index_init() { elgg_extend_view('css/elgg', 'custom_index/css'); // Replace the default index page - register_plugin_hook('index', 'system', 'custom_index'); + elgg_register_plugin_hook_handler('index', 'system', 'custom_index'); } function custom_index($hook, $type, $return, $params) { -- cgit v1.2.3 From 3c0fe711be8f13cf7f46bfc667718f1ec3232db2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 07:40:52 -0500 Subject: fixed date on copyright and name of GPL --- README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index 0d4015238..3cffcc8c7 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,5 @@ Elgg -Copyright (c) 2008-2010 See COPYRIGHT.txt +Copyright (c) 2008-2011 See COPYRIGHT.txt See CONTRIBUTORS.txt for development credits. @@ -15,7 +15,7 @@ The Elgg project was started in 2004 by: Ben Werdmuller and Dave Tosh -Elgg is released under the GNU Public License (GPL) Version 2 and the +Elgg is released under the GNU General Public License (GPL) Version 2 and the Massachusetts Institute of Technology (MIT) License. See LICENSE.txt in the root of the package you downloaded. -- cgit v1.2.3 From c8f62956115245d023c5f049524e450f3fbcd5d6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 20:31:07 -0500 Subject: Refs #4007 previous solution to admin population in ElggUser was throwing warnings --- engine/classes/ElggUser.php | 1 - views/default/js/initialize_elgg.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php index 51440687d..75ac008f6 100644 --- a/engine/classes/ElggUser.php +++ b/engine/classes/ElggUser.php @@ -526,7 +526,6 @@ class ElggUser extends ElggEntity 'name', 'username', 'language', - 'admin', )); } diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index 09e0b27bc..f8234f84f 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -41,6 +41,7 @@ if ($user instanceof ElggUser) { $user_json['subtype'] = $user->getSubtype(); $user_json['url'] = $user->getURL(); + $user_json['admin'] = $user->isAdmin(); echo 'elgg.session.user = new elgg.ElggUser(' . json_encode($user_json) . ');'; } -- cgit v1.2.3 From 42e3a3353eb524fc984f72e2b525d5597444d1aa Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 8 Nov 2011 06:28:14 -0500 Subject: Refs #3150 can pass description to RSS page shell --- views/rss/page/default.php | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/views/rss/page/default.php b/views/rss/page/default.php index 246ec972e..c973e3fd0 100644 --- a/views/rss/page/default.php +++ b/views/rss/page/default.php @@ -2,17 +2,13 @@ /** * Elgg RSS output pageshell * - * @package Elgg - * @subpackage Core + * @package Elgg.Core + * + * @uses $vars['title'] The title of the RSS feed + * @uses $vars['body'] The items for the RSS feed as a string + * @uses $vars['descrption'] The description for the RSS feed */ -header("Content-Type: text/xml"); - -// allow caching as required by stupid MS products for https feeds. -header('Pragma: public', TRUE); - -echo ""; - // Set title if (empty($vars['title'])) { $title = elgg_get_config('sitename'); @@ -23,17 +19,28 @@ if (empty($vars['title'])) { // Remove RSS from URL $url = str_replace('?view=rss', '', full_url()); $url = str_replace('&view=rss', '', $url); +$url = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8'); -?> +$body = elgg_extract('body', $vars, ''); +$description = elgg_extract('description', $vars, ''); - > +$namespaces = elgg_view('extensions/xmlns'); +$extensions = elgg_view('extensions/channel'); + + +// allow caching as required by stupid MS products for https feeds. +header('Pragma: public', true); +header("Content-Type: text/xml"); + +echo ""; +echo << - <![CDATA[<?php echo $title; ?>]]> - - - + <![CDATA[$title]]> + $url + + $extensions + $body +END; -- cgit v1.2.3 From 1c0bda3d9868cf62788eaf88317af35326e0b4e7 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 8 Nov 2011 06:45:18 -0500 Subject: it is GPL General Public License not GPL Public License --- .../examples/plugins/manifest_options/manifest.xml | 4 ++-- documentation/examples/plugins/skeleton/manifest.xml | 2 +- engine/tests/api/plugins.php | 16 ++++++++-------- engine/tests/test_files/plugin_17/manifest.xml | 4 ++-- engine/tests/test_files/plugin_18/manifest.xml | 4 ++-- mod/blog/manifest.xml | 2 +- mod/bookmarks/manifest.xml | 2 +- mod/categories/manifest.xml | 2 +- mod/custom_index/manifest.xml | 2 +- mod/dashboard/manifest.xml | 2 +- mod/developers/manifest.xml | 2 +- mod/diagnostics/manifest.xml | 2 +- mod/embed/manifest.xml | 2 +- mod/externalpages/manifest.xml | 2 +- mod/file/manifest.xml | 2 +- mod/garbagecollector/manifest.xml | 2 +- mod/groups/manifest.xml | 2 +- mod/htmlawed/manifest.xml | 2 +- mod/invitefriends/manifest.xml | 2 +- mod/likes/manifest.xml | 2 +- mod/logbrowser/manifest.xml | 2 +- mod/logrotate/manifest.xml | 2 +- mod/members/manifest.xml | 2 +- mod/messageboard/manifest.xml | 2 +- mod/messages/manifest.xml | 2 +- mod/notifications/manifest.xml | 2 +- mod/oauth_api/manifest.xml | 2 +- mod/pages/manifest.xml | 2 +- mod/profile/manifest.xml | 2 +- mod/reportedcontent/manifest.xml | 2 +- mod/search/manifest.xml | 2 +- mod/tagcloud/manifest.xml | 2 +- mod/thewire/manifest.xml | 2 +- mod/tinymce/manifest.xml | 2 +- mod/twitter/manifest.xml | 2 +- mod/twitter_api/manifest.xml | 2 +- mod/uservalidationbyemail/manifest.xml | 2 +- mod/zaudio/manifest.xml | 2 +- 38 files changed, 48 insertions(+), 48 deletions(-) diff --git a/documentation/examples/plugins/manifest_options/manifest.xml b/documentation/examples/plugins/manifest_options/manifest.xml index 48a5a9558..baa6cc3fa 100644 --- a/documentation/examples/plugins/manifest_options/manifest.xml +++ b/documentation/examples/plugins/manifest_options/manifest.xml @@ -6,8 +6,8 @@ A concise description. This is a longer, more interesting description of my plugin, its features, and other important information. http://www.elgg.org/ - (C) Elgg 2010 - GNU Public License version 2 + (C) Elgg 2011 + GNU General Public License version 2 elgg_version diff --git a/documentation/examples/plugins/skeleton/manifest.xml b/documentation/examples/plugins/skeleton/manifest.xml index febe71999..e31624432 100644 --- a/documentation/examples/plugins/skeleton/manifest.xml +++ b/documentation/examples/plugins/skeleton/manifest.xml @@ -6,7 +6,7 @@ This is a description of my plugin and its features. http://www.elgg.org/ (C) My Name or Company 2012 - GNU Public License version 2 + GNU General Public License version 2 elgg_release diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 8f5f5dd1e..a0faaff0e 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -68,8 +68,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { 'blurb' => 'A concise description.', 'description' => 'A longer, more interesting description.', 'website' => 'http://www.elgg.org/', - 'copyright' => '(C) Elgg 2010', - 'license' => 'GNU Public License version 2', + 'copyright' => '(C) Elgg Foundation 2011', + 'license' => 'GNU General Public License version 2', 'requires' => array( array('type' => 'elgg_version', 'version' => '3009030802', 'comparison' => 'lt'), @@ -117,8 +117,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { 'version' => '1.0', 'description' => 'A 1.7-style manifest.', 'website' => 'http://www.elgg.org/', - 'copyright' => '(C) Elgg 2010', - 'license' => 'GNU Public License version 2', + 'copyright' => '(C) Elgg Foundation 2011', + 'license' => 'GNU General Public License version 2', 'elgg_version' => '2009030702', 'name' => 'Plugin Test 17', ); @@ -165,13 +165,13 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { } public function testElggPluginManifestGetCopyright() { - $this->assertEqual($this->manifest18->getCopyright(), '(C) Elgg 2010'); - $this->assertEqual($this->manifest18->getCopyright(), '(C) Elgg 2010'); + $this->assertEqual($this->manifest18->getCopyright(), '(C) Elgg Foundation 2011'); + $this->assertEqual($this->manifest18->getCopyright(), '(C) Elgg Foundation 2011'); } public function testElggPluginManifestGetLicense() { - $this->assertEqual($this->manifest18->getLicense(), 'GNU Public License version 2'); - $this->assertEqual($this->manifest17->getLicense(), 'GNU Public License version 2'); + $this->assertEqual($this->manifest18->getLicense(), 'GNU General Public License version 2'); + $this->assertEqual($this->manifest17->getLicense(), 'GNU General Public License version 2'); } diff --git a/engine/tests/test_files/plugin_17/manifest.xml b/engine/tests/test_files/plugin_17/manifest.xml index bb178ab93..706734265 100644 --- a/engine/tests/test_files/plugin_17/manifest.xml +++ b/engine/tests/test_files/plugin_17/manifest.xml @@ -4,7 +4,7 @@ - - + + \ No newline at end of file diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml index 445a41c2e..e0776ffc1 100644 --- a/engine/tests/test_files/plugin_18/manifest.xml +++ b/engine/tests/test_files/plugin_18/manifest.xml @@ -6,8 +6,8 @@ A concise description. A longer, more interesting description. http://www.elgg.org/ - (C) Elgg 2010 - GNU Public License version 2 + (C) Elgg Foundation 2011 + GNU General Public License version 2 elgg_version diff --git a/mod/blog/manifest.xml b/mod/blog/manifest.xml index bd5f9c396..29ee1bfc8 100644 --- a/mod/blog/manifest.xml +++ b/mod/blog/manifest.xml @@ -10,7 +10,7 @@ Adds simple blogging capabilities to your Elgg installation. http://elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/bookmarks/manifest.xml b/mod/bookmarks/manifest.xml index 679d3f1d8..b95af87f8 100644 --- a/mod/bookmarks/manifest.xml +++ b/mod/bookmarks/manifest.xml @@ -10,7 +10,7 @@ Adds the ability for users to bookmark internal and external sites. Other users can then comment on the bookmarks. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/categories/manifest.xml b/mod/categories/manifest.xml index a2f4d97fc..4a6bd0864 100644 --- a/mod/categories/manifest.xml +++ b/mod/categories/manifest.xml @@ -9,7 +9,7 @@ Site-wide Categories lets administrators define categories that users across the site can add content to. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/custom_index/manifest.xml b/mod/custom_index/manifest.xml index f93251214..80187efbc 100644 --- a/mod/custom_index/manifest.xml +++ b/mod/custom_index/manifest.xml @@ -7,7 +7,7 @@ A demonstration of how to create a front page plugin. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/dashboard/manifest.xml b/mod/dashboard/manifest.xml index 14a620268..cbbc1044c 100644 --- a/mod/dashboard/manifest.xml +++ b/mod/dashboard/manifest.xml @@ -7,7 +7,7 @@ A widget-based dashboard for your users http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/developers/manifest.xml b/mod/developers/manifest.xml index 6b672e231..93a12945d 100644 --- a/mod/developers/manifest.xml +++ b/mod/developers/manifest.xml @@ -9,7 +9,7 @@ A set of tools for writing plugins and themes. It is recommended that you have this plugin at the top of the plugin list. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release diff --git a/mod/diagnostics/manifest.xml b/mod/diagnostics/manifest.xml index a9034d695..21e847d22 100644 --- a/mod/diagnostics/manifest.xml +++ b/mod/diagnostics/manifest.xml @@ -9,7 +9,7 @@ Elgg diagnostics tool http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml index c33c8b40a..7ffbc23a4 100644 --- a/mod/embed/manifest.xml +++ b/mod/embed/manifest.xml @@ -8,7 +8,7 @@ Allows users to easily upload and embed media into text areas. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/externalpages/manifest.xml b/mod/externalpages/manifest.xml index 389ad6960..f2aef09f3 100644 --- a/mod/externalpages/manifest.xml +++ b/mod/externalpages/manifest.xml @@ -7,7 +7,7 @@ Create simple web pages for about, contact, privacy, and terms. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/file/manifest.xml b/mod/file/manifest.xml index 85ff76b41..26282a8e3 100644 --- a/mod/file/manifest.xml +++ b/mod/file/manifest.xml @@ -9,7 +9,7 @@ File browser plugin http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/garbagecollector/manifest.xml b/mod/garbagecollector/manifest.xml index 1cbf33592..5aafebf38 100644 --- a/mod/garbagecollector/manifest.xml +++ b/mod/garbagecollector/manifest.xml @@ -8,7 +8,7 @@ Perform some database cleanup tasks http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/groups/manifest.xml b/mod/groups/manifest.xml index b8fd92de7..fd28360d0 100644 --- a/mod/groups/manifest.xml +++ b/mod/groups/manifest.xml @@ -9,7 +9,7 @@ Provides group support for elgg http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/htmlawed/manifest.xml b/mod/htmlawed/manifest.xml index aac599dee..5c1f14cb5 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 Public License version 3 + GNU General Public License version 3 elgg_release 1.8 diff --git a/mod/invitefriends/manifest.xml b/mod/invitefriends/manifest.xml index 0a1ed2012..b36238a05 100644 --- a/mod/invitefriends/manifest.xml +++ b/mod/invitefriends/manifest.xml @@ -8,7 +8,7 @@ Invite friends via email invites. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/likes/manifest.xml b/mod/likes/manifest.xml index 5a18b8862..62835fcf5 100644 --- a/mod/likes/manifest.xml +++ b/mod/likes/manifest.xml @@ -8,7 +8,7 @@ Enables users to like content on the site. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/logbrowser/manifest.xml b/mod/logbrowser/manifest.xml index d3b76ee8c..4527e2cbb 100644 --- a/mod/logbrowser/manifest.xml +++ b/mod/logbrowser/manifest.xml @@ -8,7 +8,7 @@ Browse the system event log http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/logrotate/manifest.xml b/mod/logrotate/manifest.xml index db04e762f..1aa62e2e7 100644 --- a/mod/logrotate/manifest.xml +++ b/mod/logrotate/manifest.xml @@ -8,7 +8,7 @@ Rotate the system log at specific intervals http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/members/manifest.xml b/mod/members/manifest.xml index efd1ede5e..8b18c9f91 100644 --- a/mod/members/manifest.xml +++ b/mod/members/manifest.xml @@ -7,7 +7,7 @@ Lists the members of your site http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/messageboard/manifest.xml b/mod/messageboard/manifest.xml index b4f74c7d0..617813725 100644 --- a/mod/messageboard/manifest.xml +++ b/mod/messageboard/manifest.xml @@ -8,7 +8,7 @@ This plugin allows users to put a message board on their profile for other users to post comments. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml index 238ccf42b..73a58d9d4 100644 --- a/mod/messages/manifest.xml +++ b/mod/messages/manifest.xml @@ -8,7 +8,7 @@ Elgg internal messages plugin. This plugin lets user send each other messages. See COPYRIGHT.txt http://www.elgg.org/ - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/notifications/manifest.xml b/mod/notifications/manifest.xml index a07486331..205476881 100644 --- a/mod/notifications/manifest.xml +++ b/mod/notifications/manifest.xml @@ -7,7 +7,7 @@ Elgg notifications plugin http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/oauth_api/manifest.xml b/mod/oauth_api/manifest.xml index 62111e258..efd3d944f 100644 --- a/mod/oauth_api/manifest.xml +++ b/mod/oauth_api/manifest.xml @@ -8,7 +8,7 @@ api http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/pages/manifest.xml b/mod/pages/manifest.xml index dfc521e11..6990bd6b0 100644 --- a/mod/pages/manifest.xml +++ b/mod/pages/manifest.xml @@ -9,7 +9,7 @@ Elgg Pages http://www.elgg.org See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/profile/manifest.xml b/mod/profile/manifest.xml index f56604c7e..86fbc7b7b 100644 --- a/mod/profile/manifest.xml +++ b/mod/profile/manifest.xml @@ -8,7 +8,7 @@ social http://elgg.org/ See COPYRIGHT.txt - GNU Public License Version 2 + GNU General Public License Version 2 true elgg_release diff --git a/mod/reportedcontent/manifest.xml b/mod/reportedcontent/manifest.xml index aea8f8114..e96620b01 100644 --- a/mod/reportedcontent/manifest.xml +++ b/mod/reportedcontent/manifest.xml @@ -7,7 +7,7 @@ Adds the option for users to report content and for admins to check it out. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/search/manifest.xml b/mod/search/manifest.xml index 9a952d3d8..513d3a6b9 100644 --- a/mod/search/manifest.xml +++ b/mod/search/manifest.xml @@ -7,7 +7,7 @@ Allow search across entities of the site http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/tagcloud/manifest.xml b/mod/tagcloud/manifest.xml index 1127e9559..c0f89f35e 100644 --- a/mod/tagcloud/manifest.xml +++ b/mod/tagcloud/manifest.xml @@ -8,7 +8,7 @@ Widget-based tag clouds. http://cashcostello.com/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/thewire/manifest.xml b/mod/thewire/manifest.xml index 9f6b0eaa9..962ed12f1 100644 --- a/mod/thewire/manifest.xml +++ b/mod/thewire/manifest.xml @@ -8,7 +8,7 @@ Microblogging for Elgg http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/tinymce/manifest.xml b/mod/tinymce/manifest.xml index ac7b23b29..61bf0c22c 100644 --- a/mod/tinymce/manifest.xml +++ b/mod/tinymce/manifest.xml @@ -8,7 +8,7 @@ TinyMCE plugin. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/twitter/manifest.xml b/mod/twitter/manifest.xml index 38380a2ba..18fa8c957 100644 --- a/mod/twitter/manifest.xml +++ b/mod/twitter/manifest.xml @@ -8,7 +8,7 @@ Elgg simple twitter widget http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/twitter_api/manifest.xml b/mod/twitter_api/manifest.xml index 51ad0dcb4..86bba4b50 100644 --- a/mod/twitter_api/manifest.xml +++ b/mod/twitter_api/manifest.xml @@ -8,7 +8,7 @@ bundled http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/uservalidationbyemail/manifest.xml b/mod/uservalidationbyemail/manifest.xml index 232ba71ca..800dd2641 100644 --- a/mod/uservalidationbyemail/manifest.xml +++ b/mod/uservalidationbyemail/manifest.xml @@ -8,7 +8,7 @@ Simple user account validation via email. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 diff --git a/mod/zaudio/manifest.xml b/mod/zaudio/manifest.xml index 767637a56..54f819658 100644 --- a/mod/zaudio/manifest.xml +++ b/mod/zaudio/manifest.xml @@ -9,7 +9,7 @@ This simple plugin lets users play mp3's in the page. http://www.elgg.org/ See COPYRIGHT.txt - GNU Public License version 2 + GNU General Public License version 2 elgg_release 1.8 -- cgit v1.2.3 From e084cfccb4804f6105d00e1757bc463a5c782ed2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 8 Nov 2011 07:06:08 -0500 Subject: we rewrote default widgets from scratch so updated copyright/contributors to reflect that --- CONTRIBUTORS.txt | 2 -- COPYRIGHT.txt | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 75eb016c2..0163757e7 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -8,8 +8,6 @@ Pete Harris - http://www.peteharris.co.uk/ Kevin Jardine - http://radagast.biz/ -Milan Magudia - http://hedgehogs.net/ - Jon Maul - MITRE http://www.mitre.org/ Marcus Povey - http://marcuspovey.co.uk/ diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index ac653594c..76781f25a 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -3,8 +3,7 @@ code to the Elgg project and share the copyright. (In alphabetical order.) Organizations: The MITRE Corportation (jricher@mitre.org) -Curverider Ltd (richard@elgg.com) -Hedgehogs (http://hedgehogs.net/) +Curverider Ltd (info@elgg.com) Individuals: Cash Costello (cash.costello@gmail.com) -- cgit v1.2.3 From 2d43e8efdfa4e8281450e683e392091fe4dadf06 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 8 Nov 2011 07:17:59 -0500 Subject: exclamation marks are annoying in notifications --- mod/likes/languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/likes/languages/en.php b/mod/likes/languages/en.php index 29b379506..4a98d7cfe 100644 --- a/mod/likes/languages/en.php +++ b/mod/likes/languages/en.php @@ -25,7 +25,7 @@ $english = array( 'likes:notifications:body' => 'Hi %1$s, -%2$s likes your post "%3$s" on %4$s! +%2$s likes your post "%3$s" on %4$s See your original post here: -- cgit v1.2.3 From 8cf115081e7a168eb3f3c74b279dac7f4e258287 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 10 Nov 2011 21:24:47 -0500 Subject: Fixes #4010 not sending naked query strings into add ajax tokens and also fixed a few related bugs in JavaScript --- js/lib/ajax.js | 6 +++- js/lib/elgglib.js | 68 +++++++++----------------------------------- js/lib/security.js | 18 ++++++------ js/tests/ElggLibTest.js | 22 ++++++++++++++ js/tests/ElggSecurityTest.js | 40 ++++++++++++++++++++------ 5 files changed, 82 insertions(+), 72 deletions(-) diff --git a/js/lib/ajax.js b/js/lib/ajax.js index 6f6ae052f..b3f39cc42 100644 --- a/js/lib/ajax.js +++ b/js/lib/ajax.js @@ -187,7 +187,11 @@ elgg.action = function(action, options) { options = elgg.ajax.handleOptions(action, options); - options.data = elgg.security.addToken(options.data); + // This is a misuse of elgg.security.addToken() because it is not always a + // full query string with a ?. As such we need a special check for the tokens. + if (!elgg.isString(options.data) || options.data.indexOf('__elgg_ts') == -1) { + options.data = elgg.security.addToken(options.data); + } options.dataType = 'json'; //Always display system messages after actions diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js index ca7914e7c..81209ebd0 100644 --- a/js/lib/elgglib.js +++ b/js/lib/elgglib.js @@ -410,16 +410,6 @@ elgg.parse_url = function(url, component, expand) { // fragment + '(?:#(.*))?)', keys = { - 'mailto': { - 4: "scheme", - 5: "user", - 6: "host", - 9: "path", - 12: "query", - 13: "fragment" - }, - - 'standard': { 1: "scheme", 4: "user", 5: "pass", @@ -428,58 +418,28 @@ elgg.parse_url = function(url, component, expand) { 9: "path", 12: "query", 13: "fragment" - } }, - results = {}, - match_keys, - is_mailto = false; + results = {}; - var re = new RegExp(re_str); - var matches = re.exec(url); - - // if the scheme field is undefined it means we're using a protocol - // without :// and an @. Feel free to fix this in the re if you can >:O - if (matches[1] == undefined) { - match_keys = keys['mailto']; - is_mailto = true; - } else { - match_keys = keys['standard']; + if (url.indexOf('mailto:') === 0) { + results['scheme'] = 'mailto'; + results['path'] = url.replace('mailto:', ''); + return results; } - for (var i in match_keys) { - if (matches[i]) { - results[match_keys[i]] = matches[i]; - } + if (url.indexOf('javascript:') === 0) { + results['scheme'] = 'javascript'; + results['path'] = url.replace('javascript:', ''); + return results; } - // merge everything to path if not standard - if (is_mailto) { - var path = '', - new_results = {}; - - if (typeof(results['user']) != 'undefined' && typeof(results['host']) != 'undefined') { - path = results['user'] + '@' + results['host']; - delete results['user']; - delete results['host']; - } else if (typeof(results['user'])) { - path = results['user']; - delete results['user']; - } else if (typeof(results['host'])) { - path = results['host']; - delete results['host']; - } - - if (typeof(results['path']) != 'undefined') { - results['path'] = path + results['path']; - } else { - results['path'] = path; - } + var re = new RegExp(re_str); + var matches = re.exec(url); - for (var prop in results) { - new_results[prop] = results[prop]; + for (var i in keys) { + if (matches[i]) { + results[keys[i]] = matches[i]; } - - results = new_results; } if (expand && typeof(results['query']) != 'undefined') { diff --git a/js/lib/security.js b/js/lib/security.js index 726c6b767..61aa1cfcd 100644 --- a/js/lib/security.js +++ b/js/lib/security.js @@ -60,7 +60,7 @@ elgg.security.refreshToken = function() { /** - * Add elgg action tokens to an object, URL, or query string. + * Add elgg action tokens to an object, URL, or query string (with a ?). * * @param {Object|string} data * @return {Object} The new data object including action tokens @@ -75,17 +75,17 @@ elgg.security.addToken = function(data) { args = {}, base = ''; - if (parts['host'] == data) { - if (data.indexOf('=') > -1) { + if (parts['host'] == undefined) { + if (data.indexOf('?') === 0) { // query string - args = elgg.parse_str(data); - } else { - // relative URL - base = data + '?'; + base = '?'; + args = elgg.parse_str(parts['query']); } } else { - // a URL - if (typeof parts['query'] != 'undefined') { + // full or relative URL + + if (parts['query'] != undefined) { + // with query string args = elgg.parse_str(parts['query']); } var split = data.split('?'); diff --git a/js/tests/ElggLibTest.js b/js/tests/ElggLibTest.js index c53c6331d..a29ebf743 100644 --- a/js/tests/ElggLibTest.js +++ b/js/tests/ElggLibTest.js @@ -105,3 +105,25 @@ ElggLibTest.prototype.testNormalizeUrl = function() { assertEquals(args[1], elgg.normalize_url(args[0])); }); }; + +ElggLibTest.prototype.testParseUrl = function() { + + [ + ["http://www.elgg.org/test/", {'scheme': 'http', 'host': 'www.elgg.org', 'path': '/test/'}], + ["https://www.elgg.org/test/", {'scheme': 'https', 'host': 'www.elgg.org', 'path': '/test/'}], + ["ftp://www.elgg.org/test/", {'scheme': 'ftp', 'host': 'www.elgg.org', 'path': '/test/'}], + ["http://elgg.org/test?val1=one&val2=two", {'scheme': 'http', 'host': 'elgg.org', 'path': '/test', 'query': 'val1=one&val2=two'}], + ["http://elgg.org:8080/", {'scheme': 'http', 'host': 'elgg.org', 'port': 8080, 'path': '/'}], + ["http://elgg.org/test#there", {'scheme': 'http', 'host': 'elgg.org', 'path': '/test', 'fragment': 'there'}], + + ["test?val=one", {'host': 'test', 'query': 'val=one'}], + ["?val=one", {'query': 'val=one'}], + + ["mailto:joe@elgg.org", {'scheme': 'mailto', 'path': 'joe@elgg.org'}], + ["javascript:load()", {'scheme': 'javascript', 'path': 'load()'}] + + ].forEach(function(args) { + assertEquals(args[1], elgg.parse_url(args[0])); + }); +}; + diff --git a/js/tests/ElggSecurityTest.js b/js/tests/ElggSecurityTest.js index c7309d55f..107c0adbd 100644 --- a/js/tests/ElggSecurityTest.js +++ b/js/tests/ElggSecurityTest.js @@ -26,16 +26,42 @@ ElggSecurityTest.prototype.testAddTokenAcceptsObject = function() { assertEquals(expected, elgg.security.addToken(input)); }; -ElggSecurityTest.prototype.testAddTokenAcceptsString = function() { +ElggSecurityTest.prototype.testAddTokenAcceptsRelativeUrl = function() { var input, str = "__elgg_ts=" + this.ts + "&__elgg_token=" + this.token; - - input = ""; - assertEquals('?' + str, elgg.security.addToken(input)); - + + input = "test"; + assertEquals(input + '?' + str, elgg.security.addToken(input)); +}; + +ElggSecurityTest.prototype.testAddTokenAcceptsFullUrl = function() { + var input, + str = "__elgg_ts=" + this.ts + "&__elgg_token=" + this.token; + + input = "http://elgg.org/"; + assertEquals(input + '?' + str, elgg.security.addToken(input)); +}; + +ElggSecurityTest.prototype.testAddTokenAcceptsQueryString = function() { + var input, + str = "__elgg_ts=" + this.ts + "&__elgg_token=" + this.token; + input = "?data=sofar"; assertEquals(input + '&' + str, elgg.security.addToken(input)); - + + input = "test?data=sofar"; + assertEquals(input + '&' + str, elgg.security.addToken(input)); + + input = "http://elgg.org/?data=sofar"; + assertEquals(input + '&' + str, elgg.security.addToken(input)); +}; + +ElggSecurityTest.prototype.testAddTokenAlreadyAdded = function() { + var input, + str = "__elgg_ts=" + this.ts + "&__elgg_token=" + this.token; + + input = "http://elgg.org/?" + str + "&data=sofar"; + assertEquals(input, elgg.security.addToken(input)); }; ElggSecurityTest.prototype.testSetTokenSetsElggSecurityToken = function() { @@ -47,5 +73,3 @@ ElggSecurityTest.prototype.testSetTokenSetsElggSecurityToken = function() { elgg.security.setToken(json); assertEquals(json, elgg.security.token); }; - - -- cgit v1.2.3 From 8cca602e2bc1c65b99a2d0c2a60255ab09ca4f3d Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 10 Nov 2011 21:31:39 -0500 Subject: Fixes #4071 hellekin was right - it was a bad idea to format queries --- engine/lib/database.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/engine/lib/database.php b/engine/lib/database.php index ddfda8f4c..c44fdf1fd 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -400,8 +400,6 @@ function get_data_row($query, $callback = "") { function elgg_query_runner($query, $callback = null, $single = false) { global $CONFIG, $DB_QUERY_CACHE; - $query = elgg_format_query($query); - // Since we want to cache results of running the callback, we need to // need to namespace the query with the callback and single result request. // http://trac.elgg.org/ticket/4049 @@ -467,7 +465,6 @@ function elgg_query_runner($query, $callback = null, $single = false) { function insert_data($query) { global $CONFIG, $DB_QUERY_CACHE; - $query = elgg_format_query($query); elgg_log("DB query $query", 'NOTICE'); $dblink = get_db_link('write'); @@ -499,7 +496,6 @@ function insert_data($query) { function update_data($query) { global $CONFIG, $DB_QUERY_CACHE; - $query = elgg_format_query($query); elgg_log("DB query $query", 'NOTICE'); $dblink = get_db_link('write'); @@ -530,7 +526,6 @@ function update_data($query) { function delete_data($query) { global $CONFIG, $DB_QUERY_CACHE; - $query = elgg_format_query($query); elgg_log("DB query $query", 'NOTICE'); $dblink = get_db_link('write'); -- cgit v1.2.3 From ef23a0d09b76f7e78262d3428fd109cf82594537 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 10 Nov 2011 21:45:55 -0500 Subject: fixed WSOD when trying to edit a private page --- languages/en.php | 2 ++ mod/pages/pages/pages/edit.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/languages/en.php b/languages/en.php index 6aa292e5a..62effb334 100644 --- a/languages/en.php +++ b/languages/en.php @@ -237,6 +237,8 @@ $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.', + /** * API */ diff --git a/mod/pages/pages/pages/edit.php b/mod/pages/pages/pages/edit.php index 6f54d72bf..1f411b94d 100644 --- a/mod/pages/pages/pages/edit.php +++ b/mod/pages/pages/pages/edit.php @@ -10,12 +10,14 @@ gatekeeper(); $page_guid = (int)get_input('guid'); $page = get_entity($page_guid); if (!$page) { - + register_error(elgg_echo('noaccess')); + forward(''); } $container = $page->getContainerEntity(); if (!$container) { - + register_error(elgg_echo('noaccess')); + forward(''); } elgg_set_page_owner_guid($container->getGUID()); -- cgit v1.2.3 From 63c4e33687ba720003dcf2a83a0a66487ea583b7 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 09:02:16 -0500 Subject: removed deprecated function from messages plugin --- mod/messages/pages/messages/send.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/messages/pages/messages/send.php b/mod/messages/pages/messages/send.php index 1b821d185..8b0de6f9d 100644 --- a/mod/messages/pages/messages/send.php +++ b/mod/messages/pages/messages/send.php @@ -8,7 +8,7 @@ gatekeeper(); $page_owner = elgg_get_logged_in_user_entity(); -set_page_owner($page_owner->getGUID()); +elgg_set_page_owner_guid($page_owner->getGUID()); $title = elgg_echo('messages:add'); -- cgit v1.2.3 From d570fa64707367bf84746ccce50575052ff843db Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 09:02:59 -0500 Subject: added a input class for text boxes so that they aren't super long --- views/default/css/admin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/views/default/css/admin.php b/views/default/css/admin.php index fde34873d..9205e528a 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -443,6 +443,9 @@ textarea { .elgg-input-thin { width: 400px; } +.elgg-input-natural { + width: auto; +} .elgg-button { font-size: 14px; -- cgit v1.2.3 From 1674e174c49f365020f66dc778b133e30bc8177b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 09:36:47 -0500 Subject: fixed exception being thrown when no site email address has been set --- mod/invitefriends/actions/invite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/invitefriends/actions/invite.php b/mod/invitefriends/actions/invite.php index d9b6db792..eed156d69 100644 --- a/mod/invitefriends/actions/invite.php +++ b/mod/invitefriends/actions/invite.php @@ -60,7 +60,7 @@ foreach ($emails as $email) { // create the from address $site = get_entity($site->guid); - if (($site) && (isset($site->email))) { + if ($site && $site->email) { $from = $site->email; } else { $from = 'noreply@' . get_site_domain($site->guid); -- cgit v1.2.3 From 19f9a2ade78ee4522d3775bdba190a636cf79da5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 09:50:12 -0500 Subject: removed uses of deprecated function for setting page owner guid --- engine/lib/users.php | 4 ++-- mod/groups/actions/groups/edit.php | 2 +- mod/groups/actions/groups/membership/leave.php | 2 +- mod/invitefriends/start.php | 2 +- pages/entities/index.php | 4 ++-- pages/settings/account.php | 2 +- pages/settings/statistics.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/lib/users.php b/engine/lib/users.php index ac507e060..4072740f9 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1088,14 +1088,14 @@ function collections_page_handler($page_elements) { $base = elgg_get_config('path'); if (isset($page_elements[0])) { if ($page_elements[0] == "add") { - set_page_owner(elgg_get_logged_in_user_guid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); collections_submenu_items(); require_once "{$base}pages/friends/collections/add.php"; return true; } else { $user = get_user_by_username($page_elements[0]); if ($user) { - set_page_owner($user->getGUID()); + elgg_set_page_owner_guid($user->getGUID()); if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) { collections_submenu_items(); } diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php index 27f6e0426..c4cf6667e 100644 --- a/mod/groups/actions/groups/edit.php +++ b/mod/groups/actions/groups/edit.php @@ -91,7 +91,7 @@ $group->save(); // group creator needs to be member of new group and river entry created if ($new_group_flag) { - set_page_owner($group->guid); + elgg_set_page_owner_guid($group->guid); $group->join($user); add_to_river('river/group/create', 'create', $user->guid, $group->guid); } diff --git a/mod/groups/actions/groups/membership/leave.php b/mod/groups/actions/groups/membership/leave.php index 390870df1..4f34c7dde 100644 --- a/mod/groups/actions/groups/membership/leave.php +++ b/mod/groups/actions/groups/membership/leave.php @@ -17,7 +17,7 @@ if (!$user_guid) { $group = get_entity($group_guid); -set_page_owner($group->guid); +elgg_set_page_owner_guid($group->guid); if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) { if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php index be853f2ce..368f6348a 100644 --- a/mod/invitefriends/start.php +++ b/mod/invitefriends/start.php @@ -33,7 +33,7 @@ function invitefriends_page_handler($page) { gatekeeper(); elgg_set_context('friends'); - set_page_owner(elgg_get_logged_in_user_guid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); $title = elgg_echo('friends:invite'); diff --git a/pages/entities/index.php b/pages/entities/index.php index d3b935dc4..e73d65db4 100644 --- a/pages/entities/index.php +++ b/pages/entities/index.php @@ -25,9 +25,9 @@ if ($context) { // Get the entity, if possible if ($entity = get_entity($guid)) { if ($entity->container_guid) { - set_page_owner($entity->container_guid); + elgg_set_page_owner_guid($entity->container_guid); } else { - set_page_owner($entity->owner_guid); + elgg_set_page_owner_guid($entity->owner_guid); } // Set the body to be the full view of the entity, and the title to be its title diff --git a/pages/settings/account.php b/pages/settings/account.php index 1a57f89d8..1bf71973b 100644 --- a/pages/settings/account.php +++ b/pages/settings/account.php @@ -11,7 +11,7 @@ gatekeeper(); // Make sure we don't open a security hole ... if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { - set_page_owner(elgg_get_logged_in_user_guid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); } $title = elgg_echo('usersettings:user'); diff --git a/pages/settings/statistics.php b/pages/settings/statistics.php index b7394cbe8..9df71ec5e 100644 --- a/pages/settings/statistics.php +++ b/pages/settings/statistics.php @@ -11,7 +11,7 @@ gatekeeper(); // Make sure we don't open a security hole ... if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) { - set_page_owner(elgg_get_logged_in_user_guid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); } $title = elgg_echo("usersettings:statistics"); -- cgit v1.2.3 From 88d597c63a9691c9714e9db4dbe676028e548be8 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 11:10:34 -0500 Subject: added bottom margin to info modules for plugin settings --- views/default/css/admin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 9205e528a..c02d43512 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -320,6 +320,9 @@ p { .elgg-module-main > .elgg-head { margin-bottom: 5px; } +.elgg-module-info > .elgg-head { + margin-bottom: 10px; +} .elgg-module-inline { margin: 20px 0; } -- cgit v1.2.3 From 76bea966f7f93e719ccbf6e2350f647636d4da2a Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 12 Nov 2011 14:28:52 -0500 Subject: added better plugin skeleton and added documentation to some of the examples --- documentation/examples/actions/basic.php | 22 ++ documentation/examples/actions/manual_tokens.php | 6 - documentation/examples/events/advanced.php | 7 +- documentation/examples/events/all.php | 16 +- documentation/examples/events/basic.php | 14 +- documentation/examples/events/emit.php | 7 - documentation/examples/events/trigger.php | 11 + documentation/examples/plugins/README.txt | 3 + documentation/examples/plugins/actions/.gitignore | 0 documentation/examples/plugins/languages/en.php | 24 ++ documentation/examples/plugins/manifest.xml | 18 + .../examples/plugins/manifest_options/manifest.xml | 95 ----- .../examples/plugins/skeleton/manifest.xml | 18 - documentation/examples/plugins/skeleton/start.php | 0 documentation/examples/plugins/start.php | 0 .../examples/plugins/views/default/.gitignore | 0 documentation/info/config.php | 430 +++++++++++++++++++++ documentation/info/manifest.xml | 95 +++++ documentation/stubs/config.php | 430 --------------------- 19 files changed, 628 insertions(+), 568 deletions(-) create mode 100644 documentation/examples/actions/basic.php delete mode 100644 documentation/examples/actions/manual_tokens.php delete mode 100644 documentation/examples/events/emit.php create mode 100644 documentation/examples/events/trigger.php create mode 100644 documentation/examples/plugins/README.txt create mode 100644 documentation/examples/plugins/actions/.gitignore create mode 100644 documentation/examples/plugins/languages/en.php create mode 100644 documentation/examples/plugins/manifest.xml delete mode 100644 documentation/examples/plugins/manifest_options/manifest.xml delete mode 100644 documentation/examples/plugins/skeleton/manifest.xml delete mode 100644 documentation/examples/plugins/skeleton/start.php create mode 100644 documentation/examples/plugins/start.php create mode 100644 documentation/examples/plugins/views/default/.gitignore create mode 100644 documentation/info/config.php create mode 100644 documentation/info/manifest.xml delete mode 100644 documentation/stubs/config.php diff --git a/documentation/examples/actions/basic.php b/documentation/examples/actions/basic.php new file mode 100644 index 000000000..926e11b79 --- /dev/null +++ b/documentation/examples/actions/basic.php @@ -0,0 +1,22 @@ +annotate('rating', $rating); + +system_message(elgg_echo('rating:success')); +forward(REFERER); diff --git a/documentation/examples/actions/manual_tokens.php b/documentation/examples/actions/manual_tokens.php deleted file mode 100644 index 8dcf61fb1..000000000 --- a/documentation/examples/actions/manual_tokens.php +++ /dev/null @@ -1,6 +0,0 @@ -getSubtype(); + if ($object instanceof ElggObject) { + $subtype = $object->getSubtype(); - switch($subtype) { + switch ($subtype) { case 'blog': case 'thewire': case 'pages': + // prevent these object subtypes from being saved or changed return false; default: return true; @@ -21,4 +28,3 @@ function example_event_handler($event, $type, $params) { return true; } - diff --git a/documentation/examples/events/basic.php b/documentation/examples/events/basic.php index 91704e60b..ca2762344 100644 --- a/documentation/examples/events/basic.php +++ b/documentation/examples/events/basic.php @@ -1,13 +1,17 @@ "Blog", + * into the $mapping array so that it looks like: + * 'blog' => "Rantings", + * + * Follow this pattern for any other string you want to change. Make sure this + * plugin is lower in the plugin list than any plugin that it is modifying. + * + * If you want to add languages other than English, name the file according to + * the language's ISO 639-1 code: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + */ + +$mapping = array( + 'string:here' => 'Display string here', +); + +add_translation('en', $mapping); diff --git a/documentation/examples/plugins/manifest.xml b/documentation/examples/plugins/manifest.xml new file mode 100644 index 000000000..e31624432 --- /dev/null +++ b/documentation/examples/plugins/manifest.xml @@ -0,0 +1,18 @@ + + + My Plugin + My Name + 1.0 + This is a description of my plugin and its features. + http://www.elgg.org/ + (C) My Name or Company 2012 + GNU General Public License version 2 + + + elgg_release + 1.8 + + + communication + + diff --git a/documentation/examples/plugins/manifest_options/manifest.xml b/documentation/examples/plugins/manifest_options/manifest.xml deleted file mode 100644 index baa6cc3fa..000000000 --- a/documentation/examples/plugins/manifest_options/manifest.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - My Plugin - Elgg - 1.0 - A concise description. - This is a longer, more interesting description of my plugin, its features, and other important information. - http://www.elgg.org/ - (C) Elgg 2011 - GNU General Public License version 2 - - - elgg_version - 2009030802 - - - - elgg_release - 1.8 - - - - An example screenshot - graphics/plugin_ss1.png - - - - Another screenshot - graphics/plugin_ss2.png - - - admin - api - - - php_extension - gd - - - - php_ini - short_open_tag - off - - - - php_extension - made_up - 1.0 - - - - plugin - fake_plugin - 1.0 - - - - plugin - profile - 1.0 - - - - plugin - profile_api - 1.3 - lt - - - - priority - after - blog - - - - plugin - profile_api - 1.0 - - - - plugin - profile_api - 1.3 - - - - php_extension - curl - 1.0 - - - diff --git a/documentation/examples/plugins/skeleton/manifest.xml b/documentation/examples/plugins/skeleton/manifest.xml deleted file mode 100644 index e31624432..000000000 --- a/documentation/examples/plugins/skeleton/manifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - My Plugin - My Name - 1.0 - This is a description of my plugin and its features. - http://www.elgg.org/ - (C) My Name or Company 2012 - GNU General Public License version 2 - - - elgg_release - 1.8 - - - communication - - diff --git a/documentation/examples/plugins/skeleton/start.php b/documentation/examples/plugins/skeleton/start.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php new file mode 100644 index 000000000..e69de29bb diff --git a/documentation/examples/plugins/views/default/.gitignore b/documentation/examples/plugins/views/default/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/documentation/info/config.php b/documentation/info/config.php new file mode 100644 index 000000000..19e76c8ae --- /dev/null +++ b/documentation/info/config.php @@ -0,0 +1,430 @@ += 1.8 with {@link elgg_unregister_event_handler()}. + * + * Events are stored as a multidimensional array in the format: + * + * $CONFIG->events[str $event_name][str $event_type][int priority] = str callback_function + * + * + * @global array $CONFIG->events + * @name $CONFIG->events + * @see events() + * @see elgg_register_event_handler() + * @see elgg_unregister_event_handler() + * @see elgg_trigger_event() + */ +$CONFIG->events; + +/** + * Plugin Hook information for the plugin hooks subsystem. + * + * Hooks are added with {@link elgg_register_plugin_hook_handler()} and + * can be removed in >= 1.8 with {@link elgg_unregister_plugin_hook_handler()}. + * + * Hooks are stored as a multidimensional array in the format: + * + * $CONFIG->hooks[str $hook_name][str $hook_type][int priority] = str callback_function + * + * + * @global array $CONFIG->hooks + * @see elgg_register_plugin_hook_handler() + * @see elgg_unregister_plugin_hook_handler() + * @see elgg_trigger_plugin_hook() + */ +$CONFIG->hooks; + +/** + * Paths to scan for autoloading languages. + * + * Languages are automatically loaded for the site or + * user's default language. Plugins can extend or override strings. + * language_paths is an array of paths to scan for PHP files matching + * the default language. The order of paths is determined by the plugin load order, + * with later entries overriding earlier. Language files within these paths are + * named as the two-letter ISO 639-1 country codes for the language they represent. + * + * Language paths are stored as array keys in the format: + * + * $CONFIG->language_paths[str $language_path] = true + * + * + * @link http://en.wikipedia.org/wiki/ISO_639-1 + * @see register_language() + * @global array $CONFIG->language_paths + */ +$CONFIG->language_paths; + + +/** + * String translations for the current language. + * + * Elgg uses a key-based system for string internationalization, which + * is accessed with {@link elgg_echo()}. + * + * Translations are stored as an array in the following format: + * + * $CONFIG->translations[str $language_code][str $string_key] = str 'Translated Language String'; + * + * + * @see register_translation() + * @see elgg_echo() + * @global array $CONFIG->translations + */ +$CONFIG->translations; + +/** + * Stores input used by {@link set_input()} and {@link get_input()}. + * + * @global array $CONFIG->input + */ +$CONFIG->input; + +/** + * An array of metadata names to be used as tags. + * + * Because tags are simply names of meatdata, This is used + * in search to prevent data exposure by searching on + * arbitrary metadata. + * + * @global array $CONFIG->registered_tag_metadata_names + */ +$CONFIG->registered_tag_metadata_names; + +/** + * An associative array of page handlers and their function names. + * + * Page handlers must be registered by {@link elgg_register_page_handler()} and + * will be dispatched by {@link engine/handlers/pagehandler.php} to the + * proper function. + * + * @global array $CONFIG->pagehandler + */ +$CONFIG->pagehandler; + +/** + * An object holding valid widgets and their configurations. + * + * This object stores the valid context for widgets, and the handlers + * registered, as well as a description of the widget. + * + * Widgets are added with {@link add_widget_type()}. + * + * @global stdClass $CONFIG->widgets + */ +$CONFIG->widgets; + +/** + * The full path where Elgg is installed. + * + * @global string $CONFIG->path; + */ +$CONFIG->path; + +/** + * The full path for core views. + * + * @global string $CONFIG->viewpath + */ +$CONFIG->viewpath; + +/** + * The full path where plugins are stored. + * + * @global string $CONFIG->pluginspath + */ +$CONFIG->pluginspath; + +/** + * The full URL where Elgg is installed + * + * @global string $CONFIG->wwwroot + */ +$CONFIG->wwwroot; + +/** + * The full URL where Elgg is installed + * + * @global string $CONFIG->wwwroot + */ +$CONFIG->url; + +/** + * The name of the site as defined in the config table. + * + * @global string $CONFIG->sitename + */ +$CONFIG->sitename; + +/** + * The current language for either the site or the user. + * + * @global $CONFIG->language + */ +$CONFIG->language; + +/** + * Is the site fully installed + * + * @global bool $CONFIG->installed + */ +$CONFIG->installed; + +/** + * The guid of the current site object. + * + * @global int $CONFIG->site_id + */ +$CONFIG->site_id; + +/** + * The guid of the current site object. + * + * @global int $CONFIG->site_id + */ +$CONFIG->site_guid; + +/** + * The current site object. + * + * @global ElggSite $CONFIG->site + */ +$CONFIG->site; + +/** + * The full path to the data directory. + * + * @global string $CONFIG->dataroot + */ +$CONFIG->dataroot; + +/** + * Is simplecache enabled? + * + * @global string $CONFIG->simplecache_enabled + */ +$CONFIG->simplecache_enabled; + +/** + * Is view paths cache enabled + * + * @global string $CONFIG->viewpath_cache_enabled + */ +$CONFIG->viewpath_cache_enabled; + +/** + * The site description from the current site object. + * + * @global string $CONFIG->sitedescription + */ +$CONFIG->sitedescription; + +/** + * The site email from the current site object. + * + * @global string $CONFIG->siteemail + */ +$CONFIG->siteemail; + +/** + * The current view type + * + * View types determin the location of view files that are used to draw pages. + * They are set system-wide by the $_REQUEST['view']. If a view type is manually + * set in settings.php or through a function hooking to the {@elgg_hook + * + * @warning This is the current view type used to determine where to load views. + * Don't confuse this with the current view. + * + * @global string $CONFIG->view + */ +$CONFIG->view; + +/** + * Default access as defined in the config table for the current site. + * + * @global string $CONFIG->default_access + */ +$CONFIG->default_access; + +/** + * Is registration enabled? + * + * @global bool $CONFIG->allow_registration + */ +$CONFIG->allow_registration; + +/** + * Is current site in walled garden mode? + * + * @global bool $CONFIG->walled_garden + */ +$CONFIG->walled_garden; + +/** + * Are users allow to enter their own default access levels + * + * @global bool $CONFIG->allow_user_default_access + */ +$CONFIG->allow_user_default_access; + +/** + * A list of feature URLs for the main site menu. + * + * These links are added via the admin interface. + * + * @global string $CONFIG->menu_items_featured_urls + */ +$CONFIG->menu_items_featured_urls; + +/** + * The custom menu items entered in the administration. + * + * @global string $CONFIG->menu_items_custom_items + */ +$CONFIG->menu_items_custom_items; + +/** + * A list of registered actions, their file locations, and access permissions. + * + * @global array $CONFIG->actions + */ +$CONFIG->actions; + +/** + * Holds information about views. + * + * @global object $CONFIG->views + */ +$CONFIG->views; + +/** + * A list of views to cache in the simple cache. + * + * @global object $CONFIG->views->simplecache + */ +$CONFIG->views->simplecache; + +/** + * A list of views and the top level views directory to search for the view in. + * + * @note Views are stored as the key and the top level view location is stored as the value. + * The current viewtype {@link $CONFIG->view} is used to determin which directory under the entry + * in $CONFIG->views->location to search. View names are automatically appened a '.php' extension. + * + * @global object $CONFIG->views->locations + */ +$CONFIG->views->locations; + + +/** + * A list of valid view types as discovered. + * + * @global array $CONFIG->view_types + */ +$CONFIG->view_types; + +/** + * A list of plugins and their load order + * + * @global string $CONFIG->pluginlistcache + */ +$CONFIG->pluginlistcache; + +/** + * Holds URL handler information for ElggExtender objects. + * + * @global array $CONFIG->extender_url_handler + */ +$CONFIG->extender_url_handler; + +/** + * A list of registered entities and subtypes. Used in search. + * + * @global array $CONFIG->registered_entities + */ +$CONFIG->registered_entities; + +/** + * A list of URL handlers for {@link ElggEntity::getURL()} + * + * @global array $CONFIG->entity_url_handler + */ +$CONFIG->entity_url_handler; + +/** + * A list of entity types and subtypes that have metadata whose access permission + * can be changed independently of the main object. {@link register_metadata_as_indepenent()} + * + * @global string $CONFIG->independents + */ +$CONFIG->independents; + +/** + * Holds items for all submenus. + * + * @global string $CONFIG->submenu_items + */ +$CONFIG->submenu_items; + +/** + * Holds the service handlers as registered by {@register_service_handler()} + * + * @global array $CONFIG->servicehandler + */ +$CONFIG->servicehandler; + +/** + * A list of stop works for search. Not currently used. + * + * @global array $CONFIG->wordblacklist + * @todo currently unused. + */ +$CONFIG->wordblacklist; + +/** + * A list of menu contexts for menus registered with {@link add_menu()}. Not currently used. + * + * @global array $CONFIG->menucontexts + */ +$CONFIG->menucontexts; + +/** + * A list of registers and their children added via {@add_to_register()}. Used only for menus. + * + * @global string $CONFIG->registers + */ +$CONFIG->registers; + +/** + * A list of objects that can emit notifications. {@link register_notification_object()} + * + * @global array $CONFIG->register_objects + */ +$CONFIG->register_objects; + +/** + * Holds available group tools options. Added with {@link add_group_tool_option()} + * + * @global array $CONFIG->group_tool_options + */ +$CONFIG->group_tool_options; + +/** + * The last cache time for the current viewtype. Used in the generation of CSS and JS links. + * + * @global string $CONFIG->lastcache + */ +$CONFIG->lastcache; \ No newline at end of file diff --git a/documentation/info/manifest.xml b/documentation/info/manifest.xml new file mode 100644 index 000000000..baa6cc3fa --- /dev/null +++ b/documentation/info/manifest.xml @@ -0,0 +1,95 @@ + + + My Plugin + Elgg + 1.0 + A concise description. + This is a longer, more interesting description of my plugin, its features, and other important information. + http://www.elgg.org/ + (C) Elgg 2011 + GNU General Public License version 2 + + + elgg_version + 2009030802 + + + + elgg_release + 1.8 + + + + An example screenshot + graphics/plugin_ss1.png + + + + Another screenshot + graphics/plugin_ss2.png + + + admin + api + + + php_extension + gd + + + + php_ini + short_open_tag + off + + + + php_extension + made_up + 1.0 + + + + plugin + fake_plugin + 1.0 + + + + plugin + profile + 1.0 + + + + plugin + profile_api + 1.3 + lt + + + + priority + after + blog + + + + plugin + profile_api + 1.0 + + + + plugin + profile_api + 1.3 + + + + php_extension + curl + 1.0 + + + diff --git a/documentation/stubs/config.php b/documentation/stubs/config.php deleted file mode 100644 index 19e76c8ae..000000000 --- a/documentation/stubs/config.php +++ /dev/null @@ -1,430 +0,0 @@ -= 1.8 with {@link elgg_unregister_event_handler()}. - * - * Events are stored as a multidimensional array in the format: - * - * $CONFIG->events[str $event_name][str $event_type][int priority] = str callback_function - * - * - * @global array $CONFIG->events - * @name $CONFIG->events - * @see events() - * @see elgg_register_event_handler() - * @see elgg_unregister_event_handler() - * @see elgg_trigger_event() - */ -$CONFIG->events; - -/** - * Plugin Hook information for the plugin hooks subsystem. - * - * Hooks are added with {@link elgg_register_plugin_hook_handler()} and - * can be removed in >= 1.8 with {@link elgg_unregister_plugin_hook_handler()}. - * - * Hooks are stored as a multidimensional array in the format: - * - * $CONFIG->hooks[str $hook_name][str $hook_type][int priority] = str callback_function - * - * - * @global array $CONFIG->hooks - * @see elgg_register_plugin_hook_handler() - * @see elgg_unregister_plugin_hook_handler() - * @see elgg_trigger_plugin_hook() - */ -$CONFIG->hooks; - -/** - * Paths to scan for autoloading languages. - * - * Languages are automatically loaded for the site or - * user's default language. Plugins can extend or override strings. - * language_paths is an array of paths to scan for PHP files matching - * the default language. The order of paths is determined by the plugin load order, - * with later entries overriding earlier. Language files within these paths are - * named as the two-letter ISO 639-1 country codes for the language they represent. - * - * Language paths are stored as array keys in the format: - * - * $CONFIG->language_paths[str $language_path] = true - * - * - * @link http://en.wikipedia.org/wiki/ISO_639-1 - * @see register_language() - * @global array $CONFIG->language_paths - */ -$CONFIG->language_paths; - - -/** - * String translations for the current language. - * - * Elgg uses a key-based system for string internationalization, which - * is accessed with {@link elgg_echo()}. - * - * Translations are stored as an array in the following format: - * - * $CONFIG->translations[str $language_code][str $string_key] = str 'Translated Language String'; - * - * - * @see register_translation() - * @see elgg_echo() - * @global array $CONFIG->translations - */ -$CONFIG->translations; - -/** - * Stores input used by {@link set_input()} and {@link get_input()}. - * - * @global array $CONFIG->input - */ -$CONFIG->input; - -/** - * An array of metadata names to be used as tags. - * - * Because tags are simply names of meatdata, This is used - * in search to prevent data exposure by searching on - * arbitrary metadata. - * - * @global array $CONFIG->registered_tag_metadata_names - */ -$CONFIG->registered_tag_metadata_names; - -/** - * An associative array of page handlers and their function names. - * - * Page handlers must be registered by {@link elgg_register_page_handler()} and - * will be dispatched by {@link engine/handlers/pagehandler.php} to the - * proper function. - * - * @global array $CONFIG->pagehandler - */ -$CONFIG->pagehandler; - -/** - * An object holding valid widgets and their configurations. - * - * This object stores the valid context for widgets, and the handlers - * registered, as well as a description of the widget. - * - * Widgets are added with {@link add_widget_type()}. - * - * @global stdClass $CONFIG->widgets - */ -$CONFIG->widgets; - -/** - * The full path where Elgg is installed. - * - * @global string $CONFIG->path; - */ -$CONFIG->path; - -/** - * The full path for core views. - * - * @global string $CONFIG->viewpath - */ -$CONFIG->viewpath; - -/** - * The full path where plugins are stored. - * - * @global string $CONFIG->pluginspath - */ -$CONFIG->pluginspath; - -/** - * The full URL where Elgg is installed - * - * @global string $CONFIG->wwwroot - */ -$CONFIG->wwwroot; - -/** - * The full URL where Elgg is installed - * - * @global string $CONFIG->wwwroot - */ -$CONFIG->url; - -/** - * The name of the site as defined in the config table. - * - * @global string $CONFIG->sitename - */ -$CONFIG->sitename; - -/** - * The current language for either the site or the user. - * - * @global $CONFIG->language - */ -$CONFIG->language; - -/** - * Is the site fully installed - * - * @global bool $CONFIG->installed - */ -$CONFIG->installed; - -/** - * The guid of the current site object. - * - * @global int $CONFIG->site_id - */ -$CONFIG->site_id; - -/** - * The guid of the current site object. - * - * @global int $CONFIG->site_id - */ -$CONFIG->site_guid; - -/** - * The current site object. - * - * @global ElggSite $CONFIG->site - */ -$CONFIG->site; - -/** - * The full path to the data directory. - * - * @global string $CONFIG->dataroot - */ -$CONFIG->dataroot; - -/** - * Is simplecache enabled? - * - * @global string $CONFIG->simplecache_enabled - */ -$CONFIG->simplecache_enabled; - -/** - * Is view paths cache enabled - * - * @global string $CONFIG->viewpath_cache_enabled - */ -$CONFIG->viewpath_cache_enabled; - -/** - * The site description from the current site object. - * - * @global string $CONFIG->sitedescription - */ -$CONFIG->sitedescription; - -/** - * The site email from the current site object. - * - * @global string $CONFIG->siteemail - */ -$CONFIG->siteemail; - -/** - * The current view type - * - * View types determin the location of view files that are used to draw pages. - * They are set system-wide by the $_REQUEST['view']. If a view type is manually - * set in settings.php or through a function hooking to the {@elgg_hook - * - * @warning This is the current view type used to determine where to load views. - * Don't confuse this with the current view. - * - * @global string $CONFIG->view - */ -$CONFIG->view; - -/** - * Default access as defined in the config table for the current site. - * - * @global string $CONFIG->default_access - */ -$CONFIG->default_access; - -/** - * Is registration enabled? - * - * @global bool $CONFIG->allow_registration - */ -$CONFIG->allow_registration; - -/** - * Is current site in walled garden mode? - * - * @global bool $CONFIG->walled_garden - */ -$CONFIG->walled_garden; - -/** - * Are users allow to enter their own default access levels - * - * @global bool $CONFIG->allow_user_default_access - */ -$CONFIG->allow_user_default_access; - -/** - * A list of feature URLs for the main site menu. - * - * These links are added via the admin interface. - * - * @global string $CONFIG->menu_items_featured_urls - */ -$CONFIG->menu_items_featured_urls; - -/** - * The custom menu items entered in the administration. - * - * @global string $CONFIG->menu_items_custom_items - */ -$CONFIG->menu_items_custom_items; - -/** - * A list of registered actions, their file locations, and access permissions. - * - * @global array $CONFIG->actions - */ -$CONFIG->actions; - -/** - * Holds information about views. - * - * @global object $CONFIG->views - */ -$CONFIG->views; - -/** - * A list of views to cache in the simple cache. - * - * @global object $CONFIG->views->simplecache - */ -$CONFIG->views->simplecache; - -/** - * A list of views and the top level views directory to search for the view in. - * - * @note Views are stored as the key and the top level view location is stored as the value. - * The current viewtype {@link $CONFIG->view} is used to determin which directory under the entry - * in $CONFIG->views->location to search. View names are automatically appened a '.php' extension. - * - * @global object $CONFIG->views->locations - */ -$CONFIG->views->locations; - - -/** - * A list of valid view types as discovered. - * - * @global array $CONFIG->view_types - */ -$CONFIG->view_types; - -/** - * A list of plugins and their load order - * - * @global string $CONFIG->pluginlistcache - */ -$CONFIG->pluginlistcache; - -/** - * Holds URL handler information for ElggExtender objects. - * - * @global array $CONFIG->extender_url_handler - */ -$CONFIG->extender_url_handler; - -/** - * A list of registered entities and subtypes. Used in search. - * - * @global array $CONFIG->registered_entities - */ -$CONFIG->registered_entities; - -/** - * A list of URL handlers for {@link ElggEntity::getURL()} - * - * @global array $CONFIG->entity_url_handler - */ -$CONFIG->entity_url_handler; - -/** - * A list of entity types and subtypes that have metadata whose access permission - * can be changed independently of the main object. {@link register_metadata_as_indepenent()} - * - * @global string $CONFIG->independents - */ -$CONFIG->independents; - -/** - * Holds items for all submenus. - * - * @global string $CONFIG->submenu_items - */ -$CONFIG->submenu_items; - -/** - * Holds the service handlers as registered by {@register_service_handler()} - * - * @global array $CONFIG->servicehandler - */ -$CONFIG->servicehandler; - -/** - * A list of stop works for search. Not currently used. - * - * @global array $CONFIG->wordblacklist - * @todo currently unused. - */ -$CONFIG->wordblacklist; - -/** - * A list of menu contexts for menus registered with {@link add_menu()}. Not currently used. - * - * @global array $CONFIG->menucontexts - */ -$CONFIG->menucontexts; - -/** - * A list of registers and their children added via {@add_to_register()}. Used only for menus. - * - * @global string $CONFIG->registers - */ -$CONFIG->registers; - -/** - * A list of objects that can emit notifications. {@link register_notification_object()} - * - * @global array $CONFIG->register_objects - */ -$CONFIG->register_objects; - -/** - * Holds available group tools options. Added with {@link add_group_tool_option()} - * - * @global array $CONFIG->group_tool_options - */ -$CONFIG->group_tool_options; - -/** - * The last cache time for the current viewtype. Used in the generation of CSS and JS links. - * - * @global string $CONFIG->lastcache - */ -$CONFIG->lastcache; \ No newline at end of file -- cgit v1.2.3 From 08c5b507bbaf4937ff637bd138f64119873e2922 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 12 Nov 2011 14:49:36 -0500 Subject: cleaned up the plugin hooks documentation --- documentation/examples/hooks/advanced.php | 28 +++++++++++++++ documentation/examples/hooks/all.php | 12 +++++++ documentation/examples/hooks/basic.php | 41 +++++++--------------- documentation/examples/hooks/register/advanced.php | 23 ------------ documentation/examples/hooks/register/all.php | 8 ----- documentation/examples/hooks/register/basic.php | 14 -------- documentation/examples/hooks/register/emit.php | 7 ---- documentation/examples/hooks/trigger.php | 14 ++++++++ documentation/examples/hooks/trigger/advanced.php | 9 ----- documentation/examples/hooks/trigger/basic.php | 9 ----- 10 files changed, 66 insertions(+), 99 deletions(-) create mode 100644 documentation/examples/hooks/advanced.php create mode 100644 documentation/examples/hooks/all.php delete mode 100644 documentation/examples/hooks/register/advanced.php delete mode 100644 documentation/examples/hooks/register/all.php delete mode 100644 documentation/examples/hooks/register/basic.php delete mode 100644 documentation/examples/hooks/register/emit.php create mode 100644 documentation/examples/hooks/trigger.php delete mode 100644 documentation/examples/hooks/trigger/advanced.php delete mode 100644 documentation/examples/hooks/trigger/basic.php diff --git a/documentation/examples/hooks/advanced.php b/documentation/examples/hooks/advanced.php new file mode 100644 index 000000000..ca036c46a --- /dev/null +++ b/documentation/examples/hooks/advanced.php @@ -0,0 +1,28 @@ + 'Joe'); -$items = elgg_trigger_plugin_hook('get_items', 'example', $params, $default); +function example_plugin_hook_handler($hook, $type, $value, $params) { + var_dump($hook); + var_dump($type); + var_dump($value); + var_dump($params); -var_dump($items); - -function example_plugin_hook($hook, $type, $value, $params) { - if (is_array($value)) { - $value[] = "Hook Value 1"; - $value[] = "Hook Value 2"; - } - - return $value; -} - -function example_plugin_hook_2($hook, $type, $value, $params) { - $username = isset($params['username']) ? $params['username'] : NULL; - if (is_array($value)) { - switch($username) { - case 'Joe': - $value[] = "Joe's item"; - break; - case 'John': - $value[] = "Joe's item"; - break; - } - } - - return $value; + // we are not changing $value so return null + return null; } diff --git a/documentation/examples/hooks/register/advanced.php b/documentation/examples/hooks/register/advanced.php deleted file mode 100644 index e3951c19c..000000000 --- a/documentation/examples/hooks/register/advanced.php +++ /dev/null @@ -1,23 +0,0 @@ - Date: Sun, 13 Nov 2011 16:20:03 -0500 Subject: need to unset the trusted link key --- views/default/output/confirmlink.php | 1 + 1 file changed, 1 insertion(+) diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 953c15f1b..532790a38 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -41,6 +41,7 @@ if (isset($vars['class'])) { unset($vars['encode_text']); unset($vars['text']); unset($vars['confirm']); +unset($vars['is_trusted']); $attributes = elgg_format_attributes($vars); echo "$text"; -- cgit v1.2.3 From 95346209886527207ffd036a58d6fd50572d34fd Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Nov 2011 16:20:48 -0500 Subject: should be a ul rather than a div --- mod/groups/views/default/groups/profile/widgets.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/groups/views/default/groups/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php index caf019a3a..7635cad4f 100644 --- a/mod/groups/views/default/groups/profile/widgets.php +++ b/mod/groups/views/default/groups/profile/widgets.php @@ -6,8 +6,8 @@ */ // tools widget area -echo '"; +echo ""; -- cgit v1.2.3 From 6483d9d446e7fa50e16823fe20514a45416880e2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Nov 2011 16:22:57 -0500 Subject: Fixes #4082 adds output/img --- engine/lib/users.php | 11 ++++++----- mod/bookmarks/views/default/bookmarks/bookmarklet.php | 9 ++++++--- views/default/core/avatar/upload.php | 7 +++++-- views/default/forms/avatar/crop.php | 17 +++++++++++++---- views/default/icon/default.php | 7 +++++-- views/default/icon/user/default.php | 12 +++++++++--- views/default/output/img.php | 12 ++++++++++++ 7 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 views/default/output/img.php diff --git a/engine/lib/users.php b/engine/lib/users.php index 4072740f9..9cb8ddfa7 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1476,14 +1476,15 @@ function users_pagesetup() { // topbar if ($viewer) { - - $icon_url = $viewer->getIconURL('topbar'); - $class = 'elgg-border-plain elgg-transition'; - $title = elgg_echo('profile'); elgg_register_menu_item('topbar', array( 'name' => 'profile', 'href' => $viewer->getURL(), - 'text' => "\"$viewer-name\" title=\"$title\" class=\"$class\" />", + 'text' => elgg_view('output/img', array( + 'src' => $viewer->getIconURL('topbar'), + 'alt' => $viewer->name, + 'title' => elgg_echo('profile'), + 'class' => 'elgg-border-plain elgg-transition', + )), 'priority' => 100, 'link_class' => 'elgg-topbar-avatar', )); diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index 1d0b25498..b3e9737fe 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -20,13 +20,16 @@ if (!$name && ($user = elgg_get_logged_in_user_entity())) { } $url = elgg_get_site_url(); - +$img = elgg_view('output/img', array( + 'src' => 'mod/bookmarks/graphics/bookmarklet.gif', + 'alt' => $title, +)); $bookmarklet = "getIconUrl('medium'); +$user_avatar = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('medium'), + 'alt' => elgg_echo('avatar'), +)); $current_label = elgg_echo('avatar:current'); @@ -23,7 +26,7 @@ $upload_form = elgg_view_form('avatar/upload', $form_params, $vars); $image = <<
- avatar + $user_avatar HTML; diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index f622fd60f..3e798cb27 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -9,14 +9,23 @@ elgg_load_js('jquery.imgareaselect'); elgg_load_js('elgg.avatar_cropper'); elgg_load_css('jquery.imgareaselect'); -$master_image = $vars['entity']->getIconUrl('master'); +$master_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), + 'class' => 'mrl', + 'id' => 'user-avatar-cropper', +)); + +$preview_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), +)); ?>
- <?php echo elgg_echo('avatar'); ?> +
-
- +
getIconURL($vars['size']); -$img = "\"$title\""; +$img = elgg_view('output/img', array( + 'src' => $entity->getIconURL($vars['size']), + 'alt' => $title, + 'class' => $class, +)); if ($url) { $params = array( diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php index a208ec41a..c0b0e7483 100644 --- a/views/default/icon/user/default.php +++ b/views/default/icon/user/default.php @@ -47,7 +47,7 @@ if ($js) { $img_class = ''; if (isset($vars['img_class'])) { - $img_class = "class=\"{$vars['img_class']}\""; + $img_class = $vars['img_class']; } $use_hover = elgg_extract('use_hover', $vars, true); @@ -62,8 +62,14 @@ if (isset($vars['hover'])) { $spacer_url = elgg_get_site_url() . '_graphics/spacer.gif'; -$icon_url = $user->getIconURL($size); -$icon = "\"$name\""; +$icon_url = elgg_format_url($user->getIconURL($size)); +$icon = elgg_view('output/img', array( + 'src' => $spacer_url, + 'alt' => $name, + 'title' => $name, + 'class' => $img_class, + 'style' => "background: url($icon_url) no-repeat;", +)); $show_menu = $use_hover && (elgg_is_admin_logged_in() || !$user->isBanned()); diff --git a/views/default/output/img.php b/views/default/output/img.php new file mode 100644 index 000000000..d3f596801 --- /dev/null +++ b/views/default/output/img.php @@ -0,0 +1,12 @@ +"; -- cgit v1.2.3 From 2694d74593644af64737a41d32cc6191265fc02b Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 13 Nov 2011 19:48:32 -0500 Subject: added the missing set/get priority methods to ElggMenuItem --- engine/classes/ElggMenuItem.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index 289919a8e..62547134a 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -415,6 +415,7 @@ class ElggMenuItem { * * @param int $priority The smaller numbers mean higher priority (1 before 100) * @return void + * @deprecated */ public function setWeight($priority) { $this->data['priority'] = $priority; @@ -424,11 +425,31 @@ class ElggMenuItem { * Get the priority of the menu item * * @return int + * @deprecated */ public function getWeight() { return $this->data['priority']; } + /** + * Set the priority of the menu item + * + * @param int $priority The smaller numbers mean higher priority (1 before 100) + * @return void + */ + public function setPriority($priority) { + $this->data['priority'] = $priority; + } + + /** + * Get the priority of the menu item + * + * @return int + */ + public function getPriority() { + return $this->data['priority']; + } + /** * Set the section identifier * -- cgit v1.2.3 From 947b4b042469123a98ed038cecc8301fd6494057 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 14 Nov 2011 07:18:29 -0500 Subject: Refs #4083 increased number of friends to 50 --- mod/messages/pages/messages/send.php | 2 +- mod/messages/views/default/forms/messages/send.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/messages/pages/messages/send.php b/mod/messages/pages/messages/send.php index 8b0de6f9d..b46d0ba52 100644 --- a/mod/messages/pages/messages/send.php +++ b/mod/messages/pages/messages/send.php @@ -15,7 +15,7 @@ $title = elgg_echo('messages:add'); elgg_push_breadcrumb($title); $params = messages_prepare_form_vars((int)get_input('send_to')); -$params['friends'] = $page_owner->getFriends(); +$params['friends'] = $page_owner->getFriends('', 50); $content = elgg_view_form('messages/send', array(), $params); $body = elgg_view_layout('content', array( diff --git a/mod/messages/views/default/forms/messages/send.php b/mod/messages/views/default/forms/messages/send.php index b0638e0c0..5b7e7830e 100644 --- a/mod/messages/views/default/forms/messages/send.php +++ b/mod/messages/views/default/forms/messages/send.php @@ -1,6 +1,6 @@ Date: Tue, 15 Nov 2011 18:51:45 -0500 Subject: Fixes #4090 removes double assignment - thanks to andres.fortier --- engine/lib/relationships.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index 929d3841d..3578f0cb8 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -123,7 +123,7 @@ function check_entity_relationship($guid_one, $relationship, $guid_two) { AND relationship='$relationship' AND guid_two=$guid_two limit 1"; - $row = $row = get_data_row($query); + $row = get_data_row($query); if ($row) { return $row; } -- cgit v1.2.3 From ed682b22e5a14673090bc9e48ee8c0ecebaadef9 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 15 Nov 2011 18:55:04 -0500 Subject: Fixes #4089 corrects documentation of ElggRelationship constructor --- engine/classes/ElggRelationship.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/classes/ElggRelationship.php b/engine/classes/ElggRelationship.php index a0826689d..2d9a32cbd 100644 --- a/engine/classes/ElggRelationship.php +++ b/engine/classes/ElggRelationship.php @@ -10,9 +10,9 @@ class ElggRelationship extends ElggData implements { /** - * Construct a new site object, optionally from a given id value or row. + * Create a relationship object, optionally from a given id value or row. * - * @param mixed $id ElggRelationship id + * @param mixed $id ElggRelationship id, database row, or null for new relationship */ function __construct($id = null) { $this->initializeAttributes(); -- cgit v1.2.3 From fbbed3deaa0090173d398587cfea4af144d062a2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 15 Nov 2011 20:03:52 -0500 Subject: atleast renaming the ui js libs --- engine/lib/elgglib.php | 8 +-- js/lib/autocomplete.js | 14 ------ js/lib/avatar_cropper.js | 76 ---------------------------- js/lib/friends_picker.js | 91 ---------------------------------- js/lib/ui.autocomplete.js | 14 ++++++ js/lib/ui.avatar_cropper.js | 76 ++++++++++++++++++++++++++++ js/lib/ui.friends_picker.js | 91 ++++++++++++++++++++++++++++++++++ js/lib/ui.userpicker.js | 117 ++++++++++++++++++++++++++++++++++++++++++++ js/lib/userpicker.js | 117 -------------------------------------------- 9 files changed, 302 insertions(+), 302 deletions(-) delete mode 100644 js/lib/autocomplete.js delete mode 100644 js/lib/avatar_cropper.js delete mode 100644 js/lib/friends_picker.js create mode 100644 js/lib/ui.autocomplete.js create mode 100644 js/lib/ui.avatar_cropper.js create mode 100644 js/lib/ui.friends_picker.js create mode 100644 js/lib/ui.userpicker.js delete mode 100644 js/lib/userpicker.js diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 47ca157e1..08b346960 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -2048,12 +2048,12 @@ function elgg_init() { elgg_register_page_handler('css', 'elgg_css_page_handler'); elgg_register_page_handler('ajax', 'elgg_ajax_page_handler'); - elgg_register_js('elgg.autocomplete', 'js/lib/autocomplete.js'); + elgg_register_js('elgg.autocomplete', 'js/lib/ui.autocomplete.js'); elgg_register_js('jquery.ui.autocomplete.html', 'vendors/jquery/jquery.ui.autocomplete.html.js'); - elgg_register_js('elgg.userpicker', 'js/lib/userpicker.js'); - elgg_register_js('elgg.friendspicker', 'js/lib/friends_picker.js'); + elgg_register_js('elgg.userpicker', 'js/lib/ui.userpicker.js'); + elgg_register_js('elgg.friendspicker', 'js/lib/ui.friends_picker.js'); elgg_register_js('jquery.easing', 'vendors/jquery/jquery.easing.1.3.packed.js'); - elgg_register_js('elgg.avatar_cropper', 'js/lib/avatar_cropper.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_css('jquery.imgareaselect', 'vendors/jquery/jquery.imgareaselect-0.9.8/css/imgareaselect-deprecated.css'); diff --git a/js/lib/autocomplete.js b/js/lib/autocomplete.js deleted file mode 100644 index 46d72d146..000000000 --- a/js/lib/autocomplete.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * - */ -elgg.provide('elgg.autocomplete'); - -elgg.autocomplete.init = function() { - $('.elgg-input-autocomplete').autocomplete({ - source: elgg.autocomplete.url, //gets set by input/autocomplete view - minLength: 2, - html: "html" - }) -}; - -elgg.register_hook_handler('init', 'system', elgg.autocomplete.init); \ No newline at end of file diff --git a/js/lib/avatar_cropper.js b/js/lib/avatar_cropper.js deleted file mode 100644 index fc32a0832..000000000 --- a/js/lib/avatar_cropper.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Avatar cropping - */ - -elgg.provide('elgg.avatarCropper'); - -/** - * Register the avatar cropper. - * - * If the hidden inputs have the coordinates from a previous cropping, begin - * the selection and preview with that displayed. - */ -elgg.avatarCropper.init = function() { - var params = { - selectionOpacity: 0, - aspectRatio: '1:1', - onSelectEnd: elgg.avatarCropper.selectChange, - onSelectChange: elgg.avatarCropper.preview - }; - - if ($('input[name=x2]').val()) { - params.x1 = $('input[name=x1]').val(); - params.x2 = $('input[name=x2]').val(); - params.y1 = $('input[name=y1]').val(); - params.y2 = $('input[name=y2]').val(); - } - - $('#user-avatar-cropper').imgAreaSelect(params); - - if ($('input[name=x2]').val()) { - var ias = $('#user-avatar-cropper').imgAreaSelect({instance: true}); - var selection = ias.getSelection(); - elgg.avatarCropper.preview($('#user-avatar-cropper'), selection); - } -}; - -/** - * Handler for changing select area. - * - * @param {Object} reference to the image - * @param {Object} imgareaselect selection object - * @return void - */ -elgg.avatarCropper.preview = function(img, selection) { - // catch for the first click on the image - if (selection.width == 0 || selection.height == 0) { - return; - } - - var origWidth = $("#user-avatar-cropper").width(); - var origHeight = $("#user-avatar-cropper").height(); - var scaleX = 100 / selection.width; - var scaleY = 100 / selection.height; - $('#user-avatar-preview > img').css({ - width: Math.round(scaleX * origWidth) + 'px', - height: Math.round(scaleY * origHeight) + 'px', - marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', - marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' - }); -}; - -/** - * Handler for updating the form inputs after select ends - * - * @param {Object} reference to the image - * @param {Object} imgareaselect selection object - * @return void - */ -elgg.avatarCropper.selectChange = function(img, selection) { - $('input[name=x1]').val(selection.x1); - $('input[name=x2]').val(selection.x2); - $('input[name=y1]').val(selection.y1); - $('input[name=y2]').val(selection.y2); -}; - -elgg.register_hook_handler('init', 'system', elgg.avatarCropper.init); \ No newline at end of file diff --git a/js/lib/friends_picker.js b/js/lib/friends_picker.js deleted file mode 100644 index 9257c40fc..000000000 --- a/js/lib/friends_picker.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - elgg friendsPicker plugin - adapted from Niall Doherty's excellent Coda-Slider - http://www.ndoherty.com/coda-slider - */ - - -jQuery.fn.friendsPicker = function(iterator) { - - var settings; - settings = $.extend({ easeFunc: "easeOutExpo", easeTime: 1000, toolTip: false }, settings); - - return this.each(function() { - - var container = $(this); - container.addClass("friends-picker"); - // set panelwidth manually as it's hidden initially - adjust this value for different themes/pagewidths - var panelWidth = 730; - - // count the panels in the container - var panelCount = container.find("div.panel").size(); - // calculate the width of all the panels lined up end-to-end - var friendsPicker_containerWidth = panelWidth*panelCount; - // specify width for the friendsPicker_container - container.find("div.friends-picker-container").css("width" , friendsPicker_containerWidth); - - // global variables for container.each function below - var friendsPickerNavigationWidth = 0; - var currentPanel = 1; - - // generate appropriate nav for each container - container.each(function(i) { - // generate Left and Right arrows - $(this).before("
Left<\/div>"); - $(this).after("
Right<\/div>"); - - // generate a-z tabs - $(this).before("
    <\/ul><\/div>"); - $(this).find("div.panel").each(function(individualTabItemNumber) { - $("div#friends-picker-navigation" + iterator + " ul").append("
  • " + $(this).attr("title") + "<\/a><\/li>"); - }); - - // tabs navigation - $("div#friends-picker-navigation" + iterator + " a").each(function(individualTabItemNumber) { - // calc friendsPickerNavigationWidth by summing width of each li - friendsPickerNavigationWidth += $(this).parent().width(); - // set-up individual tab clicks - $(this).bind("click", function() { - $(this).addClass("current").parent().parent().find("a").not($(this)).removeClass("current"); - var distanceToMoveFriendsPicker_container = - (panelWidth*individualTabItemNumber); - currentPanel = individualTabItemNumber + 1; - $(this).parent().parent().parent().next().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); - }); - }); - - // Right arow click function - $("div#friends-picker-navigation-r" + iterator + " a").click(function() { - if (currentPanel == panelCount) { - var distanceToMoveFriendsPicker_container = 0; - currentPanel = 1; - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().parent().find("a:eq(0)").addClass("current"); - } else { - var distanceToMoveFriendsPicker_container = - (panelWidth*currentPanel); - currentPanel += 1; - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().next().find("a").addClass("current"); - }; - $(this).parent().parent().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); - return false; - }); - - // Left arrow click function - $("div#friends-picker-navigation-l" + iterator + " a").click(function() { - if (currentPanel == 1) { - var distanceToMoveFriendsPicker_container = - (panelWidth*(panelCount - 1)); - currentPanel = panelCount; - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().parent().find("li:last a").addClass("current"); - } else { - currentPanel -= 1; - var distanceToMoveFriendsPicker_container = - (panelWidth*(currentPanel - 1)); - $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().prev().find("a").addClass("current"); - }; - $(this).parent().parent().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); - return false; - }); - - // apply 'current' class to currently selected tab link - $("div#friends-picker-navigation" + iterator + " a:eq(0)").addClass("current"); - }); - - $("div#friends-picker-navigation" + iterator).append("
    "); - }); -}; \ No newline at end of file diff --git a/js/lib/ui.autocomplete.js b/js/lib/ui.autocomplete.js new file mode 100644 index 000000000..46d72d146 --- /dev/null +++ b/js/lib/ui.autocomplete.js @@ -0,0 +1,14 @@ +/** + * + */ +elgg.provide('elgg.autocomplete'); + +elgg.autocomplete.init = function() { + $('.elgg-input-autocomplete').autocomplete({ + source: elgg.autocomplete.url, //gets set by input/autocomplete view + minLength: 2, + html: "html" + }) +}; + +elgg.register_hook_handler('init', 'system', elgg.autocomplete.init); \ No newline at end of file diff --git a/js/lib/ui.avatar_cropper.js b/js/lib/ui.avatar_cropper.js new file mode 100644 index 000000000..fc32a0832 --- /dev/null +++ b/js/lib/ui.avatar_cropper.js @@ -0,0 +1,76 @@ +/** + * Avatar cropping + */ + +elgg.provide('elgg.avatarCropper'); + +/** + * Register the avatar cropper. + * + * If the hidden inputs have the coordinates from a previous cropping, begin + * the selection and preview with that displayed. + */ +elgg.avatarCropper.init = function() { + var params = { + selectionOpacity: 0, + aspectRatio: '1:1', + onSelectEnd: elgg.avatarCropper.selectChange, + onSelectChange: elgg.avatarCropper.preview + }; + + if ($('input[name=x2]').val()) { + params.x1 = $('input[name=x1]').val(); + params.x2 = $('input[name=x2]').val(); + params.y1 = $('input[name=y1]').val(); + params.y2 = $('input[name=y2]').val(); + } + + $('#user-avatar-cropper').imgAreaSelect(params); + + if ($('input[name=x2]').val()) { + var ias = $('#user-avatar-cropper').imgAreaSelect({instance: true}); + var selection = ias.getSelection(); + elgg.avatarCropper.preview($('#user-avatar-cropper'), selection); + } +}; + +/** + * Handler for changing select area. + * + * @param {Object} reference to the image + * @param {Object} imgareaselect selection object + * @return void + */ +elgg.avatarCropper.preview = function(img, selection) { + // catch for the first click on the image + if (selection.width == 0 || selection.height == 0) { + return; + } + + var origWidth = $("#user-avatar-cropper").width(); + var origHeight = $("#user-avatar-cropper").height(); + var scaleX = 100 / selection.width; + var scaleY = 100 / selection.height; + $('#user-avatar-preview > img').css({ + width: Math.round(scaleX * origWidth) + 'px', + height: Math.round(scaleY * origHeight) + 'px', + marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', + marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' + }); +}; + +/** + * Handler for updating the form inputs after select ends + * + * @param {Object} reference to the image + * @param {Object} imgareaselect selection object + * @return void + */ +elgg.avatarCropper.selectChange = function(img, selection) { + $('input[name=x1]').val(selection.x1); + $('input[name=x2]').val(selection.x2); + $('input[name=y1]').val(selection.y1); + $('input[name=y2]').val(selection.y2); +}; + +elgg.register_hook_handler('init', 'system', elgg.avatarCropper.init); \ No newline at end of file diff --git a/js/lib/ui.friends_picker.js b/js/lib/ui.friends_picker.js new file mode 100644 index 000000000..9257c40fc --- /dev/null +++ b/js/lib/ui.friends_picker.js @@ -0,0 +1,91 @@ +/* + elgg friendsPicker plugin + adapted from Niall Doherty's excellent Coda-Slider - http://www.ndoherty.com/coda-slider + */ + + +jQuery.fn.friendsPicker = function(iterator) { + + var settings; + settings = $.extend({ easeFunc: "easeOutExpo", easeTime: 1000, toolTip: false }, settings); + + return this.each(function() { + + var container = $(this); + container.addClass("friends-picker"); + // set panelwidth manually as it's hidden initially - adjust this value for different themes/pagewidths + var panelWidth = 730; + + // count the panels in the container + var panelCount = container.find("div.panel").size(); + // calculate the width of all the panels lined up end-to-end + var friendsPicker_containerWidth = panelWidth*panelCount; + // specify width for the friendsPicker_container + container.find("div.friends-picker-container").css("width" , friendsPicker_containerWidth); + + // global variables for container.each function below + var friendsPickerNavigationWidth = 0; + var currentPanel = 1; + + // generate appropriate nav for each container + container.each(function(i) { + // generate Left and Right arrows + $(this).before("
    Left<\/div>"); + $(this).after("
    Right<\/div>"); + + // generate a-z tabs + $(this).before("
      <\/ul><\/div>"); + $(this).find("div.panel").each(function(individualTabItemNumber) { + $("div#friends-picker-navigation" + iterator + " ul").append("
    • " + $(this).attr("title") + "<\/a><\/li>"); + }); + + // tabs navigation + $("div#friends-picker-navigation" + iterator + " a").each(function(individualTabItemNumber) { + // calc friendsPickerNavigationWidth by summing width of each li + friendsPickerNavigationWidth += $(this).parent().width(); + // set-up individual tab clicks + $(this).bind("click", function() { + $(this).addClass("current").parent().parent().find("a").not($(this)).removeClass("current"); + var distanceToMoveFriendsPicker_container = - (panelWidth*individualTabItemNumber); + currentPanel = individualTabItemNumber + 1; + $(this).parent().parent().parent().next().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); + }); + }); + + // Right arow click function + $("div#friends-picker-navigation-r" + iterator + " a").click(function() { + if (currentPanel == panelCount) { + var distanceToMoveFriendsPicker_container = 0; + currentPanel = 1; + $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().parent().find("a:eq(0)").addClass("current"); + } else { + var distanceToMoveFriendsPicker_container = - (panelWidth*currentPanel); + currentPanel += 1; + $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().next().find("a").addClass("current"); + }; + $(this).parent().parent().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); + return false; + }); + + // Left arrow click function + $("div#friends-picker-navigation-l" + iterator + " a").click(function() { + if (currentPanel == 1) { + var distanceToMoveFriendsPicker_container = - (panelWidth*(panelCount - 1)); + currentPanel = panelCount; + $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().parent().find("li:last a").addClass("current"); + } else { + currentPanel -= 1; + var distanceToMoveFriendsPicker_container = - (panelWidth*(currentPanel - 1)); + $(this).parent().parent().find("div.friends-picker-navigation a.current").removeClass("current").parent().prev().find("a").addClass("current"); + }; + $(this).parent().parent().find("div.friends-picker-container").animate({ left: distanceToMoveFriendsPicker_container}, settings.easeTime, settings.easeFunc); + return false; + }); + + // apply 'current' class to currently selected tab link + $("div#friends-picker-navigation" + iterator + " a:eq(0)").addClass("current"); + }); + + $("div#friends-picker-navigation" + iterator).append("
      "); + }); +}; \ No newline at end of file diff --git a/js/lib/ui.userpicker.js b/js/lib/ui.userpicker.js new file mode 100644 index 000000000..8287ba91c --- /dev/null +++ b/js/lib/ui.userpicker.js @@ -0,0 +1,117 @@ +elgg.provide('elgg.userpicker'); + +/** + * Userpicker initialization + * + * The userpicker is an autocomplete library for selecting multiple users or + * friends. It works in concert with the view input/userpicker. + * + * @return void + */ +elgg.userpicker.init = function() { + + // binding autocomplete. + // doing this as an each so we can pass this to functions. + $('.elgg-input-user-picker').each(function() { + + $(this).autocomplete({ + source: function(request, response) { + + var params = elgg.userpicker.getSearchParams(this); + + elgg.get('livesearch', { + data: params, + dataType: 'json', + success: function(data) { + response(data); + } + }); + }, + minLength: 2, + html: "html", + select: elgg.userpicker.addUser + }) + }); + + $('.elgg-userpicker-remove').live('click', elgg.userpicker.removeUser); +}; + +/** + * Adds a user to the select user list + * + * elgg.userpicker.userList is defined in the input/userpicker view + * + * @param {Object} event + * @param {Object} ui The object returned by the autocomplete endpoint + * @return void + */ +elgg.userpicker.addUser = function(event, ui) { + var info = ui.item; + + // do not allow users to be added multiple times + if (!(info.guid in elgg.userpicker.userList)) { + elgg.userpicker.userList[info.guid] = true; + var users = $(this).siblings('.elgg-user-picker-list'); + var li = ''; + li += elgg.userpicker.viewUser(info); + $('
    • ').html(li).appendTo(users); + } + + $(this).val(''); + event.preventDefault(); +}; + +/** + * Remove a user from the selected user list + * + * @param {Object} event + * @return void + */ +elgg.userpicker.removeUser = function(event) { + var item = $(this).closest('.elgg-user-picker-list > li'); + + var guid = item.find('[name="members[]"]').val(); + delete elgg.userpicker.userList[guid]; + + item.remove(); + event.preventDefault(); +}; + +/** + * Render the list item for insertion into the selected user list + * + * The html in this method has to remain synced with the input/userpicker view + * + * @param {Object} info The object returned by the autocomplete endpoint + * @return string + */ +elgg.userpicker.viewUser = function(info) { + + var deleteLink = "X"; + + var html = "
      "; + html += "
      " + info.icon + "
      "; + html += "
      " + deleteLink + "
      "; + html += "
      " + info.name + "
      "; + html += "'; - li += elgg.userpicker.viewUser(info); - $('
    • ').html(li).appendTo(users); - } - - $(this).val(''); - event.preventDefault(); -}; - -/** - * Remove a user from the selected user list - * - * @param {Object} event - * @return void - */ -elgg.userpicker.removeUser = function(event) { - var item = $(this).closest('.elgg-user-picker-list > li'); - - var guid = item.find('[name="members[]"]').val(); - delete elgg.userpicker.userList[guid]; - - item.remove(); - event.preventDefault(); -}; - -/** - * Render the list item for insertion into the selected user list - * - * The html in this method has to remain synced with the input/userpicker view - * - * @param {Object} info The object returned by the autocomplete endpoint - * @return string - */ -elgg.userpicker.viewUser = function(info) { - - var deleteLink = "X"; - - var html = "
      "; - html += "
      " + info.icon + "
      "; - html += "
      " + deleteLink + "
      "; - html += "
      " + info.name + "
      "; - html += " Date: Tue, 15 Nov 2011 20:30:59 -0500 Subject: fixed bugs in avatar cropping with remembering old crop coordinates and resizing the master --- actions/avatar/crop.php | 1 + actions/avatar/upload.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/actions/avatar/crop.php b/actions/avatar/crop.php index 39061fa2c..6d71b6f06 100644 --- a/actions/avatar/crop.php +++ b/actions/avatar/crop.php @@ -23,6 +23,7 @@ $filehandler->setFilename("profile/" . $owner->guid . "master" . ".jpg"); $filename = $filehandler->getFilenameOnFilestore(); $icon_sizes = elgg_get_config('icon_sizes'); +unset($icon_sizes['master']); // get the images and save their file handlers into an array // so we can do clean up if one fails. diff --git a/actions/avatar/upload.php b/actions/avatar/upload.php index 2e8ff98b3..0752615e0 100644 --- a/actions/avatar/upload.php +++ b/actions/avatar/upload.php @@ -44,6 +44,12 @@ foreach ($icon_sizes as $name => $size_info) { } } +// reset crop coordinates +$owner->x1 = 0; +$owner->x2 = 0; +$owner->y1 = 0; +$owner->y2 = 0; + $owner->icontime = time(); if (elgg_trigger_event('profileiconupdate', $owner->type, $owner)) { system_message(elgg_echo("avatar:upload:success")); -- cgit v1.2.3 From 73d3096a3bd0a80ea82a952e6f1082cf7a382cc8 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 15 Nov 2011 21:17:31 -0500 Subject: updated the plugin skeleton with some instructions --- documentation/examples/plugins/README.txt | 4 +++- documentation/examples/plugins/start.php | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/documentation/examples/plugins/README.txt b/documentation/examples/plugins/README.txt index 9eb04391d..704f56598 100644 --- a/documentation/examples/plugins/README.txt +++ b/documentation/examples/plugins/README.txt @@ -1,3 +1,5 @@ Plugin Skeleton ========================= - +This directory includes a plugin skeleton to be used as the starting point when +creating a new plugin. Just create a new directory in /mod/ and copy the files +and directories into it. Then update the manifest and start coding. \ No newline at end of file diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php index e69de29bb..ea1e894b2 100644 --- a/documentation/examples/plugins/start.php +++ b/documentation/examples/plugins/start.php @@ -0,0 +1,12 @@ + Date: Tue, 15 Nov 2011 21:18:33 -0500 Subject: updated release date --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 25df5faf6..879fee50c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ Version 1.8.1 -(November xx, 2011 from https://github.com/Elgg/Elgg/tree/1.8) +(November 16, 2011 from https://github.com/Elgg/Elgg/tree/1.8) Enhancements: * Completed styling of user validation admin page -- cgit v1.2.3 From 3703eb1e0d54ea35f751d5f451b9880069ee7ab4 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 16 Nov 2011 20:29:25 -0500 Subject: removed two deprecated function calls from thewire --- mod/thewire/pages/thewire/friends.php | 2 +- mod/thewire/pages/thewire/owner.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/thewire/pages/thewire/friends.php b/mod/thewire/pages/thewire/friends.php index 26ad03da6..e7f5eed59 100644 --- a/mod/thewire/pages/thewire/friends.php +++ b/mod/thewire/pages/thewire/friends.php @@ -14,7 +14,7 @@ elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all"); elgg_push_breadcrumb($owner->name, "thewire/owner/$owner->username"); elgg_push_breadcrumb(elgg_echo('friends')); -if (get_loggedin_userid() == $owner->guid) { +if (elgg_get_logged_in_user_guid() == $owner->guid) { $form_vars = array('class' => 'thewire-form'); $content = elgg_view_form('thewire/add', $form_vars); $content .= elgg_view('input/urlshortener'); diff --git a/mod/thewire/pages/thewire/owner.php b/mod/thewire/pages/thewire/owner.php index a95786b0a..f544aa655 100644 --- a/mod/thewire/pages/thewire/owner.php +++ b/mod/thewire/pages/thewire/owner.php @@ -14,7 +14,7 @@ $title = elgg_echo('thewire:user', array($owner->name)); elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all"); elgg_push_breadcrumb($owner->name); -if (get_loggedin_userid() == $owner->guid) { +if (elgg_get_logged_in_user_guid() == $owner->guid) { $form_vars = array('class' => 'thewire-form'); $content = elgg_view_form('thewire/add', $form_vars); $content .= elgg_view('input/urlshortener'); -- cgit v1.2.3 From efbc8eaeb96c2e2f645d1896f29c5e12ea0dbce4 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 17 Nov 2011 07:12:39 -0500 Subject: Fixes #4100 adds the wire post form back to all page --- mod/thewire/pages/thewire/everyone.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/thewire/pages/thewire/everyone.php b/mod/thewire/pages/thewire/everyone.php index 4e88d17af..909f0caf2 100644 --- a/mod/thewire/pages/thewire/everyone.php +++ b/mod/thewire/pages/thewire/everyone.php @@ -8,13 +8,14 @@ elgg_push_breadcrumb(elgg_echo('thewire')); $title = elgg_echo('thewire:everyone'); +$content = ''; if (elgg_is_logged_in()) { $form_vars = array('class' => 'thewire-form'); $content .= elgg_view_form('thewire/add', $form_vars); $content .= elgg_view('input/urlshortener'); } -$content = elgg_list_entities(array( +$content .= elgg_list_entities(array( 'type' => 'object', 'subtype' => 'thewire', 'limit' => 15, -- cgit v1.2.3 From 4fcf69419052800ab98ce8ee8e239de9f749e028 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 17 Nov 2011 07:23:11 -0500 Subject: Fixes #4101 added footer links back --- mod/externalpages/start.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php index 13235af53..152a8b4d9 100644 --- a/mod/externalpages/start.php +++ b/mod/externalpages/start.php @@ -43,8 +43,11 @@ function expages_setup_footer_menu() { $pages = array('about', 'terms', 'privacy'); foreach ($pages as $page) { $url = "$page"; - $item = new ElggMenuItem($page, elgg_echo("expages:$page"), $url); - elgg_register_menu_item('walled_garden', $item); + $wg_item = new ElggMenuItem($page, elgg_echo("expages:$page"), $url); + elgg_register_menu_item('walled_garden', $wg_item); + + $footer_item = clone $wg_item; + elgg_register_menu_item('footer', $footer_item); } } -- cgit v1.2.3 From 1403d4978bd0f9944aabc86520d49815c0fdce29 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 17 Nov 2011 07:49:25 -0500 Subject: Fixes #4094, #4095 fixes casting issues in unit tests - thanks to andres.fortier --- engine/tests/objects/entities.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php index c13b4c731..e010a3fa7 100644 --- a/engine/tests/objects/entities.php +++ b/engine/tests/objects/entities.php @@ -89,21 +89,21 @@ class ElggCoreEntityTest extends ElggCoreUnitTest { $this->assertFalse(isset($this->entity->non_existent)); // create metadata - $this->assertTrue($this->entity->non_existent = 'testing'); + $this->entity->existent = 'testing'; + $this->assertIdentical($this->entity->existent, 'testing'); // check metadata set - $this->assertTrue(isset($this->entity->non_existent)); - $this->assertIdentical($this->entity->non_existent, 'testing'); - $this->assertIdentical($this->entity->getMetaData('non_existent'), 'testing'); + $this->assertTrue(isset($this->entity->existent)); + $this->assertIdentical($this->entity->getMetaData('existent'), 'testing'); // check internal metadata array $metadata = $this->entity->expose_metadata(); - $this->assertIdentical($metadata['non_existent'], 'testing'); + $this->assertIdentical($metadata['existent'], 'testing'); } public function testElggEnityGetAndSetAnnotations() { $this->assertFalse(array_key_exists('non_existent', $this->entity->expose_annotations())); - $this->assertFalse($this->entity->getAnnotations('non_existent')); + $this->assertIdentical($this->entity->getAnnotations('non_existent'), array()); // set and check temp annotation $this->assertTrue($this->entity->annotate('non_existent', 'testing')); -- cgit v1.2.3 From 1dc08335584dac4630fd7fdf638bb6c6e0d85cb3 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 17 Nov 2011 22:18:42 -0500 Subject: Fixes #4120 metadata tests now check for the correct types --- engine/tests/api/metadata.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/tests/api/metadata.php b/engine/tests/api/metadata.php index 7897b8d47..f5b615ca8 100644 --- a/engine/tests/api/metadata.php +++ b/engine/tests/api/metadata.php @@ -58,11 +58,11 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { $this->create_metastring('tested'); // create_metadata returns id of metadata on success - $this->assertTrue(create_metadata($this->object->guid, 'metaUnitTest', 'tested')); + $this->assertNotEqual(false, create_metadata($this->object->guid, 'metaUnitTest', 'tested')); // check value with improper case $options = array('metadata_names' => 'metaUnitTest', 'metadata_values' => 'Tested', 'limit' => 10, 'metadata_case_sensitive' => TRUE); - $this->assertFalse(elgg_get_entities_from_metadata($options)); + $this->assertIdentical(array(), elgg_get_entities_from_metadata($options)); // compare forced case with ignored case $options = array('metadata_names' => 'metaUnitTest', 'metadata_values' => 'tested', 'limit' => 10, 'metadata_case_sensitive' => TRUE); -- cgit v1.2.3 From d792a0987ef0c3f292c038effded241793b32b73 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 18 Nov 2011 06:25:25 -0500 Subject: Fixes #4114 checking type for acl test --- engine/tests/api/access_collections.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/tests/api/access_collections.php b/engine/tests/api/access_collections.php index 0c37fa779..7875b1409 100644 --- a/engine/tests/api/access_collections.php +++ b/engine/tests/api/access_collections.php @@ -76,7 +76,7 @@ class ElggCoreAccessCollectionsTest extends ElggCoreUnitTest { $q = "SELECT * FROM {$this->dbPrefix}access_collections WHERE id = $acl_id"; $data = get_data($q); - $this->assertFalse($data); + $this->assertIdentical(array(), $data); } } -- cgit v1.2.3 From e1b2cf3b9499f0a5a649e4695f7a26d3a3bf6ddb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 18 Nov 2011 06:33:17 -0500 Subject: Fixes #4104, #4105 fixed casting in testElggEntityMetadata() --- engine/tests/objects/entities.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php index e010a3fa7..06bc80a4a 100644 --- a/engine/tests/objects/entities.php +++ b/engine/tests/objects/entities.php @@ -230,24 +230,26 @@ class ElggCoreEntityTest extends ElggCoreUnitTest { // let's delete a non-existent metadata $this->assertFalse($this->entity->deleteMetadata('important')); - // let's add the meatadata - $this->assertTrue($this->entity->important = 'indeed!'); - $this->assertTrue($this->entity->less_important = 'true, too!'); + // let's add the metadata + $this->entity->important = 'indeed!'; + $this->assertIdentical('indeed!', $this->entity->important); + $this->entity->less_important = 'true, too!'; + $this->assertIdentical('true, too!', $this->entity->less_important); $this->save_entity(); // test deleting incorrectly // @link http://trac.elgg.org/ticket/2273 - $this->assertFalse($this->entity->deleteMetadata('impotent')); + $this->assertNull($this->entity->deleteMetadata('impotent')); $this->assertEqual($this->entity->important, 'indeed!'); // get rid of one metadata $this->assertEqual($this->entity->important, 'indeed!'); $this->assertTrue($this->entity->deleteMetadata('important')); - $this->assertEqual($this->entity->important, ''); + $this->assertNull($this->entity->important); // get rid of all metadata $this->assertTrue($this->entity->deleteMetadata()); - $this->assertEqual($this->entity->less_important, ''); + $this->assertNull($this->entity->less_important); // clean up database $this->assertTrue($this->entity->delete()); -- cgit v1.2.3 From 51e2a993373b9f39c1c2b7f308dd308d320feb0a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 18 Nov 2011 06:42:45 -0500 Subject: Fixes #4108 delete() returns bool now and updated unit tests --- engine/lib/entities.php | 2 +- engine/tests/objects/entities.php | 2 +- engine/tests/objects/sites.php | 6 ++++-- engine/tests/objects/users.php | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index fd2b0e9f9..d8db88462 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1563,7 +1563,7 @@ function delete_entity($guid, $recursive = true) { } } - return $res; + return (bool)$res; } } } diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php index 06bc80a4a..1772f7c1a 100644 --- a/engine/tests/objects/entities.php +++ b/engine/tests/objects/entities.php @@ -178,7 +178,7 @@ class ElggCoreEntityTest extends ElggCoreUnitTest { $this->AssertEqual($this->entity->get('non_existent'), 'testing'); // clean up with delete - $this->assertTrue($this->entity->delete()); + $this->assertIdentical(true, $this->entity->delete()); } public function testElggEntityDisableAndEnable() { diff --git a/engine/tests/objects/sites.php b/engine/tests/objects/sites.php index e5acbb3f9..a05074c59 100644 --- a/engine/tests/objects/sites.php +++ b/engine/tests/objects/sites.php @@ -66,8 +66,10 @@ class ElggCoreSiteTest extends ElggCoreUnitTest { } public function testElggSiteSaveAndDelete() { - $this->assertTrue($this->site->save()); - $this->assertTrue($this->site->delete()); + $guid = $this->site->save(); + $this->assertIsA($guid, 'int'); + $this->assertTrue($guid > 0); + $this->assertIdentical(true, $this->site->delete()); } } diff --git a/engine/tests/objects/users.php b/engine/tests/objects/users.php index d1533c3d2..901d76ac0 100644 --- a/engine/tests/objects/users.php +++ b/engine/tests/objects/users.php @@ -138,7 +138,7 @@ class ElggCoreUserTest extends ElggCoreUnitTest { $guid = $this->user->save(); // delete object - $this->assertTrue($this->user->delete()); + $this->assertIdentical(true, $this->user->delete()); // check GUID not in database $this->assertFalse($this->fetchUser($guid)); -- cgit v1.2.3 From a77a8f5c4a1e76aa9beb18a2b3c938b3082fa4a8 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 18 Nov 2011 06:46:03 -0500 Subject: Fixes #4109 remove inaccurate comment due to copy & paste --- engine/tests/api/metastrings.php | 6 ------ engine/tests/objects/sites.php | 3 --- engine/tests/objects/users.php | 3 --- engine/tests/test_skeleton.php | 3 --- 4 files changed, 15 deletions(-) diff --git a/engine/tests/api/metastrings.php b/engine/tests/api/metastrings.php index 9b5d7ee4e..0a008c6ce 100644 --- a/engine/tests/api/metastrings.php +++ b/engine/tests/api/metastrings.php @@ -68,9 +68,6 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest { parent::__destruct(); } - /** - * A basic test that will be called and fail. - */ public function testDeleteByID() { $db_prefix = elgg_get_config('dbprefix'); $annotations = $this->createAnnotations(1); @@ -101,9 +98,6 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest { } } - /** - * A basic test that will be called and fail. - */ public function testEnableDisableByID() { $db_prefix = elgg_get_config('dbprefix'); $annotations = $this->createAnnotations(1); diff --git a/engine/tests/objects/sites.php b/engine/tests/objects/sites.php index a05074c59..a01a661e3 100644 --- a/engine/tests/objects/sites.php +++ b/engine/tests/objects/sites.php @@ -36,9 +36,6 @@ class ElggCoreSiteTest extends ElggCoreUnitTest { parent::__destruct(); } - /** - * A basic test that will be called and fail. - */ public function testElggSiteConstructor() { $attributes = array(); $attributes['guid'] = NULL; diff --git a/engine/tests/objects/users.php b/engine/tests/objects/users.php index 901d76ac0..a3573acb6 100644 --- a/engine/tests/objects/users.php +++ b/engine/tests/objects/users.php @@ -41,9 +41,6 @@ class ElggCoreUserTest extends ElggCoreUnitTest { parent::__destruct(); } - /** - * A basic test that will be called and fail. - */ public function testElggUserConstructor() { $attributes = array(); $attributes['guid'] = NULL; diff --git a/engine/tests/test_skeleton.php b/engine/tests/test_skeleton.php index e5ff557e5..5a5de89bb 100644 --- a/engine/tests/test_skeleton.php +++ b/engine/tests/test_skeleton.php @@ -49,9 +49,6 @@ class ElggCoreSkeletonTest extends ElggCoreUnitTest { parent::__destruct(); } - /** - * A basic test that will be called and fail. - */ public function testFailure() { $this->assertTrue(FALSE); } -- cgit v1.2.3 From 597641b401a73d6d5cd7f35f052095105bd2fb22 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:15:02 -0500 Subject: Fixes #4112 get_user_by_username() returns false if no user --- engine/lib/users.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/lib/users.php b/engine/lib/users.php index 9cb8ddfa7..29fa4db2f 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -565,6 +565,8 @@ function get_user_by_username($username) { $entity = get_data_row($query, 'entity_row_to_elggstar'); if ($entity) { $USERNAME_TO_GUID_MAP_CACHE[$username] = $entity->guid; + } else { + $entity = false; } return $entity; -- cgit v1.2.3 From 3a9198cc650ce3d55fa6227de21b63d327c4e62f Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:35:32 -0500 Subject: Fixes #4122, #4123, #4124 testing for empty arrays and added some documentation for the sanity of future developers --- engine/tests/api/entity_getter_functions.php | 63 ++++++++++++++++++---------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/engine/tests/api/entity_getter_functions.php b/engine/tests/api/entity_getter_functions.php index e7906d3c8..a548a8e52 100644 --- a/engine/tests/api/entity_getter_functions.php +++ b/engine/tests/api/entity_getter_functions.php @@ -175,9 +175,10 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } /** + * Get a mix of valid and invalid types * - * @param unknown_type $num - * @return unknown_type + * @param int $num + * @return array */ public function getRandomMixedTypes($num = 2) { $have_valid = $have_invalid = false; @@ -196,8 +197,8 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { * Get random mix of valid and invalid subtypes for types given. * * @param array $types - * @param unknown_type $num - * @return unknown_type + * @param int $num + * @return array */ public function getRandomMixedSubtypes(array $types, $num = 2) { $types_c = count($types); @@ -230,8 +231,8 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { /** * Creates random annotations on $entity * - * @param unknown_type $entity - * @param unknown_type $max + * @param ElggEntity $entity + * @param int $max */ public function createRandomAnnotations($entity, $max = 1) { $annotations = array(); @@ -563,7 +564,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { * TYPE_SUBTYPE_PAIRS ***************************/ - + /** + * Valid type, valid subtype pairs + */ public function testElggAPIGettersTSPValidTypeValidSubtype() { $type_num = 1; $subtype_num = 1; @@ -586,6 +589,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } } + /** + * Valid type, multiple valid subtypes + */ public function testElggAPIGettersTSPValidTypeValidPluralSubtype() { $type_num = 1; $subtype_num = 3; @@ -608,6 +614,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } } + /** + * Valid type, both valid and invalid subtypes + */ public function testElggAPIGettersTSPValidTypeMixedPluralSubtype() { $type_num = 1; $valid_subtype_num = 2; @@ -635,9 +644,6 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } - - - /**************************** * FALSE-RETURNING TESTS **************************** @@ -652,8 +658,8 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { */ - /* - * Test invalid types. + /** + * Test invalid types with singular 'type'. */ public function testElggApiGettersInvalidTypeUsingType() { $type_arr = $this->getRandomInvalids(); @@ -667,7 +673,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $this->assertFalse($es); } - + /** + * Test invalid types with plural 'types'. + */ public function testElggApiGettersInvalidTypeUsingTypesAsString() { $type_arr = $this->getRandomInvalids(); $type = $type_arr[0]; @@ -680,8 +688,11 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $this->assertFalse($es); } + /** + * Test invalid types with plural 'types' and an array of a single type + */ public function testElggApiGettersInvalidTypeUsingTypesAsArray() { - $type_arr = $this->getRandomInvalids(); + $type_arr = $this->getRandomInvalids(1); $options = array( 'types' => $type_arr @@ -691,6 +702,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $this->assertFalse($es); } + /** + * Test invalid types with plural 'types' and an array of a two types + */ public function testElggApiGettersInvalidTypes() { $type_arr = $this->getRandomInvalids(2); @@ -1053,7 +1067,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $entities = elgg_get_entities_from_metadata($options); - $this->assertFalse($entities); + $this->assertIdentical(array(), $entities); $e->delete(); } @@ -1081,7 +1095,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $entities = elgg_get_entities_from_metadata($options); - $this->assertFalse($entities); + $this->assertIdentical(array(), $entities); $e->delete(); } @@ -1214,7 +1228,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } } - function testElggApiGettersEntityMetadatavalueInvalidSingle() { + function testElggApiGettersEntityMetadataValueInvalidSingle() { $subtypes = $this->getRandomValidSubtypes(array('object'), 1); $subtype = $subtypes[0]; $md_name = 'test_metadata_name_' . rand(); @@ -1235,7 +1249,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $entities = elgg_get_entities_from_metadata($options); - $this->assertFalse($entities); + $this->assertIdentical(array(), $entities); $e->delete(); } @@ -1263,7 +1277,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $entities = elgg_get_entities_from_metadata($options); - $this->assertFalse($entities); + $this->assertIdentical(array(), $entities); $e->delete(); } @@ -1641,6 +1655,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } } + /** + * Name value pair with valid name and invalid value + */ function testElggApiGettersEntityMetadataNVPValidNInvalidV() { $subtypes = $this->getRandomValidSubtypes(array('object'), 1); $subtype = $subtypes[0]; @@ -1676,7 +1693,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $entities = elgg_get_entities_from_metadata($options); - $this->assertFalse($entities); + $this->assertIdentical(array(), $entities); foreach ($guids as $guid) { if ($e = get_entity($guid)) { @@ -1685,7 +1702,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { } } - + /** + * Name value pair with invalid name and valid value + */ function testElggApiGettersEntityMetadataNVPInvalidNValidV() { $subtypes = $this->getRandomValidSubtypes(array('object'), 1); $subtype = $subtypes[0]; @@ -1721,7 +1740,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $entities = elgg_get_entities_from_metadata($options); - $this->assertFalse($entities); + $this->assertIdentical(array(), $entities); foreach ($guids as $guid) { if ($e = get_entity($guid)) { -- cgit v1.2.3 From afba00a6f029366be6ce0972042832dd3b9adaf8 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:39:55 -0500 Subject: Fixes #4125 checking count correctly --- engine/tests/api/entity_getter_functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/tests/api/entity_getter_functions.php b/engine/tests/api/entity_getter_functions.php index a548a8e52..7b977da61 100644 --- a/engine/tests/api/entity_getter_functions.php +++ b/engine/tests/api/entity_getter_functions.php @@ -2102,7 +2102,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $es = elgg_get_entities_from_relationship($options); $this->assertTrue(is_array($es)); - $this->assertTrue(count($es), 1); + $this->assertIdentical(count($es), 1); foreach ($es as $e) { $this->assertEqual($guids[1], $e->guid); @@ -2134,7 +2134,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $es = elgg_get_entities_from_relationship($options); $this->assertTrue(is_array($es)); - $this->assertTrue(count($es), 1); + $this->assertIdentical(count($es), 1); foreach ($es as $e) { $this->assertEqual($guids[1], $e->guid); @@ -2170,7 +2170,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { $es = elgg_get_entities_from_relationship($options); $this->assertTrue(is_array($es)); - $this->assertTrue(count($es), 1); + $this->assertIdentical(count($es), 1); foreach ($es as $e) { $this->assertEqual($guids[1], $e->guid); -- cgit v1.2.3 From 3d975e028c3d5bde2ee8a5c9e09d7650b8f3c505 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:41:58 -0500 Subject: Fixes #4113 returning a bool from delete_access_collection() --- engine/lib/access.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engine/lib/access.php b/engine/lib/access.php index 97f744fb9..ba3820f46 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -610,8 +610,7 @@ function delete_access_collection($collection_id) { WHERE id = {$collection_id}"; $result = delete_data($q); - - return $result; + return (bool)$result; } /** -- cgit v1.2.3 From 15f02eea51f0f0eb92e427b627324d58af166e5e Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:44:45 -0500 Subject: Fixes #4115 returning bool from remove_user_from_access_collection() --- engine/lib/access.php | 2 +- engine/tests/api/access_collections.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/lib/access.php b/engine/lib/access.php index ba3820f46..08b9283cd 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -717,7 +717,7 @@ function remove_user_from_access_collection($user_guid, $collection_id) { WHERE access_collection_id = {$collection_id} AND user_guid = {$user_guid}"; - return delete_data($q); + return (bool)delete_data($q); } /** diff --git a/engine/tests/api/access_collections.php b/engine/tests/api/access_collections.php index 7875b1409..bea995a6e 100644 --- a/engine/tests/api/access_collections.php +++ b/engine/tests/api/access_collections.php @@ -88,7 +88,7 @@ class ElggCoreAccessCollectionsTest extends ElggCoreUnitTest { if ($result) { $result = remove_user_from_access_collection($this->user->guid, $acl_id); - $this->assertTrue($result); + $this->assertIdentical(true, $result); } delete_access_collection($acl_id); -- cgit v1.2.3 From 30630b3a25e37430d966af6e6af933b7d000ab1a Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:50:36 -0500 Subject: Fixes #4118 returning bool from leave group functions --- engine/classes/ElggGroup.php | 6 +++--- engine/lib/relationships.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/classes/ElggGroup.php b/engine/classes/ElggGroup.php index 49ba27204..5c16e978f 100644 --- a/engine/classes/ElggGroup.php +++ b/engine/classes/ElggGroup.php @@ -309,7 +309,7 @@ class ElggGroup extends ElggEntity * * @param ElggUser $user User * - * @return void + * @return bool */ public function leave(ElggUser $user) { return leave_group($this->getGUID(), $user->getGUID()); @@ -322,7 +322,7 @@ class ElggGroup extends ElggEntity * * @param int $guid GUID of an ElggGroup entity * - * @return true + * @return bool */ protected function load($guid) { // Test to see if we have the generic stuff @@ -340,7 +340,7 @@ class ElggGroup extends ElggEntity $row = get_group_entity_as_row($guid); if (($row) && (!$this->isFullyLoaded())) { // If $row isn't a cached copy then increment the counter - $this->attributes['tables_loaded'] ++; + $this->attributes['tables_loaded']++; } // Now put these into the attributes array as core values diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index 3578f0cb8..5b7080b56 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -158,7 +158,7 @@ function remove_entity_relationship($guid_one, $relationship, $guid_two) { and relationship='$relationship' and guid_two=$guid_two"; - return delete_data($query); + return (bool)delete_data($query); } else { return false; } -- cgit v1.2.3 From c872edbb476cf0a0c742c6e7a987096e15464f00 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:53:29 -0500 Subject: Fixes #4126 fixed test for checking relationship existence --- engine/tests/api/entity_getter_functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/tests/api/entity_getter_functions.php b/engine/tests/api/entity_getter_functions.php index 7b977da61..9db248de9 100644 --- a/engine/tests/api/entity_getter_functions.php +++ b/engine/tests/api/entity_getter_functions.php @@ -2597,7 +2597,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { foreach ($fan_entities as $fan_entity) { $this->assertTrue(in_array($fan_entity->guid, $relationships[$e->guid])); - $this->assertTrue(check_entity_relationship($fan_entity->guid, $relationship_name, $e->guid)); + $this->assertNotIdentical(false, check_entity_relationship($fan_entity->guid, $relationship_name, $e->guid)); } } } -- cgit v1.2.3 From ff907019418cd1635cba8b1c225827a20eedfe2c Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 17:59:50 -0500 Subject: Fixes #4129 fixed priority list tests --- engine/tests/api/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/tests/api/helpers.php b/engine/tests/api/helpers.php index f48f91faf..8896fc33f 100644 --- a/engine/tests/api/helpers.php +++ b/engine/tests/api/helpers.php @@ -351,7 +351,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest { $test_elements = $pl->getElements(); // make sure it's gone. - $this->assertTrue(2, count($test_elements)); + $this->assertEqual(2, count($test_elements)); $this->assertIdentical($elements[0], $test_elements[0]); $this->assertIdentical($elements[2], $test_elements[2]); } @@ -369,7 +369,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest { $pl->add($element, $priority); } - $this->assertTrue($pl->move($elements[-5], 10)); + $this->assertEqual($pl->move($elements[-5], 10), 10); // check it's at the new place $this->assertIdentical($elements[-5], $pl->getElement(10)); -- cgit v1.2.3 From f3b50d11966eb75c648e317ab11045913e28e56a Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 18:02:39 -0500 Subject: Fixes #4131 elgg_delete_metastring_based_object_by_id() should return a bool --- engine/lib/metastrings.php | 2 +- engine/tests/api/metastrings.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php index 9dccec700..9fe9b4bff 100644 --- a/engine/lib/metastrings.php +++ b/engine/lib/metastrings.php @@ -810,7 +810,7 @@ function elgg_delete_metastring_based_object_by_id($id, $type) { } if (($obj->canEdit()) && (elgg_trigger_event('delete', $type, $obj))) { - return delete_data("DELETE from $table where id=$id"); + return (bool)delete_data("DELETE from $table where id=$id"); } } diff --git a/engine/tests/api/metastrings.php b/engine/tests/api/metastrings.php index 0a008c6ce..f6870d34b 100644 --- a/engine/tests/api/metastrings.php +++ b/engine/tests/api/metastrings.php @@ -80,7 +80,7 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest { $test = get_data($q); $this->assertEqual($test[0]->id, $id); - $this->assertTrue(elgg_delete_metastring_based_object_by_id($id, $type)); + $this->assertIdentical(true, elgg_delete_metastring_based_object_by_id($id, $type)); $this->assertFalse(get_data($q)); } } -- cgit v1.2.3 From 079a7bd1cf925b2b624d0af491347f997e863d0b Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 18:05:36 -0500 Subject: Fixes #4132 fixed metastring delete by id test --- engine/tests/api/metastrings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/tests/api/metastrings.php b/engine/tests/api/metastrings.php index f6870d34b..a96388217 100644 --- a/engine/tests/api/metastrings.php +++ b/engine/tests/api/metastrings.php @@ -81,7 +81,7 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest { $this->assertEqual($test[0]->id, $id); $this->assertIdentical(true, elgg_delete_metastring_based_object_by_id($id, $type)); - $this->assertFalse(get_data($q)); + $this->assertIdentical(array(), get_data($q)); } } -- cgit v1.2.3 From 4a5856e451b95bc85a2f3e80d76aebbd37ec39b1 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 18:24:27 -0500 Subject: Fixes #4133 updated type in plugin manifest test --- engine/classes/ElggPluginManifest.php | 2 +- engine/tests/api/plugins.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index eacc16455..7592eb667 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -553,7 +553,7 @@ class ElggPluginManifest { } /** - * Returns the admin interface to use. + * Should this plugin be activated when Elgg is installed * * @return bool */ diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index a0faaff0e..ac38f34ea 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -105,7 +105,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => 1.0), ), - 'activate_on_install' => true + // string because we are reading from a file + 'activate_on_install' => 'true', ); $this->assertEqual($this->manifest18->getManifest(), $manifest_array); -- cgit v1.2.3 From af8415b62ef7eede3666e6a050b5f1e292d7d54e Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 21:31:21 -0500 Subject: Fixes #4134 improved plugin manifest tests by using assertIdentical more --- engine/tests/api/plugins.php | 46 +++++++++++++------------- engine/tests/test_files/plugin_18/manifest.xml | 4 +-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index ac38f34ea..8ecb0a46c 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -93,23 +93,23 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { ), 'conflicts' => array( - array('type' => 'plugin', 'name' => 'profile_api', 'version' => 1.0) + array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.0') ), 'provides' => array( - array('type' => 'plugin', 'name' => 'profile_api', 'version' => 1.3), - array('type' => 'php_extension', 'name' => 'big_math', 'version' => 1.0) + array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.3'), + array('type' => 'php_extension', 'name' => 'big_math', 'version' => '1.0') ), 'suggests' => array( - array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => 1.0), + array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => '1.0'), ), // string because we are reading from a file 'activate_on_install' => 'true', ); - $this->assertEqual($this->manifest18->getManifest(), $manifest_array); + $this->assertIdentical($this->manifest18->getManifest(), $manifest_array); } public function testElggPluginManifest17() { @@ -124,7 +124,7 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { 'name' => 'Plugin Test 17', ); - $this->assertEqual($this->manifest17->getManifest(), $manifest_array); + $this->assertIdentical($this->manifest17->getManifest(), $manifest_array); } @@ -181,7 +181,7 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'elgg_version', 'version' => '3009030802', 'comparison' => 'lt'), array('type' => 'elgg_release', 'version' => '1.8-svn', 'comparison' => 'ge'), array('type' => 'php_extension', 'name' => 'gd', 'version' => '', 'comparison' => '='), - array('type' => 'php_ini', 'name' => 'short_open_tag', 'value' => 'off', 'comparison' => '='), + array('type' => 'php_ini', 'name' => 'short_open_tag', 'value' => 0, 'comparison' => '='), array('type' => 'php_extension', 'name' => 'made_up', 'version' => '1.0', 'comparison' => '='), array('type' => 'plugin', 'name' => 'fake_plugin', 'version' => '1.0', 'comparison' => 'ge'), array('type' => 'plugin', 'name' => 'profile', 'version' => '1.0', 'comparison' => 'ge'), @@ -189,13 +189,13 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'priority', 'priority' => 'after', 'plugin' => 'profile'), ); - $this->assertEqual($this->package18->getManifest()->getRequires(), $requires); + $this->assertIdentical($this->package18->getManifest()->getRequires(), $requires); $requires = array( array('type' => 'elgg_version', 'version' => '2009030702', 'comparison' => 'ge') ); - $this->assertEqual($this->package17->getManifest()->getRequires(), $requires); + $this->assertIdentical($this->package17->getManifest()->getRequires(), $requires); } public function testElggPluginManifestGetSuggests() { @@ -203,11 +203,11 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => '1.0', 'comparison' => 'ge'), ); - $this->assertEqual($this->package18->getManifest()->getSuggests(), $suggests); + $this->assertIdentical($this->package18->getManifest()->getSuggests(), $suggests); $suggests = array(); - $this->assertEqual($this->package17->getManifest()->getSuggests(), $suggests); + $this->assertIdentical($this->package17->getManifest()->getSuggests(), $suggests); } public function testElggPluginManifestGetDescription() { @@ -220,8 +220,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { 'Admin', 'ServiceAPI' ); - $this->assertEqual($this->package18->getManifest()->getCategories(), $categories); - $this->assertEqual($this->package17->getManifest()->getCategories(), array()); + $this->assertIdentical($this->package18->getManifest()->getCategories(), $categories); + $this->assertIdentical($this->package17->getManifest()->getCategories(), array()); } public function testElggPluginManifestGetScreenshots() { @@ -230,25 +230,25 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('description' => 'Fun things to do 2', 'path' => 'graphics/plugin_ss2.png'), ); - $this->assertEqual($this->package18->getManifest()->getScreenshots(), $screenshots); - $this->assertEqual($this->package17->getManifest()->getScreenshots(), array()); + $this->assertIdentical($this->package18->getManifest()->getScreenshots(), $screenshots); + $this->assertIdentical($this->package17->getManifest()->getScreenshots(), array()); } public function testElggPluginManifestGetProvides() { $provides = array( - array('type' => 'plugin', 'name' => 'profile_api', 'version' => 1.3), - array('type' => 'php_extension', 'name' => 'big_math', 'version' => 1.0), - array('type' => 'plugin', 'name' => 'plugin_18', 'version' => 1.0) + array('type' => 'plugin', 'name' => 'profile_api', 'version' => '1.3'), + array('type' => 'php_extension', 'name' => 'big_math', 'version' => '1.0'), + array('type' => 'plugin', 'name' => 'plugin_18', 'version' => '1.0') ); - $this->assertEqual($this->package18->getManifest()->getProvides(), $provides); + $this->assertIdentical($this->package18->getManifest()->getProvides(), $provides); $provides = array( array('type' => 'plugin', 'name' => 'plugin_17', 'version' => '1.0') ); - $this->assertEqual($this->package17->getManifest()->getProvides(), $provides); + $this->assertIdentical($this->package17->getManifest()->getProvides(), $provides); } public function testElggPluginManifestGetConflicts() { @@ -261,12 +261,12 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { ) ); - $this->assertEqual($this->manifest18->getConflicts(), $conflicts); - $this->assertEqual($this->manifest17->getConflicts(), array()); + $this->assertIdentical($this->manifest18->getConflicts(), $conflicts); + $this->assertIdentical($this->manifest17->getConflicts(), array()); } public function testElggPluginManifestGetActivateOnInstall() { - $this->assertEqual($this->manifest18->getActivateOnInstall(), true); + $this->assertIdentical($this->manifest18->getActivateOnInstall(), true); } // ElggPluginPackage diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml index e0776ffc1..9654b6422 100644 --- a/engine/tests/test_files/plugin_18/manifest.xml +++ b/engine/tests/test_files/plugin_18/manifest.xml @@ -34,8 +34,6 @@ ServiceAPI - true - php_extension gd @@ -102,4 +100,6 @@ 1.0 + true + -- cgit v1.2.3 From 0aacda8b1fa77999f4e00d73e9fd1c416d75f920 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 21:32:11 -0500 Subject: Fixes #4128 better test of null passed to registering external files --- engine/tests/api/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/tests/api/helpers.php b/engine/tests/api/helpers.php index 8896fc33f..77205138d 100644 --- a/engine/tests/api/helpers.php +++ b/engine/tests/api/helpers.php @@ -127,7 +127,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest { $this->assertIdentical('http://test1.com', $item->url); // send a bad url - $result = @elgg_register_js('bad'); + $result = elgg_register_js('bad', null); $this->assertFalse($result); } -- cgit v1.2.3 From d9848f73bdfbf3bca6fbfe9939e307775279da91 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 21:35:15 -0500 Subject: Fixes #4085 accepting . in usernames for the wire --- mod/thewire/start.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/thewire/start.php b/mod/thewire/start.php index c0890344f..328e5d46c 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -217,7 +217,7 @@ function thewire_filter($text) { // usernames $text = preg_replace( - '/(^|[^\w])@([\w]+)/', + '/(^|[^\w])@([\w.]+)/', '$1@$2', $text); -- cgit v1.2.3 From 52f2f64c6bdd79bb8eca3a8c0bd8108e012d9336 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 21:57:52 -0500 Subject: Fixes #4111 guid is now an int --- engine/classes/ElggEntity.php | 3 +++ engine/classes/ElggGroup.php | 3 +++ engine/classes/ElggObject.php | 5 ++++- engine/classes/ElggSite.php | 5 ++++- engine/classes/ElggUser.php | 5 ++++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index fdf2a80ea..df87082fe 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -1335,6 +1335,9 @@ abstract class ElggEntity extends ElggData implements $this->attributes['tables_loaded']++; } + // guid needs to be an int http://trac.elgg.org/ticket/4111 + $this->attributes['guid'] = (int)$this->attributes['guid']; + // Cache object handle if ($this->attributes['guid']) { cache_entity($this); diff --git a/engine/classes/ElggGroup.php b/engine/classes/ElggGroup.php index 5c16e978f..0190e5eac 100644 --- a/engine/classes/ElggGroup.php +++ b/engine/classes/ElggGroup.php @@ -349,6 +349,9 @@ class ElggGroup extends ElggEntity $this->attributes[$key] = $value; } + // guid needs to be an int http://trac.elgg.org/ticket/4111 + $this->attributes['guid'] = (int)$this->attributes['guid']; + return true; } diff --git a/engine/classes/ElggObject.php b/engine/classes/ElggObject.php index caccfb038..0b8340697 100644 --- a/engine/classes/ElggObject.php +++ b/engine/classes/ElggObject.php @@ -110,7 +110,7 @@ class ElggObject extends ElggEntity { $row = get_object_entity_as_row($guid); if (($row) && (!$this->isFullyLoaded())) { // If $row isn't a cached copy then increment the counter - $this->attributes['tables_loaded'] ++; + $this->attributes['tables_loaded']++; } // Now put these into the attributes array as core values @@ -119,6 +119,9 @@ class ElggObject extends ElggEntity { $this->attributes[$key] = $value; } + // guid needs to be an int http://trac.elgg.org/ticket/4111 + $this->attributes['guid'] = (int)$this->attributes['guid']; + return true; } diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php index 16b80b9d3..5c44d4076 100644 --- a/engine/classes/ElggSite.php +++ b/engine/classes/ElggSite.php @@ -128,7 +128,7 @@ class ElggSite extends ElggEntity { $row = get_site_entity_as_row($guid); if (($row) && (!$this->isFullyLoaded())) { // If $row isn't a cached copy then increment the counter - $this->attributes['tables_loaded'] ++; + $this->attributes['tables_loaded']++; } // Now put these into the attributes array as core values @@ -137,6 +137,9 @@ class ElggSite extends ElggEntity { $this->attributes[$key] = $value; } + // guid needs to be an int http://trac.elgg.org/ticket/4111 + $this->attributes['guid'] = (int)$this->attributes['guid']; + return true; } diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php index 75ac008f6..a1c7147a5 100644 --- a/engine/classes/ElggUser.php +++ b/engine/classes/ElggUser.php @@ -114,7 +114,7 @@ class ElggUser extends ElggEntity $row = get_user_entity_as_row($guid); if (($row) && (!$this->isFullyLoaded())) { // If $row isn't a cached copy then increment the counter - $this->attributes['tables_loaded'] ++; + $this->attributes['tables_loaded']++; } // Now put these into the attributes array as core values @@ -123,6 +123,9 @@ class ElggUser extends ElggEntity $this->attributes[$key] = $value; } + // guid needs to be an int http://trac.elgg.org/ticket/4111 + $this->attributes['guid'] = (int)$this->attributes['guid']; + return true; } -- cgit v1.2.3 From 7fb01974030d89b4b7c64578b2640ead3b2175e7 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:03:22 -0500 Subject: Fixes #3929 used a combination of min-width/max-width and overflow hidden to provide better support for long names --- views/default/css/elements/navigation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index bf1046dda..6515fc975 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -372,7 +372,10 @@ position: absolute; z-index: 10000; - width: 165px; + overflow: hidden; + + min-width: 165px; + max-width: 250px; border: solid 1px; border-color: #E5E5E5 #999 #999 #E5E5E5; background-color: #FFF; -- cgit v1.2.3 From 37426fc75b3b2cff67bd8a42b33252949270dee6 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:07:31 -0500 Subject: Fixes #3996 displaying message when basic site settings are saved --- actions/admin/site/update_basic.php | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php index c809dc671..45f00a20d 100644 --- a/actions/admin/site/update_basic.php +++ b/actions/admin/site/update_basic.php @@ -24,4 +24,5 @@ if (datalist_get('default_site')) { set_config('language', get_input('language'), $site->getGUID()); } +system_message(elgg_echo('admin:configuration:success')); forward(REFERER); \ No newline at end of file -- cgit v1.2.3 From 71b9a1c21e3eec65f577a05a8e1ff86548e3aa4c Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:09:23 -0500 Subject: line between settings and save button not needed --- views/default/forms/admin/site/update_advanced.php | 2 +- views/default/forms/admin/site/update_basic.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php index e12764092..5155fc415 100644 --- a/views/default/forms/admin/site/update_advanced.php +++ b/views/default/forms/admin/site/update_advanced.php @@ -91,7 +91,7 @@ $form_body .= "
      "; $form_body .= elgg_view('input/hidden', array('name' => 'settings', 'value' => 'go')); -$form_body .= '
      '; +$form_body .= '
      '; $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); $form_body .= '
      '; diff --git a/views/default/forms/admin/site/update_basic.php b/views/default/forms/admin/site/update_basic.php index 66722aef2..88870bc60 100644 --- a/views/default/forms/admin/site/update_basic.php +++ b/views/default/forms/admin/site/update_basic.php @@ -24,7 +24,7 @@ $form_body .= elgg_view("input/dropdown", array( 'options_values' => $languages, )) . "
      "; -$form_body .= '
      '; +$form_body .= '
      '; $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); $form_body .= '
      '; -- cgit v1.2.3 From 77d6a5b9afe3f6dabfad4bda5d7c735cd48deeec Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:18:47 -0500 Subject: don't want hover menu or link on owner block icon in profile --- mod/profile/views/default/profile/owner_block.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php index 35199726a..63cb5391a 100644 --- a/mod/profile/views/default/profile/owner_block.php +++ b/mod/profile/views/default/profile/owner_block.php @@ -11,7 +11,10 @@ if (!$user) { return TRUE; } -$icon = elgg_view_entity_icon($user, 'large', array('use_hover' => 'true')); +$icon = elgg_view_entity_icon($user, 'large', array( + 'use_hover' => false, + 'use_link' => false, +)); // grab the actions and admin menu items from user hover $menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array()); -- cgit v1.2.3 From db990aa3c55e9eb79455285d7d0d326974c970e3 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:28:18 -0500 Subject: Fixes #4093 making sure elgg.page_owner is defined --- js/lib/pageowner.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/lib/pageowner.js b/js/lib/pageowner.js index 825898416..c695c41c3 100644 --- a/js/lib/pageowner.js +++ b/js/lib/pageowner.js @@ -6,9 +6,13 @@ */ /** - * @return {number} The GUID of the logged in user + * @return {number} The GUID of the page owner entity or 0 for no owner */ elgg.get_page_owner_guid = function() { - return elgg.page_owner.guid || 0; + if (elgg.page_owner !== undefined) { + return elgg.page_owner.guid; + } else { + return 0; + } }; -- cgit v1.2.3 From ad161cd2bd5122c6a2adf65c5b8683d42f28b005 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:32:01 -0500 Subject: made status message a little more grammatical --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/en.php b/languages/en.php index 62effb334..5964580ad 100644 --- a/languages/en.php +++ b/languages/en.php @@ -1038,7 +1038,7 @@ Once you have logged in, we highly recommend that you change your password. 'email:settings' => "Email settings", 'email:address:label' => "Your email address", - 'email:save:success' => "New email address saved, verification requested.", + 'email:save:success' => "New email address saved. Verification is requested.", 'email:save:fail' => "Your new email address could not be saved.", 'friend:newfriend:subject' => "%s has made you a friend!", -- cgit v1.2.3 From 75c00c55dd9cc2de4d97f829d9b47c99eb4ba287 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:40:04 -0500 Subject: Fixes #3792 admin can edit settings again --- engine/lib/user_settings.php | 4 ++-- engine/lib/users.php | 5 +++++ languages/en.php | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php index 1e2d6db10..c71670357 100644 --- a/engine/lib/user_settings.php +++ b/engine/lib/user_settings.php @@ -265,8 +265,8 @@ function elgg_set_user_default_access() { * @access private */ function usersettings_pagesetup() { - if (elgg_get_context() == "settings" && elgg_get_logged_in_user_guid()) { - $user = elgg_get_logged_in_user_entity(); + if (elgg_get_context() == "settings") { + $user = elgg_get_page_owner_entity(); $params = array( 'name' => '1_account', diff --git a/engine/lib/users.php b/engine/lib/users.php index 29fa4db2f..3a86c1faa 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1283,6 +1283,11 @@ function elgg_user_hover_menu($hook, $type, $return, $params) { $item = new ElggMenuItem('profile:edit', elgg_echo('profile:edit'), $url); $item->setSection('admin'); $return[] = $item; + + $url = "settings/user/$user->username"; + $item = new ElggMenuItem('settings:edit', elgg_echo('settings:edit'), $url); + $item->setSection('admin'); + $return[] = $item; } return $return; diff --git a/languages/en.php b/languages/en.php index 5964580ad..af97e112d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -481,6 +481,7 @@ $english = array( 'account' => "Account", 'settings' => "Settings", 'tools' => "Tools", + 'settings:edit' => 'Edit settings', 'register' => "Register", 'registerok' => "You have successfully registered for %s.", -- cgit v1.2.3 From 7cc4c3139d8d75335bd7e9b21d99257ff8d3cc72 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 19 Nov 2011 07:45:33 -0500 Subject: Fixes #641 users can submit email address to reset password --- actions/login.php | 1 - actions/user/requestnewpassword.php | 5 +++++ languages/en.php | 10 +++++----- views/default/forms/user/requestnewpassword.php | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/actions/login.php b/actions/login.php index 5934d1423..c717faadd 100644 --- a/actions/login.php +++ b/actions/login.php @@ -28,7 +28,6 @@ if (empty($username) || empty($password)) { } // check if logging in with email address -// @todo Are usernames with @ not allowed? if (strpos($username, '@') !== FALSE && ($users = get_user_by_email($username))) { $username = $users[0]->username; } diff --git a/actions/user/requestnewpassword.php b/actions/user/requestnewpassword.php index 5dfa24952..f1d4fa43c 100644 --- a/actions/user/requestnewpassword.php +++ b/actions/user/requestnewpassword.php @@ -8,6 +8,11 @@ $username = get_input('username'); +// allow email addresses +if (strpos($username, '@') !== false && ($users = get_user_by_email($username))) { + $username = $users[0]->username; +} + $user = get_user_by_username($username); if ($user) { if (send_new_password_request($user->guid)) { diff --git a/languages/en.php b/languages/en.php index af97e112d..1576ed73d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -20,7 +20,7 @@ $english = array( 'login' => "Log in", 'loginok' => "You have been logged in.", 'loginerror' => "We couldn't log you in. Please check your credentials and try again.", - 'login:empty' => "Username and password are required.", + 'login:empty' => "Username/email and password are required.", 'login:baduser' => "Unable to load your user account.", 'auth:nopams' => "Internal error. No user authentication method installed.", @@ -222,8 +222,8 @@ $english = array( 'RegistrationException:EmptyPassword' => 'The password fields cannot be empty', 'RegistrationException:PasswordMismatch' => 'Passwords must match', 'LoginException:BannedUser' => 'You have been banned from this site and cannot log in', - 'LoginException:UsernameFailure' => 'We could not log you in. Please check your username and password.', - 'LoginException:PasswordFailure' => 'We could not log you in. Please check your username and password.', + 'LoginException:UsernameFailure' => 'We could not log you in. Please check your username/email and password.', + 'LoginException:PasswordFailure' => 'We could not log you in. Please check your username/email and password.', 'LoginException:AccountLocked' => 'Your account has been locked for too many log in failures.', 'LoginException:ChangePasswordFailure' => 'Failed current password check.', @@ -531,7 +531,7 @@ $english = array( 'user:password:resetreq:success' => 'Successfully requested a new password, email sent', 'user:password:resetreq:fail' => 'Could not request a new password.', - 'user:password:text' => 'To request a new password, enter your username below and click the Request button.', + 'user:password:text' => 'To request a new password, enter your username or email address below and click the Request button.', 'user:persistent' => 'Remember me', @@ -1064,7 +1064,7 @@ Your password has been reset to: %s", Somebody (from the IP address %s) has requested a new password for their account. -If you requested this click on the link below, otherwise ignore this email. +If you requested this, click on the link below. Otherwise ignore this email. %s ", diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php index 8a5a18734..c90971eaf 100644 --- a/views/default/forms/user/requestnewpassword.php +++ b/views/default/forms/user/requestnewpassword.php @@ -11,7 +11,7 @@
      -
      +
      'username', 'class' => 'elgg-autofocus', -- cgit v1.2.3 From 5f3935de2012b2bd88c0d6ba227570b54ce10bc6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 19 Nov 2011 07:59:33 -0500 Subject: Fixes #4102 handling no menu items for site menu --- views/default/navigation/menu/site.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/views/default/navigation/menu/site.php b/views/default/navigation/menu/site.php index 38b42bda9..24c21dd57 100644 --- a/views/default/navigation/menu/site.php +++ b/views/default/navigation/menu/site.php @@ -6,12 +6,15 @@ * @uses $vars['menu']['more'] */ +$default_items = elgg_extract('default', $vars['menu'], array()); +$more_items = elgg_extract('more', $vars['menu'], array()); + echo '
        '; -foreach ($vars['menu']['default'] as $menu_item) { +foreach ($default_items as $menu_item) { echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); } -if (isset($vars['menu']['more']) && !empty($vars['menu']['more'])) { +if ($more_items) { echo '
      • '; $more = elgg_echo('more'); @@ -19,7 +22,7 @@ if (isset($vars['menu']['more']) && !empty($vars['menu']['more'])) { echo elgg_view('navigation/menu/elements/section', array( 'class' => 'elgg-menu elgg-menu-site elgg-menu-site-more', - 'items' => $vars['menu']['more'], + 'items' => $more_items, )); echo '
      • '; -- cgit v1.2.3 From ed13a36bfd53a3a0a66a4d52849e096ccb4ae5b5 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Nov 2011 12:11:52 -0500 Subject: don't display

        if no title --- views/default/object/elements/summary.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php index 8d82bc52a..22db03f51 100644 --- a/views/default/object/elements/summary.php +++ b/views/default/object/elements/summary.php @@ -46,7 +46,9 @@ if ($tags !== false) { if ($metadata) { echo $metadata; } -echo "

        $title_link

        "; +if ($title_link) { + echo "

        $title_link

        "; +} echo "
        $subtitle
        "; echo $tags; -- cgit v1.2.3 From 6ad10da8fb3195a063634df23558430625d6c2a5 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 20 Nov 2011 08:10:47 -0500 Subject: fixed error in css for .elgg-output ordered lists --- views/default/css/elements/typography.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/default/css/elements/typography.php b/views/default/css/elements/typography.php index f080a29b2..d93b28d2c 100644 --- a/views/default/css/elements/typography.php +++ b/views/default/css/elements/typography.php @@ -139,7 +139,7 @@ h6 { font-size: 0.8em; } .elgg-output dt { font-weight: bold } .elgg-output dd { margin: 0 0 1em 1em } -.elgg-output ul, ol { +.elgg-output ul, .elgg-output ol { margin: 0 1.5em 1.5em 0; padding-left: 1.5em; } -- cgit v1.2.3 From cd2ed1772e6dc52d68d286536333127b65c74935 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 20 Nov 2011 08:13:34 -0500 Subject: Fixes #4140 fixed spelling mistake --- install/languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/languages/en.php b/install/languages/en.php index 3e2569669..bbcd72d20 100644 --- a/install/languages/en.php +++ b/install/languages/en.php @@ -64,7 +64,7 @@ If you are ready to proceed, click the Next button.", 'install:database:label:dbhost' => 'Database Host', 'install:database:label:dbprefix' => 'Database Table Prefix', - 'install:database:help:dbuser' => 'User that has full priviledges to the MySQL database that you created for Elgg', + 'install:database:help:dbuser' => 'User that has full privileges to the MySQL database that you created for Elgg', 'install:database:help:dbpassword' => 'Password for the above database user account', 'install:database:help:dbname' => 'Name of the Elgg database', 'install:database:help:dbhost' => 'Hostname of the MySQL server (usually localhost)', -- cgit v1.2.3 From a35e00f095cfbe924af589260649674f6b05384a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 20 Nov 2011 19:48:40 -0500 Subject: added check in case something goes wrong with the container entity of a discussion --- mod/groups/start.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/groups/start.php b/mod/groups/start.php index 7dcf6b7c4..09362cbbc 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -830,7 +830,7 @@ function discussion_add_to_river_menu($hook, $type, $return, $params) { if (elgg_instanceof($object, 'object', 'groupforumtopic')) { if ($item->annotation_id == 0) { $group = $object->getContainerEntity(); - if ($group->canWriteToContainer() || elgg_is_admin_logged_in()) { + if ($group && ($group->canWriteToContainer() || elgg_is_admin_logged_in())) { $options = array( 'name' => 'reply', 'href' => "#groups-reply-$object->guid", -- cgit v1.2.3 From f8a55ea9a29dfdffaacbe51ced0fe8b1bcaa1848 Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Tue, 22 Nov 2011 12:10:10 +0000 Subject: Fixes #1995 (memcache: incorrect check for get() return value) --- engine/classes/ElggMemcache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/classes/ElggMemcache.php b/engine/classes/ElggMemcache.php index 1fd3be0d1..a54c29723 100644 --- a/engine/classes/ElggMemcache.php +++ b/engine/classes/ElggMemcache.php @@ -161,7 +161,7 @@ class ElggMemcache extends ElggSharedMemoryCache { } $result = $this->memcache->set($key, $data, null, $expires); - if (!$result) { + if ($result === false) { elgg_log("MEMCACHE: FAILED TO SAVE $key", 'ERROR'); } @@ -181,7 +181,7 @@ class ElggMemcache extends ElggSharedMemoryCache { $key = $this->_makeMemcacheKey($key); $result = $this->memcache->get($key); - if (!$result) { + if ($result === false) { elgg_log("MEMCACHE: FAILED TO LOAD $key", 'ERROR'); } -- cgit v1.2.3 From e144ddac4e99694a407aa8fd95f07de225a181e8 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 22 Nov 2011 21:59:12 -0500 Subject: Fixes #3775 updates the log browser link and keeps the refine area open if the page is loaded with a user selected --- mod/logbrowser/start.php | 2 +- .../views/default/admin/administer_utilities/logbrowser.php | 12 ++++++------ mod/logbrowser/views/default/logbrowser/refine.php | 7 ++++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index 3bffe800a..22659877b 100644 --- a/mod/logbrowser/start.php +++ b/mod/logbrowser/start.php @@ -23,7 +23,7 @@ function logbrowser_init() { function logbrowser_user_hover_menu($hook, $type, $return, $params) { $user = $params['entity']; - $url = "admin/utilities/logbrowser?user_guid={$user->guid}"; + $url = "admin/administer_utilities/logbrowser?user_guid={$user->guid}"; $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url); $item->setSection('admin'); $return[] = $item; diff --git a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php index 2be1f33dc..a04ef686a 100644 --- a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php +++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php @@ -13,14 +13,14 @@ $offset = get_input('offset'); $search_username = get_input('search_username'); if ($search_username) { if ($user = get_user_by_username($search_username)) { - $user = $user->guid; + $user_guid = $user->guid; } } else { $user_guid = get_input('user_guid',0); if ($user_guid) { - $user = (int) $user_guid; + $user_guid = (int) $user_guid; } else { - $user = ""; + $user_guid = null; } } @@ -35,14 +35,14 @@ if ($timeupper) { } $refine = elgg_view('logbrowser/refine', array( - 'user_guid' => $user, + 'user_guid' => $user_guid, 'timeupper' => $timeupper, 'timelower' => $timelower, )); // Get log entries -$log = get_system_log($user, "", "", "","", $limit, $offset, false, $timeupper, $timelower); -$count = get_system_log($user, "", "", "","", $limit, $offset, true, $timeupper, $timelower); +$log = get_system_log($user_guid, "", "", "","", $limit, $offset, false, $timeupper, $timelower); +$count = get_system_log($user_guid, "", "", "","", $limit, $offset, true, $timeupper, $timelower); $table = elgg_view('logbrowser/table', array('log_entries' => $log)); diff --git a/mod/logbrowser/views/default/logbrowser/refine.php b/mod/logbrowser/views/default/logbrowser/refine.php index 27cb6042f..86460c79e 100644 --- a/mod/logbrowser/views/default/logbrowser/refine.php +++ b/mod/logbrowser/views/default/logbrowser/refine.php @@ -18,13 +18,18 @@ $toggle_link = elgg_view('output/url', array( 'rel' => 'toggle', )); +$form_class = 'elgg-module elgg-module-inline'; +if (!isset($vars['user_guid'])) { + $form_class .= ' hidden'; +} + ?>
        -