From 642816a60c9b2b5b9043413a2622f0fdb15925e4 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 20 Aug 2009 08:50:50 +0000 Subject: [PATCH] MDL-19799 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno --- comment/lib.php | 4 +-- files/draftfiles.php | 2 +- files/index.php | 2 +- lib/adminlib.php | 28 +++++++++---------- lib/commentlib.php | 10 +++---- lib/deprecatedlib.php | 25 ++++++----------- lib/environmentlib.php | 12 ++++---- lib/formslib.php | 21 +++++++++----- lib/outputcomponents.php | 19 ++++++++++++- lib/portfolio/exporter.php | 6 ++-- lib/portfoliolib.php | 4 +-- lib/questionlib.php | 16 +++++------ .../filtersettingsperformancetester.php | 20 +++++++++---- lib/simpletestcoveragelib.php | 6 ++-- lib/weblib.php | 3 +- my/index.php | 3 +- 16 files changed, 103 insertions(+), 78 deletions(-) diff --git a/comment/lib.php b/comment/lib.php index 921c6df471..48187c69f5 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -82,7 +82,7 @@ class comment_manager { $this->perpage = 10; $count = $DB->count_records_sql('SELECT COUNT(*) FROM {comments} c'); $comments = $this->get_comments($page); - $table = new stdclass; + $table = new html_table(); $table->head = array ('', 'author', 'content', 'action'); $table->align = array ('left', 'left', 'left', 'left'); $table->width = "95%"; @@ -101,7 +101,7 @@ class comment_manager { } $table->data[] = array($checkbox, $c->username, $c->content, $action); } - print_table($table); + echo $OUTPUT->table($table); echo $OUTPUT->paging_bar(moodle_paging_bar::make($count, $page, $this->perpage, $CFG->wwwroot.'/comment/index.php')); } diff --git a/files/draftfiles.php b/files/draftfiles.php index 9f9fe292de..11dd043f04 100644 --- a/files/draftfiles.php +++ b/files/draftfiles.php @@ -102,7 +102,7 @@ if ($delete !== '' and $file = $fs->get_file($contextid, $filearea, $itemid, $fi echo $OUTPUT->notification(get_string('deletecheckwarning').': '.s($file->get_filepath().$file->get_filename())); $optionsno = array('itemid'=>$itemid, 'filepath'=>$filepath, 'subdirs'=>$subdirs); $optionsyes = array('itemid'=>$itemid, 'filepath'=>$filepath, 'delete'=>$delete, 'sesskey'=>sesskey(), 'subdirs'=>$subdirs); - notice_yesno (get_string('deletecheckfiles'), 'draftfiles.php', 'draftfiles.php', $optionsyes, $optionsno, 'post', 'get'); + echo $OUTPUT->confirm(get_string('deletecheckfiles'), new moodle_url('draftfiles.php', $optionsyes), new moodle_url('draftfiles.php', $optionsno)); echo $OUTPUT->footer(); die; diff --git a/files/index.php b/files/index.php index 913b44449d..d67b609471 100644 --- a/files/index.php +++ b/files/index.php @@ -117,7 +117,7 @@ if ($file_info and $delete) { $optionsyes['delete'] = 1; $optionsyes['sesskey'] = sesskey(); - notice_yesno (get_string('deletecheckfiles'), 'index.php', 'index.php', $optionsyes, $optionsno, 'post', 'get'); + echo $OUTPUT->confirm(get_string('deletecheckfiles'), new moodle_url( 'index.php', $optionsyes), new moodle_url('index.php', $optionsno)); echo $OUTPUT->footer(); die; } diff --git a/lib/adminlib.php b/lib/adminlib.php index 273433ed28..10c9efd907 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -4550,7 +4550,7 @@ class admin_setting_manageauths extends admin_setting { $return = $OUTPUT->heading(get_string('actauthhdr', 'auth'), 3, 'main'); $return .= $OUTPUT->box_start('generalbox authsui'); - $table = new object(); + $table = new html_table(); $table->head = array($txt->name, $txt->enable, $txt->updown, $txt->settings); $table->align = array('left', 'center', 'center', 'center'); $table->width = '90%'; @@ -4620,7 +4620,7 @@ class admin_setting_manageauths extends admin_setting { // add a row to the table $table->data[] =array($displayname, $hideshow, $updown, $settings); } - $return .= print_table($table, true); + $return .= $OUTPUT->table($table); $return .= get_string('configauthenticationplugins', 'admin').'
'.get_string('tablenosave', 'filters'); $return .= $OUTPUT->box_end(); return highlight($query, $return); @@ -4727,7 +4727,7 @@ class admin_setting_manageeditors extends admin_setting { $return = $OUTPUT->heading(get_string('acteditorshhdr', 'editor'), 3, 'main', true); $return .= $OUTPUT->box_start('generalbox editorsui'); - $table = new object(); + $table = new html_table(); $table->head = array($txt->name, $txt->enable, $txt->updown, $txt->settings); $table->align = array('left', 'center', 'center', 'center'); $table->width = '90%'; @@ -4784,7 +4784,7 @@ class admin_setting_manageeditors extends admin_setting { // add a row to the table $table->data[] =array($displayname, $hideshow, $updown, $settings); } - $return .= print_table($table, true); + $return .= $OUTPUT->table($table); $return .= get_string('configeditorplugins', 'editor').'
'.get_string('tablenosave', 'filters'); $return .= $OUTPUT->box_end(); return highlight($query, $return); @@ -4939,7 +4939,7 @@ class admin_setting_manageportfolio extends admin_setting { $output .= portfolio_report_insane($insane, null, true); $output .= portfolio_report_insane($insaneinstances, $instances, true); - $table = new StdClass; + $table = new html_table(); $table->head = array($namestr, $pluginstr, ''); $table->data = array(); @@ -4959,7 +4959,7 @@ class admin_setting_manageportfolio extends admin_setting { } } - $output .= print_table($table, true); + $output .= $OUTPUT->table($table); $instancehtml = '

' . get_string('addnewportfolio', 'portfolio') . ':

'; $addable = 0; @@ -5047,7 +5047,7 @@ function admin_externalpage_setup($section, $extrabutton = '', * @param string $focus focus element */ function admin_externalpage_print_header($focus='') { - global $CFG, $PAGE, $SITE, $THEME; + global $CFG, $PAGE, $SITE, $THEME, $OUTPUT; if (!is_string($focus)) { $focus = ''; // BC compatibility, there used to be adminroot parameter @@ -5079,7 +5079,7 @@ function admin_externalpage_print_header($focus='') { $caption = get_string('blocksediton'); $options['adminedit'] = 'on'; } - $buttons = print_single_button($PAGE->url->out(false), $options, $caption, 'get', '', true); + $buttons = $OUTPUT->button(html_form::make_button($PAGE->url->out(false), $options, $caption, 'get')); } $navlinks = array(); @@ -5793,7 +5793,7 @@ class admin_setting_managerepository extends admin_setting { $instances = repository::get_types(); $instancesnumber = count($instances); $alreadyplugins = array(); - $table = new StdClass; + $table = new html_table(); $table->head = array($namestr, $updownstr, $hiddenstr, $deletestr, $settingsstr); $table->align = array('left', 'center', 'center','center','center'); $table->data = array(); @@ -5865,7 +5865,7 @@ class admin_setting_managerepository extends admin_setting { $alreadyplugins[] = $i->get_typename(); } } - $output .= print_table($table, true); + $output .= $OUTPUT->table($table); $instancehtml = '

'; $instancehtml .= get_string('addplugin', 'repository'); $instancehtml .= '