version 1.199, 2009/07/17 15:42:07
|
version 1.203.2.1, 2009/12/07 02:27:25
|
Line 518 END
|
Line 518 END
|
$select_file_categories{''} = &mt('All file types'); |
$select_file_categories{''} = &mt('All file types'); |
foreach my $cat (@file_categories) { |
foreach my $cat (@file_categories) { |
my $types = join(",",&Apache::loncommon::filecategorytypes($cat)); |
my $types = join(",",&Apache::loncommon::filecategorytypes($cat)); |
$select_file_categories{$types} = $cat; |
$select_file_categories{$types} = &mt($cat); |
push(@select_form_order,$types); |
push(@select_form_order,$types); |
} |
} |
$select_file_categories{'select_form_order'} = \@select_form_order; |
$select_file_categories{'select_form_order'} = \@select_form_order; |
my $type_element= |
my $type_element= |
&Apache::loncommon::select_form($typeselect,'only', |
&Apache::loncommon::select_form( |
%select_file_categories); |
$typeselect, |
|
'only', |
|
%select_file_categories); |
$type_element = '<label>'.&mt('File Type Displayed: [_1]', |
$type_element = '<label>'.&mt('File Type Displayed: [_1]', |
$type_element).'</label>'; |
$type_element).'</label>'; |
$r->print($type_element |
$r->print($type_element |
Line 541 END
|
Line 543 END
|
$storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1]; |
$storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1]; |
$storeuri=~s/\/+/\//g; |
$storeuri=~s/\/+/\//g; |
# ---------------------------------------------------------------- Bread crumbs |
# ---------------------------------------------------------------- Bread crumbs |
$r->print(&Apache::lonhtmlcommon::crumbs($storeuri,'','', |
$r->print( |
(($env{'form.catalogmode'} eq 'import')? |
'<p>' |
'document.forms.fileattr':'')). |
.&Apache::lonhtmlcommon::crumbs( |
&Apache::lonhtmlcommon::select_recent('residx','resrecent', |
$storeuri, |
'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();')); |
'', |
|
'', |
|
(($env{'form.catalogmode'} eq 'import')? |
|
'document.forms.fileattr':'')) |
|
.'<br />' |
|
.&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();') |
|
.'</p>' |
|
); |
# -------------------------------------------------------- Resource Home Button |
# -------------------------------------------------------- Resource Home Button |
my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'}; |
my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'}; |
if ($reshome) { |
if ($reshome) { |
Line 563 END
|
Line 575 END
|
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri); |
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri); |
# -------------------------------------------------- Check All and Uncheck all |
# -------------------------------------------------- Check All and Uncheck all |
if ($env{'form.catalogmode'} eq 'import') { |
if ($env{'form.catalogmode'} eq 'import') { |
$r->print('<br /><input type="button" value="'.&mt("Check All").'" id="checkallbutton" onclick="javascript:checkAll()" />'); |
$r->print('<p><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()" />'); |
$r->print('<input type="button" value="'.&mt("Uncheck All").'" id="uncheckallbutton" onclick="javascript:uncheckAll()" /></p>'); |
} |
} |
# ----------------- output starting row to the indexed file/directory hierarchy |
# ----------------- output starting row to the indexed file/directory hierarchy |
#$r->print(&initdebug()); |
#$r->print(&initdebug()); |
#$r->print(&writedebug("Omit:@Omit")) if (@Omit); |
#$r->print(&writedebug("Omit:@Omit")) if (@Omit); |
#$r->print(&writedebug("Only:@Only")) if (@Only); |
#$r->print(&writedebug("Only:@Only")) if (@Only); |
$r->print('<br /><br />'); |
|
$r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes") |
$r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes") |
.&Apache::loncommon::start_data_table_header_row()); |
.&Apache::loncommon::start_data_table_header_row()); |
$r->print("<th $colspan>".&mt('Name')."</th>\n"); |
$r->print("<th $colspan>".&mt('Name')."</th>\n"); |
Line 913 sub display_line {
|
Line 924 sub display_line {
|
return OK; |
return OK; |
} |
} |
# Do we have permission to look at this? |
# Do we have permission to look at this? |
|
if($filecom[15] ne '1') { return OK if ((!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])) && (!&Apache::lonnet::allowed('bro',$pathprefix.$filecom[0]))); } |
if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])); } |
|
|
|
# make absolute links appear on different background |
# make absolute links appear on different background |
#SB if ($absolute) { $fileclr='#ccdd99'; } |
#SB if ($absolute) { $fileclr='#ccdd99'; } |
Line 1147 $r->print ('<input type="hidden" name="a
|
Line 1157 $r->print ('<input type="hidden" name="a
|
if ($hash{'display_attrs_7'} == 1) { |
if ($hash{'display_attrs_7'} == 1) { |
# Show resource |
# Show resource |
my $output=&showpreview($filelink); |
my $output=&showpreview($filelink); |
$r->print('<td class="LC_fontsize_medium LC_nobreak">'.($output eq '' ? ' ':$output). |
$r->print('<td class="LC_fontsize_medium">'.($output eq '' ? ' ':$output). |
" </td>\n"); |
" </td>\n"); |
} |
} |
|
|
Line 1322 sub showpreview {
|
Line 1332 sub showpreview {
|
my $output=''; |
my $output=''; |
my $embstyle=&Apache::loncommon::fileembstyle($curfext); |
my $embstyle=&Apache::loncommon::fileembstyle($curfext); |
if ($embstyle eq 'ssi') { |
if ($embstyle eq 'ssi') { |
my $cache=$Apache::lonnet::perlvar{'lonDocRoot'}.$filelink. |
my $cache = $Apache::lonnet::perlvar{'lonDocRoot'}.$filelink; |
'.tmp'; |
if ($env{'request.gcicontext'} eq 'buildtest') { |
|
$cache .= '.tn'; |
|
} else { |
|
$cache .= '.tmp'; |
|
} |
if ((!$env{'form.updatedisplay'}) && |
if ((!$env{'form.updatedisplay'}) && |
(-e $cache)) { |
(-e $cache)) { |
open(FH,$cache); |
open(FH,$cache); |