]> git.mjollnir.org Git - moodle.git/commitdiff
General tidy up of code, changes for XHTML and accessibility compatibility.
authorikawhero <ikawhero>
Tue, 18 Jan 2005 09:46:01 +0000 (09:46 +0000)
committerikawhero <ikawhero>
Tue, 18 Jan 2005 09:46:01 +0000 (09:46 +0000)
mod/resource/lib.php
mod/resource/type/common.html
mod/resource/type/file/file.html
mod/resource/type/file/resource.class.php
mod/resource/type/html/html.html
mod/resource/type/html/resource.class.php
mod/resource/type/text/resource.class.php
mod/resource/type/text/text.html

index 794b9f29e5ce62534e33968a104fa175e69febd2..908a0dc6ad56beb5449ca822830a799b66cd9eaf 100644 (file)
@@ -32,18 +32,18 @@ if (!isset($CFG->resource_parametersettings)) {
     set_config("resource_parametersettings", "0");
 }  
 
-$RESOURCE_WINDOW_OPTIONS = array("resizable", "scrollbars", "directories", "location"
-                                 "menubar", "toolbar", "status", "height", "width");
+$RESOURCE_WINDOW_OPTIONS = array('resizable', 'scrollbars', 'directories', 'location'
+                                 'menubar', 'toolbar', 'status', 'height', 'width');
 
 foreach ($RESOURCE_WINDOW_OPTIONS as $popupoption) {
     $popupoption = "resource_popup$popupoption";
     if (!isset($CFG->$popupoption)) {
-        if ($popupoption == "resource_popupheight") {
+        if ($popupoption == 'resource_popupheight') {
             set_config($popupoption, 450);
-        } else if ($popupoption == "resource_popupwidth") {
+        } else if ($popupoption == 'resource_popupwidth') {
             set_config($popupoption, 620);
         } else {
-            set_config($popupoption, "checked");
+            set_config($popupoption, 'checked');
         }
     }  
 }
index 980e016c8be4be7ee9641259cad97751eb1e0a0c..8b8eb8af3902fbde009a79e94dffab92859620d6 100644 (file)
 
 <table cellpadding="5">
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("name") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("name") ?>:</b></td>
     <td>
         <input type="text" name="name" size="65" value="<?php p($form->name) ?>" alt="<?php print_string("name") ?>" />
     </td>
 </tr>
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("summary") ?>:</b></p>
-     <font size="1">
+    <td align="right"><b><?php print_string("summary") ?>:</b><br />
      <?php
         helpbutton("summary", get_string("summary"), "resource", true, true);
      ?>
      <br />
-     </font>
     </td>
     <td>
         <?php print_textarea($usehtmleditor, 10, 65, 680, 400, "summary", $form->summary); ?>
index 548f2b85d25fca12837bbf60fea28f1ed0ed5bad..32f75e0b1f4be9bd68b5043677fab1261c43f347 100644 (file)
 </script>
 
 
-        <p><b><?php echo $strfilename ?>:</b></p>
+        <b><?php echo $strfilename ?>:</b>
     </td>
     <td>
     <?php
-        echo "<input name=\"reference\" size=\"90\" value=\"$form->reference\" alt=\"reference\" /><br />";
-        button_to_popup_window ("/files/index.php?id=$form->course&choose=form.reference", "coursefiles", $strchooseafile, 500, 750, $strchooseafile);
+        echo "<input type=\"text\" name=\"reference\" size=\"90\" value=\"$form->reference\" alt=\"reference\" /><br />";
+        button_to_popup_window ("/files/index.php?id=$form->course&amp;choose=form.reference", "coursefiles", $strchooseafile, 500, 750, $strchooseafile);
         echo "<input type=\"button\" name=\"searchbutton\" value=\"$strsearch ...\" ".
              "onclick=\"return window.open('$CFG->resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\" />\n";
     ?>
@@ -46,7 +46,7 @@
 <tr><td colspan="2"><hr /></td></tr>
 
 <tr>
-    <td align="right"><p><b><?php print_string("display", "resource") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("display", "resource") ?>:</b></td>
     <td>
         <input type="button" value="hide settings" id="windowsettingsbutton" onclick="javascript: return showhide('windowsettings');" />
         <input type="hidden" name="windowsettingspref" id="windowsettingspref" 
 </td></tr>
 
 <tr>
-    <td align="right"><p><b><?php print_string("parameters", "resource") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("parameters", "resource") ?>:</b></td>
     <td>
         <input type="button" value="hide settings" id="parametersettingsbutton" onclick="javascript: return showhide('parametersettings');" />
         <input type="hidden" name="parametersettingspref" id="parametersettingspref" 
 <table align="center">
 
         <tr>
-            <td align="center"><p><?php print_string("parameter", "resource") ?></p></td>
-            <td align="center"><p><?php print_string("variablename", "resource") ?></p></td>
+            <td align="center"><?php print_string("parameter", "resource") ?></td>
+            <td align="center"><?php print_string("variablename", "resource") ?></td>
         </tr>
 
 <?php
index 35619117e1fde6f088e1ce0e23dd6fba14cff825..32c4f80b7f5fd7ab198d455f5fb043bc2a22d838 100644 (file)
@@ -491,17 +491,22 @@ function setup($form) {
                 $option = explode('=', trim($rawoption));
                 $optionname = $option[0];
                 $optionvalue = $option[1];
-                if ($optionname == "height" or $optionname == "width") {
+                if ($optionname == 'height' or $optionname == 'width') {
                     $window->$optionname = $optionvalue;
                 } else if ($optionvalue) {
-                    $window->$optionname = "checked=\"checked\"";
+                    $window->$optionname = 'checked="checked"';
                 }
             }
         }
     } else {
         foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
             $defaultvalue = "resource_popup$optionname";
-            $window->$optionname = $CFG->$defaultvalue;
+
+            if ($optionname == 'height' or $optionname == 'width') {
+                $window->$optionname = $CFG->$defaultvalue;
+            } else if ($CFG->$defaultvalue) {
+                $window->$optionname = 'checked="checked"';
+            }
         }
 
         $windowtype = ($CFG->resource_popup) ? 'popup' : 'page';
index 445c2bee597648aaedd6ec5e7b39e6432c82e679..08db9bb531dc4afd155fb51666817145e6c3d49f 100644 (file)
 </script>
 
 
-        <p><b><?php print_string("fulltext", "resource") ?>:</b></p><br />
-        <font size="1">
+        <b><?php print_string("fulltext", "resource") ?>:</b><br />
             <?php  helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
-            <?php  helpbutton("text", get_string("helptext"), "moodle", true, true) ?> <br />
+            <?php  helpbutton("text", get_string("helptext"), "moodle", true, true) ?><br />
             <?php  emoticonhelpbutton("theform", "alltext") ?> <br />
-        </font>
     </td>
     <td>
         <?php print_textarea($usehtmleditor, 30, 60, 680, 500, "alltext", $form->alltext); ?>
@@ -46,7 +44,7 @@
 <tr><td colspan="2"><hr /></td></tr>
 
 <tr>
-    <td align="right"><p><b><?php print_string("display", "resource") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("display", "resource") ?>:</b></td>
     <td>
         <input type="button" value="hide settings" id="windowsettingsbutton" onclick="javascript: return showhide('windowsettings');" />
         <input type="hidden" name="windowsettingspref" id="windowsettingspref" 
             var popupitems = [<?php echo $popupoptions; ?>];
             var allitems = [<?php echo $alloptions; ?>];
         </script>
-        <input type="radio" name="windowpopup" value="0" <?php echo ($windowtype != "popup") ? "checked=\"checked\"" : "" ?> 
+        <input type="radio" name="windowpopup" value="0" alt="<?php print_string('pagewindow', 'resource') ?>" <?php echo ($windowtype != 'popup') ? 'checked="checked"' : '' ?> 
         onclick="return lockoptions('form', 'windowpopup[1]', popupitems);" />
-        <b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b>
+        <b title="<?php print_string('pagedisplay', 'resource') ?>"><?php print_string('pagewindow', 'resource') ?></b>
     </td>
 </tr>
 
 <tr valign="top">
     
     <td colspan="2">
-        <input name="windowpopup" type="radio" value="1" <?php echo ($windowtype == "popup") ? "checked=\"checked\"" : "" ?>
+        <input name="windowpopup" type="radio" value="1" alt="<?php p($strnewwindow) ?>" <?php echo ($windowtype == "popup") ? "checked=\"checked\"" : "" ?>
         onclick=" return lockoptions('form', 'windowpopup[1]', popupitems);" />
         <b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
         <blockquote>
                 if ($name == "height" or $name == "width") {
                     continue;
                 }
-                echo "<input name=\"h$name\" type=\"hidden\" value=\"0\" />";
-                echo "<input name=\"$name\" type=\"checkbox\" value=\"1\" ".$window->$name." />";
                 $stringname = "str$name";
+                echo "<input name=\"h$name\" type=\"hidden\" value=\"0\" />";
+                echo "<input name=\"$name\" type=\"checkbox\" value=\"1\" alt=\"<?php echo $$stringname ?>\" ".$window->$name." />";
                 echo $$stringname."<br />";
             }
         ?>
 
         <input name="hwidth" type="hidden" value="0" />
-        <input name="width" type="text" size="4" value="<?php p($window->width) ?>" />
+        <input name="width" type="text" size="4" value="<?php p($window->width) ?>" alt="<?php p($strwidth) ?>" />
         <?php p($strwidth) ?><br />
 
         <input name="hheight" type="hidden" value="0" />
-        <input name="height" type="text" size="4" value="<?php p($window->height) ?>" />
+        <input name="height" type="text" size="4" value="<?php p($window->height) ?>" alt="<?php p($strheight) ?>"/>
         <?php p($strheight) ?><br />
         <?php
             if ($windowtype == "page") {
index 13d341954495ea3720a24176c4cdaeca7797bb20..22859f0a5c55ea3af1881c57e2cb909304449c9b 100644 (file)
@@ -185,14 +185,19 @@ function setup($form) {
                 if ($optionname == "height" or $optionname == "width") {
                     $window->$optionname = $optionvalue;
                 } else if ($optionvalue) {
-                    $window->$optionname = "checked=\"checked\"";
+                    $window->$optionname = 'checked="checked"';
                 }
             }
         }
     } else {
         foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
             $defaultvalue = "resource_popup$optionname";
-            $window->$optionname = $CFG->$defaultvalue;
+
+            if ($optionname == "height" or $optionname == "width") {
+                $window->$optionname = $CFG->$defaultvalue;
+            } else if ($CFG->$defaultvalue) {
+                $window->$optionname = 'checked="checked"';
+            }
         }
 
         $windowtype = ($CFG->resource_popup) ? 'popup' : 'page';
index a934a796daeb8a5232d4b072d88189ea0ba376b9..90a38e513ded2a8eb239385481ff7cafe31f10ce 100644 (file)
@@ -187,14 +187,19 @@ function setup($form) {
                 if ($optionname == "height" or $optionname == "width") {
                     $window->$optionname = $optionvalue;
                 } else if ($optionvalue) {
-                    $window->$optionname = "checked=\"checked\"";
+                    $window->$optionname = 'checked="checked"';
                 }
             }
         }
     } else {
         foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
             $defaultvalue = "resource_popup$optionname";
-            $window->$optionname = $CFG->$defaultvalue;
+            
+            if ($optionname == "height" or $optionname == "width") {
+                $window->$optionname = $CFG->$defaultvalue;
+            } else if ($CFG->$defaultvalue) {
+                $window->$optionname = 'checked="checked"';
+            }
         }
 
         $windowtype = ($CFG->resource_popup) ? 'popup' : 'page';
index ce7eb587c827e5577243500c0512333f3425ef52..8860f6b9bc2f71dd3474d49095e6e85e8b7c73d7 100644 (file)
 
 
 
-        <p><b><?php print_string("fulltext", "resource") ?>:</b></p><br />
-        <font size="1">
+        <b><?php print_string("fulltext", "resource") ?>:</b><br />
             <?php  helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
             <?php  emoticonhelpbutton("theform", "alltext") ?> <br />
-        </font>
     </td>
     <td>
         <?php print_textarea(false, 30, 65, 680, 400, "alltext", $form->alltext); ?>
@@ -44,7 +42,7 @@
 </tr> 
 <tr valign="top">
     <td align="right" nowrap="nowrap">
-        <p><b><?php print_string("formattexttype") ?>:</b></p><br />
+        <b><?php print_string("formattexttype") ?>:</b><br />
     </td>
     <td>
         <?php 
@@ -58,7 +56,7 @@
 
 
 <tr>
-    <td align="right"><p><b><?php print_string("display", "resource") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("display", "resource") ?>:</b></td>
     <td>
         <input type="button" value="hide settings" id="windowsettingsbutton" onclick="javascript: return showhide('windowsettings');" />
         <input type="hidden" name="windowsettingspref" id="windowsettingspref" 
@@ -80,7 +78,7 @@
             var popupitems = [<?php echo $popupoptions; ?>];
             var allitems = [<?php echo $alloptions; ?>];
         </script>
-        <input type="radio" name="windowpopup" value="0" <?php echo ($windowtype != "popup") ? "checked=\"checked\"" : "" ?> 
+        <input type="radio" name="windowpopup" value="0" alt="<?php print_string("pagewindow", "resource") ?>" <?php echo ($windowtype != "popup") ? 'checked="checked"' : '' ?> 
         onclick="return lockoptions('form', 'windowpopup[1]', popupitems);" />
         <b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b>
         <?php print_string("pagedisplay", "resource") ?>
@@ -90,7 +88,7 @@
 <tr valign="top">
     
     <td colspan="2">
-        <input name="windowpopup" type="radio" value="1" <?php echo ($windowtype == "popup") ? "checked=\"checked\"" : "" ?>
+        <input name="windowpopup" type="radio" value="1" alt="<?php p($strnewwindowopen) ?>" <?php echo ($windowtype == "popup") ? "checked=\"checked\"" : "" ?>
         onclick=" return lockoptions('form', 'windowpopup[1]', popupitems);" />
         <b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
         <?php p($strnewwindowopen) ?>
                 if ($name == "height" or $name == "width") {
                     continue;
                 }
-                echo "<input name=\"h$name\" type=\"hidden\" value=\"0\" />";
-                echo "<input name=\"$name\" type=\"checkbox\" value=\"1\" ".$window->$name." />";
+                echo '<input name="h'.$name.'" type="hidden" value="0" />';
+                echo '<input name="'.$name.'" type="checkbox" value="1" alt="'.$$stringname.'" '.$window->$name.' />';
                 $stringname = "str$name";
                 echo $$stringname."<br />";
             }