Drupal Questions & Answers

Ask and answer Drupal related questions! No question too simple or complex!
runeveryday's picture
Asked by on Sat 10th Jul 2010
how to write the function return?

function annotate_menu() {

$items['admin/settings/annotate'] = array(

'title' => 'Annotation settings',

'description' => 'Change how annotations behave.',

'page callback' => 'drupal_get_form','

page arguments' => array('annotate_admin_settings'),

'access arguments' => array('administer site configuration'),

'type' => MENU_NORMAL_ITEM,

'file' => 'annotate.admin.inc',);

return $items;}

function annotate_admin_settings() {

$options = node_get_types('names');

$form['annotate_node_types'] = array(

'#type' => 'checkboxes',

'#title' => t('Users may annotate these content types'),

'#options' => $options,

'#default_value' => variable_get('annotate_node_types', array('page')),'

#description' => t('A text field will be available on these content types tomake user-specific notes.'),);

return system_settings_form($form);
}

the above are two functions and each have a return value. but the return value are all irregularly, the return line are “return $items” and “return system_settings_form($form)”, do i can instead of it using others?
eg:return system_settings_form($form)”, i use this “return $form”, to place of it.

Commenting on this Drupal Question is closed.