From 112c9133bb8dc3b4e8f1d47241fa57c86dd5065c Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 05 Oct 2008 03:18:15 -0400
Subject: [PATCH] - removed deprecated rcube_add_label() and all uses - code for 'show' action added in r1937 moved to show.inc

---
 program/steps/addressbook/edit.inc |    3 +--
 program/include/main.inc           |   17 +----------------
 program/steps/mail/compose.inc     |    4 ++--
 program/steps/addressbook/func.inc |    2 +-
 program/steps/mail/func.inc        |   13 ++-----------
 program/steps/settings/func.inc    |    2 +-
 program/steps/mail/show.inc        |    9 +++++++--
 7 files changed, 15 insertions(+), 35 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index 23c2c28..ee84747 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -133,20 +133,6 @@
 
 
 /**
- * Add a localized label to the client environment
- * @deprecated
- */
-function rcube_add_label()
-  {
-  global $OUTPUT;
-  
-  $arg_list = func_get_args();
-  foreach ($arg_list as $i => $name)
-    $OUTPUT->add_label($name);
-  }
-
-
-/**
  * Garbage collector function for temp files.
  * Remove temp files older than two days
  */
@@ -913,8 +899,7 @@
   $attrib += array('maxlength' => 100, 'relanames' => false);
 
   // add some labels to client
-  rcube_add_label('purgefolderconfirm');
-  rcube_add_label('deletemessagesconfirm');
+  $RCMAIL->output->add_label('purgefolderconfirm', 'deletemessagesconfirm');
   
   $type = $attrib['type'] ? $attrib['type'] : 'ul';
   unset($attrib['type']);
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index 61c660d..410a09b 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -43,8 +43,7 @@
   }
 
   // add some labels to client
-  rcube_add_label('noemailwarning');
-  rcube_add_label('nonamewarning');
+  $OUTPUT->add_label('noemailwarning', 'nonamewarning');
 
   list($form_start, $form_end) = get_form_tags($attrib);
   unset($attrib['form']);
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 4199502..33dfad6 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -114,7 +114,7 @@
   $OUTPUT->include_script('list.js');
   
   // add some labels to client
-  rcube_add_label('deletecontactconfirm');
+  $OUTPUT->add_label('deletecontactconfirm');
   
   return $out;
   }
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 8f4bc9f..9fe4a68 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -81,7 +81,7 @@
 }
 
 // add some labels to client
-rcube_add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting');
+$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting');
 
 // add config parameter to client script
 $OUTPUT->set_env('draft_autosave', !empty($CONFIG['drafts_mbox']) ? $CONFIG['draft_autosave'] : 0);
@@ -477,7 +477,7 @@
       $attrib['id'],
       JS_OBJECT_NAME), 'foot');
 
-    rcube_add_label('checking');
+    $OUTPUT->add_label('checking');
     $OUTPUT->set_env('spellcheck_langs', join(',', $editor_lang_set));
   }
  
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index b7ef82c..a5ffb9d 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -69,18 +69,9 @@
     $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
 
   if (!$OUTPUT->ajax_call)
-    rcube_add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
+    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
 
   $OUTPUT->set_pagetitle(rcmail_localize_foldername($IMAP->get_mailbox_name()));
-  }
-else if ($RCMAIL->action == 'show')
-  {
-  // set current mailbox in client environment
-  $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name());
-  if ($CONFIG['trash_mbox'])
-    $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
-  if (!$OUTPUT->ajax_call)
-    rcube_add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
   }
 
 
@@ -99,7 +90,7 @@
   $sort_order = $_SESSION['sort_order'];
   
   // add some labels to client
-  rcube_add_label('from', 'to');
+  $OUTPUT->add_label('from', 'to');
 
   // get message headers
   $a_headers = $IMAP->list_headers('', '', $sort_col, $sort_order);
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 941c3cc..d8478d5 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -71,11 +71,16 @@
 
   // give message uid to the client
   $OUTPUT->set_env('uid', $MESSAGE->uid);
+  // set environement
   $OUTPUT->set_env('safemode', $MESSAGE->is_safe);
   $OUTPUT->set_env('sender', $MESSAGE->sender['string']);
   $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
   $OUTPUT->set_env('mailbox', $mbox_name);
-  
+  if ($CONFIG['trash_mbox'])
+    $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
+  if (!$OUTPUT->ajax_call)
+    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
+    
   // check for unset disposition notification
   if ($MESSAGE->headers->mdn_to &&
       !$MESSAGE->headers->mdn_sent &&
@@ -92,7 +97,7 @@
     }
     else if (empty($CONFIG['mdn_requests']))
     {
-      rcube_add_label('mdnrequest');
+      $OUTPUT->add_label('mdnrequest');
       $OUTPUT->set_env('mdn_request', true);
     }
   }
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index e98ce1b..6e8c6b5 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -30,7 +30,7 @@
   $no_override = is_array($config['dont_override']) ? array_flip($config['dont_override']) : array();
 
   // add some labels to client
-  rcube_add_label('nopagesizewarning');
+  $RCMAIL->output->add_label('nopagesizewarning');
   
   list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs');
   unset($attrib['form']);

--
Gitblit v1.9.1