aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--documentation/coding_standards/javascript_coding_standards.txt11
-rw-r--r--engine/classes/ElggUser.php1
-rw-r--r--engine/lib/access.php2
-rw-r--r--engine/lib/annotations.php4
-rw-r--r--engine/lib/entities.php2
-rw-r--r--engine/lib/location.php2
-rw-r--r--engine/lib/metadata.php2
-rw-r--r--engine/lib/plugins.php4
-rw-r--r--engine/lib/private_settings.php2
-rw-r--r--engine/lib/relationships.php4
-rw-r--r--engine/start.php5
-rw-r--r--install/ElggInstaller.php7
-rw-r--r--js/classes/ElggPriorityList.js7
-rw-r--r--js/classes/ElggUser.js16
-rw-r--r--js/lib/avatar_cropper.js6
-rw-r--r--js/lib/configuration.js2
-rw-r--r--js/lib/elgglib.js12
-rw-r--r--js/lib/hooks.js10
-rw-r--r--js/lib/ui.js59
-rw-r--r--js/lib/ui.widgets.js12
-rw-r--r--js/lib/userpicker.js10
-rw-r--r--js/tests/ElggLanguagesTest.js2
-rw-r--r--js/tests/ElggPriorityListTest.js6
-rw-r--r--js/tests/ElggSecurityTest.js6
-rw-r--r--js/tests/jsTestDriver.conf3
-rw-r--r--languages/en.php8
-rw-r--r--mod/blog/lib/blog.php1
-rw-r--r--mod/blog/views/default/js/blog/save_draft.php4
-rw-r--r--mod/blog/views/default/object/blog.php1
-rw-r--r--mod/bookmarks/languages/en.php4
-rw-r--r--mod/bookmarks/pages/bookmarks/all.php4
-rw-r--r--mod/bookmarks/pages/bookmarks/friends.php8
-rw-r--r--mod/bookmarks/pages/bookmarks/view.php1
-rw-r--r--mod/bookmarks/views/default/bookmarks/js.php2
-rw-r--r--mod/bookmarks/views/default/object/bookmarks.php1
-rw-r--r--mod/bookmarks/views/rss/object/bookmarks.php36
-rw-r--r--mod/developers/views/default/admin/developers/settings.php2
-rw-r--r--mod/developers/views/default/js/developers/developers.php4
-rw-r--r--mod/developers/views/default/theme_preview/forms.php4
-rw-r--r--mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php4
-rw-r--r--mod/embed/views/default/js/embed/embed.php8
-rw-r--r--mod/externalpages/views/default/admin/appearance/expages.php2
-rw-r--r--mod/externalpages/views/default/expages/menu.php31
-rw-r--r--mod/file/languages/en.php2
-rw-r--r--mod/file/pages/file/world.php3
-rw-r--r--mod/file/start.php3
-rw-r--r--mod/file/views/default/object/file.php1
-rw-r--r--mod/file/views/rss/file/enclosure.php16
-rw-r--r--mod/file/views/rss/object/file.php21
-rw-r--r--mod/groups/languages/en.php5
-rw-r--r--mod/groups/lib/discussion.php3
-rw-r--r--mod/groups/lib/groups.php15
-rw-r--r--mod/groups/views/default/discussion/group_module.php2
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php1
-rw-r--r--mod/messageboard/views/default/messageboard/js.php6
-rw-r--r--mod/pages/views/default/object/page_top.php1
-rw-r--r--mod/search/views/rss/search/list.php (renamed from mod/search/views/rss/search/listing.php)0
-rw-r--r--mod/thewire/languages/en.php1
-rw-r--r--mod/thewire/views/default/js/thewire.php6
-rw-r--r--mod/thewire/views/rss/object/thewire.php59
-rw-r--r--mod/tinymce/views/default/js/tinymce.php4
-rw-r--r--mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php2
-rw-r--r--views/default/admin/appearance/menu_items.php2
-rw-r--r--views/default/admin/appearance/profile_fields.php2
-rw-r--r--views/default/admin/plugin_settings.php2
-rw-r--r--views/default/admin/plugins.php3
-rw-r--r--views/default/admin/settings/advanced.php2
-rw-r--r--views/default/admin/settings/basic.php2
-rw-r--r--views/default/css/admin.php2
-rw-r--r--views/default/css/elements/forms.php2
-rw-r--r--views/default/forms/login.php6
-rw-r--r--views/default/object/elements/full.php10
-rw-r--r--views/default/output/text.php3
-rw-r--r--views/rss/annotation/generic_comment.php2
-rw-r--r--views/rss/group/default.php2
-rw-r--r--views/rss/object/default.php6
-rw-r--r--views/rss/user/default.php2
77 files changed, 269 insertions, 252 deletions
diff --git a/documentation/coding_standards/javascript_coding_standards.txt b/documentation/coding_standards/javascript_coding_standards.txt
index 7d3b842ec..9939e80ab 100644
--- a/documentation/coding_standards/javascript_coding_standards.txt
+++ b/documentation/coding_standards/javascript_coding_standards.txt
@@ -1,2 +1,13 @@
*** JAVASCRIPT CODING STANDARDS ***
+* Same formatting standards as PHP.
+
+* All functions should be in the elgg namespace.
+
+* Function expressions should end with a semi-colon:
+
+ elgg.ui.toggles = function(event) {
+ event.preventDefault();
+ $(target).slideToggle('medium');
+ };
+
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index 75ac008f6..51440687d 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -526,6 +526,7 @@ class ElggUser extends ElggEntity
'name',
'username',
'language',
+ 'admin',
));
}
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 002413baa..97f744fb9 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -792,7 +792,7 @@ function get_members_of_access_collection($collection, $idonly = FALSE) {
* access_id => int The access ID of the entity.
*
* @see elgg_get_entities()
- * @return mixed if count, int. if not count, array. false on errors.
+ * @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
function elgg_get_entities_from_access_id(array $options = array()) {
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 66c6454c3..e40ab2e39 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -320,7 +320,7 @@ function elgg_list_annotations($options) {
*
* annotation_ids => NULL|ARR Annotation IDs
*
- * @return mixed if count, int. if not count, array or false if no entities. false also on errors.
+ * @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
function elgg_get_entities_from_annotations(array $options = array()) {
@@ -397,7 +397,7 @@ function elgg_list_entities_from_annotations($options = array()) {
* 'metadata_names' => The name of metadata on the entity.
* 'metadata_values' => The value of metadata on the entitiy.
*
- * @return mixed
+ * @return mixed If count, int. If not count, array. false on errors.
*/
function elgg_get_entities_from_annotation_calculation($options) {
$db_prefix = elgg_get_config('dbprefix');
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index fcd4544bf..8b3431c8a 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -774,7 +774,7 @@ function elgg_entity_exists($guid) {
*
* callback => string A callback function to pass each row through
*
- * @return mixed if count, int. if not count, array or false if no entities. false also on errors.
+ * @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
* @see elgg_get_entities_from_metadata()
* @see elgg_get_entities_from_relationship()
diff --git a/engine/lib/location.php b/engine/lib/location.php
index 7e2c38fc8..5b889509b 100644
--- a/engine/lib/location.php
+++ b/engine/lib/location.php
@@ -74,7 +74,7 @@ function elgg_geocode_location($location) {
*
* @see ElggEntity::setLatLong()
*
- * @return array
+ * @return mixed If count, int. If not count, array. false on errors.
* @since 1.8.0
*/
function elgg_get_entities_from_location(array $options = array()) {
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 0220e6c1f..050e69526 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -398,7 +398,7 @@ function elgg_enable_metadata(array $options) {
*
* metadata_owner_guids => NULL|ARR guids for metadata owners
*
- * @return mixed if count, int. if not count, array or false if no entities. false also on errors.
+ * @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
function elgg_get_entities_from_metadata(array $options = array()) {
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 86070a2aa..be871d025 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -324,7 +324,7 @@ function elgg_load_plugins() {
$plugin->deactivate();
$msg = elgg_echo('PluginException:CannotStart',
array($plugin->getID(), $plugin->guid, $e->getMessage()));
- register_error($msg);
+ elgg_add_admin_notice('cannot_start' . $plugin->getID(), $msg);
$return = false;
continue;
@@ -1007,7 +1007,7 @@ function elgg_unset_all_plugin_settings($plugin_id = null) {
* plugin_user_setting_name_value_pairs_operator => NULL|STR The operator to use for combining
* (name = value) OPERATOR (name = value); default AND
*
- * @return mixed int if count is true, an array of entity objects, or false on failure
+ * @return mixed int If count, int. If not count, array. false on errors.
*/
function elgg_get_entities_from_plugin_user_settings(array $options = array()) {
// if they're passing it don't bother
diff --git a/engine/lib/private_settings.php b/engine/lib/private_settings.php
index 95b1afa57..386af5279 100644
--- a/engine/lib/private_settings.php
+++ b/engine/lib/private_settings.php
@@ -38,7 +38,7 @@
* their own settings.
*
*
- * @return mixed int if count is true, an array of entity objects, or false on failure
+ * @return mixed int If count, int. If not count, array. false on errors.
* @since 1.8.0
*/
function elgg_get_entities_from_private_settings(array $options = array()) {
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 1a5833732..929d3841d 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -250,7 +250,7 @@ function get_entity_relationships($guid, $inverse_relationship = FALSE) {
*
* inverse_relationship => BOOL Inverse the relationship
*
- * @return mixed if count, int. if not count, array or false if no entities. false also on errors.
+ * @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
function elgg_get_entities_from_relationship($options) {
@@ -372,7 +372,7 @@ function elgg_list_entities_from_relationship(array $options = array()) {
*
* @param array $options An options array compatible with
* elgg_get_entities_from_relationship()
- * @return mixed int if count is true, an array of entity objects, or false on failure
+ * @return mixed int If count, int. If not count, array. false on errors.
* @since 1.8.0
*/
function elgg_get_entities_from_relationship_count(array $options = array()) {
diff --git a/engine/start.php b/engine/start.php
index fc3aa004e..00bdc3197 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -60,7 +60,8 @@ $lib_dir = dirname(__FILE__) . '/lib/';
*/
$required_files = array(
'elgglib.php', 'views.php', 'access.php', 'system_log.php', 'export.php',
- 'sessions.php', 'languages.php', 'input.php', 'cache.php', 'output.php'
+ 'sessions.php', 'languages.php', 'pageowner.php', 'input.php', 'cache.php',
+ 'output.php'
);
// include bootstraping libs
@@ -96,7 +97,7 @@ $lib_files = array(
'extender.php', 'filestore.php', 'group.php',
'location.php', 'mb_wrapper.php', 'memcache.php', 'metadata.php',
'metastrings.php', 'navigation.php', 'notification.php', 'objects.php',
- 'opendd.php', 'pagehandler.php', 'pageowner.php', 'pam.php', 'plugins.php',
+ 'opendd.php', 'pagehandler.php', 'pam.php', 'plugins.php',
'private_settings.php', 'relationships.php', 'river.php', 'sites.php',
'statistics.php', 'tags.php', 'user_settings.php', 'users.php',
'upgrade.php', 'web_services.php', 'widgets.php', 'xml.php', 'xml-rpc.php',
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index 657f0907f..d556ba744 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -728,8 +728,9 @@ class ElggInstaller {
// bootstrapping with required files in a required order
$required_files = array(
- 'elgglib.php', 'views.php', 'access.php', 'system_log.php', 'export.php', 'configuration.php',
- 'sessions.php', 'languages.php', 'input.php', 'cache.php', 'output.php'
+ 'elgglib.php', 'views.php', 'access.php', 'system_log.php', 'export.php',
+ 'configuration.php', 'sessions.php', 'languages.php', 'pageowner.php',
+ 'input.php', 'cache.php', 'output.php',
);
foreach ($required_files as $file) {
@@ -785,7 +786,7 @@ class ElggInstaller {
'memcache.php', 'metadata.php', 'metastrings.php',
'navigation.php', 'notification.php',
'objects.php', 'opendd.php', 'pagehandler.php',
- 'pageowner.php', 'pam.php', 'plugins.php',
+ 'pam.php', 'plugins.php',
'private_settings.php', 'relationships.php', 'river.php',
'sites.php', 'statistics.php', 'tags.php', 'user_settings.php',
'users.php', 'upgrade.php', 'web_services.php',
diff --git a/js/classes/ElggPriorityList.js b/js/classes/ElggPriorityList.js
index 831342f21..b4cec5044 100644
--- a/js/classes/ElggPriorityList.js
+++ b/js/classes/ElggPriorityList.js
@@ -16,7 +16,10 @@ elgg.ElggPriorityList = function() {
* @return {Void}
*/
elgg.ElggPriorityList.prototype.insert = function(obj, opt_priority) {
- var priority = parseInt(opt_priority || 500, 10);
+ var priority = 500;
+ if (arguments.length == 2 && opt_priority != undefined) {
+ priority = parseInt(opt_priority, 10);
+ }
priority = Math.max(priority, 0);
@@ -31,7 +34,7 @@ elgg.ElggPriorityList.prototype.insert = function(obj, opt_priority) {
/**
* Iterates through each element in order.
*
-* Unlike every, this ignores the return value of the callback.
+ * Unlike every, this ignores the return value of the callback.
*
* @param {Function} callback The callback function to pass each element through. See
* Array.prototype.every() for details.
diff --git a/js/classes/ElggUser.js b/js/classes/ElggUser.js
index 8a7a8b7eb..b8a976fba 100644
--- a/js/classes/ElggUser.js
+++ b/js/classes/ElggUser.js
@@ -6,9 +6,23 @@
* @class Represents an ElggUser
* @property {string} name
* @property {string} username
+ * @property {string} language
+ * @property {boolean} admin
*/
elgg.ElggUser = function(o) {
elgg.ElggEntity.call(this, o);
};
-elgg.inherit(elgg.ElggUser, elgg.ElggEntity); \ No newline at end of file
+elgg.inherit(elgg.ElggUser, elgg.ElggEntity);
+
+/**
+ * Is this user an admin?
+ *
+ * @warning The admin state of the user should be checked on the server for any
+ * actions taken that require admin privileges.
+ *
+ * @return {boolean}
+ */
+elgg.ElggUser.prototype.isAdmin = function() {
+ return this.admin;
+}; \ No newline at end of file
diff --git a/js/lib/avatar_cropper.js b/js/lib/avatar_cropper.js
index df6ba7866..fc32a0832 100644
--- a/js/lib/avatar_cropper.js
+++ b/js/lib/avatar_cropper.js
@@ -32,7 +32,7 @@ elgg.avatarCropper.init = function() {
var selection = ias.getSelection();
elgg.avatarCropper.preview($('#user-avatar-cropper'), selection);
}
-}
+};
/**
* Handler for changing select area.
@@ -57,7 +57,7 @@ elgg.avatarCropper.preview = function(img, selection) {
marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px',
marginTop: '-' + Math.round(scaleY * selection.y1) + 'px'
});
-}
+};
/**
* Handler for updating the form inputs after select ends
@@ -71,6 +71,6 @@ elgg.avatarCropper.selectChange = function(img, selection) {
$('input[name=x2]').val(selection.x2);
$('input[name=y1]').val(selection.y1);
$('input[name=y2]').val(selection.y2);
-}
+};
elgg.register_hook_handler('init', 'system', elgg.avatarCropper.init); \ No newline at end of file
diff --git a/js/lib/configuration.js b/js/lib/configuration.js
index f724a2f01..6e221c957 100644
--- a/js/lib/configuration.js
+++ b/js/lib/configuration.js
@@ -7,4 +7,4 @@ elgg.provide('elgg.config');
*/
elgg.get_site_url = function() {
return elgg.config.wwwroot;
-} \ No newline at end of file
+}; \ No newline at end of file
diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js
index 628adccfc..85251c1e8 100644
--- a/js/lib/elgglib.js
+++ b/js/lib/elgglib.js
@@ -467,7 +467,7 @@ elgg.parse_url = function(url, component, expand) {
}
}
return results;
-}
+};
/**
* Returns an object with key/values of the parsed query string.
@@ -535,12 +535,12 @@ elgg.push_to_object_array = function(object, parent, value) {
object[parent] = []
}
- if (object[parent].indexOf(value) < 0) {
+ if ($.inArray(value, object[parent]) < 0) {
return object[parent].push(value);
}
return false;
-}
+};
/**
* Tests if object[parent] contains child
@@ -553,8 +553,8 @@ elgg.is_in_object_array = function(object, parent, value) {
elgg.assertTypeOf('object', object);
elgg.assertTypeOf('string', parent);
- return typeof(object[parent]) != 'undefined' && object[parent].indexOf(value) >= 0;
-}
+ return typeof(object[parent]) != 'undefined' && $.inArray(value, object[parent]) >= 0;
+};
/**
* Triggers the init hook when the library is ready
@@ -569,4 +569,4 @@ elgg.initWhenReady = function() {
elgg.trigger_hook('init', 'system');
elgg.trigger_hook('ready', 'system');
}
-} \ No newline at end of file
+}; \ No newline at end of file
diff --git a/js/lib/hooks.js b/js/lib/hooks.js
index edfd28f24..5e1808e22 100644
--- a/js/lib/hooks.js
+++ b/js/lib/hooks.js
@@ -115,7 +115,7 @@ elgg.trigger_hook = function(name, type, params, value) {
return true;
});
- return (tempReturnValue !== null) ? tempReturnValue : returnValue;
+ return (tempReturnValue != null) ? tempReturnValue : returnValue;
};
/**
@@ -136,7 +136,7 @@ elgg.register_instant_hook = function(name, type) {
elgg.assertTypeOf('string', type);
return elgg.push_to_object_array(elgg.config.instant_hooks, name, type);
-}
+};
/**
* Is this hook registered as an instant hook?
@@ -146,7 +146,7 @@ elgg.register_instant_hook = function(name, type) {
*/
elgg.is_instant_hook = function(name, type) {
return elgg.is_in_object_array(elgg.config.instant_hooks, name, type);
-}
+};
/**
* Records that a hook has been triggered.
@@ -156,7 +156,7 @@ elgg.is_instant_hook = function(name, type) {
*/
elgg.set_triggered_hook = function(name, type) {
return elgg.push_to_object_array(elgg.config.triggered_hooks, name, type);
-}
+};
/**
* Has this hook been triggered yet?
@@ -166,7 +166,7 @@ elgg.set_triggered_hook = function(name, type) {
*/
elgg.is_triggered_hook = function(name, type) {
return elgg.is_in_object_array(elgg.config.triggered_hooks, name, type);
-}
+};
elgg.register_instant_hook('init', 'system');
elgg.register_instant_hook('ready', 'system');
diff --git a/js/lib/ui.js b/js/lib/ui.js
index 6cc1bc78a..c26cbe389 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -14,18 +14,14 @@ elgg.ui.init = function () {
$('[rel=toggle]').live('click', elgg.ui.toggles);
- $('[rel=popup]').live('click', elgg.ui.popsUp);
+ $('[rel=popup]').live('click', elgg.ui.popupOpen);
$('.elgg-menu-page .elgg-menu-parent').live('click', elgg.ui.toggleMenu);
$('.elgg-requires-confirmation').live('click', elgg.ui.requiresConfirmation);
$('.elgg-autofocus').focus();
-
- if ($('.elgg-input-date').length) {
- elgg.ui.initDatePicker();
- }
-}
+};
/**
* Toggles an element based on clicking a separate element
@@ -43,7 +39,7 @@ elgg.ui.toggles = function(event) {
var target = $(this).toggleClass('elgg-state-active').attr('href');
$(target).slideToggle('medium');
-}
+};
/**
* Pops up an element based on clicking a separate element
@@ -63,7 +59,7 @@ elgg.ui.toggles = function(event) {
* @param {Object} event
* @return void
*/
-elgg.ui.popsUp = function(event) {
+elgg.ui.popupOpen = function(event) {
event.preventDefault();
event.stopPropagation();
@@ -105,7 +101,7 @@ elgg.ui.popsUp = function(event) {
$('body')
.die('click', elgg.ui.popupClose)
.live('click', elgg.ui.popupClose);
-}
+};
/**
* Catches clicks that aren't in a popup and closes all popups.
@@ -143,7 +139,7 @@ elgg.ui.popupClose = function(event) {
$('body').die('click', elgg.ui.popClose);
}
-}
+};
/**
* Toggles a child menu when the parent is clicked
@@ -155,7 +151,7 @@ elgg.ui.toggleMenu = function(event) {
$(this).siblings().slideToggle('medium');
$(this).toggleClass('elgg-menu-closed elgg-menu-opened');
event.preventDefault();
-}
+};
/**
* Initialize the hover menu
@@ -183,7 +179,7 @@ elgg.ui.initHoverMenu = function(parent) {
var $hovermenu = $(this).data('hovermenu') || null;
if (!$hovermenu) {
- var $hovermenu = $(this).parent().find(".elgg-menu-hover");
+ $hovermenu = $(this).parent().find(".elgg-menu-hover");
$(this).data('hovermenu', $hovermenu);
}
@@ -215,7 +211,7 @@ elgg.ui.initHoverMenu = function(parent) {
$(".elgg-menu-hover").fadeOut();
}
});
-}
+};
/**
* Calls a confirm() and prevents default if denied.
@@ -240,7 +236,7 @@ elgg.ui.requiresConfirmation = function(e) {
*
* @return {Object}
*/
-elgg.ui.LoginHandler = function(hook, type, params, options) {
+elgg.ui.loginHandler = function(hook, type, params, options) {
if (params.target.attr('id') == 'login-dropdown-box') {
options.my = 'right top';
options.at = 'right bottom';
@@ -261,22 +257,25 @@ elgg.ui.LoginHandler = function(hook, type, params, options) {
* @return void
*/
elgg.ui.initDatePicker = function() {
- $('.elgg-input-date').datepicker({
- // ISO-8601
- dateFormat: 'yy-mm-dd',
- onSelect: function(dateText) {
- if ($(this).is('.elgg-input-timestamp')) {
- // convert to unix timestamp
- var dateParts = dateText.split("-");
- var timestamp = Date.UTC(dateParts[0], dateParts[1] - 1, dateParts[2]);
- timestamp = timestamp / 1000;
-
- var id = $(this).attr('id');
- $('input[name="' + id + '"]').val(timestamp);
+ if ($('.elgg-input-date').length) {
+ $('.elgg-input-date').datepicker({
+ // ISO-8601
+ dateFormat: 'yy-mm-dd',
+ onSelect: function(dateText) {
+ if ($(this).is('.elgg-input-timestamp')) {
+ // convert to unix timestamp
+ var dateParts = dateText.split("-");
+ var timestamp = Date.UTC(dateParts[0], dateParts[1] - 1, dateParts[2]);
+ timestamp = timestamp / 1000;
+
+ var id = $(this).attr('id');
+ $('input[name="' + id + '"]').val(timestamp);
+ }
}
- }
- });
-}
+ });
+ }
+};
elgg.register_hook_handler('init', 'system', elgg.ui.init);
-elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.LoginHandler); \ No newline at end of file
+elgg.register_hook_handler('init', 'system', elgg.ui.initDatePicker);
+elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.loginHandler); \ No newline at end of file
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js
index fb256672a..6435d2147 100644
--- a/js/lib/ui.widgets.js
+++ b/js/lib/ui.widgets.js
@@ -65,7 +65,7 @@ elgg.ui.widgets.add = function(event) {
}
});
event.preventDefault();
-}
+};
/**
* Persist the widget's new position
@@ -96,7 +96,7 @@ elgg.ui.widgets.move = function(event, ui) {
// @hack fixes jquery-ui/opera bug where draggable elements jump
ui.item.css('top', 0);
ui.item.css('left', 0);
-}
+};
/**
* Removes a widget from the layout
@@ -134,7 +134,7 @@ elgg.ui.widgets.remove = function(event) {
}
});
event.preventDefault();
-}
+};
/**
* Toggle the collapse state of the widget
@@ -146,7 +146,7 @@ elgg.ui.widgets.collapseToggle = function(event) {
$(this).toggleClass('elgg-widget-collapsed');
$(this).parent().parent().find('.elgg-body').slideToggle('medium');
event.preventDefault();
-}
+};
/**
* Save a widget's settings
@@ -178,7 +178,7 @@ elgg.ui.widgets.saveSettings = function(event) {
}
});
event.preventDefault();
-}
+};
/**
* Make all elements have the same min-height
@@ -197,6 +197,6 @@ elgg.ui.widgets.equalHeight = function(selector) {
}
})
$(selector).css('min-height', maxHeight);
-}
+};
elgg.register_hook_handler('init', 'system', elgg.ui.widgets.init);
diff --git a/js/lib/userpicker.js b/js/lib/userpicker.js
index ae2add53f..8287ba91c 100644
--- a/js/lib/userpicker.js
+++ b/js/lib/userpicker.js
@@ -34,7 +34,7 @@ elgg.userpicker.init = function() {
});
$('.elgg-userpicker-remove').live('click', elgg.userpicker.removeUser);
-}
+};
/**
* Adds a user to the select user list
@@ -59,7 +59,7 @@ elgg.userpicker.addUser = function(event, ui) {
$(this).val('');
event.preventDefault();
-}
+};
/**
* Remove a user from the selected user list
@@ -75,7 +75,7 @@ elgg.userpicker.removeUser = function(event) {
item.remove();
event.preventDefault();
-}
+};
/**
* Render the list item for insertion into the selected user list
@@ -96,7 +96,7 @@ elgg.userpicker.viewUser = function(info) {
html += "</div";
return html;
-}
+};
/**
* Get the parameters to use for autocomplete
@@ -112,6 +112,6 @@ elgg.userpicker.getSearchParams = function(obj) {
} else {
return {'match_on[]': 'users', 'term' : obj.term};
}
-}
+};
elgg.register_hook_handler('init', 'system', elgg.userpicker.init); \ No newline at end of file
diff --git a/js/tests/ElggLanguagesTest.js b/js/tests/ElggLanguagesTest.js
index 1f66fc35b..9186ff5bb 100644
--- a/js/tests/ElggLanguagesTest.js
+++ b/js/tests/ElggLanguagesTest.js
@@ -6,7 +6,7 @@ ElggLanguagesTest.prototype.setUp = function() {
//Immediately execute some dummy "returned" javascript instead of sending
//an actual ajax request
$.ajax = function(settings) {
- var lang = settings.data.js.split('/')[1];
+ var lang = settings.data.language;
elgg.config.translations[lang] = {'language':lang};
};
};
diff --git a/js/tests/ElggPriorityListTest.js b/js/tests/ElggPriorityListTest.js
index 2549e0ee0..2329a8490 100644
--- a/js/tests/ElggPriorityListTest.js
+++ b/js/tests/ElggPriorityListTest.js
@@ -15,7 +15,7 @@ ElggPriorityListTest.prototype.testInsert = function() {
this.list.insert('bar', 501);
- assertEquals('foo', this.list.priorities_[501][0]);
+ assertEquals('bar', this.list.priorities_[501][0]);
};
ElggPriorityListTest.prototype.testInsertRespectsPriority = function() {
@@ -25,9 +25,9 @@ ElggPriorityListTest.prototype.testInsertRespectsPriority = function() {
this.list.insert(values[i], values[i]);
}
- this.list.forEach(function(elem, idx)) {
+ this.list.forEach(function(elem, idx) {
assertEquals(elem, idx);
- }
+ })
};
ElggPriorityListTest.prototype.testInsertHandlesDuplicatePriorities = function() {
diff --git a/js/tests/ElggSecurityTest.js b/js/tests/ElggSecurityTest.js
index f1111168f..c7309d55f 100644
--- a/js/tests/ElggSecurityTest.js
+++ b/js/tests/ElggSecurityTest.js
@@ -31,10 +31,10 @@ ElggSecurityTest.prototype.testAddTokenAcceptsString = function() {
str = "__elgg_ts=" + this.ts + "&__elgg_token=" + this.token;
input = "";
- assertEquals(str, elgg.security.addToken(input));
+ assertEquals('?' + str, elgg.security.addToken(input));
- input = "data=sofar";
- assertEquals(input+'&'+str, elgg.security.addToken(input));
+ input = "?data=sofar";
+ assertEquals(input + '&' + str, elgg.security.addToken(input));
};
diff --git a/js/tests/jsTestDriver.conf b/js/tests/jsTestDriver.conf
index 1bb06e811..1f9c0a6f7 100644
--- a/js/tests/jsTestDriver.conf
+++ b/js/tests/jsTestDriver.conf
@@ -1,9 +1,10 @@
server: http://localhost:42442
load:
- - vendors/jquery/jquery-1.4.2.min.js
+ - vendors/jquery/jquery-1.6.2.min.js
- vendors/sprintf.js
- js/lib/elgglib.js
+ - js/lib/hooks.js
- js/classes/*.js
- js/lib/*.js
- js/tests/*.js \ No newline at end of file
diff --git a/languages/en.php b/languages/en.php
index 5af005814..6aa292e5a 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -63,7 +63,7 @@ $english = array(
'InvalidClassException:NotValidElggStar' => "GUID:%d is not a valid %s",
'PluginException:MisconfiguredPlugin' => "%s (guid: %s) is a misconfigured plugin. It has been disabled. Please search the Elgg wiki for possible causes (http://docs.elgg.org/wiki/).",
- 'PluginException:CannotStart' => '%s (guid: %s) cannot start. Reason: %s',
+ 'PluginException:CannotStart' => '%s (guid: %s) cannot start and has been deactivated. Reason: %s',
'PluginException:InvalidID' => "%s is an invalid plugin ID.",
'PluginException:InvalidPath' => "%s is an invalid plugin path.",
'PluginException:InvalidManifest' => 'Invalid manifest file for plugin %s',
@@ -79,9 +79,9 @@ $english = array(
'ElggPluginPackage:InvalidPlugin:InvalidProvides' => 'Invalid provides type "%s"',
'ElggPluginPackage:InvalidPlugin:CircularDep' => 'Invalid %s dependency "%s" in plugin %s. Plugins cannot conflict with or require something they provide!',
- 'ElggPlugin:Exception:CannotIncludeFile' => 'Cannot include %s for plugin %s (guid: %s) at %s. Check permissions!',
- 'ElggPlugin:Exception:CannotRegisterViews' => 'Cannot open views dir for plugin %s (guid: %s) at %s. Check permissions!',
- 'ElggPlugin:Exception:CannotRegisterLanguages' => 'Cannot register languages for plugin %s (guid: %s) at %s. Check permissions!',
+ 'ElggPlugin:Exception:CannotIncludeFile' => 'Cannot include %s for plugin %s (guid: %s) at %s.',
+ 'ElggPlugin:Exception:CannotRegisterViews' => 'Cannot open views dir for plugin %s (guid: %s) at %s.',
+ 'ElggPlugin:Exception:CannotRegisterLanguages' => 'Cannot register languages for plugin %s (guid: %s) at %s.',
'ElggPlugin:Exception:NoID' => 'No ID for plugin guid %s!',
'PluginException:ParserError' => 'Error parsing manifest with API version %s in plugin %s.',
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 792f32c42..590547a8c 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -20,7 +20,6 @@ function blog_get_page_content_read($guid = NULL) {
// no header or tabs for viewing an individual blog
$return['filter'] = '';
- $return['header'] = '';
if (!elgg_instanceof($blog, 'object', 'blog')) {
$return['content'] = elgg_echo('blog:error:post_not_found');
diff --git a/mod/blog/views/default/js/blog/save_draft.php b/mod/blog/views/default/js/blog/save_draft.php
index fd76c870c..8a994ffb0 100644
--- a/mod/blog/views/default/js/blog/save_draft.php
+++ b/mod/blog/views/default/js/blog/save_draft.php
@@ -28,7 +28,7 @@ elgg.blog.saveDraftCallback = function(data, textStatus, XHR) {
} else {
$(".blog-save-status-time").html(elgg.echo('error'));
}
-}
+};
elgg.blog.saveDraft = function() {
if (typeof(tinyMCE) != 'undefined') {
@@ -55,7 +55,7 @@ elgg.blog.saveDraft = function() {
});
$.post(draftURL, postData, elgg.blog.saveDraftCallback, 'json');
-}
+};
elgg.blog.init = function() {
// get a copy of the body to compare for auto save
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 05ddf62c7..3525b3d48 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -77,7 +77,6 @@ if ($full) {
$summary = elgg_view('object/elements/summary', $params);
echo elgg_view('object/elements/full', array(
- 'title' => $blog->title,
'summary' => $summary,
'icon' => $owner_icon,
'body' => $body,
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php
index 0478e292f..2c589c207 100644
--- a/mod/bookmarks/languages/en.php
+++ b/mod/bookmarks/languages/en.php
@@ -68,14 +68,14 @@ $english = array(
*/
'bookmarks:save:success' => "Your item was successfully bookmarked.",
- 'bookmarks:delete:success' => "Your bookmarked item was successfully deleted.",
+ 'bookmarks:delete:success' => "Your bookmark was deleted.",
/**
* Error messages
*/
'bookmarks:save:failed' => "Your bookmark could not be saved. Make sure you've entered a title and address and then try again.",
- 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could nto be saved.",
+ 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could not be saved.",
'bookmarks:delete:failed' => "Your bookmark could not be deleted. Please try again.",
);
diff --git a/mod/bookmarks/pages/bookmarks/all.php b/mod/bookmarks/pages/bookmarks/all.php
index d9ac2767f..f57776752 100644
--- a/mod/bookmarks/pages/bookmarks/all.php
+++ b/mod/bookmarks/pages/bookmarks/all.php
@@ -20,6 +20,10 @@ $content = elgg_list_entities(array(
'view_toggle_type' => false
));
+if (!$content) {
+ $content = elgg_echo('bookmarks:none');
+}
+
$title = elgg_echo('bookmarks:everyone');
$body = elgg_view_layout('content', array(
diff --git a/mod/bookmarks/pages/bookmarks/friends.php b/mod/bookmarks/pages/bookmarks/friends.php
index be164fcec..15b1da098 100644
--- a/mod/bookmarks/pages/bookmarks/friends.php
+++ b/mod/bookmarks/pages/bookmarks/friends.php
@@ -5,19 +5,19 @@
* @package ElggBookmarks
*/
-$owner = elgg_get_page_owner_entity();
+$page_owner = elgg_get_page_owner_entity();
if (!$page_owner) {
forward('bookmarks/all');
}
-elgg_push_breadcrumb($owner->name, "bookmarks/owner/$owner->username");
+elgg_push_breadcrumb($page_owner->name, "bookmarks/owner/$page_owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
elgg_register_title_button();
$title = elgg_echo('bookmarks:friends');
-$content = list_user_friends_objects($owner->guid, 'bookmarks', 10, false);
+$content = list_user_friends_objects($page_owner->guid, 'bookmarks', 10, false);
if (!$content) {
$content = elgg_echo('bookmarks:none');
}
@@ -30,4 +30,4 @@ $params = array(
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body); \ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/pages/bookmarks/view.php b/mod/bookmarks/pages/bookmarks/view.php
index 8e097b090..2439d2ee8 100644
--- a/mod/bookmarks/pages/bookmarks/view.php
+++ b/mod/bookmarks/pages/bookmarks/view.php
@@ -28,7 +28,6 @@ $body = elgg_view_layout('content', array(
'content' => $content,
'title' => $title,
'filter' => '',
- 'header' => '',
));
echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/bookmarks/js.php b/mod/bookmarks/views/default/bookmarks/js.php
index 0e55c510a..c36823c09 100644
--- a/mod/bookmarks/views/default/bookmarks/js.php
+++ b/mod/bookmarks/views/default/bookmarks/js.php
@@ -7,6 +7,6 @@ elgg.bookmarks.init = function() {
var e = $('a.elgg-bookmark-page');
var link = e.attr('href') + '&title=' + encodeURIComponent(title);
e.attr('href', link);
-}
+};
elgg.register_hook_handler('init', 'system', elgg.bookmarks.init);
diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php
index ba8029a54..89a0d03e0 100644
--- a/mod/bookmarks/views/default/object/bookmarks.php
+++ b/mod/bookmarks/views/default/object/bookmarks.php
@@ -79,7 +79,6 @@ HTML;
echo elgg_view('object/elements/full', array(
'entity' => $bookmark,
- 'title' => $bookmark->title,
'icon' => $owner_icon,
'summary' => $summary,
'body' => $body,
diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php
index 8e88485f1..1abda4710 100644
--- a/mod/bookmarks/views/rss/object/bookmarks.php
+++ b/mod/bookmarks/views/rss/object/bookmarks.php
@@ -1,23 +1,37 @@
<?php
/**
- * Elgg bookmark rss view
- *
+ * Bookmark RSS object view
+ *
* @package ElggBookmarks
*/
$title = $vars['entity']->title;
if (empty($title)) {
- $title = substr($vars['entity']->description,0,32);
- if (strlen($vars['entity']->description) > 32)
- $title .= " ...";
+ $title = strip_tags($vars['entity']->description);
+ $title = elgg_get_excerpt($title, 32);
}
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+$url_text = elgg_echo('bookmarks:address');
+$link = elgg_view('output/url', array('href' => $vars['entity']->address));
+$description = $vars['entity']->description . "<p>$url_text: $link</p>";
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item');
+
+$item = <<<__HTML
<item>
- <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
- <pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
- <link><?php echo $vars['entity']->address; ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/developers/views/default/admin/developers/settings.php b/mod/developers/views/default/admin/developers/settings.php
index 287f4d99e..dcc0a3e4f 100644
--- a/mod/developers/views/default/admin/developers/settings.php
+++ b/mod/developers/views/default/admin/developers/settings.php
@@ -58,6 +58,6 @@ $data = array(
),
);
-$form_vars = array('id' => 'developer-settings-form');
+$form_vars = array('id' => 'developer-settings-form', 'class' => 'elgg-form-settings');
$body_vars = array('data' => $data);
echo elgg_view_form('developers/settings', $form_vars, $body_vars);
diff --git a/mod/developers/views/default/js/developers/developers.php b/mod/developers/views/default/js/developers/developers.php
index 09e6ddd12..6e82295aa 100644
--- a/mod/developers/views/default/js/developers/developers.php
+++ b/mod/developers/views/default/js/developers/developers.php
@@ -8,7 +8,7 @@ elgg.provide('elgg.dev');
elgg.dev.init = function() {
$('.developers-form-inspect').live('submit', elgg.dev.inspectSubmit);
-}
+};
/**
* Submit the inspect form through Ajax
@@ -39,6 +39,6 @@ elgg.dev.inspectSubmit = function(event) {
});
event.preventDefault();
-}
+};
elgg.register_hook_handler('init', 'system', elgg.dev.init); \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/forms.php b/mod/developers/views/default/theme_preview/forms.php
index 6b59ef6d7..ffb77f3a9 100644
--- a/mod/developers/views/default/theme_preview/forms.php
+++ b/mod/developers/views/default/theme_preview/forms.php
@@ -20,11 +20,11 @@
?>
</div>
<div>
- <label for="f3">Radio input (.elgg-input-radio):</label><br />
+ <label for="f3">Radio input (.elgg-input-radios):</label><br />
<?php echo elgg_view('input/radio', array(
'name' => 'f3',
'id' => 'f3',
- 'options' => array('a' => 1, 'b' => 2),
+ 'options' => array('a (.elgg-input-radio)' => 1, 'b (.elgg-input-radio)' => 2),
));
?>
</div>
diff --git a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
index 02151174c..89e235279 100644
--- a/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
+++ b/mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
@@ -34,5 +34,5 @@ if (elgg_get_config('debug')) {
}
// display admin body
-echo elgg_view_module('inline', $diagnostics_title, $diagnostics);
-echo elgg_view_module('inline', $unit_tests_title, $unit_tests);
+echo elgg_view_module('inline', $diagnostics_title, $diagnostics, array('class' => 'elgg-form-settings'));
+echo elgg_view_module('inline', $unit_tests_title, $unit_tests, array('class' => 'elgg-form-settings'));
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index 3126e12f7..8e543ac37 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -19,7 +19,7 @@ elgg.embed.init = function() {
$('.embed-section').live('click', elgg.embed.forward);
$('.elgg-form-embed').live('submit', elgg.embed.submit);
-}
+};
/**
* Inserts data attached to an embed list item in textarea
@@ -48,7 +48,7 @@ elgg.embed.insert = function(event) {
$.fancybox.close();
event.preventDefault();
-}
+};
/**
* Submit an upload form through Ajax
@@ -85,7 +85,7 @@ elgg.embed.submit = function(event) {
// this was bubbling up the DOM causing a submission
event.preventDefault();
event.stopPropagation();
-}
+};
/**
* Loads content within the lightbox
@@ -96,6 +96,6 @@ elgg.embed.submit = function(event) {
elgg.embed.forward = function(event) {
$('.embed-wrapper').parent().load($(this).attr('href'));
event.preventDefault();
-}
+};
elgg.register_hook_handler('init', 'system', elgg.embed.init);
diff --git a/mod/externalpages/views/default/admin/appearance/expages.php b/mod/externalpages/views/default/admin/appearance/expages.php
index b30765089..6a5a521a5 100644
--- a/mod/externalpages/views/default/admin/appearance/expages.php
+++ b/mod/externalpages/views/default/admin/appearance/expages.php
@@ -7,4 +7,4 @@ $type = get_input('type', 'about');
echo elgg_view('expages/menu', array('type' => $type));
-echo elgg_view_form('expages/edit', array(), array('type' => $type));
+echo elgg_view_form('expages/edit', array('class' => 'elgg-form-settings'), array('type' => $type));
diff --git a/mod/externalpages/views/default/expages/menu.php b/mod/externalpages/views/default/expages/menu.php
index 846db076f..6ed521629 100644
--- a/mod/externalpages/views/default/expages/menu.php
+++ b/mod/externalpages/views/default/expages/menu.php
@@ -20,33 +20,4 @@ foreach ($pages as $page) {
);
}
-echo elgg_view('navigation/tabs', array('tabs' => $tabs));
-
-return true;
-
-/**
- * Tab navigation
- *
- * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal
- * @uses string $vars['class'] Additional class to add to ul
- * @uses array $vars['tabs'] A multi-dimensional array of tab entries in the format array(
- * 'title' => string, // Title of link
- * 'url' => string, // URL for the link
- * 'class' => string // Class of the li element
- * 'id' => string, // ID of the li element
- * 'selected' => bool // if this li element is currently selected
- * 'url_class' => string, // Class to pass to the link
- * 'url_id' => string, // ID to pass to the link
- * )
- */
-
-?>
-
-<div id="elgg_horizontal_tabbed_nav">
-<ul>
- <li <?php if($type == 'front') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>front"><?php echo elgg_echo('expages:frontpage'); ?></a></li>
- <li <?php if($type == 'about') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>about"><?php echo elgg_echo('expages:about'); ?></a></li>
- <li <?php if($type == 'terms') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>terms"><?php echo elgg_echo('expages:terms'); ?></a></li>
- <li <?php if($type == 'privacy') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>privacy"><?php echo elgg_echo('expages:privacy'); ?></a></li>
-</ul>
-</div> \ No newline at end of file
+echo elgg_view('navigation/tabs', array('tabs' => $tabs, 'class' => 'elgg-form-settings'));
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index 96fbd1c48..c4d5a4f88 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -95,7 +95,7 @@ $english = array(
* Error messages
*/
- 'file:none' => "No files uploaded.",
+ 'file:none' => "No files.",
'file:uploadfailed' => "Sorry; we could not save your file.",
'file:downloadfailed' => "Sorry; this file is not available at this time.",
'file:deletefailed' => "Your file could not be deleted at this time.",
diff --git a/mod/file/pages/file/world.php b/mod/file/pages/file/world.php
index e438ca2f0..770dfd6e8 100644
--- a/mod/file/pages/file/world.php
+++ b/mod/file/pages/file/world.php
@@ -19,6 +19,9 @@ $content = elgg_list_entities(array(
'limit' => $limit,
'full_view' => FALSE
));
+if (!$content) {
+ $content = elgg_echo('file:none');
+}
$sidebar = file_get_type_cloud();
$sidebar = elgg_view('file/sidebar');
diff --git a/mod/file/start.php b/mod/file/start.php
index 843ae0794..9007fc9ba 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -22,6 +22,9 @@ function file_init() {
// Extend CSS
elgg_extend_view('css/elgg', 'file/css');
+ // add enclosure to rss item
+ elgg_extend_view('extensions/item', 'file/enclosure');
+
// extend group main page
elgg_extend_view('groups/tool_latest', 'file/group_module');
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 81421133f..1db9863c9 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -69,7 +69,6 @@ if ($full && !elgg_in_context('gallery')) {
$params = array(
'entity' => $file,
- 'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
'tags' => $tags,
diff --git a/mod/file/views/rss/file/enclosure.php b/mod/file/views/rss/file/enclosure.php
new file mode 100644
index 000000000..600d287ef
--- /dev/null
+++ b/mod/file/views/rss/file/enclosure.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Link to download the file
+ *
+ * @uses $vars['entity']
+ */
+
+if (elgg_instanceof($vars['entity'], 'object', 'file')) {
+ $download_url = elgg_get_site_url() . 'mod/file/download.php?file_guid=' . $vars['entity']->getGUID();
+ $size = $vars['entity']->size();
+ $mime_type = $vars['entity']->getMimeType();
+ echo <<<END
+
+ <enclosure url="$download_url" length="$size" type="$mime_type" />";
+END;
+}
diff --git a/mod/file/views/rss/object/file.php b/mod/file/views/rss/object/file.php
deleted file mode 100644
index a0660d6c8..000000000
--- a/mod/file/views/rss/object/file.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Elgg RSS file object view
- *
- * @package ElggFile
- * @subpackage Core
- */
-$title = $vars['entity']->title;
-if (empty($title)) {
- $title = elgg_get_excerpt($vars['entity']->description, 32);
-}
-?>
-
-<item>
- <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
- <pubDate><?php echo date("r", $vars['entity']->time_created) ?></pubDate>
- <link><?php echo $vars['entity']->getURL(); ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
- <enclosure url="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" length="<?php echo $vars['entity']->size(); ?>" type="<?php echo $vars['entity']->getMimeType(); ?>" />
-</item>
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 9f8bed9a4..0818e5602 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -69,9 +69,9 @@ $english = array(
'groups:notfound' => "Group not found",
'groups:notfound:details' => "The requested group either does not exist or you do not have access to it",
- 'groups:requests:none' => 'There are no outstanding membership requests at this time.',
+ 'groups:requests:none' => 'There are no current membership requests.',
- 'groups:invitations:none' => 'There are no outstanding invitations at this time.',
+ 'groups:invitations:none' => 'There are no current invitations.',
'item:object:groupforumtopic' => "Discussion topics",
@@ -113,6 +113,7 @@ $english = array(
'discussion:add' => 'Add discussion topic',
'discussion:latest' => 'Latest discussion',
'discussion:group' => 'Group discussion',
+ 'discussion:none' => 'No discussion',
'discussion:topic:created' => 'The discussion topic was created.',
'discussion:topic:updated' => 'The discussion topic was updated.',
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index e129e0f9d..68e5e4884 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -60,6 +60,9 @@ function discussion_handle_list_page($guid) {
'full_view' => false,
);
$content = elgg_list_entities($options);
+ if (!$content) {
+ $content = elgg_echo('discussion:none');
+ }
$params = array(
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 44143d440..590ba2b35 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -24,6 +24,9 @@ function groups_handle_all_page() {
'inverse_relationship' => false,
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
break;
case 'discussion':
$content = elgg_list_entities(array(
@@ -33,6 +36,9 @@ function groups_handle_all_page() {
'limit' => 40,
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('discussion:none');
+ }
break;
case 'newest':
default:
@@ -40,6 +46,9 @@ function groups_handle_all_page() {
'type' => 'group',
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
break;
}
@@ -107,6 +116,9 @@ function groups_handle_owned_page() {
'owner_guid' => elgg_get_page_owner_guid(),
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
$params = array(
'content' => $content,
@@ -137,6 +149,9 @@ function groups_handle_mine_page() {
'inverse_relationship' => false,
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
$params = array(
'content' => $content,
diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php
index 3c9961f82..e0bcd55d6 100644
--- a/mod/groups/views/default/discussion/group_module.php
+++ b/mod/groups/views/default/discussion/group_module.php
@@ -31,7 +31,7 @@ $content = elgg_list_entities($options);
elgg_pop_context();
if (!$content) {
- $content = '<p>' . elgg_echo('grouptopic:notcreated') . '</p>';
+ $content = '<p>' . elgg_echo('discussion:none') . '</p>';
}
$new_link = elgg_view('output/url', array(
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index f3d5f96d5..a579d89a4 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -64,7 +64,6 @@ if ($full) {
$params = array(
'entity' => $topic,
- 'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
'tags' => $tags,
diff --git a/mod/messageboard/views/default/messageboard/js.php b/mod/messageboard/views/default/messageboard/js.php
index e5495409a..3295c68de 100644
--- a/mod/messageboard/views/default/messageboard/js.php
+++ b/mod/messageboard/views/default/messageboard/js.php
@@ -13,7 +13,7 @@ elgg.messageboard.init = function() {
// double whammy for in case the load order changes.
.unbind('click', elgg.ui.requiresConfirmation)
.removeClass('elgg-requires-confirmation');
-}
+};
elgg.messageboard.submit = function(e) {
var form = $(this).parents('form');
@@ -35,7 +35,7 @@ elgg.messageboard.submit = function(e) {
});
e.preventDefault();
-}
+};
elgg.messageboard.deletePost = function(e) {
var link = $(this);
@@ -50,6 +50,6 @@ elgg.messageboard.deletePost = function(e) {
}
e.preventDefault();
-}
+};
elgg.register_hook_handler('init', 'system', elgg.messageboard.init);
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index 0a1c33458..e78289f28 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -80,7 +80,6 @@ if ($full) {
$params = array(
'entity' => $page,
- 'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
'tags' => $tags,
diff --git a/mod/search/views/rss/search/listing.php b/mod/search/views/rss/search/list.php
index 32082fd31..32082fd31 100644
--- a/mod/search/views/rss/search/listing.php
+++ b/mod/search/views/rss/search/list.php
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php
index 9716fc060..3c83d145f 100644
--- a/mod/thewire/languages/en.php
+++ b/mod/thewire/languages/en.php
@@ -20,6 +20,7 @@ $english = array(
'thewire:noposts' => "No wire posts yet",
'item:object:thewire' => "Wire posts",
'thewire:update' => 'Update',
+ 'thewire:by' => 'Wire post by %s',
'thewire:previous' => "Previous",
'thewire:hide' => "Hide",
diff --git a/mod/thewire/views/default/js/thewire.php b/mod/thewire/views/default/js/thewire.php
index d9bf6d10e..0a6eba134 100644
--- a/mod/thewire/views/default/js/thewire.php
+++ b/mod/thewire/views/default/js/thewire.php
@@ -18,7 +18,7 @@ elgg.thewire.init = function() {
});
$(".thewire-previous").live('click', elgg.thewire.viewPrevious);
-}
+};
/**
* Update the number of characters left with every keystroke
@@ -42,7 +42,7 @@ elgg.thewire.textCounter = function(textarea, status, limit) {
$("#thewire-submit-button").removeAttr('disabled', 'disabled');
$("#thewire-submit-button").removeClass('elgg-state-disabled');
}
-}
+};
/**
* Display the previous wire post
@@ -81,6 +81,6 @@ elgg.thewire.viewPrevious = function(event) {
}
event.preventDefault();
-}
+};
elgg.register_hook_handler('init', 'system', elgg.thewire.init);
diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php
index 8229f46f1..494c2c8dc 100644
--- a/mod/thewire/views/rss/object/thewire.php
+++ b/mod/thewire/views/rss/object/thewire.php
@@ -2,46 +2,35 @@
/**
* Elgg thewire rss view
*
- * @package Elgg
- * @subpackage Core
+ * @package ElggTheWire
*/
$owner = $vars['entity']->getOwnerEntity();
-if ($owner) {
- $title = elgg_echo('thewire:by', array($owner->name));
-} else {
- $subtitle = strip_tags($vars['entity']->description);
- $title = elgg_get_excerpt($subtitle, 32);
+if (!$owner) {
+ return true;
}
-?>
+$title = elgg_echo('thewire:by', array($owner->name));
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+
+$description = autop($vars['entity']->description);
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item', $vars);
+
+$item = <<<__HTML
<item>
-<guid isPermaLink='false'><?php echo $vars['entity']->getGUID(); ?></guid>
-<pubDate><?php echo date("r", $vars['entity']->time_created) ?></pubDate>
-<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
-<title><![CDATA[<?php echo $title; ?>]]></title>
-<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
-<?php
-$owner = $vars['entity']->getOwnerEntity();
-if ($owner) {
- ?>
- <dc:creator><?php echo $owner->name; ?></dc:creator>
- <?php
-}
-?>
-<?php
-if (
- ($vars['entity'] instanceof Locatable) &&
- ($vars['entity']->getLongitude()) &&
- ($vars['entity']->getLatitude())
-) {
- ?>
- <georss:point>
- <?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?>
- </georss:point>
- <?php
-}
-?>
-<?php echo elgg_view('extensions/item'); ?>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/tinymce/views/default/js/tinymce.php b/mod/tinymce/views/default/js/tinymce.php
index 55e0c7ae1..c6973d878 100644
--- a/mod/tinymce/views/default/js/tinymce.php
+++ b/mod/tinymce/views/default/js/tinymce.php
@@ -18,7 +18,7 @@ elgg.tinymce.toggleEditor = function(event) {
tinyMCE.execCommand('mceRemoveControl', false, id);
$(this).html(elgg.echo('tinymce:add'));
}
-}
+};
/**
* TinyMCE initialization script
@@ -69,6 +69,6 @@ elgg.tinymce.init = function() {
content_css: elgg.config.wwwroot + 'mod/tinymce/css/elgg_tinymce.css'
});
-}
+};
elgg.register_hook_handler('init', 'system', elgg.tinymce.init); \ No newline at end of file
diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
index abd29c0e1..50c98406e 100644
--- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
+++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/js.php
@@ -23,6 +23,6 @@ elgg.uservalidationbyemail.init = function() {
$form.attr('action', $(this).attr('href')).submit();
});
-}
+};
elgg.register_hook_handler('init', 'system', elgg.uservalidationbyemail.init);
diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/appearance/menu_items.php
index 4e35e032f..1d5c95cf9 100644
--- a/views/default/admin/appearance/menu_items.php
+++ b/views/default/admin/appearance/menu_items.php
@@ -7,4 +7,4 @@
*/
-echo elgg_view_form('admin/menu/save');
+echo elgg_view_form('admin/menu/save', array('class' => 'elgg-form-settings'));
diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php
index 8371ce83c..91d14b874 100644
--- a/views/default/admin/appearance/profile_fields.php
+++ b/views/default/admin/appearance/profile_fields.php
@@ -3,7 +3,7 @@
* Admin area: edit default profile fields
*/
-$add = elgg_view_form('profile/fields/add', array(), array());
+$add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array());
$list = elgg_view('admin/appearance/profile_fields/list');
$reset = elgg_view_form('profile/fields/reset', array(), array());
diff --git a/views/default/admin/plugin_settings.php b/views/default/admin/plugin_settings.php
index c75492270..1c6e9e206 100644
--- a/views/default/admin/plugin_settings.php
+++ b/views/default/admin/plugin_settings.php
@@ -19,7 +19,7 @@ $settings = false;
if (elgg_view_exists("settings/$plugin_id/edit") || elgg_view_exists("plugins/$plugin_id/settings")) {
$title = $plugin->getManifest()->getName();
- $params = array('id' => "$plugin_id-settings");
+ $params = array('id' => "$plugin_id-settings", 'class' => 'elgg-form-settings');
$body = elgg_view_form("plugins/settings/save", $params, $vars);
echo elgg_view_module('info', $title, $body);
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php
index 5bd0dd55d..c3e7e3ab0 100644
--- a/views/default/admin/plugins.php
+++ b/views/default/admin/plugins.php
@@ -22,7 +22,8 @@ foreach ($installed_plugins as $id => $plugin) {
if (!$plugin->isValid()) {
if ($plugin->isActive()) {
// force disable and warn
- register_error(elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId())));
+ elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(),
+ elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId())));
$plugin->deactivate();
}
continue;
diff --git a/views/default/admin/settings/advanced.php b/views/default/admin/settings/advanced.php
index 12e4303e7..a262740f2 100644
--- a/views/default/admin/settings/advanced.php
+++ b/views/default/admin/settings/advanced.php
@@ -6,4 +6,4 @@
* @subpackage Core
*/
-echo elgg_view_form('admin/site/update_advanced');
+echo elgg_view_form('admin/site/update_advanced', array('class' => 'elgg-form-settings'));
diff --git a/views/default/admin/settings/basic.php b/views/default/admin/settings/basic.php
index 3b8f4f183..9334ba81b 100644
--- a/views/default/admin/settings/basic.php
+++ b/views/default/admin/settings/basic.php
@@ -6,4 +6,4 @@
* @subpackage Core
*/
-echo elgg_view_form('admin/site/update_basic');
+echo elgg_view_form('admin/site/update_basic', array('class' => 'elgg-form-settings'));
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 73996a199..160a2a3e4 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -512,7 +512,7 @@ a.elgg-button {
}
.elgg-form-settings {
- max-width: 600px;
+ max-width: 800px;
}
/* **************************************
diff --git a/views/default/css/elements/forms.php b/views/default/css/elements/forms.php
index d14c341a7..e358c86e7 100644
--- a/views/default/css/elements/forms.php
+++ b/views/default/css/elements/forms.php
@@ -72,7 +72,7 @@ input[type="radio"] {
width:auto;
}
.elgg-input-checkboxes.elgg-horizontal li,
-.elgg-input-radio.elgg-horizontal li {
+.elgg-input-radios.elgg-horizontal li {
display: inline;
padding-right: 10px;
}
diff --git a/views/default/forms/login.php b/views/default/forms/login.php
index 670731883..9536bb439 100644
--- a/views/default/forms/login.php
+++ b/views/default/forms/login.php
@@ -23,13 +23,13 @@
<?php echo elgg_view('login/extend'); ?>
<div class="elgg-foot">
- <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?>
-
- <label class="right mtm">
+ <label class="mtm float-alt">
<input type="checkbox" name="persistent" value="true" />
<?php echo elgg_echo('user:persistent'); ?>
</label>
+ <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?>
+
<?php
if ($vars['returntoreferer']) {
echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true'));
diff --git a/views/default/object/elements/full.php b/views/default/object/elements/full.php
index 4a2991442..9b89f9706 100644
--- a/views/default/object/elements/full.php
+++ b/views/default/object/elements/full.php
@@ -2,8 +2,7 @@
/**
* Object full rendering
*
- * Sample output
- * <h2>Title</h3>
+ * Sample output:
* <div class="elgg-content">
* <div class="elgg-image-block">
* </div>
@@ -12,14 +11,12 @@
* </div>
*
* @uses $vars['entity'] ElggEntity
- * @uses $vars['title'] Title (false for no title)
* @uses $vars['icon'] HTML for the content icon
* @uses $vars['summary'] HTML for the content summary
* @uses $vars['body'] HTML for the content body
* @uses $vars['class'] Optional additional class for the content wrapper
*/
-$title = elgg_extract('title', $vars);
$icon = elgg_extract('icon', $vars);
$summary = elgg_extract('summary', $vars);
$body = elgg_extract('body', $vars);
@@ -30,14 +27,9 @@ if ($class) {
$class = "elgg-content";
}
-if ($title) {
- $title = elgg_view_title($title);
-}
-
$header = elgg_view_image_block($icon, $summary);
echo <<<HTML
-$title
<div class="$class">
$header
$body
diff --git a/views/default/output/text.php b/views/default/output/text.php
index 2c9242c1d..5cbfc35b0 100644
--- a/views/default/output/text.php
+++ b/views/default/output/text.php
@@ -6,8 +6,7 @@
* @package Elgg
* @subpackage Core
*
- * @uses $vars['text'] The text to display
- *
+ * @uses $vars['value'] The text to display
*/
echo htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false); \ No newline at end of file
diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php
index 9e9107568..de652fc8e 100644
--- a/views/rss/annotation/generic_comment.php
+++ b/views/rss/annotation/generic_comment.php
@@ -16,7 +16,7 @@ $permalink = $annotation->getURL();
$title = elgg_echo('generic_comment:title', array($poster_name));
$creator = elgg_view('page/components/creator', array('entity' => $annotation));
-$extensions = elgg_view('extensions/item');
+$extensions = elgg_view('extensions/item', $vars);
$item = <<<__HTML
<item>
diff --git a/views/rss/group/default.php b/views/rss/group/default.php
index 1276ab8f1..f57c7f82c 100644
--- a/views/rss/group/default.php
+++ b/views/rss/group/default.php
@@ -20,7 +20,7 @@ if ($vars['entity']->description) {
$creator = elgg_view('page/components/creator', $vars);
$georss = elgg_view('page/components/georss', $vars);
-$extension = elgg_view('extensions/item');
+$extension = elgg_view('extensions/item', $vars);
$item = <<<__HTML
<item>
diff --git a/views/rss/object/default.php b/views/rss/object/default.php
index b5d269ac7..be8025953 100644
--- a/views/rss/object/default.php
+++ b/views/rss/object/default.php
@@ -15,9 +15,11 @@ if (empty($title)) {
$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
$pubdate = date('r', $vars['entity']->getTimeCreated());
+$description = autop($vars['entity']->description);
+
$creator = elgg_view('page/components/creator', $vars);
$georss = elgg_view('page/components/georss', $vars);
-$extension = elgg_view('extensions/item');
+$extension = elgg_view('extensions/item', $vars);
$item = <<<__HTML
<item>
@@ -25,7 +27,7 @@ $item = <<<__HTML
<pubDate>$pubdate</pubDate>
<link>$permalink</link>
<title><![CDATA[$title]]></title>
- <description><![CDATA[{$vars['entity']->description}]]></description>
+ <description><![CDATA[$description]]></description>
$creator$georss$extension
</item>
diff --git a/views/rss/user/default.php b/views/rss/user/default.php
index 1500881f8..1c7bf75e7 100644
--- a/views/rss/user/default.php
+++ b/views/rss/user/default.php
@@ -17,7 +17,7 @@ if ($vars['entity']->description) {
}
$georss = elgg_view('page/components/georss', $vars);
-$extension = elgg_view('extensions/item');
+$extension = elgg_view('extensions/item', $vars);
$item = <<<__HTML
<item>