From 17c28c8161e8c551ce4e4a1345e525cbb785fb59 Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 8 Jul 2012 09:48:50 +0200 Subject: Fixes #3646. Added suport for Repository, Bugtracker and Donations in manifest. --- documentation/info/manifest.xml | 3 +++ engine/classes/ElggPluginManifest.php | 26 ++++++++++++++++++++++++ engine/classes/ElggPluginManifestParser18.php | 11 ++++++---- engine/tests/api/plugins.php | 18 +++++++++++++++++ engine/tests/test_files/plugin_18/manifest.xml | 3 +++ languages/en.php | 3 +++ mod/blog/manifest.xml | 1 + mod/bookmarks/manifest.xml | 1 + mod/categories/manifest.xml | 1 + mod/custom_index/manifest.xml | 1 + mod/dashboard/manifest.xml | 1 + mod/developers/manifest.xml | 3 +++ mod/diagnostics/manifest.xml | 1 + mod/embed/manifest.xml | 1 + mod/externalpages/manifest.xml | 1 + mod/file/manifest.xml | 1 + mod/garbagecollector/manifest.xml | 1 + mod/groups/manifest.xml | 1 + mod/htmlawed/manifest.xml | 1 + mod/invitefriends/manifest.xml | 1 + mod/likes/manifest.xml | 1 + mod/logbrowser/manifest.xml | 1 + mod/logrotate/manifest.xml | 1 + mod/members/manifest.xml | 1 + mod/messageboard/manifest.xml | 1 + mod/messages/manifest.xml | 3 ++- mod/notifications/manifest.xml | 1 + mod/oauth_api/manifest.xml | 1 + mod/pages/manifest.xml | 1 + mod/profile/manifest.xml | 1 + mod/reportedcontent/manifest.xml | 1 + mod/search/manifest.xml | 1 + mod/tagcloud/manifest.xml | 1 + mod/thewire/manifest.xml | 1 + mod/tinymce/manifest.xml | 1 + mod/twitter/manifest.xml | 1 + mod/twitter_api/manifest.xml | 1 + mod/uservalidationbyemail/manifest.xml | 1 + mod/zaudio/manifest.xml | 1 + views/default/css/admin.php | 3 ++- views/default/object/plugin/full.php | 28 ++++++++++++++++++++++++-- 41 files changed, 124 insertions(+), 8 deletions(-) diff --git a/documentation/info/manifest.xml b/documentation/info/manifest.xml index baa6cc3fa..494158481 100644 --- a/documentation/info/manifest.xml +++ b/documentation/info/manifest.xml @@ -6,6 +6,9 @@ A concise description. This is a longer, more interesting description of my plugin, its features, and other important information. http://www.elgg.org/ + https://github.com/Elgg/Elgg + http://trac.elgg.org + http://elgg.org/supporter.php (C) Elgg 2011 GNU General Public License version 2 diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 7e79c15c8..5eb248c2c 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -276,6 +276,32 @@ class ElggPluginManifest { } } + /** + * Returns the repository url + * + * @return sting + */ + public function getRepository() { + return $this->parser->getAttribute('repository'); + } + + /** + * Returns the bug tracker page + * + * @return sting + */ + public function getBugTracker() { + return $this->parser->getAttribute('bugtracker'); + } + + /** + * Returns the donations page + * + * @return sting + */ + public function getDonationsPage() { + return $this->parser->getAttribute('donations'); + } /** * Returns the version of the plugin. diff --git a/engine/classes/ElggPluginManifestParser18.php b/engine/classes/ElggPluginManifestParser18.php index 554e28c02..3b753f17b 100644 --- a/engine/classes/ElggPluginManifestParser18.php +++ b/engine/classes/ElggPluginManifestParser18.php @@ -13,10 +13,10 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser { * @var array */ protected $validAttributes = array( - 'name', 'author', 'version', 'blurb', 'description', - 'website', 'copyright', 'license', 'requires', 'suggests', - 'screenshot', 'category', 'conflicts', 'provides', - 'activate_on_install' + 'name', 'author', 'version', 'blurb', 'description','website', + 'repository', 'bugtracker', 'donations', 'copyright', 'license', + 'requires', 'suggests', 'conflicts', 'provides', + 'screenshot', 'category', 'activate_on_install' ); /** @@ -46,6 +46,9 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser { case 'website': case 'copyright': case 'license': + case 'repository': + case 'bugtracker': + case 'donations': case 'activate_on_install': $parsed[$element->name] = $element->content; break; diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 8ecb0a46c..66297266c 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -68,6 +68,9 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { 'blurb' => 'A concise description.', 'description' => 'A longer, more interesting description.', 'website' => 'http://www.elgg.org/', + 'repository' => 'https://github.com/Elgg/Elgg', + 'bugtracker' => 'http://trac.elgg.org', + 'donations' => 'http://elgg.org/supporter.php', 'copyright' => '(C) Elgg Foundation 2011', 'license' => 'GNU General Public License version 2', @@ -164,6 +167,21 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { $this->assertEqual($this->manifest18->getWebsite(), 'http://www.elgg.org/'); $this->assertEqual($this->manifest17->getWebsite(), 'http://www.elgg.org/'); } + + public function testElggPluginManifestGetRepository() { + $this->assertEqual($this->manifest18->getRepository(), 'https://github.com/Elgg/Elgg'); + $this->assertEqual($this->manifest17->getRepository(), ''); + } + + public function testElggPluginManifestGetBugtracker() { + $this->assertEqual($this->manifest18->getBugTracker(), 'http://trac.elgg.org'); + $this->assertEqual($this->manifest17->getBugTracker(), ''); + } + + public function testElggPluginManifestGetDonationsPage() { + $this->assertEqual($this->manifest18->getDonationsPage(), 'http://elgg.org/supporter.php'); + $this->assertEqual($this->manifest17->getDonationsPage(), ''); + } public function testElggPluginManifestGetCopyright() { $this->assertEqual($this->manifest18->getCopyright(), '(C) Elgg Foundation 2011'); diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml index 9654b6422..5d788616a 100644 --- a/engine/tests/test_files/plugin_18/manifest.xml +++ b/engine/tests/test_files/plugin_18/manifest.xml @@ -6,6 +6,9 @@ A concise description. A longer, more interesting description. http://www.elgg.org/ + https://github.com/Elgg/Elgg + http://trac.elgg.org + http://elgg.org/supporter.php (C) Elgg Foundation 2011 GNU General Public License version 2 diff --git a/languages/en.php b/languages/en.php index 18d0c88d9..23f1c3a19 100644 --- a/languages/en.php +++ b/languages/en.php @@ -686,6 +686,9 @@ $english = array( 'admin:plugins:label:categories' => 'Categories', 'admin:plugins:label:licence' => "Licence", 'admin:plugins:label:website' => "URL", + 'admin:plugins:label:repository' => "Code", + 'admin:plugins:label:bugtracker' => "Report issue", + 'admin:plugins:label:donate' => "Donate", 'admin:plugins:label:moreinfo' => 'more info', 'admin:plugins:label:version' => 'Version', 'admin:plugins:label:location' => 'Location', diff --git a/mod/blog/manifest.xml b/mod/blog/manifest.xml index 29ee1bfc8..a68c30969 100644 --- a/mod/blog/manifest.xml +++ b/mod/blog/manifest.xml @@ -9,6 +9,7 @@ Blog plugin Adds simple blogging capabilities to your Elgg installation. http://elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/bookmarks/manifest.xml b/mod/bookmarks/manifest.xml index b95af87f8..ebe8704a6 100644 --- a/mod/bookmarks/manifest.xml +++ b/mod/bookmarks/manifest.xml @@ -9,6 +9,7 @@ Add and comment on bookmarks. Adds the ability for users to bookmark internal and external sites. Other users can then comment on the bookmarks. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/categories/manifest.xml b/mod/categories/manifest.xml index 4a6bd0864..dbc84bed0 100644 --- a/mod/categories/manifest.xml +++ b/mod/categories/manifest.xml @@ -8,6 +8,7 @@ Add site-wide categories Site-wide Categories lets administrators define categories that users across the site can add content to. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/custom_index/manifest.xml b/mod/custom_index/manifest.xml index 80187efbc..3bdcbd333 100644 --- a/mod/custom_index/manifest.xml +++ b/mod/custom_index/manifest.xml @@ -6,6 +6,7 @@ bundled A demonstration of how to create a front page plugin. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/dashboard/manifest.xml b/mod/dashboard/manifest.xml index cbbc1044c..20ed074a7 100644 --- a/mod/dashboard/manifest.xml +++ b/mod/dashboard/manifest.xml @@ -6,6 +6,7 @@ bundled A widget-based dashboard for your users http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/developers/manifest.xml b/mod/developers/manifest.xml index 93a12945d..58e8e24f0 100644 --- a/mod/developers/manifest.xml +++ b/mod/developers/manifest.xml @@ -8,6 +8,9 @@ Developer tools for Elgg 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/ + https://github.com/Elgg/Elgg + http://trac.elgg.org + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/diagnostics/manifest.xml b/mod/diagnostics/manifest.xml index 21e847d22..df4a81b02 100644 --- a/mod/diagnostics/manifest.xml +++ b/mod/diagnostics/manifest.xml @@ -8,6 +8,7 @@ admin Elgg diagnostics tool http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml index 81ca9194e..546471647 100644 --- a/mod/embed/manifest.xml +++ b/mod/embed/manifest.xml @@ -7,6 +7,7 @@ enhancement Allows users to easily upload and embed media into text areas. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/externalpages/manifest.xml b/mod/externalpages/manifest.xml index f2aef09f3..8c474ddab 100644 --- a/mod/externalpages/manifest.xml +++ b/mod/externalpages/manifest.xml @@ -6,6 +6,7 @@ bundled Create simple web pages for about, contact, privacy, and terms. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/file/manifest.xml b/mod/file/manifest.xml index 26282a8e3..7d69f4280 100644 --- a/mod/file/manifest.xml +++ b/mod/file/manifest.xml @@ -8,6 +8,7 @@ widget File browser plugin http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/garbagecollector/manifest.xml b/mod/garbagecollector/manifest.xml index 5aafebf38..ddf15656a 100644 --- a/mod/garbagecollector/manifest.xml +++ b/mod/garbagecollector/manifest.xml @@ -7,6 +7,7 @@ admin Perform some database cleanup tasks http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/groups/manifest.xml b/mod/groups/manifest.xml index fd28360d0..574ba1985 100644 --- a/mod/groups/manifest.xml +++ b/mod/groups/manifest.xml @@ -8,6 +8,7 @@ widget Provides group support for elgg http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/htmlawed/manifest.xml b/mod/htmlawed/manifest.xml index 6807e96a4..e4d8fa145 100644 --- a/mod/htmlawed/manifest.xml +++ b/mod/htmlawed/manifest.xml @@ -7,6 +7,7 @@ security Provides security filtering. Running a site with this plugin disabled is extremely insecure. DO NOT DISABLE. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/invitefriends/manifest.xml b/mod/invitefriends/manifest.xml index b36238a05..220948c30 100644 --- a/mod/invitefriends/manifest.xml +++ b/mod/invitefriends/manifest.xml @@ -7,6 +7,7 @@ social Invite friends via email invites. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/likes/manifest.xml b/mod/likes/manifest.xml index 62835fcf5..e0a9b10f2 100644 --- a/mod/likes/manifest.xml +++ b/mod/likes/manifest.xml @@ -7,6 +7,7 @@ social Enables users to like content on the site. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/logbrowser/manifest.xml b/mod/logbrowser/manifest.xml index 4527e2cbb..17b08803c 100644 --- a/mod/logbrowser/manifest.xml +++ b/mod/logbrowser/manifest.xml @@ -7,6 +7,7 @@ admin Browse the system event log http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/logrotate/manifest.xml b/mod/logrotate/manifest.xml index 1aa62e2e7..79b37dbbc 100644 --- a/mod/logrotate/manifest.xml +++ b/mod/logrotate/manifest.xml @@ -7,6 +7,7 @@ admin Rotate the system log at specific intervals http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/members/manifest.xml b/mod/members/manifest.xml index 8b18c9f91..40a05892c 100644 --- a/mod/members/manifest.xml +++ b/mod/members/manifest.xml @@ -6,6 +6,7 @@ bundled Lists the members of your site http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/messageboard/manifest.xml b/mod/messageboard/manifest.xml index 617813725..b4188ab31 100644 --- a/mod/messageboard/manifest.xml +++ b/mod/messageboard/manifest.xml @@ -7,6 +7,7 @@ widget This plugin allows users to put a message board on their profile for other users to post comments. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml index 73a58d9d4..83f7bba64 100644 --- a/mod/messages/manifest.xml +++ b/mod/messages/manifest.xml @@ -6,8 +6,9 @@ bundled communication Elgg internal messages plugin. This plugin lets user send each other messages. - See COPYRIGHT.txt http://www.elgg.org/ + http://elgg.org/supporter.php + See COPYRIGHT.txt GNU General Public License version 2 elgg_release diff --git a/mod/notifications/manifest.xml b/mod/notifications/manifest.xml index 205476881..d961ce138 100644 --- a/mod/notifications/manifest.xml +++ b/mod/notifications/manifest.xml @@ -6,6 +6,7 @@ bundled Elgg notifications plugin http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/oauth_api/manifest.xml b/mod/oauth_api/manifest.xml index 991be6a22..96b9c7280 100644 --- a/mod/oauth_api/manifest.xml +++ b/mod/oauth_api/manifest.xml @@ -7,6 +7,7 @@ bundled api http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/pages/manifest.xml b/mod/pages/manifest.xml index 4cf999f45..a764171b4 100644 --- a/mod/pages/manifest.xml +++ b/mod/pages/manifest.xml @@ -8,6 +8,7 @@ widget Collaborative editing tool. Enables users to create pages similar to a wiki without having to know wiki syntax. http://www.elgg.org + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/profile/manifest.xml b/mod/profile/manifest.xml index 86fbc7b7b..b7ad5185e 100644 --- a/mod/profile/manifest.xml +++ b/mod/profile/manifest.xml @@ -7,6 +7,7 @@ bundled social http://elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License Version 2 true diff --git a/mod/reportedcontent/manifest.xml b/mod/reportedcontent/manifest.xml index e96620b01..d98ff383b 100644 --- a/mod/reportedcontent/manifest.xml +++ b/mod/reportedcontent/manifest.xml @@ -6,6 +6,7 @@ bundled Adds the option for users to report content and for admins to check it out. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/search/manifest.xml b/mod/search/manifest.xml index 513d3a6b9..1bc974729 100644 --- a/mod/search/manifest.xml +++ b/mod/search/manifest.xml @@ -6,6 +6,7 @@ bundled Allow search across entities of the site http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/tagcloud/manifest.xml b/mod/tagcloud/manifest.xml index c0f89f35e..fd91d92b8 100644 --- a/mod/tagcloud/manifest.xml +++ b/mod/tagcloud/manifest.xml @@ -7,6 +7,7 @@ widget Widget-based tag clouds. http://cashcostello.com/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/thewire/manifest.xml b/mod/thewire/manifest.xml index 962ed12f1..950ecfbed 100644 --- a/mod/thewire/manifest.xml +++ b/mod/thewire/manifest.xml @@ -7,6 +7,7 @@ content Microblogging for Elgg http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/tinymce/manifest.xml b/mod/tinymce/manifest.xml index 61bf0c22c..fb36c4141 100644 --- a/mod/tinymce/manifest.xml +++ b/mod/tinymce/manifest.xml @@ -7,6 +7,7 @@ enhancement TinyMCE plugin. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/twitter/manifest.xml b/mod/twitter/manifest.xml index 18fa8c957..18031deec 100644 --- a/mod/twitter/manifest.xml +++ b/mod/twitter/manifest.xml @@ -7,6 +7,7 @@ widget Elgg simple twitter widget http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/twitter_api/manifest.xml b/mod/twitter_api/manifest.xml index 86bba4b50..88d43aa5e 100644 --- a/mod/twitter_api/manifest.xml +++ b/mod/twitter_api/manifest.xml @@ -7,6 +7,7 @@ api bundled http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/uservalidationbyemail/manifest.xml b/mod/uservalidationbyemail/manifest.xml index 800dd2641..6a15fd0cf 100644 --- a/mod/uservalidationbyemail/manifest.xml +++ b/mod/uservalidationbyemail/manifest.xml @@ -7,6 +7,7 @@ security Simple user account validation via email. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/zaudio/manifest.xml b/mod/zaudio/manifest.xml index 54f819658..a103052aa 100644 --- a/mod/zaudio/manifest.xml +++ b/mod/zaudio/manifest.xml @@ -8,6 +8,7 @@ multimedia This simple plugin lets users play mp3's in the page. http://www.elgg.org/ + http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 78ec95c26..437b0f00f 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1460,7 +1460,8 @@ a.elgg-widget-collapsed:before { padding: 5px 10px; margin: 4px 0; } -ul.elgg-plugin-categories, ul.elgg-plugin-categories > li { +ul.elgg-plugin-categories, ul.elgg-plugin-categories > li, +ul.elgg-plugin-resources, ul.elgg-plugin-resources > li { display: inline; } .elgg-plugin-category-bundled { diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index db0a52416..a96acd4ec 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -172,6 +172,26 @@ $website = elgg_view('output/url', array( 'is_trusted' => true, )); +$resources = array( + 'repository' => $plugin->getManifest()->getRepository(), + 'bugtracker' => $plugin->getManifest()->getBugTracker(), + 'donate' => $plugin->getManifest()->getDonationsPage(), +); + +$resources_html = "
    "; +foreach ($resources as $id => $href) { + if ($href) { + $resources_html .= "
  • "; + $resources_html .= elgg_view('output/url', array( + 'href' => $href, + 'text' => elgg_echo("admin:plugins:label:$id"), + 'is_trusted' => true, + )); + $resources_html .= "
  • "; + } +} +$resources_html .= "
"; + $copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright())); $license = elgg_view('output/text', array('value' => $plugin->getManifest()->getLicense())); @@ -242,7 +262,11 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)

- + +
- \ No newline at end of file + -- cgit v1.2.3 From 538a4c24bd9c942d8e0e9a58a650a29188fbd2ce Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 8 Jul 2012 10:42:17 +0200 Subject: Fixes #4004. elgg_logging when a language key is missing. --- engine/lib/languages.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 15c48f902..e8e3d31af 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,8 +50,10 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; + elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), WARNING); } else { $string = $message_key; + elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), ERROR); } // only pass through if we have arguments to allow backward compatibility -- cgit v1.2.3 From 8c0897d92395d897a8e40a2d1b97e5f838520296 Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 8 Jul 2012 12:21:19 +0200 Subject: Fixes #1792. Added pluggin setting in groups to set who can create groups, logged in users or only admins. --- mod/groups/actions/groups/edit.php | 6 +++++- mod/groups/languages/en.php | 4 +++- mod/groups/lib/groups.php | 10 ++++++++-- mod/groups/views/default/plugins/groups/settings.php | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php index b513a6098..a76bde0ac 100644 --- a/mod/groups/actions/groups/edit.php +++ b/mod/groups/actions/groups/edit.php @@ -39,10 +39,14 @@ $user = elgg_get_logged_in_user_entity(); $group_guid = (int)get_input('group_guid'); $new_group_flag = $group_guid == 0; +if ($new_group_flag && elgg_get_plugin_setting('limited_groups', 'groups') == 'yes' && !elgg_is_admin_logged_in()) { + register_error(elgg_echo("groups:cantcreate")); + forward(REFERER); +} + $group = new ElggGroup($group_guid); // load if present, if not create a new group if (($group_guid) && (!$group->canEdit())) { register_error(elgg_echo("groups:cantedit")); - forward(REFERER); } diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 4868aa334..0ca980108 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -41,6 +41,7 @@ $english = array( 'groups:noaccess' => 'No access to group', 'groups:permissions:error' => 'You do not have the permissions for this', 'groups:ingroup' => 'in the group', + 'groups:cantcreate' => 'You can not create a group. Only admins can.', 'groups:cantedit' => 'You can not edit this group', 'groups:saved' => 'Group saved', 'groups:featured' => 'Featured groups', @@ -259,6 +260,7 @@ or click below to view the group's join requests: 'groups:forumtopic:edited' => 'Forum topic successfully edited.', 'groups:allowhiddengroups' => 'Do you want to allow private (invisible) groups?', + 'groups:whocancreate' => 'Who can create new groups?', /** * Action messages @@ -285,4 +287,4 @@ or click below to view the group's join requests: ); -add_translation("en", $english); \ No newline at end of file +add_translation("en", $english); diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index 51ae89a87..dfbb1154b 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -12,7 +12,9 @@ function groups_handle_all_page() { elgg_pop_breadcrumb(); elgg_push_breadcrumb(elgg_echo('groups')); - elgg_register_title_button(); + if (elgg_get_plugin_setting('limited_groups', 'groups') != 'yes' || elgg_is_admin_logged_in()) { + elgg_register_title_button(); + } $selected_tab = get_input('filter', 'newest'); @@ -184,7 +186,11 @@ function groups_handle_edit_page($page, $guid = 0) { elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); $title = elgg_echo('groups:add'); elgg_push_breadcrumb($title); - $content = elgg_view('groups/edit'); + if (elgg_get_plugin_setting('limited_groups', 'groups') != 'yes' || elgg_is_admin_logged_in()) { + $content = elgg_view('groups/edit'); + } else { + $content = elgg_echo('groups:cantcreate'); + } } else { $title = elgg_echo("groups:edit"); $group = get_entity($guid); diff --git a/mod/groups/views/default/plugins/groups/settings.php b/mod/groups/views/default/plugins/groups/settings.php index 7197dcb37..41ea146db 100644 --- a/mod/groups/views/default/plugins/groups/settings.php +++ b/mod/groups/views/default/plugins/groups/settings.php @@ -8,6 +8,11 @@ if (!isset($vars['entity']->hidden_groups)) { $vars['entity']->hidden_groups = 'no'; } +// set default value +if (!isset($vars['entity']->limited_groups)) { + $vars['entity']->limited_groups = 'no'; +} + echo '
'; echo elgg_echo('groups:allowhiddengroups'); echo ' '; @@ -20,3 +25,16 @@ echo elgg_view('input/dropdown', array( 'value' => $vars['entity']->hidden_groups, )); echo '
'; + +echo '
'; +echo elgg_echo('groups:whocancreate'); +echo ' '; +echo elgg_view('input/dropdown', array( + 'name' => 'params[limited_groups]', + 'options_values' => array( + 'no' => elgg_echo('LOGGED_IN'), + 'yes' => elgg_echo('admin') + ), + 'value' => $vars['entity']->limited_groups, +)); +echo '
'; -- cgit v1.2.3 From 84666d49fcc1191075f45b75a164ed0383c2c375 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 11 Jul 2012 01:24:57 +0200 Subject: Fixes #4381. Group edit form made sticky. --- mod/groups/actions/groups/edit.php | 5 +++++ mod/groups/views/default/forms/groups/edit.php | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php index b513a6098..a3ad91622 100644 --- a/mod/groups/actions/groups/edit.php +++ b/mod/groups/actions/groups/edit.php @@ -15,6 +15,8 @@ function profile_array_decoder(&$v) { $v = html_entity_decode($v, ENT_COMPAT, 'UTF-8'); } +elgg_make_sticky_form('groups'); + // Get group fields $input = array(); foreach ($CONFIG->group as $shortname => $valuetype) { @@ -106,6 +108,9 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') { $group->save(); +// group saved so clear sticky form +elgg_clear_sticky_form('groups'); + // group creator needs to be member of new group and river entry created if ($new_group_flag) { elgg_set_page_owner_guid($group->guid); diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php index 8055b6430..7540d1bf9 100644 --- a/mod/groups/views/default/forms/groups/edit.php +++ b/mod/groups/views/default/forms/groups/edit.php @@ -5,8 +5,16 @@ * @package ElggGroups */ +if (elgg_is_sticky_form('groups')) { + $sticky_values = elgg_get_sticky_values('groups'); + elgg_clear_sticky_form('groups'); +} + // new groups default to open membership -if (isset($vars['entity'])) { +if (isset($sticky_values)) { + $membership = $sticky_values['membership']; + $access = $sticky_values['access_id']; +} elseif (isset($vars['entity'])) { $membership = $vars['entity']->membership; $access = $vars['entity']->access_id; if ($access != ACCESS_PUBLIC && $access != ACCESS_LOGGED_IN) { @@ -27,7 +35,7 @@ if (isset($vars['entity'])) {
'name', - 'value' => $vars['entity']->name, + 'value' => isset($sticky_values['name']) ? $sticky_values['name'] : $vars['entity']->name, )); ?> @@ -45,7 +53,7 @@ if ($group_profile_fields > 0) { echo "$line_break"; echo elgg_view("input/{$valtype}", array( 'name' => $shortname, - 'value' => $vars['entity']->$shortname, + 'value' => isset($sticky_values[$shortname]) ? $sticky_values[$shortname] : $vars['entity']->$shortname, )); echo ''; } -- cgit v1.2.3 From 0b00af1e77d7ffc5c739f7fa21f61886b5480e62 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 12 Jul 2012 07:51:54 -0400 Subject: Fixes #4702 better actions logic --- engine/lib/actions.php | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/engine/lib/actions.php b/engine/lib/actions.php index 3a7c02488..53b185dea 100644 --- a/engine/lib/actions.php +++ b/engine/lib/actions.php @@ -82,44 +82,28 @@ function action($action, $forwarder = "") { $forwarder = str_replace(elgg_get_site_url(), "", $forwarder); $forwarder = str_replace("http://", "", $forwarder); $forwarder = str_replace("@", "", $forwarder); - if (substr($forwarder, 0, 1) == "/") { $forwarder = substr($forwarder, 1); } - if (isset($CONFIG->actions[$action])) { - if (elgg_is_admin_logged_in() || ($CONFIG->actions[$action]['access'] !== 'admin')) { - if (elgg_is_logged_in() || ($CONFIG->actions[$action]['access'] === 'public')) { - - // Trigger action event - // @todo This is only called before the primary action is called. - $event_result = true; - $event_result = elgg_trigger_plugin_hook('action', $action, null, $event_result); - - // Include action - // Event_result being false doesn't produce an error - // since i assume this will be handled in the hook itself. - // @todo make this better! - if ($event_result) { - if (!include($CONFIG->actions[$action]['file'])) { - register_error(elgg_echo('actionnotfound', array($action))); - } - } - } else { - register_error(elgg_echo('actionloggedout')); + if (!isset($CONFIG->actions[$action])) { + register_error(elgg_echo('actionundefined', array($action))); + } elseif (!elgg_is_admin_logged_in() && ($CONFIG->actions[$action]['access'] === 'admin')) { + register_error(elgg_echo('actionunauthorized')); + } elseif (!elgg_is_logged_in() && ($CONFIG->actions[$action]['access'] !== 'public')) { + register_error(elgg_echo('actionloggedout')); + } else { + // Returning falsy doesn't produce an error + // We assume this will be handled in the hook itself. + if (elgg_trigger_plugin_hook('action', $action, null, true)) { + if (!include($CONFIG->actions[$action]['file'])) { + register_error(elgg_echo('actionnotfound', array($action))); } - } else { - register_error(elgg_echo('actionunauthorized')); } - } else { - register_error(elgg_echo('actionundefined', array($action))); } - if (!empty($forwarder)) { - forward($forwarder); - } else { - forward(REFERER); - } + $forwarder = empty($forwarder) ? REFERER : $forwarder; + forward($forwarder); } /** -- cgit v1.2.3 From b7edff977107e928660256f37bbf4bc35fdea0a9 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 00:58:12 +0200 Subject: Refs #3646. "getRepositoryURL" is more descriptive than "getRepository". --- engine/classes/ElggPluginManifest.php | 10 +++++----- engine/tests/api/plugins.php | 4 ++-- views/default/object/plugin/full.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 5eb248c2c..5706d1e42 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -264,7 +264,7 @@ class ElggPluginManifest { /** * Returns the license * - * @return sting + * @return string */ public function getLicense() { // license vs licence. Use license. @@ -279,16 +279,16 @@ class ElggPluginManifest { /** * Returns the repository url * - * @return sting + * @return string */ - public function getRepository() { + public function getRepositoryURL() { return $this->parser->getAttribute('repository'); } /** * Returns the bug tracker page * - * @return sting + * @return string */ public function getBugTracker() { return $this->parser->getAttribute('bugtracker'); @@ -297,7 +297,7 @@ class ElggPluginManifest { /** * Returns the donations page * - * @return sting + * @return string */ public function getDonationsPage() { return $this->parser->getAttribute('donations'); diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 66297266c..3b650f1b0 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -169,8 +169,8 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { } public function testElggPluginManifestGetRepository() { - $this->assertEqual($this->manifest18->getRepository(), 'https://github.com/Elgg/Elgg'); - $this->assertEqual($this->manifest17->getRepository(), ''); + $this->assertEqual($this->manifest18->getRepositoryURL(), 'https://github.com/Elgg/Elgg'); + $this->assertEqual($this->manifest17->getRepositoryURL(), ''); } public function testElggPluginManifestGetBugtracker() { diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index a96acd4ec..76e1136f2 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -173,7 +173,7 @@ $website = elgg_view('output/url', array( )); $resources = array( - 'repository' => $plugin->getManifest()->getRepository(), + 'repository' => $plugin->getManifest()->getRepositoryURL(), 'bugtracker' => $plugin->getManifest()->getBugTracker(), 'donate' => $plugin->getManifest()->getDonationsPage(), ); -- cgit v1.2.3 From 25c324f5bf0f8737268c34626455a302b819651e Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 01:32:44 +0200 Subject: Refs #4004. Downgraded to notice and warning. It also returns the complete language name. --- engine/lib/languages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/lib/languages.php b/engine/lib/languages.php index e8e3d31af..77128202f 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,10 +50,11 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; - elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), WARNING); + $lang = elgg_echo($language, array(), 'en'); + elgg_log(sprintf('Missing %s translation for "%s" language key', $lang, $message_key), 'NOTICE'); } else { $string = $message_key; - elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), ERROR); + elgg_log(sprintf('Missing English translation for "%s" language key', $message_key), 'WARNING'); } // only pass through if we have arguments to allow backward compatibility -- cgit v1.2.3 From d6953c9955b2b9e3c245936e448e7be41058bb9b Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 09:53:15 +0200 Subject: Fixes #4687. Handle URLs on plugins that include only handler name. --- mod/bookmarks/start.php | 5 +++++ mod/groups/start.php | 8 ++++++++ mod/profile/start.php | 2 ++ 3 files changed, 15 insertions(+) diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 56bac984a..66e22b565 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -86,8 +86,13 @@ function bookmarks_init() { * @return bool */ function bookmarks_page_handler($page) { + elgg_load_library('elgg:bookmarks'); + if (!isset($page[0])) { + $page[0] = 'all'; + } + elgg_push_breadcrumb(elgg_echo('bookmarks'), 'bookmarks/all'); // old group usernames diff --git a/mod/groups/start.php b/mod/groups/start.php index 48df338c0..c591410c5 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -196,6 +196,10 @@ function groups_page_handler($page) { elgg_load_library('elgg:groups'); + if (!isset($page[0])) { + $page[0] = 'all'; + } + elgg_push_breadcrumb(elgg_echo('groups'), "groups/all"); switch ($page[0]) { @@ -785,6 +789,10 @@ function discussion_page_handler($page) { elgg_load_library('elgg:discussion'); + if (!isset($page[0])) { + $page[0] = 'all'; + } + elgg_push_breadcrumb(elgg_echo('discussion'), 'discussion/all'); switch ($page[0]) { diff --git a/mod/profile/start.php b/mod/profile/start.php index abe044632..ab596f235 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -56,6 +56,8 @@ function profile_page_handler($page) { $username = $page[0]; $user = get_user_by_username($username); elgg_set_page_owner_guid($user->guid); + } elseif (elgg_is_logged_in()) { + forward(elgg_get_logged_in_user_entity()->getURL()); } // short circuit if invalid or banned username -- cgit v1.2.3 From 185b73174fbd39e4b47c27f19839329438b8f3c2 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 14:39:32 +0300 Subject: Refs #4004. Used $CONFIG->translations instead of elgg_echo() --- engine/lib/languages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 77128202f..219917b29 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,7 +50,7 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; - $lang = elgg_echo($language, array(), 'en'); + $lang = $CONFIG->translations["en"][$language]; elgg_log(sprintf('Missing %s translation for "%s" language key', $lang, $message_key), 'NOTICE'); } else { $string = $message_key; -- cgit v1.2.3 From 2d986f9f35167ee66d0f084d3de6e70c78b69f7b Mon Sep 17 00:00:00 2001 From: Matt Beckett Date: Sat, 14 Jul 2012 01:37:05 -0600 Subject: Fixes #3240 - makes categories sticky --- mod/categories/views/default/input/categories.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/categories/views/default/input/categories.php b/mod/categories/views/default/input/categories.php index 75960d257..b543cde45 100644 --- a/mod/categories/views/default/input/categories.php +++ b/mod/categories/views/default/input/categories.php @@ -10,6 +10,12 @@ if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) { $selected_categories = $vars['entity']->universal_categories; } + +// use sticky values if set +if (isset($vars['universal_categories_list'])) { + $selected_categories = $vars['universal_categories_list']; +} + $categories = elgg_get_site_entity()->categories; if (empty($categories)) { $categories = array(); -- cgit v1.2.3 From d7a5c24dd7c31318cf2e4405337919b7fd5ec304 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 07:12:12 -0400 Subject: Fixes #4691 not passing name to the form since not valid --- mod/blog/lib/blog.php | 1 - mod/blog/views/default/js/blog/save_draft.php | 6 +++--- views/default/page/elements/comments.php | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 9a02a8cc3..4622a9e7e 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -272,7 +272,6 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) { $vars = array(); $vars['id'] = 'blog-post-edit'; - $vars['name'] = 'blog_post'; $vars['class'] = 'elgg-form-alt'; if ($page == 'edit') { diff --git a/mod/blog/views/default/js/blog/save_draft.php b/mod/blog/views/default/js/blog/save_draft.php index 8a994ffb0..8cd07ff5d 100644 --- a/mod/blog/views/default/js/blog/save_draft.php +++ b/mod/blog/views/default/js/blog/save_draft.php @@ -12,7 +12,7 @@ elgg.provide('elgg.blog'); */ elgg.blog.saveDraftCallback = function(data, textStatus, XHR) { if (textStatus == 'success' && data.success == true) { - var form = $('form[name=blog_post]'); + var form = $('form[id=blog-post-edit]'); // update the guid input element for new posts that now have a guid form.find('input[name=guid]').val(data.guid); @@ -36,7 +36,7 @@ elgg.blog.saveDraft = function() { } // only save on changed content - var form = $('form[name=blog_post]'); + var form = $('form[id=blog-post-edit]'); var description = form.find('textarea[name=description]').val(); var title = form.find('input[name=title]').val(); @@ -59,7 +59,7 @@ elgg.blog.saveDraft = function() { elgg.blog.init = function() { // get a copy of the body to compare for auto save - oldDescription = $('form[name=blog_post]').find('textarea[name=description]').val(); + oldDescription = $('form[id=blog-post-edit]').find('textarea[name=description]').val(); setInterval(elgg.blog.saveDraft, 60000); }; diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php index cf9b5f08b..97cb9574e 100644 --- a/views/default/page/elements/comments.php +++ b/views/default/page/elements/comments.php @@ -36,8 +36,7 @@ if ($html) { } if ($show_add_form) { - $form_vars = array('name' => 'elgg_add_comment'); - echo elgg_view_form('comments/add', $form_vars, $vars); + echo elgg_view_form('comments/add', array(), $vars); } echo ''; -- cgit v1.2.3 From cf151b55922b638feeeb9477b1d5dea764f4427b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 13:10:41 -0400 Subject: added .elgg-text-help to admin theme --- views/default/css/admin.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 78ec95c26..6f9ed643e 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1510,6 +1510,12 @@ ul.elgg-plugin-categories, ul.elgg-plugin-categories > li { margin-bottom: 5px; } +.elgg-text-help { + display: block; + font-size: 85%; + font-style: italic; +} + .elgg-longtext-control { margin-left: 14px; font-size: 80%; -- cgit v1.2.3 From 0a54cabfe75fb0261fff12ee48cd868bfa8f06fb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 20:42:31 -0400 Subject: Refs #4004 decided to downgrage missing language keys to NOTICE for all languages. The plugin categories were causing problems at the WARNING level. This will be more useful when we move db queries off NOTICE --- engine/lib/languages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 219917b29..98006f7cd 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,11 +50,11 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; - $lang = $CONFIG->translations["en"][$language]; + $lang = $CONFIG->translations["en"][$language]; elgg_log(sprintf('Missing %s translation for "%s" language key', $lang, $message_key), 'NOTICE'); } else { $string = $message_key; - elgg_log(sprintf('Missing English translation for "%s" language key', $message_key), 'WARNING'); + elgg_log(sprintf('Missing English translation for "%s" language key', $message_key), 'NOTICE'); } // only pass through if we have arguments to allow backward compatibility -- cgit v1.2.3 From 8163cd38fe4d963bfc9087f7fedc2461e655f43e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 21:00:53 -0400 Subject: Fixes #4705 validate view type --- engine/start.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/start.php b/engine/start.php index 5f4bded45..55b8ffa5b 100644 --- a/engine/start.php +++ b/engine/start.php @@ -100,6 +100,15 @@ elgg_trigger_event('boot', 'system'); // Load the plugins that are active elgg_load_plugins(); + +// @todo move loading plugins into a single boot function that replaces 'boot', 'system' event +// and then move this code in there. +// This validates the view type - first opportunity to do it is after plugins load. +$view_type = elgg_get_viewtype(); +if (!elgg_is_valid_view_type($view_type)) { + elgg_set_viewtype('default'); +} + // @todo deprecate as plugins can use 'init', 'system' event elgg_trigger_event('plugins_boot', 'system'); -- cgit v1.2.3 From 1ed326672a833f020bdb15f0b9cb047ab57f0b5b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 21:32:35 -0400 Subject: Fixes #3817 cleans up advanced settings form --- actions/admin/site/update_advanced.php | 2 -- views/default/forms/admin/site/update_advanced.php | 31 ++++++++++------------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php index 897a2f983..0fd8d1f35 100644 --- a/actions/admin/site/update_advanced.php +++ b/actions/admin/site/update_advanced.php @@ -53,8 +53,6 @@ if ($site = elgg_get_site_entity()) { $user_default_access = (get_input('allow_user_default_access')) ? 1 : 0; set_config('allow_user_default_access', $user_default_access, $site->getGUID()); - set_config('view', get_input('view'), $site->getGUID()); - $debug = get_input('debug'); if ($debug) { set_config('debug', $debug, $site->getGUID()); diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php index b935090f0..14b74e4f9 100644 --- a/views/default/forms/admin/site/update_advanced.php +++ b/views/default/forms/admin/site/update_advanced.php @@ -30,21 +30,21 @@ $form_body .= elgg_view('input/access', array( )) . ""; $form_body .= "
" . elgg_echo('installation:allow_user_default_access:description') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:allow_user_default_access:label') => elgg_echo('installation:allow_user_default_access:label')), + 'options' => array(elgg_echo('installation:allow_user_default_access:label') => 1), 'name' => 'allow_user_default_access', - 'value' => (elgg_get_config('allow_user_default_access') ? elgg_echo('installation:allow_user_default_access:label') : ""), + 'value' => (elgg_get_config('allow_user_default_access') ? 1 : 0), )) . "
"; $form_body .= "
" . elgg_echo('installation:simplecache:description') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:simplecache:label') => elgg_echo('installation:simplecache:label')), + 'options' => array(elgg_echo('installation:simplecache:label') => 1), 'name' => 'simplecache_enabled', - 'value' => (elgg_get_config('simplecache_enabled') ? elgg_echo('installation:simplecache:label') : ""), + 'value' => (elgg_get_config('simplecache_enabled') ? 1 : 0), )) . "
"; $form_body .= "
" . elgg_echo('installation:systemcache:description') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:systemcache:label') => elgg_echo('installation:systemcache:label')), + 'options' => array(elgg_echo('installation:systemcache:label') => 1), 'name' => 'system_cache_enabled', - 'value' => (elgg_get_config('system_cache_enabled') ? elgg_echo('installation:systemcache:label') : ""), + 'value' => (elgg_get_config('system_cache_enabled') ? 1 : 0), )) . "
"; $debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); @@ -58,9 +58,9 @@ $form_body .= ''; // control new user registration $options = array( - 'options' => array(elgg_echo('installation:registration:label') => elgg_echo('installation:registration:label')), + 'options' => array(elgg_echo('installation:registration:label') => 1), 'name' => 'allow_registration', - 'value' => elgg_get_config('allow_registration') ? elgg_echo('installation:registration:label') : '', + 'value' => elgg_get_config('allow_registration') ? 1 : 0, ); $form_body .= '
' . elgg_echo('installation:registration:description'); $form_body .= '
' .elgg_view('input/checkboxes', $options) . '
'; @@ -68,28 +68,25 @@ $form_body .= '
' .elgg_view('input/checkboxes', $options) . ''; // control walled garden $walled_garden = elgg_get_config(walled_garden); $options = array( - 'options' => array(elgg_echo('installation:walled_garden:label') => elgg_echo('installation:walled_garden:label')), + 'options' => array(elgg_echo('installation:walled_garden:label') => 1), 'name' => 'walled_garden', - 'value' => $walled_garden ? elgg_echo('installation:walled_garden:label') : '', + 'value' => $walled_garden ? 1 : 0, ); $form_body .= '
' . elgg_echo('installation:walled_garden:description'); $form_body .= '
' . elgg_view('input/checkboxes', $options) . '
'; $form_body .= "
" . elgg_echo('installation:httpslogin') . "
"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:httpslogin:label') => elgg_echo('installation:httpslogin:label')), + 'options' => array(elgg_echo('installation:httpslogin:label') => 1), 'name' => 'https_login', - 'value' => (elgg_get_config('https_login') ? elgg_echo('installation:httpslogin:label') : "") + 'value' => (elgg_get_config('https_login') ? 1 : 0) )) . "
"; $form_body .= "
" . elgg_echo('installation:disableapi') . "
"; -$on = elgg_echo('installation:disableapi:label'); $disable_api = elgg_get_config('disable_api'); -if ($disable_api) { - $on = (disable_api ? "" : elgg_echo('installation:disableapi:label')); -} +$on = $disable_api ? 0 : 1; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:disableapi:label') => elgg_echo('installation:disableapi:label')), + 'options' => array(elgg_echo('installation:disableapi:label') => 1), 'name' => 'api', 'value' => $on, )); -- cgit v1.2.3 From 2e0cc0343715adec8a0843750016f89acc3c2394 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 21:44:14 -0400 Subject: Fixes #4661 not showing access on widgets loaded through ajax if the layout does not show access --- actions/widgets/add.php | 3 ++- js/lib/ui.widgets.js | 1 + views/default/page/layouts/widgets.php | 1 + views/default/page/layouts/widgets/add_panel.php | 9 ++++++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/actions/widgets/add.php b/actions/widgets/add.php index f65d11134..d7b2f291c 100644 --- a/actions/widgets/add.php +++ b/actions/widgets/add.php @@ -9,6 +9,7 @@ $owner_guid = get_input('owner_guid'); $handler = get_input('handler'); $context = get_input('context'); +$show_access = (bool)get_input('show_access', true); $column = get_input('column', 1); $default_widgets = get_input('default_widgets', 0); @@ -29,7 +30,7 @@ if (!empty($owner_guid)) { $widget->move($column, 0); // send widget html for insertion - echo elgg_view_entity($widget); + echo elgg_view_entity($widget, array('show_access' => $show_access)); //system_message(elgg_echo('widgets:add:success')); forward(REFERER); diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index b7d4b2fe4..26020bb4b 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -58,6 +58,7 @@ elgg.ui.widgets.add = function(event) { handler: type, owner_guid: elgg.get_page_owner_guid(), context: $("input[name='widget_context']").val(), + show_access: $("input[name='show_access']").val(), default_widgets: $("input[name='default_widgets']").val() || 0 }, success: function(json) { diff --git a/views/default/page/layouts/widgets.php b/views/default/page/layouts/widgets.php index e3819cc20..c6b162516 100644 --- a/views/default/page/layouts/widgets.php +++ b/views/default/page/layouts/widgets.php @@ -31,6 +31,7 @@ if (elgg_can_edit_widget_layout($context)) { 'widgets' => $widgets, 'context' => $context, 'exact_match' => $exact_match, + 'show_access' => $show_access, ); echo elgg_view('page/layouts/widgets/add_panel', $params); } diff --git a/views/default/page/layouts/widgets/add_panel.php b/views/default/page/layouts/widgets/add_panel.php index 9eb78cdb6..d9b11342a 100644 --- a/views/default/page/layouts/widgets/add_panel.php +++ b/views/default/page/layouts/widgets/add_panel.php @@ -50,10 +50,13 @@ foreach ($widgets as $column_widgets) { ?> 'widget_context', 'value' => $context - ); - echo elgg_view('input/hidden', $params); + )); + echo elgg_view('input/hidden', array( + 'name' => 'show_access', + 'value' => (int)$vars['show_access'] + )); ?>
-- cgit v1.2.3 From 1080fecabc592c9c319c1aa816f61eb922cf3285 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 16 Jul 2012 20:05:39 -0400 Subject: added URL to the other new method names --- engine/classes/ElggPluginManifest.php | 4 ++-- engine/tests/api/plugins.php | 8 ++++---- views/default/object/plugin/full.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 5706d1e42..a1fe66856 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -290,7 +290,7 @@ class ElggPluginManifest { * * @return string */ - public function getBugTracker() { + public function getBugTrackerURL() { return $this->parser->getAttribute('bugtracker'); } @@ -299,7 +299,7 @@ class ElggPluginManifest { * * @return string */ - public function getDonationsPage() { + public function getDonationsPageURL() { return $this->parser->getAttribute('donations'); } diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 3b650f1b0..114f3991b 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -174,13 +174,13 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { } public function testElggPluginManifestGetBugtracker() { - $this->assertEqual($this->manifest18->getBugTracker(), 'http://trac.elgg.org'); - $this->assertEqual($this->manifest17->getBugTracker(), ''); + $this->assertEqual($this->manifest18->getBugTrackerURL(), 'http://trac.elgg.org'); + $this->assertEqual($this->manifest17->getBugTrackerURL(), ''); } public function testElggPluginManifestGetDonationsPage() { - $this->assertEqual($this->manifest18->getDonationsPage(), 'http://elgg.org/supporter.php'); - $this->assertEqual($this->manifest17->getDonationsPage(), ''); + $this->assertEqual($this->manifest18->getDonationsPageURL(), 'http://elgg.org/supporter.php'); + $this->assertEqual($this->manifest17->getDonationsPageURL(), ''); } public function testElggPluginManifestGetCopyright() { diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php index 76e1136f2..2de65b555 100644 --- a/views/default/object/plugin/full.php +++ b/views/default/object/plugin/full.php @@ -174,8 +174,8 @@ $website = elgg_view('output/url', array( $resources = array( 'repository' => $plugin->getManifest()->getRepositoryURL(), - 'bugtracker' => $plugin->getManifest()->getBugTracker(), - 'donate' => $plugin->getManifest()->getDonationsPage(), + 'bugtracker' => $plugin->getManifest()->getBugTrackerURL(), + 'donate' => $plugin->getManifest()->getDonationsPageURL(), ); $resources_html = "
    "; -- cgit v1.2.3 From 037eacc4a5015dc048c4fff080349aa96a9b918e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 16 Jul 2012 22:10:53 -0400 Subject: don't want to go overboard in asking for donations --- mod/blog/manifest.xml | 1 - mod/bookmarks/manifest.xml | 1 - mod/categories/manifest.xml | 1 - mod/custom_index/manifest.xml | 1 - mod/dashboard/manifest.xml | 1 - mod/developers/manifest.xml | 2 -- mod/diagnostics/manifest.xml | 1 - mod/embed/manifest.xml | 1 - mod/externalpages/manifest.xml | 1 - mod/file/manifest.xml | 1 - mod/garbagecollector/manifest.xml | 1 - mod/groups/manifest.xml | 1 - mod/htmlawed/manifest.xml | 1 - mod/invitefriends/manifest.xml | 1 - mod/likes/manifest.xml | 1 - mod/logbrowser/manifest.xml | 1 - mod/logrotate/manifest.xml | 1 - mod/members/manifest.xml | 1 - mod/messageboard/manifest.xml | 1 - mod/messages/manifest.xml | 1 - mod/notifications/manifest.xml | 1 - mod/oauth_api/manifest.xml | 1 - mod/pages/manifest.xml | 1 - mod/profile/manifest.xml | 1 - mod/reportedcontent/manifest.xml | 1 - mod/search/manifest.xml | 1 - mod/tagcloud/manifest.xml | 1 - mod/thewire/manifest.xml | 1 - mod/tinymce/manifest.xml | 1 - mod/twitter/manifest.xml | 1 - mod/twitter_api/manifest.xml | 1 - mod/uservalidationbyemail/manifest.xml | 1 - mod/zaudio/manifest.xml | 1 - 33 files changed, 34 deletions(-) diff --git a/mod/blog/manifest.xml b/mod/blog/manifest.xml index a68c30969..29ee1bfc8 100644 --- a/mod/blog/manifest.xml +++ b/mod/blog/manifest.xml @@ -9,7 +9,6 @@ Blog plugin Adds simple blogging capabilities to your Elgg installation. http://elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/bookmarks/manifest.xml b/mod/bookmarks/manifest.xml index ebe8704a6..b95af87f8 100644 --- a/mod/bookmarks/manifest.xml +++ b/mod/bookmarks/manifest.xml @@ -9,7 +9,6 @@ Add and comment on bookmarks. Adds the ability for users to bookmark internal and external sites. Other users can then comment on the bookmarks. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/categories/manifest.xml b/mod/categories/manifest.xml index dbc84bed0..4a6bd0864 100644 --- a/mod/categories/manifest.xml +++ b/mod/categories/manifest.xml @@ -8,7 +8,6 @@ Add site-wide categories Site-wide Categories lets administrators define categories that users across the site can add content to. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/custom_index/manifest.xml b/mod/custom_index/manifest.xml index 3bdcbd333..80187efbc 100644 --- a/mod/custom_index/manifest.xml +++ b/mod/custom_index/manifest.xml @@ -6,7 +6,6 @@ bundled A demonstration of how to create a front page plugin. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/dashboard/manifest.xml b/mod/dashboard/manifest.xml index 20ed074a7..cbbc1044c 100644 --- a/mod/dashboard/manifest.xml +++ b/mod/dashboard/manifest.xml @@ -6,7 +6,6 @@ bundled A widget-based dashboard for your users http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/developers/manifest.xml b/mod/developers/manifest.xml index 58e8e24f0..e31998872 100644 --- a/mod/developers/manifest.xml +++ b/mod/developers/manifest.xml @@ -8,9 +8,7 @@ Developer tools for Elgg 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/ - https://github.com/Elgg/Elgg http://trac.elgg.org - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/diagnostics/manifest.xml b/mod/diagnostics/manifest.xml index df4a81b02..21e847d22 100644 --- a/mod/diagnostics/manifest.xml +++ b/mod/diagnostics/manifest.xml @@ -8,7 +8,6 @@ admin Elgg diagnostics tool http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/embed/manifest.xml b/mod/embed/manifest.xml index 546471647..81ca9194e 100644 --- a/mod/embed/manifest.xml +++ b/mod/embed/manifest.xml @@ -7,7 +7,6 @@ enhancement Allows users to easily upload and embed media into text areas. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/externalpages/manifest.xml b/mod/externalpages/manifest.xml index 8c474ddab..f2aef09f3 100644 --- a/mod/externalpages/manifest.xml +++ b/mod/externalpages/manifest.xml @@ -6,7 +6,6 @@ bundled Create simple web pages for about, contact, privacy, and terms. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/file/manifest.xml b/mod/file/manifest.xml index 7d69f4280..26282a8e3 100644 --- a/mod/file/manifest.xml +++ b/mod/file/manifest.xml @@ -8,7 +8,6 @@ widget File browser plugin http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/garbagecollector/manifest.xml b/mod/garbagecollector/manifest.xml index ddf15656a..5aafebf38 100644 --- a/mod/garbagecollector/manifest.xml +++ b/mod/garbagecollector/manifest.xml @@ -7,7 +7,6 @@ admin Perform some database cleanup tasks http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/groups/manifest.xml b/mod/groups/manifest.xml index 574ba1985..fd28360d0 100644 --- a/mod/groups/manifest.xml +++ b/mod/groups/manifest.xml @@ -8,7 +8,6 @@ widget Provides group support for elgg http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/htmlawed/manifest.xml b/mod/htmlawed/manifest.xml index e4d8fa145..6807e96a4 100644 --- a/mod/htmlawed/manifest.xml +++ b/mod/htmlawed/manifest.xml @@ -7,7 +7,6 @@ security Provides security filtering. Running a site with this plugin disabled is extremely insecure. DO NOT DISABLE. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/invitefriends/manifest.xml b/mod/invitefriends/manifest.xml index 220948c30..b36238a05 100644 --- a/mod/invitefriends/manifest.xml +++ b/mod/invitefriends/manifest.xml @@ -7,7 +7,6 @@ social Invite friends via email invites. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/likes/manifest.xml b/mod/likes/manifest.xml index e0a9b10f2..62835fcf5 100644 --- a/mod/likes/manifest.xml +++ b/mod/likes/manifest.xml @@ -7,7 +7,6 @@ social Enables users to like content on the site. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/logbrowser/manifest.xml b/mod/logbrowser/manifest.xml index 17b08803c..4527e2cbb 100644 --- a/mod/logbrowser/manifest.xml +++ b/mod/logbrowser/manifest.xml @@ -7,7 +7,6 @@ admin Browse the system event log http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/logrotate/manifest.xml b/mod/logrotate/manifest.xml index 79b37dbbc..1aa62e2e7 100644 --- a/mod/logrotate/manifest.xml +++ b/mod/logrotate/manifest.xml @@ -7,7 +7,6 @@ admin Rotate the system log at specific intervals http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/members/manifest.xml b/mod/members/manifest.xml index 40a05892c..8b18c9f91 100644 --- a/mod/members/manifest.xml +++ b/mod/members/manifest.xml @@ -6,7 +6,6 @@ bundled Lists the members of your site http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/messageboard/manifest.xml b/mod/messageboard/manifest.xml index b4188ab31..617813725 100644 --- a/mod/messageboard/manifest.xml +++ b/mod/messageboard/manifest.xml @@ -7,7 +7,6 @@ widget This plugin allows users to put a message board on their profile for other users to post comments. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml index 83f7bba64..6e3462901 100644 --- a/mod/messages/manifest.xml +++ b/mod/messages/manifest.xml @@ -7,7 +7,6 @@ communication Elgg internal messages plugin. This plugin lets user send each other messages. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/notifications/manifest.xml b/mod/notifications/manifest.xml index d961ce138..205476881 100644 --- a/mod/notifications/manifest.xml +++ b/mod/notifications/manifest.xml @@ -6,7 +6,6 @@ bundled Elgg notifications plugin http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/oauth_api/manifest.xml b/mod/oauth_api/manifest.xml index 96b9c7280..991be6a22 100644 --- a/mod/oauth_api/manifest.xml +++ b/mod/oauth_api/manifest.xml @@ -7,7 +7,6 @@ bundled api http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/pages/manifest.xml b/mod/pages/manifest.xml index a764171b4..4cf999f45 100644 --- a/mod/pages/manifest.xml +++ b/mod/pages/manifest.xml @@ -8,7 +8,6 @@ widget Collaborative editing tool. Enables users to create pages similar to a wiki without having to know wiki syntax. http://www.elgg.org - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/profile/manifest.xml b/mod/profile/manifest.xml index b7ad5185e..86fbc7b7b 100644 --- a/mod/profile/manifest.xml +++ b/mod/profile/manifest.xml @@ -7,7 +7,6 @@ bundled social http://elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License Version 2 true diff --git a/mod/reportedcontent/manifest.xml b/mod/reportedcontent/manifest.xml index d98ff383b..e96620b01 100644 --- a/mod/reportedcontent/manifest.xml +++ b/mod/reportedcontent/manifest.xml @@ -6,7 +6,6 @@ bundled Adds the option for users to report content and for admins to check it out. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/search/manifest.xml b/mod/search/manifest.xml index 1bc974729..513d3a6b9 100644 --- a/mod/search/manifest.xml +++ b/mod/search/manifest.xml @@ -6,7 +6,6 @@ bundled Allow search across entities of the site http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/tagcloud/manifest.xml b/mod/tagcloud/manifest.xml index fd91d92b8..c0f89f35e 100644 --- a/mod/tagcloud/manifest.xml +++ b/mod/tagcloud/manifest.xml @@ -7,7 +7,6 @@ widget Widget-based tag clouds. http://cashcostello.com/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/thewire/manifest.xml b/mod/thewire/manifest.xml index 950ecfbed..962ed12f1 100644 --- a/mod/thewire/manifest.xml +++ b/mod/thewire/manifest.xml @@ -7,7 +7,6 @@ content Microblogging for Elgg http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/tinymce/manifest.xml b/mod/tinymce/manifest.xml index fb36c4141..61bf0c22c 100644 --- a/mod/tinymce/manifest.xml +++ b/mod/tinymce/manifest.xml @@ -7,7 +7,6 @@ enhancement TinyMCE plugin. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/twitter/manifest.xml b/mod/twitter/manifest.xml index 18031deec..18fa8c957 100644 --- a/mod/twitter/manifest.xml +++ b/mod/twitter/manifest.xml @@ -7,7 +7,6 @@ widget Elgg simple twitter widget http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/twitter_api/manifest.xml b/mod/twitter_api/manifest.xml index 88d43aa5e..86bba4b50 100644 --- a/mod/twitter_api/manifest.xml +++ b/mod/twitter_api/manifest.xml @@ -7,7 +7,6 @@ api bundled http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/uservalidationbyemail/manifest.xml b/mod/uservalidationbyemail/manifest.xml index 6a15fd0cf..800dd2641 100644 --- a/mod/uservalidationbyemail/manifest.xml +++ b/mod/uservalidationbyemail/manifest.xml @@ -7,7 +7,6 @@ security Simple user account validation via email. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 diff --git a/mod/zaudio/manifest.xml b/mod/zaudio/manifest.xml index a103052aa..54f819658 100644 --- a/mod/zaudio/manifest.xml +++ b/mod/zaudio/manifest.xml @@ -8,7 +8,6 @@ multimedia This simple plugin lets users play mp3's in the page. http://www.elgg.org/ - http://elgg.org/supporter.php See COPYRIGHT.txt GNU General Public License version 2 -- cgit v1.2.3 From b164c39ac5c82b311e9ef07fa01fcc464bab86b1 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 16 Jul 2012 22:30:20 -0400 Subject: Fixes #4621 adds warning to remove_subtype() --- engine/lib/entities.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index abfe07276..66c1475b7 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -313,6 +313,10 @@ function add_subtype($type, $subtype, $class = "") { /** * Removes a registered ElggEntity type, subtype, and classname. * + * @warning You do not want to use this function. If you want to unregister + * a class for a subtype, use update_subtype(). Using this function will + * permanently orphan all the objects created with the specified subtype. + * * @param string $type Type * @param string $subtype Subtype * -- cgit v1.2.3 From 3cb2ce976fc024dfc700ef4500e5cddd01163e9c Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Sat, 21 Jul 2012 15:23:42 -0700 Subject: Revert "Fixes #4606 made unlike code consistent and functional" This reverts commit e3222535a07e39ffe506eb9688db515798ebf2a4. --- mod/likes/actions/likes/delete.php | 17 +++++++++++------ mod/likes/languages/en.php | 1 - mod/likes/views/default/annotation/likes.php | 4 ++-- mod/likes/views/default/likes/button.php | 8 +------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/mod/likes/actions/likes/delete.php b/mod/likes/actions/likes/delete.php index 88cb84467..db3036bb4 100644 --- a/mod/likes/actions/likes/delete.php +++ b/mod/likes/actions/likes/delete.php @@ -4,12 +4,17 @@ * */ -$id = (int) get_input('id'); -$like = elgg_get_annotation_from_id($id); -if ($like && $like->canEdit()) { - $like->delete(); - system_message(elgg_echo("likes:deleted")); - forward(REFERER); +$likes = elgg_get_annotations(array( + 'guid' => (int) get_input('guid'), + 'annotation_owner_guid' => elgg_get_logged_in_user_guid(), + 'annotation_name' => 'likes', +)); +if ($likes) { + if ($likes[0]->canEdit()) { + $likes[0]->delete(); + system_message(elgg_echo("likes:deleted")); + forward(REFERER); + } } register_error(elgg_echo("likes:notdeleted")); diff --git a/mod/likes/languages/en.php b/mod/likes/languages/en.php index b9460aa10..4a98d7cfe 100644 --- a/mod/likes/languages/en.php +++ b/mod/likes/languages/en.php @@ -17,7 +17,6 @@ $english = array( 'likes:userlikedthis' => '%s like', 'likes:userslikedthis' => '%s likes', 'likes:river:annotate' => 'likes', - 'likes:delete:confirm' => 'Are you sure you want to unlike this?', 'river:likes' => 'likes %s %s', diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php index abd4df823..d41522fc4 100644 --- a/mod/likes/views/default/annotation/likes.php +++ b/mod/likes/views/default/annotation/likes.php @@ -29,9 +29,9 @@ $friendlytime = elgg_view_friendly_time($like->time_created); if ($like->canEdit()) { $delete_button = elgg_view("output/confirmlink",array( - 'href' => "action/likes/delete?id={$like->id}", + 'href' => "action/likes/delete?annotation_id={$like->id}", 'text' => "", - 'confirm' => elgg_echo('likes:delete:confirm'), + 'confirm' => elgg_echo('deleteconfirm'), 'encode_text' => false, )); } diff --git a/mod/likes/views/default/likes/button.php b/mod/likes/views/default/likes/button.php index 956bbcb19..bc7c8fd8a 100644 --- a/mod/likes/views/default/likes/button.php +++ b/mod/likes/views/default/likes/button.php @@ -24,13 +24,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) { ); $likes_button = elgg_view('output/url', $params); } else { - $like = elgg_get_annotations(array( - 'guid' => $guid, - 'annotation_owner_guid' => elgg_get_logged_in_user_guid(), - 'annotation_name' => 'likes', - )); - $like = $like[0]; - $url = elgg_get_site_url() . "action/likes/delete?id={$like->id}"; + $url = elgg_get_site_url() . "action/likes/delete?guid={$guid}"; $params = array( 'href' => $url, 'text' => elgg_view_icon('thumbs-up-alt'), -- cgit v1.2.3 From 55e11c0675508b4ccc2cb88ed2238a0c0a38cc17 Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Sat, 21 Jul 2012 15:49:31 -0700 Subject: Fixes #4750: Supporting both id and guid arguments for likes/delete --- mod/likes/actions/likes/delete.php | 32 ++++++++++++++++++---------- mod/likes/languages/en.php | 1 + mod/likes/views/default/annotation/likes.php | 10 ++++----- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/mod/likes/actions/likes/delete.php b/mod/likes/actions/likes/delete.php index db3036bb4..322d512e8 100644 --- a/mod/likes/actions/likes/delete.php +++ b/mod/likes/actions/likes/delete.php @@ -4,17 +4,27 @@ * */ -$likes = elgg_get_annotations(array( - 'guid' => (int) get_input('guid'), - 'annotation_owner_guid' => elgg_get_logged_in_user_guid(), - 'annotation_name' => 'likes', -)); -if ($likes) { - if ($likes[0]->canEdit()) { - $likes[0]->delete(); - system_message(elgg_echo("likes:deleted")); - forward(REFERER); - } +// Support deleting by id in case we're deleting another user's likes +$id = (int) get_input('id'); + +$like = NULL; +if ($id) { + $like = elgg_get_annotation_from_id($id); +} + +if (!$like) { + $likes = elgg_get_annotations(array( + 'guid' => (int) get_input('guid'), + 'annotation_owner_guid' => elgg_get_logged_in_user_guid(), + 'annotation_name' => 'likes', + )); + $like = $likes[0]; +} + +if ($like && $like->canEdit()) { + $like->delete(); + system_message(elgg_echo("likes:deleted")); + forward(REFERER); } register_error(elgg_echo("likes:notdeleted")); diff --git a/mod/likes/languages/en.php b/mod/likes/languages/en.php index 4a98d7cfe..bdbd2a963 100644 --- a/mod/likes/languages/en.php +++ b/mod/likes/languages/en.php @@ -17,6 +17,7 @@ $english = array( 'likes:userlikedthis' => '%s like', 'likes:userslikedthis' => '%s likes', 'likes:river:annotate' => 'likes', + 'likes:delete:confirm' => 'Are you sure you want to delete this like?', 'river:likes' => 'likes %s %s', diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php index d41522fc4..2b5acc520 100644 --- a/mod/likes/views/default/annotation/likes.php +++ b/mod/likes/views/default/annotation/likes.php @@ -29,11 +29,11 @@ $friendlytime = elgg_view_friendly_time($like->time_created); if ($like->canEdit()) { $delete_button = elgg_view("output/confirmlink",array( - 'href' => "action/likes/delete?annotation_id={$like->id}", - 'text' => "", - 'confirm' => elgg_echo('deleteconfirm'), - 'encode_text' => false, - )); + 'href' => "action/likes/delete?id={$like->id}", + 'text' => "", + 'confirm' => elgg_echo('likes:delete:confirm'), + 'encode_text' => false, + )); } $body = << Date: Tue, 24 Jul 2012 09:34:06 -0700 Subject: Better grid preview --- .../views/default/theme_preview/grid.php | 134 +++++++++++++-------- 1 file changed, 86 insertions(+), 48 deletions(-) diff --git a/mod/developers/views/default/theme_preview/grid.php b/mod/developers/views/default/theme_preview/grid.php index 030e752e7..0c4cbb251 100644 --- a/mod/developers/views/default/theme_preview/grid.php +++ b/mod/developers/views/default/theme_preview/grid.php @@ -4,73 +4,111 @@ */ ?> - - -
    -
    -

    1/5

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    +
    +

    1/1

    -
    -
    -

    3/5

    -
    -
    -

    1/2

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    -
    -
    -
    -

    1/2

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    -
    -
    -
    -

    1/3

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    +
    +

    1/2

    +

    1/2

    +
    +
    +

    1/3

    +

    2/3

    +
    +
    +

    3/4

    +

    1/4

    +
    +
    +

    1/5

    +

    4/5

    +
    +
    +

    3/5

    +

    2/5

    +
    +
    +

    1/6

    +

    5/6

    +
    +
    + +
    +
    +

    1/5

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    -
    -

    2/3

    +
    +
    +
    +

    3/5

    +

    1/2

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    +

    1/2

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -
    +
    +
    +
    -

    1

    +

    1/3

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +
    +
    +

    2/3

    +
    +
    +
    +

    1/2

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +
    +
    +
    +
    +

    1/2

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +
    +
    +
    +
    +
    +
    +

    1

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +
    +
    +
    +
    +
    -
    -
    -
    -

    1/5

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +
    +
    +

    1/5

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    +
    - -
    -- cgit v1.2.3 From 4dd2ca9d54b64ebbf5eba3e3036f747cadb40825 Mon Sep 17 00:00:00 2001 From: Sem Date: Sat, 28 Jul 2012 03:34:59 +0200 Subject: Fixes #4740. Added language fallback in javascript. --- views/default/js/languages.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/views/default/js/languages.php b/views/default/js/languages.php index 009e8159c..c51d7bcb2 100644 --- a/views/default/js/languages.php +++ b/views/default/js/languages.php @@ -6,4 +6,10 @@ global $CONFIG; $language = $vars['language']; -echo json_encode($CONFIG->translations[$language]); \ No newline at end of file +$translations = $CONFIG->translations['en']; + +if ($language != 'en') { + $translations = array_merge($translations, $CONFIG->translations[$language]); +} + +echo json_encode($translations); \ No newline at end of file -- cgit v1.2.3