Skip to content

Commit

Permalink
MDL-24321 switching to standard stdClass()
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 21, 2010
1 parent 8c6521b commit 6bdfef5
Show file tree
Hide file tree
Showing 53 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion admin/settings/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$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));
Expand Down
2 changes: 1 addition & 1 deletion admin/xmldb/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions blocks/comments/block_comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function get_content() {
$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';
Expand All @@ -50,7 +50,7 @@ function get_content() {
$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;
Expand Down
2 changes: 1 addition & 1 deletion comment/comment_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

// initilising comment object
if (!empty($client_id)) {
$args = new stdclass;
$args = new stdClass();
$args->context = $context;
$args->course = $course;
$args->cm = $cm;
Expand Down
2 changes: 1 addition & 1 deletion comment/comment_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$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;
Expand Down
6 changes: 3 additions & 3 deletions comment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function __construct($options) {
}

// 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;
Expand Down Expand Up @@ -282,7 +282,7 @@ public function output($return = true) {
$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;
Expand Down Expand Up @@ -486,7 +486,7 @@ public function add($content, $format = FORMAT_MOODLE) {
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;
Expand Down
2 changes: 1 addition & 1 deletion course/format/social/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion files/filebrowser_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

echo $OUTPUT->header(); // send headers

$err = new stdclass;
$err = new stdClass();
if (isguestuser()) {
$err->error = get_string('noguest');
die(json_encode($err));
Expand Down
2 changes: 1 addition & 1 deletion lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2639,7 +2639,7 @@ function xmldb_main_upgrade($oldversion) {
}
$active_licenses = array();

$license = new stdclass;
$license = new stdClass();

// add unknown license
$license->shortname = 'unknown';
Expand Down
6 changes: 3 additions & 3 deletions lib/filelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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'=>'/');

Expand All @@ -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, '/');
Expand Down
2 changes: 1 addition & 1 deletion lib/form/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function toHtml() {
$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);
Expand Down
4 changes: 2 additions & 2 deletions lib/form/filemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function toHtml() {
$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();
Expand Down Expand Up @@ -207,7 +207,7 @@ public function __construct(stdClass $options) {
}

// 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;
Expand Down
2 changes: 1 addition & 1 deletion lib/form/filepicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function toHtml() {

$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;
Expand Down
2 changes: 1 addition & 1 deletion lib/form/url.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function toHtml(){
$straddlink
</button>
EOD;
$args = new stdclass;
$args = new stdClass();
$args->accepted_types = '*';
$args->return_types = FILE_EXTERNAL;
$args->context = $PAGE->context;
Expand Down
2 changes: 1 addition & 1 deletion lib/licenselib.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static private function set_active_licenses() {
static public function install_licenses() {
$active_licenses = array();

$license = new stdclass;
$license = new stdClass();

$license->shortname = 'unknown';
$license->fullname = 'Unknown license';
Expand Down
2 changes: 1 addition & 1 deletion lib/upgradelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ function display_submission($offset=-1,$userid =-1, $display=true) {

$this->preprocess_submission($submission);

$mformdata = new stdclass;
$mformdata = new stdClass();
$mformdata->context = $this->context;
$mformdata->maxbytes = $this->course->maxbytes;
$mformdata->courseid = $this->course->id;
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/type/upload/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

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
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/chat_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
$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;
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/gui_ajax/theme/bubble/config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$chattheme_cfg = new stdclass;
$chattheme_cfg = new stdClass();
$chattheme_cfg->avatar = true;
$chattheme_cfg->align = true;
$chattheme_cfg->event_message = <<<TEMPLATE
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/gui_ajax/theme/compact/config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$chattheme_cfg = new stdclass;
$chattheme_cfg = new stdClass();
$chattheme_cfg->avatar = false;
$chattheme_cfg->align = false;
$chattheme_cfg->event_message = <<<TEMPLATE
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ function chat_format_userlist($users, $course) {
*/
function chat_print_error($level, $msg) {
header('Content-Length: ' . ob_get_length() );
$error = new stdclass;
$error = new stdClass();
$error->level = $level;
$error->msg = $msg;
$response['error'] = $error;
Expand Down
2 changes: 1 addition & 1 deletion mod/data/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function xmldb_data_upgrade($oldversion) {
$lastdataid = $res->dataid;
$lastcourseid = $res->courseid;
}
$cmt = new stdclass;
$cmt = new stdClass();
$cmt->contextid = $modcontext->id;
$cmt->commentarea = 'database_entry';
$cmt->itemid = $res->itemid;
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/file/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function display_add_field($recordid=0) {
// itemid element
$html .= '<input type="hidden" name="field_'.$this->field->id.'_file" value="'.$itemid.'" />';

$options = new stdclass;
$options = new stdClass();
$options->maxbytes = $this->field->param3;
$options->itemid = $itemid;
$options->accepted_types = '*';
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/picture/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function display_add_field($recordid=0) {
$str .= '<img width="'.s($this->previewwidth).'" height="'.s($this->previewheight).'" src="'.$src.'" alt="" />';
}

$options = new stdclass;
$options = new stdClass();
$options->maxbytes = $this->field->param3;
$options->itemid = $itemid;
$options->accepted_types = array('image');
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/url/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class data_field_url extends data_field_base {
function display_add_field($recordid=0) {
global $CFG, $DB, $OUTPUT, $PAGE;

$args = new stdclass;
$args = new stdClass();
$args->accepted_types = '*';
$args->return_types = FILE_EXTERNAL;
$args->context = $this->context;
Expand Down
2 changes: 1 addition & 1 deletion mod/data/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
require_once('import_form.php');
echo $OUTPUT->heading(get_string('uploadrecords', 'data'), 3);
$form = new mod_data_import_form(new moodle_url('/mod/data/import.php'));
$formdata = new stdclass;
$formdata = new stdClass();
$formdata->d = $data->id;
$form->set_data($formdata);
$form->display();
Expand Down
4 changes: 2 additions & 2 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
if (!empty($CFG->usecomments)) {
require_once($CFG->dirroot . '/comment/lib.php');
list($context, $course, $cm) = get_context_info_array($context->id);
$cmt = new stdclass;
$cmt = new stdClass();
$cmt->context = $context;
$cmt->course = $course;
$cmt->cm = $cm;
Expand Down Expand Up @@ -1332,7 +1332,7 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
if (!empty($CFG->usecomments)) {
require_once($CFG->dirroot . '/comment/lib.php');
list($context, $course, $cm) = get_context_info_array($context->id);
$cmt = new stdclass;
$cmt = new stdClass();
$cmt->context = $context;
$cmt->course = $course;
$cmt->cm = $cm;
Expand Down
2 changes: 1 addition & 1 deletion mod/glossary/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function xmldb_glossary_upgrade($oldversion) {
$lastglossaryid = $res->glossaryid;
$lastcourseid = $res->courseid;
}
$cmt = new stdclass;
$cmt = new stdClass();
$cmt->contextid = $modcontext->id;
$cmt->commentarea = 'glossary_entry';
$cmt->itemid = $res->itemid;
Expand Down
2 changes: 1 addition & 1 deletion mod/glossary/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
if ( !$data = $form->get_data() ) {
echo $OUTPUT->box_start('glossarydisplay generalbox');
// display upload form
$data = new stdclass;
$data = new stdClass();
$data->id = $id;
$form->set_data($data);
$form->display();
Expand Down
2 changes: 1 addition & 1 deletion mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$output = true;
if (!empty($CFG->usecomments)) {
require_once($CFG->dirroot . '/comment/lib.php');
$cmt = new stdclass;
$cmt = new stdClass();
$cmt->component = 'mod_glossary';
$cmt->context = $context;
$cmt->course = $course;
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function quiz_update_effective_access($quiz, $userid) {
$override = $DB->get_record('quiz_overrides', array('quiz' => $quiz->id, 'userid' => $userid));

if (!$override) {
$override = new stdclass;
$override = new stdClass();
$override->timeopen = null;
$override->timeclose = null;
$override->timelimit = null;
Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ function wiki_delete_comment($idcomment, $context, $pageid) {
require_once($CFG->dirroot . '/comment/lib.php');

list($context, $course, $cm) = get_context_info_array($context->id);
$cmt = new stdclass;
$cmt = new stdClass();
$cmt->context = $context;
$cmt->itemid = $pageid;
$cmt->area = 'wiki_page';
Expand Down
4 changes: 2 additions & 2 deletions mod/wiki/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ function print_content($pagetitle = '') {

// @TODO: Change this to has_capability and show an alternative interface.
require_capability('mod/wiki:createpage', $context, NULL, true, 'nocreatepermission', 'wiki');
$data = new stdclass;
$data = new stdClass();
if (!empty($pagetitle)) {
$data->pagetitle = $pagetitle;
}
Expand Down Expand Up @@ -1037,7 +1037,7 @@ function print_header() {
parent::print_header();

$this->print_pagetitle();
$vstring = new stdclass;
$vstring = new stdClass();
$vstring->old = $this->compare;
$vstring->new = $this->comparewith;
echo $OUTPUT->heading(get_string('comparewith', 'wiki', $vstring));
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/allocation/manual/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function ui() {
$allocations = array();

foreach ($participants as $participant) {
$allocations[$participant->id] = new stdclass;
$allocations[$participant->id] = new stdClass();
$allocations[$participant->id]->userid = $participant->id;
$allocations[$participant->id]->submissionid = null;
$allocations[$participant->id]->reviewedby = array();
Expand Down
2 changes: 1 addition & 1 deletion question/previewlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function question_preview_question_pluginfile($course, $context, $component,

// Build fake attempt
$timenow = time();
$attempt = new stdclass;
$attempt = new stdClass();
$attempt->quiz = $quiz->id;
$attempt->userid = $USER->id;
$attempt->attempt = 0;
Expand Down
Loading

0 comments on commit 6bdfef5

Please sign in to comment.