aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt15
-rw-r--r--actions/admin/site/update_advanced.php2
-rw-r--r--actions/river/delete.php21
-rw-r--r--actions/widgets/add.php3
-rw-r--r--documentation/info/manifest.xml3
-rw-r--r--engine/classes/ElggPluginManifest.php34
-rw-r--r--engine/classes/ElggPluginManifestParser18.php11
-rw-r--r--engine/lib/actions.php44
-rw-r--r--engine/lib/languages.php3
-rw-r--r--engine/lib/navigation.php13
-rw-r--r--engine/lib/river.php4
-rw-r--r--engine/start.php9
-rw-r--r--engine/tests/api/plugins.php18
-rw-r--r--engine/tests/test_files/plugin_18/manifest.xml3
-rw-r--r--js/lib/ui.widgets.js1
-rw-r--r--languages/en.php5
-rw-r--r--mod/blog/lib/blog.php1
-rw-r--r--mod/blog/views/default/js/blog/save_draft.php6
-rw-r--r--mod/bookmarks/start.php5
-rw-r--r--mod/categories/views/default/input/categories.php6
-rw-r--r--mod/developers/manifest.xml1
-rw-r--r--mod/groups/actions/groups/edit.php5
-rw-r--r--mod/groups/lib/discussion.php2
-rw-r--r--mod/groups/start.php8
-rw-r--r--mod/groups/views/default/forms/groups/edit.php14
-rw-r--r--mod/htmlawed/start.php22
-rw-r--r--mod/htmlawed/tests/tags.php45
-rw-r--r--mod/messages/manifest.xml2
-rw-r--r--mod/profile/start.php2
-rw-r--r--mod/thewire/actions/delete.php2
-rw-r--r--version.php4
-rw-r--r--views/default/css/admin.php9
-rw-r--r--views/default/forms/admin/site/update_advanced.php31
-rw-r--r--views/default/object/plugin/full.php28
-rw-r--r--views/default/page/elements/comments.php3
-rw-r--r--views/default/page/layouts/widgets.php1
-rw-r--r--views/default/page/layouts/widgets/add_panel.php9
37 files changed, 316 insertions, 79 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 45f561ab5..7a3422d7d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,18 @@
+Version 1.8.8
+(July 11, 2012 from https://github.com/Elgg/Elgg/tree/1.8)
+
+ Contributing Developers:
+ * Cash Costello
+ * Miguel Rodriguez
+ * Sem
+
+ Enhancements:
+ * Added a delete button on river items for admins
+
+ Bugfixes:
+ * Fixed the significant bug with htmlawed plugin that caused duplicate tags
+
+
Version 1.8.7
(July 10, 2012 from https://github.com/Elgg/Elgg/tree/1.8)
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/actions/river/delete.php b/actions/river/delete.php
new file mode 100644
index 000000000..0d8297932
--- /dev/null
+++ b/actions/river/delete.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * River item delete action
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$id = get_input('id', false);
+
+if ($id !== false && elgg_is_admin_logged_in()) {
+ if (elgg_delete_river(array('id' => $id))) {
+ system_message(elgg_echo('river:delete:success'));
+ } else {
+ register_error(elgg_echo('river:delete:fail'));
+ }
+} else {
+ register_error(elgg_echo('river:delete:fail'));
+}
+
+forward(REFERER);
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/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 @@
<blurb>A concise description.</blurb>
<description>This is a longer, more interesting description of my plugin, its features, and other important information.</description>
<website>http://www.elgg.org/</website>
+ <repository>https://github.com/Elgg/Elgg</repository>
+ <bugtracker>http://trac.elgg.org</bugtracker>
+ <donations>http://elgg.org/supporter.php</donations>
<copyright>(C) Elgg 2011</copyright>
<license>GNU General Public License version 2</license>
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index 7e79c15c8..a4f5bb95d 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.
@@ -276,6 +276,32 @@ class ElggPluginManifest {
}
}
+ /**
+ * Returns the repository url
+ *
+ * @return string
+ */
+ public function getRepositoryURL() {
+ return $this->parser->getAttribute('repository');
+ }
+
+ /**
+ * Returns the bug tracker page
+ *
+ * @return string
+ */
+ public function getBugTrackerURL() {
+ return $this->parser->getAttribute('bugtracker');
+ }
+
+ /**
+ * Returns the donations page
+ *
+ * @return string
+ */
+ public function getDonationsPageURL() {
+ return $this->parser->getAttribute('donations');
+ }
/**
* Returns the version of the plugin.
@@ -456,7 +482,7 @@ class ElggPluginManifest {
* Normalizes a dependency array using the defined structs.
* Can be used with either requires or suggests.
*
- * @param array $dep An dependency array.
+ * @param array $dep A dependency array.
* @return array The normalized deps array.
*/
private function normalizeDep($dep) {
@@ -500,8 +526,10 @@ class ElggPluginManifest {
break;
}
}
-
break;
+ default:
+ // unrecognized so we just return the raw dependency
+ return $dep;
}
$normalized_dep = $this->buildStruct($struct, $dep);
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/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);
}
/**
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index 15c48f902..98006f7cd 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -50,8 +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];
+ 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), 'NOTICE');
}
// only pass through if we have arguments to allow backward compatibility
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index 4ff009bfb..10b11acfe 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -335,6 +335,19 @@ function elgg_river_menu_setup($hook, $type, $return, $params) {
$return[] = ElggMenuItem::factory($options);
}
}
+
+ if (elgg_is_admin_logged_in()) {
+ $options = array(
+ 'name' => 'delete',
+ 'href' => "action/river/delete?id=$item->id",
+ 'text' => elgg_view_icon('delete'),
+ 'title' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ 'is_action' => true,
+ 'priority' => 200,
+ );
+ $return[] = ElggMenuItem::factory($options);
+ }
}
return $return;
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 711832f70..b717a7756 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -643,9 +643,11 @@ function elgg_river_init() {
elgg_register_page_handler('activity', 'elgg_river_page_handler');
$item = new ElggMenuItem('activity', elgg_echo('activity'), 'activity');
elgg_register_menu_item('site', $item);
-
+
elgg_register_widget_type('river_widget', elgg_echo('river:widget:title'), elgg_echo('river:widget:description'));
+ elgg_register_action('river/delete', '', 'admin');
+
elgg_register_plugin_hook_handler('unit_test', 'system', 'elgg_river_test');
}
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');
diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php
index 8ecb0a46c..114f3991b 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->getRepositoryURL(), 'https://github.com/Elgg/Elgg');
+ $this->assertEqual($this->manifest17->getRepositoryURL(), '');
+ }
+
+ public function testElggPluginManifestGetBugtracker() {
+ $this->assertEqual($this->manifest18->getBugTrackerURL(), 'http://trac.elgg.org');
+ $this->assertEqual($this->manifest17->getBugTrackerURL(), '');
+ }
+
+ public function testElggPluginManifestGetDonationsPage() {
+ $this->assertEqual($this->manifest18->getDonationsPageURL(), 'http://elgg.org/supporter.php');
+ $this->assertEqual($this->manifest17->getDonationsPageURL(), '');
+ }
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 @@
<blurb>A concise description.</blurb>
<description>A longer, more interesting description.</description>
<website>http://www.elgg.org/</website>
+ <repository>https://github.com/Elgg/Elgg</repository>
+ <bugtracker>http://trac.elgg.org</bugtracker>
+ <donations>http://elgg.org/supporter.php</donations>
<copyright>(C) Elgg Foundation 2011</copyright>
<license>GNU General Public License version 2</license>
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/languages/en.php b/languages/en.php
index 18d0c88d9..bb5376a44 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -437,6 +437,8 @@ $english = array(
'river:ingroup' => 'in the group %s',
'river:none' => 'No activity',
'river:update' => 'Update for %s',
+ 'river:delete:success' => 'River item has been deleted',
+ 'river:delete:fail' => 'River item could not be deleted',
'river:widget:title' => "Activity",
'river:widget:description' => "Display latest activity",
@@ -686,6 +688,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/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/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/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();
diff --git a/mod/developers/manifest.xml b/mod/developers/manifest.xml
index 93a12945d..e31998872 100644
--- a/mod/developers/manifest.xml
+++ b/mod/developers/manifest.xml
@@ -8,6 +8,7 @@
<blurb>Developer tools for Elgg</blurb>
<description>A set of tools for writing plugins and themes. It is recommended that you have this plugin at the top of the plugin list.</description>
<website>http://www.elgg.org/</website>
+ <bugtracker>http://trac.elgg.org</bugtracker>
<copyright>See COPYRIGHT.txt</copyright>
<license>GNU General Public License version 2</license>
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index a76bde0ac..df2464a65 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) {
@@ -110,6 +112,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/lib/discussion.php b/mod/groups/lib/discussion.php
index 02ab27fdc..ab2fe4849 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -15,7 +15,7 @@ function discussion_handle_all_page() {
'type' => 'object',
'subtype' => 'groupforumtopic',
'order_by' => 'e.last_action desc',
- 'limit' => 40,
+ 'limit' => 20,
'full_view' => false,
));
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/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'])) {
<label><?php echo elgg_echo("groups:name"); ?></label><br />
<?php echo elgg_view("input/text", array(
'name' => 'name',
- 'value' => $vars['entity']->name,
+ 'value' => isset($sticky_values['name']) ? $sticky_values['name'] : $vars['entity']->name,
));
?>
</div>
@@ -45,7 +53,7 @@ if ($group_profile_fields > 0) {
echo "</label>$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 '</div>';
}
diff --git a/mod/htmlawed/start.php b/mod/htmlawed/start.php
index 5af18f4dd..12b6470a3 100644
--- a/mod/htmlawed/start.php
+++ b/mod/htmlawed/start.php
@@ -18,6 +18,8 @@ function htmlawed_init() {
$lib = elgg_get_plugins_path() . "htmlawed/vendors/htmLawed/htmLawed.php";
elgg_register_library('htmlawed', $lib);
+
+ elgg_register_plugin_hook_handler('unit_test', 'system', 'htmlawed_test');
}
/**
@@ -90,7 +92,13 @@ function htmLawedArray(&$v, $k, $htmlawed_config) {
* @param array $attributes An array of attributes
* @return string
*/
-function htmlawed_tag_post_processor($element, $attributes = array()) {
+function htmlawed_tag_post_processor($element, $attributes = false) {
+ if ($attributes === false) {
+ // This is a closing tag. Prevent further processing to avoid inserting a duplicate tag
+
+ return "</${element}>";
+ }
+
// these are the default styles used by tinymce.
$allowed_styles = array(
'color', 'cursor', 'text-align', 'vertical-align', 'font-size',
@@ -143,3 +151,15 @@ function htmlawed_tag_post_processor($element, $attributes = array()) {
$r = "<$element$string>";
return $r;
}
+
+/**
+ * Runs unit tests for htmlawed
+ *
+ * @return array
+ * */
+function htmlawed_test($hook, $type, $value, $params) {
+ global $CONFIG;
+
+ $value[] = dirname(__FILE__) . '/tests/tags.php';
+ return $value;
+}
diff --git a/mod/htmlawed/tests/tags.php b/mod/htmlawed/tests/tags.php
new file mode 100644
index 000000000..b3914a9d6
--- /dev/null
+++ b/mod/htmlawed/tests/tags.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Dupplicated tags in htmlawed
+ */
+class HtmLawedDuplicateTagsTest extends ElggCoreUnitTest {
+
+ /**
+ * Called before each test object.
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+
+ /**
+ * Called before each test method.
+ */
+ public function setUp() {
+ }
+
+ /**
+ * Called after each test method.
+ */
+ public function tearDown() {
+ // do not allow SimpleTest to interpret Elgg notices as exceptions
+ $this->swallowErrors();
+ }
+
+ /**
+ * Called after each test object.
+ */
+ public function __destruct() {
+ elgg_set_ignore_access($this->ia);
+ // all __destruct() code should go above here
+ parent::__destruct();
+ }
+
+ public function testNotDuplicateTags() {
+ $filter_html = '<ul><li>item</li></ul>';
+ set_input('test', $filter_html);
+
+ $expected = $filter_html;
+ $result = get_input('test');
+ $this->assertEqual($result, $expected);
+ }
+} \ No newline at end of file
diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml
index 73a58d9d4..6e3462901 100644
--- a/mod/messages/manifest.xml
+++ b/mod/messages/manifest.xml
@@ -6,8 +6,8 @@
<category>bundled</category>
<category>communication</category>
<description>Elgg internal messages plugin. This plugin lets user send each other messages.</description>
- <copyright>See COPYRIGHT.txt</copyright>
<website>http://www.elgg.org/</website>
+ <copyright>See COPYRIGHT.txt</copyright>
<license>GNU General Public License version 2</license>
<requires>
<type>elgg_release</type>
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
diff --git a/mod/thewire/actions/delete.php b/mod/thewire/actions/delete.php
index 58502a7e7..38355d25e 100644
--- a/mod/thewire/actions/delete.php
+++ b/mod/thewire/actions/delete.php
@@ -24,7 +24,7 @@ if ($thewire->getSubtype() == "thewire" && $thewire->canEdit()) {
}
// Get owning user
- $owner = get_entity($thewire->getOwner());
+ $owner = get_entity($thewire->getOwnerGUID());
// Delete it
$rowsaffected = $thewire->delete();
diff --git a/version.php b/version.php
index 0fb757b9c..dda087c52 100644
--- a/version.php
+++ b/version.php
@@ -11,7 +11,7 @@
// YYYYMMDD = Elgg Date
// XX = Interim incrementer
-$version = 2012061800;
+$version = 2012071100;
// Human-friendly version name
-$release = '1.8.6';
+$release = '1.8.8';
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 78ec95c26..b996e5636 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 {
@@ -1510,6 +1511,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%;
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(
)) . "</div>";
$form_body .= "<div>" . elgg_echo('installation:allow_user_default_access:description') . "<br />";
$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),
)) . "</div>";
$form_body .= "<div>" . elgg_echo('installation:simplecache:description') . "<br />";
$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),
)) . "</div>";
$form_body .= "<div>" . elgg_echo('installation:systemcache:description') . "<br />";
$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),
)) . "</div>";
$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 .= '</div>';
// 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 .= '<div>' . elgg_echo('installation:registration:description');
$form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</div>';
@@ -68,28 +68,25 @@ $form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</div>';
// 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 .= '<div>' . elgg_echo('installation:walled_garden:description');
$form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</div>';
$form_body .= "<div>" . elgg_echo('installation:httpslogin') . "<br />";
$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)
)) . "</div>";
$form_body .= "<div>" . elgg_echo('installation:disableapi') . "<br />";
-$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,
));
diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php
index db0a52416..2de65b555 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()->getRepositoryURL(),
+ 'bugtracker' => $plugin->getManifest()->getBugTrackerURL(),
+ 'donate' => $plugin->getManifest()->getDonationsPageURL(),
+);
+
+$resources_html = "<ul class=\"elgg-plugin-resources\">";
+foreach ($resources as $id => $href) {
+ if ($href) {
+ $resources_html .= "<li class=\"prm\">";
+ $resources_html .= elgg_view('output/url', array(
+ 'href' => $href,
+ 'text' => elgg_echo("admin:plugins:label:$id"),
+ 'is_trusted' => true,
+ ));
+ $resources_html .= "</li>";
+ }
+}
+$resources_html .= "</ul>";
+
$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)
<div><?php echo $description; ?></div>
<p><?php echo $author . ' - ' . $website; ?></p>
- <?php echo $docs; ?>
+
+ <?php
+ echo $resources_html;
+ echo $docs;
+ ?>
<div class="pts">
<?php
@@ -281,4 +305,4 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)
?>
</div>
</div>
-</div> \ No newline at end of file
+</div>
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 '</div>';
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) {
?>
</ul>
<?php
- $params = array(
+ echo elgg_view('input/hidden', array(
'name' => 'widget_context',
'value' => $context
- );
- echo elgg_view('input/hidden', $params);
+ ));
+ echo elgg_view('input/hidden', array(
+ 'name' => 'show_access',
+ 'value' => (int)$vars['show_access']
+ ));
?>
</div>