Skip to content

Commit

Permalink
MDL-24321 switching to stdClass in /user/
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 21, 2010
1 parent c213773 commit bf718f5
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion user/addnote.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
print_error('invalidformdata', '', $CFG->wwwroot.'/user/index.php?id='.$id);
}

$note = new object();
$note = new stdClass();
$note->courseid = $id;
$note->format = FORMAT_PLAIN;
foreach ($users as $k => $v) {
Expand Down
2 changes: 1 addition & 1 deletion user/editadvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

if ($id == -1) {
// creating new user
$user = new object();
$user = new stdClass();
$user->id = -1;
$user->auth = 'manual';
$user->confirmed = 1;
Expand Down
2 changes: 1 addition & 1 deletion user/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {

$strrequired = get_string('required');

$nameordercheck = new object();
$nameordercheck = new stdClass();
$nameordercheck->firstname = 'a';
$nameordercheck->lastname = 'b';
if (fullname($nameordercheck) == 'b a' ) { // See MDL-4325
Expand Down
2 changes: 1 addition & 1 deletion user/filesedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$PAGE->set_pagelayout('mydashboard');
$PAGE->set_pagetype('user-files');

$data = new object();
$data = new stdClass();
$data->returnurl = $returnurl;
$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);
Expand Down
2 changes: 1 addition & 1 deletion user/filters/courserole.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function get_label($data) {
$roleid = $data['roleid'];
$categoryid = $data['categoryid'];

$a = new object();
$a = new stdClass();
$a->label = $this->_label;

if ($roleid) {
Expand Down
2 changes: 1 addition & 1 deletion user/filters/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function get_label($data) {
$never = $data['never'];
$field = $this->_field;

$a = new object();
$a = new stdClass();
$a->label = $this->_label;
$a->after = userdate($after);
$a->before = userdate($before);
Expand Down
2 changes: 1 addition & 1 deletion user/filters/globalrole.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function get_label($data) {

$rolename = $DB->get_field('role', 'name', array('id'=>$data['value']));

$a = new object();
$a = new stdClass();
$a->label = $this->_label;
$a->value = '"'.format_string($rolename).'"';

Expand Down
2 changes: 1 addition & 1 deletion user/filters/profilefield.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function get_label($data) {
return '';
}

$a = new object();
$a = new stdClass();
$a->label = $this->_label;
$a->value = $value;
$a->profile = $profile_fields[$profile];
Expand Down
2 changes: 1 addition & 1 deletion user/filters/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function get_label($data) {
return '';
}

$a = new object();
$a = new stdClass();
$a->label = $this->_label;
$a->value = '"'.s($this->_options[$value]).'"';
$a->operator = $operators[$operator];
Expand Down
2 changes: 1 addition & 1 deletion user/filters/simpleselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function get_sql_filter($data) {
function get_label($data) {
$value = $data['value'];

$a = new object();
$a = new stdClass();
$a->label = $this->_label;
$a->value = '"'.s($this->_options[$value]).'"';
$a->operator = get_string('isequalto','filters');
Expand Down
2 changes: 1 addition & 1 deletion user/filters/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function get_label($data) {
$value = $data['value'];
$operators = $this->getOperators();

$a = new object();
$a = new stdClass();
$a->label = $this->_label;
$a->value = '"'.s($value).'"';
$a->operator = $operators[$operator];
Expand Down
2 changes: 1 addition & 1 deletion user/groupaddnote.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}

if (!empty($users) && !empty($content) && confirm_sesskey()) {
$note = new object();
$note = new stdClass();
$note->courseid = $id;
$note->format = FORMAT_PLAIN;
$note->content = $content;
Expand Down
2 changes: 1 addition & 1 deletion user/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function user_delete_user($user) {
}

// mark internal user record as "deleted"
$updateuser = new object();
$updateuser = new stdClass();
$updateuser->id = $user->id;
$updateuser->deleted = 1;
$updateuser->username = $delname; // Remember it just in case
Expand Down
8 changes: 4 additions & 4 deletions user/profile/definelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function profile_reorder_fields() {
$i = 1;
if ($fields = $DB->get_records('user_info_field', array('categoryid'=>$category->id), 'sortorder ASC')) {
foreach ($fields as $field) {
$f = new object();
$f = new stdClass();
$f->id = $field->id;
$f->sortorder = $i++;
$DB->update_record('user_info_field', $f);
Expand All @@ -218,7 +218,7 @@ function profile_reorder_categories() {
$i = 1;
if ($categories = $DB->get_records('user_info_category', null, 'sortorder ASC')) {
foreach ($categories as $cat) {
$c = new object();
$c = new stdClass();
$c->id = $cat->id;
$c->sortorder = $i++;
$DB->update_record('user_info_category', $c);
Expand Down Expand Up @@ -263,7 +263,7 @@ function profile_delete_category($id) {

if ($fields = $DB->get_records('user_info_field', array('categoryid'=>$category->id), 'sortorder ASC')) {
foreach ($fields as $field) {
$f = new object();
$f = new stdClass();
$f->id = $field->id;
$f->sortorder = $sortorder++;
$f->categoryid = $newcategory->id;
Expand Down Expand Up @@ -453,7 +453,7 @@ function profile_edit_field($id, $datatype, $redirect) {
global $CFG, $DB, $OUTPUT, $PAGE;

if (!$field = $DB->get_record('user_info_field', array('id'=>$id))) {
$field = new object();
$field = new stdClass();
$field->datatype = $datatype;
$field->description = '';
$field->descriptionformat = FORMAT_HTML;
Expand Down
2 changes: 1 addition & 1 deletion user/profile/field/checkbox/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function edit_field_add(&$mform) {
* Display the data for this field
*/
function display_data() {
$options = new object();
$options = new stdClass();
$options->para = false;
$checked = intval($this->data) === 1 ? 'checked="checked"' : '';
return '<input disabled="disabled" type="checkbox" name="'.$this->inputname.'" '.$checked.' />';
Expand Down
2 changes: 1 addition & 1 deletion user/profile/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

/// Check that we have at least one category defined
if ($DB->count_records('user_info_category') == 0) {
$defaultcategory = new object();
$defaultcategory = new stdClass();
$defaultcategory->name = $strdefaultcategory;
$defaultcategory->sortorder = 1;
$DB->insert_record('user_info_category', $defaultcategory);
Expand Down
6 changes: 3 additions & 3 deletions user/profile/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function edit_field_add(&$mform) {
* Display the data for this field
*/
function display_data() {
$options = new object();
$options = new stdClass();
$options->para = false;
return format_text($this->data, FORMAT_MOODLE, $options);
}
Expand Down Expand Up @@ -105,7 +105,7 @@ function edit_save_data($usernew) {
return;
}

$data = new object();
$data = new stdClass();

$usernew->{$this->inputname} = $this->edit_save_data_preprocess($usernew->{$this->inputname}, $data);

Expand Down Expand Up @@ -471,7 +471,7 @@ function profile_signup_fields(&$mform) {
function profile_user_record($userid) {
global $CFG, $DB;

$usercustomfields = new object();
$usercustomfields = new stdClass();

if ($fields = $DB->get_records('user_info_field')) {
foreach ($fields as $field) {
Expand Down

0 comments on commit bf718f5

Please sign in to comment.