| 1 |
|
<?php |
| 2 |
|
// $Id: bot.module,v 1.9.2.9 2007/06/29 02:38:43 morbus Exp $ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* @file |
| 6 |
|
* Admin page callbacks for the Bot module. |
| 7 |
|
*/ |
| 8 |
|
|
| 9 |
|
/** |
| 10 |
|
* Configures the bot framework; system_settings_form(). |
| 11 |
|
*/ |
| 12 |
|
function bot_settings() { |
| 13 |
|
$form = array(); |
| 14 |
|
|
| 15 |
|
$form['bot_server'] = array( |
| 16 |
|
'#default_value' => variable_get('bot_server', 'irc.freenode.net'), |
| 17 |
|
'#description' => t('Enter the IRC server the bot will connect to.'), |
| 18 |
|
'#title' => t('IRC server'), |
| 19 |
|
'#type' => 'textfield', |
| 20 |
|
); |
| 21 |
|
$form['bot_server_port'] = array( |
| 22 |
|
'#default_value' => variable_get('bot_server_port', 6667), |
| 23 |
|
'#description' => t('Enter the IRC port of the IRC server. 6667 is the most common configuration.'), |
| 24 |
|
'#title' => t('IRC server port'), |
| 25 |
|
'#type' => 'textfield', |
| 26 |
|
); |
| 27 |
|
$form['bot_nickname'] = array( |
| 28 |
|
'#default_value' => variable_get('bot_nickname', 'bot_module'), |
| 29 |
|
'#description' => t('Enter the nickname the bot will login as.'), |
| 30 |
|
'#title' => t('Bot nickname'), |
| 31 |
|
'#type' => 'textfield', |
| 32 |
|
); |
| 33 |
|
$form['bot_password'] = array( |
| 34 |
|
'#default_value' => variable_get('bot_password', ''), |
| 35 |
|
'#description' => t('(Optional) Enter the password the bot will login to the server with.'), |
| 36 |
|
'#title' => t('Bot password'), |
| 37 |
|
'#type' => 'textfield', |
| 38 |
|
); |
| 39 |
|
$form['bot_channels'] = array( |
| 40 |
|
'#default_value' => variable_get('bot_channels', '#test'), |
| 41 |
|
'#description' => t('Enter a comma-separated list of channels the bot will join. For channels with a key, use "<#channel> <key>".'), |
| 42 |
|
'#rows' => 3, |
| 43 |
|
'#title' => t('Bot channels'), |
| 44 |
|
'#type' => 'textarea', |
| 45 |
|
); |
| 46 |
|
$form['bot_debugging'] = array( |
| 47 |
|
'#default_value' => variable_get('bot_debugging', 0), // spits out a TON of (useful) stuff. |
| 48 |
|
'#description' => t('If checked, send Net_SmartIRC\'s SMARTIRC_DEBUG_ALL to the shell.'), |
| 49 |
|
'#options' => array('0' => t('No'), '1' => t('Yes')), |
| 50 |
|
'#title' => t('Enable debugging'), |
| 51 |
|
'#type' => 'checkbox', |
| 52 |
|
); |
| 53 |
|
|
| 54 |
|
return system_settings_form($form); |
| 55 |
|
} |