Ignore:
Timestamp:
Nov 11, 2011 10:04:45 AM (19 months ago)
Author:
alec
Message:
  • Apply fixes fom trunk up to r5414
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-0.7/program/steps/mail/show.inc

    r5274 r5415  
    151151} 
    152152 
    153 function rcmail_remote_objects_msg($attrib) 
     153function rcmail_remote_objects_msg() 
    154154{ 
    155155  global $MESSAGE, $RCMAIL; 
    156156 
    157   if (!$attrib['id']) 
    158     $attrib['id'] = 'rcmremoteobjmsg'; 
     157  $attrib['id']    = 'remote-objects-message'; 
     158  $attrib['class'] = 'notice'; 
     159  $attrib['style'] = 'display: none'; 
    159160 
    160161  $msg = Q(rcube_label('blockedimages')) . ' '; 
     
    169170  $RCMAIL->output->add_gui_object('remoteobjectsmsg', $attrib['id']); 
    170171  return html::div($attrib, $msg); 
     172} 
     173 
     174function rcmail_message_buttons() 
     175{ 
     176  global $MESSAGE, $RCMAIL, $CONFIG; 
     177 
     178  $mbox  = $RCMAIL->imap->get_mailbox_name(); 
     179  $delim = $RCMAIL->imap->get_hierarchy_delimiter(); 
     180  $dbox  = $CONFIG['drafts_mbox']; 
     181 
     182  // the message is not a draft 
     183  if ($mbox != $dbox && strpos($mbox, $dbox.$delim) !== 0) { 
     184    return ''; 
     185  } 
     186 
     187  $attrib['id']    = 'message-buttons'; 
     188  $attrib['class'] = 'notice'; 
     189 
     190  $msg = Q(rcube_label('isdraft')) . ' '; 
     191  $msg .= html::a(array('href' => "#edit", 'onclick' => JS_OBJECT_NAME.".command('edit')"), Q(rcube_label('edit'))); 
     192 
     193  return html::div($attrib, $msg); 
     194} 
     195 
     196function rcmail_message_objects($attrib) 
     197{ 
     198  global $RCMAIL, $MESSAGE; 
     199 
     200  if (!$attrib['id']) 
     201    $attrib['id'] = 'message-objects'; 
     202 
     203  $content = array( 
     204    rcmail_message_buttons(), 
     205    rcmail_remote_objects_msg(), 
     206  ); 
     207 
     208  $plugin = $RCMAIL->plugins->exec_hook('message_objects', 
     209    array('content' => $content, 'message' => $MESSAGE)); 
     210 
     211  $content = implode("\n", $plugin['content']); 
     212 
     213  return html::div($attrib, $content); 
    171214} 
    172215 
     
    190233  'messageattachments' => 'rcmail_message_attachments', 
    191234  'mailboxname' => 'rcmail_mailbox_name_display', 
    192   'blockedobjects' => 'rcmail_remote_objects_msg')); 
     235  'messageobjects' => 'rcmail_message_objects', 
     236)); 
    193237 
    194238 
Note: See TracChangeset for help on using the changeset viewer.