mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-24321 switching to stdClass in /user/
This commit is contained in:
parent
c213773d59
commit
bf718f50ac
@ -52,7 +52,7 @@ if (!empty($users) && confirm_sesskey()) {
|
||||
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) {
|
||||
|
@ -60,7 +60,7 @@ $systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
if ($id == -1) {
|
||||
// creating new user
|
||||
$user = new object();
|
||||
$user = new stdClass();
|
||||
$user->id = -1;
|
||||
$user->auth = 'manual';
|
||||
$user->confirmed = 1;
|
||||
|
@ -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
|
||||
|
@ -55,7 +55,7 @@ $PAGE->set_heading($title);
|
||||
$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);
|
||||
|
@ -127,7 +127,7 @@ class user_filter_courserole extends user_filter_type {
|
||||
$roleid = $data['roleid'];
|
||||
$categoryid = $data['categoryid'];
|
||||
|
||||
$a = new object();
|
||||
$a = new stdClass();
|
||||
$a->label = $this->_label;
|
||||
|
||||
if ($roleid) {
|
||||
|
@ -134,7 +134,7 @@ class user_filter_date extends user_filter_type {
|
||||
$never = $data['never'];
|
||||
$field = $this->_field;
|
||||
|
||||
$a = new object();
|
||||
$a = new stdClass();
|
||||
$a->label = $this->_label;
|
||||
$a->after = userdate($after);
|
||||
$a->before = userdate($before);
|
||||
|
@ -81,7 +81,7 @@ class user_filter_globalrole extends user_filter_type {
|
||||
|
||||
$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).'"';
|
||||
|
||||
|
@ -188,7 +188,7 @@ class user_filter_profilefield extends user_filter_type {
|
||||
return '';
|
||||
}
|
||||
|
||||
$a = new object();
|
||||
$a = new stdClass();
|
||||
$a->label = $this->_label;
|
||||
$a->value = $value;
|
||||
$a->profile = $profile_fields[$profile];
|
||||
|
@ -120,7 +120,7 @@ class user_filter_select extends user_filter_type {
|
||||
return '';
|
||||
}
|
||||
|
||||
$a = new object();
|
||||
$a = new stdClass();
|
||||
$a->label = $this->_label;
|
||||
$a->value = '"'.s($this->_options[$value]).'"';
|
||||
$a->operator = $operators[$operator];
|
||||
|
@ -80,7 +80,7 @@ class user_filter_simpleselect extends user_filter_type {
|
||||
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');
|
||||
|
@ -129,7 +129,7 @@ class user_filter_text extends user_filter_type {
|
||||
$value = $data['value'];
|
||||
$operators = $this->getOperators();
|
||||
|
||||
$a = new object();
|
||||
$a = new stdClass();
|
||||
$a->label = $this->_label;
|
||||
$a->value = '"'.s($value).'"';
|
||||
$a->operator = $operators[$operator];
|
||||
|
@ -55,7 +55,7 @@ if (empty($CFG->enablenotes)) {
|
||||
}
|
||||
|
||||
if (!empty($users) && !empty($content) && confirm_sesskey()) {
|
||||
$note = new object();
|
||||
$note = new stdClass();
|
||||
$note->courseid = $id;
|
||||
$note->format = FORMAT_PLAIN;
|
||||
$note->content = $content;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
@ -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);
|
||||
@ -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;
|
||||
@ -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;
|
||||
|
@ -38,7 +38,7 @@ class profile_field_checkbox extends profile_field_base {
|
||||
* 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.' />';
|
||||
|
@ -89,7 +89,7 @@ echo $OUTPUT->heading(get_string('profilefields', 'admin'));
|
||||
|
||||
/// 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);
|
||||
|
@ -54,7 +54,7 @@ class profile_field_base {
|
||||
* 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);
|
||||
}
|
||||
@ -105,7 +105,7 @@ class profile_field_base {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = new object();
|
||||
$data = new stdClass();
|
||||
|
||||
$usernew->{$this->inputname} = $this->edit_save_data_preprocess($usernew->{$this->inputname}, $data);
|
||||
|
||||
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user