--- loncom/interface/portfolio.pm 2006/06/22 15:42:38 1.110 +++ loncom/interface/portfolio.pm 2006/06/22 18:33:58 1.115 @@ -31,7 +31,7 @@ use Apache::lonfeedback; use Apache::lonlocal; use Apache::lonnet; use Apache::longroup; -use lib '/home/httpd/lib/perl'; +use HTML::Entities; use LONCAPA; # receives a file name and path stub from username/userfiles/portfolio/ @@ -40,9 +40,9 @@ sub make_anchor { my ($url, $filename, $current_path, $current_mode, $field_name, $continue_select,$group) = @_; if ($continue_select ne 'true') {$continue_select = 'false'}; - my $anchor = ''.$filename.''; return $anchor; @@ -63,38 +63,39 @@ sub display_common { 'createdir' => 'Create Subdirectory', 'createdir_label' => 'Create subdirectory in current directory:'); + my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); $r->print(<<"TABLE"); - - - - - '); + $r->print('
- $text{'upload_label'} - $groupitem + + + + - - - - - - + + + + - - + + +
+ $text{'upload_label'} + $groupitem + -
- $text{'createdir_label'} - + +
+ $text{'createdir_label'} + +
$groupitem -
TABLE my @tree = split (/\//,$current_path); @@ -108,9 +109,9 @@ TABLE } $r->print(''); &Apache::lonhtmlcommon::store_recent($namespace,$current_path,$current_path); - $r->print('
'. &Apache::lonhtmlcommon::select_recent($namespace,'currentpath', @@ -153,13 +154,13 @@ sub display_directory { return; } if ($select_mode eq 'true') { + $r->print(''); $r->print(''. ''); - $r->print(''); } else { + $r->print(''); $r->print('
Select NameSizeLast Modified
'. ''); - $r->print(''); } if (defined($group)) { $r->print("\n".$groupitem."\n"); @@ -190,9 +191,9 @@ sub display_directory { if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { if ($dirptr&$testdir) { if ($select_mode eq 'true'){ - $r->print(''); + $r->print(''); } else { - $r->print(''); + $r->print(''); } $r->print(''); $r->print(''); @@ -256,15 +257,15 @@ sub display_directory { } $curr_access = join('+ ',@allaccesses); } - $r->print(''); + $r->print(''); $r->print(''); $r->print(''); $r->print(''); - $r->print(''); + '">'.&mt('View/Change').''); $r->print(''); } } @@ -316,7 +317,7 @@ sub close_form { $group.'" />'); } $r->print('

'); - $r->print(' + $r->print('

'); @@ -693,7 +694,7 @@ sub update_access { &close_form($r,$url,$group); } else { $r->print('
'. + '&currentpath='.$env{'form.currentpath'}.'">'. &mt('Display all access settings for this file').''); } return; @@ -952,12 +953,12 @@ sub display_access_row { } } $r->print(&Apache::loncommon::end_data_table_row()); - $r->print(&Apache::loncommon::start_data_table_row()); if ($status eq 'old') { + $r->print(&Apache::loncommon::start_data_table_row()); $r->print('

'); + $r->print(&Apache::loncommon::end_data_table_row()); } - $r->print(&Apache::loncommon::end_data_table_row()); $r->print(&Apache::loncommon::end_data_table()); } else { $r->print(&mt('No [_1]-based conditions defined.
',$type). @@ -1011,10 +1012,11 @@ function getIndex(name,value) { sub course_row { my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_; - my %content; + my $content; my $defdom = $env{'user.domain'}; if ($status eq 'old') { - $defdom = $$access_controls{$item}{'domain'}; + $content = $$access_controls{$item}; + $defdom = $content->{'domain'}; } my $js = &Apache::loncommon::coursebrowser_javascript($defdom) .&course_js(); @@ -1026,9 +1028,9 @@ sub course_row { $type); $r->print(''); if ($status eq 'old') { - my $cid = $content{'domain'}.'_'.$content{'number'}; + my $cid = $content->{'domain'}.'_'.$content->{'number'}; my %course_description = &Apache::lonnet::coursedescription($cid); - $r->print(''); + $r->print(''); } elsif ($status eq 'new') { my $uctype = $type; $uctype =~ s/^(\w)/uc($1)/e; @@ -1041,15 +1043,15 @@ sub course_row { &mt($crsgrptext).''); if ($status eq 'old') { my $max_id = 0; - foreach my $role_id (sort(keys(%{$content{'roles'}}))) { + foreach my $role_id (sort(keys(%{$content->{'roles'}}))) { if ($role_id > $max_id) { $max_id = $role_id; } $max_id ++; - my $role_selects = &role_selectors($num,$role_id,$status,$type,\%content,'display'); - $r->print(''.$role_selects.''); + my $role_selects = &role_selectors($num,$role_id,$status,$type,$content,'display'); + $r->print(''.$role_selects.''); } - $r->print('
Actions NameSizeLast ModifiedCurrent Access Status
'.&mt('open folder').'
'.&mt('closed folder').'Go to ...'.&make_anchor($url,$filename.'/',$current_path.$filename.'/',$env{'form.mode'},$env{"form.fieldname"},$env{'form.continue'},$group).''. $filename.''.$size.''.&Apache::lonlocal::locallocaltime($mtime).''.&mt($curr_access).'   '. + $r->print(''.&mt($curr_access).'   '. ''.&mt('View/Change').'
'.&additional_item($type). ''.$js.&actionbox($status,$num,$scope).''.$course_description{'description'}.''.$course_description{'description'}.'



'.&mt('Add a roles-based condition').' 

'.&mt('Add a roles-based condition').' {'domain'}','$content->{'number'}','Course'".')" value="'.$max_id.'" />'); } elsif ($status eq 'new') { my $role_id = 1; my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display'); @@ -1063,7 +1065,7 @@ sub domains_row { my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_; my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then, 'domains'); - my $dom_select = ''. ' '; if ($status eq 'old') { my $content = $$access_controls{$item}; @@ -1081,6 +1083,7 @@ sub domains_row { $dom_select .= ''; } } + $dom_select .= ''; $r->print(''.&actionbox($status,$num,$scope).''.$dom_select. ''.&dateboxes($num,$start,$end).''); } @@ -1105,17 +1108,17 @@ sub additional_item { sub actionbox { my ($status,$num,$scope) = @_; - my $output = ''. + '" />'.&mt('Delete').'
'. '
'; + $output .= ''; return $output; } @@ -1130,10 +1133,10 @@ sub dateboxes { undef,undef,1); my $enddate = &Apache::lonhtmlcommon::date_setter('portform', 'enddate_'.$num,$end,undef,undef,undef,1,undef, - undef,undef,1). '  '; + ''; my $output = &mt('Start: ').$startdate.'
'.&mt('End: ').$enddate; return $output; @@ -1276,7 +1279,7 @@ sub select_files { $java_files.=','; } my $javascript =(< +