$defaultformat = FORMAT_MOODLE;
}
- $icon = '<img class="icon" src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" />';
+ $icon = '<img class="icon" src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt="'.get_string('modulename',$module->name).'"/>';
print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start('center', '', '', 5, 'generalbox', $module->name);
$ret = ewiki_make_title($id, $id, 2);
$ret .= ($cont&&$cont!==true)?$cont."<br /><br />\n":"";
$ret .= get_string("wikiexportcomment","wiki");
+ // removing name="form" from the following form as it does not validate
+ // and is not referenced. MDL-7861
$ret .= "<br /><br />\n".
- '<FORM name="form" method="post" action="'.$url.'">'."\n".
- '<INPUT TYPE="HIDDEN" NAME="userid" VALUE="'.$userid.'" />'."\n".
- '<INPUT TYPE="HIDDEN" NAME="groupid" VALUE="'.$groupid.'" />'."\n".
- '<INPUT TYPE="HIDDEN" NAME="id" VALUE="'.$cm->id.'" />'."\n".
- '<INPUT TYPE="HIDDEN" NAME="wikipage" VALUE="'.$wikipage.'" />'."\n".
- "<CENTER>\n";
+ '<FORM method="post" action="'.$url.'">'."\n".
+ "<div class=\"wikiexportbox\">\n".
+ '<INPUT type="hidden" name="userid" value="'.$userid.'" />'."\n".
+ '<INPUT type="hidden" name="groupid" value="'.$groupid.'" />'."\n".
+ '<INPUT type="hidden" name="id" value="'.$cm->id.'" />'."\n".
+ '<INPUT type="hidden" name="wikipage" value="'.$wikipage.'" />'."\n";
+
// Export binaries too ?
if(!$wiki->ewikiacceptbinary) {
- $ret.='<INPUT TYPE="HIDDEN" NAME="exportbinaries" VALUE="0" />'.$exportdestinations[0]."\n";
+ $ret.='<INPUT type="hidden" name="exportbinaries" value="0" />'.$exportdestinations[0]."\n";
} else {
- $ret.='<INPUT TYPE="HIDDEN" NAME="exportbinaries" VALUE="0" />'."\n";
+ $ret.='<INPUT type="hidden" name="exportbinaries" value="0" />'."\n";
}
- $ret.="<TABLE cellpadding=5>\n";
+ $ret.="<TABLE cellpadding=\"5\">\n";
if($wiki->ewikiacceptbinary) {
- $ret.=" <TR valign=top>\n".
- ' <TD align=right>'.get_string("withbinaries","wiki").":</TD>\n".
+ $ret.=" <TR valign=\"top\">\n".
+ ' <TD align="right">'.get_string("withbinaries","wiki").":</TD>\n".
" <TD>\n".
' <input type="checkbox" name="exportbinaries" value="1"'.($_REQUEST["exportbinaries"]==1?" checked":"")." />\n".
" </TD>\n".
" </TR>\n";
}
- $ret.=" <TR valign=top>\n".
- ' <TD align=right>'.get_string("withvirtualpages","wiki").":</TD>\n".
+ $ret.=" <TR valign=\"top\">\n".
+ ' <TD align="right">'.get_string("withvirtualpages","wiki").":</TD>\n".
" <TD>\n".
' <input type="checkbox" name="withvirtualpages" value="1"'.($_REQUEST["withvirtualpages"]==1?" checked":"")." />\n".
" </TD>\n".
" </TR>\n";
$exportformats=array( "0" => get_string("plaintext","wiki") , "1" => get_string("html","wiki"));
/// Formats
- $ret.=" <TR valign=top>\n".
- ' <TD align=right>'.get_string("exportformats","wiki").":</TD>\n".
+ $ret.=" <TR valign=\"top\">\n".
+ ' <TD align="right">'.get_string("exportformats","wiki").":</TD>\n".
" <TD>\n";
if($wiki->htmlmode!=2) {
$ret.= choose_from_menu($exportformats, "exportformats", $_REQUEST["exportformats"], "", "", "", true)."\n";
} else {
- $ret.= '<INPUT TYPE="HIDDEN" NAME="exportformats" VALUE="1" />'.
+ $ret.= '<INPUT type="hidden" name="exportformats" value="1" />'.
get_string("html","wiki");
}
$ret.=" </TD>\n".
}
}
- $ret.=" <TR valign=top>\n".
- ' <TD align=right>'.get_string("exportto","wiki").":</TD>\n".
+ $ret.=" <TR valign=\"top\">\n".
+ ' <TD align="right">'.get_string("exportto","wiki").":</TD>\n".
" <TD>\n";
if(count($exportdestinations)==1) {
- $ret.='<INPUT TYPE="HIDDEN" NAME="exportdestinations" VALUE="0" />'.$exportdestinations[0]."\n";
+ $ret.='<INPUT type="hidden" name="exportdestinations" value="0" />'.$exportdestinations[0]."\n";
} else {
$ret.=choose_from_menu($exportdestinations, "exportdestinations", $_REQUEST["exportdestinations"], "", "", "", true)."\n";
}
" </TR>\n".
"</TABLE>\n".
' <input type="submit" name="wikiexport" value= "'.get_string("export","wiki").'" />'."\n".
- "</CENTER>\n";
+ "</div>\n";
"</FORM>\n";
return $ret;
}
$refs .= $row["refs"];
}
- #-- build array
- $refs = array_unique(explode("\n", $refs));
+ #-- build array
+ $refs = array_unique(explode("\n", $refs));
- #-- strip existing pages from array
- $refs = ewiki_database("FIND", $refs);
+ #-- strip existing pages from array
+ $refs = ewiki_database("FIND", $refs);
foreach ($refs as $id=>$exists) {
if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
continue;
}
}
- #-- print out
- $o .= "<ul>";
- foreach ($wanted as $page) {
-
- $link = ewiki_link_regex_callback(array($page, $page));
+ // to prevent empty <ul></ul> getting printed out, we have to interate twice.
+ // once to make sure the <ul></ul> is needed at all.
+ // MDL-7861, <ul></ul> does not validate.
+
+ $printul = false;
+ foreach ($wanted as $page) {
+ $link = ewiki_link_regex_callback(array($page, $page));
+ if (strstr($link, "?</a>")) {
+ $printul = true;
+ }
+ }
+ #-- print out
+
+ if ($printul) {
+ $o .= "<ul>";
+ foreach ($wanted as $page) {
- if (strstr($link, "?</a>")) {
- $o .= "<li>" . $link . "</li>";
- }
+ $link = ewiki_link_regex_callback(array($page, $page));
- }
- $o .= "<ul>";
+ if (strstr($link, "?</a>")) {
+ $o .= "<li>" . $link . "</li>";
+ }
- return($o);
+ }
+ $o .= "</ul>";
+ }
+ return($o);
}
-
?>
foreach ($FD as $n=>$str) {
$cell_flags .='<input type="checkbox" name="flags['. rawurlencode($id)
. '][' . $n . ']" value="1" '
- . (($data["flags"] & $n) ? "CHECKED=\"checked\"" : "")
+ . (($data["flags"] & $n) ? "checked=\"checked\"" : "")
. ' />'.$str. ' ';
}
if($pageflagstatus) {
}
$checked="";
if($pagestostrip=="" || $pagestostrip[$i]) {
- $checked=" CHECKED";
+ $checked=" checked=\"checked\"";
}
if($version=="") {
$versiondefault="1-".($row["version"]-1);
<form id="form" method="post" action="mod.php">
<fieldset class="invisiblefieldset">
-<center>
+<div class="boxaligncenter">
<table cellpadding="5">
<tr valign="top">
<td align="right"><b><?php print_string('name') ?>:</b></td>
<td align="right">
<b> <?php print_string('wikilinkoptions', 'wiki') ?>:</b></td>
<td>
- <input type="checkbox" name="disablecamelcase" value="1" <?php echo $form->disablecamelcase?"CHECKED":""; ?> alt="<?php print_string('disablecamel', 'wiki') ?>" />
+ <input type="checkbox" name="disablecamelcase" value="1" <?php echo $form->disablecamelcase?"checked=\"checked\"":""; ?> alt="<?php print_string('disablecamel', 'wiki') ?>" />
<?php print_string('disablecamel', 'wiki') ?><br />
<?php helpbutton('wikilinkoptions', get_string('wikilinkoptions', 'wiki'), 'wiki') ?>
</td>
<b> <?php print_string('studentadminoptions', 'wiki') ?>:</b></td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
- <td width="50%">
- <input type="checkbox" name="setpageflags" value="1" <?php echo $form->setpageflags?"CHECKED":""; ?> alt="<?php print_string('allowsetpage', 'wiki') ?>" />
+ <td style="width:50%">
+ <input type="checkbox" name="setpageflags" value="1" <?php echo $form->setpageflags?"checked=\"checked\"":""; ?> alt="<?php print_string('allowsetpage', 'wiki') ?>" />
<?php print_string('allowsetpage', 'wiki') ?><br />
- <input type="checkbox" name="strippages" value="1" <?php echo $form->strippages?"CHECKED":""; ?> alt="<?php print_string('allowstrippages', 'wiki') ?>" />
+ <input type="checkbox" name="strippages" value="1" <?php echo $form->strippages?"checked=\"checked\"":""; ?> alt="<?php print_string('allowstrippages', 'wiki') ?>" />
<?php print_string('allowstrippages', 'wiki') ?><br />
</td>
- <td width="50%">
- <input type="checkbox" name="removepages" value="1" <?php echo $form->removepages?"CHECKED":""; ?> alt="<?php print_string('allowremovepages', 'wiki') ?>" />
+ <td style="width:50%">
+ <input type="checkbox" name="removepages" value="1" <?php echo $form->removepages?"checked=\"checked\"":""; ?> alt="<?php print_string('allowremovepages', 'wiki') ?>" />
<?php print_string('allowremovepages', 'wiki') ?>
<?php helpbutton('studentadminoptions', get_string('studentadminoptions', 'wiki'), 'wiki') ?>
<br />
- <input type="checkbox" name="revertchanges" value="1" <?php echo $form->revertchanges?"CHECKED":""; ?> alt="<?php print_string('allowrevertchanges', 'wiki') ?>" />
+ <input type="checkbox" name="revertchanges" value="1" <?php echo $form->revertchanges?"checked=\"checked\"":""; ?> alt="<?php print_string('allowrevertchanges', 'wiki') ?>" />
<?php print_string('allowrevertchanges', 'wiki') ?><br />
</td>
</tr></table>
</tr>
<tr valign="top">
- <td align="right" nowrap="nowrap">
+ <td style="text-align:right;white-space:nowrap;">
<b><?php echo get_string("initialcontent", "wiki") ?>:</b>
</td>
<td>
<input type="hidden" name="id" value="<?php p($form->instance) ?>" />
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
<input type="submit" value="<?php print_string('savechanges') ?>" />
-</center>
+</div>
</fieldset>
</form>
$remove_table=wiki_admin_remove_list($form->listall);
print_table($remove_table);
?>
-<center>
+<div class="boxaligncenter">
<?php
if(!count($remove_table->data)) {
print get_string("nocandidatestoremove","wiki",get_string("listall","wiki"))."<br /><br />";
}
?>
<input type="submit" name="proceed" value="<?php print get_string("removeselectedpages","wiki"); ?>" />
-</center></field></form>
+</div></fieldset></form>
<input type="hidden" name="id" value="<?php print $cm->id ?>" />
<input type="hidden" name="wikipage" value="<?php print $wikipage?>" />
-<center>
+<div class="boxaligncenter">
<?php
if($err->remark) {
formerr($err->remark);
}
?>
-<table cellpadding=5>
-<tr valign=top>
- <td align=right><p><b><?php print_string('authorfieldpattern','wiki') ?>:</b></p></td>
+<table cellpadding="5">
+<tr valign="top">
+ <td align="right"><p><b><?php print_string('authorfieldpattern','wiki') ?>:</b></p></td>
<td>
- <input type="text" name="authorfieldpattern" size=30 value="<?php p($form->authorfieldpattern) ?>" />
+ <input type="text" name="authorfieldpattern" size="30" value="<?php p($form->authorfieldpattern) ?>" />
<?php
helpbutton('revertauthorfieldpattern', get_string('authorfieldpattern', 'wiki'), 'wiki');
if (!empty($err->authorfieldpattern)) { formerr($err->authorfieldpattern); }
?>
</td>
</tr>
-<tr valign=top>
- <td align=right><p><b><?php print_string('changesfield','wiki') ?>:</b></p></td>
+<tr valign="top">
+ <td align="right"><p><b><?php print_string('changesfield','wiki') ?>:</b></p></td>
<td>
- <input type="text" name="changesfield" size=30 value="<?php p($form->changesfield) ?>" />
+ <input type="text" name="changesfield" size="30" value="<?php p($form->changesfield) ?>" />
<?php if (!empty($err->changesfield)) { formerr($err->changesfield); } ?>
</td>
</tr>
-<tr valign=top>
- <td align=right><p><b><?php print_string('howtooperate', 'wiki') ?>:</b></p></td>
+<tr valign="top">
+ <td align="right"><p><b><?php print_string('howtooperate', 'wiki') ?>:</b></p></td>
<td>
<?php
$operations=array( "lastonly" => get_string("revertlastonly","wiki"),
?>
</td>
</tr>
-<tr valign=top>
- <td align=right><p><b><?php print_string('deleteversions','wiki') ?>:</b></p></td>
+<tr valign="top">
+ <td align="right"><p><b><?php print_string('deleteversions','wiki') ?>:</b></p></td>
<td>
- <input type="text" name="deleteversions" size=2 value="<?php p($form->deleteversions) ?>" />
+ <input type="text" name="deleteversions" size="2" value="<?php p($form->deleteversions) ?>" />
<?php if (!empty($err->deleteversions)) { formerr($err->deleteversions); } ?>
</td>
</tr>
</table>
<input type="submit" name="proceed" value="<?php print get_string("revertchanges","wiki"); ?>" />
-</center></fieldset></form>
+</div></fieldset></form>
print_table($pageflags_table);
?>
<br />
-<center>
+<div class="boxaligncenter">
<input type="submit" name="proceed" value="<?php print get_string("setpageflags","wiki"); ?>" />
-</center></fieldset></form>
+</div></fieldset></form>
$strip_table=wiki_admin_strip_list($form->pagestostrip, $form->version, $err);
print_table($strip_table);
?>
-<center>
+<div class="boxaligncenter">
<?php
if(!count($strip_table->data)) {
print get_string("nothingtostrip","wiki")."<br /><br />";
}
?>
<input type="submit" name="proceed" value="<?php print get_string("strippages","wiki"); ?>" />
-</center></fieldset></form>
\ No newline at end of file
+</div></fieldset></form>
\ No newline at end of file
text-align:right;
padding-bottom: 0.5em;
}
+
+.wikiexportbox{
+ margin-left:auto;
+ margin-right:auto;
+}
/***
*** Modules: Workshop
***/