version 1.162, 2007/06/27 22:39:48
|
version 1.165, 2007/06/28 22:28:22
|
Line 128 sub handler {
|
Line 128 sub handler {
|
if ($env{'form.launch'} eq '1') { |
if ($env{'form.launch'} eq '1') { |
&start_fresh_session(\%dbfile); |
&start_fresh_session(\%dbfile); |
} |
} |
|
|
while(my($key,$value)=each(%dbfile)) { |
while(my($key,$value)=each(%dbfile)) { |
$hash{$key}=$value; |
$hash{$key}=$value; |
} |
} |
Line 350 END
|
Line 349 END
|
my $js = <<"ENDHEADER"; |
my $js = <<"ENDHEADER"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
$catalogmodefunctions |
$catalogmodefunctions |
function checkAll(dir) { |
function checkAll() { |
var numForms = document.forms.length; |
var numForms = document.forms.length; |
var dirLength = dir.length; |
|
var dirCheckbox = document.getElementById(dir); |
|
for (i=0;i<numForms;i++) { |
for (i=0;i<numForms;i++) { |
var numElements = document.forms[i].elements.length; |
var numElements = document.forms[i].elements.length; |
for (j=0;j<numElements;j++){ |
for (j=0;j<numElements;j++){ |
var fieldVal = document.forms[i].elements[j].value; |
var fieldName = document.forms[i].elements[j].name; |
var comp = fieldVal.substr(0,dirLength); |
if (fieldName == 'filelink') { |
if ((comp == dir) && (dirLength < fieldVal.length)) { |
document.forms[i].elements[j].checked = true; |
if (dirCheckbox.checked == true) { |
} |
document.forms[i].elements[j].checked = true; |
} |
} else { |
} |
document.forms[i].elements[j].checked = false; |
} |
} |
function uncheckAll() { |
|
var numForms = document.forms.length; |
|
for (i=0;i<numForms;i++) { |
|
var numElements = document.forms[i].elements.length; |
|
for (j=0;j<numElements;j++){ |
|
var fieldName = document.forms[i].elements[j].name; |
|
if (fieldName == 'filelink') { |
|
document.forms[i].elements[j].checked = false; |
} |
} |
} |
} |
} |
} |
Line 404 ENDHEADER
|
Line 408 ENDHEADER
|
$ac++; |
$ac++; |
} |
} |
# sorting through the actions and changing the global database hash |
# sorting through the actions and changing the global database hash |
foreach (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) { |
foreach my $key (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) { |
my $key=$_; |
|
if ($ahash{$key} eq '1') { |
if ($ahash{$key} eq '1') { |
$hash{'store_'.$hash{'pre_'.$key.'_link'}}= |
$hash{'store_'.$hash{'pre_'.$key.'_link'}}= |
$hash{'pre_'.$key.'_title'}; |
$hash{'pre_'.$key.'_title'}; |
$hash{'storectr_'.$hash{'pre_'.$key.'_link'}}= |
$hash{'storectr_'.$hash{'pre_'.$key.'_link'}}= |
$hash{'storectr'}+0; |
$hash{'storectr'}+0; |
$hash{'storectr'}++; |
$hash{'storectr'}++; |
Line 518 END
|
Line 521 END
|
# ------------------------------------------------------ Remember where we were |
# ------------------------------------------------------ Remember where we were |
&Apache::loncommon::storeresurl($storeuri); |
&Apache::loncommon::storeresurl($storeuri); |
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri); |
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri); |
|
# -------------------------------------------------- Check All and Uncheck all |
|
$r->print('<br /><input type="button" value="'.&mt("Check All").'" id="checkallbutton" onClick="javascript:checkAll()" />'); |
|
$r->print('<input type="button" value="'.&mt("Uncheck All").'" id="uncheckallbutton" onClick="javascript:uncheckAll()" />'); |
# ----------------- output starting row to the indexed file/directory hierarchy |
# ----------------- output starting row to the indexed file/directory hierarchy |
my $titleclr="#ddffff"; |
my $titleclr="#ddffff"; |
#$r->print(&initdebug()); |
#$r->print(&initdebug()); |
Line 889 sub display_line {
|
Line 895 sub display_line {
|
my $curdir = $startdir.$filecom[0].'/'; |
my $curdir = $startdir.$filecom[0].'/'; |
my $anchor = $curdir; |
my $anchor = $curdir; |
$anchor =~ s/\W//g; |
$anchor =~ s/\W//g; |
$r->print("<tr valign=$valign bgcolor=\"$fileclr\">"); |
$r->print("<tr bgcolor=\"$fileclr\">$extrafield<td valign=$valign>"); |
$r->print("<td>\n"); |
|
$r->print("<input type=\"checkbox\" name=\"$curdir\" id=\"$curdir\" value=\"$curdir\" onClick=\"javascript:checkAll('$curdir')\" /></td>\n"); |
|
$r->print("<td nowrap>\n"); |
|
&begin_form ($r,$curdir); |
&begin_form ($r,$curdir); |
$r->print ('<a name="'.$anchor.'"></a><img alt="" src="'.$iconpath. |
$r->print ('<a name="'.$anchor.'"></a><img alt="" src="'.$iconpath. |
'whitespace1.gif" class="LC_icon" />'."\n"); |
'whitespace1.gif" class="LC_icon" />'."\n"); |
Line 948 sub display_line {
|
Line 951 sub display_line {
|
$r->print(" />\n"); |
$r->print(" />\n"); |
$r->print("</form></td><td nowrap='nowrap' valign='top'>"); |
$r->print("</form></td><td nowrap='nowrap' valign='top'>"); |
$hash{"pre_${fnum}_link"}=$filelink; |
$hash{"pre_${fnum}_link"}=$filelink; |
|
$hash{"pre_${fnum}_title"}=&Apache::lonnet::gettitle($filelink,'title'); |
|
if (!$hash{"pre_${fnum}_title"}) { |
|
$hash{"pre_${fnum}_title"} = 'Untitled'; |
|
} |
$fnum++; |
$fnum++; |
} |
} |
# Form to open or close sequences |
# Form to open or close sequences |