aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/classes/ElggEntity.php4
-rw-r--r--engine/classes/ElggMenuItem.php38
-rw-r--r--engine/lib/admin.php2
-rw-r--r--engine/lib/configuration.php19
-rw-r--r--engine/lib/deprecated-1.8.php7
-rw-r--r--engine/lib/entities.php9
-rw-r--r--engine/lib/navigation.php2
-rw-r--r--engine/lib/relationships.php33
-rw-r--r--engine/lib/statistics.php2
-rw-r--r--engine/lib/upgrade.php104
-rw-r--r--engine/lib/upgrades/2011010101.php5
-rw-r--r--engine/lib/users.php34
-rw-r--r--engine/lib/views.php29
-rw-r--r--js/lib/ui.js26
-rw-r--r--languages/en.php9
-rw-r--r--mod/blog/languages/en.php11
-rw-r--r--mod/blog/lib/blog.php4
-rw-r--r--mod/blog/views/default/blog/group_module.php22
-rw-r--r--mod/blog/views/default/object/blog.php2
-rw-r--r--mod/blog/views/default/river/object/blog/create.php30
-rw-r--r--mod/bookmarks/languages/en.php4
-rw-r--r--mod/bookmarks/pages/bookmarks/all.php3
-rw-r--r--mod/bookmarks/pages/bookmarks/view.php2
-rw-r--r--mod/bookmarks/start.php1
-rw-r--r--mod/bookmarks/views/default/bookmarks/group_module.php21
-rw-r--r--mod/bookmarks/views/default/object/bookmarks.php4
-rw-r--r--mod/bookmarks/views/default/river/object/bookmarks/create.php31
-rw-r--r--mod/custom_index/index.php3
-rw-r--r--mod/dashboard/start.php2
-rw-r--r--mod/dashboard/views/default/dashboard/blurb.php2
-rw-r--r--mod/dashboard/views/default/dashboard/css.php10
-rw-r--r--mod/file/actions/file/upload.php3
-rw-r--r--mod/file/download.php9
-rw-r--r--mod/file/languages/en.php9
-rw-r--r--mod/file/pages/file/friends.php2
-rw-r--r--mod/file/pages/file/owner.php5
-rw-r--r--mod/file/pages/file/view.php10
-rw-r--r--mod/file/views/default/file/group_module.php22
-rw-r--r--mod/file/views/default/file/typecloud.php2
-rw-r--r--mod/file/views/default/forms/file/upload.php4
-rw-r--r--mod/file/views/default/object/file.php10
-rw-r--r--mod/file/views/default/river/object/file/create.php30
-rw-r--r--mod/groups/actions/groups/membership/remove.php31
-rw-r--r--mod/groups/languages/en.php11
-rw-r--r--mod/groups/lib/discussion.php2
-rw-r--r--mod/groups/lib/groups.php2
-rw-r--r--mod/groups/start.php48
-rw-r--r--mod/groups/views/default/discussion/group_module.php22
-rw-r--r--mod/groups/views/default/group/default.php1
-rw-r--r--mod/groups/views/default/groups/css.php11
-rw-r--r--mod/groups/views/default/groups/js.php3
-rw-r--r--mod/groups/views/default/groups/profile/activity_module.php11
-rw-r--r--mod/groups/views/default/groups/profile/module.php25
-rw-r--r--mod/groups/views/default/groups/profile/widgets.php2
-rw-r--r--mod/groups/views/default/groups/sidebar/featured.php2
-rw-r--r--mod/groups/views/default/groups/sidebar/members.php3
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php2
-rw-r--r--mod/groups/views/default/river/annotation/group_topic_post/reply.php25
-rw-r--r--mod/groups/views/default/river/group/create.php20
-rw-r--r--mod/groups/views/default/river/object/groupforumtopic/create.php38
-rw-r--r--mod/groups/views/default/river/relationship/member/create.php14
-rw-r--r--mod/likes/start.php32
-rw-r--r--mod/likes/views/default/likes/button.php (renamed from mod/likes/views/default/likes/display.php)25
-rw-r--r--mod/likes/views/default/likes/count.php31
-rw-r--r--mod/likes/views/default/likes/css.php4
-rw-r--r--mod/likes/views/default/likes/js.php26
-rw-r--r--mod/likes/views/default/river/annotation/likes/create.php22
-rw-r--r--mod/logbrowser/views/default/logbrowser/form.php8
-rw-r--r--mod/logrotate/views/default/settings/logrotate/edit.php2
-rw-r--r--mod/members/pages/members/search.php8
-rw-r--r--mod/messageboard/languages/en.php5
-rw-r--r--mod/messageboard/pages/messageboard/owner.php3
-rw-r--r--mod/messageboard/views/default/forms/messageboard/add.php2
-rw-r--r--mod/messageboard/views/default/river/object/messageboard/create.php21
-rw-r--r--mod/messages/pages/messages/read.php4
-rw-r--r--mod/pages/languages/en.php13
-rw-r--r--mod/pages/pages/pages/view.php2
-rw-r--r--mod/pages/views/default/object/page_top.php2
-rw-r--r--mod/pages/views/default/pages/group_module.php21
-rw-r--r--mod/pages/views/default/river/object/page/create.php30
-rw-r--r--mod/profile/views/default/profile/owner_block.php2
-rw-r--r--mod/reportedcontent/views/default/object/reported_content.php2
-rw-r--r--mod/search/views/default/search/entity.php2
-rw-r--r--mod/search/views/default/search/list.php4
-rw-r--r--mod/thewire/languages/en.php5
-rw-r--r--mod/thewire/start.php12
-rw-r--r--mod/thewire/views/default/js/thewire.php4
-rw-r--r--mod/thewire/views/default/object/thewire.php1
-rw-r--r--mod/thewire/views/default/river/object/thewire/create.php29
-rw-r--r--mod/thewire/views/default/thewire/reply.php7
-rw-r--r--mod/twitter/views/default/twitter/css.php2
-rw-r--r--mod/twitter_api/graphics/sign-in-with-twitter-d.pngbin0 -> 3306 bytes
-rw-r--r--mod/twitter_api/graphics/sign-in-with-twitter-l.pngbin0 -> 3062 bytes
-rw-r--r--mod/twitter_api/languages/en.php2
-rw-r--r--mod/twitter_api/lib/twitter_api.php133
-rw-r--r--mod/twitter_api/start.php61
-rw-r--r--mod/twitter_api/views/default/settings/twitter_api/edit.php13
-rw-r--r--mod/twitter_api/views/default/twitter_api/css.php7
-rw-r--r--mod/twitter_api/views/default/twitter_api/login.php4
-rw-r--r--mod/twitter_api/views/default/usersettings/twitter_api/edit.php4
-rw-r--r--pages/entities/index.php2
-rw-r--r--[-rwxr-xr-x]vendors/markdown/License.text0
-rw-r--r--[-rwxr-xr-x]vendors/markdown/PHP Markdown Extra Readme.text0
-rw-r--r--[-rwxr-xr-x]vendors/markdown/markdown.php0
-rw-r--r--views/default/css/admin.php6
-rw-r--r--views/default/css/elements/components.php12
-rw-r--r--views/default/css/elements/core.php6
-rw-r--r--views/default/css/elements/layout.php3
-rw-r--r--views/default/css/elements/navigation.php31
-rw-r--r--views/default/css/elgg.php7
-rw-r--r--views/default/object/default.php1
-rw-r--r--views/default/object/elements/summary.php8
-rw-r--r--views/default/object/plugin/advanced.php2
-rw-r--r--views/default/object/plugin/invalid.php2
-rw-r--r--views/default/object/widget/elements/controls.php6
-rw-r--r--views/default/page/components/gallery.php31
-rw-r--r--views/default/page/components/list.php6
-rw-r--r--views/default/page/default.php2
-rw-r--r--views/default/page/elements/owner_block.php2
-rw-r--r--views/default/page/layouts/one_column.php15
-rw-r--r--views/default/page/layouts/widgets/add_button.php11
-rw-r--r--views/default/river/annotation/generic_comment/create.php27
-rw-r--r--views/default/river/elements/body.php70
-rw-r--r--views/default/river/elements/responses.php (renamed from views/default/river/elements/footer.php)10
-rw-r--r--views/default/river/elements/summary.php41
-rw-r--r--views/default/river/item.php10
-rw-r--r--views/default/river/relationship/friend/create.php16
-rw-r--r--views/default/river/user/default/profileiconupdate.php18
-rw-r--r--views/default/widgets/friends/content.php16
-rw-r--r--views/json/entities/entity_list.php4
130 files changed, 999 insertions, 775 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index 8fc1e46cb..6edc99dd4 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -851,7 +851,7 @@ abstract class ElggEntity extends ElggData implements
*/
function countComments() {
$params = array('entity' => $this);
- $num = trigger_plugin_hook('comments:count', $this->getType(), $params);
+ $num = elgg_trigger_plugin_hook('comments:count', $this->getType(), $params);
if (is_int($num)) {
return $num;
@@ -1628,7 +1628,7 @@ abstract class ElggEntity extends ElggData implements
*/
elgg_set_viewtype('default');
- $view = elgg_view_entity($this, true);
+ $view = elgg_view_entity($this, array('full_view' => true));
elgg_set_viewtype();
$tmp[] = new ODDMetaData($uuid . "volatile/renderedentity/", $uuid,
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 157ed9ceb..1181583f2 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -132,7 +132,7 @@ class ElggMenuItem {
$item->setItemClass($options['item_class']);
unset($options['item_class']);
}
-
+
foreach ($options as $key => $value) {
$item->$key = $value;
}
@@ -153,9 +153,20 @@ class ElggMenuItem {
public function getName() {
return $this->name;
}
+
+ /**
+ * Set the display text of the menu item
+ *
+ * @param string $text The display text
+ *
+ * @return void
+ */
+ public function setText($text) {
+ $this->text = $text;
+ }
/**
- * Get the display text of the menu
+ * Get the display text of the menu item
*
* @return string
*/
@@ -164,6 +175,15 @@ class ElggMenuItem {
}
/**
+ * Set the URL of the menu item
+ *
+ * @return void
+ */
+ public function setHref($href) {
+ $this->href = $href;
+ }
+
+ /**
* Get the URL of the menu item
*
* @return string
@@ -465,7 +485,7 @@ class ElggMenuItem {
* @params array $vars Options to pass to output/url if a link
*
* @return string
- *
+ *
* @todo View code in a model. How do we feel about that?
*/
public function getContent(array $vars = array()) {
@@ -475,7 +495,7 @@ class ElggMenuItem {
}
$vars['text'] = $this->text;
-
+
if ($this->href) {
$vars['href'] = $this->href;
}
@@ -483,15 +503,19 @@ class ElggMenuItem {
if ($this->linkClass) {
$vars['class'] = $this->getLinkClass();
}
-
+
+ if ($this->link_rel) {
+ $vars['rel'] = $this->link_rel;
+ }
+
if ($this->rel) {
$vars['rel'] = $this->rel;
}
-
+
if ($this->title) {
$vars['title'] = $this->title;
}
-
+
if ($this->is_action) {
$vars['is_action'] = $this->is_action;
}
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 3bfb69102..c16da9295 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -348,7 +348,7 @@ function elgg_admin_add_plugin_settings_menu() {
'parent_name' => 'settings',
'context' => 'admin',
'section' => 'configure',
- ));
+ ));
}
}
}
diff --git a/engine/lib/configuration.php b/engine/lib/configuration.php
index cbc083bd0..b756d2e70 100644
--- a/engine/lib/configuration.php
+++ b/engine/lib/configuration.php
@@ -282,8 +282,8 @@ function datalist_set($name, $value) {
return false;
}
- $name = sanitise_string($name);
- $value = sanitise_string($value);
+ $sanitised_name = sanitise_string($name);
+ $sanitised_value = sanitise_string($value);
// If memcache is available then invalidate the cached copy
static $datalist_memcache;
@@ -295,13 +295,16 @@ function datalist_set($name, $value) {
$datalist_memcache->delete($name);
}
- insert_data("INSERT into {$CONFIG->dbprefix}datalists"
- . " set name = '{$name}', value = '{$value}'"
- . " ON DUPLICATE KEY UPDATE value='{$value}'");
-
- $DATALIST_CACHE[$name] = $value;
+ $success = insert_data("INSERT into {$CONFIG->dbprefix}datalists"
+ . " set name = '{$sanitised_name}', value = '{$sanitised_value}'"
+ . " ON DUPLICATE KEY UPDATE value='{$sanitised_value}'");
- return true;
+ if ($success) {
+ $DATALIST_CACHE[$name] = $value;
+ return true;
+ } else {
+ return false;
+ }
}
/**
diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php
index d92257a09..ff4fa0756 100644
--- a/engine/lib/deprecated-1.8.php
+++ b/engine/lib/deprecated-1.8.php
@@ -20,7 +20,7 @@
* @param string $fromdir Optional directory to load upgrades from. default: engine/schema/upgrades/
* @param bool $quiet If true, suppress all error messages. Only use for the upgrade from <=1.6.
*
- * @return bool
+ * @return int The number of upgrades run.
* @see upgrade.php
* @see version.php
* @deprecated 1.8 Use PHP upgrades for sql changes.
@@ -35,6 +35,8 @@ function db_upgrade($version, $fromdir = "", $quiet = FALSE) {
if (!$fromdir) {
$fromdir = $CONFIG->path . 'engine/schema/upgrades/';
}
+
+ $i = 0;
if ($handle = opendir($fromdir)) {
$sqlupgrades = array();
@@ -65,11 +67,12 @@ function db_upgrade($version, $fromdir = "", $quiet = FALSE) {
} else {
run_sql_script($fromdir . $sqlfile);
}
+ $i++;
}
}
}
- return TRUE;
+ return $i;
}
/**
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index cb197b569..10313fc8c 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1190,10 +1190,10 @@ $time_created_lower = NULL, $time_updated_upper = NULL, $time_updated_lower = NU
* @internal This also provides the views for elgg_view_annotation().
*
* @param array $options Any options from $getter options plus:
- * full_view => BOOL Display full view entities
- * list_type_toggle => BOOL Display gallery / list switch
- * pagination => BOOL Display pagination links
- * gallery => BOOL display in gallery view
+ * full_view => BOOL Display full view entities
+ * list_type => STR 'list' or 'gallery'
+ * list_type_toggle => BOOL Display gallery / list switch
+ * pagination => BOOL Display pagination links
*
* @param mixed $getter The entity getter function to use to fetch the entities
* @param mixed $viewer The function to use to view the entity list.
@@ -1216,7 +1216,6 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
'full_view' => TRUE,
'list_type_toggle' => FALSE,
'pagination' => TRUE,
- 'gallery' => FALSE,
);
$options = array_merge($defaults, $options);
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index b51c63b49..4b2c998a2 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -276,7 +276,7 @@ function elgg_river_menu_setup($hook, $type, $return, $params) {
'href' => "#comments-add-$object->guid",
'text' => elgg_view_icon('speech-bubble'),
'title' => elgg_echo('comment:this'),
- 'link_class' => "elgg-toggler",
+ 'link_rel' => 'toggle',
'priority' => 50,
);
$return[] = ElggMenuItem::factory($options);
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 5224efaf1..9d5fd39b6 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -593,38 +593,31 @@ function export_relationship_plugin_hook($hook, $entity_type, $returnvalue, $par
}
/**
- * An event listener which will notify users based on certain events.
+ * Notify user that someone has friended them
*
- * @param string $event Event name
- * @param string $object_type Object type
- * @param mixed $object Object
+ * @param string $event Event name
+ * @param string $type Object type
+ * @param mixed $object Object
*
* @return bool
*/
-function relationship_notification_hook($event, $object_type, $object) {
- global $CONFIG;
+function relationship_notification_hook($event, $type, $object) {
- if (
- ($object instanceof ElggRelationship) &&
- ($event == 'create') &&
- ($object_type == 'friend')
- ) {
- $user_one = get_entity($object->guid_one);
- $user_two = get_entity($object->guid_two);
+ $user_one = get_entity($object->guid_one);
+ $user_two = get_entity($object->guid_two);
- // Notify target user
- return notify_user($object->guid_two, $object->guid_one,
+ return notify_user($object->guid_two,
+ $object->guid_one,
elgg_echo('friend:newfriend:subject', array($user_one->name)),
elgg_echo("friend:newfriend:body", array($user_one->name, $user_one->getURL()))
- );
- }
+ );
}
-/** Register the import hook */
+// Register the import hook
elgg_register_plugin_hook_handler("import", "all", "import_relationship_plugin_hook", 3);
-/** Register the hook, ensuring entities are serialised first */
+// Register the hook, ensuring entities are serialised first
elgg_register_plugin_hook_handler("export", "all", "export_relationship_plugin_hook", 3);
-/** Register event to listen to some events **/
+// Register event to listen to some events
elgg_register_event_handler('create', 'friend', 'relationship_notification_hook');
diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php
index cd2b7a6a1..1232c6128 100644
--- a/engine/lib/statistics.php
+++ b/engine/lib/statistics.php
@@ -96,7 +96,7 @@ function get_number_users($show_deactivated = false) {
*/
function get_online_users() {
$offset = get_input('offset', 0);
- $count = count(find_active_users(600, 9999));
+ $count = find_active_users(600, 10, $offset, true);
$objects = find_active_users(600, 10, $offset);
if ($objects) {
diff --git a/engine/lib/upgrade.php b/engine/lib/upgrade.php
index 85810956b..dc3911062 100644
--- a/engine/lib/upgrade.php
+++ b/engine/lib/upgrade.php
@@ -20,15 +20,15 @@ function upgrade_code($version, $quiet = FALSE) {
$version = (int) $version;
$upgrade_path = elgg_get_config('path') . 'engine/lib/upgrades/';
- $processed_upgrades = unserialize(datalist_get('processed_upgrades'));
- // the day we started the new upgrade names
- $upgrade_epoch = 2011021700;
+ $processed_upgrades = elgg_get_processed_upgrades();
+ // upgrading from 1.7 to 1.8. Need to bootstrap.
if (!$processed_upgrades) {
- $processed_upgrades = array();
- }
+ elgg_upgrade_bootstrap_17_to_18();
- $upgrades = array();
+ // grab accurate processed upgrades
+ $processed_upgrades = elgg_get_processed_upgrades();
+ }
$upgrade_files = elgg_get_upgrade_files($upgrade_path);
@@ -36,23 +36,7 @@ function upgrade_code($version, $quiet = FALSE) {
return false;
}
- // if before the new upgrade system, run through all upgrades and check
- // version number. After the upgrade epoch, pull run upgrades from db
- if ($version < $upgrade_epoch) {
- foreach ($upgrade_files as $upgrade_file) {
- $upgrade_version = elgg_get_upgrade_file_version($upgrade_file);
-
- if ($version < $upgrade_version) {
- $upgrades[] = $upgrade_file;
- } else {
- // set this upgrade as processed so that we don't run it again
- $processed_upgrades[] = $upgrade_file;
- }
- }
- } else {
- // add any upgrades that haven't been run to the upgrades list
- $upgrades = elgg_get_unprocessed_upgrades($upgrade_files, $processed_upgrades);
- }
+ $upgrades = elgg_get_unprocessed_upgrades($upgrade_files, $processed_upgrades);
// Sort and execute
sort($upgrades);
@@ -67,7 +51,7 @@ function upgrade_code($version, $quiet = FALSE) {
try {
if (!@include("$upgrade_path/$upgrade")) {
$success = false;
- error_log($e->getmessage());
+ error_log("Could not include $upgrade_path/$upgrade");
}
} catch (Exception $e) {
$success = false;
@@ -76,6 +60,7 @@ function upgrade_code($version, $quiet = FALSE) {
} else {
if (!include("$upgrade_path/$upgrade")) {
$success = false;
+ error_log("Could not include $upgrade_path/$upgrade");
}
}
@@ -84,13 +69,12 @@ function upgrade_code($version, $quiet = FALSE) {
$processed_upgrades[] = $upgrade;
// don't set the version to a lower number in instances where an upgrade
- // has been merged from a lower version
+ // has been merged from a lower version of Elgg
if ($upgrade_version > $version) {
datalist_set('version', $upgrade_version);
}
- $processed_upgrades = array_unique($processed_upgrades);
- datalist_set('processed_upgrades', serialize($processed_upgrades));
+ elgg_set_processed_upgrades($processed_upgrades);
} else {
return false;
}
@@ -100,6 +84,29 @@ function upgrade_code($version, $quiet = FALSE) {
}
/**
+ * Saves the processed upgrades to a dataset.
+ *
+ * @param array $processed_upgrades An array of processed upgrade filenames
+ * (not the path, just the file)
+ * @return bool
+ */
+function elgg_set_processed_upgrades(array $processed_upgrades) {
+ $processed_upgrades = array_unique($processed_upgrades);
+ return datalist_set('processed_upgrades', serialize($processed_upgrades));
+}
+
+/**
+ * Gets a list of processes upgrades
+ *
+ * @return mixed Array of processed upgrade filenames or false
+ */
+function elgg_get_processed_upgrades() {
+ $upgrades = datalist_get('processed_upgrades');
+ $unserialized = unserialize($upgrades);
+ return $unserialized;
+}
+
+/**
* Returns the version of the upgrade filename.
*
* @param string $filename The upgrade filename. No full path.
@@ -248,3 +255,46 @@ function version_upgrade() {
return false;
}
+
+/**
+ * Boot straps into 1.8 upgrade system from 1.7
+ *
+ * This runs all the 1.7 upgrades, then sets the processed_upgrades to all existing 1.7 upgrades.
+ * Control is then passed back to the main upgrade function which detects and runs the
+ * 1.8 upgrades, regardless of filename convention.
+ *
+ * @return bool
+ */
+function elgg_upgrade_bootstrap_17_to_18() {
+ $db_version = (int) datalist_get('version');
+
+ // the 1.8 upgrades before the upgrade system change that are interspersed with 1.7 upgrades.
+ $upgrades_18 = array(
+ '2010111501.php',
+ '2010121601.php',
+ '2010121602.php',
+ '2010121701.php',
+ '2010123101.php',
+ '2011010101.php',
+ );
+
+ $upgrades_17 = array();
+ $upgrade_files = elgg_get_upgrade_files();
+ $processed_upgrades = array();
+
+ foreach ($upgrade_files as $upgrade_file) {
+ // ignore if not in 1.7 format or if it's a 1.8 upgrade
+ if (in_array($upgrade_file, $upgrades_18) || !preg_match("/[0-9]{10}\.php/", $upgrade_file)) {
+ continue;
+ }
+
+ $upgrade_version = elgg_get_upgrade_file_version($upgrade_file);
+
+ // this has already been run in a previous 1.7.X -> 1.7.X upgrade
+ if ($upgrade_version < $db_version) {
+ $processed_upgrades[] = $upgrade_file;
+ }
+ }
+
+ return elgg_set_processed_upgrades($processed_upgrades);
+}
diff --git a/engine/lib/upgrades/2011010101.php b/engine/lib/upgrades/2011010101.php
index 9dbaff1e4..b063c249b 100644
--- a/engine/lib/upgrades/2011010101.php
+++ b/engine/lib/upgrades/2011010101.php
@@ -87,7 +87,10 @@ if ($upgrade_version > $version) {
datalist_set('version', $upgrade_version);
}
+// add ourselves to the processed_upgrades.
+$processed_upgrades[] = '2011010101.php';
+
$processed_upgrades = array_unique($processed_upgrades);
-datalist_set('processed_upgrades', serialize($processed_upgrades));
+elgg_set_processed_upgrades($processed_upgrades);
forward('upgrade.php');
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 59bfa1259..e7e1a57f0 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -625,31 +625,37 @@ function get_user_by_email($email) {
/**
* A function that returns a maximum of $limit users who have done something within the last
- * $seconds seconds.
+ * $seconds seconds or the total count of active users.
*
* @param int $seconds Number of seconds (default 600 = 10min)
* @param int $limit Limit, default 10.
- * @param int $offset Offset, defualt 0.
+ * @param int $offset Offset, default 0.
+ * @param bool $count Count, default false.
*
* @return mixed
*/
-function find_active_users($seconds = 600, $limit = 10, $offset = 0) {
- global $CONFIG;
-
+function find_active_users($seconds = 600, $limit = 10, $offset = 0, $count = false) {
$seconds = (int)$seconds;
$limit = (int)$limit;
$offset = (int)$offset;
+ $params = array('seconds' => $seconds, 'limit' => $limit, 'offset' => $offset, 'count' => $count);
+ $data = elgg_trigger_plugin_hook('find_active_users', 'system', $params, NULL);
+ if (!$data) {
+ global $CONFIG;
- $time = time() - $seconds;
-
- $access = get_access_sql_suffix("e");
-
- $query = "SELECT distinct e.* from {$CONFIG->dbprefix}entities e
- join {$CONFIG->dbprefix}users_entity u on e.guid = u.guid
- where u.last_action >= {$time} and $access
- order by u.last_action desc limit {$offset}, {$limit}";
+ $time = time() - $seconds;
- return get_data($query, "entity_row_to_elggstar");
+ $data = elgg_get_entities(array(
+ 'type' => 'user',
+ 'limit' => $limit,
+ 'offset' => $offset,
+ 'count' => $count,
+ 'joins' => array("join {$CONFIG->dbprefix}users_entity u on e.guid = u.guid"),
+ 'wheres' => array("u.last_action >= {$time}"),
+ 'order_by' => "u.last_action desc"
+ ));
+ }
+ return $data;
}
/**
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 45b2c35f8..7358fc0ba 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -950,9 +950,10 @@ function elgg_view_annotation(ElggAnnotation $annotation, array $vars = array(),
* 'offset' The current indexing offset
* 'limit' The number of entities to display per page
* 'full_view' Display the full view of the entities?
- * 'list_class' CSS Class applied to the list
+ * 'list_class' CSS class applied to the list
+ * 'item_class' CSS class applied to the list items
* 'pagination' Display pagination?
- * 'gallery' Display as gallery?
+ * 'list_type' List type: 'list' (default), 'gallery'
* 'list_type_toggle' Display the list type toggle?
*
* @return string The rendered list of entities
@@ -965,14 +966,21 @@ $list_type_toggle = true, $pagination = true) {
$offset = (int)get_input('offset', 0);
}
+ // list type can be passed as request parameter
+ $list_type = get_input('list_type', 'list');
+ if (get_input('listtype')) {
+ elgg_deprecated_notice("'listtype' has been deprecated by 'list_type' for lists", 1.8);
+ $list_type = get_input('listtype');
+ }
+
if (is_array($vars)) {
// new function
$defaults = array(
'items' => $entities,
- 'list_class' => 'elgg-entity-list',
+ 'list_class' => 'elgg-list-entity',
'full_view' => true,
'pagination' => true,
- 'gallery' => false,
+ 'list_type' => $list_type,
'list_type_toggle' => false,
'offset' => $offset,
);
@@ -990,18 +998,13 @@ $list_type_toggle = true, $pagination = true) {
'limit' => (int) $limit,
'full_view' => $full_view,
'pagination' => $pagination,
- 'gallery' => false,
+ 'list_type' => $list_type,
'list_type_toggle' => $list_type_toggle,
- 'list_class' => 'elgg-entity-list',
+ 'list_class' => 'elgg-list-entity',
);
}
- $listtype = get_input('listtype', 'list');
- if ($listtype != 'list') {
- $vars['gallery'] = true;
- }
-
- if ($vars['gallery']) {
+ if ($vars['list_type'] != 'list') {
return elgg_view('page/components/gallery', $vars);
} else {
return elgg_view('page/components/list', $vars);
@@ -1203,7 +1206,7 @@ function elgg_view_river_item($item, array $vars = array()) {
$vars['item'] = $item;
- return elgg_view('river/item', $vars);
+ return elgg_view($item->getView(), $vars);
}
/**
diff --git a/js/lib/ui.js b/js/lib/ui.js
index 692311d73..fd20acbd1 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -11,7 +11,7 @@ elgg.ui.init = function () {
$('.elgg-system-messages li').animate({opacity: 0.9}, 6000);
$('.elgg-system-messages li').fadeOut('slow');
- $('.elgg-toggler').live('click', elgg.ui.toggles);
+ $('[rel=toggle]').live('click', elgg.ui.toggles);
$('[rel=popup]').live('click', elgg.ui.popsUp);
@@ -27,8 +27,8 @@ elgg.ui.init = function () {
/**
* Toggles an element based on clicking a separate element
*
- * Use .elgg-toggler on the toggler element
- * Set the href to target the item you want to toggle (<a class="elgg-toggler" href="#id-of-target">)
+ * Use rel="toggle" on the toggler element
+ * Set the href to target the item you want to toggle (<a rel="toggle" href="#id-of-target">)
*
* @param {Object} event
* @return void
@@ -228,25 +228,6 @@ elgg.ui.requiresConfirmation = function(e) {
};
/**
- * Repositions the likes popup
- *
- * @param {String} hook 'getOptions'
- * @param {String} type 'ui.popup'
- * @param {Object} params An array of info about the target and source.
- * @param {Object} options Options to pass to
- *
- * @return {Object}
- */
-elgg.ui.likesPopupHandler = function(hook, type, params, options) {
- if (params.target.hasClass('elgg-likes-list')) {
- options.my = 'right bottom';
- options.at = 'left top';
- return options;
- }
- return null;
-};
-
-/**
* Repositions the login popup
*
* @param {String} hook 'getOptions'
@@ -266,5 +247,4 @@ elgg.ui.LoginHandler = function(hook, type, params, options) {
};
elgg.register_hook_handler('init', 'system', elgg.ui.init);
-elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler);
elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.LoginHandler); \ No newline at end of file
diff --git a/languages/en.php b/languages/en.php
index dcba9abc3..50cd08ac9 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -383,7 +383,7 @@ $english = array(
'profile:editdefault:delete:success' => 'Default profile item deleted!',
'profile:defaultprofile:reset' => 'Default system profile reset',
'profile:resetdefault' => 'Reset default profile',
- 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will loose any information already entered into custom fields on profile pages.",
+ 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will lose any information already entered into custom fields on profile pages.",
'profile:editdefault:success' => 'Item successfully added to default profile',
'profile:editdefault:fail' => 'Default profile could not be saved',
@@ -403,14 +403,13 @@ $english = array(
* River
*/
'river' => "River",
- 'river:relationship:friend' => 'is now friends with',
- 'friends:river:add' => "is now a friend with %s",
- 'profile:river:iconupdate' => 'updated their profile icon',
+ 'river:friend:user:default' => "%s is now a friend with %s",
+ 'river:update:user:avatar' => '%s has a new avatar',
'river:noaccess' => 'You do not have permission to view this item.',
'river:posted:generic' => '%s posted',
'riveritem:single:user' => 'a user',
'riveritem:plural:user' => 'some users',
- 'river:ingroup' => 'to the group %s',
+ 'river:ingroup' => 'in the group %s',
'river:none' => 'No activity',
'river:widget:title' => "Activity",
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php
index b626085d7..47dc57dda 100644
--- a/mod/blog/languages/en.php
+++ b/mod/blog/languages/en.php
@@ -12,9 +12,9 @@ $english = array(
'blog:blog' => 'Blog',
'item:object:blog' => 'Blogs',
- 'blog:title:user_blogs' => '%s\'s Blogs',
- 'blog:title:all_blogs' => 'All Site Blogs',
- 'blog:title:friends' => 'Friends\' Blogs',
+ 'blog:title:user_blogs' => '%s\'s blogs',
+ 'blog:title:all_blogs' => 'All site blogs',
+ 'blog:title:friends' => 'Friends\' blogs',
'blog:group' => 'Group blog',
'blog:enableblog' => 'Enable group blog',
@@ -53,8 +53,9 @@ $english = array(
'blog:error:revision_not_found' => 'Cannot find this revision.',
// river
- 'blog:river:create' => 'published a blog post',
- 'river:commented:object:blog' => 'the blog',
+
+ 'river:create:object:blog' => '%s published a blog post %s',
+ 'river:comment:object:blog' => '%s commented on the blog %s',
// widget
'blog:widget:description' => 'Display your latest blog posts',
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 8964d5b53..4d1edd50e 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -38,7 +38,7 @@ function blog_get_page_content_read($guid = NULL) {
}
elgg_push_breadcrumb($blog->title);
- $return['content'] = elgg_view_entity($blog, TRUE);
+ $return['content'] = elgg_view_entity($blog, array('full_view' => true));
//check to see if comment are on
if ($blog->comments_on != 'Off') {
$return['content'] .= elgg_view_comments($blog);
@@ -88,6 +88,8 @@ function blog_get_page_content_list($container_guid = NULL) {
} else {
$return['filter_context'] = 'all';
$return['title'] = elgg_echo('blog:title:all_blogs');
+ elgg_pop_breadcrumb();
+ elgg_push_breadcrumb(elgg_echo('blog:blogs'));
}
// show all posts for admin or users looking at their own blogs
diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php
index 6cfe6c98e..d769fbd59 100644
--- a/mod/blog/views/default/blog/group_module.php
+++ b/mod/blog/views/default/blog/group_module.php
@@ -14,10 +14,6 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('blog:group') . '</h3>';
-
-
elgg_push_context('widgets');
$options = array(
'type' => 'object',
@@ -34,12 +30,14 @@ if (!$content) {
$content = '<p>' . elgg_echo('blog:none') . '</p>';
}
-if ($group->canWriteToContainer()) {
- $new_link = elgg_view('output/url', array(
- 'href' => "blog/add/$group->guid",
- 'text' => elgg_echo('blog:write'),
- ));
- $content .= "<span class='elgg-widget-more'>$new_link</span>";
-}
+$new_link = elgg_view('output/url', array(
+ 'href' => "blog/add/$group->guid",
+ 'text' => elgg_echo('blog:write'),
+));
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('blog:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+));
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 8456829fe..ba08180b1 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -74,6 +74,7 @@ if ($full) {
'subtitle' => $subtitle,
'tags' => $tags,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$blog_info = elgg_view_image_block($owner_icon, $list_body);
@@ -94,6 +95,7 @@ HTML;
'tags' => $tags,
'content' => $excerpt,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($owner_icon, $list_body);
diff --git a/mod/blog/views/default/river/object/blog/create.php b/mod/blog/views/default/river/object/blog/create.php
index bd2405d42..613cbb165 100644
--- a/mod/blog/views/default/river/object/blog/create.php
+++ b/mod/blog/views/default/river/object/blog/create.php
@@ -7,29 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->excerpt);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-echo elgg_echo('blog:river:create');
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php
index 42865f8cf..1d32a0344 100644
--- a/mod/bookmarks/languages/en.php
+++ b/mod/bookmarks/languages/en.php
@@ -35,10 +35,10 @@ $english = array(
'bookmarks:visit' => "Visit resource",
'bookmarks:recent' => "Recent bookmarks",
- 'bookmarks:river:created' => 'bookmarked %s',
+ 'river:create:object:bookmarks' => '%s bookmarked %s',
+ 'river:comment:object:bookmarks' => '%s commented on a bookmark %s',
'bookmarks:river:annotate' => 'a comment on this bookmark',
'bookmarks:river:item' => 'an item',
- 'river:commented:object:bookmarks' => 'a bookmark',
'item:object:bookmarks' => 'Bookmarks',
diff --git a/mod/bookmarks/pages/bookmarks/all.php b/mod/bookmarks/pages/bookmarks/all.php
index 0978fd7fd..ec0f85e2b 100644
--- a/mod/bookmarks/pages/bookmarks/all.php
+++ b/mod/bookmarks/pages/bookmarks/all.php
@@ -5,6 +5,9 @@
* @package ElggBookmarks
*/
+elgg_pop_breadcrumb();
+elgg_push_breadcrumb(elgg_echo('bookmarks'));
+
$offset = (int)get_input('offset', 0);
$content = elgg_list_entities(array(
'type' => 'object',
diff --git a/mod/bookmarks/pages/bookmarks/view.php b/mod/bookmarks/pages/bookmarks/view.php
index d0a9c630a..8e097b090 100644
--- a/mod/bookmarks/pages/bookmarks/view.php
+++ b/mod/bookmarks/pages/bookmarks/view.php
@@ -21,7 +21,7 @@ $title = $bookmark->title;
elgg_push_breadcrumb($title);
-$content = elgg_view_entity($bookmark, true);
+$content = elgg_view_entity($bookmark, array('full_view' => true));
$content .= elgg_view_comments($bookmark);
$body = elgg_view_layout('content', array(
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index 1fb79deb6..2a7b44e97 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -88,7 +88,6 @@ function bookmarks_page_handler($page) {
elgg_load_library('elgg:bookmarks');
elgg_push_breadcrumb(elgg_echo('bookmarks'), 'bookmarks/all');
- elgg_push_context('bookmarks');
// old group usernames
if (substr_count($page[0], 'group:')) {
diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php
index 3166fc0f0..3797de010 100644
--- a/mod/bookmarks/views/default/bookmarks/group_module.php
+++ b/mod/bookmarks/views/default/bookmarks/group_module.php
@@ -16,9 +16,6 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('bookmarks:group') . '</h3>';
-
elgg_push_context('widgets');
$options = array(
'type' => 'object',
@@ -35,12 +32,14 @@ if (!$content) {
$content = '<p>' . elgg_echo('bookmarks:none') . '</p>';
}
-if ($group->canWriteToContainer()) {
- $new_link = elgg_view('output/url', array(
- 'href' => "bookmarks/add/$group->guid",
- 'text' => elgg_echo('bookmarks:add'),
- ));
- $content .= "<span class='elgg-widget-more'>$new_link</span>";
-}
+$new_link = elgg_view('output/url', array(
+ 'href' => "bookmarks/add/$group->guid",
+ 'text' => elgg_echo('bookmarks:add'),
+));
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('bookmarks:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+));
diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php
index 38b0a721a..ca1f5d312 100644
--- a/mod/bookmarks/views/default/object/bookmarks.php
+++ b/mod/bookmarks/views/default/object/bookmarks.php
@@ -65,6 +65,7 @@ if ($full && !elgg_in_context('gallery')) {
'subtitle' => $subtitle,
'tags' => $tags,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$bookmark_info = elgg_view_image_block($owner_icon, $list_body);
@@ -118,7 +119,8 @@ HTML;
'tags' => $tags,
'content' => $content,
);
-
+ $params = $params + $vars;
$body = elgg_view('object/elements/summary', $params);
+
echo elgg_view_image_block($owner_icon, $body);
} \ No newline at end of file
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php
index 743efdb22..984d109be 100644
--- a/mod/bookmarks/views/default/river/object/bookmarks/create.php
+++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php
@@ -8,29 +8,8 @@
$object = $vars['item']->getObjectEntity();
$excerpt = elgg_get_excerpt($object->description);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-$link = elgg_echo('bookmarks:river:created', array($link));
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+ 'attachments' => elgg_view('output/url', array('href' => $object->address)),
+));
diff --git a/mod/custom_index/index.php b/mod/custom_index/index.php
index e39e6ef29..53990a006 100644
--- a/mod/custom_index/index.php
+++ b/mod/custom_index/index.php
@@ -35,7 +35,8 @@ $newest_members = elgg_list_entities_from_metadata(array(
'limit' => 10,
'full_view' => false,
'pagination' => false,
- 'gallery' => true,
+ 'list_type' => 'gallery',
+ 'gallery_class' => 'elgg-gallery-users',
'size' => 'small',
));
diff --git a/mod/dashboard/start.php b/mod/dashboard/start.php
index 4fa048b3d..9de1ee4af 100644
--- a/mod/dashboard/start.php
+++ b/mod/dashboard/start.php
@@ -8,6 +8,8 @@ elgg_register_event_handler('init', 'system', 'dashboard_init');
function dashboard_init() {
elgg_register_page_handler('dashboard', 'dashboard_page_handler');
+ elgg_extend_view('css/elgg', 'dashboard/css');
+
elgg_register_menu_item('topbar', array(
'name' => 'dashboard',
'href' => 'dashboard',
diff --git a/mod/dashboard/views/default/dashboard/blurb.php b/mod/dashboard/views/default/dashboard/blurb.php
index 202be1dc5..9293e513a 100644
--- a/mod/dashboard/views/default/dashboard/blurb.php
+++ b/mod/dashboard/views/default/dashboard/blurb.php
@@ -9,7 +9,7 @@
<?php
echo elgg_view('output/longtext', array(
'id' => 'dashboard-info',
- 'class' => 'elgg-inner elgg-border-plain pam mhs mbl mtn',
+ 'class' => 'elgg-inner pam mhs mtn',
'value' => elgg_echo("dashboard:nowidgets"),
));
diff --git a/mod/dashboard/views/default/dashboard/css.php b/mod/dashboard/views/default/dashboard/css.php
new file mode 100644
index 000000000..f49293293
--- /dev/null
+++ b/mod/dashboard/views/default/dashboard/css.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * User dashboard CSS
+ */
+?>
+
+#dashboard-info {
+ border: 2px solid #dedede;
+ margin-bottom: 15px;
+}
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index b17fb6298..88a01745d 100644
--- a/mod/file/actions/file/upload.php
+++ b/mod/file/actions/file/upload.php
@@ -95,9 +95,10 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) {
$file->originalfilename = $_FILES['upload']['name'];
$file->simpletype = file_get_simple_type($_FILES['upload']['type']);
+ // Open the file to guarantee the directory exists
$file->open("write");
- $file->write(get_uploaded_file('upload'));
$file->close();
+ move_uploaded_file($_FILES['upload']['tmp_name'], $file->getFilenameOnFilestore());
$guid = $file->save();
diff --git a/mod/file/download.php b/mod/file/download.php
index a386d490f..8e0287a1e 100644
--- a/mod/file/download.php
+++ b/mod/file/download.php
@@ -33,8 +33,7 @@ if (strpos($mime, "image/") !== false) {
header("Content-Disposition: attachment; filename=\"$filename\"");
}
-$contents = $file->grabFile();
-$splitString = str_split($contents, 8192);
-foreach ($splitString as $chunk) {
- echo $chunk;
-}
+ob_clean();
+flush();
+readfile($file->getFilenameOnFilestore());
+exit;
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index 7ced3f112..72b198d54 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -11,11 +11,8 @@ $english = array(
* Menu items and titles
*/
'file' => "Files",
- 'files' => "My Files",
- 'file:yours' => "Your files",
- 'file:yours:friends' => "Your friends' files",
'file:user' => "%s's files",
- 'file:friends' => "%s's friends' files",
+ 'file:friends' => "Friends' files",
'file:all' => "All site files",
'file:edit' => "Edit file",
'file:more' => "More files",
@@ -73,8 +70,8 @@ $english = array(
'file:display:number' => "Number of files to display",
- 'file:river:create' => 'uploaded the file',
- 'river:commented:object:file' => 'the file',
+ 'river:create:object:file' => '%s uploaded the file %s',
+ 'river:comment:object:file' => '%s commented on the file %s',
'item:object:file' => 'Files',
diff --git a/mod/file/pages/file/friends.php b/mod/file/pages/file/friends.php
index 65fc66f62..fc23e1d1e 100644
--- a/mod/file/pages/file/friends.php
+++ b/mod/file/pages/file/friends.php
@@ -12,7 +12,7 @@ elgg_push_breadcrumb($owner->name, "file/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
-$title = elgg_echo("file:friends", array($owner->name));
+$title = elgg_echo("file:friends");
// offset is grabbed in list_user_friends_objects
$content = list_user_friends_objects($owner->guid, 'file', 10, false);
diff --git a/mod/file/pages/file/owner.php b/mod/file/pages/file/owner.php
index 69ec30425..a01e9cd22 100644
--- a/mod/file/pages/file/owner.php
+++ b/mod/file/pages/file/owner.php
@@ -17,20 +17,19 @@ $params = array();
if ($owner->guid == elgg_get_logged_in_user_guid()) {
// user looking at own files
- $title = elgg_echo('file:yours');
$params['filter_context'] = 'mine';
} else if (elgg_instanceof($owner, 'user')) {
// someone else's files
- $title = elgg_echo("file:user", array($owner->name));
// do not show button or select a tab when viewing someone else's posts
$params['filter_context'] = 'none';
$params['buttons'] = '';
} else {
// group files
- $title = elgg_echo("file:user", array($owner->name));
$params['filter'] = '';
}
+$title = elgg_echo("file:user", array($owner->name));
+
// List files
$content = elgg_list_entities(array(
'types' => 'object',
diff --git a/mod/file/pages/file/view.php b/mod/file/pages/file/view.php
index daa2a400e..4b395d20d 100644
--- a/mod/file/pages/file/view.php
+++ b/mod/file/pages/file/view.php
@@ -22,14 +22,20 @@ $title = $file->title;
elgg_push_breadcrumb($title);
-$content = elgg_view_entity($file, true);
+$content = elgg_view_entity($file, array('full_view' => true));
$content .= elgg_view_comments($file);
+$download = elgg_view('output/url', array(
+ 'href' => "mod/file/download.php?file_guid=$file->guid",
+ 'text' => elgg_echo("file:download"),
+ 'class' => 'elgg-button elgg-button-action float-alt',
+));
+
$body = elgg_view_layout('content', array(
'content' => $content,
'title' => $title,
'filter' => '',
- 'header' => '',
+ 'buttons' => $download,
));
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php
index 830b1096c..c37b13927 100644
--- a/mod/file/views/default/file/group_module.php
+++ b/mod/file/views/default/file/group_module.php
@@ -14,10 +14,6 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('file:group') . '</h3>';
-
-
elgg_push_context('widgets');
$options = array(
'type' => 'object',
@@ -34,12 +30,14 @@ if (!$content) {
$content = '<p>' . elgg_echo('file:none') . '</p>';
}
-if ($group->canWriteToContainer()) {
- $new_link = elgg_view('output/url', array(
- 'href' => "file/add/$group->guid",
- 'text' => elgg_echo('file:add'),
- ));
- $content .= "<span class='elgg-widget-more'>$new_link</span>";
-}
+$new_link = elgg_view('output/url', array(
+ 'href' => "file/add/$group->guid",
+ 'text' => elgg_echo('file:add'),
+));
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('file:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+));
diff --git a/mod/file/views/default/file/typecloud.php b/mod/file/views/default/file/typecloud.php
index ce4d6c127..4253bf674 100644
--- a/mod/file/views/default/file/typecloud.php
+++ b/mod/file/views/default/file/typecloud.php
@@ -15,7 +15,7 @@ function file_type_cloud_get_url($type, $friends) {
}
if ($type->tag == "image") {
- $url .= "&listtype=gallery";
+ $url .= "&list_type=gallery";
}
if (elgg_get_page_owner_guid()) {
diff --git a/mod/file/views/default/forms/file/upload.php b/mod/file/views/default/forms/file/upload.php
index da764c3d8..98b7d9f05 100644
--- a/mod/file/views/default/forms/file/upload.php
+++ b/mod/file/views/default/forms/file/upload.php
@@ -18,8 +18,10 @@ $guid = elgg_extract('guid', $vars, null);
if ($guid) {
$file_label = elgg_echo("file:replace");
+ $submit_label = elgg_echo('save');
} else {
$file_label = elgg_echo("file:file");
+ $submit_label = elgg_echo('upload');
}
?>
@@ -60,7 +62,7 @@ if ($guid) {
echo elgg_view('input/hidden', array('name' => 'file_guid', 'value' => $guid));
}
-echo elgg_view('input/submit', array('value' => elgg_echo("save")));
+echo elgg_view('input/submit', array('value' => $submit_label));
?>
</div>
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 93a21c8e6..95e190d35 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -67,12 +67,6 @@ if ($full && !elgg_in_context('gallery')) {
$extra = elgg_view("file/specialcontent/$base_type/default", $vars);
}
- $download = elgg_view('output/url', array(
- 'href' => "mod/file/download.php?file_guid=$file->guid",
- 'text' => elgg_echo("file:download"),
- 'class' => 'elgg-button elgg-button-action',
- ));
-
$header = elgg_view_title($file->title);
$params = array(
@@ -82,17 +76,16 @@ if ($full && !elgg_in_context('gallery')) {
'subtitle' => $subtitle,
'tags' => $tags,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$file_info = elgg_view_image_block($file_icon, $list_body);
echo <<<HTML
-$header
$file_info
<div class="file elgg-content">
$body
$extra
- <p>$download</p>
</div>
HTML;
@@ -112,6 +105,7 @@ HTML;
'tags' => $tags,
'content' => $excerpt,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($file_icon, $list_body);
diff --git a/mod/file/views/default/river/object/file/create.php b/mod/file/views/default/river/object/file/create.php
index 620d1d18c..dad629120 100644
--- a/mod/file/views/default/river/object/file/create.php
+++ b/mod/file/views/default/river/object/file/create.php
@@ -7,29 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-echo elgg_echo('file:river:create');
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/actions/groups/membership/remove.php b/mod/groups/actions/groups/membership/remove.php
new file mode 100644
index 000000000..650d35286
--- /dev/null
+++ b/mod/groups/actions/groups/membership/remove.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Remove a user from a group
+ *
+ * @package ElggGroups
+ */
+
+$user_guid = get_input('user_guid');
+$group_guid = get_input('group_guid');
+
+$user = get_entity($user_guid);
+$group = get_entity($group_guid);
+
+elgg_set_page_owner_guid($group->guid);
+
+if (($user instanceof ElggUser) && ($group instanceof ElggGroup) && $group->canEdit()) {
+ // Don't allow removing group owner
+ if ($group->getOwnerGUID() != $user->getGUID()) {
+ if ($group->leave($user)) {
+ system_message(elgg_echo("groups:removed", array($user->name)));
+ } else {
+ register_error(elgg_echo("groups:cantremove"));
+ }
+ } else {
+ register_error(elgg_echo("groups:cantremove"));
+ }
+} else {
+ register_error(elgg_echo("groups:cantremove"));
+}
+
+forward(REFERER);
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 63a6df3a9..9f8bed9a4 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -166,6 +166,9 @@ $english = array(
'groups:notitle' => 'Groups must have a title',
'groups:cantjoin' => 'Can not join group',
'groups:cantleave' => 'Could not leave group',
+ 'groups:removeuser' => 'Remove from group',
+ 'groups:cantremove' => 'Cannot remove user from group',
+ 'groups:removed' => 'Successfully removed %s from group',
'groups:addedtogroup' => 'Successfully added the user to the group',
'groups:joinrequestnotmade' => 'Could not request to join group',
'groups:joinrequestmade' => 'Requested to join group',
@@ -210,10 +213,10 @@ or click below to view the group's join requests:
Forum river items
*/
- 'groups:river:create' => 'created the group',
- 'groups:river:join' => 'joined the group',
- 'forumtopic:river:create' => 'added a new discussion topic',
- 'groups:river:reply' => 'replied on the discussion topic',
+ 'river:create:group:default' => '%s created the group %s',
+ 'river:join:group:default' => '%s joined the group %s',
+ 'river:create:object:groupforumtopic' => '%s added a new discussion topic %s',
+ 'river:reply:object:groupforumtopic' => '%s replied on the discussion topic %s',
'groups:nowidgets' => 'No widgets have been defined for this group.',
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index 94d212ef6..342115c81 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -167,7 +167,7 @@ function discussion_handle_view_page($guid) {
elgg_push_breadcrumb($group->name, "discussion/owner/$group->guid");
elgg_push_breadcrumb($topic->title);
- $content = elgg_view_entity($topic, true);
+ $content = elgg_view_entity($topic, array('full_view' => true));
if ($topic->status == 'closed') {
$content .= elgg_view('discussion/replies', array(
'entity' => $topic,
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 279c5f238..c3986e53c 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -307,7 +307,7 @@ function groups_handle_members_page($guid) {
$title = elgg_echo('groups:members:title', array($group->name));
elgg_push_breadcrumb($group->name, $group->getURL());
- elgg_push_breadcrumb(elgg_echo('groups:members:'));
+ elgg_push_breadcrumb(elgg_echo('groups:members'));
$content = elgg_list_entities_from_relationship(array(
'relationship' => 'member',
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 73bdd08a9..57c40af5d 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -44,6 +44,7 @@ function groups_init() {
elgg_register_action("groups/invite", "$action_base/invite.php");
elgg_register_action("groups/join", "$action_base/join.php");
elgg_register_action("groups/leave", "$action_base/leave.php");
+ elgg_register_action("groups/remove", "$action_base/remove.php");
elgg_register_action("groups/killrequest", "$action_base/delete_request.php");
elgg_register_action("groups/killinvitation", "$action_base/delete_invite.php");
elgg_register_action("groups/addtogroup", "$action_base/add.php");
@@ -60,6 +61,9 @@ function groups_init() {
// group entity menu
elgg_register_plugin_hook_handler('register', 'menu:entity', 'groups_entity_menu_setup');
+
+ // group user hover menu
+ elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'groups_user_entity_menu_setup');
//extend some views
elgg_extend_view('css/elgg', 'groups/css');
@@ -367,6 +371,44 @@ function groups_entity_menu_setup($hook, $type, $return, $params) {
}
/**
+ * Add a remove user link to user hover menu when the page owner is a group
+ */
+function groups_user_entity_menu_setup($hook, $type, $return, $params) {
+ if (elgg_is_logged_in()) {
+ $group = elgg_get_page_owner_entity();
+
+ // Check for valid group
+ if (!elgg_instanceof($group, 'group')) {
+ return $return;
+ }
+
+ $entity = $params['entity'];
+
+ // Make sure we have a user and that user is a member of the group
+ if (!elgg_instanceof($entity, 'user') || !$group->isMember($entity)) {
+ return $return;
+ }
+
+ // Add remove link if we can edit the group, and if we're not trying to remove the group owner
+ if ($group->canEdit() && $group->getOwnerGUID() != $entity->guid) {
+ $remove = elgg_view('output/confirmlink', array(
+ 'href' => "action/groups/remove?user_guid={$entity->guid}&group_guid={$group->guid}",
+ 'text' => elgg_echo('groups:removeuser'),
+ ));
+
+ $options = array(
+ 'name' => 'removeuser',
+ 'text' => $remove,
+ 'priority' => 999,
+ );
+ $return[] = ElggMenuItem::factory($options);
+ }
+ }
+
+ return $return;
+}
+
+/**
* Groups created so create an access list for it
*/
function groups_create_event_listener($event, $object_type, $object) {
@@ -621,7 +663,7 @@ function discussion_init() {
// commenting not allowed on discussion topics (use a different annotation)
elgg_register_plugin_hook_handler('permissions_check:comment', 'object', 'discussion_comment_override');
-
+
$action_base = elgg_get_plugins_path() . 'groups/actions/discussion';
elgg_register_action('discussion/save', "$action_base/save.php");
elgg_register_action('discussion/delete', "$action_base/delete.php");
@@ -722,7 +764,7 @@ function discussion_owner_block_menu($hook, $type, $return, $params) {
* Add the reply button for the river
*/
function discussion_add_to_river_menu($hook, $type, $return, $params) {
- if (elgg_is_logged_in()) {
+ if (elgg_is_logged_in() && !elgg_in_context('widgets')) {
$item = $params['item'];
$object = $item->getObjectEntity();
if (elgg_instanceof($object, 'object', 'groupforumtopic')) {
@@ -734,7 +776,7 @@ function discussion_add_to_river_menu($hook, $type, $return, $params) {
'href' => "#groups-reply-$object->guid",
'text' => elgg_view_icon('speech-bubble'),
'title' => elgg_echo('reply:this'),
- 'link_class' => "elgg-toggler",
+ 'link_rel' => 'toggle',
'priority' => 50,
);
$return[] = ElggMenuItem::factory($options);
diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php
index 165d9b1be..3a46e336e 100644
--- a/mod/groups/views/default/discussion/group_module.php
+++ b/mod/groups/views/default/discussion/group_module.php
@@ -17,10 +17,6 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('discussion:group') . '</h3>';
-
-
elgg_push_context('widgets');
$options = array(
'type' => 'object',
@@ -37,12 +33,14 @@ if (!$content) {
$content = '<p>' . elgg_echo('grouptopic:notcreated') . '</p>';
}
-if ($group->canWriteToContainer()) {
- $new_link = elgg_view('output/url', array(
- 'href' => "discussion/add/" . $group->getGUID(),
- 'text' => elgg_echo('groups:addtopic'),
- ));
- $content .= "<span class='elgg-widget-more'>$new_link</span>";
-}
+$new_link = elgg_view('output/url', array(
+ 'href' => "discussion/add/" . $group->getGUID(),
+ 'text' => elgg_echo('groups:addtopic'),
+));
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('discussion:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php
index 2aa377813..fc91f90d0 100644
--- a/mod/groups/views/default/group/default.php
+++ b/mod/groups/views/default/group/default.php
@@ -31,6 +31,7 @@ if ($vars['full_view']) {
'metadata' => $metadata,
'subtitle' => $group->briefdescription,
);
+ $params = $params + $vars;
$list_body = elgg_view('group/elements/summary', $params);
echo elgg_view_image_block($icon, $list_body);
diff --git a/mod/groups/views/default/groups/css.php b/mod/groups/views/default/groups/css.php
index 37fc5dc10..9c65d1602 100644
--- a/mod/groups/views/default/groups/css.php
+++ b/mod/groups/views/default/groups/css.php
@@ -36,15 +36,14 @@
margin: 0;
}
-#groups-tools > .elgg-module {
- float: left;
- margin-bottom: 40px;
+#groups-tools > li {
+ width: 48%;
min-height: 200px;
- width: 350px;
+ margin-bottom: 40px;
}
-#groups-tools > .elgg-module:nth-child(odd) {
- margin-right: 30px;
+#groups-tools > li:nth-child(odd) {
+ margin-right: 4%;
}
.groups-widget-viewall {
diff --git a/mod/groups/views/default/groups/js.php b/mod/groups/views/default/groups/js.php
index dec31cf54..ad742445b 100644
--- a/mod/groups/views/default/groups/js.php
+++ b/mod/groups/views/default/groups/js.php
@@ -1,4 +1,5 @@
$(function() {
- $('#groups-tools').find('.elgg-module:odd').addClass('odd');
+ // jQuery uses 0-based indexing
+ $('#groups-tools').children('li:even').addClass('odd');
});
diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php
index 4ea97cad6..5e557b443 100644
--- a/mod/groups/views/default/groups/profile/activity_module.php
+++ b/mod/groups/views/default/groups/profile/activity_module.php
@@ -21,16 +21,13 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('groups:activity') . '</h3>';
-
elgg_push_context('widgets');
$db_prefix = elgg_get_config('dbprefix');
$content = elgg_list_river(array(
'limit' => 4,
'pagination' => false,
- 'joins' => array("join {$db_prefix}entities e1 on e1.guid = rv.object_guid"),
+ 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"),
'wheres' => array("(e1.container_guid = $group->guid)"),
));
elgg_pop_context();
@@ -39,4 +36,8 @@ if (!$content) {
$content = '<p>' . elgg_echo('groups:activity:none') . '</p>';
}
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('groups:activity'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+));
diff --git a/mod/groups/views/default/groups/profile/module.php b/mod/groups/views/default/groups/profile/module.php
new file mode 100644
index 000000000..9d0b18266
--- /dev/null
+++ b/mod/groups/views/default/groups/profile/module.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Group module (also called a group widget)
+ *
+ * @uses $vars['title'] The title of the module
+ * @uses $vars['content'] The module content
+ * @uses $vars['all_link'] A link to list content
+ * @uses $vars['add_link'] A link to create content
+ */
+
+$group = elgg_get_page_owner_entity();
+
+$header = "<span class=\"groups-widget-viewall\">{$vars['all_link']}</span>";
+$header .= '<h3>' . $vars['title'] . '</h3>';
+
+if ($group->canWriteToContainer() && isset($vars['add_link'])) {
+ $vars['content'] .= "<span class='elgg-widget-more'>{$vars['add_link']}</span>";
+}
+
+echo '<li>';
+echo elgg_view_module('info', '', $vars['content'], array(
+ 'header' => $header,
+ 'class' => 'elgg-module-group',
+));
+echo '</li>';
diff --git a/mod/groups/views/default/groups/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php
index 28e43fdc4..75c04c810 100644
--- a/mod/groups/views/default/groups/profile/widgets.php
+++ b/mod/groups/views/default/groups/profile/widgets.php
@@ -6,7 +6,7 @@
*/
// tools widget area
-echo '<div id="groups-tools" class="mtl clearfix">';
+echo '<div id="groups-tools" class="elgg-gallery elgg-gallery-fluid mtl clearfix">';
// enable tools to extend this area
echo elgg_view("groups/tool_latest", array('entity' => $vars['entity']));
diff --git a/mod/groups/views/default/groups/sidebar/featured.php b/mod/groups/views/default/groups/sidebar/featured.php
index 695782783..8bd51ab5c 100644
--- a/mod/groups/views/default/groups/sidebar/featured.php
+++ b/mod/groups/views/default/groups/sidebar/featured.php
@@ -17,7 +17,7 @@ if ($featured_groups) {
elgg_push_context('widgets');
$body = '';
foreach ($featured_groups as $group) {
- $body .= elgg_view_entity($group, false);
+ $body .= elgg_view_entity($group, array('full_view' => false));
}
elgg_pop_context();
diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php
index 28111554f..7249ffbf4 100644
--- a/mod/groups/views/default/groups/sidebar/members.php
+++ b/mod/groups/views/default/groups/sidebar/members.php
@@ -21,7 +21,8 @@ $body = elgg_list_entities_from_relationship(array(
'inverse_relationship' => true,
'types' => 'user',
'limit' => $limit,
- 'gallery' => true,
+ 'list_type' => 'gallery',
+ 'gallery_class' => 'elgg-gallery-users',
));
$body .= "<div class='center mts'>$all_link</div>";
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index 3a4decbe4..22589b84d 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -67,6 +67,7 @@ if ($full) {
'subtitle' => $subtitle,
'tags' => $tags,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$info = elgg_view_image_block($poster_icon, $list_body);
@@ -90,6 +91,7 @@ HTML;
'tags' => $tags,
'content' => $excerpt,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($poster_icon, $list_body);
diff --git a/mod/groups/views/default/river/annotation/group_topic_post/reply.php b/mod/groups/views/default/river/annotation/group_topic_post/reply.php
index 1999c8dd9..cc94fbd43 100644
--- a/mod/groups/views/default/river/annotation/group_topic_post/reply.php
+++ b/mod/groups/views/default/river/annotation/group_topic_post/reply.php
@@ -4,24 +4,9 @@
*/
$object = $vars['item']->getObjectEntity();
$reply = $vars['item']->getAnnotation();
+$excerpt = elgg_get_excerpt($reply->value);
-$url = $object->getURL();
-$title = $object->title;
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $title,
-);
-$object_link = elgg_view('output/url', $params);
-
-$type = $object->getType();
-$subtype = $object->getSubtype();
-
-echo elgg_echo('groups:river:reply') . ' ';
-echo $object_link;
-
-if ($reply) {
- $excerpt = elgg_get_excerpt($reply->value);
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/river/group/create.php b/mod/groups/views/default/river/group/create.php
index a70f8b51d..cacb5ad3f 100644
--- a/mod/groups/views/default/river/group/create.php
+++ b/mod/groups/views/default/river/group/create.php
@@ -7,19 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$link = elgg_view('output/url', $params);
-
-
-echo elgg_echo('groups:river:create');
-
-echo " $link";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/groups/views/default/river/object/groupforumtopic/create.php b/mod/groups/views/default/river/object/groupforumtopic/create.php
index 466196921..80e7b09aa 100644
--- a/mod/groups/views/default/river/object/groupforumtopic/create.php
+++ b/mod/groups/views/default/river/object/groupforumtopic/create.php
@@ -7,36 +7,16 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-echo elgg_echo('forumtopic:river:create');
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
-
-if (elgg_is_logged_in() && $container->canWriteToContainer()) {
+$responses = '';
+if (elgg_is_logged_in() && $object->canAnnotate(0, 'group_topic_post')) {
// inline comment form
$form_vars = array('id' => "groups-reply-{$object->getGUID()}", 'class' => 'hidden');
$body_vars = array('entity' => $object, 'inline' => true);
- echo elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
+ $responses = elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
}
+
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+ 'responses' => $responses,
+));
diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php
index 060826649..d1c4c3ed3 100644
--- a/mod/groups/views/default/river/relationship/member/create.php
+++ b/mod/groups/views/default/river/relationship/member/create.php
@@ -3,14 +3,6 @@
* Group join river view.
*/
-$object = $vars['item']->getObjectEntity();
-
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$link = elgg_view('output/url', $params);
-
-echo elgg_echo('groups:river:join');
-
-echo " $link";
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+));
diff --git a/mod/likes/start.php b/mod/likes/start.php
index b2aa83260..d45fb96b3 100644
--- a/mod/likes/start.php
+++ b/mod/likes/start.php
@@ -9,6 +9,7 @@ elgg_register_event_handler('init', 'system', 'likes_init');
function likes_init() {
elgg_extend_view('css/elgg', 'likes/css');
+ elgg_extend_view('js/elgg', 'likes/js');
// registered with priority < 500 so other plugins can remove likes
elgg_register_plugin_hook_handler('register', 'menu:river', 'likes_river_menu_setup', 400);
@@ -29,15 +30,27 @@ function likes_entity_menu_setup($hook, $type, $return, $params) {
$entity = $params['entity'];
- // likes
+ // likes button
$options = array(
'name' => 'likes',
- 'text' => elgg_view('likes/display', array('entity' => $entity)),
+ 'text' => elgg_view('likes/button', array('entity' => $entity)),
'href' => false,
'priority' => 1000,
);
$return[] = ElggMenuItem::factory($options);
+ // likes count
+ $count = elgg_view('likes/count', array('entity' => $entity));
+ if ($count) {
+ $options = array(
+ 'name' => 'likes_count',
+ 'text' => $count,
+ 'href' => false,
+ 'priority' => 1001,
+ );
+ $return[] = ElggMenuItem::factory($options);
+ }
+
return $return;
}
@@ -50,14 +63,27 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
$object = $item->getObjectEntity();
if (!elgg_in_context('widgets') && $item->annotation_id == 0) {
if ($object->canAnnotate(0, 'likes')) {
+ // like button
$options = array(
'name' => 'likes',
'href' => false,
- 'text' => elgg_view('likes/display', array('entity' => $object)),
+ 'text' => elgg_view('likes/button', array('entity' => $object)),
'is_action' => true,
'priority' => 100,
);
$return[] = ElggMenuItem::factory($options);
+
+ // likes count
+ $count = elgg_view('likes/count', array('entity' => $object));
+ if ($count) {
+ $options = array(
+ 'name' => 'likes_count',
+ 'text' => $count,
+ 'href' => false,
+ 'priority' => 101,
+ );
+ $return[] = ElggMenuItem::factory($options);
+ }
}
}
}
diff --git a/mod/likes/views/default/likes/display.php b/mod/likes/views/default/likes/button.php
index 2dc50ddd0..383e1bb63 100644
--- a/mod/likes/views/default/likes/display.php
+++ b/mod/likes/views/default/likes/button.php
@@ -1,6 +1,6 @@
<?php
/**
- * Elgg likes display
+ * Elgg likes button
*
* @uses $vars['entity']
*/
@@ -40,26 +40,3 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) {
}
echo $likes_button;
-
-$list = '';
-$num_of_likes = likes_count($vars['entity']);
-
-if ($num_of_likes) {
- // display the number of likes
- if ($num_of_likes == 1) {
- $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
- } else {
- $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
- }
- $params = array(
- 'text' => $likes_string,
- 'title' => elgg_echo('likes:see'),
- 'rel' => 'popup',
- 'href' => "#likes-$guid"
- );
- $list = elgg_view('output/url', $params);
- $list .= "<div class='elgg-module elgg-module-popup elgg-likes-list hidden clearfix' id='likes-$guid'>";
- $list .= elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99));
- $list .= "</div>";
- echo $list;
-}
diff --git a/mod/likes/views/default/likes/count.php b/mod/likes/views/default/likes/count.php
new file mode 100644
index 000000000..bdc50bcd1
--- /dev/null
+++ b/mod/likes/views/default/likes/count.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Count of who has liked something
+ *
+ * @uses $vars['entity']
+ */
+
+
+$list = '';
+$num_of_likes = likes_count($vars['entity']);
+$guid = $vars['entity']->getGUID();
+
+if ($num_of_likes) {
+ // display the number of likes
+ if ($num_of_likes == 1) {
+ $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
+ } else {
+ $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
+ }
+ $params = array(
+ 'text' => $likes_string,
+ 'title' => elgg_echo('likes:see'),
+ 'rel' => 'popup',
+ 'href' => "#likes-$guid"
+ );
+ $list = elgg_view('output/url', $params);
+ $list .= "<div class='elgg-module elgg-module-popup elgg-likes-list hidden clearfix' id='likes-$guid'>";
+ $list .= elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99));
+ $list .= "</div>";
+ echo $list;
+}
diff --git a/mod/likes/views/default/likes/css.php b/mod/likes/views/default/likes/css.php
index cb0334b7c..fabf54e46 100644
--- a/mod/likes/views/default/likes/css.php
+++ b/mod/likes/views/default/likes/css.php
@@ -11,3 +11,7 @@
width: 345px;
position: absolute;
}
+
+.elgg-menu .elgg-menu-item-likes-count {
+ margin-left: 3px;
+}
diff --git a/mod/likes/views/default/likes/js.php b/mod/likes/views/default/likes/js.php
new file mode 100644
index 000000000..b7e000539
--- /dev/null
+++ b/mod/likes/views/default/likes/js.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Likes JavaScript extension for elgg.js
+ */
+?>
+
+/**
+ * Repositions the likes popup
+ *
+ * @param {String} hook 'getOptions'
+ * @param {String} type 'ui.popup'
+ * @param {Object} params An array of info about the target and source.
+ * @param {Object} options Options to pass to
+ *
+ * @return {Object}
+ */
+elgg.ui.likesPopupHandler = function(hook, type, params, options) {
+ if (params.target.hasClass('elgg-likes-list')) {
+ options.my = 'right bottom';
+ options.at = 'left top';
+ return options;
+ }
+ return null;
+};
+
+elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler); \ No newline at end of file
diff --git a/mod/likes/views/default/river/annotation/likes/create.php b/mod/likes/views/default/river/annotation/likes/create.php
index 463fe5049..0160bcc0b 100644
--- a/mod/likes/views/default/river/annotation/likes/create.php
+++ b/mod/likes/views/default/river/annotation/likes/create.php
@@ -5,22 +5,6 @@
* @todo not finished
*/
-$object = $vars['item']->getObjectEntity();
-$comment = $vars['item']->getAnnotation();
-
-$url = $object->getURL();
-$title = $object->title;
-if (!$title) {
- $title = elgg_echo('untitled');
-}
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $title,
-);
-$object_link = elgg_view('output/url', $params);
-
-$type = $object->getType();
-$subtype = $object->getSubtype();
-
-$type_string = elgg_echo("river:commented:$type:$subtype");
-echo elgg_echo('river:likes', array($type_string, $object_link));
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+));
diff --git a/mod/logbrowser/views/default/logbrowser/form.php b/mod/logbrowser/views/default/logbrowser/form.php
index d2476afac..d5cf9f6b8 100644
--- a/mod/logbrowser/views/default/logbrowser/form.php
+++ b/mod/logbrowser/views/default/logbrowser/form.php
@@ -59,9 +59,12 @@
$toggle_link = elgg_view('output/url', array(
'href' => '#log-browser-search-form',
'text' => elgg_echo('logbrowser:search'),
- 'class' => 'elgg-toggler',
+ 'rel' => 'toggle',
));
?>
+ <p>
+ <?php echo $toggle_link; ?>
+ </p>
<div id="log-browser-search-form" class="elgg-module elgg-module-inline hidden">
<div class="elgg-head">
<h3><?php echo elgg_echo('logbrowser:search'); ?></h3>
@@ -70,7 +73,4 @@
<?php echo $wrappedform; ?>
</div>
</div>
- <p>
- <?php echo $toggle_link; ?>
- </p>
</div> \ No newline at end of file
diff --git a/mod/logrotate/views/default/settings/logrotate/edit.php b/mod/logrotate/views/default/settings/logrotate/edit.php
index 32d59faa5..64c7bf743 100644
--- a/mod/logrotate/views/default/settings/logrotate/edit.php
+++ b/mod/logrotate/views/default/settings/logrotate/edit.php
@@ -36,7 +36,7 @@ if (!$time) {
<?php
echo elgg_view('input/pulldown', array(
- 'internalname' => 'params[time]',
+ 'name' => 'params[time]',
'options_values' => array(
'weekly' => elgg_echo('logrotate:week'),
'monthly' => elgg_echo('logrotate:month'),
diff --git a/mod/members/pages/members/search.php b/mod/members/pages/members/search.php
index 39b54990e..94127768a 100644
--- a/mod/members/pages/members/search.php
+++ b/mod/members/pages/members/search.php
@@ -19,16 +19,16 @@ if ($vars['search_type'] == 'tag') {
$users = $results['entities'];
$content = elgg_view_entity_list($users, $count, $offset, $limit, false, false, true);
} else {
- $name = get_input('name');
+ $name = sanitize_string(get_input('name'));
$title = elgg_echo('members:title:searchname', array($name));
- global $CONFIG;
+ $db_prefix = elgg_get_config('dbprefix');
$params = array(
'type' => 'user',
'full_view' => false,
- 'joins' => array("join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid"),
- 'wheres' => array("(u.name like \"%{$name}%\" or u.username like \"%{$name}%\")"),
+ 'joins' => array("JOIN {$db_prefix}users_entity u ON e.guid=u.guid"),
+ 'wheres' => array("(u.name LIKE \"%{$name}%\" OR u.username LIKE \"%{$name}%\")"),
);
$content .= elgg_list_entities($params);
}
diff --git a/mod/messageboard/languages/en.php b/mod/messageboard/languages/en.php
index d8ccbdeee..9027eb650 100644
--- a/mod/messageboard/languages/en.php
+++ b/mod/messageboard/languages/en.php
@@ -26,10 +26,7 @@ $english = array(
/**
* Message board widget river
*/
- 'messageboard:river:added' => "posted on",
- 'messageboard:river:user' => "%s's",
- 'messageboard:river:messageboard' => "message board",
-
+ 'river:messageboard:user:default' => "%s posted on %s's message board",
/**
* Status messages
diff --git a/mod/messageboard/pages/messageboard/owner.php b/mod/messageboard/pages/messageboard/owner.php
index 58021c29e..241ad64f2 100644
--- a/mod/messageboard/pages/messageboard/owner.php
+++ b/mod/messageboard/pages/messageboard/owner.php
@@ -16,7 +16,8 @@ elgg_push_breadcrumb($page_owner->name, $page_owner->getURL());
$options = array(
'annotations_name' => 'messageboard',
'guid' => $page_owner_guid,
- 'limit' => 10
+ 'limit' => 10,
+ 'reverse_order_by' => true,
);
if ($history_user) {
diff --git a/mod/messageboard/views/default/forms/messageboard/add.php b/mod/messageboard/views/default/forms/messageboard/add.php
index 87bec9b20..b219fd800 100644
--- a/mod/messageboard/views/default/forms/messageboard/add.php
+++ b/mod/messageboard/views/default/forms/messageboard/add.php
@@ -7,7 +7,7 @@
echo elgg_view('input/plaintext', array(
'name' => 'message_content',
- 'class' => 'messageboard-input'
+ 'class' => 'messageboard-input mbs'
));
echo elgg_view('input/hidden', array(
diff --git a/mod/messageboard/views/default/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php
index 0268930bf..975598805 100644
--- a/mod/messageboard/views/default/river/object/messageboard/create.php
+++ b/mod/messageboard/views/default/river/object/messageboard/create.php
@@ -3,22 +3,9 @@
* Messageboard river view
*/
-$performed_by = $vars['item']->getSubjectEntity();
-$performed_on = $vars['item']->getObjectEntity();
+$messageboard = $vars['item']->getAnnotation();
-$comment = $vars['item']->getAnnotation();
-
-$link = elgg_view('output/url', array(
- 'href' => $performed_on->getURL(),
- 'text' => elgg_echo('messageboard:river:user', array($performed_on->name)),
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $messageboard->value,
));
-
-echo elgg_echo("messageboard:river:added");
-echo " $link ";
-echo elgg_echo("messageboard:river:messageboard");
-
-if ($comment) {
- echo '<div class="elgg-river-content">';
- echo elgg_get_excerpt($comment->value);
- echo '</div>';
-}
diff --git a/mod/messages/pages/messages/read.php b/mod/messages/pages/messages/read.php
index c5d1d4941..9bedbd08a 100644
--- a/mod/messages/pages/messages/read.php
+++ b/mod/messages/pages/messages/read.php
@@ -27,11 +27,11 @@ if ($page_owner->getGUID() == $message->toId) {
elgg_push_breadcrumb($title);
$buttons = '';
-$content = elgg_view_entity($message, true);
+$content = elgg_view_entity($message, array('full_view' => true));
if ($inbox) {
$form_params = array(
'id' => 'messages-reply-form',
- 'class' => 'hidden',
+ 'class' => 'hidden mtl',
'action' => 'action/messages/send',
);
$body_params = array('message' => $message);
diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php
index f590afb9c..1c6d0318c 100644
--- a/mod/pages/languages/en.php
+++ b/mod/pages/languages/en.php
@@ -38,13 +38,12 @@ $english = array(
* River
**/
- 'pages:river:create' => 'created the page',
- 'pages:river:created' => "%s wrote",
- 'pages:river:updated' => "%s updated",
- 'pages:river:posted' => "%s posted",
- 'pages:river:update' => "a page titled",
- 'river:commented:object:page' => 'the page',
- 'river:commented:object:page_top' => 'the page',
+ 'river:create:object:page' => '%s created a page %s',
+ 'river:create:object:page_top' => '%s created a page %s',
+ 'river:update:object:page' => '%s updated a page %s',
+ 'river:update:object:page_top' => '%s updated a page %s',
+ 'river:comment:object:page' => '%s commented on a page titled %s',
+ 'river:comment:object:page_top' => '%s commented on a page titled %s',
/**
* Form fields
diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php
index b73bc985c..06064d993 100644
--- a/mod/pages/pages/pages/view.php
+++ b/mod/pages/pages/pages/view.php
@@ -29,7 +29,7 @@ if (elgg_instanceof($container, 'group')) {
pages_prepare_parent_breadcrumbs($page);
elgg_push_breadcrumb($title);
-$content = elgg_view_entity($page, true);
+$content = elgg_view_entity($page, array('full_view' => true));
$content .= elgg_view_comments($page);
$buttons = '';
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index 2ad44e38c..8ba9fc298 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -82,6 +82,7 @@ if ($full) {
'subtitle' => $subtitle,
'tags' => $tags,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$info = elgg_view_image_block($page_icon, $list_body);
@@ -103,6 +104,7 @@ HTML;
'tags' => $tags,
'content' => $excerpt,
);
+ $params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($page_icon, $list_body);
diff --git a/mod/pages/views/default/pages/group_module.php b/mod/pages/views/default/pages/group_module.php
index 1d3437e18..7e2656ca3 100644
--- a/mod/pages/views/default/pages/group_module.php
+++ b/mod/pages/views/default/pages/group_module.php
@@ -17,9 +17,6 @@ $all_link = elgg_view('output/url', array(
'text' => elgg_echo('link:view:all'),
));
-$header = "<span class=\"groups-widget-viewall\">$all_link</span>";
-$header .= '<h3>' . elgg_echo('pages:group') . '</h3>';
-
elgg_push_context('widgets');
$options = array(
@@ -37,12 +34,14 @@ if (!$content) {
$content = '<p>' . elgg_echo('pages:none') . '</p>';
}
-if ($group->canWriteToContainer()) {
- $new_link = elgg_view('output/url', array(
- 'href' => "pages/add/$group->guid",
- 'text' => elgg_echo('pages:add'),
- ));
- $content .= "<span class='elgg-widget-more'>$new_link</span>";
-}
+$new_link = elgg_view('output/url', array(
+ 'href' => "pages/add/$group->guid",
+ 'text' => elgg_echo('pages:add'),
+));
-echo elgg_view_module('info', '', $content, array('header' => $header));
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('pages:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+));
diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php
index 032046063..ca15ddea7 100644
--- a/mod/pages/views/default/river/object/page/create.php
+++ b/mod/pages/views/default/river/object/page/create.php
@@ -7,29 +7,7 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
-
-$group_string = '';
-$container = $object->getContainerEntity();
-if ($container instanceof ElggGroup) {
- $params = array(
- 'href' => $container->getURL(),
- 'text' => $container->name,
- );
- $group_link = elgg_view('output/url', $params);
- $group_string = elgg_echo('river:ingroup', array($group_link));
-}
-
-echo elgg_echo('pages:river:create');
-
-echo " $link $group_string";
-
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+)); \ No newline at end of file
diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php
index 48d7ff24f..5a65a3a26 100644
--- a/mod/profile/views/default/profile/owner_block.php
+++ b/mod/profile/views/default/profile/owner_block.php
@@ -35,7 +35,7 @@ if (elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != elgg_get_page
$text = elgg_echo('admin:options');
$admin_links = '<ul class="profile-admin-menu-wrapper">';
- $admin_links .= "<li><a class=\"elgg-toggler\" href=\"#profile-menu-admin\">$text&hellip;</a>";
+ $admin_links .= "<li><a rel=\"toggle\" href=\"#profile-menu-admin\">$text&hellip;</a>";
$admin_links .= '<ul class="profile-admin-menu" id="profile-menu-admin">';
foreach ($admin as $menu_item) {
$admin_links .= elgg_view('navigation/menu/elements/item', array('item' => $menu_item));
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
index b8c443450..6bcbf6e5d 100644
--- a/mod/reportedcontent/views/default/object/reported_content.php
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -58,7 +58,7 @@ if ($report->state == 'archived') {
<?php echo elgg_view('output/url', array(
'href' => "#report-$report->guid",
'text' => elgg_echo('reportedcontent:moreinfo'),
- 'class' => "elgg-toggler",
+ 'rel' => "toggle",
));
?>
</p>
diff --git a/mod/search/views/default/search/entity.php b/mod/search/views/default/search/entity.php
index 2193a70d8..e04d08836 100644
--- a/mod/search/views/default/search/entity.php
+++ b/mod/search/views/default/search/entity.php
@@ -27,7 +27,7 @@ if (!$icon) {
} else {
// display a generic icon if no owner, though there will probably be
// other problems if the owner can't be found.
- $icon = elgg_view_entity($entity, 'tiny');
+ $icon = elgg_view_entity_icon($entity, 'tiny');
}
}
diff --git a/mod/search/views/default/search/list.php b/mod/search/views/default/search/list.php
index c5afaaa86..11860c094 100644
--- a/mod/search/views/default/search/list.php
+++ b/mod/search/views/default/search/list.php
@@ -82,7 +82,7 @@ $more = ($more_check > 0) ? $more_check : 0;
if ($more) {
$title_key = ($more == 1) ? 'comment' : 'comments';
$more_str = elgg_echo('search:more', array($count, $type_str));
- $more_link = "<li class='elgg-list-item'><a href=\"$url\">$more_str</a></li>";
+ $more_link = "<li class='elgg-item'><a href=\"$url\">$more_str</a></li>";
} else {
$more_link = '';
}
@@ -98,7 +98,7 @@ if ($view) {
$body .= '<ul class="elgg-list search-list">';
foreach ($entities as $entity) {
$id = "elgg-{$entity->getType()}-{$entity->getGUID()}";
- $body .= "<li id=\"$id\" class=\"elgg-list-item\">";
+ $body .= "<li id=\"$id\" class=\"elgg-item\">";
$body .= elgg_view($view, array(
'entity' => $entity,
'params' => $vars['params'],
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php
index 1b9d71c56..9716fc060 100644
--- a/mod/thewire/languages/en.php
+++ b/mod/thewire/languages/en.php
@@ -13,7 +13,7 @@ $english = array(
'thewire:user' => "%s's wire posts",
'thewire:friends' => "Friends' wire posts",
'thewire:reply' => "Reply",
- 'thewire:replying' => "Replying to %s who wrote",
+ 'thewire:replying' => "Replying to %s (@%s) who wrote",
'thewire:thread' => "Thread",
'thewire:charleft' => "characters remaining",
'thewire:tags' => "Wire posts tagged with '%s'",
@@ -29,7 +29,8 @@ $english = array(
/**
* The wire river
*/
- 'thewire:river:create' => "posted to the wire",
+ 'river:create:object:thewire' => "%s posted to the %s",
+ 'thewire:wire' => 'wire',
/**
* Wire widget
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index 0e6bd7794..9d3993b6f 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -278,6 +278,16 @@ function thewire_save_post($text, $userid, $access_id, $parent_guid = 0, $method
if ($guid) {
add_to_river('river/object/thewire/create', 'create', $post->owner_guid, $post->guid);
+
+ // let other plugins know we are setting a user status
+ $params = array(
+ 'entity' => $post,
+ 'user' => $post->getOwnerEntity(),
+ 'message' => $post->description,
+ 'url' => $post->getURL(),
+ 'origin' => 'thewire',
+ );
+ elgg_trigger_plugin_hook('status', 'user', $params);
}
return $guid;
@@ -401,7 +411,7 @@ function thewire_setup_entity_menu_items($hook, $type, $value, $params) {
'text' => elgg_echo('thewire:previous'),
'href' => "thewire/previous/$entity->guid",
'priority' => 160,
- 'class' => 'thewire-previous',
+ 'link_class' => 'thewire-previous',
'title' => elgg_echo('thewire:previous:help'),
);
$value[] = ElggMenuItem::factory($options);
diff --git a/mod/thewire/views/default/js/thewire.php b/mod/thewire/views/default/js/thewire.php
index 1eda90bee..d9bf6d10e 100644
--- a/mod/thewire/views/default/js/thewire.php
+++ b/mod/thewire/views/default/js/thewire.php
@@ -30,7 +30,7 @@ elgg.thewire.init = function() {
*/
elgg.thewire.textCounter = function(textarea, status, limit) {
- var remaining_chars = limit - textarea.value.length;
+ var remaining_chars = limit - $(textarea).val().length;
status.html(remaining_chars);
if (remaining_chars < 0) {
@@ -83,4 +83,4 @@ elgg.thewire.viewPrevious = function(event) {
event.preventDefault();
}
-elgg.register_hook_handler('init', 'system', elgg.thewire.init); \ No newline at end of file
+elgg.register_hook_handler('init', 'system', elgg.thewire.init);
diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php
index 3ae347711..2727df60d 100644
--- a/mod/thewire/views/default/object/thewire.php
+++ b/mod/thewire/views/default/object/thewire.php
@@ -51,6 +51,7 @@ $params = array(
'content' => thewire_filter($post->description),
'tags' => false,
);
+$params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($owner_icon, $list_body);
diff --git a/mod/thewire/views/default/river/object/thewire/create.php b/mod/thewire/views/default/river/object/thewire/create.php
index d4dac38ee..c3c434858 100644
--- a/mod/thewire/views/default/river/object/thewire/create.php
+++ b/mod/thewire/views/default/river/object/thewire/create.php
@@ -7,18 +7,23 @@ $object = $vars['item']->getObjectEntity();
$excerpt = strip_tags($object->description);
$excerpt = thewire_filter($excerpt);
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->title,
-);
-$link = elgg_view('output/url', $params);
+$subject = $vars['item']->getSubjectEntity();
+$subject_link = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+));
-echo elgg_echo('thewire:river:create');
+$object_link = elgg_view('output/url', array(
+ 'href' => "thewire/owner/$subject->username",
+ 'text' => elgg_echo('thewire:wire'),
+ 'class' => 'elgg-river-object',
+));
-echo " $link";
+$summary = elgg_echo("river:create:object:thewire", array($subject_link, $object_link));
-if ($excerpt) {
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $excerpt,
+ 'summary' => $summary,
+)); \ No newline at end of file
diff --git a/mod/thewire/views/default/thewire/reply.php b/mod/thewire/views/default/thewire/reply.php
index 3794e1454..341b691b1 100644
--- a/mod/thewire/views/default/thewire/reply.php
+++ b/mod/thewire/views/default/thewire/reply.php
@@ -5,7 +5,10 @@
$post = $vars['post'];
$poster = $post->getOwnerEntity();
-
+$poster_details = array(
+ htmlspecialchars($poster->name, ENT_QUOTES, 'UTF-8'),
+ htmlspecialchars($poster->username, ENT_QUOTES, 'UTF-8'),
+);
?>
-<b><?php echo elgg_echo('thewire:replying', array($poster->name)); ?>: </b>
+<b><?php echo elgg_echo('thewire:replying', $poster_details); ?>: </b>
<?php echo $post->description; \ No newline at end of file
diff --git a/mod/twitter/views/default/twitter/css.php b/mod/twitter/views/default/twitter/css.php
index cb58e8fb1..eb0cda98a 100644
--- a/mod/twitter/views/default/twitter/css.php
+++ b/mod/twitter/views/default/twitter/css.php
@@ -54,7 +54,7 @@ p.twitter_username .input-text {
padding:2px;
margin:0 0 5px 0;
}
-#twitter_widget li a {
+#twitter_widget li > a {
display:block;
margin:0 0 0 4px;
}
diff --git a/mod/twitter_api/graphics/sign-in-with-twitter-d.png b/mod/twitter_api/graphics/sign-in-with-twitter-d.png
new file mode 100644
index 000000000..b49a0ba59
--- /dev/null
+++ b/mod/twitter_api/graphics/sign-in-with-twitter-d.png
Binary files differ
diff --git a/mod/twitter_api/graphics/sign-in-with-twitter-l.png b/mod/twitter_api/graphics/sign-in-with-twitter-l.png
new file mode 100644
index 000000000..834d43cfd
--- /dev/null
+++ b/mod/twitter_api/graphics/sign-in-with-twitter-l.png
Binary files differ
diff --git a/mod/twitter_api/languages/en.php b/mod/twitter_api/languages/en.php
index 940a49d9b..3a422b043 100644
--- a/mod/twitter_api/languages/en.php
+++ b/mod/twitter_api/languages/en.php
@@ -11,7 +11,7 @@ $english = array(
'twitter_api:consumer_key' => 'Consumer Key',
'twitter_api:consumer_secret' => 'Consumer Secret',
- 'twitter_api:settings:instructions' => 'You must obtain a consumer key and secret from <a href="https://twitter.com/oauth_clients" target="_blank">Twitter</a>. Most of the fields are self explanatory, the one piece of data you will need is the callback url which takes the form http://[yoursite]/action/twitterlogin/return - [yoursite] is the url of your Elgg network.',
+ 'twitter_api:settings:instructions' => 'You must obtain a consumer key and secret from <a href="https://dev.twitter.com/apps/new" target="_blank">Twitter</a>. Fill out the new app application. Select "Browser" as the application type and "Read & Write" for the access type. The callback url is %stwitter_api/authorize',
'twitter_api:usersettings:description' => "Link your %s account with Twitter.",
'twitter_api:usersettings:request' => "You must first <a href=\"%s\">authorize</a> %s to access your Twitter account.",
diff --git a/mod/twitter_api/lib/twitter_api.php b/mod/twitter_api/lib/twitter_api.php
index 0621c2b13..81aef38fb 100644
--- a/mod/twitter_api/lib/twitter_api.php
+++ b/mod/twitter_api/lib/twitter_api.php
@@ -24,9 +24,9 @@ function twitter_api_allow_sign_on_with_twitter() {
}
/**
- * Forwards
+ * Forwards the user to twitter to authenticate
*
- * @todo what is this?
+ * This includes the login URL as the callback
*/
function twitter_api_forward() {
// sanity check
@@ -41,7 +41,18 @@ function twitter_api_forward() {
}
/**
- * Log in a user with twitter.
+ * Log in a user referred from Twitter's OAuth API
+ *
+ * If the user has already linked their account with Twitter, it is a seamless
+ * login. If this is a first time login (or a user from deprecated twitter login
+ * plugin), we create a new account (update the account).
+ *
+ * If a plugin wants to be notified when someone logs in with twitter or a new
+ * twitter user signs up, register for the standard login or create user events
+ * and check for 'twitter_api' context.
+ *
+ * The user has to be redirected from Twitter for this to work. It depends on
+ * the Twitter OAuth data.
*/
function twitter_api_login() {
@@ -64,32 +75,26 @@ function twitter_api_login() {
'access_key' => $token['oauth_token'],
'access_secret' => $token['oauth_token_secret'],
),
- 'limit' => 0
+ 'limit' => 0,
);
$users = elgg_get_entities_from_plugin_user_settings($options);
if ($users) {
if (count($users) == 1 && login($users[0])) {
- system_message(elgg_echo('twitter_api:login:success'));
-
- // trigger login hook
- elgg_trigger_plugin_hook('login', 'twitter_api', array('user' => $users[0]));
+ system_message(elgg_echo('twitter_api:login:success'));
} else {
- system_message(elgg_echo('twitter_api:login:error'));
+ register_error(elgg_echo('twitter_api:login:error'));
}
-
- forward();
- } else {
- // need Twitter account credentials
- elgg_load_library('twitter_oauth');
+ forward(elgg_get_site_url());
+ } else {
$consumer_key = elgg_get_plugin_setting('consumer_key', 'twitter_api');
$consumer_secret = elgg_get_plugin_setting('consumer_secret', 'twitter_api');
$api = new TwitterOAuth($consumer_key, $consumer_secret, $token['oauth_token'], $token['oauth_token_secret']);
$twitter = $api->get('account/verify_credentials');
- // backward compatibility for stalled-development Twitter Login plugin
+ // backward compatibility for deprecated Twitter Login plugin
$user = FALSE;
if ($twitter_user = get_user_by_username($token['screen_name'])) {
if (($screen_name = $twitter_user->twitter_screen_name) && ($screen_name == $token['screen_name'])) {
@@ -101,47 +106,9 @@ function twitter_api_login() {
// create new user
if (!$user) {
- // check new registration allowed
- if (!twitter_api_allow_new_users_with_twitter()) {
- register_error(elgg_echo('registerdisabled'));
- forward();
- }
-
- // trigger a hook for plugin authors to intercept
- if (!elgg_trigger_plugin_hook('new_twitter_user', 'twitter_service', array('account' => $twitter), TRUE)) {
- // halt execution
- register_error(elgg_echo('twitter_api:login:error'));
- forward();
- }
-
- // Elgg-ify Twitter credentials
- $username = $twitter->screen_name;
- while (get_user_by_username($username)) {
- $username = $twitter->screen_name . '_' . rand(1000, 9999);
- }
-
- $password = generate_random_cleartext_password();
- $name = $twitter->name;
-
- $user = new ElggUser();
- $user->username = $username;
- $user->name = $name;
- $user->access_id = ACCESS_PUBLIC;
- $user->salt = generate_random_cleartext_password();
- $user->password = generate_user_password($user, $password);
- $user->owner_guid = 0;
- $user->container_guid = 0;
-
- if (!$user->save()) {
- register_error(elgg_echo('registerbad'));
- forward();
- }
-
- // @todo require email address?
-
+ $user = twitter_api_create_user($twitter);
$site_name = elgg_get_site_entity()->name;
system_message(elgg_echo('twitter_api:login:email', array($site_name)));
-
$forward = "settings/user/{$user->username}";
}
@@ -156,9 +123,6 @@ function twitter_api_login() {
// login new user
if (login($user)) {
system_message(elgg_echo('twitter_api:login:success'));
-
- // trigger login hook for new user
- elgg_trigger_plugin_hook('first_login', 'twitter_api', array('user' => $user));
} else {
system_message(elgg_echo('twitter_api:login:error'));
}
@@ -172,10 +136,50 @@ function twitter_api_login() {
}
/**
+ * Create a new user from Twitter information
+ *
+ * @param object $twitter Twitter OAuth response
+ * @return ElggUser
+ */
+function twitter_api_create_user($twitter) {
+ // check new registration allowed
+ if (!twitter_api_allow_new_users_with_twitter()) {
+ register_error(elgg_echo('registerdisabled'));
+ forward();
+ }
+
+ // Elgg-ify Twitter credentials
+ $username = $twitter->screen_name;
+ while (get_user_by_username($username)) {
+ // @todo I guess we just hope this is good enough
+ $username = $twitter->screen_name . '_' . rand(1000, 9999);
+ }
+
+ $password = generate_random_cleartext_password();
+ $name = $twitter->name;
+
+ $user = new ElggUser();
+ $user->username = $username;
+ $user->name = $name;
+ $user->access_id = ACCESS_PUBLIC;
+ $user->salt = generate_random_cleartext_password();
+ $user->password = generate_user_password($user, $password);
+ $user->owner_guid = 0;
+ $user->container_guid = 0;
+
+ if (!$user->save()) {
+ register_error(elgg_echo('registerbad'));
+ forward();
+ }
+
+ return $user;
+}
+
+/**
* Pull in the latest avatar from twitter.
*
- * @param unknown_type $user
- * @param unknown_type $file_location
+ * @param ElggUser $user
+ * @param string $file_location
*/
function twitter_api_update_user_avatar($user, $file_location) {
// twitter's images have a few suffixes:
@@ -213,8 +217,6 @@ function twitter_api_update_user_avatar($user, $file_location) {
// update user's icontime
$user->icontime = time();
-
- return TRUE;
}
/**
@@ -243,7 +245,6 @@ function twitter_api_authorize() {
),
'limit' => 0
);
-
$users = elgg_get_entities_from_plugin_user_settings($options);
if ($users) {
@@ -281,13 +282,12 @@ function twitter_api_revoke() {
}
/**
- * Returns the url to authorize a user.
+ * Gets the url to authorize a user.
*
* @param string $callback The callback URL
*/
-function twitter_api_get_authorize_url($callback = NULL) {
+function twitter_api_get_authorize_url($callback = NULL, $login = true) {
global $SESSION;
- elgg_load_library('twitter_oauth');
$consumer_key = elgg_get_plugin_setting('consumer_key', 'twitter_api');
$consumer_secret = elgg_get_plugin_setting('consumer_secret', 'twitter_api');
@@ -302,7 +302,7 @@ function twitter_api_get_authorize_url($callback = NULL) {
'oauth_token_secret' => $token['oauth_token_secret'],
);
- return $twitter->getAuthorizeURL($token['oauth_token']);
+ return $twitter->getAuthorizeURL($token['oauth_token'], $login);
}
/**
@@ -312,7 +312,6 @@ function twitter_api_get_authorize_url($callback = NULL) {
*/
function twitter_api_get_access_token($oauth_verifier = FALSE) {
global $SESSION;
- elgg_load_library('twitter_oauth');
$consumer_key = elgg_get_plugin_setting('consumer_key', 'twitter_api');
$consumer_secret = elgg_get_plugin_setting('consumer_secret', 'twitter_api');
diff --git a/mod/twitter_api/start.php b/mod/twitter_api/start.php
index 8a49db719..0c71104b5 100644
--- a/mod/twitter_api/start.php
+++ b/mod/twitter_api/start.php
@@ -12,14 +12,14 @@ function twitter_api_init() {
// require libraries
$base = elgg_get_plugins_path() . 'twitter_api';
- elgg_register_library('twitter_oauth', "$base/vendors/twitteroauth/twitterOAuth.php");
+ elgg_register_class('TwitterOAuth', "$base/vendors/twitteroauth/twitterOAuth.php");
elgg_register_library('twitter_api', "$base/lib/twitter_api.php");
-
elgg_load_library('twitter_api');
// extend site views
- elgg_extend_view('metatags', 'twitter_api/metatags');
- elgg_extend_view('css', 'twitter_api/css');
+ //elgg_extend_view('metatags', 'twitter_api/metatags');
+ elgg_extend_view('css/elgg', 'twitter_api/css');
+ elgg_extend_view('css/admin', 'twitter_api/css');
// sign on with twitter
if (twitter_api_allow_sign_on_with_twitter()) {
@@ -34,14 +34,14 @@ function twitter_api_init() {
// register Walled Garden public pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'twitter_api_public_pages');
- // allow plugin authors to hook into this service
- elgg_register_plugin_hook_handler('tweet', 'twitter_service', 'twitter_api_tweet');
+ // push status messages to twitter
+ elgg_register_plugin_hook_handler('status', 'user', 'twitter_api_tweet');
}
/**
* Handles old pg/twitterservice/ handler
*
- * @param array$page
+ * @param array $page
*/
function twitter_api_pagehandler_deprecated($page) {
$url = elgg_get_site_url() . 'pg/twitter_api/authorize';
@@ -55,7 +55,7 @@ function twitter_api_pagehandler_deprecated($page) {
/**
* Serves pages for twitter.
*
- * @param array$page
+ * @param array $page
*/
function twitter_api_pagehandler($page) {
if (!isset($page[0])) {
@@ -82,53 +82,48 @@ function twitter_api_pagehandler($page) {
}
/**
- * Push a tweet to twitter.
+ * Push a status update to twitter.
*
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $returnvalue
- * @param unknown_type $params
+ * @param string $hook
+ * @param string $type
+ * @param null $returnvalue
+ * @param array $params
*/
-function twitter_api_tweet($hook, $entity_type, $returnvalue, $params) {
- static $plugins;
- if (!$plugins) {
- $plugins = elgg_trigger_plugin_hook('plugin_list', 'twitter_service', NULL, array());
- }
+function twitter_api_tweet($hook, $type, $returnvalue, $params) {
- // ensure valid plugin
- if (!in_array($params['plugin'], $plugins)) {
- return NULL;
+ if (!elgg_instanceof($params['user'])) {
+ return;
}
+ // @todo - allow admin to select origins?
+
// check admin settings
$consumer_key = elgg_get_plugin_setting('consumer_key', 'twitter_api');
$consumer_secret = elgg_get_plugin_setting('consumer_secret', 'twitter_api');
if (!($consumer_key && $consumer_secret)) {
- return NULL;
+ return;
}
// check user settings
- $user_id = elgg_get_logged_in_user_guid();
+ $user_id = $params['user']->getGUID();
$access_key = elgg_get_plugin_user_setting('access_key', $user_id, 'twitter_api');
$access_secret = elgg_get_plugin_user_setting('access_secret', $user_id, 'twitter_api');
if (!($access_key && $access_secret)) {
- return NULL;
+ return;
}
// send tweet
$api = new TwitterOAuth($consumer_key, $consumer_secret, $access_key, $access_secret);
$response = $api->post('statuses/update', array('status' => $params['message']));
-
- return TRUE;
}
/**
- * Return tweets for a user.
+ * Get tweets for a user.
*
- * @param int $user_id The Elgg user GUID
+ * @param int $user_id The Elgg user GUID
* @param array $options
*/
-function twitter_api_fetch_tweets($user_guid, $options=array()) {
+function twitter_api_fetch_tweets($user_guid, $options = array()) {
// check admin settings
$consumer_key = elgg_get_plugin_setting('consumer_key', 'twitter_api');
$consumer_secret = elgg_get_plugin_setting('consumer_secret', 'twitter_api');
@@ -151,10 +146,10 @@ function twitter_api_fetch_tweets($user_guid, $options=array()) {
/**
* Register as public pages for walled garden.
*
- * @param unknown_type $hook
- * @param unknown_type $type
- * @param unknown_type $return_value
- * @param unknown_type $params
+ * @param string $hook
+ * @param string $type
+ * @param array $return_value
+ * @param array $params
*/
function twitter_api_public_pages($hook, $type, $return_value, $params) {
$return_value[] = 'twitter_api/forward';
diff --git a/mod/twitter_api/views/default/settings/twitter_api/edit.php b/mod/twitter_api/views/default/settings/twitter_api/edit.php
index 9deac3989..4e52a5c9d 100644
--- a/mod/twitter_api/views/default/settings/twitter_api/edit.php
+++ b/mod/twitter_api/views/default/settings/twitter_api/edit.php
@@ -1,8 +1,9 @@
<?php
/**
- *
+ * Twitter API plugin settings
*/
-$insert_view = elgg_view('twittersettings/extend');
+
+$instructions = elgg_echo('twitter_api:settings:instructions', array(elgg_get_site_url()));
$consumer_key_string = elgg_echo('twitter_api:consumer_key');
$consumer_key_view = elgg_view('input/text', array(
@@ -15,7 +16,7 @@ $consumer_secret_string = elgg_echo('twitter_api:consumer_secret');
$consumer_secret_view = elgg_view('input/text', array(
'name' => 'params[consumer_secret]',
'value' => $vars['entity']->consumer_secret,
- 'class' => 'text_input',
+ 'class' => 'text_input twitter-secret',
));
$sign_on_with_twitter_string = elgg_echo('twitter_api:login');
@@ -39,9 +40,9 @@ $new_users_with_twitter_view = elgg_view('input/dropdown', array(
));
$settings = <<<__HTML
-<div>$insert_view</div>
-<div>$consumer_key_string $consumer_key_view</div>
-<div>$consumer_secret_string $consumer_secret_view</div>
+<div class="elgg-instructs mtm"><p>$instructions</p></div>
+<div><label>$consumer_key_string</label><br /> $consumer_key_view</div>
+<div><label>$consumer_secret_string</label><br /> $consumer_secret_view</div>
<div>$sign_on_with_twitter_string $sign_on_with_twitter_view</div>
<div>$new_users_with_twitter $new_users_with_twitter_view</div>
__HTML;
diff --git a/mod/twitter_api/views/default/twitter_api/css.php b/mod/twitter_api/views/default/twitter_api/css.php
index 140ce6a52..04bbed668 100644
--- a/mod/twitter_api/views/default/twitter_api/css.php
+++ b/mod/twitter_api/views/default/twitter_api/css.php
@@ -4,9 +4,10 @@
*/
?>
-#twitter_api_site_settings .text_input {
- width: 350px;
-}
#login_with_twitter {
padding: 10px 0 0 0;
}
+
+.twitter-secret {
+ width: 400px;
+} \ No newline at end of file
diff --git a/mod/twitter_api/views/default/twitter_api/login.php b/mod/twitter_api/views/default/twitter_api/login.php
index d0aca87ac..17bd76d56 100644
--- a/mod/twitter_api/views/default/twitter_api/login.php
+++ b/mod/twitter_api/views/default/twitter_api/login.php
@@ -1,10 +1,10 @@
<?php
/**
- *
+ * Extension of login form for Twitter sign in
*/
$url = elgg_get_site_url() . 'twitter_api/forward';
-$img_url = elgg_get_site_url() . 'mod/twitter_api/graphics/sign_in_with_twitter.gif';
+$img_url = elgg_get_site_url() . 'mod/twitter_api/graphics/sign-in-with-twitter-d.png';
$login = <<<__HTML
<div id="login_with_twitter">
diff --git a/mod/twitter_api/views/default/usersettings/twitter_api/edit.php b/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
index 77dd5cc5d..0898087ca 100644
--- a/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
+++ b/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
@@ -1,6 +1,6 @@
<?php
/**
- *
+ * User settings for Twitter API
*/
$user_id = elgg_get_logged_in_user_guid();
@@ -13,7 +13,7 @@ echo '<div>' . elgg_echo('twitter_api:usersettings:description', array($site_nam
if (!$access_key || !$access_secret) {
// send user off to validate account
- $request_link = twitter_api_get_authorize_url();
+ $request_link = twitter_api_get_authorize_url(null, false);
echo '<div>' . elgg_echo('twitter_api:usersettings:request', array($request_link, $site_name)) . '</div>';
} else {
$url = elgg_get_site_url() . "twitter_api/revoke";
diff --git a/pages/entities/index.php b/pages/entities/index.php
index 13aea9e5a..d3b935dc4 100644
--- a/pages/entities/index.php
+++ b/pages/entities/index.php
@@ -36,7 +36,7 @@ if ($entity = get_entity($guid)) {
} else if ($entity instanceof ElggEntity) {
$title = $entity->name;
}
- $area1 = elgg_view_entity($entity, true);
+ $area1 = elgg_view_entity($entity, array('full_view' => true));
if ($shell) {
$body = elgg_view_layout('one_column', array('content' => $area1));
} else {
diff --git a/vendors/markdown/License.text b/vendors/markdown/License.text
index 4d6bf8b63..4d6bf8b63 100755..100644
--- a/vendors/markdown/License.text
+++ b/vendors/markdown/License.text
diff --git a/vendors/markdown/PHP Markdown Extra Readme.text b/vendors/markdown/PHP Markdown Extra Readme.text
index b72ee998e..b72ee998e 100755..100644
--- a/vendors/markdown/PHP Markdown Extra Readme.text
+++ b/vendors/markdown/PHP Markdown Extra Readme.text
diff --git a/vendors/markdown/markdown.php b/vendors/markdown/markdown.php
index 3f1f3a715..3f1f3a715 100755..100644
--- a/vendors/markdown/markdown.php
+++ b/vendors/markdown/markdown.php
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index a4d413781..d7c154438 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -383,7 +383,7 @@ table.mceLayout {
margin-left: 5px;
}
-.elgg-list-item {
+.elgg-item {
margin: 3px;
}
.elgg-menu-metadata {
@@ -1102,6 +1102,10 @@ a.elgg-widget-collapsed:before {
ADMIN MISC
*************************************** */
+.elgg-instructs {
+ max-width: 600px;
+}
+
.manifest_file {
background-color:#eee;
diff --git a/views/default/css/elements/components.php b/views/default/css/elements/components.php
index 0fcbe3619..3f30a6422 100644
--- a/views/default/css/elements/components.php
+++ b/views/default/css/elements/components.php
@@ -47,10 +47,10 @@
border-bottom: 1px dotted #CCCCCC;
}
-.elgg-list-item .elgg-subtext {
+.elgg-item .elgg-subtext {
margin-bottom: 5px;
}
-.elgg-list-content {
+.elgg-item .elgg-content {
margin: 10px 5px;
}
@@ -65,9 +65,12 @@
.elgg-gallery td {
padding: 5px;
}
-.elgg-gallery-fluid li {
+.elgg-gallery-fluid > li {
float: left;
}
+.elgg-gallery-users > li {
+ margin: 0 2px;
+}
/* ***************************************
Tables
@@ -161,6 +164,9 @@
font-style: italic;
line-height: 1.2em;
}
+
+.elgg-river-attachments,
+.elgg-river-message,
.elgg-river-content {
border-left: 1px solid #CCC;
font-size: 85%;
diff --git a/views/default/css/elements/core.php b/views/default/css/elements/core.php
index 61dcdb1fe..af4a1882a 100644
--- a/views/default/css/elements/core.php
+++ b/views/default/css/elements/core.php
@@ -96,9 +96,6 @@
.elgg-menu-hz > li > span {
/* Google says do this, but why? */
position: relative;
-
- /* FF2 */
- display: -moz-inline-box;
display: inline-block;
@@ -106,6 +103,3 @@
zoom: 1;
*display: inline;
}
-
-/* Looks much better when middle-aligned with surrounding text */
-.elgg-icon {vertical-align:middle} \ No newline at end of file
diff --git a/views/default/css/elements/layout.php b/views/default/css/elements/layout.php
index 4d87b8824..42d898439 100644
--- a/views/default/css/elements/layout.php
+++ b/views/default/css/elements/layout.php
@@ -75,9 +75,6 @@
.elgg-layout {
min-height: 360px;
}
-.elgg-layout-one-column {
- padding: 10px 0;
-}
.elgg-layout-one-sidebar {
background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/sidebar_background.gif) repeat-y right top;
}
diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php
index 99de0867b..64b7c47b4 100644
--- a/views/default/css/elements/navigation.php
+++ b/views/default/css/elements/navigation.php
@@ -144,6 +144,11 @@
float: right;
}
+.elgg-menu-topbar .elgg-icon {
+ vertical-align: middle;
+ margin-top: -1px;
+}
+
.elgg-menu-topbar > li > a.elgg-topbar-logo {
margin-top: 0;
padding-left: 5px;
@@ -421,20 +426,27 @@ li:hover > .elgg-menu-site-more {
/* ***************************************
ENTITY
*************************************** */
+<?php // height depends on line height/font size ?>
.elgg-menu-entity {
float: right;
margin-left: 15px;
font-size: 90%;
color: #aaa;
+ line-height: 16px;
+ height: 16px;
}
.elgg-menu-entity > li {
- display: inline-block;
margin-left: 15px;
}
-<?php // height depends on line height/font size ?>
.elgg-menu-entity > li > a {
color: #aaa;
- height: 18px;
+}
+<?php // need to override .elgg-menu-hz ?>
+.elgg-menu-entity > li > a {
+ display: block;
+}
+.elgg-menu-entity > li > span {
+ vertical-align: baseline;
}
/* ***************************************
@@ -476,11 +488,24 @@ li:hover > .elgg-menu-site-more {
margin-left: 15px;
font-size: 90%;
color: #aaa;
+ line-height: 16px;
+ height: 16px;
}
.elgg-menu-river > li {
display: inline-block;
margin-left: 5px;
}
+.elgg-menu-river > li > a {
+ color: #aaa;
+ height: 16px;
+}
+<?php // need to override .elgg-menu-hz ?>
+.elgg-menu-river > li > a {
+ display: block;
+}
+.elgg-menu-river > li > span {
+ vertical-align: baseline;
+}
/* ***************************************
SIDEBAR EXTRAS (rss, bookmark, etc)
diff --git a/views/default/css/elgg.php b/views/default/css/elgg.php
index 675af860d..4960e6ade 100644
--- a/views/default/css/elgg.php
+++ b/views/default/css/elgg.php
@@ -26,13 +26,12 @@ if ($old_css_view != elgg_get_config('viewpath')) {
Base CSS
* CSS reset
* core
- * helpers
+ * helpers (moved to end to have a higher priority)
* grid
*******************************************************************************/
echo elgg_view('css/elements/reset', $vars);
echo elgg_view('css/elements/core', $vars);
-echo elgg_view('css/elements/helpers', $vars);
echo elgg_view('css/elements/grid', $vars);
@@ -61,5 +60,9 @@ echo elgg_view('css/elements/layout', $vars);
echo elgg_view('css/elements/misc', $vars);
+// included last to have higher priority
+echo elgg_view('css/elements/helpers', $vars);
+
+
// in case plugins are still extending the old 'css' view, display it
echo elgg_view('css', $vars);
diff --git a/views/default/object/default.php b/views/default/object/default.php
index 27bb1890e..a50f19387 100644
--- a/views/default/object/default.php
+++ b/views/default/object/default.php
@@ -42,6 +42,7 @@ $params = array(
'subtitle' => $subtitle,
'tags' => $vars['entity']->tags,
);
+$params = $params + $vars;
$body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($icon, $body);
diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php
index d3a6ea862..10cf0b148 100644
--- a/views/default/object/elements/summary.php
+++ b/views/default/object/elements/summary.php
@@ -3,15 +3,15 @@
* Object summary
*
* Sample output
- * <ul class="elgg-menu elgg-menu-metadata"><li>Public</li><li>Like this</li></ul>
+ * <ul class="elgg-menu elgg-menu-entity"><li>Public</li><li>Like this</li></ul>
* <h3><a href="">Title</a></h3>
* <p class="elgg-subtext">Posted 3 hours ago by George</p>
* <p class="elgg-tags"><a href="">one</a>, <a href="">two</a></p>
- * <div class="elgg-list-content">Excerpt text</div>
+ * <div class="elgg-content">Excerpt text</div>
*
* @uses $vars['entity'] ElggEntity
* @uses $vars['title'] Title link (optional) false = no title, '' = default
- * @uses $vars['metadata'] HTML for entity metadata and actions (optional)
+ * @uses $vars['metadata'] HTML for entity menu and metadata (optional)
* @uses $vars['subtitle'] HTML for the subtitle (optional)
* @uses $vars['tags'] HTML for the tags (optional)
* @uses $vars['content'] HTML for the entity content (optional)
@@ -49,5 +49,5 @@ echo "<h3>$title_link</h3>";
echo "<div class=\"elgg-subtext\">$subtitle</div>";
echo $tags;
if ($content) {
- echo "<div class=\"elgg-list-content\">$content</div>";
+ echo "<div class=\"elgg-content\">$content</div>";
}
diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php
index 51fb69d17..84fc0439b 100644
--- a/views/default/object/plugin/advanced.php
+++ b/views/default/object/plugin/advanced.php
@@ -242,7 +242,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)
echo elgg_view('output/url', array(
'href' => "#elgg-plugin-manifest-{$plugin->getID()}",
'text' => elgg_echo("admin:plugins:label:moreinfo"),
- 'class' => 'elgg-toggler',
+ 'rel' => 'toggle',
));
?>
</div>
diff --git a/views/default/object/plugin/invalid.php b/views/default/object/plugin/invalid.php
index 9e239b7ca..f29ee8d12 100644
--- a/views/default/object/plugin/invalid.php
+++ b/views/default/object/plugin/invalid.php
@@ -29,7 +29,7 @@ $error = $plugin->getError();
echo elgg_view('output/url', array(
'href' => "#elgg-plugin-manifest-{$plugin->getID()}",
'text' => elgg_echo("admin:plugins:label:moreinfo"),
- 'class' => 'elgg-toggler',
+ 'rel' => 'toggle',
));
?>
</div>
diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php
index 83a2f5767..abf2154fc 100644
--- a/views/default/object/widget/elements/controls.php
+++ b/views/default/object/widget/elements/controls.php
@@ -12,7 +12,8 @@ $show_edit = elgg_extract('show_edit', $vars, true);
$params = array(
'text' => ' ',
'href' => "#elgg-widget-content-$widget->guid",
- 'class' => 'elgg-widget-collapse-button elgg-toggler',
+ 'class' => 'elgg-widget-collapse-button',
+ 'rel' => 'toggle',
);
$collapse_link = elgg_view('output/url', $params);
@@ -33,7 +34,8 @@ if ($widget->canEdit()) {
'text' => elgg_view_icon('settings-alt'),
'title' => elgg_echo('widget:edit'),
'href' => "#widget-edit-$widget->guid",
- 'class' => "elgg-toggler elgg-widget-edit-button",
+ 'class' => "elgg-widget-edit-button",
+ 'rel' => 'toggle',
);
$edit_link = elgg_view('output/url', $params);
}
diff --git a/views/default/page/components/gallery.php b/views/default/page/components/gallery.php
index e86b9f885..f03eb1109 100644
--- a/views/default/page/components/gallery.php
+++ b/views/default/page/components/gallery.php
@@ -2,7 +2,17 @@
/**
* Gallery view
*
- * @uses $vars['items']
+ * Implemented as an unorder list
+ *
+ * @uses $vars['items'] Array of ElggEntity or ElggAnnotation objects
+ * @uses $vars['offset'] Index of the first list item in complete list
+ * @uses $vars['limit'] Number of items per page
+ * @uses $vars['count'] Number of items in the complete list
+ * @uses $vars['pagination'] Show pagination? (default: true)
+ * @uses $vars['position'] Position of the pagination: before, after, or both
+ * @uses $vars['full_view'] Show the full view of the items (default: false)
+ * @uses $vars['gallery_class'] Additional CSS class for the <ul> element
+ * @uses $vars['item_class'] Additional CSS class for the <li> elements
*/
$items = $vars['items'];
@@ -19,6 +29,16 @@ $pagination = elgg_extract('pagination', $vars, true);
$offset_key = elgg_extract('offset_key', $vars, 'offset');
$position = elgg_extract('position', $vars, 'after');
+$gallery_class = 'elgg-gallery';
+if (isset($vars['gallery_class'])) {
+ $gallery_class = "$gallery_class {$vars['gallery_class']}";
+}
+
+$item_class = 'elgg-item';
+if (isset($vars['item_class'])) {
+ $item_class = "$item_class {$vars['item_class']}";
+}
+
if ($pagination && $count) {
$nav .= elgg_view('navigation/pagination', array(
'offset' => $offset,
@@ -33,10 +53,15 @@ if ($position == 'before' || $position == 'both') {
}
?>
-<ul class="elgg-gallery">
+<ul class="<?php echo $gallery_class; ?>">
<?php
foreach ($items as $item) {
- echo '<li>';
+ if (elgg_instanceof($item)) {
+ $id = "elgg-{$item->getType()}-{$item->getGUID()}";
+ } else {
+ $id = "item-{$item->getType()}-{$item->id}";
+ }
+ echo "<li id=\"$id\" class=\"$item_class\">";
echo elgg_view_list_item($item, $vars);
echo "</li>";
}
diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php
index ae951c89f..c83fa0966 100644
--- a/views/default/page/components/list.php
+++ b/views/default/page/components/list.php
@@ -27,12 +27,12 @@ $position = elgg_extract('position', $vars, 'after');
$list_class = 'elgg-list';
if (isset($vars['list_class'])) {
- $list_class = "{$vars['list_class']} $list_class";
+ $list_class = "$list_class {$vars['list_class']}";
}
-$item_class = 'elgg-list-item';
+$item_class = 'elgg-item';
if (isset($vars['item_class'])) {
- $item_class = "{$vars['item_class']} $item_class";
+ $item_class = "$item_class {$vars['item_class']}";
}
$html = "";
diff --git a/views/default/page/default.php b/views/default/page/default.php
index 9effce1ec..0e27cda52 100644
--- a/views/default/page/default.php
+++ b/views/default/page/default.php
@@ -17,7 +17,7 @@ if (elgg_get_context() == 'admin') {
elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8);
elgg_admin_add_plugin_settings_menu();
elgg_unregister_css('elgg');
- echo elgg_view('page/shells/admin', $vars);
+ echo elgg_view('page/admin', $vars);
return true;
}
diff --git a/views/default/page/elements/owner_block.php b/views/default/page/elements/owner_block.php
index c525a38aa..fc7f0f6d2 100644
--- a/views/default/page/elements/owner_block.php
+++ b/views/default/page/elements/owner_block.php
@@ -15,7 +15,7 @@ $owner = elgg_get_page_owner_entity();
if ($owner instanceof ElggGroup ||
($owner instanceof ElggUser && $owner->getGUID() != elgg_get_logged_in_user_guid())) {
- $header = elgg_view_entity($owner, false);
+ $header = elgg_view_entity($owner, array('full_view' => false));
$body = elgg_view_menu('owner_block', array('entity' => $owner));
diff --git a/views/default/page/layouts/one_column.php b/views/default/page/layouts/one_column.php
index c59a574e7..7546a4cdf 100644
--- a/views/default/page/layouts/one_column.php
+++ b/views/default/page/layouts/one_column.php
@@ -13,11 +13,22 @@ $class = 'elgg-layout elgg-layout-one-column clearfix';
if (isset($vars['class'])) {
$class = "$class {$vars['class']}";
}
+
+// navigation defaults to breadcrumbs
+$nav = elgg_extract('nav', $vars, elgg_view('navigation/breadcrumbs'));
+
?>
<div class="<?php echo $class; ?>">
- <div class="elgg-body">
- <?php echo $vars['content']; ?>
+ <div class="elgg-body elgg-main">
<?php
+ echo $nav;
+
+ if (isset($vars['title'])) {
+ echo elgg_view_title($vars['title']);
+ }
+
+ echo $vars['content'];
+
// @deprecated 1.8
echo $vars['area1'];
?>
diff --git a/views/default/page/layouts/widgets/add_button.php b/views/default/page/layouts/widgets/add_button.php
index a8670146b..89e83b096 100644
--- a/views/default/page/layouts/widgets/add_button.php
+++ b/views/default/page/layouts/widgets/add_button.php
@@ -4,7 +4,12 @@
*/
?>
<div class="elgg-widget-add-control">
- <a class="elgg-button elgg-button-action elgg-toggler" href="#widgets-add-panel">
- <?php echo elgg_echo('widgets:add'); ?>
- </a>
+<?php
+ echo elgg_view('output/url', array(
+ 'href' => '#widgets-add-panel',
+ 'text' => elgg_echo('widgets:add'),
+ 'class' => 'elgg-button elgg-button-action',
+ 'rel' => 'toggle',
+ ));
+?>
</div>
diff --git a/views/default/river/annotation/generic_comment/create.php b/views/default/river/annotation/generic_comment/create.php
index aabb6a9c6..d3db68e41 100644
--- a/views/default/river/annotation/generic_comment/create.php
+++ b/views/default/river/annotation/generic_comment/create.php
@@ -5,26 +5,7 @@
$object = $vars['item']->getObjectEntity();
$comment = $vars['item']->getAnnotation();
-$url = $object->getURL();
-$title = $object->title;
-if (!$title) {
- $title = elgg_echo('untitled');
-}
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $title,
-);
-$object_link = elgg_view('output/url', $params);
-
-$type = $object->getType();
-$subtype = $object->getSubtype();
-
-$type_string = elgg_echo("river:commented:$type:$subtype");
-echo elgg_echo('river:generic_comment', array($type_string, $object_link));
-
-if ($comment) {
- $excerpt = elgg_get_excerpt($comment->value);
- echo '<div class="elgg-river-content">';
- echo $excerpt;
- echo '</div>';
-}
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => elgg_get_excerpt($comment->value),
+));
diff --git a/views/default/river/elements/body.php b/views/default/river/elements/body.php
index f9ecbc03c..f7a9d2426 100644
--- a/views/default/river/elements/body.php
+++ b/views/default/river/elements/body.php
@@ -2,32 +2,64 @@
/**
* Body of river item
*
- * @uses $vars['item']
+ * @uses $vars['item'] ElggRiverItem
+ * @uses $vars['summary'] Alternate summary (the short text summary of action)
+ * @uses $vars['message'] Optional message (usually excerpt of text)
+ * @uses $vars['attachments'] Optional attachments (displaying icons or other non-text data)
+ * @uses $vars['responses'] Alternate respones (comments, replies, etc.)
*/
$item = $vars['item'];
-$subject = $item->getSubjectEntity();
+
+$menu = elgg_view_menu('river', array(
+ 'item' => $item,
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+));
// river item header
-$params = array(
- 'href' => $subject->getURL(),
- 'text' => $subject->name,
-);
-$subject_link = elgg_view('output/url', $params);
$timestamp = elgg_get_friendly_time($item->getPostedTime());
-$header = elgg_view_menu('river', array('item' => $item, 'sort_by' => 'priority'));
-$header .= "$subject_link <span class=\"elgg-river-timestamp\">$timestamp</span>";
+$summary = elgg_extract('summary', $vars, elgg_view('river/elements/summary', array('item' => $vars['item'])));
+if ($summary === false) {
+ $subject = $item->getSubjectEntity();
+ $summary = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+ ));
+}
+
+$message = elgg_extract('message', $vars, false);
+if ($message !== false) {
+ $message = "<div class=\"elgg-river-message\">$message</div>";
+}
+
+$attachments = elgg_extract('attachments', $vars, false);
+if ($attachments !== false) {
+ $attachments = "<div class=\"elgg-river-attachments\">$attachments</div>";
+}
-// body
-$body = elgg_view($item->getView(), array('item' => $item));
+$responses = elgg_view('river/elements/responses', $vars);
+if ($responses) {
+ $responses = "<div class=\"elgg-river-responses\">$responses</div>";
+}
-// footer
-$footer = elgg_view('river/elements/footer', $vars);
+$group_string = '';
+$object = $item->getObjectEntity();
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup && $container->guid != elgg_get_page_owner_guid()) {
+ $group_link = elgg_view('output/url', array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ ));
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
-echo elgg_view('page/components/module', array(
- 'header' => $header,
- 'body' => $body,
- 'footer' => $footer,
- 'class' => 'mbn',
-)); \ No newline at end of file
+echo <<<RIVER
+$menu
+<div class="elgg-river-summary">$summary $group_string <span class="elgg-river-timestamp">$timestamp</span></div>
+$message
+$attachments
+$responses
+RIVER;
diff --git a/views/default/river/elements/footer.php b/views/default/river/elements/responses.php
index f1e79f131..8c5be6316 100644
--- a/views/default/river/elements/footer.php
+++ b/views/default/river/elements/responses.php
@@ -1,8 +1,18 @@
<?php
/**
* River item footer
+ *
+ * @uses $vars['item'] ElggRiverItem
+ * @uses $vars['responses'] Alternate override for this item
*/
+// allow river views to override the response content
+$responses = elgg_extract('responses', $vars, false);
+if ($responses) {
+ echo $responses;
+ return true;
+}
+
$item = $vars['item'];
$object = $item->getObjectEntity();
diff --git a/views/default/river/elements/summary.php b/views/default/river/elements/summary.php
new file mode 100644
index 000000000..4d80c29a6
--- /dev/null
+++ b/views/default/river/elements/summary.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Short summary of the action that occurred
+ *
+ * @vars['item'] ElggRiverItem
+ */
+
+$item = $vars['item'];
+
+$subject = $item->getSubjectEntity();
+$object = $item->getObjectEntity();
+$target = $object->getContainerEntity();
+
+$subject_link = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+));
+
+$object_link = elgg_view('output/url', array(
+ 'href' => $object->getURL(),
+ 'text' => $object->title ? $object->title : $object->name,
+ 'class' => 'elgg-river-object',
+));
+
+$action = $item->action_type;
+$type = $item->type;
+$subtype = $item->subtype ? $item->subtype : 'default';
+
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup) {
+ $params = array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ );
+ $group_link = elgg_view('output/url', $params);
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
+
+
+echo elgg_echo("river:$action:$type:$subtype", array($subject_link, $object_link)); \ No newline at end of file
diff --git a/views/default/river/item.php b/views/default/river/item.php
index bf7c80b03..94622e272 100644
--- a/views/default/river/item.php
+++ b/views/default/river/item.php
@@ -7,10 +7,8 @@
$item = $vars['item'];
-$vars = array(
- 'image' => elgg_view('river/elements/image', array('item' => $item)),
- 'body' => elgg_view('river/elements/body', array('item' => $item)),
+echo elgg_view('page/components/image_block', array(
+ 'image' => elgg_view('river/elements/image', $vars),
+ 'body' => elgg_view('river/elements/body', $vars),
'class' => 'elgg-river-item',
-);
-
-echo elgg_view('page/components/image_block', $vars);
+));
diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php
index 14dab4451..f3f4a9b14 100644
--- a/views/default/river/relationship/friend/create.php
+++ b/views/default/river/relationship/friend/create.php
@@ -5,18 +5,10 @@
$subject = $vars['item']->getSubjectEntity();
$object = $vars['item']->getObjectEntity();
-$params = array(
- 'href' => $object->getURL(),
- 'text' => $object->name,
-);
-$object_link = elgg_view('output/url', $params);
$subject_icon = elgg_view_entity_icon($subject, 'tiny');
$object_icon = elgg_view_entity_icon($object, 'tiny');
-echo elgg_echo("friends:river:add", array($object_link));
-
-echo '<div class="elgg-river-content clearfix">';
-echo $subject_icon;
-echo elgg_view_icon('arrow-right', true);
-echo $object_icon;
-echo '</div>';
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'attachments' => $subject_icon . elgg_view_icon('arrow-right', true) . $object_icon,
+));
diff --git a/views/default/river/user/default/profileiconupdate.php b/views/default/river/user/default/profileiconupdate.php
index a723c5335..c7f691533 100644
--- a/views/default/river/user/default/profileiconupdate.php
+++ b/views/default/river/user/default/profileiconupdate.php
@@ -2,12 +2,20 @@
/**
* Update avatar river view
*/
+
+
$subject = $vars['item']->getSubjectEntity();
-$subject_icon = elgg_view_entity_icon($subject, 'tiny');
+$subject_link = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+));
-echo elgg_echo("profile:river:iconupdate");
+$string = elgg_echo('river:update:user:avatar', array($subject_link));
-echo '<div class="elgg-river-content clearfix">';
-echo $subject_icon;
-echo '</div>';
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'summary' => $string,
+ 'attachments' => elgg_view_entity_icon($subject, 'tiny'),
+));
diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php
index 4c5ef5b4a..bb5bd7a8d 100644
--- a/views/default/widgets/friends/content.php
+++ b/views/default/widgets/friends/content.php
@@ -13,12 +13,12 @@ $num = (int) $vars['entity']->num_display;
// get the correct size
$size = $vars['entity']->icon_size;
-$html = $owner->listFriends('', $num, array(
- 'size' => $size,
- 'gallery' => true,
-));
-if ($html) {
- echo $html;
-} else {
-
+if (elgg_instanceof($owner, 'user')) {
+ $html = $owner->listFriends('', $num, array(
+ 'size' => $size,
+ 'list_type' => 'gallery',
+ ));
+ if ($html) {
+ echo $html;
+ }
}
diff --git a/views/json/entities/entity_list.php b/views/json/entities/entity_list.php
index b583588c3..d5b134a71 100644
--- a/views/json/entities/entity_list.php
+++ b/views/json/entities/entity_list.php
@@ -4,7 +4,7 @@ $entities = $vars['entities'];
$full_view = $vars['full_view'];
if (is_array($entities) && sizeof($entities) > 0) {
- foreach($entities as $entity) {
- echo elgg_view_entity($entity, $full_view);
+ foreach ($entities as $entity) {
+ echo elgg_view_entity($entity, array('full_view' => $full_view));
}
}