[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 04 Jul 2007 00:21:43 -0000
This is a MIME encoded message
--albertel1183508503
Content-Type: text/plain
albertel Tue Jul 3 20:21:43 2007 EDT
Modified files:
/loncom/interface londocs.pm
Log:
- valid xhtml
--albertel1183508503
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20070703202143.txt"
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.285 loncom/interface/londocs.pm:1.286
--- loncom/interface/londocs.pm:1.285 Tue Jul 3 19:02:53 2007
+++ loncom/interface/londocs.pm Tue Jul 3 20:21:42 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.285 2007/07/03 23:02:53 albertel Exp $
+# $Id: londocs.pm,v 1.286 2007/07/04 00:21:42 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1209,7 +1209,7 @@
return if (!defined($env{'docs.markedcopy_url'}));
$r->print(<<ENDPASTE);
-<p><form name="pasteform" action="/adm/coursedocs" method="post">
+<form name="pasteform" action="/adm/coursedocs" method="post"><p>
ENDPASTE
$r->print('<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> ');
@@ -1221,20 +1221,20 @@
my $extension = (split(/\./,$env{'docs.markedcopy_url'}))[-1];
my $type = &Apache::loncommon::filedescription($extension);
my $icon = '<img src="'.&Apache::loncommon::icon($extension).
- '" class="LC_icon" />';
+ '" alt="" class="LC_icon" />';
$r->print($icon.$type.': '. &parse_supplemental_title($env{'docs.markedcopy_title'}));
}
if ($container eq 'page') {
- $r->print(<<PAGEINFO);
- <input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />
- <input type="hidden" name="pagesymb" value="$env{'form.pagesymb'}" />
-PAGEINFO
+ $r->print('
+ <input type="hidden" name="pagepath" value="'.&HTML::Entities::encode($env{'form.pagepath'},'<>&"').'" />
+ <input type="hidden" name="pagesymb" value="'.&HTML::Entities::encode($env{'form.pagesymb'},'<>&"').'" />
+');
} else {
- $r->print(<<FOLDERINFO);
- <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
-FOLDERINFO
+ $r->print('
+ <input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />
+');
}
- $r->print('</form></p>');
+ $r->print('</p></form>');
}
sub editor {
@@ -1715,7 +1715,9 @@
$renametitle=~s/\\/\\\\/g;
$renametitle=~s/\"\;/\\\"/g;
+ $renametitle=~s/ /%20/g;
my $line='<tr>';
+ my ($form_start,$form_end);
# Edit commands
my $container;
my ($container, $type, $esc_path, $path, $symb);
@@ -1791,12 +1793,15 @@
<a href='javascript:cutres("$esc_path","$index","$renametitle","$container","$symb","$folder");' class="LC_docs_cut">$lt{'ct'}</a>
ENDCUT
}
- $line.=(<<END);
- <form name="entry_$index" action="/adm/coursedocs" method="post">
+ $form_start = (<<END);
+ <form action="/adm/coursedocs" method="post">
<input type="hidden" name="${type}path" value="$path" />
<input type="hidden" name="${type}symb" value="$symb" />
<input type="hidden" name="setparms" value="$orderidx" />
<input type="hidden" name="changeparms" value="0" />
+END
+ $form_end = '</form>';
+ $line.=(<<END);
<td>
<table class="LC_docs_entry_move">
<tr>
@@ -1812,7 +1817,9 @@
</table>
</td>
<td>
+ $form_start
$selectbox
+ $form_end
</td>
<td class="LC_docs_entry_commands">
<a href='javascript:removeres("$esc_path","$index","$renametitle","$container","$symb");' class="LC_docs_remove">$lt{'rm'}</a>
@@ -1927,7 +1934,7 @@
}
$line.='
<td class="LC_docs_entry_icon">
- <a href="'.$url.'"><img src="'.$icon.'" class="LC_icon" /></a>
+ <a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>
</td>
<td class="LC_docs_entry_title">
'.($url?"<a href=\"$url\">":'').$title.($url?'</a>':' <span class="LC_docs_reinit_warn">'.&mt('(re-initialize course to access)').'</span>')."
@@ -1942,15 +1949,19 @@
((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':'');
$line.=(<<ENDPARMS);
<td class="LC_docs_entry_parameter">
+ $form_start
<label><input type="checkbox" name="hidprs_$orderidx" onClick="this.form.changeparms.value='hiddenresource';this.form.submit()" $hidtext /> $lt{'hd'}</label>
+ $form_end
</td>
<td class="LC_docs_entry_parameter">
+ $form_start
<label><input type="checkbox" name="encprs_$orderidx" onClick="this.form.changeparms.value='encrypturl';this.form.submit()" $enctext /> $lt{'ec'}</label>
+ $form_end
</td>
- <td class="LC_docs_entry_parameter">$parameterset</td>
+ <td class="LC_docs_entry_parameter">$form_start $parameterset $form_end</td>
ENDPARMS
}
- $line.="</form></tr>";
+ $line.="</tr>";
return $line;
}
@@ -2398,7 +2409,7 @@
$message='Changes will become active for your current session after [_1], or the next time you log in.';
}
$r->print("\n\n".
-'<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'."\n".
+'<script type="text/javascript">function reinit(tf) { tf.submit();'.$postexec.' }</script>'."\n".
'<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'.
'<input type="hidden" name="orgurl" value="'.$url.
'" /><input type="hidden" name="selectrole" value="1" /><h3><span class="LC_warning">'.
@@ -2735,7 +2746,7 @@
}
my $postexec='';
if ($folder eq 'default') {
- $r->print('<script>this.window.name="loncapaclient";</script>');
+ $r->print('<script type="text/javascript">this.window.name="loncapaclient";</script>');
} else {
#$postexec='self.close();';
}
@@ -2765,12 +2776,12 @@
<td>
$lt{'file'}:<br />
<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data">
-<input type="file" name="uploaddoc" size="40">
+<input type="file" name="uploaddoc" size="40" />
<br />
$lt{'title'}:<br />
-<input type="text" size="50" name="comment">
+<input type="text" size="50" name="comment" />
$uploadtag
-<input type="hidden" name="cmd" value="upload_default">
+<input type="hidden" name="cmd" value="upload_default" />
<br />
<span class="LC_nobreak">
<label>$lt{'parse'}?
@@ -2780,7 +2791,7 @@
<br />
<br />
<span class="LC_nobreak">
-<input type="submit" value="$lt{'upld'}">
+<input type="submit" value="$lt{'upld'}" />
$help{'Uploading_From_Harddrive'}
</span>
</form>
@@ -2789,19 +2800,19 @@
<form action="/adm/coursedocs" method="post" name="simpleeditdefault">
$lt{'pubd'}<br />
$uploadtag
-<input type=button onClick="javascript:groupsearch()" value="$lt{'srch'}" />
+<input type="button" onClick="javascript:groupsearch()" value="$lt{'srch'}" />
<br />
<span class="LC_nobreak">
-<input type=button onClick="javascript:groupimport();" value="$lt{'impo'}" />
+<input type="button" onClick="javascript:groupimport();" value="$lt{'impo'}" />
$help{'Importing_LON-CAPA_Resource'}
</span>
<br />
-<input type=button onClick="javascript:groupopen(0,1,1);" value="$lt{'book'}" />
-<p>
+<input type="button" onClick="javascript:groupopen(0,1,1);" value="$lt{'book'}" />
<hr />
+<p>
$lt{'copm'}<br />
<input type="text" size="40" name="importmap" /><br />
-<span class="LC_nobreak"><input type=button
+<span class="LC_nobreak"><input type="button"
onClick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')"
value="$lt{'selm'}" /> <input type="submit" name="loadmap" value="$lt{'load'}" />
$help{'Load_Map'}</span>
@@ -2992,7 +3003,7 @@
</tr>
<tr><td>
<form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
-<input type="file" name="uploaddoc" size="40">
+<input type="file" name="uploaddoc" size="40" />
<br />
<br />
<span class="LC_nobreak">
@@ -3006,9 +3017,9 @@
</textarea>
<br />
<input type="hidden" name="folderpath" value="$path" />
-<input type="hidden" name="cmd" value="upload_supplemental">
+<input type="hidden" name="cmd" value="upload_supplemental" />
<span class="LC_nobreak">
-<input type="submit" value="$lt{'upld'}">
+<input type="submit" value="$lt{'upld'}" />
$help{'Uploading_From_Harddrive'}
</span>
</form>
@@ -3055,17 +3066,17 @@
ENDSUPFORM
}
}
+ $r->print('</table>');
if ($allowed) {
- $r->print('<form method="POST" name="extimport" action="/adm/coursedocs"><input type="hidden" name="title" /><input type="hidden" name="url" /><input type="hidden" name="useform" /></form>');
+ $r->print('<form method="post" name="extimport" action="/adm/coursedocs"><input type="hidden" name="title" /><input type="hidden" name="url" /><input type="hidden" name="useform" /></form>');
}
- $r->print('</table>');
} else {
unless ($upload_result eq 'phasetwo') {
# -------------------------------------------------------- This is showdoc mode
$r->print("<h1>".&mt('Uploaded Document').' - '.
&Apache::lonnet::gettitle($r->uri).'</h1><p>'.
-&mt('It is recommended that you use an up-to-date virus scanner before handling this file.')."</p><p><table>".
- &entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'</table></p>');
+&mt('It is recommended that you use an up-to-date virus scanner before handling this file.')."</p><table>".
+ &entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'</table>');
}
}
}
--albertel1183508503--