[LON-CAPA-cvs] cvs: loncom(version_2_8_X) /interface portfolio.pm

raeburn raeburn@source.lon-capa.org
Fri, 12 Dec 2008 15:38:54 -0000


raeburn		Fri Dec 12 15:38:54 2008 EDT

  Modified files:              (Branch: version_2_8_X)
    /loncom/interface	portfolio.pm 
  Log:
  - Backport 1.200, 1.201.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.196 loncom/interface/portfolio.pm:1.196.2.1
--- loncom/interface/portfolio.pm:1.196	Mon Nov 17 17:04:20 2008
+++ loncom/interface/portfolio.pm	Fri Dec 12 15:38:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.196 2008/11/17 17:04:20 schafran Exp $
+# $Id: portfolio.pm,v 1.196.2.1 2008/12/12 15:38:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -227,7 +227,7 @@
     $r->print('<td>'.$size.'</td>');
     $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');
     if ($select_mode ne 'true') {
-	$r->print('<td><span style="white-space: nowrap">'.
+	$r->print('<td><span class="LC_nobreak">'.
 		  &mt($curr_access).'&nbsp;&nbsp;&nbsp;');
         my %anchor_fields = (
             'access' => $filename,
@@ -775,13 +775,13 @@
         $info .= '</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.');
         $info .= '</li><li>'.&explain_conditionals();
         $info .= '</li></ul>'.
-                  &mt('A listing of files viewable without log-in is available at: ')."<a href=\"/adm/$udom/$uname/aboutme/portfolio\">http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio</a>.<br />";
+                  &mt('A listing of files viewable without log-in is available at: ')."<a href=\"/adm/$udom/$uname/aboutme/portfolio\">".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme/portfolio</a>.<br />";
         if ($group eq '') {
             $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:");
         } else {
             $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on the course information page:");
         }
-        $info .= "<br /><a href=\"/adm/$udom/$uname/aboutme\">http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a><br />";
+        $info .= "<br /><a href=\"/adm/$udom/$uname/aboutme\">".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme</a><br />";
         if ($group ne '') {
             $info .= &mt("Users with privileges to edit course contents may add a course information page to a course using the 'Course Info' button in DOCS").'<br />';
         }
@@ -1474,7 +1474,7 @@
                 }
                 $max_id ++;
                 my $role_selects = &role_selectors($num,$role_id,$type,$content,'display');
-                $r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>');
+                $r->print('<tr><td><span class="LC_nobreak"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>');
             }
             $r->print('</table>');
         }
@@ -1549,7 +1549,7 @@
 
 sub actionbox {
     my ($status,$num,$scope) = @_;
-    my $output = '<span style="white-space: nowrap"><label>';
+    my $output = '<span class="LC_nobreak"><label>';
     if ($status eq 'new') {
         my $checkstate;
         if ($scope eq 'domains' || $scope eq 'users' || $scope eq 'course') {
@@ -1560,7 +1560,7 @@
         &mt('Activate');
     } else {
         $output .= '<input type="checkbox" name="delete" value="'.$num.
-                   '" />'.&mt('Delete').'</label></span><br /><span style="white-space: nowrap">'.
+                   '" />'.&mt('Delete').'</label></span><br /><span class="LC_nobreak">'.
                    '<label><input type="checkbox" name="update" value="'.
                    $num.'" />'.&mt('Update');
     }
@@ -1579,7 +1579,7 @@
                             undef,undef,1);
     my $enddate = &Apache::lonhtmlcommon::date_setter('portform',
                                'enddate_'.$num,$end,undef,undef,undef,1,undef,
-                                undef,undef,1). '&nbsp;&nbsp;<span style="white-space: nowrap"><label>'.
+                                undef,undef,1). '&nbsp;&nbsp;<span class="LC_nobreak"><label>'.
                                 '<input type="checkbox" name="noend_'.
                                 $num.'" '.$noend.' />'.&mt('No end date').
                                 '</label></span>';
@@ -2216,6 +2216,15 @@
         $r->print(&Apache::loncommon::start_page($title));
     }
     $r->rflush();
+    if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {
+        $r->print('<h2>'.&mt('No user portfolio available') .'</h2>'.
+                  &mt('This is a result of one of the following:').'<ul>'.
+                  '<li>'.&mt('The administrator of this domain has disabled portfolio functionality for this specific user.').'</li>'.
+                  '<li>'.&mt('The domain has been configured to disable, by default, portfolio functionality for all users in the domain.').'</li>'.
+                  '</ul>');
+        $r->print(&Apache::loncommon::end_page());
+        return OK;
+    }
     my ($blocked,$blocktext) = 
         &Apache::loncommon::blocking_status('port',$uname,$udom);
     if ($blocked) {