MDL-24321 switching to stdClass in /repository/

This commit is contained in:
Petr Skoda 2010-09-21 08:22:04 +00:00
parent 7f38934243
commit a27ab6fdfb
4 changed files with 8 additions and 8 deletions

View File

@ -75,13 +75,13 @@ class repository_alfresco extends repository {
public function print_login() {
if ($this->options['ajax']) {
$user_field = new object();
$user_field = new stdClass();
$user_field->label = get_string('username', 'repository_alfresco').': ';
$user_field->id = 'alfresco_username';
$user_field->type = 'text';
$user_field->name = 'al_username';
$passwd_field = new object();
$passwd_field = new stdClass();
$passwd_field->label = get_string('password', 'repository_alfresco').': ';
$passwd_field->id = 'alfresco_password';
$passwd_field->type = 'password';

View File

@ -125,7 +125,7 @@ switch ($action) {
//bad luck, we can not rename!
echo json_encode(false);
} else if ($file = $fs->get_file($user_context->id, 'user', 'draft', $draftid, $filepath, $filename)) {
$return = new object();
$return = new stdClass();
$newfile = $fs->create_file_from_storedfile(array('filename'=>$newfilename), $file);
$file->delete();
$return->filepath = $newfile->get_filepath();
@ -181,7 +181,7 @@ switch ($action) {
$file->delete();
}
$return = new object();
$return = new stdClass();
if ($action === 'renamedir') {
$return->filepath = $parent;
} else {
@ -200,7 +200,7 @@ switch ($action) {
//bad luck, we can not rename!
echo json_encode(false);
} else if ($file = $fs->get_file($user_context->id, 'user', 'draft', $draftid, $filepath, $filename)) {
$return = new object();
$return = new stdClass();
$newfile = $fs->create_file_from_storedfile(array('filepath'=>$newfilepath), $file);
$file->delete();
$return->filepath = $newfile->get_filepath();

View File

@ -1311,7 +1311,7 @@ abstract class repository {
global $DB;
if (!empty($options['name'])) {
$r = new object();
$r = new stdClass();
$r->id = $this->id;
$r->name = $options['name'];
$DB->update_record('repository_instances', $r);
@ -1321,7 +1321,7 @@ abstract class repository {
if ($id = $DB->get_field('repository_instance_config', 'id', array('name'=>$name, 'instanceid'=>$this->id))) {
$DB->set_field('repository_instance_config', 'value', $value, array('id'=>$id));
} else {
$config = new object();
$config = new stdClass();
$config->instanceid = $this->id;
$config->name = $name;
$config->value = $value;

View File

@ -51,7 +51,7 @@ class repository_wikimedia extends repository {
// if check_login returns false,
// this function will be called to print a login form.
public function print_login() {
$keyword = new object();
$keyword = new stdClass();
$keyword->label = get_string('keyword', 'repository_wikimedia').': ';
$keyword->id = 'input_text_keyword';
$keyword->type = 'text';