Fixed up some styles and pagepath for field-editing pages

This commit is contained in:
moodler 2006-03-22 13:38:29 +00:00
parent 76a1cf366e
commit 26d93549f5
11 changed files with 119 additions and 89 deletions

View file

@ -1,14 +1,14 @@
<table width="100%">
<tr>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
<td class="c0"><?php echo get_string('fieldname', 'data'); ?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
<td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
<td class="c0" valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
</tr>
</table>

View file

@ -1,15 +1,10 @@
<table width="100%">
<tr>
<td>
<?php echo get_string('fieldname', 'data'); ?>:
</td>
<td>
<input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" />
</td>
<td class="c0"> <?php echo get_string('fieldname', 'data'); ?>: </td>
<td class="c1"> <input class="fieldname" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td>
<?php echo get_string('fielddescription', 'data'); ?>:</td><td><input style="width:300px;" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" />
</td>
<td class="c0"> <?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" /></td>
</tr>
</table>

View file

@ -1,14 +1,14 @@
<table width="100%">
<tr>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" /></td>
<td class="c0"><?php echo get_string('fieldname', 'data'); ?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" /></td>
<td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" /></td>
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
<td class="c0" valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
</tr>
</table>

View file

@ -1,14 +1,14 @@
<table width="100%">
<tr>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
<td class="c0"><?php echo get_string('fieldname', 'data'); ?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
<td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?></td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
<td class="c0" valign="top"><?php echo get_string('fieldoptions', 'data'); ?></td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
</tr>
</table>

View file

@ -1,51 +1,54 @@
<table width="100%">
<tr>
<td>
<?php echo get_string('fieldname', 'data');?>:</td><td><input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" />
<td class="c0">
<?php echo get_string('fieldname', 'data');?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" />
</td>
</tr>
<tr>
<td>
<td class="c0">
<?php echo get_string('fielddescription', 'data');?>:
</td>
<td>
<input style="width:300px;" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" />
<td class="c1">
<input class="fielddescription" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" />
</td>
</tr>
<tr>
<td>
<td class="c0">
<?php echo get_string('fieldwidthsingleview', 'data');?>:
</td>
<td>
<td class="c1">
<input style="width:70px;" type="text" name="param1" id="param1" value = "<?php if (!empty($this->field->param1)) echo $this->field->param1; ?>" />
</td>
</tr>
<tr>
<td>
<td class="c0">
<?php echo get_string('fieldheightsingleview', 'data');?>:
</td>
<td>
<td class="c1">
<input style="width:70px;" type="text" name="param2" id="param2" value = "<?php if (!empty($this->field->param2)) echo $this->field->param2; ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldwidthlistview', 'data');?>:</td><td><input style="width:70px;" type="text" name="param4" id="param4" value = "<?php if (!empty($this->field->param4)) echo $this->field->param4; ?>" />
<td class="c0">
<?php echo get_string('fieldwidthlistview', 'data');?>:
</td>
<td class="c1"><input style="width:70px;" type="text" name="param4" id="param4" value = "<?php if (!empty($this->field->param4)) echo $this->field->param4; ?>" />
</td>
</tr>
<tr>
<td>
<td class="c0">
<?php echo get_string('fieldheightlistview', 'data');?>:
</td>
<td>
<td class="c1">
<input style="width:70px;" type="text" name="param5" id="param5" value = "<?php if (!empty($this->field->param5)) echo $this->field->param5; ?>" />
</td>
</tr>
<tr>
<td>
<td class="c0">
<?php echo get_string('maxsize', 'data'); ?>:
</td>
<td>
<td class="c1">
<?php
$course->maxbytes = get_field('course', 'maxbytes', 'id', $this->data->course);
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);

View file

@ -1,14 +1,14 @@
<table width="100%">
<tr>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
<td class="c0"><?php echo get_string('fieldname', 'data'); ?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
<td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
<td class="c0" valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {echo $this->field->param1;} ?></textarea></td>
</tr>
</table>

View file

@ -1,14 +1,14 @@
<table width="100%">
<tr>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
<td class="c0"><?php echo get_string('fieldname', 'data'); ?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
<td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fieldallowautolink', 'data'); ?>:</td>
<td><input type="checkbox" name="param1" id="param1" <?php if($this->field->param1) {echo 'checked="checked"';} ?> value="1" /></td>
<td class="c0"><?php echo get_string('fieldallowautolink', 'data'); ?>:</td>
<td class="c1"><input type="checkbox" name="param1" id="param1" <?php if($this->field->param1) {echo 'checked="checked"';} ?> value="1" /></td>
</tr>
</table>

View file

@ -1,18 +1,18 @@
<table width="100%">
<tr>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
<td class="c0"><?php echo get_string('fieldname', 'data'); ?>:</td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php echo($this->field->name); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
<td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php echo($this->field->description); ?>" /></td>
</tr>
<tr>
<td><?php echo get_string('fieldwidth', 'data'); ?>:</td>
<td><input style="width:50px;" type="text" name="param2" id="width" value="<?php echo($this->field->param2); ?>" /> columns</td>
<td class="c0"><?php echo get_string('fieldwidth', 'data'); ?>:</td>
<td class="c1"><input style="width:50px;" type="text" name="param2" id="width" value="<?php echo($this->field->param2); ?>" /> columns</td>
</tr>
<tr>
<td><?php echo get_string('fieldheight', 'data'); ?>:</td>
<td><input style="width:50px;" type="text" name="param3" id="height" value="<?php echo($this->field->param3); ?>" /> rows</td>
<td class="c0"><?php echo get_string('fieldheight', 'data'); ?>:</td>
<td class="c1"><input style="width:50px;" type="text" name="param3" id="height" value="<?php echo($this->field->param3); ?>" /> rows</td>
</tr>
</table>

View file

@ -1,18 +1,10 @@
<table width="100%">
<tr>
<td>
<?php echo get_string('fieldname', 'data'); ?>:
</td>
<td>
<input style="width:350px;" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" />
</td>
<td class="c0"> <?php echo get_string('fieldname', 'data'); ?>: </td>
<td class="c1"> <input class="fieldname" type="text" name="name" id="name" value = "<?php echo($this->field->name); ?>" /> </td>
</tr>
<tr>
<td>
<?php echo get_string('fielddescription', 'data'); ?>:
</td>
<td>
<input style="width:350px;" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" />
</td>
<td class="c0"> <?php echo get_string('fielddescription', 'data'); ?>: </td>
<td class="c1"> <input class="fielddescription" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" /> </td>
</tr>
</table>

View file

@ -60,18 +60,12 @@
error(get_string('noaccess','data'));
}
$strdata = get_string('modulenameplural','data');
print_header_simple($data->name, '', "<a href='index.php?id=$course->id'>$strdata</a> -> $data->name",
'', '', true, '', navmenu($course, $cm));
print_heading(format_string($data->name));
/************************************
* Data Processing *
***********************************/
switch ($mode){
switch ($mode) {
case 'add': ///add a new field
if (confirm_sesskey() and $fieldinput = data_submitted($CFG->wwwroot.'/mod/data/fields.php')){
@ -136,8 +130,10 @@
case 'delete': // Delete a field
if (confirm_sesskey()){
if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
// Delete the field completely
if ($field = data_get_field_from_id($fid, $data)) {
$field->delete_field();
@ -152,6 +148,9 @@
}
} else {
data_fields_print_header($course,$cm,$data, false);
// Print confirmation message.
$field = data_get_field_from_id($fid, $data);
@ -169,10 +168,7 @@
break;
}
/// Print the tabs
$currenttab = 'fields';
include('tabs.php');
/// Print the browsing interface
@ -185,22 +181,26 @@
}
asort($menufield); //sort in alphabetical order
if (!empty($displaynoticegood)) {
notify($displaynoticegood, 'notifysuccess'); // good (usually green)
} else if (!empty($displaynoticebad)) {
notify($displaynoticebad); // bad (usuually red)
}
if (($mode == 'new') && confirm_sesskey()) { /// Adding a new field
$CFG->pagepath='mod/data/field/'.$newtype;
data_fields_print_header($course,$cm,$data);
$field = data_get_field_new($newtype, $data);
$field->display_edit_field();
} else if ($mode == 'display' && confirm_sesskey()) { /// Display/edit existing field
$CFG->pagepath='mod/data/field/'.$newtype;
data_fields_print_header($course,$cm,$data);
$field = data_get_field_from_id($fid, $data);
$field->display_edit_field();
} else { /// Display the main listing of all fields
$CFG->pagepath='mod/data/field/'.$newtype;
data_fields_print_header($course,$cm,$data);
if (!record_exists('data_fields','dataid',$data->id)) {
notify(get_string('nofieldindatabase','data')); // nothing in database
@ -251,4 +251,32 @@
/// Finish the page
print_footer($course);
function data_fields_print_header($course,$cm,$data,$showtabs=true) {
global $CFG, $displaynoticegood, $displaynoticebad;
$strdata = get_string('modulenameplural','data');
print_header_simple($data->name, '', "<a href='index.php?id=$course->id'>$strdata</a> -> $data->name",
'', '', true, '', navmenu($course, $cm));
print_heading(format_string($data->name));
/// Print the tabs
if ($showtabs) {
$currenttab = 'fields';
include_once('tabs.php');
}
/// Print any notices
if (!empty($displaynoticegood)) {
notify($displaynoticegood, 'notifysuccess'); // good (usually green)
} else if (!empty($displaynoticebad)) {
notify($displaynoticebad); // bad (usuually red)
}
}
?>

View file

@ -1,3 +1,15 @@
#mod-data-view #sortsearch .c0 {
text-align: right;
}
.mod-data-field .c0 {
text-align: right;
}
.mod-data-field .fieldname {
width:300px;
}
.mod-data-field .fielddescription {
width:300px;
}