function tweet_admin in Tweet 5
Same name and namespace in other branches
- 5.2 tweet.module \tweet_admin()
- 6.4 tweet.admin.inc \tweet_admin()
- 6.2 tweet.admin.inc \tweet_admin()
- 6.3 tweet.admin.inc \tweet_admin()
- 7.4 tweet.admin.inc \tweet_admin()
Settings page.
1 string reference to 'tweet_admin'
- tweet_menu in ./
tweet.module - Implementation of hook_menu().
File
- ./
tweet.module, line 189 - Builds links to post pages to twitter.
Code
function tweet_admin() {
$form['node_type'] = array(
'#type' => 'select',
'#title' => t('Type of link to show on nodes'),
'#default_value' => variable_get('tweet_node', 'icon'),
'#options' => array(
'icon' => 'icon',
'icon_text' => 'icon_text',
'text' => 'text',
'none' => 'none',
),
);
$form['teaser_type'] = array(
'#type' => 'select',
'#title' => t('Type of link to show on teasers'),
'#default_value' => variable_get('tweet_teaser', 'none'),
'#options' => array(
'icon' => 'icon',
'icon_text' => 'icon_text',
'text' => 'text',
'none' => 'none',
),
);
$node_types = variable_get('tweet_types', array());
//If all types are selected, un-select them, because the system will still save the result as all selected and it looks better.
if ($node_types == _tweet_node_types()) {
$node_types = array();
}
$form['types'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('Node types on which to display link'),
'#description' => t('If no types are selected, the link will appear on all types. To stop links from appearing on any nodes, choose "none" in one of the options above.'),
'#default_value' => $node_types,
'#options' => _tweet_node_types(),
);
$form['title'] = array(
'#type' => 'select',
'#title' => t('Include page title in tweet'),
'#default_value' => variable_get('tweet_title', 1),
'#options' => array(
1 => 'Yes',
0 => 'No',
),
);
return system_settings_form($form);
}