aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/start.php9
-rw-r--r--mod/bookmarks/languages/en.php4
-rw-r--r--mod/bookmarks/pages/bookmarks/all.php4
-rw-r--r--mod/bookmarks/pages/bookmarks/friends.php8
-rw-r--r--mod/bookmarks/start.php2
-rw-r--r--mod/bookmarks/views/rss/object/bookmarks.php36
-rw-r--r--mod/categories/start.php6
-rw-r--r--mod/custom_index/views/default/custom_index/css.php4
-rw-r--r--mod/custom_index/views/default/page/layouts/custom_index.php17
-rw-r--r--mod/dashboard/start.php5
-rw-r--r--mod/developers/start.php2
-rw-r--r--mod/developers/views/default/theme_preview/forms.php4
-rw-r--r--mod/developers/views/default/theme_preview/icons/avatars.php4
-rw-r--r--mod/diagnostics/start.php3
-rw-r--r--mod/externalpages/start.php2
-rw-r--r--mod/file/download.php29
-rw-r--r--mod/file/languages/en.php5
-rw-r--r--mod/file/pages/file/download.php38
-rw-r--r--mod/file/pages/file/view.php2
-rw-r--r--mod/file/pages/file/world.php3
-rw-r--r--mod/file/start.php57
-rw-r--r--mod/file/views/default/icon/object/file.php11
-rw-r--r--mod/file/views/rss/file/enclosure.php16
-rw-r--r--mod/file/views/rss/object/file.php21
-rw-r--r--mod/groups/languages/en.php6
-rw-r--r--mod/groups/lib/discussion.php3
-rw-r--r--mod/groups/lib/groups.php15
-rw-r--r--mod/groups/start.php12
-rw-r--r--mod/groups/views/default/discussion/group_module.php2
-rw-r--r--mod/groups/views/default/groups/invitationrequests.php2
-rw-r--r--mod/groups/views/default/groups/membershiprequests.php2
-rw-r--r--mod/groups/views/rss/annotation/group_topic_post.php32
-rw-r--r--mod/groups/views/rss/discussion/replies.php12
-rw-r--r--mod/groups/views/rss/forum/topicposts.php3
-rw-r--r--mod/groups/views/rss/forum/topics.php10
-rw-r--r--mod/groups/views/rss/forum/viewposts.php22
-rw-r--r--mod/groups/views/rss/groups/contentwrapper.php5
-rw-r--r--mod/groups/views/rss/groups/profile/layout.php13
-rw-r--r--mod/groups/views/rss/groups/profileitems.php15
-rw-r--r--mod/groups/views/rss/object/groupforumtopic.php49
-rw-r--r--mod/invitefriends/start.php2
-rw-r--r--mod/members/start.php2
-rw-r--r--mod/messageboard/start.php4
-rw-r--r--mod/messages/start.php1
-rw-r--r--mod/notifications/start.php7
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/forminternals.php2
-rw-r--r--mod/pages/start.php7
-rw-r--r--mod/profile/start.php2
-rw-r--r--mod/profile/views/default/profile/owner_block.php2
-rw-r--r--mod/reportedcontent/start.php2
-rw-r--r--mod/search/start.php6
-rw-r--r--mod/search/views/rss/search/list.php (renamed from mod/search/views/rss/search/listing.php)0
-rw-r--r--mod/thewire/languages/en.php1
-rw-r--r--mod/thewire/start.php91
-rw-r--r--mod/thewire/views/rss/object/thewire.php59
-rw-r--r--mod/twitter_api/lib/twitter_api.php19
-rw-r--r--mod/twitter_api/start.php8
-rw-r--r--mod/uservalidationbyemail/start.php6
58 files changed, 420 insertions, 296 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 9e77b0a93..052c63651 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -93,14 +93,14 @@ function blog_init() {
* @todo no archives for all blogs or friends
*
* @param array $page
- * @return NULL
+ * @return bool
*/
function blog_page_handler($page) {
elgg_load_library('elgg:blog');
// @todo remove the forwarder in 1.9
- // forward to correct URL for bookmarks pre-1.7.5
+ // forward to correct URL for blog pages pre-1.7.5
blog_url_forwarder($page);
// push all blogs breadcrumb
@@ -139,10 +139,10 @@ function blog_page_handler($page) {
$params = blog_get_page_content_list($page[1]);
break;
case 'all':
- default:
- $title = elgg_echo('blog:title:all_blogs');
$params = blog_get_page_content_list();
break;
+ default:
+ return false;
}
$params['sidebar'] .= elgg_view('blog/sidebar', array('page' => $page_type));
@@ -150,6 +150,7 @@ function blog_page_handler($page) {
$body = elgg_view_layout('content', $params);
echo elgg_view_page($params['title'], $body);
+ return true;
}
/**
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php
index 0478e292f..2c589c207 100644
--- a/mod/bookmarks/languages/en.php
+++ b/mod/bookmarks/languages/en.php
@@ -68,14 +68,14 @@ $english = array(
*/
'bookmarks:save:success' => "Your item was successfully bookmarked.",
- 'bookmarks:delete:success' => "Your bookmarked item was successfully deleted.",
+ 'bookmarks:delete:success' => "Your bookmark was deleted.",
/**
* Error messages
*/
'bookmarks:save:failed' => "Your bookmark could not be saved. Make sure you've entered a title and address and then try again.",
- 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could nto be saved.",
+ 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could not be saved.",
'bookmarks:delete:failed' => "Your bookmark could not be deleted. Please try again.",
);
diff --git a/mod/bookmarks/pages/bookmarks/all.php b/mod/bookmarks/pages/bookmarks/all.php
index d9ac2767f..f57776752 100644
--- a/mod/bookmarks/pages/bookmarks/all.php
+++ b/mod/bookmarks/pages/bookmarks/all.php
@@ -20,6 +20,10 @@ $content = elgg_list_entities(array(
'view_toggle_type' => false
));
+if (!$content) {
+ $content = elgg_echo('bookmarks:none');
+}
+
$title = elgg_echo('bookmarks:everyone');
$body = elgg_view_layout('content', array(
diff --git a/mod/bookmarks/pages/bookmarks/friends.php b/mod/bookmarks/pages/bookmarks/friends.php
index be164fcec..15b1da098 100644
--- a/mod/bookmarks/pages/bookmarks/friends.php
+++ b/mod/bookmarks/pages/bookmarks/friends.php
@@ -5,19 +5,19 @@
* @package ElggBookmarks
*/
-$owner = elgg_get_page_owner_entity();
+$page_owner = elgg_get_page_owner_entity();
if (!$page_owner) {
forward('bookmarks/all');
}
-elgg_push_breadcrumb($owner->name, "bookmarks/owner/$owner->username");
+elgg_push_breadcrumb($page_owner->name, "bookmarks/owner/$page_owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
elgg_register_title_button();
$title = elgg_echo('bookmarks:friends');
-$content = list_user_friends_objects($owner->guid, 'bookmarks', 10, false);
+$content = list_user_friends_objects($page_owner->guid, 'bookmarks', 10, false);
if (!$content) {
$content = elgg_echo('bookmarks:none');
}
@@ -30,4 +30,4 @@ $params = array(
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body); \ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index 2a7b44e97..21a2d8940 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -83,6 +83,7 @@ function bookmarks_init() {
* Title is ignored
*
* @param array $page
+ * @return bool
*/
function bookmarks_page_handler($page) {
elgg_load_library('elgg:bookmarks');
@@ -151,7 +152,6 @@ function bookmarks_page_handler($page) {
}
elgg_pop_context();
-
return true;
}
diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php
index 8e88485f1..1abda4710 100644
--- a/mod/bookmarks/views/rss/object/bookmarks.php
+++ b/mod/bookmarks/views/rss/object/bookmarks.php
@@ -1,23 +1,37 @@
<?php
/**
- * Elgg bookmark rss view
- *
+ * Bookmark RSS object view
+ *
* @package ElggBookmarks
*/
$title = $vars['entity']->title;
if (empty($title)) {
- $title = substr($vars['entity']->description,0,32);
- if (strlen($vars['entity']->description) > 32)
- $title .= " ...";
+ $title = strip_tags($vars['entity']->description);
+ $title = elgg_get_excerpt($title, 32);
}
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+$url_text = elgg_echo('bookmarks:address');
+$link = elgg_view('output/url', array('href' => $vars['entity']->address));
+$description = $vars['entity']->description . "<p>$url_text: $link</p>";
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item');
+
+$item = <<<__HTML
<item>
- <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
- <pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
- <link><?php echo $vars['entity']->address; ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/categories/start.php b/mod/categories/start.php
index b6bc4a55c..0aacf11e7 100644
--- a/mod/categories/start.php
+++ b/mod/categories/start.php
@@ -27,12 +27,12 @@ function categories_init() {
/**
- * Page handler
- *
+ * Category page handler
+ * @return bool
*/
function categories_page_handler() {
include(dirname(__FILE__) . "/pages/categories/listing.php");
- return TRUE;
+ return true;
}
/**
diff --git a/mod/custom_index/views/default/custom_index/css.php b/mod/custom_index/views/default/custom_index/css.php
index 841b66761..4c780a905 100644
--- a/mod/custom_index/views/default/custom_index/css.php
+++ b/mod/custom_index/views/default/custom_index/css.php
@@ -11,12 +11,12 @@
.custom-index {
padding: 10px 0;
}
-.elgg-module-front {
+.elgg-module-highlight {
-webkit-box-shadow: 1px 1px 5px #CCC;
-moz-box-shadow: 1px 1px 5px #CCC;
box-shadow: 1px 1px 5px #CCC;
}
-.elgg-module-front:hover {
+.elgg-module-highlight:hover {
-webkit-box-shadow: 1px 1px 6px #AAA;
-moz-box-shadow: 1px 1px 6px #AAA;
box-shadow: 1px 1px 6px #AAA;
diff --git a/mod/custom_index/views/default/page/layouts/custom_index.php b/mod/custom_index/views/default/page/layouts/custom_index.php
index 46efa11e2..1267e19b2 100644
--- a/mod/custom_index/views/default/page/layouts/custom_index.php
+++ b/mod/custom_index/views/default/page/layouts/custom_index.php
@@ -7,7 +7,7 @@
*
*/
-$mod_params = array('class' => 'elgg-module-featured');
+$mod_params = array('class' => 'elgg-module-highlight');
?>
@@ -25,22 +25,19 @@ if (elgg_is_logged_in()) {
} else {
$top_box = $vars['login'];
}
-echo elgg_view_module('front', '', $top_box, array(
- 'header' => false,
- 'class' => 'elgg-module-featured',
-));
+echo elgg_view_module('featured', '', $top_box, $mod_params);
// a view for plugins to extend
echo elgg_view("index/lefthandside");
// files
if (elgg_is_active_plugin('file')) {
- echo elgg_view_module('front', elgg_echo("custom:files"), $vars['files'], $mod_params);
+ echo elgg_view_module('featured', elgg_echo("custom:files"), $vars['files'], $mod_params);
}
// groups
if (elgg_is_active_plugin('groups')) {
- echo elgg_view_module('front', elgg_echo("custom:groups"), $vars['groups'], $mod_params);
+ echo elgg_view_module('featured', elgg_echo("custom:groups"), $vars['groups'], $mod_params);
}
?>
</div>
@@ -54,16 +51,16 @@ if (elgg_is_active_plugin('groups')) {
echo elgg_view("index/righthandside");
// files
-echo elgg_view_module('front', elgg_echo("custom:members"), $vars['members'], $mod_params);
+echo elgg_view_module('featured', elgg_echo("custom:members"), $vars['members'], $mod_params);
// groups
if (elgg_is_active_plugin('blog')) {
- echo elgg_view_module('front', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params);
+ echo elgg_view_module('featured', elgg_echo("custom:blogs"), $vars['blogs'], $mod_params);
}
// files
if (elgg_is_active_plugin('bookmarks')) {
- echo elgg_view_module('front', elgg_echo("custom:bookmarks"), $vars['bookmarks'], $mod_params);
+ echo elgg_view_module('featured', elgg_echo("custom:bookmarks"), $vars['bookmarks'], $mod_params);
}
?>
</div>
diff --git a/mod/dashboard/start.php b/mod/dashboard/start.php
index 5635ead57..65007d1a8 100644
--- a/mod/dashboard/start.php
+++ b/mod/dashboard/start.php
@@ -29,6 +29,10 @@ function dashboard_init() {
elgg_register_plugin_hook_handler('get_list', 'default_widgets', 'dashboard_default_widgets');
}
+/**
+ * Dashboard page handler
+ * @return bool
+ */
function dashboard_page_handler() {
// Ensure that only logged-in users can see this page
gatekeeper();
@@ -51,6 +55,7 @@ function dashboard_page_handler() {
$body = elgg_view_layout('one_column', array('content' => $widgets));
echo elgg_view_page($title, $body);
+ return true;
}
diff --git a/mod/developers/start.php b/mod/developers/start.php
index ab9a174a4..2e3df7663 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -157,6 +157,7 @@ function developers_log_events($name, $type) {
* Serve the theme preview pages
*
* @param array $page
+ * @return bool
*/
function developers_theme_preview_controller($page) {
if (!isset($page[0])) {
@@ -191,4 +192,5 @@ function developers_theme_preview_controller($page) {
));
echo elgg_view_page($title, $layout, 'theme_preview');
+ return true;
}
diff --git a/mod/developers/views/default/theme_preview/forms.php b/mod/developers/views/default/theme_preview/forms.php
index 6b59ef6d7..ffb77f3a9 100644
--- a/mod/developers/views/default/theme_preview/forms.php
+++ b/mod/developers/views/default/theme_preview/forms.php
@@ -20,11 +20,11 @@
?>
</div>
<div>
- <label for="f3">Radio input (.elgg-input-radio):</label><br />
+ <label for="f3">Radio input (.elgg-input-radios):</label><br />
<?php echo elgg_view('input/radio', array(
'name' => 'f3',
'id' => 'f3',
- 'options' => array('a' => 1, 'b' => 2),
+ 'options' => array('a (.elgg-input-radio)' => 1, 'b (.elgg-input-radio)' => 2),
));
?>
</div>
diff --git a/mod/developers/views/default/theme_preview/icons/avatars.php b/mod/developers/views/default/theme_preview/icons/avatars.php
index cbce5bc7d..f50a6b70d 100644
--- a/mod/developers/views/default/theme_preview/icons/avatars.php
+++ b/mod/developers/views/default/theme_preview/icons/avatars.php
@@ -18,7 +18,7 @@
<?php
foreach ($sizes as $size) {
echo '<td>';
- echo elgg_view_entity_icon($user, $size, array('hover' => false));
+ echo elgg_view_entity_icon($user, $size, array('use_hover' => false));
echo '</td>';
}
?>
@@ -28,7 +28,7 @@
<?php
foreach ($sizes as $size) {
echo '<td>';
- echo elgg_view_entity_icon($group, $size, array('hover' => false));
+ echo elgg_view_entity_icon($group, $size, array('use_hover' => false));
echo '</td>';
}
?>
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index 735e15042..0bcc08bd9 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -12,9 +12,6 @@ elgg_register_event_handler('init', 'system', 'diagnostics_init');
*/
function diagnostics_init() {
- // Register a page handler, so we can have nice URLs
- elgg_register_page_handler('diagnostics','diagnostics_page_handler');
-
// Add admin menu item
elgg_register_admin_menu_item('develop', 'diagnostics', 'develop_utilities');
diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php
index 3169503be..13235af53 100644
--- a/mod/externalpages/start.php
+++ b/mod/externalpages/start.php
@@ -53,6 +53,7 @@ function expages_setup_footer_menu() {
*
* @param array $page URL segements
* @param string $handler Handler identifier
+ * @return bool
*/
function expages_page_handler($page, $handler) {
if ($handler == 'expages') {
@@ -76,6 +77,7 @@ function expages_page_handler($page, $handler) {
$body = elgg_view_layout("one_sidebar", array('content' => $content));
echo elgg_view_page($title, $body);
+ return true;
}
/**
diff --git a/mod/file/download.php b/mod/file/download.php
index 8e0287a1e..b2acdffec 100644
--- a/mod/file/download.php
+++ b/mod/file/download.php
@@ -9,31 +9,4 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Get the guid
$file_guid = get_input("file_guid");
-// Get the file
-$file = get_entity($file_guid);
-if (!$file) {
- register_error(elgg_echo("file:downloadfailed"));
- forward();
-}
-
-$mime = $file->getMimeType();
-if (!$mime) {
- $mime = "application/octet-stream";
-}
-
-$filename = $file->originalfilename;
-
-// fix for IE https issue
-header("Pragma: public");
-
-header("Content-type: $mime");
-if (strpos($mime, "image/") !== false) {
- header("Content-Disposition: inline; filename=\"$filename\"");
-} else {
- header("Content-Disposition: attachment; filename=\"$filename\"");
-}
-
-ob_clean();
-flush();
-readfile($file->getFilenameOnFilestore());
-exit;
+forward("file/download/$file_guid");
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index 96fbd1c48..278076927 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -35,6 +35,9 @@ $english = array(
'file:desc' => "Description",
'file:tags' => "Tags",
+ 'file:list:list' => 'Switch to the list view',
+ 'file:list:gallery' => 'Switch to the gallery view',
+
'file:types' => "Uploaded file types",
'file:type:' => 'Files',
@@ -95,7 +98,7 @@ $english = array(
* Error messages
*/
- 'file:none' => "No files uploaded.",
+ 'file:none' => "No files.",
'file:uploadfailed' => "Sorry; we could not save your file.",
'file:downloadfailed' => "Sorry; this file is not available at this time.",
'file:deletefailed' => "Your file could not be deleted at this time.",
diff --git a/mod/file/pages/file/download.php b/mod/file/pages/file/download.php
new file mode 100644
index 000000000..00e6d500e
--- /dev/null
+++ b/mod/file/pages/file/download.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Elgg file download.
+ *
+ * @package ElggFile
+ */
+
+// Get the guid
+$file_guid = get_input("guid");
+
+// Get the file
+$file = get_entity($file_guid);
+if (!$file) {
+ register_error(elgg_echo("file:downloadfailed"));
+ forward();
+}
+
+$mime = $file->getMimeType();
+if (!$mime) {
+ $mime = "application/octet-stream";
+}
+
+$filename = $file->originalfilename;
+
+// fix for IE https issue
+header("Pragma: public");
+
+header("Content-type: $mime");
+if (strpos($mime, "image/") !== false) {
+ header("Content-Disposition: inline; filename=\"$filename\"");
+} else {
+ header("Content-Disposition: attachment; filename=\"$filename\"");
+}
+
+ob_clean();
+flush();
+readfile($file->getFilenameOnFilestore());
+exit;
diff --git a/mod/file/pages/file/view.php b/mod/file/pages/file/view.php
index 50c55a74f..a571c9d68 100644
--- a/mod/file/pages/file/view.php
+++ b/mod/file/pages/file/view.php
@@ -28,7 +28,7 @@ $content .= elgg_view_comments($file);
elgg_register_menu_item('title', array(
'name' => 'download',
'text' => elgg_echo('file:download'),
- 'href' => "mod/file/download.php?file_guid=$file->guid",
+ 'href' => "file/download/$file->guid",
'link_class' => 'elgg-button elgg-button-action',
));
diff --git a/mod/file/pages/file/world.php b/mod/file/pages/file/world.php
index e438ca2f0..770dfd6e8 100644
--- a/mod/file/pages/file/world.php
+++ b/mod/file/pages/file/world.php
@@ -19,6 +19,9 @@ $content = elgg_list_entities(array(
'limit' => $limit,
'full_view' => FALSE
));
+if (!$content) {
+ $content = elgg_echo('file:none');
+}
$sidebar = file_get_type_cloud();
$sidebar = elgg_view('file/sidebar');
diff --git a/mod/file/start.php b/mod/file/start.php
index 843ae0794..d6e17cc4b 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -22,6 +22,9 @@ function file_init() {
// Extend CSS
elgg_extend_view('css/elgg', 'file/css');
+ // add enclosure to rss item
+ elgg_extend_view('extensions/item', 'file/enclosure');
+
// extend group main page
elgg_extend_view('groups/tool_latest', 'file/group_module');
@@ -93,11 +96,12 @@ function file_init() {
* New file: file/add/<guid>
* Edit file: file/edit/<guid>
* Group files: file/group/<guid>/all
+ * Download: file/download/<guid>
*
* Title is ignored
*
* @param array $page
- * @return NULL
+ * @return bool
*/
function file_page_handler($page) {
@@ -110,9 +114,11 @@ function file_page_handler($page) {
$page_type = $page[0];
switch ($page_type) {
case 'owner':
+ file_register_toggle();
include "$file_dir/owner.php";
break;
case 'friends':
+ file_register_toggle();
include "$file_dir/friends.php";
break;
case 'view':
@@ -127,25 +133,64 @@ function file_page_handler($page) {
include "$file_dir/edit.php";
break;
case 'search':
+ file_register_toggle();
include "$file_dir/search.php";
break;
case 'group':
+ file_register_toggle();
include "$file_dir/owner.php";
break;
case 'all':
- default:
+ file_register_toggle();
include "$file_dir/world.php";
break;
+ case 'download':
+ set_input('guid', $page[1]);
+ include "$file_dir/download.php";
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+/**
+ * Adds a toggle to extra menu for switching between list and gallery views
+ */
+function file_register_toggle() {
+ $url = elgg_http_remove_url_query_element(current_page_url(), 'list_type');
+
+ if (get_input('list_type', 'list') == 'list') {
+ $list_type = "gallery";
+ $icon = elgg_view_icon('grid');
+ } else {
+ $list_type = "list";
+ $icon = elgg_view_icon('list');
}
+
+ if (substr_count($url, '?')) {
+ $url .= "&list_type=" . $list_type;
+ } else {
+ $url .= "?list_type=" . $list_type;
+ }
+
+
+ elgg_register_menu_item('extras', array(
+ 'name' => 'file_list',
+ 'text' => $icon,
+ 'href' => $url,
+ 'title' => elgg_echo("file:list:$list_type"),
+ 'priority' => 1000,
+ ));
}
/**
* Creates the notification message body
*
- * @param unknown_type $hook
- * @param unknown_type $entity_type
- * @param unknown_type $returnvalue
- * @param unknown_type $params
+ * @param string $hook
+ * @param string $entity_type
+ * @param string $returnvalue
+ * @param array $params
*/
function file_notify_message($hook, $entity_type, $returnvalue, $params) {
$entity = $params['entity'];
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
index ff729da94..a3190310b 100644
--- a/mod/file/views/default/icon/object/file.php
+++ b/mod/file/views/default/icon/object/file.php
@@ -5,7 +5,8 @@
* @uses $vars['entity'] The entity the icon represents - uses getIconURL() method
* @uses $vars['size'] topbar, tiny, small, medium (default), large, master
* @uses $vars['href'] Optional override for link
- * @uses $vars['link_class'] Optional CSS class added to img
+ * @uses $vars['img_class'] Optional CSS class added to img
+ * @uses $vars['link_class'] Optional CSS class added to link
*/
$entity = $vars['entity'];
@@ -17,6 +18,7 @@ if (!in_array($vars['size'], $sizes)) {
}
$title = $entity->title;
+$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8', false);
$url = $entity->getURL();
if (isset($vars['href'])) {
@@ -24,8 +26,13 @@ if (isset($vars['href'])) {
}
$class = '';
+if (isset($vars['img_class'])) {
+ $class = $vars['img_class'];
+}
if ($entity->thumbnail) {
- $class = 'class="elgg-photo"';
+ $class = "class=\"elgg-photo $class\"";
+} else if ($class) {
+ $class = "class=\"$class\"";
}
$img_src = $entity->getIconURL($vars['size']);
diff --git a/mod/file/views/rss/file/enclosure.php b/mod/file/views/rss/file/enclosure.php
new file mode 100644
index 000000000..fb4a899d9
--- /dev/null
+++ b/mod/file/views/rss/file/enclosure.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Link to download the file
+ *
+ * @uses $vars['entity']
+ */
+
+if (elgg_instanceof($vars['entity'], 'object', 'file')) {
+ $download_url = elgg_get_site_url() . 'file/download/' . $vars['entity']->getGUID();
+ $size = $vars['entity']->size();
+ $mime_type = $vars['entity']->getMimeType();
+ echo <<<END
+
+ <enclosure url="$download_url" length="$size" type="$mime_type" />";
+END;
+}
diff --git a/mod/file/views/rss/object/file.php b/mod/file/views/rss/object/file.php
deleted file mode 100644
index a0660d6c8..000000000
--- a/mod/file/views/rss/object/file.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Elgg RSS file object view
- *
- * @package ElggFile
- * @subpackage Core
- */
-$title = $vars['entity']->title;
-if (empty($title)) {
- $title = elgg_get_excerpt($vars['entity']->description, 32);
-}
-?>
-
-<item>
- <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
- <pubDate><?php echo date("r", $vars['entity']->time_created) ?></pubDate>
- <link><?php echo $vars['entity']->getURL(); ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
- <enclosure url="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" length="<?php echo $vars['entity']->size(); ?>" type="<?php echo $vars['entity']->getMimeType(); ?>" />
-</item>
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 9f8bed9a4..09feaf8d1 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -69,9 +69,9 @@ $english = array(
'groups:notfound' => "Group not found",
'groups:notfound:details' => "The requested group either does not exist or you do not have access to it",
- 'groups:requests:none' => 'There are no outstanding membership requests at this time.',
+ 'groups:requests:none' => 'There are no current membership requests.',
- 'groups:invitations:none' => 'There are no outstanding invitations at this time.',
+ 'groups:invitations:none' => 'There are no current invitations.',
'item:object:groupforumtopic' => "Discussion topics",
@@ -113,6 +113,8 @@ $english = array(
'discussion:add' => 'Add discussion topic',
'discussion:latest' => 'Latest discussion',
'discussion:group' => 'Group discussion',
+ 'discussion:none' => 'No discussion',
+ 'discussion:reply:title' => 'Reply by %s',
'discussion:topic:created' => 'The discussion topic was created.',
'discussion:topic:updated' => 'The discussion topic was updated.',
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index e129e0f9d..68e5e4884 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -60,6 +60,9 @@ function discussion_handle_list_page($guid) {
'full_view' => false,
);
$content = elgg_list_entities($options);
+ if (!$content) {
+ $content = elgg_echo('discussion:none');
+ }
$params = array(
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 44143d440..590ba2b35 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -24,6 +24,9 @@ function groups_handle_all_page() {
'inverse_relationship' => false,
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
break;
case 'discussion':
$content = elgg_list_entities(array(
@@ -33,6 +36,9 @@ function groups_handle_all_page() {
'limit' => 40,
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('discussion:none');
+ }
break;
case 'newest':
default:
@@ -40,6 +46,9 @@ function groups_handle_all_page() {
'type' => 'group',
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
break;
}
@@ -107,6 +116,9 @@ function groups_handle_owned_page() {
'owner_guid' => elgg_get_page_owner_guid(),
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
$params = array(
'content' => $content,
@@ -137,6 +149,9 @@ function groups_handle_mine_page() {
'inverse_relationship' => false,
'full_view' => false,
));
+ if (!$content) {
+ $content = elgg_echo('groups:none');
+ }
$params = array(
'content' => $content,
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 1b5b03ce7..7dcf6b7c4 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -192,6 +192,7 @@ function groups_setup_sidebar_menus() {
* Group members: groups/members/<guid>
*
* @param array $page Array of url segments for routing
+ * @return bool
*/
function groups_page_handler($page) {
@@ -238,13 +239,17 @@ function groups_page_handler($page) {
case 'requests':
groups_handle_requests_page($page[1]);
break;
+ default:
+ return false;
}
+ return true;
}
/**
* Handle group icons.
*
- * @param unknown_type $page
+ * @param array $page
+ * @return void
*/
function groups_icon_handler($page) {
@@ -258,6 +263,7 @@ function groups_icon_handler($page) {
// Include the standard profile index
$plugin_dir = elgg_get_plugins_path();
include("$plugin_dir/groups/icon.php");
+ return true;
}
/**
@@ -750,6 +756,7 @@ function discussion_init() {
* Edit discussion topic: discussion/edit/<guid>
*
* @param array $page Array of url segments for routing
+ * @return bool
*/
function discussion_page_handler($page) {
@@ -773,7 +780,10 @@ function discussion_page_handler($page) {
case 'view':
discussion_handle_view_page($page[1]);
break;
+ default:
+ return false;
}
+ return true;
}
/**
diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php
index 3c9961f82..e0bcd55d6 100644
--- a/mod/groups/views/default/discussion/group_module.php
+++ b/mod/groups/views/default/discussion/group_module.php
@@ -31,7 +31,7 @@ $content = elgg_list_entities($options);
elgg_pop_context();
if (!$content) {
- $content = '<p>' . elgg_echo('grouptopic:notcreated') . '</p>';
+ $content = '<p>' . elgg_echo('discussion:none') . '</p>';
}
$new_link = elgg_view('output/url', array(
diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php
index e644b6bdc..94dbdf1f2 100644
--- a/mod/groups/views/default/groups/invitationrequests.php
+++ b/mod/groups/views/default/groups/invitationrequests.php
@@ -10,7 +10,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
echo '<ul class="elgg-list">';
foreach ($vars['invitations'] as $group) {
if ($group instanceof ElggGroup) {
- $icon = elgg_view_entity_icon($group, 'tiny', array('hover' => 'true'));
+ $icon = elgg_view_entity_icon($group, 'tiny', array('use_hover' => 'true'));
$group_title = elgg_view('output/url', array(
'href' => $group->getURL(),
diff --git a/mod/groups/views/default/groups/membershiprequests.php b/mod/groups/views/default/groups/membershiprequests.php
index bc6d9af5a..9cd28262f 100644
--- a/mod/groups/views/default/groups/membershiprequests.php
+++ b/mod/groups/views/default/groups/membershiprequests.php
@@ -10,7 +10,7 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
$user = elgg_get_logged_in_user_entity();
echo '<ul class="elgg-list">';
foreach ($vars['requests'] as $user) {
- $icon = elgg_view_entity_icon($user, 'tiny', array('hover' => 'true'));
+ $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => 'true'));
$user_title = elgg_view('output/url', array(
'href' => $user->getURL(),
diff --git a/mod/groups/views/rss/annotation/group_topic_post.php b/mod/groups/views/rss/annotation/group_topic_post.php
new file mode 100644
index 000000000..0d3a40117
--- /dev/null
+++ b/mod/groups/views/rss/annotation/group_topic_post.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * RSS view for a discussion reply
+ *
+ * @uses $vars['annotation']
+ */
+
+$annotation = $vars['annotation'];
+
+$poster = $annotation->getOwnerEntity();
+$poster_name = htmlspecialchars($poster->name, ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $annotation->getTimeCreated());
+$permalink = $annotation->getURL();
+
+$title = elgg_echo('discussion:reply:title', array($poster_name));
+
+$creator = elgg_view('page/components/creator', array('entity' => $annotation));
+$extensions = elgg_view('extensions/item', $vars);
+
+$item = <<<__HTML
+<item>
+ <guid isPermaLink='true'>$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[{$vars['annotation']->value}]]></description>
+ $creator$extensions
+</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/groups/views/rss/discussion/replies.php b/mod/groups/views/rss/discussion/replies.php
new file mode 100644
index 000000000..419003b21
--- /dev/null
+++ b/mod/groups/views/rss/discussion/replies.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * List replies RSS view
+ *
+ * @uses $vars['entity'] ElggEntity
+ */
+
+$options = array(
+ 'guid' => $vars['entity']->getGUID(),
+ 'annotation_name' => 'group_topic_post',
+);
+echo elgg_list_annotations($options);
diff --git a/mod/groups/views/rss/forum/topicposts.php b/mod/groups/views/rss/forum/topicposts.php
deleted file mode 100644
index 15c5adc7f..000000000
--- a/mod/groups/views/rss/forum/topicposts.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/forum/topics.php b/mod/groups/views/rss/forum/topics.php
deleted file mode 100644
index 1cb22aaea..000000000
--- a/mod/groups/views/rss/forum/topics.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
- /**
- * Elgg groups plugin
- *
- * @package ElggGroups
- */
-
- // If there are any topics to view, view them
- echo $vars['topics'];
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/forum/viewposts.php b/mod/groups/views/rss/forum/viewposts.php
deleted file mode 100644
index ad52365e6..000000000
--- a/mod/groups/views/rss/forum/viewposts.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
- /**
- * Elgg groups plugin display topic posts
- *
- * @package ElggGroups
- */
-
- //display follow up comments
- $count = $vars['entity']->countAnnotations('group_topic_post');
- $offset = (int) get_input('offset',0);
-
- foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) {
-
- $post->title = '';
- $post->description = $post->value;
- echo elgg_view('object/default', array('entity' => $post));
- // echo elgg_view("forum/topicposts",array('entity' => $post));
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/groups/contentwrapper.php b/mod/groups/views/rss/groups/contentwrapper.php
deleted file mode 100644
index 15397d552..000000000
--- a/mod/groups/views/rss/groups/contentwrapper.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
- echo $vars['body'];
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/groups/profile/layout.php b/mod/groups/views/rss/groups/profile/layout.php
new file mode 100644
index 000000000..3eeb9eaf2
--- /dev/null
+++ b/mod/groups/views/rss/groups/profile/layout.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Group profile RSS view
+ *
+ * Displays a list of the latest content in the group
+ *
+ * @uses $vars['entity'] ElggGroup object
+ */
+
+echo elgg_list_entities(array(
+ 'type' => 'object',
+ 'container_guid' => $vars['entity']->getGUID(),
+));
diff --git a/mod/groups/views/rss/groups/profileitems.php b/mod/groups/views/rss/groups/profileitems.php
deleted file mode 100644
index 5e595a379..000000000
--- a/mod/groups/views/rss/groups/profileitems.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
- /**
- * Elgg groups items view.
- * This is the messageboard, members, pages and latest forums posts. Each plugin will extend the views
- *
- * @package ElggGroups
- */
-
- //right column
- if ($forae = elgg_get_entities(array('types' => 'object', 'container_guid' => $vars['entity']->guid))) {
- foreach($forae as $forum)
- echo elgg_view_entity($forum);
- }
-
-?> \ No newline at end of file
diff --git a/mod/groups/views/rss/object/groupforumtopic.php b/mod/groups/views/rss/object/groupforumtopic.php
index 19297b350..d730ef796 100644
--- a/mod/groups/views/rss/object/groupforumtopic.php
+++ b/mod/groups/views/rss/object/groupforumtopic.php
@@ -1,32 +1,35 @@
<?php
/**
- * Elgg groupforumtopic view
+ * Elgg groupforumtopic RSS view
*
- * @package Elgg
- * @subpackage Core
+ * @package ElggGroups
*/
$title = $vars['entity']->title;
-
-$body = '';
-$annotation = $vars['entity']->getAnnotations('group_topic_post', 1, 0, "asc");
-if (count($annotation == 1)) {
- $body = $annotation[0]->value;
+if (empty($title)) {
+ $title = strip_tags($vars['entity']->description);
+ $title = elgg_get_excerpt($title, 32);
}
-?>
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+
+$description = autop($vars['entity']->description);
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item', $vars);
+
+$item = <<<__HTML
<item>
-<guid isPermaLink='true'><?php echo htmlspecialchars($vars['entity']->getURL()); ?></guid>
-<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
-<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
-<title><![CDATA[<?php echo $title; ?>]]></title>
-<description><![CDATA[<?php echo (autop($body)); ?>]]></description>
-<?php
- $owner = $vars['entity']->getOwnerEntity();
- if ($owner) {
-?>
-<dc:creator><?php echo $owner->name; ?></dc:creator>
-<?php
- }
-?>
-</item> \ No newline at end of file
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
+</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php
index f39d25f4b..be853f2ce 100644
--- a/mod/invitefriends/start.php
+++ b/mod/invitefriends/start.php
@@ -27,6 +27,7 @@ function invitefriends_init() {
* Page handler function
*
* @param array $page Page URL segments
+ * @return bool
*/
function invitefriends_page_handler($page) {
gatekeeper();
@@ -45,4 +46,5 @@ function invitefriends_page_handler($page) {
$body = elgg_view_layout('one_sidebar', $params);
echo elgg_view_page($title, $body);
+ return true;
}
diff --git a/mod/members/start.php b/mod/members/start.php
index 2c1793c17..54787cd16 100644
--- a/mod/members/start.php
+++ b/mod/members/start.php
@@ -19,6 +19,7 @@ function members_init() {
* Members page handler
*
* @param array $page url segments
+ * @return bool
*/
function members_page_handler($page) {
$base = elgg_get_plugins_path() . 'members/pages/members';
@@ -36,4 +37,5 @@ function members_page_handler($page) {
} else {
require_once "$base/index.php";
}
+ return true;
}
diff --git a/mod/messageboard/start.php b/mod/messageboard/start.php
index 0b0155069..0c65edc4f 100644
--- a/mod/messageboard/start.php
+++ b/mod/messageboard/start.php
@@ -84,8 +84,10 @@ function messageboard_page_handler($page) {
set_input('page_owner_guid', $owner_guid);
include "$pages/owner.php";
break;
- }
+ default:
+ return false;
+ }
return true;
}
diff --git a/mod/messages/start.php b/mod/messages/start.php
index 4a3b0b250..e4ef4d43a 100644
--- a/mod/messages/start.php
+++ b/mod/messages/start.php
@@ -115,7 +115,6 @@ function messages_page_handler($page) {
default:
return false;
}
-
return true;
}
diff --git a/mod/notifications/start.php b/mod/notifications/start.php
index c6701cc3e..761f17e40 100644
--- a/mod/notifications/start.php
+++ b/mod/notifications/start.php
@@ -36,6 +36,7 @@ function notifications_plugin_init() {
* Route page requests
*
* @param array $page Array of url parameters
+ * @return bool
*/
function notifications_page_handler($page) {
@@ -51,12 +52,12 @@ function notifications_page_handler($page) {
require "$base/groups.php";
break;
case 'personal':
- default:
require "$base/index.php";
break;
+ default:
+ return false;
}
-
- return TRUE;
+ return true;
}
/**
diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
index a7fbec2fd..e89ce02be 100644
--- a/mod/notifications/views/default/notifications/subscriptions/forminternals.php
+++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
@@ -234,7 +234,7 @@ END;
<td class="namefield">
<a href="<?php echo $friend->getURL(); ?>">
<?php
- echo elgg_view_entity_icon($friend, 'tiny', array('hover' => false));
+ echo elgg_view_entity_icon($friend, 'tiny', array('use_hover' => false));
?>
</a>
<p class="namefieldlink">
diff --git a/mod/pages/start.php b/mod/pages/start.php
index 744306649..b2f26c719 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -100,6 +100,7 @@ function pages_init() {
* Title is ignored
*
* @param array $page
+ * @return bool
*/
function pages_page_handler($page) {
@@ -149,12 +150,12 @@ function pages_page_handler($page) {
include "$base_dir/revision.php";
break;
case 'all':
- default:
include "$base_dir/world.php";
break;
+ default:
+ return false;
}
-
- return;
+ return true;
}
/**
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 0f13ad844..0ee2d0152 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -48,6 +48,7 @@ function profile_init() {
* Profile page handler
*
* @param array $page Array of URL segments passed by the page handling mechanism
+ * @return bool
*/
function profile_page_handler($page) {
@@ -84,6 +85,7 @@ function profile_page_handler($page) {
$body = elgg_view_layout('one_column', array('content' => $content));
echo elgg_view_page($title, $body);
+ return true;
}
/**
diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php
index 05cb41a14..35199726a 100644
--- a/mod/profile/views/default/profile/owner_block.php
+++ b/mod/profile/views/default/profile/owner_block.php
@@ -11,7 +11,7 @@ if (!$user) {
return TRUE;
}
-$icon = elgg_view_entity_icon($user, 'large', array('hover' => 'true'));
+$icon = elgg_view_entity_icon($user, 'large', array('use_hover' => 'true'));
// grab the actions and admin menu items from user hover
$menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array());
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index 66a1248d9..8b18a4d64 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -60,6 +60,7 @@ function reportedcontent_init() {
* Serves the add report page
*
* @param array $page Array of page routing elements
+ * @return bool
*/
function reportedcontent_page_handler($page) {
// only logged in users can report things
@@ -76,6 +77,7 @@ function reportedcontent_page_handler($page) {
$body = elgg_view_layout('one_sidebar', $params);
echo elgg_view_page(elgg_echo('reportedcontent:this'), $body);
+ return true;
}
/**
diff --git a/mod/search/start.php b/mod/search/start.php
index 9ab14f42f..73a96dc0a 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -14,7 +14,7 @@ function search_init() {
require_once 'search_hooks.php';
// page handler for search actions and results
- elgg_register_page_handler('search','search_page_handler');
+ elgg_register_page_handler('search', 'search_page_handler');
// register some default search hooks
elgg_register_plugin_hook_handler('search', 'object', 'search_objects_hook');
@@ -55,7 +55,8 @@ function search_init() {
/**
* Page handler for search
*
- * @param array $page Page elements from pain page handler
+ * @param array $page Page elements from core page handler
+ * @return bool
*/
function search_page_handler($page) {
@@ -71,6 +72,7 @@ function search_page_handler($page) {
$base_dir = elgg_get_plugins_path() . 'search/pages/search';
include_once("$base_dir/index.php");
+ return true;
}
/**
diff --git a/mod/search/views/rss/search/listing.php b/mod/search/views/rss/search/list.php
index 32082fd31..32082fd31 100644
--- a/mod/search/views/rss/search/listing.php
+++ b/mod/search/views/rss/search/list.php
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php
index 9716fc060..3c83d145f 100644
--- a/mod/thewire/languages/en.php
+++ b/mod/thewire/languages/en.php
@@ -20,6 +20,7 @@ $english = array(
'thewire:noposts' => "No wire posts yet",
'item:object:thewire' => "Wire posts",
'thewire:update' => 'Update',
+ 'thewire:by' => 'Wire post by %s',
'thewire:previous' => "Previous",
'thewire:hide' => "Hide",
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index d5e995359..2ed0f0b4d 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -84,57 +84,60 @@ function thewire_init() {
* thewire/tag/<tag> View wire posts tagged with <tag>
*
* @param array $page From the page_handler function
- * @return true|false Depending on success
+ * @return bool
*/
function thewire_page_handler($page) {
$base_dir = elgg_get_plugins_path() . 'thewire/pages/thewire';
- // if just /thewire go to global view in the else statement
- if (isset($page[0]) && $page[0]) {
-
- switch ($page[0]) {
- case "all":
- include "$base_dir/everyone.php";
- break;
-
- case "friends":
- include "$base_dir/friends.php";
- break;
-
- case "owner":
- include "$base_dir/owner.php";
- break;
-
- case "thread":
- if (isset($page[1])) {
- set_input('thread_id', $page[1]);
- }
- include "$base_dir/thread.php";
- break;
- case "reply":
- if (isset($page[1])) {
- set_input('guid', $page[1]);
- }
- include "$base_dir/reply.php";
- break;
- case "tag":
- if (isset($page[1])) {
- set_input('tag', $page[1]);
- }
- include "$base_dir/tag.php";
- break;
- case "previous":
- if (isset($page[1])) {
- set_input('guid', $page[1]);
- }
- include "$base_dir/previous.php";
- break;
- }
- } else {
- include "$base_dir/everyone.php";
+ if (!isset($page[0])) {
+ $page = array('all');
}
+ switch ($page[0]) {
+ case "all":
+ include "$base_dir/everyone.php";
+ break;
+
+ case "friends":
+ include "$base_dir/friends.php";
+ break;
+
+ case "owner":
+ include "$base_dir/owner.php";
+ break;
+
+ case "thread":
+ if (isset($page[1])) {
+ set_input('thread_id', $page[1]);
+ }
+ include "$base_dir/thread.php";
+ break;
+
+ case "reply":
+ if (isset($page[1])) {
+ set_input('guid', $page[1]);
+ }
+ include "$base_dir/reply.php";
+ break;
+
+ case "tag":
+ if (isset($page[1])) {
+ set_input('tag', $page[1]);
+ }
+ include "$base_dir/tag.php";
+ break;
+
+ case "previous":
+ if (isset($page[1])) {
+ set_input('guid', $page[1]);
+ }
+ include "$base_dir/previous.php";
+ break;
+
+ default:
+ return false;
+ }
return true;
}
diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php
index 8229f46f1..494c2c8dc 100644
--- a/mod/thewire/views/rss/object/thewire.php
+++ b/mod/thewire/views/rss/object/thewire.php
@@ -2,46 +2,35 @@
/**
* Elgg thewire rss view
*
- * @package Elgg
- * @subpackage Core
+ * @package ElggTheWire
*/
$owner = $vars['entity']->getOwnerEntity();
-if ($owner) {
- $title = elgg_echo('thewire:by', array($owner->name));
-} else {
- $subtitle = strip_tags($vars['entity']->description);
- $title = elgg_get_excerpt($subtitle, 32);
+if (!$owner) {
+ return true;
}
-?>
+$title = elgg_echo('thewire:by', array($owner->name));
+$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
+$pubdate = date('r', $vars['entity']->getTimeCreated());
+
+$description = autop($vars['entity']->description);
+
+$creator = elgg_view('page/components/creator', $vars);
+$georss = elgg_view('page/components/georss', $vars);
+$extension = elgg_view('extensions/item', $vars);
+
+$item = <<<__HTML
<item>
-<guid isPermaLink='false'><?php echo $vars['entity']->getGUID(); ?></guid>
-<pubDate><?php echo date("r", $vars['entity']->time_created) ?></pubDate>
-<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
-<title><![CDATA[<?php echo $title; ?>]]></title>
-<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
-<?php
-$owner = $vars['entity']->getOwnerEntity();
-if ($owner) {
- ?>
- <dc:creator><?php echo $owner->name; ?></dc:creator>
- <?php
-}
-?>
-<?php
-if (
- ($vars['entity'] instanceof Locatable) &&
- ($vars['entity']->getLongitude()) &&
- ($vars['entity']->getLatitude())
-) {
- ?>
- <georss:point>
- <?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?>
- </georss:point>
- <?php
-}
-?>
-<?php echo elgg_view('extensions/item'); ?>
+ <guid isPermaLink="true">$permalink</guid>
+ <pubDate>$pubdate</pubDate>
+ <link>$permalink</link>
+ <title><![CDATA[$title]]></title>
+ <description><![CDATA[$description]]></description>
+ $creator$georss$extension
</item>
+
+__HTML;
+
+echo $item;
diff --git a/mod/twitter_api/lib/twitter_api.php b/mod/twitter_api/lib/twitter_api.php
index b14b84f2d..355123992 100644
--- a/mod/twitter_api/lib/twitter_api.php
+++ b/mod/twitter_api/lib/twitter_api.php
@@ -184,29 +184,22 @@ function twitter_api_create_user($twitter) {
function twitter_api_update_user_avatar($user, $file_location) {
// twitter's images have a few suffixes:
// _normal
- // _resonably_small
+ // _reasonably_small
// _mini
// the twitter app here returns _normal. We want standard, so remove the suffix.
// @todo Should probably check that it's an image file.
$file_location = str_replace('_normal.jpg', '.jpg', $file_location);
- $sizes = array(
- 'topbar' => array(16, 16, TRUE),
- 'tiny' => array(25, 25, TRUE),
- 'small' => array(40, 40, TRUE),
- 'medium' => array(100, 100, TRUE),
- 'large' => array(200, 200, FALSE),
- 'master' => array(550, 550, FALSE),
- );
+ $icon_sizes = elgg_get_config('icon_sizes');
$filehandler = new ElggFile();
$filehandler->owner_guid = $user->getGUID();
- foreach ($sizes as $size => $dimensions) {
+ foreach ($icon_sizes as $size => $dimensions) {
$image = get_resized_image_from_existing_file(
$file_location,
- $dimensions[0],
- $dimensions[1],
- $dimensions[2]
+ $dimensions['w'],
+ $dimensions['h'],
+ $dimensions['square']
);
$filehandler->setFilename("profile/$user->guid$size.jpg");
diff --git a/mod/twitter_api/start.php b/mod/twitter_api/start.php
index b17643c8c..08bce5479 100644
--- a/mod/twitter_api/start.php
+++ b/mod/twitter_api/start.php
@@ -45,6 +45,7 @@ function twitter_api_init() {
* Handles old pg/twitterservice/ handler
*
* @param array $page
+ * @return bool
*/
function twitter_api_pagehandler_deprecated($page) {
$url = elgg_get_site_url() . 'pg/twitter_api/authorize';
@@ -59,10 +60,11 @@ function twitter_api_pagehandler_deprecated($page) {
* Serves pages for twitter.
*
* @param array $page
+ * @return void
*/
function twitter_api_pagehandler($page) {
if (!isset($page[0])) {
- forward();
+ return false;
}
switch ($page[0]) {
@@ -91,9 +93,9 @@ function twitter_api_pagehandler($page) {
include "$pages/interstitial.php";
break;
default:
- forward();
- break;
+ return false;
}
+ return true;
}
/**
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 037f863a9..8de5d0522 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -150,6 +150,7 @@ function uservalidationbyemail_check_auth_attempt($credentials) {
* Checks sent passed validation code and user guids and validates the user.
*
* @param array $page
+ * @return bool
*/
function uservalidationbyemail_page_handler($page) {
@@ -163,7 +164,7 @@ function uservalidationbyemail_page_handler($page) {
$user = get_entity($user_guid);
- if (($code) && ($user)) {
+ if ($code && $user) {
if (uservalidationbyemail_validate_email($user_guid, $code)) {
elgg_push_context('uservalidationbyemail_validate_user');
@@ -185,7 +186,8 @@ function uservalidationbyemail_page_handler($page) {
register_error(elgg_echo('email:confirm:fail'));
}
- forward();
+ // forward to front page
+ forward('');
}
/**