[LON-CAPA-cvs] cvs: loncom /interface lonmsgdisplay.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 07 Dec 2006 01:11:38 -0000


albertel		Wed Dec  6 20:11:38 2006 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  - style
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.46 loncom/interface/lonmsgdisplay.pm:1.47
--- loncom/interface/lonmsgdisplay.pm:1.46	Wed Dec  6 18:44:33 2006
+++ loncom/interface/lonmsgdisplay.pm	Wed Dec  6 20:11:38 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.46 2006/12/06 23:44:33 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.47 2006/12/07 01:11:38 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -224,16 +224,17 @@
    <table border="0" cellspacing="2" cellpadding="2">
     <tr>
      <td align="center"><b>'.$lt{'fold'}.'</b><br />'."\n".
-	&Apache::loncommon::select_form($folder,'folder',%formhash).'
+         &Apache::loncommon::select_form($folder,'folder',%formhash).'
      </td>
      <td align="center"><b>'.$lt{'show'}.'</b><br />
       <select name="interdis">'.
-	      join("\n",map { '<option value="'.$_.'"'.
-	 ($_==$interdis?' selected="selected"':'').'>'.$_.'</option>' }
-		   (10,20,50,100,200)).'</select>
+          join("\n",map { '<option value="'.$_.'"'.
+			      ($_==$interdis?' selected="selected"':'').'>'.$_.'</option>' 
+			}
+	       (10,20,50,100,200)).'</select>
      </td>
      <td align="center"><b>'.$lt{'actn'}.'</b><br />'.
-    &Apache::loncommon::select_form('view','folderaction',%actions).'
+         &Apache::loncommon::select_form('view','folderaction',%actions).'
      </td><td><br />'.
     '<input type="button" value="'.$lt{'go'}.'" onClick="javascript:folder_choice(this.form,'."'change'".');" />
      </td>
@@ -252,18 +253,18 @@
 </table>'."\n".
     '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.
     '<input type="hidden" name="renamed" value="" />'.
-    ($folder=~/^(new|critical)/?'</form>':'');
+        ($folder=~/^(new|critical)/?'</form>':'');
     return $output;
 }
 
 sub get_permanent_folders {
-    my %permfolders = &Apache::lonlocal::texthash (
-                                ''         => 'INBOX',
-                                'trash'    => 'TRASH',
-                                'new'      => 'New Messages Only',
-                                'critical' => 'Critical',
-                                'sent'     => 'Sent Messages',
-    );
+    my %permfolders = 
+	&Apache::lonlocal::texthash(''         => 'INBOX',
+				    'trash'    => 'TRASH',
+				    'new'      => 'New Messages Only',
+				    'critical' => 'Critical',
+				    'sent'     => 'Sent Messages',
+				    );
     return %permfolders;
 }
 
@@ -323,19 +324,18 @@
         while (defined($userfolders{$folder_id})) {
             $folder_id ++;
         }
-        my %folderinfo = (
-                           id => $folder_id,
-                           created => time,
-                         );
+        my %folderinfo = ( id      => $folder_id,
+                           created => time, );
         $outcome =  
-        &Apache::lonnet::put('email_folders',{$newfolder => \%folderinfo,
-                                             "\0".'idcount' => $folder_id});
+	    &Apache::lonnet::put('email_folders',{$newfolder => \%folderinfo,
+						  "\0".'idcount' => $folder_id});
         my $releaseresult = &release_msgfolder_lock();
         if ($releaseresult ne 'ok') {
             $warning = $releaseresult;
         }
     } else {
-        $outcome = 'Error - could not obtain lock on email folders record.';
+        $outcome = 
+	    &mt('Error - could not obtain lock on email folders record.');
     }
     return ($outcome,$warning);
 }
@@ -386,10 +386,8 @@
     if (ref($userfolders{$folder}) eq 'HASH') {
         %folderinfo = %{$userfolders{$folder}};
     } else {
-        %folderinfo = (
-                             id => $folder,
-                        created => $userfolders{$folder},
-                      );
+        %folderinfo = ( id      => $folder,
+                        created => $userfolders{$folder},);
     }
     my $outcome =
      &Apache::lonnet::put('email_folders',{$newname => \%folderinfo});
@@ -401,14 +399,12 @@
 
 sub get_msgfolder_lock {
     # get lock for mail folder counter.
-    my $lockhash = {
-                  "\0".'lock_counter' => time,
-                   };
+    my $lockhash = { "\0".'lock_counter' => time, };
     my $tries = 0;
     my $gotlock = &Apache::lonnet::newput('email_folders',$lockhash);
     while (($gotlock ne 'ok') && $tries <3) {
         $tries ++;
-        sleep 1;
+        sleep(1);
         $gotlock = &Apache::lonnet::newput('email_folders',$lockhash);
     }
     return $gotlock;