Permalink
Browse files

General tidy up of code, changes for XHTML and accessibility compatib…

…ility.
  • Loading branch information...
1 parent c7444a3 commit 2e708fa0966312bc6fd36c3699ec79cf396b03da ikawhero committed Jan 18, 2005
View
10 mod/resource/lib.php
@@ -32,18 +32,18 @@
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');
}
}
}
View
6 mod/resource/type/common.html
@@ -11,19 +11,17 @@
<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); ?>
View
14 mod/resource/type/file/file.html
@@ -31,12 +31,12 @@
</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"
@@ -130,7 +130,7 @@
</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"
@@ -145,8 +145,8 @@
<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
View
11 mod/resource/type/file/resource.class.php
@@ -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';
View
22 mod/resource/type/html/html.html
@@ -31,12 +31,10 @@
</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"
@@ -68,16 +66,16 @@
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>
@@ -86,19 +84,19 @@
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") {
View
9 mod/resource/type/html/resource.class.php
@@ -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';
View
9 mod/resource/type/text/resource.class.php
@@ -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';
View
16 mod/resource/type/text/text.html
@@ -32,19 +32,17 @@
- <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); ?>
</td>
</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) ?>
@@ -100,8 +98,8 @@
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 />";
}

0 comments on commit 2e708fa

Please sign in to comment.