'markup',
'#value' => '
'. t('You cannot send more than %number messages per hour. Please try again later.', array('%number' => $print_mail_hourly_threshold)) .'
',
);
return $form;
}
$print_mail_teaser_default = variable_get('print_mail_teaser_default', PRINT_MAIL_TEASER_DEFAULT_DEFAULT);
$print_mail_teaser_choice = variable_get('print_mail_teaser_choice', PRINT_MAIL_TEASER_CHOICE_DEFAULT);
$form = array();
// Remove the printmail/ prefix
$path = explode('/', $_GET['q']);
unset($path[0]);
$path = implode('/', $path);
if (is_numeric($path)) {
$path = 'node/'. $path;
}
$cid = isset($_GET['comment']) ? $_GET['comment'] : NULL;
$form['path'] = array('#type' => 'value', '#value' => $path);
$forn['cid'] = array('#type' => 'value', '#value' => $cid);
$form['fld_from_addr'] = array(
'#type' => 'textfield',
'#title' => t('Your e-mail'),
'#size' => 62,
);
$form['fld_from_name'] = array(
'#type' => 'textfield',
'#title' => t('Your name'),
'#size' => 62,
);
$form['txt_to_addrs'] = array(
'#type' => 'textarea',
'#title' => t('Send to'),
'#rows' => 3,
'#resizable' => FALSE,
'#description' => t('Enter multiple addresses separated by commas and/or different lines.'),
);
$form['fld_subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#size' => 62,
);
$form['txt_message'] = array(
'#type' => 'textarea',
'#title' => t('Your message'),
'#rows' => 6,
);
if ($print_mail_teaser_choice) {
$form['chk_teaser'] = array(
'#type' => 'checkbox',
'#title' => t('Send only the teaser'),
'#default_value' => $print_mail_teaser_default,
);
}
else {
$form['chk_teaser'] = array('#type' => 'value', '#value' => $print_mail_teaser_default);
}
$form['btn_submit'] = array(
'#type' => 'submit',
'#value' => t('Send e-mail'),
);
$form['btn_clear'] = array(
'#type' => 'submit',
'#value' => t('Clear form'),
'#validate' => array('print_mail_form_reset'),
);
$form['btn_cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel'),
'#validate' => array(),
'#submit' => array('print_mail_form_cancel'),
);
if ($user->uid != 0) {
$user_name = $user->name;
$form['fld_from_addr']['#default_value'] = $user->mail;
$form['fld_from_addr']['#disabled'] = TRUE;
$form['fld_from_addr']['#value'] = $user->mail;
$form['fld_from_name']['#default_value'] = $user->name;
}
else {
$user_name = t('Someone');
}
$site_name = variable_get('site_name', t('an interesting site'));
$form['fld_subject']['#default_value'] = t('!user has sent you a message from !site',
array('!user' => $user_name, '!site' => $site_name));
return $form;
}
function theme_print_mail_form($form) {
drupal_add_css(drupal_get_path('module', 'print') .'/printlinks.css');
$content = '';
foreach (element_children($form) as $key) {
$tmp = drupal_render($form[$key]);
switch ($key) {
case 'fld_from_addr':
case 'fld_from_name':
case 'txt_to_addrs':
case 'fld_subject':
$tmp = str_replace('