$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));
print_error('xmldberror');
}
} else {
- $a = new stdclass;
+ $a = new stdClass();
$a->action = $action;
$a->actionclass = $actionclass;
print_error('cannotinstantiateclass', 'xmldb', '', $a);
$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';
$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;
// initilising comment object
if (!empty($client_id)) {
- $args = new stdclass;
+ $args = new stdClass();
$args->context = $context;
$args->course = $course;
$args->cm = $cm;
$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;
}
// 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;
$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;
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;
/// 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);
echo $OUTPUT->header(); // send headers
-$err = new stdclass;
+$err = new stdClass();
if (isguestuser()) {
$err->error = get_string('noguest');
die(json_encode($err));
}
$active_licenses = array();
- $license = new stdclass;
+ $license = new stdClass();
// add unknown license
$license->shortname = 'unknown';
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();
$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'=>'/');
$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, '/');
$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);
$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();
}
// 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;
$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;
$straddlink
</button>
EOD;
- $args = new stdclass;
+ $args = new stdClass();
$args->accepted_types = '*';
$args->return_types = FILE_EXTERNAL;
$args->context = $PAGE->context;
static public function install_licenses() {
$active_licenses = array();
- $license = new stdclass;
+ $license = new stdClass();
$license->shortname = 'unknown';
$license->fullname = 'Unknown license';
$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;
$this->preprocess_submission($submission);
- $mformdata = new stdclass;
+ $mformdata = new stdClass();
$mformdata->context = $this->context;
$mformdata->maxbytes = $this->course->maxbytes;
$mformdata->courseid = $this->course->id;
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
$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;
<?php
-$chattheme_cfg = new stdclass;
+$chattheme_cfg = new stdClass();
$chattheme_cfg->avatar = true;
$chattheme_cfg->align = true;
$chattheme_cfg->event_message = <<<TEMPLATE
<?php
-$chattheme_cfg = new stdclass;
+$chattheme_cfg = new stdClass();
$chattheme_cfg->avatar = false;
$chattheme_cfg->align = false;
$chattheme_cfg->event_message = <<<TEMPLATE
*/
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;
$lastdataid = $res->dataid;
$lastcourseid = $res->courseid;
}
- $cmt = new stdclass;
+ $cmt = new stdClass();
$cmt->contextid = $modcontext->id;
$cmt->commentarea = 'database_entry';
$cmt->itemid = $res->itemid;
// 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 = '*';
$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');
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;
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();
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;
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;
$lastglossaryid = $res->glossaryid;
$lastcourseid = $res->courseid;
}
- $cmt = new stdclass;
+ $cmt = new stdClass();
$cmt->contextid = $modcontext->id;
$cmt->commentarea = 'glossary_entry';
$cmt->itemid = $res->itemid;
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();
$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;
$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;
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';
// @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;
}
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));
$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();
// Build fake attempt
$timenow = time();
- $attempt = new stdclass;
+ $attempt = new stdClass();
$attempt->quiz = $quiz->id;
$attempt->userid = $USER->id;
$attempt->attempt = 0;
$DB->update_record("question_answers", $true);
} else {
unset($true);
- $true = new stdclass;
+ $true = new stdClass();
$true->answer = get_string("true", "quiz");
$true->question = $question->id;
$true->fraction = $question->correctanswer;
$DB->update_record("question_answers", $false);
} else {
unset($false);
- $false = new stdclass;
+ $false = new stdClass();
$false->answer = get_string("false", "quiz");
$false->question = $question->id;
$false->fraction = 1 - (int)$question->correctanswer;
$PAGE->set_url('/lib/rate.php', array('contextid'=>$context->id));
if ($userrating != RATING_UNSET_RATING) {
- $ratingoptions = new stdclass;
+ $ratingoptions = new stdClass();
$ratingoptions->context = $context;
$ratingoptions->itemid = $itemid;
$ratingoptions->scaleid = $scaleid;
$PAGE->set_url('/lib/rate.php', array('contextid'=>$context->id));
//rating options used to update the rating then retrieve the aggregate
-$ratingoptions = new stdclass;
+$ratingoptions = new stdClass();
$ratingoptions->context = $context;
$ratingoptions->itemid = $itemid;
$ratingoptions->scaleid = $scaleid;
switch ($action) {
case 'dir':
- $data = new stdclass;
+ $data = new stdClass();
file_get_drafarea_folders($draftid, $filepath, $data);
echo json_encode($data);
die;
$fs = get_file_storage();
$fs->create_directory($user_context->id, 'user', 'draft', $draftid, file_correct_filepath(file_correct_filepath($filepath).$newdirname));
- $return = new stdclass;
+ $return = new stdClass();
$return->filepath = $filepath;
echo json_encode($return);
die;
$fs = get_file_storage();
$filepath = file_correct_filepath($filepath);
- $return = new stdclass;
+ $return = new stdClass();
if ($stored_file = $fs->get_file($user_context->id, 'user', 'draft', $draftid, $filepath, $filename)) {
$parent_path = $stored_file->get_parent_directory()->get_filepath();
if ($stored_file->is_directory()) {
$parent_path = $file->get_parent_directory()->get_filepath();
if ($newfile = $zipper->archive_to_storage(array($file), $user_context->id, 'user', 'draft', $draftid, $parent_path, $filepath.'.zip', $USER->id)) {
- $return = new stdclass;
+ $return = new stdClass();
$return->filepath = $parent_path;
echo json_encode($return);
} else {
// archive compressed file to an unused draft area
$newdraftitemid = file_get_unused_draft_itemid();
if ($newfile = $zipper->archive_to_storage(array($stored_file), $user_context->id, 'user', 'draft', $newdraftitemid, '/', $filename, $USER->id)) {
- $return = new stdclass;
+ $return = new stdClass();
$return->fileurl = moodle_url::make_draftfile_url($newdraftitemid, '/', $filename)->out();
$return->filepath = $parent_path;
echo json_encode($return);
$file = $fs->get_file($user_context->id, 'user', 'draft', $draftid, $filepath, $filename);
if ($newfile = $file->extract_to_storage($zipper, $user_context->id, 'user', 'draft', $draftid, $filepath, $USER->id)) {
- $return = new stdclass;
+ $return = new stdClass();
$return->filepath = $filepath;
echo json_encode($return);
} else {
echo html_writer::link($home_url, get_string('back', 'repository'));
echo $OUTPUT->container_end();
- $data = new stdclass;
+ $data = new stdClass();
$home_url->param('action', 'movefile');
$home_url->param('draftpath', $draftpath);
$home_url->param('filename', $filename);
$url = $result['authorize_url'];
if ($this->options['ajax']) {
$ret = array();
- $popup_btn = new stdclass;
+ $popup_btn = new stdClass();
$popup_btn->type = 'popup';
$popup_btn->url = $url;
$ret['login'] = array($popup_btn);
print_error('maxbytes');
}
if (!empty($thefile)) {
- $record = new stdclass;
+ $record = new stdClass();
$record->filepath = $savepath;
$record->filename = $filename;
$record->component = 'user';
public function print_login() {
if ($this->options['ajax']) {
$ret = array();
- $popup_btn = new stdclass;
+ $popup_btn = new stdClass();
$popup_btn->type = 'popup';
$popup_btn->url = $this->flickr->auth();
$ret['login'] = array($popup_btn);
public function print_login() {
if ($this->options['ajax']) {
$ret = array();
- $fulltext = new stdclass;
+ $fulltext = new stdClass();
$fulltext->label = get_string('fulltext', 'repository_flickr_public').': ';
$fulltext->id = 'el_fulltext';
$fulltext->type = 'text';
$fulltext->name = 'flickr_fulltext';
- $tag = new stdclass;
+ $tag = new stdClass();
$tag->label = get_string('tag', 'repository_flickr_public').': ';
$tag->id = 'el_tag';
$tag->type = 'text';
$tag->name = 'flickr_tag';
- $email_field = new stdclass;
+ $email_field = new stdClass();
$email_field->label = get_string('username', 'repository_flickr_public').': ';
$email_field->id = 'account';
$email_field->type = 'text';
$email_field->name = 'flickr_account';
- $commercial = new stdclass;
+ $commercial = new stdClass();
$commercial->label = get_string('commercialuse', 'repository_flickr_public').': ';
$commercial->id = 'flickr_commercial_id';
$commercial->type = 'checkbox';
$commercial->name = 'flickr_commercial';
$commercial->value = 'yes';
- $modification = new stdclass;
+ $modification = new stdClass();
$modification->label = get_string('modification', 'repository_flickr_public').': ';
$modification->id = 'flickr_modification_id';
$modification->type = 'checkbox';
global $CFG;
if($ajax){
$ret = array();
- $popup_btn = new stdclass;
+ $popup_btn = new stdClass();
$popup_btn->type = 'popup';
$returnurl = $CFG->wwwroot.'/repository/repository_callback.php?callback=yes&repo_id='.$this->id;
$popup_btn->url = google_authsub::login_url($returnurl, google_docs::REALM);
$existingtype = $DB->get_record('repository', array('type'=>$this->_typename));
if (!$existingtype) {
//create the type
- $newtype = new stdclass;
+ $newtype = new stdClass();
$newtype->type = $this->_typename;
$newtype->visible = $this->_visible;
$newtype->sortorder = $this->_sortorder;
final public function get_meta() {
global $CFG, $OUTPUT;
$ft = new filetype_parser;
- $meta = new stdclass;
+ $meta = new stdClass();
$meta->id = $this->id;
$meta->name = $this->get_name();
$meta->type = $this->options['type'];
require_once($CFG->dirroot . '/repository/'. $type . '/lib.php');
$classname = 'repository_' . $type;
if ($repo = $DB->get_record('repository', array('type'=>$type))) {
- $record = new stdclass;
+ $record = new stdClass();
$record->name = $params['name'];
$record->typeid = $repo->id;
$record->timecreated = time();
global $CFG, $USER, $PAGE, $OUTPUT;
require_once($CFG->libdir . '/licenselib.php');
- $return = new stdclass;
+ $return = new stdClass();
$licenses = array();
if (!empty($CFG->licenses)) {
$array = explode(',', $CFG->licenses);
foreach ($array as $license) {
- $l = new stdclass;
+ $l = new stdClass();
$l->shortname = $license;
$l->fullname = get_string($license, 'license');
$licenses[] = $l;
*/
public function print_login(){
$ret = array();
- $search = new stdclass;
+ $search = new stdClass();
$search->type = 'text';
$search->id = 'merlog_search';
$search->name = 'merlot_keyword';
$search->label = get_string('search').': ';
- $author = new stdclass;
+ $author = new stdClass();
$author->type = 'text';
$author->id = 'merlog_author';
$author->name = 'merlot_author';
$authurl = google_authsub::login_url($returnurl, google_picasa::REALM);
if($this->options['ajax']){
$ret = array();
- $popup_btn = new stdclass;
+ $popup_btn = new stdClass();
$popup_btn->type = 'popup';
$popup_btn->url = $authurl;
$ret['login'] = array($popup_btn);
require_once(dirname(dirname(__FILE__)).'/lib/filelib.php');
require_once(dirname(__FILE__).'/lib.php');
-$err = new stdclass;
+$err = new stdClass();
/// Parameters
$action = optional_param('action', '', PARAM_ALPHA);
throw new file_exception('maxbytes');
}
- $record = new stdclass;
+ $record = new stdClass();
$record->filepath = $saveas_path;
$record->filename = $saveas_filename;
$record->component = 'user';
}
}
- $record = new stdclass;
+ $record = new stdClass();
$record->filearea = 'draft';
$record->component = 'user';
$record->filepath = optional_param('savepath', '/', PARAM_PATH);
$strname = get_string('rename', 'repository_url');
$strurl = get_string('url', 'repository_url');
if ($this->options['ajax']) {
- $url = new stdclass;
+ $url = new stdClass();
$url->label = $strurl.': ';
$url->id = 'fileurl';
$url->type = 'text';
public function print_login($ajax = true) {
$ret = array();
- $search = new stdclass;
+ $search = new stdClass();
$search->type = 'text';
$search->id = 'youtube_search';
$search->name = 'youtube_keyword';