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')),
$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();
?>
}
function definition_after_data() {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
$mform =& $this->_form;
$userid = $mform->getElementValue('id');
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'));
}
}
}
}
-
+
/// Next the customisable profile fields
profile_definition_after_data($mform, $user->id);
}
function definition_after_data() {
- global $USER, $CFG, $DB;
+ global $USER, $CFG, $DB, $OUTPUT;
$mform =& $this->_form;
if ($userid = $mform->getElementValue('id')) {
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'));
}
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";
$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();
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";
);
}
}
-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'));
$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');
$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;
// 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();
print_error('noinstances', 'portfolio', $CFG->wwwroot . '/user/view.php');
}
- $table = new StdClass;
+ $table = new html_table();
$table->head = array($namestr, $pluginstr, '');
$table->data = array();
);
}
- print_table($table);
+ echo $OUTPUT->table($table);
}
echo $OUTPUT->footer();
$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'),
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'),
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);
}
$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;
$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;
$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')) {
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);
}
/// 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>';
print_error('noinstances', 'repository', $CFG->wwwroot . '/user/view.php');
}
-$table = new StdClass;
+$table = new html_table();
$table->head = array($namestr, $pluginstr, '');
$table->data = array();
.get_string('settings', 'repository').'</a>' : '');
}
-print_table($table);
+echo $OUTPUT->table($table);
echo $OUTPUT->footer();
?>
}
} 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');
}
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
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));
}
/// 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);
}
}