[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonroles.pm

raeburn raeburn at source.lon-capa.org
Sat Aug 13 17:17:38 EDT 2016


raeburn		Sat Aug 13 21:17:38 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonroles.pm 
  Log:
  - For 2.11
    - Backport 1.314
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.269.2.25 loncom/auth/lonroles.pm:1.269.2.26
--- loncom/auth/lonroles.pm:1.269.2.25	Mon Aug  8 13:39:26 2016
+++ loncom/auth/lonroles.pm	Sat Aug 13 21:17:38 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.269.2.25 2016/08/08 13:39:26 raeburn Exp $
+# $Id: lonroles.pm,v 1.269.2.26 2016/08/13 21:17:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -746,13 +746,19 @@
     my $showcount = &roles_from_env(\%roles_in_env,$update); 
 
     my $swinfo=&Apache::lonmenu::rawconfig();
-    my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});
     my %domdefs=&Apache::lonnet::get_domain_defaults($env{'user.domain'}); 
     my $cattype = 'std';
     if ($domdefs{'catauth'}) {
         $cattype = $domdefs{'catauth'};
     }
     my $funcs = &get_roles_functions($showcount,$cattype);
+    my $crumbsright;
+    if ($env{'browser.mobile'}) {
+        $crumbsright = $funcs;
+        undef($funcs);
+    }
+    my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum,
+                                                                    bread_crumbs_component=>$crumbsright});
     &js_escape(\$standby);
     my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';
 
@@ -1328,7 +1334,7 @@
     my $doheaders;
     if ((ref($sortrole) eq 'HASH') && (ref($roleclass) eq 'HASH')) {
         $r->print('<br />'
-                 .&Apache::loncommon::start_data_table()
+                 .&Apache::loncommon::start_data_table('LC_textsize_mobile')
                  .&Apache::loncommon::start_data_table_header_row()
         );
         if (!$nochoose) { $r->print('<th> </th>'); }
@@ -1852,7 +1858,7 @@
 sub adhoc_roles_row {
     my ($dcdom,$rowtype) = @_;
     my $output = &Apache::loncommon::continue_data_table_row()
-                 .' <td colspan="5">'
+                 .' <td colspan="5" class="LC_textsize_mobile">'
                  .&mt('[_1]Ad hoc[_2] roles in domain [_3] --'
                      ,'<span class="LC_cusr_emph">','</span>',$dcdom)
                  .' ';
@@ -2694,15 +2700,30 @@
     unless ($cattype eq 'none') {
         push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]);
     }
-    my $funcs = &Apache::lonhtmlcommon::start_funclist();
-    foreach my $link (@links) {
-        $funcs .= &Apache::lonhtmlcommon::add_item_funclist(
-                      '<a href="'.$link->[0].'" class="LC_menubuttons_link">'.
-                      '<img src="/res/adm/pages/'.$link->[1].'.png" class="LC_icon" alt="'.$link->[2].'" />'.
-                      $link->[2].'</a>');
+    my $funcs;
+    if ($env{'browser.mobile'}) {
+        my @functions;
+        foreach my $link (@links) {
+            push(@functions,[$link->[0],$link->[2]]);
+        }
+        my $title = 'Display options';
+        if ($env{'user.adv'}) {
+            $title = 'Roles options';
+        }
+        $funcs = &Apache::lonmenu::create_submenu('','',$title,\@functions,1,'LC_breadcrumbs_hoverable');
+        $funcs = '<ol class="LC_primary_menu LC_floatright">'.$funcs.'</ol>';
+    } else {
+        $funcs = &Apache::lonhtmlcommon::start_funclist();
+        foreach my $link (@links) {
+            $funcs .= &Apache::lonhtmlcommon::add_item_funclist(
+                          '<a href="'.$link->[0].'" class="LC_menubuttons_link">'.
+                          '<img src="/res/adm/pages/'.$link->[1].'.png" class="LC_icon" alt="'.$link->[2].'" />'.
+                          $link->[2].'</a>');
+        }
+        $funcs .= &Apache::lonhtmlcommon::end_funclist();
+        $funcs = &Apache::loncommon::head_subbox($funcs);
     }
-    $funcs .= &Apache::lonhtmlcommon::end_funclist();
-    return &Apache::loncommon::head_subbox($funcs);
+    return $funcs;
 }
 
 sub get_queued {




More information about the LON-CAPA-cvs mailing list