| 1 |
<?php // $Id: send.template.inc,v 1.3 2009/05/22 15:21:55 vauxia Exp $ |
<?php // $Id: send.template.inc,v 1.4 2009/05/22 17:18:35 vauxia Exp $ |
| 2 |
|
|
| 3 |
function send_template_load($stid) { |
function send_template_load($stid) { |
| 4 |
$template = db_fetch_object(db_query("SELECT * FROM {send_template} WHERE stid = %d", $stid)); |
$template = db_fetch_object(db_query("SELECT * FROM {send_template} WHERE stid = %d", $stid)); |
| 60 |
'#title' => t('Subject is editable'), |
'#title' => t('Subject is editable'), |
| 61 |
'#default_value' => $template->subject_editable, |
'#default_value' => $template->subject_editable, |
| 62 |
); |
); |
| 63 |
$build_modes = send_build_modes(); |
$build_modes = send_template_build_modes(); |
| 64 |
if (module_exists('token')) { |
if (module_exists('token')) { |
| 65 |
$build_modes[] = t("None, I'll add the node tokens myself"); |
$build_modes[] = t("None, I'll add the node tokens myself"); |
| 66 |
} |
} |
| 157 |
|
|
| 158 |
return $templates; |
return $templates; |
| 159 |
} |
} |
| 160 |
|
|
| 161 |
|
/** |
| 162 |
|
* A helper function returning a list of node build_modes. |
| 163 |
|
*/ |
| 164 |
|
function send_template_build_modes() { |
| 165 |
|
static $build_modes; |
| 166 |
|
if (!isset($build_modes)) { |
| 167 |
|
$build_modes = array(); |
| 168 |
|
|
| 169 |
|
// CCK is installed, use its hooks. |
| 170 |
|
if (function_exists('content_build_modes')) { |
| 171 |
|
foreach (content_build_modes() as $name => $info) { |
| 172 |
|
$build_modes[$name] = $info['title']; |
| 173 |
|
} |
| 174 |
|
} |
| 175 |
|
|
| 176 |
|
// Set generic defaults. |
| 177 |
|
else { |
| 178 |
|
$build_modes['teaser'] = t('Teaser'); |
| 179 |
|
$build_modes['full'] = t('Full node'); |
| 180 |
|
} |
| 181 |
|
} |
| 182 |
|
return $build_modes; |
| 183 |
|
} |
| 184 |
|
|