1

I have a properly constructed set of data coming out of a call to system_settings_form(). How can I add to that data to display additional items on the form page?

I'm currently trying (and failing with):

// ...inside drupal_get_form callback
// $form has some form elements in it
$return =  system_settings_form($form);
if (!hay_problemas()){
    $return['warning'] = array(
        '#type' => 'div',
        '#class' => 'warning',
        '#markup' => 'WARNING:  Filesystem permission are broken'
    );
}
return $return;
1

I think this must be

// ...inside drupal_get_form callback
// $form has some form elements in it

if (!hay_problemas()){
  $form['warning'] = array(
    '#attributes' => array('class' => array('warning')),
    '#markup' => t('WARNING:  Filesystem permission are broken'),
    '#weight' => -10, //set position relative to other $form['key']
  );
}

return system_settings_form($form);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.