From 6bdfef5da9c8a741f916d4b3c918bd24be8b54e1 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Tue, 21 Sep 2010 08:54:01 +0000 Subject: [PATCH] MDL-24321 switching to standard stdClass() --- admin/settings/security.php | 2 +- admin/xmldb/index.php | 2 +- blocks/comments/block_comments.php | 4 ++-- comment/comment_ajax.php | 2 +- comment/comment_post.php | 2 +- comment/lib.php | 6 +++--- course/format/social/format.php | 2 +- files/filebrowser_ajax.php | 2 +- lib/db/upgrade.php | 2 +- lib/filelib.php | 6 +++--- lib/form/editor.php | 2 +- lib/form/filemanager.php | 4 ++-- lib/form/filepicker.php | 2 +- lib/form/url.php | 2 +- lib/licenselib.php | 2 +- lib/upgradelib.php | 2 +- mod/assignment/lib.php | 2 +- mod/assignment/type/upload/upload.php | 2 +- mod/chat/chat_ajax.php | 2 +- mod/chat/gui_ajax/theme/bubble/config.php | 2 +- mod/chat/gui_ajax/theme/compact/config.php | 2 +- mod/chat/lib.php | 2 +- mod/data/db/upgrade.php | 2 +- mod/data/field/file/field.class.php | 2 +- mod/data/field/picture/field.class.php | 2 +- mod/data/field/url/field.class.php | 2 +- mod/data/import.php | 2 +- mod/data/lib.php | 4 ++-- mod/glossary/db/upgrade.php | 2 +- mod/glossary/import.php | 2 +- mod/glossary/lib.php | 2 +- mod/quiz/lib.php | 2 +- mod/wiki/locallib.php | 2 +- mod/wiki/pagelib.php | 4 ++-- mod/workshop/allocation/manual/lib.php | 2 +- question/previewlib.php | 2 +- question/type/truefalse/questiontype.php | 4 ++-- rating/rate.php | 2 +- rating/rate_ajax.php | 2 +- repository/draftfiles_ajax.php | 12 ++++++------ repository/draftfiles_manager.php | 2 +- repository/dropbox/lib.php | 2 +- repository/filepicker.php | 2 +- repository/flickr/lib.php | 2 +- repository/flickr_public/lib.php | 10 +++++----- repository/googledocs/lib.php | 2 +- repository/lib.php | 10 +++++----- repository/merlot/lib.php | 4 ++-- repository/picasa/lib.php | 2 +- repository/repository_ajax.php | 4 ++-- repository/upload/lib.php | 2 +- repository/url/lib.php | 2 +- repository/youtube/lib.php | 2 +- 53 files changed, 77 insertions(+), 77 deletions(-) diff --git a/admin/settings/security.php b/admin/settings/security.php index 4209805932b..444458035ff 100644 --- a/admin/settings/security.php +++ b/admin/settings/security.php @@ -28,7 +28,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $temp->add(new admin_setting_configselect('maxbytes', get_string('maxbytes', 'admin'), get_string('configmaxbytes', 'admin'), 0, $max_upload_choices)); // 100MB $defaultuserquota = 104857600; - $params = new stdclass; + $params = new stdClass(); $params->bytes = $defaultuserquota; $params->displaysize = display_size($defaultuserquota); $temp->add(new admin_setting_configtext('userquota', get_string('userquota', 'admin'), get_string('configuserquota', 'admin', $params), $defaultuserquota)); diff --git a/admin/xmldb/index.php b/admin/xmldb/index.php index 53daf816ed6..4b80b2862b3 100644 --- a/admin/xmldb/index.php +++ b/admin/xmldb/index.php @@ -112,7 +112,7 @@ print_error('xmldberror'); } } else { - $a = new stdclass; + $a = new stdClass(); $a->action = $action; $a->actionclass = $actionclass; print_error('cannotinstantiateclass', 'xmldb', '', $a); diff --git a/blocks/comments/block_comments.php b/blocks/comments/block_comments.php index c6c009045bf..979a8d82cb5 100644 --- a/blocks/comments/block_comments.php +++ b/blocks/comments/block_comments.php @@ -38,7 +38,7 @@ class block_comments extends block_base { $this->content->footer = ''; $this->content->text = ''; list($context, $course, $cm) = get_context_info_array($PAGE->context->id); - $args = new stdclass; + $args = new stdClass(); $args->context = $PAGE->context; $args->course = $course; $args->area = 'page_comments'; @@ -50,7 +50,7 @@ class block_comments extends block_base { $comment = new comment($args); $comment->set_view_permission(true); - $this->content = new stdClass; + $this->content = new stdClass(); $this->content->text = $comment->output(true); $this->content->footer = ''; return $this->content; diff --git a/comment/comment_ajax.php b/comment/comment_ajax.php index adbb0110e35..8f1ea5cc24d 100644 --- a/comment/comment_ajax.php +++ b/comment/comment_ajax.php @@ -54,7 +54,7 @@ echo $OUTPUT->header(); // send headers // initilising comment object if (!empty($client_id)) { - $args = new stdclass; + $args = new stdClass(); $args->context = $context; $args->course = $course; $args->cm = $cm; diff --git a/comment/comment_post.php b/comment/comment_post.php index 9338fc9302e..e0730def927 100644 --- a/comment/comment_post.php +++ b/comment/comment_post.php @@ -35,7 +35,7 @@ $itemid = optional_param('itemid', '', PARAM_INT); $returnurl = optional_param('returnurl', '', PARAM_URL); $component = optional_param('component', '', PARAM_ALPHAEXT); -$cmt = new stdclass; +$cmt = new stdClass(); $cmt->contextid = $contextid; $cmt->courseid = $course->id; $cmt->area = $area; diff --git a/comment/lib.php b/comment/lib.php index 61036304d99..59e6d6e35ed 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -185,7 +185,7 @@ class comment { } // setup options for callback functions - $this->args = new stdclass; + $this->args = new stdClass(); $this->args->context = $this->context; $this->args->courseid = $this->courseid; $this->args->cm = $this->cm; @@ -282,7 +282,7 @@ EOD; $murl->remove_params('comment_page'); $this->link = $murl->out(); - $options = new stdclass; + $options = new stdClass(); $options->client_id = $this->cid; $options->commentarea = $this->commentarea; $options->itemid = $this->itemid; @@ -486,7 +486,7 @@ EOD; throw new comment_exception('nopermissiontocomment'); } $now = time(); - $newcmt = new stdclass; + $newcmt = new stdClass(); $newcmt->contextid = $this->contextid; $newcmt->commentarea = $this->commentarea; $newcmt->itemid = $this->itemid; diff --git a/course/format/social/format.php b/course/format/social/format.php index 25f0c8fa626..f989f6fc830 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -13,7 +13,7 @@ /// Print forum intro above posts MDL-18483 if (trim($forum->intro) != '') { - $options = new stdclass; + $options = new stdClass(); $options->para = false; $introcontent = format_module_intro('forum', $forum, $cm->id); diff --git a/files/filebrowser_ajax.php b/files/filebrowser_ajax.php index 8ecc13423a1..96099863274 100755 --- a/files/filebrowser_ajax.php +++ b/files/filebrowser_ajax.php @@ -36,7 +36,7 @@ require_login(); echo $OUTPUT->header(); // send headers -$err = new stdclass; +$err = new stdClass(); if (isguestuser()) { $err->error = get_string('noguest'); die(json_encode($err)); diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index ac1f7500909..bf9d9d74cfa 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2639,7 +2639,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL"); } $active_licenses = array(); - $license = new stdclass; + $license = new stdClass(); // add unknown license $license->shortname = 'unknown'; diff --git a/lib/filelib.php b/lib/filelib.php index 53e044294e3..18637a0aa82 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -475,7 +475,7 @@ function file_get_drafarea_folders($draftitemid, $filepath, &$data) { if ($files = $fs->get_directory_files($context->id, 'user', 'draft', $draftitemid, $filepath, false)) { foreach ($files as $file) { if ($file->is_directory()) { - $item = new stdclass; + $item = new stdClass(); $item->sortorder = $file->get_sortorder(); $item->filepath = $file->get_filepath(); @@ -505,7 +505,7 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') { $context = get_context_instance(CONTEXT_USER, $USER->id); $fs = get_file_storage(); - $data = new stdclass; + $data = new stdClass(); $data->path = array(); $data->path[] = array('name'=>get_string('files'), 'path'=>'/'); @@ -526,7 +526,7 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') { $maxlength = 12; if ($files = $fs->get_directory_files($context->id, 'user', 'draft', $draftitemid, $filepath, false)) { foreach ($files as $file) { - $item = new stdclass; + $item = new stdClass(); $item->filename = $file->get_filename(); $item->filepath = $file->get_filepath(); $item->fullname = trim($item->filename, '/'); diff --git a/lib/form/editor.php b/lib/form/editor.php index 95af0d15323..1ca0c371c83 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -161,7 +161,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { $draftitemid = $this->_values['itemid']; } - $args = new stdclass; + $args = new stdClass(); // need these three to filter repositories list $args->accepted_types = array('image'); $args->return_types = (FILE_INTERNAL | FILE_EXTERNAL); diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index 8033c2a57fb..89640f13c5f 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -135,7 +135,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element { $client_id = uniqid(); // filemanager options - $options = new stdclass; + $options = new stdClass(); $options->mainfile = $this->_options['mainfile']; $options->maxbytes = $this->_options['maxbytes']; $options->maxfiles = $this->getMaxfiles(); @@ -207,7 +207,7 @@ class form_filemanaer_x { } // building file picker options - $params = new stdclass; + $params = new stdClass(); $params->accepted_types = $options->accepted_types; $params->return_types = $options->return_types; $params->context = $options->context; diff --git a/lib/form/filepicker.php b/lib/form/filepicker.php index 81307651dab..1c590486fab 100644 --- a/lib/form/filepicker.php +++ b/lib/form/filepicker.php @@ -70,7 +70,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input { $client_id = uniqid(); - $args = new stdclass; + $args = new stdClass(); // need these three to filter repositories list $args->accepted_types = $this->_options['accepted_types']?$this->_options['accepted_types']:'*'; $args->return_types = FILE_INTERNAL; diff --git a/lib/form/url.php b/lib/form/url.php index 21cb1e7817a..8822aa8ec46 100755 --- a/lib/form/url.php +++ b/lib/form/url.php @@ -62,7 +62,7 @@ class MoodleQuickForm_url extends HTML_QuickForm_text{ $straddlink EOD; - $args = new stdclass; + $args = new stdClass(); $args->accepted_types = '*'; $args->return_types = FILE_EXTERNAL; $args->context = $PAGE->context; diff --git a/lib/licenselib.php b/lib/licenselib.php index b3c3789a5d3..c6700557653 100644 --- a/lib/licenselib.php +++ b/lib/licenselib.php @@ -140,7 +140,7 @@ class license_manager { static public function install_licenses() { $active_licenses = array(); - $license = new stdclass; + $license = new stdClass(); $license->shortname = 'unknown'; $license->fullname = 'Unknown license'; diff --git a/lib/upgradelib.php b/lib/upgradelib.php index 5adeecfe7f4..2d359cd13a5 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -1428,7 +1428,7 @@ function upgrade_plugin_mnet_functions($component) { $f = $data['filename']; $c = $data['classname']; foreach ($data['methods'] as $method) { - $dataobject = new stdclass; + $dataobject = new stdClass(); $dataobject->plugintype = $type; $dataobject->pluginname = $plugin; $dataobject->enabled = 1; diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index cdfd76b405e..23058952e45 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1001,7 +1001,7 @@ class assignment_base { $this->preprocess_submission($submission); - $mformdata = new stdclass; + $mformdata = new stdClass(); $mformdata->context = $this->context; $mformdata->maxbytes = $this->course->maxbytes; $mformdata->courseid = $this->course->id; diff --git a/mod/assignment/type/upload/upload.php b/mod/assignment/type/upload/upload.php index 93b0f7799ca..202efed3547 100644 --- a/mod/assignment/type/upload/upload.php +++ b/mod/assignment/type/upload/upload.php @@ -74,7 +74,7 @@ echo $OUTPUT->header(); echo $OUTPUT->box_start('generalbox'); if ($instance->can_upload_file($submission) && ($id==null)) { - $data = new stdclass; + $data = new stdClass(); // move submission files to user draft area $data = file_prepare_standard_filemanager($data, 'files', $filemanager_options, $context, 'mod_assignment', 'submission', $submission->id); // set file manager itemid, so it will find the files in draft area diff --git a/mod/chat/chat_ajax.php b/mod/chat/chat_ajax.php index 8542b3dfca4..836dc49cdf2 100644 --- a/mod/chat/chat_ajax.php +++ b/mod/chat/chat_ajax.php @@ -126,7 +126,7 @@ case 'update': $send_user_list = false; if ($messages && ($chat_lasttime != $chat_newlasttime)) { foreach ($messages as $n => &$message) { - $tmp = new stdclass; + $tmp = new stdClass(); // when somebody enter room, user list will be updated if (!empty($message->system)){ $send_user_list = true; diff --git a/mod/chat/gui_ajax/theme/bubble/config.php b/mod/chat/gui_ajax/theme/bubble/config.php index dbdf3c29151..f427d76e91b 100755 --- a/mod/chat/gui_ajax/theme/bubble/config.php +++ b/mod/chat/gui_ajax/theme/bubble/config.php @@ -1,5 +1,5 @@ avatar = true; $chattheme_cfg->align = true; $chattheme_cfg->event_message = <<