aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-05 19:15:42 -0400
committercash <cash.costello@gmail.com>2011-11-05 19:15:42 -0400
commit61d24f4b7b4fd4d5e960593a25a0d96b11891ff0 (patch)
treeaf0128a6f7a99aa92c807bcfad03341c08fd35a6
parenteeade2d2716826b419c1ca67a62a102017c31b02 (diff)
downloadelgg-61d24f4b7b4fd4d5e960593a25a0d96b11891ff0.tar.gz
elgg-61d24f4b7b4fd4d5e960593a25a0d96b11891ff0.tar.bz2
Fixes #4024 fixed a lot of notices - enough for this release - found a few bugs
-rw-r--r--engine/classes/ElggMenuItem.php3
-rw-r--r--engine/lib/elgglib.php8
-rw-r--r--engine/lib/navigation.php8
-rw-r--r--engine/lib/views.php9
-rw-r--r--mod/blog/start.php6
-rw-r--r--mod/file/start.php2
-rw-r--r--mod/groups/lib/discussion.php2
-rw-r--r--mod/groups/lib/groups.php2
-rw-r--r--mod/groups/views/default/object/groupforumtopic.php3
-rw-r--r--mod/notifications/groups.php2
-rw-r--r--mod/notifications/index.php10
-rw-r--r--mod/profile/start.php2
-rw-r--r--mod/thewire/pages/thewire/everyone.php2
-rw-r--r--pages/settings/account.php2
-rw-r--r--views/default/forms/login.php2
-rw-r--r--views/default/input/button.php2
-rw-r--r--views/default/output/access.php2
-rw-r--r--views/default/page/components/gallery.php1
-rw-r--r--views/default/page/components/list.php8
-rw-r--r--views/default/page/components/module.php2
-rw-r--r--views/default/page/layouts/one_column.php4
-rw-r--r--views/default/page/layouts/widgets.php8
22 files changed, 61 insertions, 29 deletions
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 8ddb1ecd8..289919a8e 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -100,6 +100,9 @@ class ElggMenuItem {
if (!isset($options['name']) || !isset($options['text'])) {
return NULL;
}
+ if (!isset($options['href'])) {
+ $options['href'] = '';
+ }
$item = new ElggMenuItem($options['name'], $options['text'], $options['href']);
unset($options['name']);
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 10804fdca..47ca157e1 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1475,8 +1475,12 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset
$url1_info = parse_url($url1);
$url2_info = parse_url($url2);
- $url1_info['path'] = trim($url1_info['path'], '/');
- $url2_info['path'] = trim($url2_info['path'], '/');
+ if (isset($url1_info['path'])) {
+ $url1_info['path'] = trim($url1_info['path'], '/');
+ }
+ if (isset($url2_info['path'])) {
+ $url2_info['path'] = trim($url2_info['path'], '/');
+ }
// compare basic bits
$parts = array('scheme', 'host', 'path');
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index aaf9fb544..176790188 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -207,7 +207,7 @@ function elgg_register_title_button($handler = null, $name = 'add') {
*/
function elgg_push_breadcrumb($title, $link = NULL) {
global $CONFIG;
- if (!is_array($CONFIG->breadcrumbs)) {
+ if (!isset($CONFIG->breadcrumbs)) {
$CONFIG->breadcrumbs = array();
}
@@ -242,7 +242,11 @@ function elgg_pop_breadcrumb() {
function elgg_get_breadcrumbs() {
global $CONFIG;
- return (is_array($CONFIG->breadcrumbs)) ? $CONFIG->breadcrumbs : array();
+ if (isset($CONFIG->breadcrumbs) && is_array($CONFIG->breadcrumbs)) {
+ return $CONFIG->breadcrumbs;
+ }
+
+ return array();
}
/**
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 6ca68ac8c..0f806b8be 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -743,7 +743,11 @@ function elgg_view_menu($menu_name, array $vars = array()) {
$sort_by = elgg_extract('sort_by', $vars, 'text');
- $menu = $CONFIG->menus[$menu_name];
+ if (isset($CONFIG->menus[$menu_name])) {
+ $menu = $CONFIG->menus[$menu_name];
+ } else {
+ $menu = array();
+ }
// Give plugins a chance to add menu items just before creation.
// This supports dynamic menus (example: user_hover).
@@ -1198,7 +1202,8 @@ function elgg_view_image_block($image, $body, $vars = array()) {
* @since 1.8.0
*/
function elgg_view_module($type, $title, $body, $vars = array()) {
- $vars['class'] .= " elgg-module-$type";
+
+ $vars['class'] = elgg_extract('class', $vars, '') . " elgg-module-$type";
$vars['title'] = $title;
$vars['body'] = $body;
return elgg_view('page/components/module', $vars);
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 052c63651..fa57e7b96 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -145,7 +145,11 @@ function blog_page_handler($page) {
return false;
}
- $params['sidebar'] .= elgg_view('blog/sidebar', array('page' => $page_type));
+ if (isset($params['sidebar'])) {
+ $params['sidebar'] .= elgg_view('blog/sidebar', array('page' => $page_type));
+ } else {
+ $params['sidebar'] = elgg_view('blog/sidebar', array('page' => $page_type));
+ }
$body = elgg_view_layout('content', $params);
diff --git a/mod/file/start.php b/mod/file/start.php
index d6e17cc4b..e15a9ad61 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -389,7 +389,7 @@ function file_icon_url_override($hook, $type, $returnvalue, $params) {
if ($size == 'large') {
$ext = '_lrg';
} else {
- $exit = '';
+ $ext = '';
}
$url = "mod/file/graphics/icons/{$type}{$ext}.gif";
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index 68e5e4884..2bda4678e 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -192,7 +192,7 @@ function discussion_handle_view_page($guid) {
);
$body = elgg_view_layout('content', $params);
- echo elgg_view_page($title, $body);
+ echo elgg_view_page($topic->title, $body);
}
/**
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 590ba2b35..7798e5dc3 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -447,7 +447,7 @@ function groups_register_profile_buttons($group) {
}
// group members
- if ($group->isMember($user)) {
+ if ($group->isMember(elgg_get_logged_in_user_entity())) {
if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) {
// leave
$url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}";
diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php
index a579d89a4..34e0ee3cc 100644
--- a/mod/groups/views/default/object/groupforumtopic.php
+++ b/mod/groups/views/default/object/groupforumtopic.php
@@ -28,7 +28,7 @@ $tags = elgg_view('output/tags', array('tags' => $topic->tags));
$date = elgg_view_friendly_time($topic->time_created);
$replies_link = '';
-$replies_text = '';
+$reply_text = '';
$num_replies = elgg_get_annotations(array(
'annotation_name' => 'group_topic_post',
'guid' => $topic->getGUID(),
@@ -76,7 +76,6 @@ if ($full) {
$body = elgg_view('output/longtext', array('value' => $topic->description));
echo <<<HTML
-$header
$info
$body
HTML;
diff --git a/mod/notifications/groups.php b/mod/notifications/groups.php
index d64c00c8e..45fb94e83 100644
--- a/mod/notifications/groups.php
+++ b/mod/notifications/groups.php
@@ -12,7 +12,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
gatekeeper();
elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
-$user = elgg_get_page_owner_guid();
+$user = elgg_get_page_owner_entity();
// Set the context to settings
elgg_set_context('settings');
diff --git a/mod/notifications/index.php b/mod/notifications/index.php
index e56042b73..882389fde 100644
--- a/mod/notifications/index.php
+++ b/mod/notifications/index.php
@@ -12,7 +12,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
gatekeeper();
elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
-$user = elgg_get_page_owner_guid();
+$user = elgg_get_page_owner_entity();
// Set the context to settings
elgg_set_context('settings');
@@ -24,7 +24,13 @@ elgg_push_breadcrumb($title);
// Get the form
$people = array();
-if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => 'notify', 'relationship_guid' => elgg_get_logged_in_user_guid(), 'types' => 'user', 'limit' => 99999))) {
+if ($people_ents = elgg_get_entities_from_relationship(array(
+ 'relationship' => 'notify',
+ 'relationship_guid' => elgg_get_logged_in_user_guid(),
+ 'types' => 'user',
+ 'limit' => 99999,
+ ))) {
+
foreach($people_ents as $ent) {
$people[] = $ent->guid;
}
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 0ee2d0152..adee838fc 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -84,7 +84,7 @@ function profile_page_handler($page) {
$content = elgg_view_layout('widgets', $params);
$body = elgg_view_layout('one_column', array('content' => $content));
- echo elgg_view_page($title, $body);
+ echo elgg_view_page($user->name, $body);
return true;
}
diff --git a/mod/thewire/pages/thewire/everyone.php b/mod/thewire/pages/thewire/everyone.php
index e78395c31..4e88d17af 100644
--- a/mod/thewire/pages/thewire/everyone.php
+++ b/mod/thewire/pages/thewire/everyone.php
@@ -14,7 +14,7 @@ if (elgg_is_logged_in()) {
$content .= elgg_view('input/urlshortener');
}
-$content .= elgg_list_entities(array(
+$content = elgg_list_entities(array(
'type' => 'object',
'subtype' => 'thewire',
'limit' => 15,
diff --git a/pages/settings/account.php b/pages/settings/account.php
index e6a5da97b..1a57f89d8 100644
--- a/pages/settings/account.php
+++ b/pages/settings/account.php
@@ -16,7 +16,7 @@ if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit()
$title = elgg_echo('usersettings:user');
-$content .= elgg_view('core/settings/account');
+$content = elgg_view('core/settings/account');
$params = array(
'content' => $content,
diff --git a/views/default/forms/login.php b/views/default/forms/login.php
index 9536bb439..6f6cc9906 100644
--- a/views/default/forms/login.php
+++ b/views/default/forms/login.php
@@ -31,7 +31,7 @@
<?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?>
<?php
- if ($vars['returntoreferer']) {
+ if (isset($vars['returntoreferer'])) {
echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true'));
}
?>
diff --git a/views/default/input/button.php b/views/default/input/button.php
index c21989919..9957fdc54 100644
--- a/views/default/input/button.php
+++ b/views/default/input/button.php
@@ -33,7 +33,7 @@ switch ($vars['type']) {
}
// blank src if trying to access an offsite image. @todo why?
-if (strpos($vars['src'], elgg_get_site_url()) === false) {
+if (isset($vars['src']) && strpos($vars['src'], elgg_get_site_url()) === false) {
$vars['src'] = "";
}
?>
diff --git a/views/default/output/access.php b/views/default/output/access.php
index f312608d5..811948323 100644
--- a/views/default/output/access.php
+++ b/views/default/output/access.php
@@ -20,7 +20,7 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'])) {
// we decided to show that the item is in a group, rather than its actual access level
// not required. Group ACLs are prepended with "Group: " when written.
//$access_id_string = elgg_echo('groups:group') . $container->name;
- $membership = $is_group->membership;
+ $membership = $container->membership;
if ($membership == ACCESS_PUBLIC) {
$access_class .= ' elgg-access-group-open';
diff --git a/views/default/page/components/gallery.php b/views/default/page/components/gallery.php
index f03eb1109..149ceeaf8 100644
--- a/views/default/page/components/gallery.php
+++ b/views/default/page/components/gallery.php
@@ -39,6 +39,7 @@ if (isset($vars['item_class'])) {
$item_class = "$item_class {$vars['item_class']}";
}
+$nav = '';
if ($pagination && $count) {
$nav .= elgg_view('navigation/pagination', array(
'offset' => $offset,
diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php
index c83fa0966..c0db50bc5 100644
--- a/views/default/page/components/list.php
+++ b/views/default/page/components/list.php
@@ -17,10 +17,10 @@
*/
$items = $vars['items'];
-$offset = $vars['offset'];
-$limit = $vars['limit'];
-$count = $vars['count'];
-$base_url = $vars['base_url'];
+$offset = elgg_extract('offset', $vars);
+$limit = elgg_extract('limit', $vars);
+$count = elgg_extract('count', $vars);
+$base_url = elgg_extract('base_url', $vars, '');
$pagination = elgg_extract('pagination', $vars, true);
$offset_key = elgg_extract('offset_key', $vars, 'offset');
$position = elgg_extract('position', $vars, 'after');
diff --git a/views/default/page/components/module.php b/views/default/page/components/module.php
index 0a2f1c35a..7e1eaff20 100644
--- a/views/default/page/components/module.php
+++ b/views/default/page/components/module.php
@@ -28,7 +28,7 @@ if (isset($vars['id'])) {
$id = "id=\"{$vars['id']}\"";
}
-if ($vars['header']) {
+if (isset($vars['header'])) {
$header = "<div class=\"elgg-head\">$header</div>";
} elseif ($title) {
$header = "<div class=\"elgg-head\"><h3>$title</h3></div>";
diff --git a/views/default/page/layouts/one_column.php b/views/default/page/layouts/one_column.php
index 7546a4cdf..491d5b459 100644
--- a/views/default/page/layouts/one_column.php
+++ b/views/default/page/layouts/one_column.php
@@ -30,7 +30,9 @@ $nav = elgg_extract('nav', $vars, elgg_view('navigation/breadcrumbs'));
echo $vars['content'];
// @deprecated 1.8
- echo $vars['area1'];
+ if (isset($vars['area1'])) {
+ echo $vars['area1'];
+ }
?>
</div>
</div> \ No newline at end of file
diff --git a/views/default/page/layouts/widgets.php b/views/default/page/layouts/widgets.php
index b2c54e854..e3819cc20 100644
--- a/views/default/page/layouts/widgets.php
+++ b/views/default/page/layouts/widgets.php
@@ -39,10 +39,14 @@ echo $vars['content'];
$widget_class = "elgg-col-1of{$num_columns}";
for ($column_index = 1; $column_index <= $num_columns; $column_index++) {
- $column_widgets = $widgets[$column_index];
+ if (isset($widgets[$column_index])) {
+ $column_widgets = $widgets[$column_index];
+ } else {
+ $column_widgets = array();
+ }
echo "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">";
- if (is_array($column_widgets) && sizeof($column_widgets) > 0) {
+ if (sizeof($column_widgets) > 0) {
foreach ($column_widgets as $widget) {
if (array_key_exists($widget->handler, $widget_types)) {
echo elgg_view_entity($widget, array('show_access' => $show_access));