]> git.mjollnir.org Git - moodle.git/commitdiff
xhtml and accessibility cleanup in data mod MDL-7813
authorskodak <skodak>
Tue, 12 Dec 2006 23:34:55 +0000 (23:34 +0000)
committerskodak <skodak>
Tue, 12 Dec 2006 23:34:55 +0000 (23:34 +0000)
* image galery preset accessiblity fixes MDL-7822
* xhtml fixes
* fields now use s() and p() where needed
* added labels to all fields - imporved accessiblity for adding of new entries
* some other general bugfixing and cleanup

it is still not finished though, expect some more commits tomorrow

29 files changed:
mod/data/edit.php
mod/data/field.php
mod/data/field/checkbox/field.class.php
mod/data/field/checkbox/mod.html
mod/data/field/date/field.class.php
mod/data/field/date/mod.html
mod/data/field/file/field.class.php
mod/data/field/file/mod.html
mod/data/field/latlong/field.class.php
mod/data/field/latlong/mod.html
mod/data/field/menu/field.class.php
mod/data/field/menu/mod.html
mod/data/field/multimenu/field.class.php
mod/data/field/multimenu/mod.html
mod/data/field/number/mod.html
mod/data/field/picture/field.class.php
mod/data/field/picture/mod.html
mod/data/field/radiobutton/field.class.php
mod/data/field/radiobutton/mod.html
mod/data/field/text/mod.html
mod/data/field/textarea/field.class.php
mod/data/field/textarea/mod.html
mod/data/field/url/field.class.php
mod/data/field/url/mod.html
mod/data/lib.php
mod/data/preset.php
mod/data/preset/imagegallery/addtemplate.html
mod/data/preset/imagegallery/listtemplate.html
mod/data/templates.php

index e811b6b900b7ba9f7f6757bc721e44b2402d70bb..4300bba674180fe0eff6fd2465dc9db3b1866cd0 100755 (executable)
     echo $newtext;
     echo '<div align="center"><input type="submit" name="saveandview" value="'.get_string('saveandview','data').'" />';
     if ($rid) {
-        echo '&nbsp;<input type="submit" name="cancel" value="'.get_string('cancel').'" onclick="javascript:history.go(-1)">';
+        echo '&nbsp;<input type="submit" name="cancel" value="'.get_string('cancel').'" onclick="javascript:history.go(-1)" />';
     } else {
         echo '<input type="submit" value="'.get_string('saveandadd','data').'" />';
     }
index bbfedcd2f58a2254d06cfcdba2b51b1aa72d7476..2459c1cb4bf838e0efc2399c6e0727713c06e26e 100755 (executable)
                     shorten_text($field->field->description, 30),
 
                     '<a href="field.php?d='.$data->id.'&amp;mode=display&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
-                    '<img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" /></a>'.
+                    '<img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" title="'.get_string('edit').'" /></a>'.
                     '&nbsp;'.
                     '<a href="field.php?d='.$data->id.'&amp;mode=delete&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
-                    '<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" /></a>'
+                    '<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" title="'.get_string('delete').'" /></a>'
                     
                     );
                 }
index 673433d2da7f6b92337ada456c140d233f542824..a5912ac408ebceb8180bf97f2fe4f480213aa398 100755 (executable)
@@ -40,26 +40,30 @@ class data_field_checkbox extends data_field_base {
             $content = explode('##', $content);
         }
 
-        $str = '<div title="'.$this->field->description.'">';
-        
+        $str = '<div title="'.s($this->field->description).'">';
+        $str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>';
+        $i = 0;
         foreach (explode("\n", $this->field->param1) as $checkbox) {
             $checkbox = trim($checkbox);
-            $str .= '<input type="checkbox" name="field_' . $this->field->id . '[]" ';
-            $str .= 'value="' . $checkbox . '" ';
+            $str .= '<input type="checkbox" id="field_'.$this->field->id.'_'.$i.'" name="field_' . $this->field->id . '[]" ';
+            $str .= 'value="' . s($checkbox) . '" ';
             
             if (array_search($checkbox, $content) !== false) {
                 $str .= 'checked />';
             } else {
                 $str .= '/>';
             }
-            $str .= $checkbox . '<br />';
+            $str .= '<label for="field_'.$this->field->id.'_'.$i.'">'.$checkbox.'</label><br />';
+            $i++;
         }
+        $str .= '</fieldset>'; 
         $str .= '</div>';
         return $str;
     }
 
     function update_content($recordid, $value, $name='') {
-        $content = new object;
+        $content = new object();
         $content->fieldid = $this->field->id;
         $content->recordid = $recordid;
         $content->content = $this->format_data_field_checkbox_content($value);
index d65576ec11bcebb3b986e7c90947d22a0784002b..6d8bef382340dcd957461900336f289017b5be36 100755 (executable)
@@ -1,14 +1,14 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
+        <td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
     </tr>
 </table>
index 9b2824ea75b75ad2189e629d462d68fd56523e7e..de6ac78569832b403063b87be9a4ce7d16588cef 100755 (executable)
@@ -42,7 +42,7 @@ class data_field_date extends data_field_base {
             $content = time();
         }
 
-        $str = '<div title="'.$this->field->description.'">';
+        $str = '<div title="'.s($this->field->description).'">';
         $str .= print_date_selector('field_'.$this->field->id.'_day', 'field_'.$this->field->id.'_month', 
                                     'field_'.$this->field->id.'_year', $content, true);
         $str .= '</div>';
index 155b409f8756571df93af37048da6a6b94d5f4cd..831560f1b5723a60d0c2bc2d0a1a3f391082aa24 100755 (executable)
@@ -1,10 +1,10 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" /></td>
     </tr>
 </table>
index 5fd812f7cdaa1a06ddaec6848a8928b42853e713..e4e2a515bbf1024754deef7e511e211c3a5eb334 100755 (executable)
@@ -60,13 +60,15 @@ class data_field_file extends data_field_base {
             $source = '';
         }
 
-        $str = '<div title="' . $this->field->description . '">';
+        $str = '<div title="' . s($this->field->description) . '">';
+        $str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>'; 
         $str .= '<input type="hidden" name ="field_'.$this->field->id.'_file" value="fakevalue" />';
-        $str .= get_string('file','data'). ': <input type="file" name ="field_'.$this->field->id.'" id="field_'.
-                            $this->field->id.'" title="'.$this->field->description.'" /><br />';
-        $str .= get_string('optionalfilename','data').': <input type="text" name="field_' .$this->field->id.'_filename"
-                            id="field_'.$this->field->id.'_filename" value="'.$displayname.'" /><br />';
-        $str .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.$this->field->param3.'" />';
+        $str .= get_string('file','data'). ' <input type="file" name ="field_'.$this->field->id.'" id="field_'.
+                            $this->field->id.'" title="'.s($this->field->description).'" /><br />';
+        $str .= get_string('optionalfilename','data').' <input type="text" name="field_' .$this->field->id.'_filename"
+                            id="field_'.$this->field->id.'_filename" value="'.s($displayname).'" /><br />';
+        $str .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.s($this->field->param3).'" />';
+        $str .= '</fieldset>'; 
         $str .= '</div>';
 
         if ($recordid and isset($content)){                     // Print icon
@@ -97,8 +99,8 @@ class data_field_file extends data_field_base {
                 $source = $CFG->wwwroot.'/file.php?file=/'.$path;
             }
             
-            $width = $this->field->param1 ? ' width = "'.$this->field->param1.'" ':' ';
-            $height = $this->field->param2 ? ' height = "'.$this->field->param2.'" ':' ';
+            $width = $this->field->param1 ? ' width = "'.s($this->field->param1).'" ':' ';
+            $height = $this->field->param2 ? ' height = "'.s($this->field->param2).'" ':' ';
             
             require_once($CFG->libdir.'/filelib.php');
             $icon = mimeinfo('icon', $src);
index 7caf63271033386cdb732153652ddb6214b2952a..9fd3c6030754d7e4fc739f7de8e45b6332df0df9 100755 (executable)
@@ -1,10 +1,21 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" /></td>
+    </tr>
+    <tr>
+        <td class="c0"><label for="param3">
+            <?php echo get_string('maxsize', 'data'); ?></label></td>
+        <td class="c1">
+            <?php
+                $course->maxbytes = get_field('course', 'maxbytes', 'id', $this->data->course);
+                $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
+                choose_from_menu($choices, 'param3', $this->field->param3, '', '', 0, false, false, 0, 'param3');
+            ?>
+        </td>
     </tr>
 </table>
index c44e8f4b925bba0ba1ced8c56e11d4757092a9af..6e7251c6eb6f17f7ee97b62f886c8600797be32a 100755 (executable)
@@ -64,11 +64,13 @@ class data_field_latlong extends data_field_base {
             }
         }
 
-        $str = '<div title="'.$this->field->description.'">';
+        $str = '<div title="'.s($this->field->description).'">';
+        $str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>'; 
         $str .= '<table><tr><td align="right">';
-        $str .= '<label for="field_'.$this->field->id.'_0">' . get_string('latitude', 'data') . '</label>:</td><td><input type="text" name="field_'.$this->field->id.'_0" id="field_'.$this->field->id.'_0" value="'.$lat.'" size="10" />°N</td></tr>';
-        $str .= '<tr><td align="right"><label for="field_'.$this->field->id.'_1">' . get_string('longitude', 'data') . '</label>:</td><td><input type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="'.$long.'" size="10" />°E</td></tr>';
+        $str .= '<label for="field_'.$this->field->id.'_0">' . get_string('latitude', 'data') . '</label></td><td><input type="text" name="field_'.$this->field->id.'_0" id="field_'.$this->field->id.'_0" value="'.s($lat).'" size="10" />°N</td></tr>';
+        $str .= '<tr><td align="right"><label for="field_'.$this->field->id.'_1">' . get_string('longitude', 'data') . '</label></td><td><input type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="'.s($long).'" size="10" />°E</td></tr>';
         $str .= '</table>';
+        $str .= '</fieldset>'; 
         $str .= '</div>';
         
         return $str;
index 4d69e4f026ae984136299eb430d0cb193c46d96a..d924d1104d3fb878a8dec4f8adbe7b669e0977e1 100755 (executable)
@@ -1,16 +1,16 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p ($this->field->description);?>" /></td>
     </tr>
     <tr>
-        <td class="c0"><?php echo get_string('latlonglinkservicesdisplayed', 'data'); ?>:</td>
+        <td class="c0"><label for="param1"><?php echo get_string('latlonglinkservicesdisplayed', 'data'); ?></label></td>
         <td class="c1">
-          <select class="linkservicesdisplayed" name="param1[]" id="param1" multiple="multiple" size="<?php echo sizeof($this->linkoutservices) ?>">
+          <select class="linkservicesdisplayed" name="param1[]" id="param1" multiple="multiple" size="<?php p(sizeof($this->linkoutservices)); ?>">
             <?php
             $serviceschosen = explode(',', htmlspecialchars($this->field->param1));
             foreach($this->linkoutservices as $servicename=>$serviceurl) {
@@ -22,7 +22,7 @@
         </td>
     </tr>
     <tr>
-        <td class="c0"><?php echo get_string('latlongkmllabelling', 'data'); ?>:</td>
+        <td class="c0"><label for="param2"><?php echo get_string('latlongkmllabelling', 'data'); ?></label></td>
         <td class="c1">
           <select class="kmllabelling" name="param2" id="param2">
             <option value="-1"<?php if($this->field->param2==-1) echo ' selected="selected"' ?>><?php echo get_string('entry', 'data') ?> #</option>
index b6cc948e1fb16fd0e55d15b25a2bc831f1655291..e6e54d775abc5dce58e2ada78eca1914e35bcc58 100755 (executable)
@@ -39,7 +39,7 @@ class data_field_menu extends data_field_base {
             $content = '';
         }
 
-        $str = '<div title="'.$this->field->description.'">';
+        $str = '<div title="'.s($this->field->description).'">';
 
         $rawoptions = explode("\n",$this->field->param1);
         foreach ($rawoptions as $option) {
@@ -50,7 +50,7 @@ class data_field_menu extends data_field_base {
         }
 
         $str .= choose_from_menu($options, 'field_'.$this->field->id, $content, 
-                                 get_string('menuchoose', 'data'), '', '', true, false);
+                                 get_string('menuchoose', 'data'), '', '', true, false, 0, 'field_'.$this->field->id);
 
         $str .= '</div>';
 
index 37da4bb9c685643d37d0977f0801fc5131039e0b..58fa709c2bce68b37dc0793821def11d5f9b1739 100755 (executable)
@@ -1,14 +1,14 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
+        <td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
     </tr>
 </table>
index 878c64a76bfc8d14d11c4ccdef302df71a314714..4fe8dd353e7888b6b2897372c7919573fa850be6 100755 (executable)
@@ -40,12 +40,12 @@ class data_field_multimenu extends data_field_base {
             $content = array();
         }
 
-        $str = '<div title="'.$this->field->description.'">';
+        $str = '<div title="'.s($this->field->description).'">';
         $str .= '<select name="field_' . $this->field->id . '[]" id="field_' . $this->field->id . '" multiple="multiple">';
         
         foreach (explode("\n",$this->field->param1) as $option) {
             $option = trim($option);
-            $str .= '<option value="' . $option . '"';
+            $str .= '<option value="' . s($option) . '"';
 
             if (array_search($option, $content) !== false) {
                 // Selected by user.
index 4eec87939ef4b99755920356b4350e324b5c3941..6d8bef382340dcd957461900336f289017b5be36 100755 (executable)
@@ -1,14 +1,14 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
+        <td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
     </tr>
 </table>
index 155b409f8756571df93af37048da6a6b94d5f4cd..831560f1b5723a60d0c2bc2d0a1a3f391082aa24 100755 (executable)
@@ -1,10 +1,10 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" /></td>
     </tr>
 </table>
index 847668ac994a30baa73138eecef8924966fbe301..d4f46705961e1e9283e5e7897712c04cbaf9b085 100755 (executable)
@@ -57,15 +57,17 @@ class data_field_picture extends data_field_file {
             }
         }
 
-        $str = '<div title="'.$this->field->description.'">';
+        $str = '<div title="'.s($this->field->description).'">';
+        $str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>'; 
         $str .= '<input type="hidden" name ="field_'.$this->field->id.'_file" id="field_'.$this->field->id.'_file"  value="fakevalue" />';
-        $str .= get_string('picture','data'). ': <input type="file" name ="field_'.$this->field->id.'" id="field_'.$this->field->id.'" /><br />';
-        $str .= get_string('optionaldescription','data') .': <input type="text" name="field_'
-                .$this->field->id.'_filename" id="field_'.$this->field->id.'_filename" value="'.$description.'" /><br />';
-        $str .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.$this->field->param3.'" />';
+        $str .= '<label for="field_'.$this->field->id.'">'.get_string('picture','data'). '</label>&nbsp;<input type="file" name ="field_'.$this->field->id.'" id="field_'.$this->field->id.'" /><br />';
+        $str .= '<label for="field_'.$this->field->id.'_filename">'.get_string('optionaldescription','data') .'</label>&nbsp;<input type="text" name="field_'
+                .$this->field->id.'_filename" id="field_'.$this->field->id.'_filename" value="'.s($description).'" /><br />';
+        $str .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.s($this->field->param3).'" />';
         if ($filepath){
-            $str .= '<img width="'.$this->previewwidth.'" height="'.$this->previewheight.'" src="'.$filepath.'" alt="" />';
+            $str .= '<img width="'.s($this->previewwidth).'" height="'.s($this->previewheight).'" src="'.$filepath.'" alt="" />';
         }
+        $str .= '</fieldset>'; 
         $str .= '</div>';
         return $str;
     }
@@ -99,14 +101,14 @@ class data_field_picture extends data_field_file {
             }
 
             if ($template == 'listtemplate') {
-                $width = $this->field->param4 ? ' width="'.$this->field->param4.'" ' : ' ';
-                $height = $this->field->param5 ? ' height="'.$this->field->param5.'" ' : ' ';
+                $width = $this->field->param4 ? ' width="'.s($this->field->param4).'" ' : ' ';
+                $height = $this->field->param5 ? ' height="'.s($this->field->param5).'" ' : ' ';
                 $str = '<a href="view.php?d='.$this->field->dataid.'&amp;rid='.$recordid.'"><img '.
-                     $width.$height.' src="'.$thumbnailsource.'" alt="'.$alt.'" title="'.$title.'" border="0" /></a>';
+                     $width.$height.' src="'.$thumbnailsource.'" alt="'.s($alt).'" title="'.s($title).'" border="0" /></a>';
             } else {
-                $width = $this->field->param1 ? ' width="'.$this->field->param1.'" ':' ';
-                $height = $this->field->param2 ? ' height="'.$this->field->param2.'" ':' ';
-                $str = '<a href="'.$source.'"><img '.$width.$height.' src="'.$source.'" alt="'.$alt.'" title="'.$title.'" border="0"/></a>';
+                $width = $this->field->param1 ? ' width="'.s($this->field->param1).'" ':' ';
+                $height = $this->field->param2 ? ' height="'.s($this->field->param2).'" ':' ';
+                $str = '<a href="'.$source.'"><img '.$width.$height.' src="'.$source.'" alt="'.s($alt).'" title="'.s($title).'" border="0"/></a>';
             }
             return $str;
         }
index 5def7328c1ab3f1c1300ce4f063e2774c273b85c..66975535a2768a2d047d50c93d611bc868a1e7da 100755 (executable)
@@ -1,60 +1,53 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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 class="c0"><label for="name">
+            <?php echo get_string('fieldname', 'data');?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" />
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('fielddescription', 'data');?>:
-        </td>
+        <td class="c0"><label for="description">
+            <?php echo get_string('fielddescription', 'data');?></label></td>
         <td class="c1">
-            <input class="fielddescription" type="text" name="description" id="description" value = "<?php echo ($this->field->description);?>" />
+            <input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" />
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('fieldwidthsingleview', 'data');?>:
-        </td>
+        <td class="c0"><label for="param1">
+            <?php echo get_string('fieldwidthsingleview', 'data');?></label></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; ?>" />
+            <input style="width:70px;" type="text" name="param1" id="param1" value="<?php if (!empty($this->field->param1)) p($this->field->param1); ?>" />
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('fieldheightsingleview', 'data');?>:
-        </td>
+        <td class="c0"><label for="param2">
+            <?php echo get_string('fieldheightsingleview', 'data');?></label></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; ?>" />
+            <input style="width:70px;" type="text" name="param2" id="param2" value="<?php if (!empty($this->field->param2)) p($this->field->param2); ?>" />
         </td>
     </tr>
     <tr>
-        <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 class="c0"><label for="param4">
+            <?php echo get_string('fieldwidthlistview', 'data');?></label></td>
+        <td class="c1"><input style="width:70px;" type="text" name="param4" id="param4" value="<?php if (!empty($this->field->param4)) p($this->field->param4); ?>" />
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('fieldheightlistview', 'data');?>:
-        </td>
+        <td class="c0"><label for="param5">
+            <?php echo get_string('fieldheightlistview', 'data');?></label></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; ?>" />
+            <input style="width:70px;" type="text" name="param5" id="param5" value="<?php if (!empty($this->field->param5)) p($this->field->param5); ?>" />
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('maxsize', 'data'); ?>:
-        </td>
+        <td class="c0"><label for="param3">
+            <?php echo get_string('maxsize', 'data'); ?></label></td>
         <td class="c1">
             <?php
                 $course->maxbytes = get_field('course', 'maxbytes', 'id', $this->data->course);
                 $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
-                choose_from_menu ($choices, "param3", $this->field->param3, "");
+                choose_from_menu($choices, 'param3', $this->field->param3, '', '', 0, false, false, 0, 'param3');
             ?>
         </td>
     </tr>
-</tr>
 </table>
index 8b670fd29d9e1342ac86d689d28650054638d85c..a208898735c8d831f1e518acf1405b21ce381865 100755 (executable)
@@ -40,12 +40,14 @@ class data_field_radiobutton extends data_field_base {
             $content = '';
         }
 
-        $str = '<div title="'.$this->field->description.'">';
-        
+        $str = '<div title="'.s($this->field->description).'">';
+        $str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>';
+        $i = 0;
         foreach (explode("\n",$this->field->param1) as $radio) {
             $radio = trim($radio);
-            $str .= '<input type="radio" name="field_' . $this->field->id . '" ';
-            $str .= 'value="' . $radio . '" ';
+            $str .= '<input type="radio" id="field_'.$this->field->id.'_'.$i.'" name="field_' . $this->field->id . '" ';
+            $str .= 'value="' . s($radio) . '" ';
 
             if ($content == $radio) {
                 // Selected by user.
@@ -54,8 +56,10 @@ class data_field_radiobutton extends data_field_base {
                 $str .= '/>';
             }
 
-            $str .= $radio . '<br />';
+            $str .= '<label for="field_'.$this->field->id.'_'.$i.'">'.$radio.'</label><br />';
+            $i++;
         }
+        $str .= '</fieldset>'; 
         $str .= '</div>';
         return $str;
     }
index d65576ec11bcebb3b986e7c90947d22a0784002b..6d8bef382340dcd957461900336f289017b5be36 100755 (executable)
@@ -1,14 +1,14 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0" valign="top"><label for="param1"><?php echo get_string('fieldoptions', 'data'); ?></label></td>
+        <td class="c1"><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($this->field->param1) {p($this->field->param1);} ?></textarea></td>
     </tr>
 </table>
index a39f4b83ba41262bf00322b8ea68f17505de6154..940ff1cf3d6d7d119a15dabfbca00b4596b22b06 100755 (executable)
@@ -1,14 +1,14 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description); ?>" /></td>
     </tr>
     <tr>
-        <td class="c0"><?php echo get_string('fieldallowautolink', 'data'); ?>:</td>
+        <td class="c0"><label for="param1"><?php echo get_string('fieldallowautolink', 'data'); ?></label></td>
         <td class="c1"><input type="checkbox" name="param1" id="param1" <?php if($this->field->param1) {echo 'checked="checked"';} ?> value="1" /></td>
     </tr>
 </table>
index d442b3969ae9488718fb655f3efb88426b07b16b..3d35af99ded620d8ae37dc6eb8c4d72ced6c246d 100755 (executable)
@@ -72,13 +72,13 @@ class data_field_textarea extends data_field_base {
     
     function gen_textarea($usehtmleditor, $text='') {
         return print_textarea($usehtmleditor, $this->field->param3, $this->field->param2, 
-                              '', '', 'field_'.$this->field->id, $text, '', true);
+                              '', '', 'field_'.$this->field->id, $text, '', true, 'field_' . $this->field->id);
     }
     
     
     function print_after_form() {
         if (can_use_richtext_editor()) {
-            use_html_editor('field_' . $this->field->id);
+            use_html_editor('field_' . $this->field->id, '', 'field_' . $this->field->id);
         }
     }
     
index 2b8c5f777600760a1f1aacab0507fd402e3341df..1badc631e13981d379d732622f690b903657b7d7 100755 (executable)
@@ -1,41 +1,39 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <td class="c0"><?php echo get_string('fielddescription', 'data'); ?>:</td>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
         <td class="c1">
             <input class="fielddescription" type="text" name="description" id="description"
-            value="<?php echo($this->field->description); ?>" />
+            value="<?php p($this->field->description); ?>" />
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('fieldwidth', 'data'); ?>:
-        </td>
+        <td class="c0"><label for="param2">
+            <?php echo get_string('fieldwidth', 'data'); ?></label></td>
         <td class="c1">
-            <input style="width:50px;" type="text" name="param2" id="width" value=
+            <input style="width:50px;" type="text" name="param2" id="param2" value=
             <?php
                 if (empty($this->field->param2)) {
-                    echo '"60"';
+                    echo('"60"');
                 } else {
-                    echo('"' . $this->field->param2 . '"');
+                    echo '"'.s($this->field->param2).'"';
                 }
             ?> /> <?php echo get_string('columns', 'data'); ?>
         </td>
     </tr>
     <tr>
-        <td class="c0">
-            <?php echo get_string('fieldheight', 'data'); ?>:
-        </td>
+        <td class="c0"><label for="param3">
+            <?php echo get_string('fieldheight', 'data'); ?></label></td>
         <td class="c1">
-            <input style="width:50px;" type="text" name="param3" id="height" value=
+            <input style="width:50px;" type="text" name="param3" id="param3" value=
             <?php
                 if (empty($this->field->param3)) {
-                    echo '"35"';
+                    echo('"35"');
                 } else {
-                    echo('"' . $this->field->param3 . '"');
+                    echo '"'.s($this->field->param2).'"';
                 }
             ?> /> <?php echo get_string('rows', 'data'); ?>
         </td>
index 07c5fd550200047d6207b0d45a8566bd9cd5ab08..538dcd6f3a521faea14facb2ab84a8dcecaa7901 100755 (executable)
@@ -44,14 +44,14 @@ class data_field_url extends data_field_base {
         }
         $url  = empty($url) ?  'http://' : $url;
 
-        $str = '<div title="'.$this->field->description.'">';
+        $str = '<div title="'.s($this->field->description).'">';
         if (!empty($this->field->param1) and empty($this->field->param2)) {
             $str .= '<table><tr><td align="right">';
             $str .= get_string('url','data').':</td><td><input type="text" name="field_'.$this->field->id.'_0" id="field_'.$this->field->id.'_0" value="'.$url.'" size="60" /></td></tr>';
-            $str .= '<tr><td align="right">'.get_string('text','data').':</td><td><input type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="'.$text.'" size="60" /></td></tr>';
+            $str .= '<tr><td align="right">'.get_string('text','data').':</td><td><input type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="'.s($text).'" size="60" /></td></tr>';
             $str .= '</table>';
         } else {   // Just the URL field
-            $str .= '<input type="text" name="field_'.$this->field->id.'_0" id="field_'.$this->field->id.'_0" value="'.$url.'" size="60" />';
+            $str .= '<input type="text" name="field_'.$this->field->id.'_0" id="field_'.$this->field->id.'_0" value="'.s($url).'" size="60" />';
         }
         $str .= '</div>';
         
index 7aa403dea4594b340ed749ac339f53a61f85d40d..99aadd6305c52e426d1e6710c22f764398e3dcfd 100755 (executable)
@@ -1,18 +1,18 @@
-<table width="100%">
+<table width="100%" cellpadding="5">
     <tr>
-        <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>
+        <td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
+        <td class="c1"> <input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
     </tr>
     <tr>
-        <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>
+        <td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
+        <td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p($this->field->description);?>" /></td>
     </tr>
     <tr>
-        <td class="c0"> <?php echo get_string('forcelinkname', 'data'); ?>: </td>
-        <td class="c1"> <input class="forcelinkname" type="text" name="param2" id="forcelinkname" value = "<?php echo ($this->field->param2);?>" /> </td>
+        <td class="c0"><label for="param2"><?php echo get_string('forcelinkname', 'data'); ?></label></td>
+        <td class="c1"><input class="forcelinkname" type="text" name="param2" id="forcelinkname" value="<?php p($this->field->param2);?>" /></td>
     </tr>
     <tr>
-        <td class="c0"><?php echo get_string('autolinkurl', 'data') ?></td>
+        <td class="c0"><label for="param1"><?php echo get_string('autolinkurl', '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>
index cf9f79fc35524545a8aad8672cac4b7070aeb9ec..0e3072e62a7c4b025c30f38fb9e7aa1d7d54a899 100755 (executable)
@@ -198,7 +198,7 @@ class data_field_base {     /// Base class for Database Field Types (see field/*
         echo '<div align="center">';
         echo '<input type="submit" value="'.$savebutton.'" />'."\n";
         echo '<input type="submit" name="cancel" value="'.get_string('cancel').'" />'."\n";
-        echo '</div">';
+        echo '</div>';
 
         echo '</form>';
 
@@ -331,12 +331,20 @@ function data_generate_default_template(&$data, $template, $recordid=0, $form=fa
     if ($fields = get_records('data_fields', 'dataid', $data->id, 'id')) {
 
         $str = '<div align="center">';
-        $str .= '<table>';
+        $str .= '<table cellpadding="5">';
 
         foreach ($fields as $field) {
 
             $str .= '<tr><td valign="top" align="right">';
-            $str .= $field->name.':';
+            if ($template == 'addtemplate') {
+                $str .= '<label';
+                if (!in_array($field->type, array('picture', 'checkbox', 'date', 'latlong', 'radiobutton'))) {
+                    $str .= ' for="[['.$field->name.'#id]]"';
+                }
+                $str .= '>'.$field->name.'</label>';
+            } else {
+                $str .= $field->name.': ';
+            }
             $str .= '</td>';
 
             $str .='<td>';
@@ -351,7 +359,7 @@ function data_generate_default_template(&$data, $template, $recordid=0, $form=fa
 
         }
         if ($template != 'addtemplate' and $template != 'rsstemplate') {    //if not adding, we put tags in there
-            $str .= '<tr><td align="center" colspan="2">##Edit##  ##More##  ##Delete##  ##Approve##</td></tr>';
+            $str .= '<tr><td align="center" colspan="2">##edit##  ##more##  ##delete##  ##approve##</td></tr>';
         }
 
         $str .= '</table>';
@@ -827,35 +835,35 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re
         }
 
     /// Replacing special tags (##Edit##, ##Delete##, ##More##)
-        $patterns[]='##Edit##';
-        $patterns[]='##Delete##';
+        $patterns[]='##edit##';
+        $patterns[]='##delete##';
         if (has_capability('mod/data:manageentries', $context) or data_isowner($record->id)) {
             $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/edit.php?d='
-                             .$data->id.'&amp;rid='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" /></a>';
+                             .$data->id.'&amp;rid='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" title="'.get_string('edit').'" /></a>';
             $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='
-                             .$data->id.'&amp;delete='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" /></a>';
+                             .$data->id.'&amp;delete='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" title="'.get_string('delete').'" /></a>';
         } else {
             $replacement[] = '';
             $replacement[] = '';
         }
-        $patterns[]='##More##';
-        $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;rid='.$record->id.'"><img src="'.$CFG->pixpath.'/i/search.gif" height="11" width="11" border="0" alt="'.get_string('more', 'data').'" /></a>';
+        $patterns[]='##more##';
+        $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;rid='.$record->id.'"><img src="'.$CFG->pixpath.'/i/search.gif" height="11" width="11" border="0" alt="'.get_string('more', 'data').'" title="'.get_string('more', 'data').'" /></a>';
 
-        $patterns[]='##MoreURL##';
+        $patterns[]='##moreurl##';
         $replacement[] = $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;rid='.$record->id;
 
-        $patterns[]='##User##';
+        $patterns[]='##user##';
         $replacement[] = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$record->userid.
                                '&amp;course='.$data->course.'">'.fullname($record).'</a>';
 
-        $patterns[]='##Approve##';
+        $patterns[]='##approve##';
         if (has_capability('mod/data:approve', $context) && ($data->approval) && (!$record->approved)){
             $replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;approve='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/i/approve.gif" height="11" width="11" border="0" alt="'.get_string('approve').'" /></a>';
         } else {
             $replacement[] = '';
         }
 
-        $patterns[]='##Comments##';
+        $patterns[]='##comments##';
         if (($template == 'listtemplate') && ($data->comments)) {
             $comments = count_records('data_comments','recordid',$record->id);
             $replacement[] = '<a href="view.php?rid='.$record->id.'#comments">'.get_string('commentsn','data', $comments).'</a>';
index 9333378a77d91714599248cc05dc46af2fce9481..90e1aaa3aecd6a4d8c18d7a2d73536d63c01dccd 100644 (file)
@@ -292,7 +292,7 @@ echo '<div align="center">';
 echo '<table class="presets" cellpadding="5">';
 echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strexport.'</h3></td></tr>';
 
-echo '<tr><td><label for="zipexport">'.$strexportaszip.'</label>';
+echo '<tr><td><label>'.$strexportaszip.'</label>';
 helpbutton('exportzip', '', 'data');
 echo '</td><td>';
 $options = new object();
@@ -302,7 +302,7 @@ $options->sesskey = sesskey();
 print_single_button('preset.php', $options, $strexport, 'post');
 echo '</td></tr>';
 
-echo '<tr><td><label for="zipexport">'.$strsaveaspreset.'</label>';
+echo '<tr><td><label>'.$strsaveaspreset.'</label>';
 helpbutton('savepreset', '', 'data');
 echo '</td><td>';
 $options = new object();
index 17088c9041f0a37ebe30d9144c0658316ec65542..69ae28e8fde5159b7b5fd288b86b026afa403034 100644 (file)
@@ -1,8 +1,7 @@
 <div align="center">
-<table cellpadding="2">
+<table cellpadding="5">
 <tr><td><label for="[[title#id]]">Title</label></td><td>[[title]]</td></tr>
 <tr><td><label for="[[caption#id]]">Caption</label></td><td>[[caption]]</td></tr>
+<tr><td><label>Image</label></td><td>[[image]]</td></tr>
 </table>
-<hr />
-[[image]]
 </div>
\ No newline at end of file
index 9ff41018177e2ac354c41db18d799b9e75ec3d3a..73737e1b1fa4abfdf8afc728da7ec920baa7fee2 100644 (file)
@@ -1,7 +1,7 @@
 <div class="picturediv">
 <table class="pictureframe"><tr><td>
 <table class="picture">
-<tr><td><div name="listimage">[[image]]</div></td></tr>
+<tr><td><div class="listimage">[[image]]</div></td></tr>
 <tr><td align="right">##edit## ##delete## ##approve##</td></tr>
 </table>
 </td></tr></table>
index 914b4321c1981d6e1407bbdeea698dbc64c55dac..c79e1d6bfe443b3091aec75388d96e0fecadf374 100755 (executable)
         if ($mode == 'addtemplate') {
             echo '<optgroup label="'.get_string('fieldids', 'data').'">';
             foreach ($fields as $field) {
+                if (in_array($field->type, array('picture', 'checkbox', 'date', 'latlong', 'radiobutton'))) {
+                    continue; //ids are not usable for these composed items
+                }
                 echo '<option value="[['.$field->name.'#id]]" title="'.$field->description.' id">'.$field->name.' id - [['.$field->name.'#id]]</option>';
             }
             echo '</optgroup>';