By mpapet on
This is sort of working code snippet where I'm trying to create a custom node that is 90% display, 10% interactive. For the 10%, I'm trying to use Drupal's api. Except, the form part of my custom node doesn't render anything. I'm pretty sure I'm not accessing the API right.
function grumbler_admin_menu() {
// This is the minimum information you can provide for a menu item.
$items['adminServer'] = array(
'title' => 'Administer The Server',
'page callback' => 'grumbler_admin',
'access arguments' => array('admin server'),
);
return $items;
}
function grumbler_admin() {
//bunch of php code that isn't relevant to the problem
$status = "<p>The quick brown fox is running ".$is_running."</p> \n";
$results = array(
'#title' => t('Status'),
'#type' => 'textfield',
'#description' => t('Is the server running?'),
'#default' => t('<p>'.$status.'<p>'),
'#disabled' => TRUE,
);
return $results;
}
When I click on the 'Administer the Server' in the menu, I get a blank page with the word 'array' and that's all. I want the textfield to appear. Any advice is welcome, even if it's painfully obvious to most.
Thanks.
Comments
try 'page callback' =>
try
'page callback' => 'drupal_get_form',
'page arguments' => array('grumbler_admin'),
Alan Davison
Thanks Alan! That's the trick
Thanks Alan!
That's the trick I needed! :-)
(I have post a "duplicate" question in the forum today: I wouldn't expect this title would lead to the same question/answer!!!)
Regards,
Sergio
lol, the title was the only
lol, the title was the only reason I read the thread! I was looking for i18n topics
;)
Alan Davison