Changeset 1344 in subversion for trunk/roundcubemail/program/steps/mail/compose.inc
- Timestamp:
- Apr 30, 2008 4:21:42 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/compose.inc
r1315 r1344 27 27 28 28 // remove an attachment 29 if ($ _action=='remove-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_POST['_file'], $regs))29 if ($RCMAIL->action=='remove-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_POST['_file'], $regs)) 30 30 { 31 31 $id = $regs[1]; … … 40 40 } 41 41 42 if ($ _action=='display-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_GET['_file'], $regs))42 if ($RCMAIL->action=='display-attachment' && preg_match('/^rcmfile([0-9]+)$/', $_GET['_file'], $regs)) 43 43 { 44 44 $id = $regs[1]; … … 338 338 function rcmail_compose_body($attrib) 339 339 { 340 global $ CONFIG, $OUTPUT, $MESSAGE, $compose_mode;340 global $RCMAIL, $CONFIG, $OUTPUT, $MESSAGE, $compose_mode; 341 341 342 342 list($form_start, $form_end) = get_form_tags($attrib); … … 411 411 } 412 412 413 $tinylang = substr($_SESSION[' user_lang'], 0, 2);413 $tinylang = substr($_SESSION['language'], 0, 2); 414 414 if (!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js')) 415 415 { … … 456 456 "googie.decorateTextarea('%s');\n". 457 457 "%s.set_env('spellcheck', googie);", 458 $ GLOBALS['COMM_PATH'],458 $RCMAIL->comm_path, 459 459 JQ(Q(rcube_label('checkspelling'))), 460 460 JQ(Q(rcube_label('resumeediting'))), … … 463 463 JQ(Q(rcube_label('nospellerrors'))), 464 464 $lang_set, 465 substr($_SESSION[' user_lang'], 0, 2),465 substr($_SESSION['language'], 0, 2), 466 466 $attrib['id'], 467 467 JS_OBJECT_NAME), 'foot'); … … 705 705 function rcmail_compose_attachment_form($attrib) 706 706 { 707 global $OUTPUT , $SESS_HIDDEN_FIELD;707 global $OUTPUT; 708 708 709 709 // add ID if not given … … 711 711 $attrib['id'] = 'rcmUploadbox'; 712 712 713 // allow the following attributes to be added to the <div> tag 714 $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style')); 715 $input_field = rcmail_compose_attachment_field(array()); 716 $label_send = rcube_label('upload'); 717 $label_close = rcube_label('close'); 718 $js_instance = JS_OBJECT_NAME; 719 720 $out = <<<EOF 721 <div$attrib_str> 722 <form action="./" method="post" enctype="multipart/form-data"> 723 $SESS_HIDDEN_FIELD 724 $input_field<br /> 725 <input type="button" value="$label_close" class="button" onclick="document.getElementById('$attrib[id]').style.visibility='hidden'" /> 726 <input type="button" value="$label_send" class="button" onclick="$js_instance.command('send-attachment', this.form)" /> 727 </form> 728 </div> 729 EOF; 730 713 $button = new html_inputfield(array('type' => "button", 'class' => "button")); 714 715 $out = html::div($attrib, 716 $OUTPUT->form_tag(array('name' => "form", 'method' => "post")) . 717 rcmail_compose_attachment_field(array()) . html::br() . 718 $button->show(rcube_label('close'), array('onclick' => "document.getElementById('$attrib[id]').style.visibility='hidden'")) . 719 $button->show(rcube_label('upload'), array('onclick' => JS_OBJECT_NAME . ".command('send-attachment', this.form)")) 720 ); 721 731 722 732 723 $OUTPUT->add_gui_object('uploadbox', $attrib['id']); … … 844 835 function get_form_tags($attrib) 845 836 { 846 global $ CONFIG, $OUTPUT, $MESSAGE_FORM, $SESS_HIDDEN_FIELD;837 global $RCMAIL, $MESSAGE_FORM; 847 838 848 839 $form_start = ''; 849 840 if (!strlen($MESSAGE_FORM)) 850 841 { 851 $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $ GLOBALS['_task']));842 $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); 852 843 $hiddenfields->add(array('name' => '_action', 'value' => 'send')); 853 844 854 $form_start = empty($attrib['form']) ? '<form name="form" action="./" method="post">' : ''; 855 $form_start .= "\n$SESS_HIDDEN_FIELD\n"; 845 $form_start = empty($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : ''; 856 846 $form_start .= $hiddenfields->show(); 857 847 } … … 861 851 862 852 if (!strlen($MESSAGE_FORM)) 863 $ OUTPUT->add_gui_object('messageform', $form_name);853 $RCMAIL->output->add_gui_object('messageform', $form_name); 864 854 865 855 $MESSAGE_FORM = $form_name;
Note: See TracChangeset
for help on using the changeset viewer.
