]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19787 upgraded calls to print_table, print_single_button, print_user_picture...
authornicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:39:07 +0000 (08:39 +0000)
committernicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:39:07 +0000 (08:39 +0000)
34 files changed:
admin/blocks.php
admin/delete.php
admin/enrol.php
admin/filters.php
admin/index.php
admin/innodb.php
admin/langimport.php
admin/mnet/access_control.php
admin/mnet/index.php
admin/mnet/mnet_themes.html
admin/modules.php
admin/multilangupgrade.php
admin/portfolio.php
admin/qtypes.php
admin/report/configlog/index.php
admin/report/courseoverview/index.php
admin/report/questioninstances/index.php
admin/report/security/index.php
admin/repository.php
admin/repositoryinstance.php
admin/roles/allow.php
admin/roles/assign.php
admin/roles/define.php
admin/roles/lib.php
admin/roles/manage.php
admin/roles/override.php
admin/settings.php
admin/timezoneimport.php
admin/user.php
admin/user/user_bulk_confirm.php
admin/user/user_bulk_delete.php
admin/user/user_bulk_display.php
admin/user/user_bulk_enrol.php
admin/user/user_bulk_message.php

index 3815328a97e8bbf72c67c0695df5a557a852887e..f6acc1a44b544e6dbe22410c49cea574a7a25664 100644 (file)
@@ -57,9 +57,7 @@
         }
 
         if (!$confirm) {
-            notice_yesno(get_string('blockdeleteconfirm', '', $strblockname),
-                         'blocks.php?delete='.$block->id.'&amp;confirm=1&amp;sesskey='.sesskey(),
-                         'blocks.php');
+            echo $OUTPUT->confirm(get_string('blockdeleteconfirm', '', $strblockname), 'blocks.php?delete='.$block->id.'&confirm=1', 'blocks.php');
             echo $OUTPUT->footer();
             exit;
 
index 7855e75939d813fb83d0216617fe0204f8234e40..215c766172b1e6658959a88b131911bb0af40b96 100644 (file)
 
     if (empty($sure)) {
         $optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
-        notice_yesno ('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?',
-            'delete.php', 'index.php', $optionsyes, NULL, 'post', 'get');
+        
+        $formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'));
+        $formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
+        echo $OUTPUT->confirm('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', $formcontinue, $formcancel);
         echo $OUTPUT->footer();
         exit;
     }
 
     if (!data_submitted() or empty($reallysure)) {
         $optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
-        notice_yesno ('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. $deletedir .' (this includes all user images, and any other course files that have been created) ?',
-            'delete.php', 'index.php', $optionsyes, NULL, 'post', 'get');
+        $formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'));
+        $formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
+        echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. 
+                $deletedir .' (this includes all user images, and any other course files that have been created) ?', 
+                $formcontinue, $formcancel);
         echo $OUTPUT->footer();
         exit;
     }
index 598b0cb7e0366c329a0f296fef4af35d76ce398c..4eafca50105fd73036494b42416bd92ac32a136e 100644 (file)
@@ -64,7 +64,7 @@
     echo "<div>";
     echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />";
 
-    $table = new stdClass();
+    $table = new html_table();
     $table->head = array(get_string('name'), get_string('enable'), get_string('default'), $str->settings);
     $table->align = array('left', 'center', 'center', 'center');
     $table->size = array('60%', '', '', '15%');
     }
     asort($table->data);
 
-    print_table($table);
+    echo $OUTPUT->table($table);
 
     echo "<div style=\"text-align:center\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></div>\n";
     echo "</div>";
index daafb9cca30340dc106ae31e5e2bbca3438658f0..3726674bb033877524584aed05a3336e4e6449c4 100644 (file)
             $title = get_string('deletefilterareyousure', 'admin', $filtername);
             admin_externalpage_print_header();
             echo $OUTPUT->heading($title);
-            notice_yesno(get_string('deletefilterareyousuremessage', 'admin', $filtername), $returnurl .
-                    '?action=delete&amp;filterpath=' . $filterpath . '&amp;confirm=1&amp;sesskey=' . sesskey(),
-                    $returnurl, NULL, NULL, 'post', 'get');
+            
+            $linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1));
+            $formcancel = html_form::make_button($returnurl, null, get_string('no'), 'get');
+            echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel);
             echo $OUTPUT->footer();
             exit;
         }
     }
     $stringfilters = filter_get_string_filters();
 
-    $table = new object();
+    $table = new html_table();
     $table->head  = array(get_string('filter'), get_string('isactive', 'filters'),
             get_string('order'), get_string('applyto', 'filters'), get_string('settings'), get_string('delete'));
     $table->align = array('left', 'left', 'center', 'left', 'left');
         $table->rowclasses[] = 'dimmed_text';
     }
 
-    print_table($table);
+    echo $OUTPUT->table($table);
     echo '<p class="filtersettingnote">' . get_string('filterallwarning', 'filters') . '</p>';
     echo $OUTPUT->footer();
 
index 5287a39abeea798cf9e0e07c6ae96c46650b523e..1b5be55960baa356d02f7a39cddc6474634df866 100644 (file)
@@ -127,8 +127,7 @@ if (!core_tables_exist()) {
         $copyrightnotice = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $copyrightnotice); // extremely ugly validation hack
         echo $OUTPUT->box($copyrightnotice, 'copyrightnotice');
         echo '<br />';
-        notice_yesno(get_string('doyouagree'), "index.php?agreelicense=1&lang=$CFG->lang",
-                                               "http://docs.moodle.org/en/License");
+        echo $OUTPUT->confirm(get_string('doyouagree'), "index.php?agreelicense=1&lang=$CFG->lang", "http://docs.moodle.org/en/License");
         echo $OUTPUT->footer();
         die;
     }
index cee323693533ecf1ef1dd3fb94a39afcd8ae564d..a504f83c9f781588b898d6127e11dc4d3c0beda4 100644 (file)
@@ -36,8 +36,9 @@
 
     } else {
         $optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
-        notice_yesno('Are you sure you want convert all your tables to the InnoDB format?',
-                     'innodb.php', 'index.php', $optionsyes, NULL, 'post', 'get');
+        $formcontinue = html_form::make_button('innodb.php', $optionsyes, get_string('yes'));
+        $formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
+        echo $OUTPUT->confirm('Are you sure you want convert all your tables to the InnoDB format?', $formcontinue, $formcancel);
         echo $OUTPUT->footer();
     }
 
index 15f5717c32f2e960cfd981400b0c3080fd3fb16c..34aaad421fa14a16a06d6c1418a8b4e0aa4ec444 100755 (executable)
 
             } else if (!$confirm && confirm_sesskey()) {
                 admin_externalpage_print_header();
-                notice_yesno(get_string('uninstallconfirm', 'admin', $uninstalllang),
-                             'langimport.php?mode='.DELETION_OF_SELECTED_LANG.'&amp;uninstalllang='.$uninstalllang.'&amp;confirm=1&amp;sesskey='.sesskey(),
+                echo $OUTPUT->confirm(get_string('uninstallconfirm', 'admin', $uninstalllang),
+                             'langimport.php?mode='.DELETION_OF_SELECTED_LANG.'&uninstalllang='.$uninstalllang.'&confirm=1',
                              'langimport.php');
                 echo $OUTPUT->footer();
                 die;
index f6c0006ead413194617067b216f155dfb6eccc59..2d7876ad58d6b6b11bee32fbc49eef96165863dd 100644 (file)
@@ -163,6 +163,7 @@ if (!$acl) {
     echo $OUTPUT->heading(get_string('noaclentries','mnet'));
     $table = NULL;
 } else {
+    $table = new html_table();
     $table->head = $headings;
     $table->align = array('left', 'left', 'center');
     $table->width = "95%";
@@ -183,7 +184,7 @@ if (!$acl) {
 }
 
 if (!empty($table)) {
-    print_table($table);
+    echo $OUTPUT->table($table);
     echo '<p>&nbsp;</p>';
     $baseurl = new moodle_url(null, array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage));
     $pagingbar = moodle_paging_bar::make($aclcount, $page, $perpage, $baseurl);
index 105e7fee7681d0f1bc540428e69212b43cadda63..beda619e34a5d2b5aecc683e8005a2999547209d 100644 (file)
         } elseif (!empty($form->submit) && $form->submit == get_string('delete')) {
             $MNET->get_private_key();
             $SESSION->mnet_confirm_delete_key = md5(sha1($MNET->keypair['keypair_PEM'])).':'.time();
-            notice_yesno(get_string("deletekeycheck", "mnet"),
-                                    "index.php?sesskey=".sesskey()."&amp;confirm=".md5($MNET->public_key),
-                                    "index.php",
-                                     array('sesskey' => sesskey()),
-                                     NULL,
-                                    'post',
-                                    'get');
+
+            $formcontinue = html_form::make_button('index.php', array('confirm' => md5($MNET->public_key)), get_string('yes'));
+            $formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
+            echo $OUTPUT->confirm(get_string("deletekeycheck", "mnet"), $formcontinue, $formcancel);
             exit;
         } else {
             // We're deleting
index 0fbe99e90227a6510f190f1f3a1563e00cf0e501..67de832256a7d7fd89e3c7c8320ac6bdbfb5ad0c 100644 (file)
@@ -47,7 +47,7 @@ print_tabs(array($tabs), 'mnetthemes');
     $options['choose'] = $unlikely_name;// Something unlikely to ever be a theme name... initially $unlikely_name = 'ZoqZoqZ';
     $options['sesskey'] = $sesskey;
     $options['hostid'] = $mnet_peer->id;
-    print_single_button('mnet_themes.php', $options, $strchoose);
+    echo $OUTPUT->button(html_form::make_button('mnet_themes.php', $options, $strchoose));
     echo '</td>';
     echo "</tr>";
 
@@ -116,7 +116,7 @@ print_tabs(array($tabs), 'mnetthemes');
         $options['choose'] = $theme;
         $options['sesskey'] = $sesskey;
         $options['hostid'] = $mnet_peer->id;
-        print_single_button('mnet_themes.php', $options, $strchoose);
+        echo $OUTPUT->button(html_form::make_button('mnet_themes.php', $options, $strchoose));
         echo '</td>';
         echo "</tr>";
     }
index 6bbbdbdf439d8c60cca0f8adeb2c724e36f606b3..a8938c16ac1b3417e34d771a7ee6e3f6f5d1fd11 100644 (file)
@@ -77,9 +77,7 @@
         $strmodulename = get_string("modulename", "$delete");
 
         if (!$confirm) {
-            notice_yesno(get_string("moduledeleteconfirm", "", $strmodulename),
-                         "modules.php?delete=$delete&amp;confirm=1&amp;sesskey=".sesskey(),
-                         "modules.php");
+            echo $OUTPUT->confirm(get_string("moduledeleteconfirm", "", $strmodulename), "modules.php?delete=$delete&confirm=1", "modules.php");
             echo $OUTPUT->footer();
             exit;
 
index 22e78606002add043ef0e3349d1708523c85bcce..801c8b058501daf9cf23632d42c9c960c4666b47 100644 (file)
@@ -18,7 +18,7 @@ $strmultilangupgrade = get_String('multilangupgradeinfo', 'admin');
 
 if (!$go or !data_submitted() or !confirm_sesskey()) {   /// Print a form
     $optionsyes = array('go'=>1, 'sesskey'=>sesskey());
-    notice_yesno($strmultilangupgrade, 'multilangupgrade.php', 'index.php', $optionsyes, null, 'post', 'get');
+    echo $OUTPUT->confirm($strmultilangupgrade, new moodle_url('multilangupgrade.php', $optionsyes), 'index.php');
     echo $OUTPUT->footer();
     die;
 }
index fbba7452f2c7aab18931268eb54275edf8c7398a..3dcdc2ef1d996dcd91b48e7ec6a3104ba489aabc 100644 (file)
@@ -101,7 +101,7 @@ if (!empty($edit) || !empty($new)) {
         }
         exit;
     }
-    notice_yesno(get_string('sure', 'portfolio', $instance->get('name')), $sesskeyurl . '&delete=' . $delete . '&sure=yes', $baseurl);
+    echo $OUTPUT->confirm(get_string('sure', 'portfolio', $instance->get('name')), $sesskeyurl . '&delete=' . $delete . '&sure=yes', $baseurl);
     $return = false;
 }
 
index fb5cb7f24c59fe30c794fd31dcd5b4b96fce9828..4e2ff7984804fb8d5a5218af8dcd3f57e7b8d7eb 100644 (file)
             $qtypename = $QTYPES[$delete]->local_name();
             admin_externalpage_print_header();
             echo $OUTPUT->heading(get_string('deleteqtypeareyousure', 'admin', $qtypename));
-            notice_yesno(get_string('deleteqtypeareyousuremessage', 'admin', $qtypename),
-                    admin_url('qtypes.php?delete=' . $delete . '&amp;confirm=1&amp;sesskey=' . sesskey()),
-                    admin_url('qtypes.php'), NULL, NULL, 'post', 'get');
+            echo $OUTPUT->confirm(get_string('deleteqtypeareyousuremessage', 'admin', $qtypename),
+                    admin_url('qtypes.php?delete=' . $delete . '&confirm=1'),
+                    admin_url('qtypes.php'));
             echo $OUTPUT->footer();
             exit;
         }
index 869644400cd89749eaef6a40b5ae1536b2e82767..46fe4df471ddc05275f554009a33fa4b6336824a 100644 (file)
@@ -67,7 +67,7 @@ if (($CFG->fullnamedisplay == 'firstname lastname') or
     $fullnamedisplay = $hcolumns['lastname'].' / '.$hcolumns['firstname'];
 }
 
-$table = new object();
+$table = new html_table();
 $table->head  = array($hcolumns['timemodified'], $fullnamedisplay, $hcolumns['plugin'], $hcolumns['name'], $hcolumns['value'], $hcolumns['oldvalue']);
 $table->align = array('left',                    'left',           'left',              'left',            'left',             'left');
 $table->size  = array('30%',                     '10%',            '10%',               '10%',             '20%',              '20%');
@@ -104,6 +104,6 @@ foreach ($rs as $log) {
 }
 $rs->close();
 
-print_table($table);
+echo $OUTPUT->table($table);
 
 echo $OUTPUT->footer();
index 54dbae9fb73a36ee758ae09956cf4408db158603..3f1a72961a6d5e855951c99420eb6183403a3cb1 100644 (file)
@@ -48,6 +48,7 @@
     echo '<form action="index.php" method="post">'."\n";
     echo '<div>';
 
+    $table = new html_table();
     $table->width = '*';
     $table->align = array('left','left','left','left','left','left');
     
@@ -64,7 +65,7 @@
                            '<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
                            '<input type="submit" value="'.get_string('view').'" />') ;
 
-    print_table($table);
+    echo $OUTPUT->table($table);
     echo '</div>';
     echo '</form>';
 
@@ -98,7 +99,7 @@
                 echo '<div class="graph"><img alt="'.get_string('courseoverviewgraph').'" src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
             }
 
-            $table = new StdClass;
+            $table = new html_table();
             $table->align = array('left','center','center','center');
             $table->head = array(get_string('course'),$param->line1);
             if (!empty($param->line2)) {
                 }
                 $table->data[] = $a;
             }
-            print_table($table);
+            echo $OUTPUT->table($table);
         }
     }
     echo $OUTPUT->footer();
index d097cbabc6a7301a2250b58c4f3dedac502e3885..d892c54cf6498778e246521e7b64be4616ec7d0b 100644 (file)
@@ -78,7 +78,7 @@ if ($requestedqtype) {
     echo $OUTPUT->heading($title);
 
     // Initialise the table.
-    $table = new stdClass;
+    $table = new html_table();
     $table->head = array(
             get_string('context', 'role'),
             get_string('totalquestions', 'report_questioninstances'),
@@ -124,7 +124,7 @@ if ($requestedqtype) {
             $totalhidden);
 
     // Print it.
-    print_table($table);
+    echo $OUTPUT->table($table);
 }
 
 // Footer.
index 18a5e34048b2c0e98b4771ce0053ed04b98b23ef..c5129592bc77a5d0d2ad84010dc984617f82bcbf 100644 (file)
@@ -74,7 +74,7 @@ $url = "$CFG->wwwroot/$CFG->admin/report/security/index.php";
 if ($issue and ($result = $issue(true))) {
     report_security_hide_timearning();
 
-    $table = new object();
+    $table = new html_table();
     $table->head  = array($strissue, $strstatus, $strdesc, $strconfig);
     $table->size  = array('30%', '10%', '50%', '10%' );
     $table->align = array('left', 'left', 'left', 'left');
@@ -92,7 +92,7 @@ if ($issue and ($result = $issue(true))) {
 
     $table->data[] = $row;
 
-    print_table($table);
+    echo $OUTPUT->table($table);
 
     echo $OUTPUT->box($result->details, 'generalbox boxwidthnormal boxaligncenter'); // TODO: add proper css
 
@@ -101,7 +101,7 @@ if ($issue and ($result = $issue(true))) {
 } else {
     report_security_hide_timearning();
 
-    $table = new object();
+    $table = new html_table();
     $table->head  = array($strissue, $strstatus, $strdesc);
     $table->size  = array('30%', '10%', '60%' );
     $table->align = array('left', 'left', 'left');
@@ -121,7 +121,7 @@ if ($issue and ($result = $issue(true))) {
 
         $table->data[] = $row;
     }
-    print_table($table);
+    echo $OUTPUT->table($table);
 }
 
 echo $OUTPUT->footer();
index 4a2c507d2abe3f860d54b980faa3e8fcd27d78fc..b26d89d1f0eae745c7d96d12860a4e68ede1f9b2 100644 (file)
@@ -156,7 +156,7 @@ if (!empty($edit) || !empty($new)) {
         }
         exit;
     }
-    notice_yesno(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&amp;delete=' . $delete . '&amp;sure=yes', $baseurl);
+    echo $OUTPUT->confirm(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&delete=' . $delete . '&sure=yes', $baseurl);
     $return = false;
 }
 else if (!empty($move) && !empty($type)) {
index c83cac1a8fd8d71fa7385200505929c57a6e3289..a2c694e0c9bc0ce177fa64ed05459b10d35eb985 100644 (file)
@@ -122,7 +122,8 @@ if (!empty($edit) || !empty($new)) {
         }
         exit;
     }
-    notice_yesno(get_string('confirmdelete', 'repository', $instance->name), $sesskeyurl . '&amp;type=' . $type . '&amp;delete=' . $delete . '&amp;sure=yes', "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
+
+    echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
     $return = false;
 }
 
index c0b6f3dab51e927e46edb8148a29fdf570a0f7d3..1acdee1e872200213a5e47b8dd2e8e96cafadef3 100755 (executable)
@@ -76,7 +76,7 @@
 
     echo '<form action="' . $baseurl . '" method="post">';
     echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
-    print_table($table);
+    echo $OUTPUT->table($table);
     echo '<div class="buttons"><input type="submit" name="submit" value="'.get_string('savechanges').'"/>';
     echo '</div></form>';
 
index 6ffa560bec1534af191e4ade3237dd37f7a36474..ae035c8c21a3345e1e85db3f76aac821e5ccf079 100755 (executable)
 
         // Get the names of role holders for roles with between 1 and MAX_USERS_TO_LIST_PER_ROLE users,
         // and so determine whether to show the extra column.
-        $rolehodlernames = array();
+        $roleholdernames = array();
         $strmorethanmax = get_string('morethan', 'role', MAX_USERS_TO_LIST_PER_ROLE);
         $showroleholders = false;
         foreach ($assignableroles as $roleid => $notused) {
                     foreach ($roleusers as $user) {
                         $strroleusers[] = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '" >' . fullname($user) . '</a>';
                     }
-                    $rolehodlernames[$roleid] = implode('<br />', $strroleusers);
+                    $roleholdernames[$roleid] = implode('<br />', $strroleusers);
                     $showroleholders = true;
                 }
             } else if ($assigncounts[$roleid] > MAX_USERS_TO_LIST_PER_ROLE) {
-                $rolehodlernames[$roleid] = '<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$strmorethanmax.'</a>';
+                $roleholdernames[$roleid] = '<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$strmorethanmax.'</a>';
             } else {
-                $rolehodlernames[$roleid] = '';
+                $roleholdernames[$roleid] = '';
             }
         }
 
         // Print overview table
+        $table = new html_table();
         $table->tablealign = 'center';
         $table->width = '60%';
         $table->head = array(get_string('role'), get_string('description'), get_string('userswiththisrole', 'role'));
             $row = array('<a href="'.$baseurl.'&amp;roleid='.$roleid.'">'.$rolename.'</a>',
                     $description, $assigncounts[$roleid]);
             if ($showroleholders) {
-                $row[] = $rolehodlernames[$roleid];
+                $row[] = $roleholdernames[$roleid];
             }
             $table->data[] = $row;
         }
 
-        print_table($table);
+        echo $OUTPUT->table($table);
 
         if (!$isfrontpage && ($url = get_context_url($context))) {
             echo '<div class="backlink"><a href="' . $url . '">' .
index 28019bc5bd4585e56c8488fbddb6a880cbd5c23a..d32fd83a8d5169b35d776ee8a0eeea9611837f9d 100755 (executable)
 
 /// On the view page, show some extra controls at the top.
     if ($action == 'view') {
-        echo '<div class="buttons">';
+        echo $OUTPUT->container_start('buttons');
         $options = array();
         $options['roleid'] = $roleid;
         $options['action'] = 'edit';
-        print_single_button($defineurl, $options, get_string('edit'));
+        echo $OUTPUT->button(html_form::make_button($defineurl, $options, get_string('edit')));
         $options['action'] = 'reset';
         if ($definitiontable->get_legacy_type()) {
-            print_single_button($manageurl, $options, get_string('resetrole', 'role'));
+            echo $OUTPUT->button(html_form::make_button($manageurl, $options, get_string('resetrole', 'role')));
         } else {
-            print_single_button($manageurl, $options, get_string('resetrolenolegacy', 'role'));
+            echo $OUTPUT->button(html_form::make_button($manageurl, $options, get_string('resetrolenolegacy', 'role')));
         }
         $options['action'] = 'duplicate';
-        print_single_button($defineurl, $options, get_string('duplicaterole', 'role'));
-        print_single_button($manageurl, null, get_string('listallroles', 'role'));
-        echo "</div>\n";
+        echo $OUTPUT->button(html_form::make_button($defineurl, $options, get_string('duplicaterole', 'role')));
+        echo $OUTPUT->button(html_form::make_button($manageurl, null, get_string('listallroles', 'role')));
+        echo $OUTPUT->container_end();
     }
 
     // Start the form.
index 71e889d4ca9dd1459fe52b5ffa4786013c4dab43..ef8e1595e4d073c2b6defe0411e05590900b5adf 100644 (file)
@@ -1335,7 +1335,7 @@ abstract class role_allow_role_page {
      * one cell for each checkbox. 
      */
     public function get_table() {
-        $table = new stdClass;
+        $table = new html_table();
         $table->tablealign = 'center';
         $table->cellpadding = 5;
         $table->cellspacing = 0;
index cf8bebd367314a47d751bc57d66948a2d16775ae..7a8fe97fdcb62803c41df9919e1f1916b0e39e67 100755 (executable)
                 $a->name = $roles[$roleid]->name;
                 $a->shortname = $roles[$roleid]->shortname;
                 $a->count = $DB->count_records('role_assignments', array('roleid'=>$roleid));
-                notice_yesno(get_string('deleterolesure', 'role', $a), $baseurl, $baseurl, $optionsyes, NULL, 'post', 'get');
+                
+                $formcontinue = html_form::make_button($baseurl, array('confirm' => 1, 'msg' => $msg), get_string('yes'));
+                $formcancel = html_form::make_button($baseurl, $optionsno, get_string('no'), 'get');
+                echo $OUTPUT->confirm(get_string('deleterolesure', 'role', $a), $formcontinue, $formcancel);
                 echo $OUTPUT->footer();
                 die;
             }
                 } else {
                     $warning = get_string('resetrolesure', 'role', $a);
                 }
-                notice_yesno($warning, 'manage.php', 'manage.php', $optionsyes, $optionsno, 'post', 'get');
+                $formcontinue = html_form::make_button('manage.php', array('confirm' => 1, 'msg' => $msg), get_string('yes'));
+                $formcancel = html_form::make_button('manage.php', $optionsno, get_string('no'), 'get');
+                echo $OUTPUT->confirm(get_string('confirmmessage', 'bulkusers', $usernames), $formcontinue, $formcancel);
                 echo $OUTPUT->footer();
                 die;
             }
     include_once('managetabs.php');
 
 /// Initialise table.
-    $table = new object;
+    $table = new html_table();
     $table->tablealign = 'center';
     $table->align = array('left', 'left', 'left', 'left');
     $table->wrap = array('nowrap', '', 'nowrap','nowrap');
 
         $table->data[] = $row;
     }
-    print_table($table);
+    echo $OUTPUT->table($table);
 
-    echo '<div class="buttons">';
-    print_single_button($defineurl, array('action' => 'add'), get_string('addrole', 'role'), 'get');
-    echo '</div>';
+    echo $OUTPUT->container_start('buttons');
+    echo $OUTPUT->button(html_form::make_button($defineurl, array('action' => 'add'), get_string('addrole', 'role'), 'get'));
+    echo $OUTPUT->container_end();
 
     echo $OUTPUT->footer();
     die;
index 977a1e2d9db1871a164fe6c3ed3126fb72b3a8f6..a573bceb0e5558cfe9b96d79b864d32bd91609ad 100755 (executable)
     } else {
     /// Show UI for choosing a role to assign.
 
+        $table = new html_table();
         $table->tablealign = 'center';
         $table->width = '60%';
         $table->head = array(get_string('role'), get_string('description'), get_string('overrides', 'role'));
                     $description, $overridecounts[$roleid]);
         }
 
-        print_table($table);
+        echo $OUTPUT->table($table);
 
         if (!$isfrontpage && ($url = get_context_url($context))) {
             echo '<div class="backlink"><a href="' . $url . '">' .
index 59f1724fdc550b3a4f9d4b02ac446967e342f5a6..35a41d037d81d9028d838afa26a314ba938a3acb 100644 (file)
@@ -92,7 +92,7 @@ if (empty($SITE->fullname)) {
             $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'));
     }
 
     $visiblepathtosection = array_reverse($settingspage->visiblepath);
index c7b47b4255d896f859d30015769e8568c2feb2de..f2c10cfd009681653700d98c36123f92c4317194 100644 (file)
@@ -30,7 +30,7 @@
 
         $message = get_string("configintrotimezones", 'admin', $message);
 
-        notice_yesno($message, 'timezoneimport.php?ok=1&amp;sesskey='.sesskey(), 'index.php');
+        echo $OUTPUT->confirm($message, 'timezoneimport.php?ok=1', 'index.php');
 
         echo $OUTPUT->footer();
         exit;
index 0496b9c316457404adcc1b94f002043bbda35b5e..5d4b68e0b05a76aaffcc77b6f8321bcdb5a2d701 100644 (file)
@@ -73,7 +73,7 @@
             $fullname = fullname($user, true);
             echo $OUTPUT->heading(get_string('deleteuser', 'admin'));
             $optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey());
-            notice_yesno(get_string('deletecheckfull', '', "'$fullname'"), 'user.php', 'user.php', $optionsyes, NULL, 'post', 'get');
+            echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), new moodle_url('user.php', $optionsyes), 'user.php');
             echo $OUTPUT->footer();
             die;
         } else if (data_submitted() and !$user->deleted) {
         } else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname') 
             $fullnamedisplay = "$lastname / $firstname";
         }
+
+        $table = new html_table();
         $table->head = array ($fullnamedisplay, $email, $city, $country, $lastaccess, "", "", "");
         $table->align = array ("left", "left", "left", "left", "left", "center", "center", "center");
         $table->width = "95%";
         echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
     }
     if (!empty($table)) {
-        print_table($table);
+        echo $OUTPUT->table($table);
         echo $OUTPUT->paging_bar(moodle_paging_bar::make($usercount, $page, $perpage, $baseurl));
         if (has_capability('moodle/user:create', $sitecontext)) {
             echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
index 6a944fb9007e60801188d046a4ebdf54e58322ee..3f58e2eb172668e8305e49641b042e7e78620e14 100755 (executable)
@@ -43,11 +43,10 @@ if ($confirm and confirm_sesskey()) {
     $in = implode(',', $SESSION->bulk_users);
     $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
     $usernames = implode(', ', $userlist);
-    $optionsyes = array();
-    $optionsyes['confirm'] = 1;
-    $optionsyes['sesskey'] = sesskey();
     echo $OUTPUT->heading(get_string('confirmation', 'admin'));
-    notice_yesno(get_string('confirmcheckfull', '', $usernames), 'user_bulk_confirm.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get');
+    $formcontinue = html_form::make_button('user_bulk_confirm.php', array('confirm' => 1), get_string('yes'));
+    $formcancel = html_form::make_button('user_bulk.php', $optionsno, get_string('no'), 'get');
+    echo $OUTPUT->confirm(get_string('confirmcheckfull', '', $usernames), $formcontinue, $formcancel);
 }
 
 echo $OUTPUT->footer();
index aef04b38f5a59a60559d902fa56cbcd9bfd956ba..7b4f3a5866ae4181629230b9fcca8ae4ebf68149 100755 (executable)
@@ -43,11 +43,10 @@ if ($confirm and confirm_sesskey()) {
     $in = implode(',', $SESSION->bulk_users);
     $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
     $usernames = implode(', ', $userlist);
-    $optionsyes = array();
-    $optionsyes['confirm'] = 1;
-    $optionsyes['sesskey'] = sesskey();
     echo $OUTPUT->heading(get_string('confirmation', 'admin'));
-    notice_yesno(get_string('deletecheckfull', '', $usernames), 'user_bulk_delete.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get');
+    $formcontinue = html_form::make_button('user_bulk_delete.php', array('confirm' => 1), get_string('yes'));
+    $formcancel = html_form::make_button('user_bulk.php', $optionsno, get_string('no'), 'get');
+    echo $OUTPUT->confirm(get_string('deletecheckfull', '', $usernames), $formcontinue, $formcancel);
 }
 
 echo $OUTPUT->footer();
index eead78be3c23bae2c31b0200b5c93730e15c771a..4d6ef5ce33d9ee147bb098cd374f13243e1b60c9 100755 (executable)
@@ -46,6 +46,7 @@ function sort_compare($a, $b) {
 }
 usort($users, 'sort_compare');
 
+$table = new html_table();
 $table->width = "95%";
 $columns = array('fullname', /*'username', */'email', 'city', 'country', 'lastaccess');
 foreach ($columns as $column) {
@@ -73,7 +74,7 @@ foreach($users as $user) {
 }
 
 echo $OUTPUT->heading("$usercount / $usertotal ".get_string('users'));
-print_table($table);
+echo $OUTPUT->table($table);
 
 echo $OUTPUT->continue_button($return);
 
index 1f3ceee3449cfe6b2170ccf6c096e7af6805549b..ec2313e56edb2bf37f824cffc266b385c4d3b316 100644 (file)
@@ -45,6 +45,7 @@ usort($users, 'sort_compare');
 
 //Take courses data (id, shortname, and fullname)
 $courses = get_courses_page(1, 'c.sortorder ASC', 'c.id,c.shortname,c.fullname,c.visible', $totalcount);
+$table = new html_table();
 $table->width = "95%";
 $columns = array('fullname');
 foreach ($courses as $v)
@@ -124,7 +125,7 @@ foreach($users as $user)
     $table->data[] = $temparray;
 }
 echo $OUTPUT->heading("$usercount / $usertotal ".get_string('users'));
-print_table($table);
+echo $OUTPUT->table($table);
 echo '<div class="continuebutton">';
 echo '<input type="submit" name="multienrolsubmit" value="save changes" />';
 echo '</div>';
index c53ce478afe24a0a50fdd622d9cd5134da164e06..ba5b1fd71c07eb792fc37285b1beb1b53f764b03 100755 (executable)
@@ -55,14 +55,13 @@ if ($msgform->is_cancelled()) {
     $in = implode(',', $SESSION->bulk_users);
     $userlist = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
     $usernames = implode(', ', $userlist);
-    $optionsyes = array();
-    $optionsyes['confirm'] = 1;
-    $optionsyes['sesskey'] = sesskey();
-    $optionsyes['msg']     = $msg;
     admin_externalpage_print_header();
     echo $OUTPUT->heading(get_string('confirmation', 'admin'));
     echo $OUTPUT->box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview');
-    notice_yesno(get_string('confirmmessage', 'bulkusers', $usernames), 'user_bulk_message.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get');
+    
+    $formcontinue = html_form::make_button('user_bulk_message.php', array('confirm' => 1, 'msg' => $msg), get_string('yes'));
+    $formcancel = html_form::make_button('user_bulk.php', $optionsno, get_string('no'), 'get');
+    echo $OUTPUT->confirm(get_string('confirmmessage', 'bulkusers', $usernames), $formcontinue, $formcancel);
     echo $OUTPUT->footer();
     die;
 }