From dd4bee83ae5961466a80728cb354fd460b32c916 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Tue, 21 Sep 2010 08:10:17 +0000 Subject: [PATCH] MDL-24321 switching to stdClass in /blocks/ --- blocks/community/locallib.php | 2 +- blocks/course_summary/block_course_summary.php | 4 ++-- blocks/glossary_random/block_glossary_random.php | 2 +- blocks/participants/block_participants.php | 2 +- blocks/private_files/block_private_files.php | 2 +- blocks/private_files/edit.php | 2 +- blocks/rss_client/block_rss_client.php | 2 +- blocks/site_main_menu/block_site_main_menu.php | 4 ++-- blocks/social_activities/block_social_activities.php | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/blocks/community/locallib.php b/blocks/community/locallib.php index 4e9b64169fe..726a11e5331 100644 --- a/blocks/community/locallib.php +++ b/blocks/community/locallib.php @@ -101,7 +101,7 @@ class block_community_manager { fclose($fp); $fs = get_file_storage(); - $record = new object(); + $record = new stdClass(); $record->contextid = get_context_instance(CONTEXT_USER, $USER->id)->id; $record->component = 'user'; $record->filearea = 'private'; diff --git a/blocks/course_summary/block_course_summary.php b/blocks/course_summary/block_course_summary.php index 790a5e6228a..52424c61c2c 100644 --- a/blocks/course_summary/block_course_summary.php +++ b/blocks/course_summary/block_course_summary.php @@ -22,8 +22,8 @@ class block_course_summary extends block_base { return ''; } - $this->content = new object(); - $options = new object(); + $this->content = new stdClass(); + $options = new stdClass(); $options->noclean = true; // Don't clean Javascripts etc $context = get_context_instance(CONTEXT_COURSE, $this->page->course->id); $this->page->course->summary = file_rewrite_pluginfile_urls($this->page->course->summary, 'pluginfile.php', $context->id, 'course', 'summary', NULL); diff --git a/blocks/glossary_random/block_glossary_random.php b/blocks/glossary_random/block_glossary_random.php index b70173e4142..336a955cf07 100644 --- a/blocks/glossary_random/block_glossary_random.php +++ b/blocks/glossary_random/block_glossary_random.php @@ -82,7 +82,7 @@ class block_glossary_random extends block_base { $text = "

".format_string($entry->concept,true)."

"; } - $options = new object; + $options = new stdClass(); $options->trusted = $entry->definitiontrust; $text .= format_text($entry->definition, $entry->definitionformat, $options); diff --git a/blocks/participants/block_participants.php b/blocks/participants/block_participants.php index d604f243955..5779210ab75 100644 --- a/blocks/participants/block_participants.php +++ b/blocks/participants/block_participants.php @@ -14,7 +14,7 @@ class block_participants extends block_list { return $this->content; } - $this->content = new object(); + $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; diff --git a/blocks/private_files/block_private_files.php b/blocks/private_files/block_private_files.php index d3c66ee2586..a552dd91423 100755 --- a/blocks/private_files/block_private_files.php +++ b/blocks/private_files/block_private_files.php @@ -54,7 +54,7 @@ class block_private_files extends block_base { $this->content->text = ''; $this->content->footer = ''; if (isloggedin() && !isguestuser()) { // Show the block - $this->content = new object(); + $this->content = new stdClass(); //TODO: add capability check here! diff --git a/blocks/private_files/edit.php b/blocks/private_files/edit.php index 7eb56f70783..5a7667bbd76 100644 --- a/blocks/private_files/edit.php +++ b/blocks/private_files/edit.php @@ -44,7 +44,7 @@ $PAGE->set_heading($title); $PAGE->set_pagelayout('mydashboard'); $PAGE->set_pagetype('user-private-files'); -$data = new object(); +$data = new stdClass(); $options = array('subdirs'=>1, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL); file_prepare_standard_filemanager($data, 'files', $options, $context, 'user', 'private', 0); diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 6a191ac3bf7..d7324090e8b 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -249,7 +249,7 @@ $description = break_up_long_words($description, 30); - $formatoptions = new object; + $formatoptions = new stdClass(); $formatoptions->para = false; $r.= html_writer::start_tag('div',array('class'=>'description')); diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index 75419a14473..3e6b993b034 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -16,7 +16,7 @@ class block_site_main_menu extends block_list { return $this->content; } - $this->content = new object(); + $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; @@ -133,7 +133,7 @@ class block_site_main_menu extends block_list { //Accessibility: incidental image - should be empty Alt text $icon = ' '; $this->content->items[] = ''.$icon.$instancename.''.$editbuttons; + ' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.$icon.$instancename.''.$editbuttons; } } } diff --git a/blocks/social_activities/block_social_activities.php b/blocks/social_activities/block_social_activities.php index 2e30c205397..3c3dc924e90 100644 --- a/blocks/social_activities/block_social_activities.php +++ b/blocks/social_activities/block_social_activities.php @@ -16,7 +16,7 @@ class block_social_activities extends block_list { return $this->content; } - $this->content = new object(); + $this->content = new stdClass(); $this->content->items = array(); $this->content->icons = array(); $this->content->footer = '';