I trying to get the twitter_admin_form and twitter_user_settings form in a div.
/**
* Get twitter form for user
* @param $account
* @type user object
*/
function getTwitterForm($account){
//module_load_include('inc', 'twitter');
module_load_all();
$twitter_form = drupal_get_form('twitter_admin_form');
return $twitter_form;
}
I get a get a drupal error.
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'twitter_admin_form' was given in .../includes/form.inc on line 372.
twitter.module
/**
* Implementation of hook_meu()
*/
function twitter_menu() {
$items = array();$items['admin/settings/twitter'] = array(
'title' => 'Twitter setup',
'description' => 'Twitter module settings',
'page callback' => 'drupal_get_form',
'page arguments' => array('twitter_admin_form'),
'access arguments' => array('administer site configuration'),
'file' => 'twitter.pages.inc'
);$items['user/%user_category/edit/twitter'] = array(
'title' => 'Twitter accounts',
'page callback' => 'twitter_user_settings',
'page arguments' => array(1),
'access arguments' => array('add twitter accounts'),
'load arguments' => array('%map', '%index'),
'weight' => 10,
'file' => 'twitter.pages.inc',
'type' => MENU_LOCAL_TASK,
);return $items;
}
I'm not sure what I'm doing wrong. The twitter_admin_form doesn’t have any arguments hence I thought it would be simple to get and display.
I’m new forms/menu so I’m not 100% sure what %user_category, %map and %index are and how to pass them in.
How do you know what the valid forms are?