More UI for calendar and DST options.

This commit is contained in:
defacer 2005-02-17 00:16:15 +00:00
parent b8a6c0da69
commit 81e6a0a5af
7 changed files with 47 additions and 22 deletions

View File

@ -1,8 +1,8 @@
<?php print_simple_box_start('center', '70%'); ?>
<form method="post" action="dst.php">
<p><input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"></p>
<div style="text-align: center;">
<table style="margin: auto; width: 100%;" cellpadding="5" cellspacing="0">
<table style="width: 100%;">
<tbody>
<tr>
<td style="vertical-align: top; width: 40%;">
@ -21,16 +21,23 @@
</div>
</td>
<td style="vertical-align: middle;text-align: center;">
<div id="dstdisplayboard">&nbsp;</div>
<p>
<input type="submit" name="mode_add" value="<?php print_string('add'); ?>..." />
<input type="submit" name="mode_edit" value="<?php print_string('edit'); ?>" <?php if(empty($presets)) echo 'disabled="disabled"';?> />
<input type="submit" name="mode_delete" value="<?php print_string('delete'); ?>" <?php if(empty($presets)) echo 'disabled="disabled"';?> />
</p>
</td>
</tr>
</tbody>
</table>
</div>
</form>
<?php print_simple_box_end(); ?>
<form method="post" action="calendar.php">
<p style="text-align: center;"><input type="submit" value="<?php print_string('returntocalendaroptions', 'admin'); ?>"></p>
</form>
<script type="text/javascript">
<!--
var DSTPresetInfo = new Array();

View File

@ -28,6 +28,7 @@
"<a href=\"configure.php\">$strconfiguration</a> -> ".
"<a href=\"calendar.php\">$strcalendarsettings</a> -> $strcalendardstpresets");
$errorhtml = '';
$mode = '';
$form = false;
@ -177,14 +178,11 @@
redirect('dst.php');
}
else {
echo '<div class="errorbox">';
echo '<h1>'.get_string('therewereerrors', 'admin').':</h1>';
echo '<ul>';
$errorhtml = '<div class="errorbox"><div class="title">'.get_string('therewereerrors', 'admin').':</div><ul>';
foreach($errors as $error) {
echo '<li>'.$error.'</li>';
$errorhtml .= '<li>'.$error.'</li>';
}
echo '</ul>';
echo '</div>';
$errorhtml .= '</ul></div>';
}
}
@ -200,6 +198,7 @@
6 => get_string('saturday', 'calendar')
);
print_heading(get_string('editingdstpreset', 'admin'));
echo $errorhtml;
print_simple_box_start('center', '70%');
include('./dst_edit.html');
print_simple_box_end();
@ -219,9 +218,7 @@
}
}
print_heading($strcalendardstpresets);
print_simple_box_start('center', '70%');
include('./dst.html');
print_simple_box_end();
}
print_footer();

View File

@ -6,21 +6,21 @@
</p>
<div style="text-align: center;">
<table style="margin: auto;" class="formtable">
<table class="formtable">
<tbody>
<tr>
<th>
<?php print_string('dstpresetname', 'calendar'); ?>
<?php print_string('dstpresetname', 'calendar'); ?>:
</th>
<td style="vertical-align: top;">
<td>
<input type="text" name="name" value="<?php print $preset->name; ?>" size="50" />
</td>
</tr>
<tr>
<th>
<?php print_string('dstpresetactivated', 'calendar'); ?>
<?php print_string('dstpresetactivated', 'calendar'); ?>:
</th>
<td style="vertical-align: top;">
<td>
<?php print_string('dstonthe', 'calendar'); ?>
<?php choose_from_menu(array('1' => get_string('first', 'calendar'), '-1' => get_string('last', 'calendar')), 'activate_index', $preset->activate_index, ''); ?>
<?php choose_from_menu($weekdays, 'activate_day', $preset->activate_day, ''); ?>
@ -31,9 +31,9 @@
</tr>
<tr>
<th>
<?php print_string('dstpresetadjusttime', 'calendar'); ?>
<?php print_string('dstpresetadjusttime', 'calendar'); ?>:
</th>
<td style="vertical-align: top;">
<td>
<?php print_string('dstadjusttime', 'calendar'); ?>
<?php choose_from_menu(array('1' => get_string('timeforward', 'calendar'), '-1' => get_string('timerewind', 'calendar')), 'apply_offset_sign', $preset->apply_offset_sign, ''); ?>
<?php print_string('dstby', 'calendar'); ?>
@ -43,9 +43,9 @@
</tr>
<tr>
<th>
<?php print_string('dstpresetdeactivated', 'calendar'); ?>
<?php print_string('dstpresetdeactivated', 'calendar'); ?>:
</th>
<td style="vertical-align: top;">
<td>
<?php print_string('dstonthe', 'calendar'); ?>
<?php choose_from_menu(array('1' => get_string('first', 'calendar'), '-1' => get_string('last', 'calendar')), 'deactivate_index', $preset->deactivate_index, ''); ?>
<?php choose_from_menu($weekdays, 'deactivate_day', $preset->deactivate_day, ''); ?>
@ -57,7 +57,7 @@
</table>
<div style="margin: 1em;">
<input type="submit" name="result_ok" value="<?php print_string('ok'); ?>" />
<input type="submit" name="result_ok" value="<?php print_string('savechanges'); ?>" />
<input type="submit" name="result_cancel" value="<?php print_string('cancel'); ?>" />
</div>

View File

@ -108,6 +108,7 @@ $string['helpweekenddays'] = 'Which days of the week are treated as \"weekend\"
$string['managedstpresets'] = 'Manage DST Presets';
$string['nodstpresetsexist'] = 'DST support is disabled for all users because there are no DST presets defined. You can define some presets using the button below.';
$string['optionalmaintenancemessage'] = 'Optional maintenance messsage';
$string['returntocalendaroptions'] = 'Return to calendar options';
$string['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available';
$string['sitemaintenancemode'] = 'Maintenance mode';
$string['sitemaintenanceon'] = 'Your site is currently in maintenance mode (only admins can log in or use the site).';

View File

@ -136,6 +136,11 @@ th {
border-color:#DDDDDD; /* borders */
}
.errorbox {
color:#ffffff;
border-color:#660000;
background-color:#990000;
}
/* summary of a user in a nice little box - weblib.php */
.userinfobox {

View File

@ -121,6 +121,12 @@ h4 {
******************************/
/* many places */
.errorbox .title {
font-weight: bold;
font-size: 1.2em;
text-align: center;
}
/* paging bar */
.pagingbar .title {
font-weight: bold;

View File

@ -130,6 +130,15 @@ a img {
border-width:1px;
border-style:solid;
}
.errorbox {
border-width:1px;
border-style:solid;
margin: 1em 15%;
width: 70%;
}
.errorbox .title {
padding: 5px;
}
.informationbox {
border-width:1px;
border-style:solid;