/// Start of main box
print_simple_box_start('center');
- echo "<center>".$stradminhelpenvironment."</center><br />";
+ echo "<div style=\"text-align:center\">".$stradminhelpenvironment."</div><br />";
/// Get current Moodle version
$current_version = $CFG->release;
}
/// Print form and popup menu
- echo '<div align="center">'.$strmoodleversion.' ';
+ echo '<div style="text-align:center">'.$strmoodleversion.' ';
popup_form("$CFG->wwwroot/$CFG->admin/environment.php?version=",
$versions, 'selectversion', $version, '');
echo '</div>';
/// Print the appropriate form
if (file_exists($filename)) { // We are in maintenance mode
- echo '<center>';
+ echo '<div style="margin-left:auto;margin-right:auto">';
echo '<form action="maintenance.php" method="post">';
echo '<input type="hidden" name="action" value="disable" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<p><input type="submit" value="'.get_string('disable').'" /></p>';
echo '</form>';
- echo '</center>';
+ echo '</div>';
} else { // We are not in maintenance mode
$usehtmleditor = can_use_html_editor();
- echo '<center>';
+ echo '<div style="text-align:center;margin-left:auto;margin-right:auto">';
echo '<form action="maintenance.php" method="post">';
+ echo '<div>';
echo '<input type="hidden" name="action" value="enable" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<p><input type="submit" value="'.get_string('enable').'" /></p>';
echo '<table><tr><td>';
print_textarea($usehtmleditor, 20, 50, 600, 400, "text");
echo '</td></tr></table>';
+ echo '</div>';
echo '</form>';
- echo '</center>';
+ echo '</div>';
if ($usehtmleditor) {
use_html_editor();
<form id="assignform" method="post" action="">
+<div>
<input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
<input type="hidden" name="userid" value="<?php p($userid) ?>" />
<input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<input type="hidden" name="contextid" value="<?php p($contextid) ?>" />
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
- <table summary="" align="center" border="0" cellpadding="5" cellspacing="0">
+ <table summary="" style="margin-left:auto;margin-right:auto" border="0" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">
<label for="removeselect"><?php print_string('existingusers', 'role', count($contextusers)); ?></label>
onfocus="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=false;
getElementById('assignform').addselect.selectedIndex=-1;">
+
<?php
foreach ($contextusers as $contextuser) {
$fullname = fullname($contextuser, true);
echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email.$hidden."</option>\n";
}
?>
-
+ <option/>
</select></td>
<td valign="top">
<br />
</td>
</tr>
</table>
+</div>
</form>
/// In the .html file below we loop through these results and exclude any in $contextusers
- echo '<div align="center">'.$strcurrentcontext.': '.print_context_name($context).'<br/>';
- echo '<label for="jump">'.$strroletoassign.'</label>: ';
+ echo '<div style="text-align:center">'.$strcurrentcontext.': '.print_context_name($context).'<br/>';
+ echo '<label>'.$strroletoassign.'</label>: ';
$assignableroles = array('0'=>get_string('listallroles', 'role').'...') + $assignableroles;
popup_form("$CFG->wwwroot/$CFG->admin/roles/assign.php?userid=$userid&courseid=$courseid&contextid=$contextid&roleid=",
$assignableroles, 'switchrole', $roleid, '');
?>
<form id="form" method="post" action="backup.php">
-<table cellpadding="5">
+<table cellpadding="5" style="text-align:center;margin-left:auto;margin-right:auto">
<?php
if (empty($to)) {
?>
</table>
-<br />
-<center>
+<div style="text-align:center;margin-left:auto;margin-right:auto">
<input type="hidden" name="to" value="<?php p($to) ?>" />
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="launch" value="execute" />
<input type="submit" value="<?php print_string("continue") ?>" />
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
-</center>
+</div>
</form>
}
-->
</script>
-
<form id="form1" method="post" action="backup.php">
-<table cellpadding="5">
+<table cellpadding="5" style="margin-left:auto;margin-right:auto;">
<?php
//Now, check modules and info and show posibilities
if ($allmods = get_records("modules") ) {
//the temp-directory name and records in backup temp tables
?>
</table>
-<br />
-<center>
+
+<div style="text-align:center;margin-left:auto;margin-right:auto">
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="to" value="<?php p($to) ?>" />
<input type="hidden" name="backup_unique_code" value="<?php p($backup_unique_code); ?>" />
<input type="hidden" name="launch" value="check" />
<input type="submit" value="<?php print_string("continue") ?>" />
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
-</center>
-</form>
+</div>
+</form>
\ No newline at end of file
$paramstring .= '<input type="hidden" name="'.$key.'" value="'.s($val).'" />';
}
- $editformstring = '<form '.$CFG->frametarget.' method="get" action="'.$this->url_get_path().'">'
- .$paramstring.'<input type="submit" value="'.$editingString.'" /></form>';
+ $editformstring = '<form '.$CFG->frametarget.' method="get" action="'.$this->url_get_path().'"><fieldset class="invisiblefieldset">'
+ .$paramstring.'<input type="submit" value="'.$editingString.'" /></fieldset></form>';
}
return $editformstring;
/// Start main column
print '<!-- Begin page content -->' . "\n";
-print '<td width="*">';
+print '<td>';
?>
<table width="100%">
<tr>
-<td height="100%" valign="top">
+<td valign="top">
if (has_capability('moodle/blog:create', $sitecontext)) {
//the user's blog is enabled and they are viewing their own blog
- $addlink = '<div align="center">';
+ $addlink = '<div class="addbloglink">';
$addlink .= '<a href="'.$CFG->wwwroot .'/blog/edit.php?action=add'.'">'. get_string('addnewentry', 'blog').'</a>';
$addlink .= '</div>';
echo $addlink;
global $USER, $CFG, $COURSE, $ME;
$template['body'] = format_text($blogEntry->summary, $blogEntry->format);
- $template['title'] = '<a name="'. $blogEntry->subject .'"></a>';
+ //$template['title'] = '<a name="'. $blogEntry->subject .'"></a>';
//enclose the title in nolink tags so that moodle formatting doesn't autolink the text
- $template['title'] .= '<span class="nolink">'.$blogEntry->subject.'</span>';
+ $template['title'] = '<span class="nolink">'.$blogEntry->subject.'</span>';
$template['userid'] = $blogEntry->userid;
$template['author'] = fullname(get_record('user','id',$blogEntry->userid));
$template['lastmod'] = userdate($blogEntry->lastmodified);
if ($firstentry) {
echo '<table align="center" border="0" cellspacing="2" cellpadding="4" class="generalbox">';
echo '<tr><th scope="col">'.get_string('subcategories').'</th></tr>';
- echo '<tr><td nowrap="nowrap">';
+ echo '<tr><td style="white-space: nowrap">';
$firstentry = false;
}
$catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" ";
if ($teachers = get_course_teachers($course->id)) {
- echo "<table align=\"center\"><tr><td nowrap=\"nowrap\">";
+ echo "<table align=\"center\"><tr><td style=\"white-space: nowrap\">";
echo "<p><font size=\"1\">\n";
foreach ($teachers as $teacher) {
if ($teacher->authority > 0) {
echo "<td> </td>";
if (isset($result->time)) {
$timeago = format_time(time() - $result->time);
- echo "<td valign=\"top\" nowrap=\"nowrap\">".userdate($result->time)." ($timeago)</td>";
+ echo "<td valign=\"top\" style=\"white-space: nowrap\">".userdate($result->time)." ($timeago)</td>";
}
echo "</tr>";
}
echo "<tr>";
echo "<td valign=\"top\">$image</td>";
- echo "<td valign=\"top\" width=\"300\">";
+ echo "<td valign=\"top\" style=\"width:300\">";
echo " <a title=\"$mod->modfullname\"";
echo " href=\"../mod/$mod->modname/view.php?id=$mod->id\">".format_string($instance->name,true)."</a></td>";
echo "<td> </td>";
if (isset($result->info)) {
echo "$result->info";
} else {
- echo "<p align=\"center\">-</p>";
+ echo "<p style=\"text-align:center\">-</p>";
}
echo "</td>";
echo "<td> </td>";
if (!empty($result->time)) {
$timeago = format_time(time() - $result->time);
- echo "<td valign=\"top\" nowrap=\"nowrap\">".userdate($result->time)." ($timeago)</td>";
+ echo "<td valign=\"top\" style=\"white-space: nowrap\">".userdate($result->time)." ($timeago)</td>";
}
echo "</tr>";
}
$return .= '<option value="' . $key . '"' . ($key == $currentsetting['m'] ? ' selected="selected"' : '') . '>' . $value . '</option>';
}
$return .= '</select></div>';
- return format_admin_setting($this->name, $this->visiblename, $return, $this->description);
+ return format_admin_setting($this->name, $this->visiblename, $return, $this->description, false);
}
}
}
$return .= '</div>';
- return format_admin_setting($this->name, $this->visiblename, $return, $this->description);
+ return format_admin_setting($this->name, $this->visiblename, $return, $this->description, false);
}
}
$return = print_textarea($CFG->adminusehtmleditor, 15, 60, 0, 0, 's_' . $this->name, $currentsetting, 0, true);
- return format_admin_setting($this->name, $this->visiblename, $return, $this->description);
+ return format_admin_setting($this->name, $this->visiblename, $return, $this->description, false);
}
function get_setting() {
}
-function format_admin_setting($name, $title='', $form='', $description='') {
- return "\n".
+function format_admin_setting($name, $title='', $form='', $description='', $label=true) {
+
+ // sometimes the id is not id_s_name, but id_s_name_m or something, and this does not validate
+ if ($label) {
+ $labelfor = 'for = "id_s_'.$name.'"';
+ } else {
+ $labelfor = '';
+ }
+
+ $str = "\n".
'<div class="form-item" id="admin-'.$name.'">'."\n".
- '<label for="id_s_'.$name.'">'.$title."\n".
+ '<label '.$labelfor.'>'.$title."\n".
' <span class="form-shortname">'.$name.'</span>'."\n".
'</label>'."\n".
$form."\n".
'<div class="description">'.$description.'</div>'."\n".
'</div>'.
"\n\n";
+
+ return $str;
}
/*
$htmlid = 'auto-cb'.sprintf('%04d', ++$idcounter);
$output = '<span class="checkbox '.$name."\">";
- $output .= '<input name="'.$name.'" id="'.$htmlid.'" type="checkbox" value="'.$value.'" alt="'.$alt.'"'.$strchecked.' '.((!empty($script)) ? ' onClick="'.$script.'" ' : '').' />';
+ $output .= '<input name="'.$name.'" id="'.$htmlid.'" type="checkbox" value="'.$value.'" alt="'.$alt.'"'.$strchecked.' '.((!empty($script)) ? ' onclick="'.$script.'" ' : '').' />';
if(!empty($label)) {
$output .= ' <label for="'.$htmlid.'">'.$label.'</label>';
}
print_header('', '', '', '', '<meta http-equiv="refresh" content="'. $delay .'; url='. $encodedurl .'" />');
$delay += 3; // double redirect prevention, it was sometimes breaking upgrades before 1.7
}
- echo '<center>';
+ echo '<div style="text-align:center">';
echo '<p>'. $message .'</p>';
echo '<p>( <a href="'. $encodedurl .'">'. get_string('continue') .'</a> )</p>';
- echo '</center>';
+ echo '</div>';
// it might be better not to set timeout the same for both types of redirect, so that we can be sure which one wins
?>
<script type="text/javascript">
if ($chat->chattime and $chat->schedule) { // A chat is scheduled
- echo "<p align=\"center\">$strnextsession: ".userdate($chat->chattime).' ('.usertimezone($USER->timezone).')</p>';
+ echo "<p class=\"nextchatsession\">$strnextsession: ".userdate($chat->chattime).' ('.usertimezone($USER->timezone).')</p>';
} else {
echo '<br />';
}
echo '<tr><td width="35">';
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$chatuser->id&course=$chat->course\">";
print_user_picture($chatuser->id, 0, $chatuser->picture, false, false, false);
- echo '</a></td><td valign="center">';
+ echo '</a></td><td style="vertical-align: middle">';
echo '<p><font size="1">';
echo fullname($chatuser).'<br />';
echo "<font color=\"#888888\">$stridle: ".format_time($lastping)."</font>";
/***
*** Blogs
***/
+.addbloglink {
+ text-align: center;
+}
.blogpost .audience {
text-align: right;
*** Modules: Chat
***/
+.nextchatsession {
+ text-align:center;
+}
+
#mod-chat-gui_header_js-jsupdate {
margin:10px
}
width:50%;
vertical-align:top;
}
+
+.whitecell {
+ background-color:white;
+}
/***
*** Modules: Wiki
***/