]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4024 fixed a lot of notices - enough for this release - found a few bugs
authorcash <cash.costello@gmail.com>
Sat, 5 Nov 2011 23:15:42 +0000 (19:15 -0400)
committercash <cash.costello@gmail.com>
Sat, 5 Nov 2011 23:15:42 +0000 (19:15 -0400)
22 files changed:
engine/classes/ElggMenuItem.php
engine/lib/elgglib.php
engine/lib/navigation.php
engine/lib/views.php
mod/blog/start.php
mod/file/start.php
mod/groups/lib/discussion.php
mod/groups/lib/groups.php
mod/groups/views/default/object/groupforumtopic.php
mod/notifications/groups.php
mod/notifications/index.php
mod/profile/start.php
mod/thewire/pages/thewire/everyone.php
pages/settings/account.php
views/default/forms/login.php
views/default/input/button.php
views/default/output/access.php
views/default/page/components/gallery.php
views/default/page/components/list.php
views/default/page/components/module.php
views/default/page/layouts/one_column.php
views/default/page/layouts/widgets.php

index 8ddb1ecd856979fade6e285e1bb232c0224b3b19..289919a8e146845ba991cabf4185030230cd477c 100644 (file)
@@ -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']);
index 10804fdcac7470d106557b7350b5975ea983b767..47ca157e102a4fd7cff55e67972f6f8f7266773e 100644 (file)
@@ -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');
index aaf9fb544e64590dd96c5e299b728eeb9c94acae..176790188997cc6290b266bef31e35333e5fefec 100644 (file)
@@ -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();
 }
 
 /**
index 6ca68ac8cd8cc14dbdae951f503c8b23eb6393dd..0f806b8be3454e28b4e33e22cf5ef863e4fda9f6 100644 (file)
@@ -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);
index 052c636510808053efbb3cf8be680e3d08536bf7..fa57e7b96640db2f7a52f8a65b9aaa3bc00f91e0 100644 (file)
@@ -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);
 
index d6e17cc4b95ca1dc19282fce8dc0a306c2931649..e15a9ad612147c2c3cbd16dbd70900a4c6a70c3f 100644 (file)
@@ -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";
index 68e5e48845ae8ff23df6e6d6b459d0d6822b7464..2bda4678e6ea0f9e8b29708295a9457c56c63c6d 100644 (file)
@@ -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);
 }
 
 /**
index 590ba2b35031f54958d6590aa6630301008f7fc1..7798e5dc3aebc4e8c0e91cd8c313a166bb58bb17 100644 (file)
@@ -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()}";
index a579d89a4203030a045bc2dcf3ee67e50050e6ee..34e0ee3cc03d5c0d58af439e48712f04a109a562 100644 (file)
@@ -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;
index d64c00c8ef4f9a4e4b4434e670ca97b85ab2df59..45fb94e83bd3e2b18d1e6ae83104b95dd482131f 100644 (file)
@@ -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');
index e56042b73fafccf4b8454cf89f1d3ba9a1b50aca..882389fde093e8f923ee1f1b5851e8a81d4bf991 100644 (file)
@@ -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;
        }
index 0ee2d01526671235ce2d9456914a07696258805a..adee838fc9f8fa08b72afa6226d44c925a6ed046 100644 (file)
@@ -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;
 }
 
index e78395c3122576bc36e56272d00d04233f9d3e30..4e88d17af766343ef471698265e7419ebd3c449e 100644 (file)
@@ -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,
index e6a5da97b8544d2983df5803b10da6f9ab2f02b1..1a57f89d8c25fcfc68e48c63a80c69db627cc014 100644 (file)
@@ -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,
index 9536bb4397729c4fca979a9d81fd5d857ab4f0b6..6f6cc990613cfacb0e46ba9e7b1ae12d523a9af3 100644 (file)
@@ -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'));
        }
        ?>
index c219899198173e4b6984126c1091a4fc6969af21..9957fdc54423c4d49d7d09b30c09d3cecd8abafe 100644 (file)
@@ -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'] = "";
 }
 ?>
index f312608d5a0c334ea5772c28fa93bb6079db994d..811948323ad43ceb7e404955617d0c5b02487549 100644 (file)
@@ -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';
index f03eb110971859782d59a94e0609eb752432c495..149ceeaf8128990bc88d0cbdd7cbe7fa734dd8bb 100644 (file)
@@ -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,
index c83fa0966baa4b19399ccb2753367d9d9e10b5fc..c0db50bc522c06e0ca7ba6daf0600558e265b956 100644 (file)
  */
 
 $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');
index 0a2f1c35a8f6c42310c743c66d1538d7a13455be..7e1eaff20306a98f864d6d7725505cfa5762b94c 100644 (file)
@@ -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>";
index 7546a4cdf606e6a00aba454d71ac17db7d85d471..491d5b4593ae3e89e7a3f0f2d790df0f9f9aa00b 100644 (file)
@@ -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
index b2c54e854119855f741fe28d0ecaf9ee6d6fd252..e3819cc206ecfad0f781762efe4fdb8caab42c94 100644 (file)
@@ -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));