MDL-19825 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno

This commit is contained in:
nicolasconnault
2009-08-20 08:50:22 +00:00
parent fd09397ee1
commit f2f085ee68
12 changed files with 49 additions and 36 deletions
+2 -1
View File
@@ -61,6 +61,7 @@ echo '<fieldset class="invisiblefieldset">';
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '</fieldset>';
$table = new html_table();
$table->head = array (get_string('fullname'),
get_string('content', 'notes') . $OUTPUT->help_icon(moodle_help_icon::make('writing', get_string('helpwriting'))),
get_string('publishstate', 'notes') . $OUTPUT->help_icon(moodle_help_icon::make('status', get_string('publishstate', 'notes'), 'notes')),
@@ -88,7 +89,7 @@ foreach ($users as $k => $v) {
$checkbox
);
}
print_table($table);
echo $OUTPUT->table($table);
echo '<div style="width:100%;text-align:center;"><input type="submit" value="' . get_string('savechanges'). '" /></div></form>';
echo $OUTPUT->footer();
?>
+5 -3
View File
@@ -38,7 +38,7 @@ class user_edit_form extends moodleform {
}
function definition_after_data() {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;
$mform =& $this->_form;
$userid = $mform->getElementValue('id');
@@ -72,7 +72,9 @@ class user_edit_form extends moodleform {
if (!empty($CFG->gdversion)) {
$image_el =& $mform->getElement('currentpicture');
if ($user and $user->picture) {
$image_el->setValue(print_user_picture($user, SITEID, $user->picture, 64,true,false,'',true));
$userpic = moodle_user_picture::make($user, SITEID);
$userpic->size = 64;
$image_el->setValue($OUTPUT->user_picture($userpic));
} else {
$image_el->setValue(get_string('none'));
}
@@ -96,7 +98,7 @@ class user_edit_form extends moodleform {
}
}
}
/// Next the customisable profile fields
profile_definition_after_data($mform, $user->id);
+4 -2
View File
@@ -49,7 +49,7 @@ class user_editadvanced_form extends moodleform {
}
function definition_after_data() {
global $USER, $CFG, $DB;
global $USER, $CFG, $DB, $OUTPUT;
$mform =& $this->_form;
if ($userid = $mform->getElementValue('id')) {
@@ -95,7 +95,9 @@ class user_editadvanced_form extends moodleform {
if (!empty($CFG->gdversion)) {
$image_el =& $mform->getElement('currentpicture');
if ($user and $user->picture) {
$image_el->setValue(print_user_picture($user, SITEID, $user->picture, 64, true, false, '', true));
$userpic = moodle_user_picture::make($user, SITEID);
$userpic->alttext = true;
$image_el->setValue($OUTPUT->user_picture($userpic));
} else {
$image_el->setValue(get_string('none'));
}
+2 -1
View File
@@ -116,6 +116,7 @@ echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('extend
echo "<form method=\"post\" action=\"extendenrol.php\">\n";
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
$table = new html_table();
$table->head = array (get_string('fullnameuser'), get_string('enrolmentstart'), get_string('enrolmentend'), get_string('extendperiod'), get_string('startingfrom'));
$table->align = array ('left', 'center', 'center', 'center');
$table->width = "600";
@@ -154,7 +155,7 @@ foreach ($_POST as $k => $v) {
$checkbox2);
}
}
print_table($table);
echo $OUTPUT->table($table);
echo "\n<div style=\"width:100%;text-align:center;\"><input type=\"submit\" value=\"".get_string('savechanges')."\" /></div>\n</form>\n";
echo $OUTPUT->footer();
+2 -1
View File
@@ -113,6 +113,7 @@ echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('groupe
echo '<form method="post" action="groupextendenrol.php">';
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
$table = new html_table();
$table->head = array (get_string('fullnameuser'), get_string('enrolmentstart'), get_string('enrolmentend'));
$table->align = array ('left', 'center', 'center', 'center');
$table->width = "600";
@@ -145,7 +146,7 @@ foreach ($_POST as $k => $v) {
);
}
}
print_table($table);
echo $OUTPUT->table($table);
echo '<div style="width:100%;text-align:center;"><strong>';
echo get_string('extendperiod') . ' ';
echo $OUTPUT->select(html_select::make($periodmenu, 'extendperiod'));
+5 -4
View File
@@ -745,7 +745,8 @@
$row = new html_table_row();
$row->cells[0] = new html_table_cell();
$row->cells[0]->add_class('left side');
$row->cells[0]->text = print_user_picture($user, $course->id, $user->picture, true, true);
$row->cells[0]->text = $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
$row->cells[1] = new html_table_cell();
$row->cells[1]->add_class('content');
@@ -892,9 +893,9 @@
$profilelink = '<strong>'.fullname($user).'</strong>';
}
$data = array (
print_user_picture($user, $course->id, $user->picture, false, true, $piclink),
$profilelink . $hidden);
$userpic = moodle_user_picture::make($user, $course->id);
$userpic->link = $piclink;
$data = array ($OUTPUT->user_picture($userpic), $profilelink . $hidden);
if ($mode === MODE_BRIEF && !isset($hiddenfields['city'])) {
$data[] = $user->city;
+4 -6
View File
@@ -48,12 +48,10 @@
// we can not use our popups here, because the url may be arbitrary, see MDL-9823
echo '<a href="'.$CFG->sitepolicy.'" onclick="this.target=\'_blank\'">'.$strpolicyagreementclick.'</a>';
echo '</object></div>';
$linkyes = 'policy.php';
$optionsyes = array('agree'=>1, 'sesskey'=>sesskey());
$linkno = $CFG->wwwroot.'/login/logout.php';
$optionsno = array('sesskey'=>sesskey());
notice_yesno($strpolicyagree, $linkyes, $linkno, $optionsyes, $optionsno);
$formcontinue = html_form::make_button('policy.php', array('agree'=>1), get_string('yes'));
$formcancel = html_form::make_button($CFG->wwwroot.'/login/logout.php', array(), get_string('no'));
echo $OUTPUT->confirm($strpolicyagree, $formcontinue, $formcancel);
echo $OUTPUT->footer();
+2 -2
View File
@@ -81,7 +81,7 @@ if ($display) {
print_error('noinstances', 'portfolio', $CFG->wwwroot . '/user/view.php');
}
$table = new StdClass;
$table = new html_table();
$table->head = array($namestr, $pluginstr, '');
$table->data = array();
@@ -94,7 +94,7 @@ if ($display) {
);
}
print_table($table);
echo $OUTPUT->table($table);
}
echo $OUTPUT->footer();
+4 -4
View File
@@ -36,7 +36,7 @@ include('tabs.php');
$queued = $DB->get_records('portfolio_tempdata', array('userid' => $USER->id), '', 'id, expirytime');
if (count($queued) > 0) {
$table = new stdClass;
$table = new html_table();
$table->head = array(
get_string('displayarea', 'portfolio'),
get_string('plugin', 'portfolio'),
@@ -56,11 +56,11 @@ if (count($queued) > 0) {
unset($e); // this could potentially be quite big, so free it.
}
echo $OUTPUT->heading(get_string('queuesummary', 'portfolio'));
print_table($table);
echo $OUTPUT->table($table);
}
$logcount = $DB->count_records('portfolio_log', array('userid' => $USER->id));
if ($logcount > 0) {
$table = new StdClass;
$table = new html_table();
$table->head = array(
get_string('plugin', 'portfolio'),
get_string('displayarea', 'portfolio'),
@@ -87,7 +87,7 @@ if ($logcount > 0) {
echo $OUTPUT->heading(get_string('logsummary', 'portfolio'));
$pagingbar = moodle_paging_bar::make($logcount, $page, $perpage, $CFG->wwwroot . '/user/portfoliologs.php?');
echo $OUTPUT->paging_bar($pagingbar);
print_table($table);
echo $OUTPUT->table($table);
echo $OUTPUT->paging_bar($pagingbar);
}
+11 -6
View File
@@ -53,7 +53,10 @@ switch ($action) {
$optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletecategory', 'sesskey'=>sesskey());
admin_externalpage_print_header();
echo $OUTPUT->heading('profiledeletecategory', 'admin');
notice_yesno(get_string('profileconfirmcategorydeletion', 'admin', $fieldcount), $redirect, $redirect, $optionsyes, null, 'post', 'get');
$formcontinue = html_form::make_button($redirect, $optionsyes, get_string('yes'), 'post');
$formcancel = html_form::make_button($redirect, array(), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('profileconfirmcategorydeletion', 'admin', $fieldcount), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
break;
@@ -71,7 +74,9 @@ switch ($action) {
$optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletefield', 'sesskey'=>sesskey());
admin_externalpage_print_header();
echo $OUTPUT->heading('profiledeletefield', 'admin');
notice_yesno(get_string('profileconfirmfielddeletion', 'admin', $datacount), $redirect, $redirect, $optionsyes, null, 'post', 'get');
$formcontinue = html_form::make_button($redirect, $optionsyes, get_string('yes'), 'post');
$formcancel = html_form::make_button($redirect, array(), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('profileconfirmfielddeletion', 'admin', $datacount), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
break;
@@ -109,11 +114,11 @@ if ($DB->count_records('user_info_category') == 0) {
$categories = $DB->get_records('user_info_category', null, 'sortorder ASC');
foreach ($categories as $category) {
$table = new object();
$table = new html_table();
$table->head = array(get_string('profilefield', 'admin'), get_string('edit'));
$table->align = array('left', 'right');
$table->width = '95%';
$table->class = 'generaltable profilefield';
$table->add_class ('generaltable profilefield');
$table->data = array();
if ($fields = $DB->get_records('user_info_field', array('categoryid'=>$category->id), 'sortorder ASC')) {
@@ -124,7 +129,7 @@ foreach ($categories as $category) {
echo $OUTPUT->heading(format_string($category->name) .' '.profile_category_icons($category));
if (count($table->data)) {
print_table($table);
echo $OUTPUT->table($table);
} else {
echo $OUTPUT->notification($strnofields);
}
@@ -144,7 +149,7 @@ echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'datatype', $option
/// Create a new category link
$options = array('action'=>'editcategory');
print_single_button('index.php', $options, get_string('profilecreatecategory', 'admin'));
echo $OUTPUT->button(html_form::make_button('index.php', $options, get_string('profilecreatecategory', 'admin')));
echo '</div>';
+2 -2
View File
@@ -39,7 +39,7 @@ if (!$instances = repository::get_instances($COURSE->context, $USER->id)) {
print_error('noinstances', 'repository', $CFG->wwwroot . '/user/view.php');
}
$table = new StdClass;
$table = new html_table();
$table->head = array($namestr, $pluginstr, '');
$table->data = array();
@@ -51,7 +51,7 @@ foreach ($instances as $i) {
.get_string('settings', 'repository').'</a>' : '');
}
print_table($table);
echo $OUTPUT->table($table);
echo $OUTPUT->footer();
?>
+6 -4
View File
@@ -97,7 +97,7 @@
}
} else { // Normal course
// check capabilities
if (!has_capability('moodle/user:viewdetails', $coursecontext) &&
if (!has_capability('moodle/user:viewdetails', $coursecontext) &&
!has_capability('moodle/user:viewdetails', $usercontext)) {
print_error('cannotviewprofile');
}
@@ -218,7 +218,9 @@
echo '<table width="80%" class="userinfobox" summary="">';
echo '<tr>';
echo '<td class="side">';
print_user_picture($user, $course->id, $user->picture, true, false, false);
$userpic = moodle_user_picture::make($user, $course->id);
$userpic->size = 100;
echo $OUTPUT->user_picture($userpic);
echo '</td><td class="content">';
// Print the description
@@ -382,7 +384,7 @@
print_row(get_string("lastaccess").":", $datestring);
}
/// printing roles
if ($rolestring = get_user_roles_in_context($id, $coursecontext)) {
print_row(get_string('roles').':', format_string($rolestring, false));
}
@@ -404,7 +406,7 @@
/// Printing Interests
if( !empty($CFG->usetags)) {
if ( $interests = tag_get_tags_csv('user', $user->id) ) {
if ( $interests = tag_get_tags_csv('user', $user->id) ) {
print_row(get_string('interests') .": ", $interests);
}
}