tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style'));
$out = '\n";
if (is_array($_SESSION['compose']['attachments']))
{
if ($attrib['deleteicon'])
$button = sprintf(' ',
$CONFIG['skin_path'],
$attrib['deleteicon'],
rcube_label('delete'));
else
$button = rcube_label('delete');
foreach ($_SESSION['compose']['attachments'] as $id => $a_prop)
$out .= sprintf('%s %s ',
$id,
$JS_OBJECT_NAME,
$id,
rcube_label('delete'),
$button,
rep_specialchars_output($a_prop['name']));
}
$OUTPUT->add_script(sprintf("%s.gui_object('attachmentlist', '%s');", $JS_OBJECT_NAME, $attrib['id']));
$out .= ' ';
return $out;
}
function rcmail_compose_attachment_form($attrib)
{
global $OUTPUT, $JS_OBJECT_NAME, $SESS_HIDDEN_FIELD;
// add ID if not given
if (!$attrib['id'])
$attrib['id'] = 'rcmUploadbox';
// allow the following attributes to be added to the tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style'));
$input_field = rcmail_compose_attachment_field(array());
$label_send = rcube_label('upload');
$label_close = rcube_label('close');
$out = <<
EOF;
$OUTPUT->add_script(sprintf("%s.gui_object('uploadbox', '%s');", $JS_OBJECT_NAME, $attrib['id']));
return $out;
}
function rcmail_compose_attachment_field($attrib)
{
// allow the following attributes to be added to the tag
$attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'size'));
$out = ' ";
return $out;
}
function rcmail_priority_selector($attrib)
{
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
$attrib['name'] = '_priority';
$selector = new select($attrib);
$selector->add(array(rcube_label('lowest'),
rcube_label('low'),
rcube_label('normal'),
rcube_label('high'),
rcube_label('highest')),
array(5, 4, 0, 2, 1));
$sel = isset($_POST['_priority']) ? $_POST['_priority'] : 0;
$out = $form_start ? "$form_start\n" : '';
$out .= $selector->show($sel);
$out .= $form_end ? "\n$form_end" : '';
return $out;
}
function rcmail_receipt_checkbox($attrib)
{
list($form_start, $form_end) = get_form_tags($attrib);
unset($attrib['form']);
if (!isset($attrib['id']))
$attrib['id'] = 'receipt';
$attrib['name'] = '_receipt';
$attrib['value'] = '1';
$checkbox = new checkbox($attrib);
$out = $form_start ? "$form_start\n" : '';
$out .= $checkbox->show(0);
$out .= $form_end ? "\n$form_end" : '';
return $out;
}
function rcmail_editor_selector($attrib)
{
global $CONFIG, $MESSAGE, $compose_mode;
$choices = array(
'html' => 'HTML',
'plain' => 'Plain text'
);
// determine whether HTML or plain text should be checked
if ($CONFIG['htmleditor'])
$useHtml = true;
else
$useHtml = false;
if ($compose_mode == RCUBE_COMPOSE_REPLY ||
$compose_mode == RCUBE_COMPOSE_FORWARD ||
$compose_mode == RCUBE_COMPOSE_DRAFT)
{
$hasHtml = rcmail_has_html_part($MESSAGE['parts']);
$useHtml = ($hasHtml && $CONFIG['htmleditor']);
}
$selector = '';
foreach ($choices as $value => $text)
{
$checked = '';
if ((($text == 'HTML') && $useHtml) ||
(($text != 'HTML') && !$useHtml))
$checked = 'checked';
$selector .= sprintf(" %s\n",
$value, $checked, $text);
}
return $selector;
}
function get_form_tags($attrib)
{
global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $MESSAGE_FORM, $SESS_HIDDEN_FIELD;
$form_start = '';
if (!strlen($MESSAGE_FORM))
{
$hiddenfields = new hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task']));
$hiddenfields->add(array('name' => '_action', 'value' => 'send'));
$form_start = empty($attrib['form']) ? '