-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
+
+
-END
- my @file_categories = &Apache::loncommon::filecategories();
- my %select_file_categories;
- my @select_form_order = ('');
- $select_file_categories{''} = &mt('All file types');
- foreach my $cat (@file_categories) {
- my $types = join(",",&Apache::loncommon::filecategorytypes($cat));
- $select_file_categories{$types} = $cat;
- push(@select_form_order,$types);
- }
- $select_file_categories{'select_form_order'} = \@select_form_order;
- my $type_element=
- &Apache::loncommon::select_form($typeselect,'only',
- %select_file_categories);
- $type_element = '';
- $r->print($type_element
- .'');
- $r->print(<
+
$closebutton $groupimportbutton
@@ -541,11 +541,21 @@ END
$storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1];
$storeuri=~s/\/+/\//g;
# ---------------------------------------------------------------- Bread crumbs
- $r->print(&Apache::lonhtmlcommon::crumbs($storeuri,'','',
- (($env{'form.catalogmode'} eq 'import')?
- 'document.forms.fileattr':'')).
- &Apache::lonhtmlcommon::select_recent('residx','resrecent',
-'window.status=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();'));
+ $r->print(
+ ''
+ .&Apache::lonhtmlcommon::crumbs(
+ $storeuri,
+ '',
+ '',
+ (($env{'form.catalogmode'} eq 'import')?
+ 'document.forms.fileattr':''))
+ .'
'
+ .&Apache::lonhtmlcommon::select_recent(
+ 'residx',
+ 'resrecent',
+ 'window.status=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();')
+ .'
'
+ );
# -------------------------------------------------------- Resource Home Button
my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'};
if ($reshome) {
@@ -563,17 +573,17 @@ END
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri);
# -------------------------------------------------- Check All and Uncheck all
if ($env{'form.catalogmode'} eq 'import') {
- $r->print('
');
- $r->print('');
+ $r->print('');
+ $r->print('
');
}
# ----------------- output starting row to the indexed file/directory hierarchy
#$r->print(&initdebug());
#$r->print(&writedebug("Omit:@Omit")) if (@Omit);
#$r->print(&writedebug("Only:@Only")) if (@Only);
- $r->print('
');
$r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes")
.&Apache::loncommon::start_data_table_header_row());
$r->print("".&mt('Name')." | \n");
+ $r->print(" | \n");
$r->print("".&mt('Title')." | \n")
if ($hash{'display_attrs_0'} == 1);
$r->print(''.&mt("Size")." (".&mt("bytes").") ".
@@ -613,7 +623,7 @@ END
# ----------------- read in what directories have previously been set to "open"
- foreach (keys %hash) {
+ foreach (keys(%hash)) {
if ($_ =~ /^diropen_status_/) {
my $key = $_;
$key =~ s/^diropen_status_//;
@@ -740,9 +750,11 @@ sub scanDir {
sub get_list {
my ($r,$uri)=@_;
my @list=();
+ my $listerror;
+
(my $luri = $uri) =~ s/\//_/g;
if ($env{'form.updatedisplay'}) {
- foreach (keys %hash) {
+ foreach (keys(%hash)) {
delete $hash{$_} if ($_ =~ /^dirlist_files_/);
delete $hash{$_} if ($_ =~ /^dirlist_timestamp_files_/);
}
@@ -763,10 +775,20 @@ sub get_list {
$hash{'dirlist_files_'.$luri} = join("\n",@list);
} else {
# is really a directory
- @list = &Apache::lonnet::dirlist($uri);
+ (my $listref,$listerror) = &Apache::lonnet::dirlist($uri);
+ if (ref($listref) eq 'ARRAY') {
+ @list = @{$listref};
+ }
$hash{'dirlist_files_'.$luri} = join("\n",@list);
$hash{'dirlist_timestamp_files_'.$luri} = time;
}
+#Checking for error messages associated with empty directories or inaccessible servers (See Bug 4984)
+ if (($listerror eq 'no_such_dir') || ($listerror eq 'no_such_host') || ($listerror eq 'no_host')) {
+ $r->print(" " . &mt("Directory does not exist."). " ");
+ } elsif ($listerror eq 'con_lost') {
+ $r->print("" . &mt("Directory temporarily not accessible."). " ");
+ }
+
return @list=&match_ext($r,@list);
}
@@ -897,7 +919,7 @@ sub display_line {
$r->print(" | \n");
$r->print ('$tabtag");
+ $r->print(&mt("Up")." | $tabtag");
$r->print(&Apache::loncommon::end_data_table_row());
return OK;
}
# Do we have permission to look at this?
-
- if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])); }
+ if($filecom[15] ne '1') { return OK if ((!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])) && (!&Apache::lonnet::allowed('bro',$pathprefix.$filecom[0]))); }
# make absolute links appear on different background
#SB if ($absolute) { $fileclr='#ccdd99'; }
@@ -932,8 +953,8 @@ sub display_line {
$anchor =~ s/\W//g;
$r->print ('');
$r->print ('');
- $r->print (' print (' name="'.$msg.'" type="image" class="LC_fileicon" />'.
+ $r->print (' print (' alt="'.$msg.'" class="LC_fileicon" />'.
"\n");
my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);
$r->print ('(".&Apache::lonnet::domain($listname,'description').
")");
}
- $r->print("$tabtag");
+ $r->print(" | $tabtag");
$r->print(&Apache::loncommon::end_data_table_row());
return OK;
@@ -962,10 +983,10 @@ $r->print (' '."\n");
$r->print ('');
- $r->print ('');
+ $r->print ('');
$r->print (' print (' name="'.$msg.'"/>'.
+ $r->print (' alt="'.$msg.'"/>'.
"\n");
my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
$r->print ('print(''.$tabtag);
+# Wishlistlink
+ $r->print(' | '.
+ ' '.$tabtag);
$r->print(&Apache::loncommon::end_data_table_row());
return OK;
}
@@ -1010,17 +1036,17 @@ $r->print ('");
$r->print(" ".
"\n");
- $r->print(' | ');
+ $r->print(' | ');
} elsif ($env{'form.catalogmode'} eq 'import') {
$r->print(" | ');
+ $r->print(' | ');
$hash{"pre_${fnum}_link"}=$filelink;
$hash{"pre_${fnum}_title"}=$title;
if (!$hash{"pre_${fnum}_title"}) {
@@ -1037,8 +1063,8 @@ $r->print ('\n");
+ $r->print(' ');
$count++;
}
# Sequence open/close icon
@@ -1048,29 +1074,31 @@ $r->print ('');
$r->print ('');
- $r->print ('');
+ $r->print ('');
$r->print (' print (' name="'.$msg.'" type="image" class="LC_fileicon" />'.
+ $r->print (' alt="'.$msg.'" />'.
"\n");
}
# Filetype icons
$r->print(" \n");
my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
- $r->print (" $listname ");
+ $r->print (" $listname ");
$quotable_filelink = &Apache::loncommon::escape_single($filelink.'.meta');
&Apache::loncommon::inhibit_menu_check(\$quotable_filelink);
- $r->print (" (".&mt('metadata').") ");
+ $r->print (" (".&mt('metadata').") ");
# Close form to open/close sequence
if ($filelink=~/\.(page|sequence)$/) {
$r->print('');
}
- $r->print(" | \n");
+ $r->print("\n");
+# Wishlistlink
+ $r->print(''.
+ ' | ');
if ($hash{'display_attrs_0'} == 1) {
$r->print(' '.($title eq '' ? ' ' : $title).
' | '."\n");
@@ -1147,7 +1175,7 @@ $r->print (''.($output eq '' ? ' ':$output).
" \n");
}
@@ -1199,26 +1227,32 @@ $r->print ('\n");
+ $r->print ('
');
$count++;
}
$r->print ('');
$r->print ('');
- $r->print ('
print (' name="'.$msg.'" class="LC_fileicon" />'.
+ $r->print (' alt="'.$msg.'" class="LC_fileicon" />'.
"\n");
my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons");
my $icon = "navmap.folder.".($nowOpen ? "open":"closed").'.gif';
- $r->print (''
- .'
'.
- "\n");
- $r->print ("$listname\n");
+ $r->print (''
+ .'
'
+ ."\n");
+ $r->print ("$listname");
+# Wishlistlink
+ $r->print(''.
+ ' | ');
# Attributes
my $filelink = $startdir.$filecom[0].'/default';
@@ -1263,8 +1297,8 @@ $r->print (''.$output.'';
} elsif ($embstyle eq 'img') {
$output='
';
} elsif ($filelink=~m{^/res/($match_domain)/($match_username)/}) {
@@ -1377,7 +1413,7 @@ sub begin_form {
$uri=&Apache::loncommon::escape_single($uri);
$r->print ('