| 10 |
* Implementation of hook_menu(). |
* Implementation of hook_menu(). |
| 11 |
*/ |
*/ |
| 12 |
function news_menu() { |
function news_menu() { |
| 13 |
return array( |
module_load_include('menu.inc', 'news', 'includes/news'); |
| 14 |
'send/news' => array( |
return news_menu_menu(); |
|
'title' => 'Send news', |
|
|
'page callback' => 'drupal_get_form', |
|
|
'page arguments' => array('news_form'), |
|
|
'access arguments' => array('send news'), |
|
|
'type' => MENU_NORMAL_ITEM, |
|
|
'file' => 'news.form.inc', |
|
|
'file path' => drupal_get_path('module', 'news') .'/includes', |
|
|
), |
|
|
'send/news/send' => array( |
|
|
'title' => 'Compose', |
|
|
'page callback' => 'drupal_get_form', |
|
|
'page arguments' => array('news_form'), |
|
|
'access arguments' => array('send news'), |
|
|
'type' => MENU_DEFAULT_LOCAL_TASK, |
|
|
'file' => 'news.form.inc', |
|
|
'file path' => drupal_get_path('module', 'news') .'/includes', |
|
|
'weight' => -10, |
|
|
), |
|
|
'send/news/list' => array( |
|
|
'title' => 'Lists', |
|
|
'page callback' => 'news_admin_lists', |
|
|
'access arguments' => array('administer mailing lists'), |
|
|
'type' => MENU_LOCAL_TASK, |
|
|
'file' => 'news.admin.inc', |
|
|
'file path' => drupal_get_path('module', 'news') .'/includes', |
|
|
), |
|
|
'send/news/%' => array( |
|
|
'title' => 'Send news', |
|
|
'page callback' => 'drupal_get_form', |
|
|
'page arguments' => array('news_form', 2), |
|
|
'access arguments' => array('send news'), |
|
|
'type' => MENU_CALLBACK, |
|
|
'file' => 'news.form.inc', |
|
|
'file path' => drupal_get_path('module', 'news') .'/includes', |
|
|
), |
|
|
); |
|
| 15 |
} |
} |
| 16 |
|
|
| 17 |
/** |
/** |
| 23 |
|
|
| 24 |
/** |
/** |
| 25 |
* Implementation of hook_elements(). |
* Implementation of hook_elements(). |
| 26 |
* Add a message element for the send form |
* Add a message element for the send form. |
| 27 |
*/ |
*/ |
| 28 |
function news_elements() { |
function news_elements() { |
| 29 |
return array( |
return array( |
| 32 |
'#process' => array('send_process'), |
'#process' => array('send_process'), |
| 33 |
'#after_build' => array('send_set_value'), |
'#after_build' => array('send_set_value'), |
| 34 |
), |
), |
|
'news_contact' => array( |
|
|
'#input' => TRUE, |
|
|
'#process' => array('send_process'), |
|
|
'#after_build' => array('send_set_value'), |
|
|
), |
|
| 35 |
); |
); |
| 36 |
} |
} |
| 37 |
|
|