[LON-CAPA-cvs] cvs: loncom /publisher lonrights.pm

bisitz bisitz at source.lon-capa.org
Fri Nov 9 10:29:19 EST 2012


bisitz		Fri Nov  9 15:29:19 2012 EDT

  Modified files:              
    /loncom/publisher	lonrights.pm 
  Log:
  - Bug #6431: Show icon for each allow/deny setting to better distinguish current status
  - XHTML: form action
  - Internationalization: Content of type column
  
  
Index: loncom/publisher/lonrights.pm
diff -u loncom/publisher/lonrights.pm:1.33 loncom/publisher/lonrights.pm:1.34
--- loncom/publisher/lonrights.pm:1.33	Mon Nov 14 00:20:31 2011
+++ loncom/publisher/lonrights.pm	Fri Nov  9 15:29:19 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to show and edit custom distribution rights
 #
-# $Id: lonrights.pm,v 1.33 2011/11/14 00:20:31 raeburn Exp $
+# $Id: lonrights.pm,v 1.34 2012/11/09 15:29:19 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -180,7 +180,7 @@
           $contents=join('',<$fh>);
           $fh->close();
       }
-      $r->print('<form name="rules" method="post">');
+      $r->print('<form name="rules" method="post" action="">');
   }
   unless ($contents=~/\<accessrule/s) {
       $contents='<accessrule effect="deny" />';
@@ -196,6 +196,10 @@
 				     'co' => 'Course / User',
 				     'se' => 'Section',
 				     'ro' => 'Role');
+  my %iconimg = ('allow' => '<img src="/adm/lonIcons/navmap.correct.gif"'
+                           .' alt="'.&mt('allow').'" title="'.&mt('allow').'" />',
+                 'deny' => '<img src="/adm/lonIcons/navmap.wrong.gif"'
+                           .' alt="'.&mt('deny').'" title="'.&mt('deny').'" />');
 # ---------------------------------------------------------- Start table output
   $r->print(&Apache::loncommon::start_data_table().
 	    &Apache::loncommon::start_data_table_header_row().
@@ -217,14 +221,13 @@
       $r->print(' ');
   }
   $r->print('</td><td>');
+  $r->print($iconimg{$token->[2]->{'effect'}});
   if ($constructmode) {
       my %lt = &Apache::lonlocal::texthash
                                    ('allow' => 'allow',
                                     'deny'  => 'deny');
       $r->print(&Apache::loncommon::select_form
                                  ($token->[2]->{'effect'},'effect_0',\%lt));
-  } else {
-      $r->print($token->[2]->{'effect'});
   }
   $r->print('</td><td colspan="5">'.&mt('Default'));
   if (($token->[2]->{'realm'}) || ($token->[2]->{'role'})) {
@@ -242,8 +245,8 @@
 	  $r->print('<span class="LC_nobreak">'.$rulecounter.'. ');
           if ($constructmode) {
              my %lt = &Apache::lonlocal::texthash
-                          ('' => '',
-                           'delete' => 'Delete this rule',
+                          (''            => '',
+                           'delete'      => 'Delete this rule',
                            'insertabove' => 'Insert rule above',
                            'insertbelow' => 'Insert rule below',
                            'moveup'      => 'Move rule up',
@@ -256,6 +259,7 @@
           $r->print('</span></td>'.
 		    '<td rowspan="2">');
 # effect
+          $r->print($iconimg{$token->[2]->{'effect'}});
           if ($constructmode) {
              my %lt = &Apache::lonlocal::texthash
                              ('allow' => 'allow',
@@ -263,8 +267,6 @@
              $r->print(&Apache::loncommon::select_form
                                  ($token->[2]->{'effect'},
                                   'effect_'.$rulecounter,\%lt));
-          } else {
-             $r->print($token->[2]->{'effect'});
           }
 
 # type
@@ -277,7 +279,7 @@
               $r->print(&Apache::loncommon::select_form($type,
 							'type_'.$rulecounter,\%lt));
           } else {
-              $r->print($type);
+              $r->print(&mt($type));
           }
 
 # ---- realm




More information about the LON-CAPA-cvs mailing list