diff options
20 files changed, 265 insertions, 23 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index ca1bdc675..acfb7055e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,39 @@ +Version 1.8.12 +(January 4th, 2013 from https://github.com/Elgg/Elgg/tree/1.8) + Contributing Developers: + * Brett Profitt + * Cash Costello + * Jerome Bakker + * Matt Beckett + * Paweł Sroka + * Sem + * Srokap + * Steve Clay + + Bugfixes: + * Added an AJAX workaround for the rewrite test. + * Code cleanup to prevent some notices and warnings. + * Removed "original_order" in menu item anchor tags. + * Site menu's selected item correctly persists through content pages. + * Static caches rewritten and improved to prevent stale data being returned. + * Installation: Invalid characters in admin username are handled correctly. + * Messages: Fixed inbox link in email notifications. + * The Wire: Fixed objects not displaying correctly when upgrading from 1.7. + + Enhancements: + * Performance improvements and improved caching in entity loading. + * Added upgrade locking to prevent concurrent upgrade attempts. + * Replaced xml_to_object() and autop() with GPL / MIT-compatible code. + * Error messages (register_error()) only fade after being clicked. + * Groups: Added a sidebar entry to display membership status and a link to + group notification settings. + * Groups: Added pending membership and invitation requests to the sidebar. + * Groups: Better redirection for invisible and closed groups. + * Search: User profile fields are searched. + * Pages: Subpages can be reassigned to new parent pages. + * Twitter: Login with twitter supports persistent login and correctly forwards + after login. + Version 1.8.11 (December 5th, 2012 from https://github.com/Elgg/Elgg/tree/1.8) diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php index 262759e23..856efe008 100644 --- a/mod/developers/languages/en.php +++ b/mod/developers/languages/en.php @@ -54,6 +54,7 @@ $english = array( 'theme_preview:modules' => 'Modules', 'theme_preview:navigation' => 'Navigation', 'theme_preview:typography' => 'Typography', + 'theme_preview:miscellaneous' => 'Miscellaneous', // unit tests 'developers:unit_tests:description' => 'Elgg has unit and integration tests for detecting bugs in its core classes and functions.', diff --git a/mod/developers/start.php b/mod/developers/start.php index d77a96b36..413a8ed9b 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -176,6 +176,7 @@ function developers_theme_preview_controller($page) { 'modules', 'navigation', 'typography', + 'miscellaneous' ); foreach ($pages as $page_name) { diff --git a/mod/developers/views/default/developers/css.php b/mod/developers/views/default/developers/css.php index 4690945a9..b4f59fdec 100644 --- a/mod/developers/views/default/developers/css.php +++ b/mod/developers/views/default/developers/css.php @@ -21,3 +21,7 @@ color: #666; padding: 20px; } + +.developers-content-thin { + max-width: 600px; +}
\ No newline at end of file diff --git a/mod/developers/views/default/forms/developers/settings.php b/mod/developers/views/default/forms/developers/settings.php index 584f6af30..78e1372de 100644 --- a/mod/developers/views/default/forms/developers/settings.php +++ b/mod/developers/views/default/forms/developers/settings.php @@ -10,20 +10,22 @@ echo '<p>' . elgg_echo('elgg_dev_tools:settings:explanation') . '</p>'; foreach ($vars['data'] as $name => $info) { echo '<div>'; if ($info['type'] == 'checkbox') { + echo '<label>'; echo elgg_view("input/checkbox", array( 'name' => $name, 'value' => $info['value'], 'checked' => $info['checked'], )); - echo '<label>' . elgg_echo("developers:label:$name") . '</label>'; + echo elgg_echo("developers:label:$name") . '</label>'; echo '<span class="elgg-text-help">' . elgg_echo("developers:help:$name") . '</span>'; } else { - echo '<label>' . elgg_echo("developers:label:$name") . '</label>'; + echo '<label>' . elgg_echo("developers:label:$name"); echo elgg_view("input/{$info['type']}", array( 'name' => $name, 'value' => $info['value'], 'options_values' => $info['options_values'], )); + echo '</label>'; echo '<span class="elgg-text-help">' . elgg_echo("developers:help:$name") . '</span>'; } echo '</div>'; diff --git a/mod/developers/views/default/page/theme_preview.php b/mod/developers/views/default/page/theme_preview.php index 584387ec1..ee2bc0c0f 100644 --- a/mod/developers/views/default/page/theme_preview.php +++ b/mod/developers/views/default/page/theme_preview.php @@ -18,9 +18,19 @@ header("Content-type: text/html; charset=UTF-8"); </head> <body> <div class="elgg-page elgg-page-default"> + <div class="elgg-page-messages"> + <ul class="elgg-system-messages"> + <li class="hidden"></li> + </ul> + </div> <div class="elgg-page-header"> <div class="elgg-inner"> <h1 class="elgg-heading-site">Theme Sandbox</h1> + <?php + if (get_input("site_menu", false)) { + echo elgg_view_menu('site'); + } + ?> </div> </div> <div class="elgg-page-body"> diff --git a/mod/developers/views/default/theme_preview/components.php b/mod/developers/views/default/theme_preview/components.php index 2f414cd88..50c155b14 100644 --- a/mod/developers/views/default/theme_preview/components.php +++ b/mod/developers/views/default/theme_preview/components.php @@ -22,4 +22,4 @@ $body = elgg_view('theme_preview/components/tags'); echo elgg_view_module('info', 'Tags (.elgg-tag)', $body); $body = elgg_view('theme_preview/components/messages'); -echo elgg_view_module('info', 'Messages (.elgg-message)', $body); +echo elgg_view_module('info', 'Messages (.elgg-message)', $body);
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/general.php b/mod/developers/views/default/theme_preview/general.php index 629462873..7d98d4443 100644 --- a/mod/developers/views/default/theme_preview/general.php +++ b/mod/developers/views/default/theme_preview/general.php @@ -11,6 +11,29 @@ The preview is divided into sections that are listed in the page menu (usually in the sidebar but depends on your current theme). </p> +<?php +$simple_cache = elgg_get_config('simplecache_enabled'); +$system_cache = elgg_get_config('system_cache_enabled'); + +if ($simple_cache || $system_cache) { + $advanced = elgg_view('output/url', array( + 'text' => 'Advanced Settings', + 'href' => 'admin/settings/advanced', + 'is_trusted' => true + )); + $developers = elgg_view('output/url', array( + 'text' => 'Developers\' Plugin Settings', + 'href' => 'admin/developers/settings', + 'is_trusted' => true + )); + + $body = "Caches are enabled. Changes you make to CSS and views might not appear. It is + always recommended to disable caches while developing themes and plugins. To + disable caches, visit the $advanced or $developers pages."; + + echo elgg_view_module('info', 'Warning', $body); +} +?> <p> <?php echo elgg_view('output/url', array( diff --git a/mod/developers/views/default/theme_preview/miscellaneous.php b/mod/developers/views/default/theme_preview/miscellaneous.php new file mode 100644 index 000000000..2f4ee4acd --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous.php @@ -0,0 +1,22 @@ +<?php +/** + * Miscellaneous and complex components + */ + +$body = elgg_view('theme_preview/miscellaneous/lightbox'); +echo elgg_view_module('info', 'Lightbox (.elgg-lightbox)', $body); + +$body = elgg_view('theme_preview/miscellaneous/popup'); +echo elgg_view_module('info', 'Popup (rel=popup)', $body); + +$body = elgg_view('theme_preview/miscellaneous/toggle'); +echo elgg_view_module('info', 'Toggle (rel=toggle)', $body); + +$body = elgg_view('theme_preview/miscellaneous/system_messages'); +echo elgg_view_module('info', 'System Messages and Errors', $body); + +$body = elgg_view('theme_preview/miscellaneous/site_menu'); +echo elgg_view_module('info', 'Site Menu', $body); + +$body = elgg_view('theme_preview/miscellaneous/user_hover_menu'); +echo elgg_view_module('info', 'User Icon with Hover Menu', $body);
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/miscellaneous/lightbox.php b/mod/developers/views/default/theme_preview/miscellaneous/lightbox.php new file mode 100644 index 000000000..b673c4ee0 --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous/lightbox.php @@ -0,0 +1,19 @@ +<?php + +elgg_load_js('lightbox'); +elgg_load_css('lightbox'); + +$ipsum = elgg_view('developers/ipsum'); + +$link = elgg_view('output/url', array( + 'text' => 'Open lighbox', + 'href' => "#elgg-lightbox-test", + 'class' => 'elgg-lightbox' +)); + +echo $link; +echo '<div class="hidden">'; +echo elgg_view_module('aside', 'Lightbox Test', $ipsum, array( + 'id' => 'elgg-lightbox-test' +)); +echo '</div>';
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/miscellaneous/popup.php b/mod/developers/views/default/theme_preview/miscellaneous/popup.php new file mode 100644 index 000000000..b711bb7cc --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous/popup.php @@ -0,0 +1,15 @@ +<?php + +$ipsum = elgg_view('developers/ipsum'); + +$link = elgg_view('output/url', array( + 'text' => 'Popup content', + 'href' => "#elgg-popup-test", + 'rel' => 'popup' +)); + +echo $link; +echo elgg_view_module('popup', 'Popup Test', $ipsum, array( + 'id' => 'elgg-popup-test', + 'class' => 'hidden clearfix developers-content-thin', +));
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/miscellaneous/site_menu.php b/mod/developers/views/default/theme_preview/miscellaneous/site_menu.php new file mode 100644 index 000000000..e2384b9f7 --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous/site_menu.php @@ -0,0 +1,15 @@ +<?php + +if (!get_input('site_menu')) { + echo elgg_view('output/url', array( + 'text' => 'Show Site Menu', + 'href' => elgg_http_add_url_query_elements(current_page_url(), array('site_menu' => 1)), + 'is_trusted' => true + )); +} else { + echo elgg_view('output/url', array( + 'text' => 'Hide Site Menu', + 'href' => elgg_http_remove_url_query_element(current_page_url(), 'site_menu'), + 'is_trusted' => true + )); +}
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/miscellaneous/system_messages.php b/mod/developers/views/default/theme_preview/miscellaneous/system_messages.php new file mode 100644 index 000000000..a6663a3dc --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous/system_messages.php @@ -0,0 +1,35 @@ +<?php + +// can't use the ipsum because it includes html when wrapping views. +$message = elgg_view('output/url', array( + 'text' => 'Show system message (system_message())', + 'is_trusted' => true, + 'href' => '#', + 'id' => 'developers-system-message', +// 'onclick' => "elgg.system_message('Elgg System Message');" +)); + +$error = elgg_view('output/url', array( + 'text' => 'Show error message (register_error())', + 'is_trusted' => true, + 'href' => '#', + 'id' => 'developers-error-message', +)); + +?> +<script type="text/javascript"> + $(function() { + $('#developers-system-message').click(function() { + elgg.system_message('Elgg System Message'); + }) + + $('#developers-error-message').click(function() { + elgg.register_error('Elgg Error Message'); + }) + }); +</script> + +<ul> + <li><?php echo $message; ?></li> + <li><?php echo $error; ?></li> +</ul>
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/miscellaneous/toggle.php b/mod/developers/views/default/theme_preview/miscellaneous/toggle.php new file mode 100644 index 000000000..abe39ddd8 --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous/toggle.php @@ -0,0 +1,15 @@ +<?php + +$ipsum = elgg_view('developers/ipsum'); + +$link = elgg_view('output/url', array( + 'text' => 'Toggle content', + 'href' => "#elgg-toggle-test", + 'rel' => 'toggle' +)); + +echo $link; +echo elgg_view_module('featured', 'Toggle Test', $ipsum, array( + 'id' => 'elgg-toggle-test', + 'class' => 'hidden clearfix developers-content-thin', +));
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php b/mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php new file mode 100644 index 000000000..45331b6e0 --- /dev/null +++ b/mod/developers/views/default/theme_preview/miscellaneous/user_hover_menu.php @@ -0,0 +1,16 @@ +<?php + +$me = elgg_get_logged_in_user_entity(); +echo elgg_view_entity_icon($me); + +// show another user if available +$users = elgg_get_entities(array( + 'type' => 'user', + 'wheres' => array("guid != {$me->getGUID()}"), + 'limit' => 1 +)); + +if (is_array($users) && count($users) > 0) { + echo elgg_view_entity_icon($users[0]); +} + diff --git a/mod/developers/views/default/theme_preview/modules.php b/mod/developers/views/default/theme_preview/modules.php index 3e0acb3a5..c46c94296 100644 --- a/mod/developers/views/default/theme_preview/modules.php +++ b/mod/developers/views/default/theme_preview/modules.php @@ -2,5 +2,5 @@ echo elgg_view_module('info', 'Modules (.elgg-module)', elgg_view('theme_preview/modules/modules')); -echo elgg_view_module('info', 'Widgets (.elgg-widget)', elgg_view('theme_preview/modules/widgets')); +echo elgg_view_module('info', 'Widgets (.elgg-module-widget)', elgg_view('theme_preview/modules/widgets')); diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php index 2143a0d24..62058abf1 100644 --- a/mod/search/search_hooks.php +++ b/mod/search/search_hooks.php @@ -122,24 +122,35 @@ function search_users_hook($hook, $type, $value, $params) { $query = sanitise_string($params['query']); - $join = "JOIN {$db_prefix}users_entity ue ON e.guid = ue.guid"; - $params['joins'] = array($join); - -// $where = "(ue.guid = e.guid -// AND (ue.username LIKE '%$query%' -// OR ue.name LIKE '%$query%' -// ) -// )"; - + $params['joins'] = array( + "JOIN {$db_prefix}users_entity ue ON e.guid = ue.guid", + "JOIN {$db_prefix}metadata md on e.guid = md.entity_guid", + "JOIN {$db_prefix}metastrings msv ON n_table.value_id = msv.id" + ); + + // username and display name $fields = array('username', 'name'); $where = search_get_where_sql('ue', $fields, $params, FALSE); + + // profile fields + $profile_fields = array_keys(elgg_get_config('profile_fields')); - $params['wheres'] = array($where); + // get the where clauses for the md names + // can't use egef_metadata() because the n_table join comes too late. + $clauses = elgg_entities_get_metastrings_options('metadata', array( + 'metadata_names' => $profile_fields, + )); + + $params['joins'] = array_merge($clauses['joins'], $params['joins']); + // no fulltext index, can't disable fulltext search in this function. + // $md_where .= " AND " . search_get_where_sql('msv', array('string'), $params, FALSE); + $md_where = "(({$clauses['wheres'][0]}) AND msv.string LIKE '%$query%')"; + + $params['wheres'] = array("(($where) OR ($md_where))"); // override subtype -- All users should be returned regardless of subtype. $params['subtype'] = ELGG_ENTITIES_ANY_VALUE; - - $params['count'] = TRUE; + $params['count'] = true; $count = elgg_get_entities($params); // no need to continue if nothing here. @@ -152,11 +163,27 @@ function search_users_hook($hook, $type, $value, $params) { // add the volatile data for why these entities have been returned. foreach ($entities as $entity) { - $username = search_get_highlighted_relevant_substrings($entity->username, $query); - $entity->setVolatileData('search_matched_title', $username); + + $title = search_get_highlighted_relevant_substrings($entity->name, $query); - $name = search_get_highlighted_relevant_substrings($entity->name, $query); - $entity->setVolatileData('search_matched_description', $name); + // include the username if it matches but the display name doesn't. + if (false !== strpos($entity->username, $query)) { + $username = search_get_highlighted_relevant_substrings($entity->username, $query); + $title .= " ($username)"; + } + + $entity->setVolatileData('search_matched_title', $title); + + $matched = ''; + foreach ($profile_fields as $md) { + $text = $entity->$md; + if (stristr($text, $query)) { + $matched .= elgg_echo("profile:{$md}") . ': ' + . search_get_highlighted_relevant_substrings($text, $query); + } + } + + $entity->setVolatileData('search_matched_description', $matched); } return array( diff --git a/mod/search/start.php b/mod/search/start.php index f493508d8..8a112a3a3 100644 --- a/mod/search/start.php +++ b/mod/search/start.php @@ -77,7 +77,7 @@ function search_page_handler($page) { /** * Return a string with highlighted matched queries and relevant context - * Determins context based upon occurance and distance of words with each other. + * Determines context based upon occurance and distance of words with each other. * * @param string $haystack * @param string $query diff --git a/version.php b/version.php index 77d151bb6..858877cfd 100644 --- a/version.php +++ b/version.php @@ -14,4 +14,4 @@ $version = 2012120500; // Human-friendly version name -$release = '1.8.11'; +$release = '1.8.12'; diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php index d2bceaf90..a1f018eea 100644 --- a/views/default/js/lightbox.php +++ b/views/default/js/lightbox.php @@ -3,7 +3,8 @@ * Elgg lightbox * * Usage - * Apply the class elgg-lightbox to links. + * Call elgg_load_js('lightbox') and elgg_load_css('lightbox') then + * apply the class elgg-lightbox to links. * * Advanced Usage * Elgg is distributed with the Fancybox jQuery library. Please go to |