From: moodler Date: Wed, 22 Mar 2006 13:38:29 +0000 (+0000) Subject: Fixed up some styles and pagepath for field-editing pages X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=26d93549f5b9bdf2ae58740a406990af505211d8;p=moodle.git Fixed up some styles and pagepath for field-editing pages --- diff --git a/mod/data/field/checkbox/mod.html b/mod/data/field/checkbox/mod.html index bdd691cb3f..d65576ec11 100755 --- a/mod/data/field/checkbox/mod.html +++ b/mod/data/field/checkbox/mod.html @@ -1,14 +1,14 @@ - - + + - - + + - - + +
::
::
::
diff --git a/mod/data/field/file/mod.html b/mod/data/field/file/mod.html index d4b51d5a21..7caf632710 100755 --- a/mod/data/field/file/mod.html +++ b/mod/data/field/file/mod.html @@ -1,15 +1,10 @@ - - + + - + +
- : - - - :
- : - :
diff --git a/mod/data/field/menu/mod.html b/mod/data/field/menu/mod.html index c29f4264c0..37da4bb9c6 100755 --- a/mod/data/field/menu/mod.html +++ b/mod/data/field/menu/mod.html @@ -1,14 +1,14 @@ - - + + - - + + - - + +
::
::
::
diff --git a/mod/data/field/multimenu/mod.html b/mod/data/field/multimenu/mod.html index 8c242017b0..4eec87939e 100755 --- a/mod/data/field/multimenu/mod.html +++ b/mod/data/field/multimenu/mod.html @@ -1,14 +1,14 @@ - - + + - - + + - - + +
::
::
diff --git a/mod/data/field/picture/mod.html b/mod/data/field/picture/mod.html index 0cda00854d..a5ef9274a0 100755 --- a/mod/data/field/picture/mod.html +++ b/mod/data/field/picture/mod.html @@ -1,51 +1,54 @@ - + - - - - - - - + - - - -
- : + + :
+ : - + +
+ : +
+ : +
- : + + : +
+ : +
+ : + maxbytes = get_field('course', 'maxbytes', 'id', $this->data->course); $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes); diff --git a/mod/data/field/radiobutton/mod.html b/mod/data/field/radiobutton/mod.html index bdd691cb3f..d65576ec11 100755 --- a/mod/data/field/radiobutton/mod.html +++ b/mod/data/field/radiobutton/mod.html @@ -1,14 +1,14 @@ - - + + - - + + - - + +
::
::
::
diff --git a/mod/data/field/text/mod.html b/mod/data/field/text/mod.html index d49b15c68f..a39f4b83ba 100755 --- a/mod/data/field/text/mod.html +++ b/mod/data/field/text/mod.html @@ -1,14 +1,14 @@ - - + + - - + + - - + +
::
::
:field->param1) {echo 'checked="checked"';} ?> value="1" />:field->param1) {echo 'checked="checked"';} ?> value="1" />
diff --git a/mod/data/field/textarea/mod.html b/mod/data/field/textarea/mod.html index 2595ce0c13..262c120b3c 100755 --- a/mod/data/field/textarea/mod.html +++ b/mod/data/field/textarea/mod.html @@ -1,18 +1,18 @@ - - + + - - + + - - + + - - + +
::
::
: columns: columns
: rows: rows
diff --git a/mod/data/field/url/mod.html b/mod/data/field/url/mod.html index 4fe3592fe1..b105c27331 100755 --- a/mod/data/field/url/mod.html +++ b/mod/data/field/url/mod.html @@ -1,18 +1,10 @@ - - + + - - + +
- : - - - :
- : - - - :
diff --git a/mod/data/fields.php b/mod/data/fields.php index d31550f520..dff4227c3f 100755 --- a/mod/data/fields.php +++ b/mod/data/fields.php @@ -60,18 +60,12 @@ error(get_string('noaccess','data')); } - $strdata = get_string('modulenameplural','data'); - - print_header_simple($data->name, '', "$strdata -> $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,21 +181,25 @@ } 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)) { @@ -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, '', "$strdata -> $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) + } + } + ?> diff --git a/mod/data/styles.php b/mod/data/styles.php index 7e14bea620..3eeaa1d7e8 100644 --- a/mod/data/styles.php +++ b/mod/data/styles.php @@ -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; +}