| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Administration callbacks for the slider module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Form builder. Configure slider.
|
| 11 |
*
|
| 12 |
* @ingroup forms
|
| 13 |
* @see system_settings_form()
|
| 14 |
*/
|
| 15 |
function slider_admin_settings() {
|
| 16 |
// get an array of node types with internal names as keys
|
| 17 |
// and friendly names as values
|
| 18 |
$options = node_get_types('names');
|
| 19 |
|
| 20 |
// remove the node types that don't have a cck field called slider_content.
|
| 21 |
foreach ($options as $key => $val) {
|
| 22 |
$field = content_fields('field_slider_content', $key);
|
| 23 |
if ($field['type'] != 'nodereference') {
|
| 24 |
unset($options[$key]);
|
| 25 |
}
|
| 26 |
}
|
| 27 |
|
| 28 |
$form['slider_node_types'] = array(
|
| 29 |
'#type' => 'checkboxes',
|
| 30 |
'#title' => t('The following nodes will be converted to sliders.'),
|
| 31 |
'#options' => $options,
|
| 32 |
'#default_value' => variable_get('slider_node_types', array()),
|
| 33 |
'#description' => t('The node must have a nodereference CCK multifield called field_slider_content.'),
|
| 34 |
);
|
| 35 |
|
| 36 |
$form['slider_tabs_position'] = array(
|
| 37 |
'#type' => 'radios',
|
| 38 |
'#title' => t("The location of the tabs."),
|
| 39 |
'#options' => array(t('Above'), t('Below')),
|
| 40 |
'#default_value' => variable_get("slider_tabs_position", 0),
|
| 41 |
'#description' => t('Should the tabs display above or below the content?.'),
|
| 42 |
);
|
| 43 |
|
| 44 |
return system_settings_form($form);
|
| 45 |
}
|