You are here

function _nodewords_form in Nodewords: D6 Meta Tags 5

Create a form - returns a $form variable

2 calls to _nodewords_form()
nodewords_form_alter in ./nodewords.module
Implementation of hook_form_alter().
nodewords_frontpage_form in ./nodewords.module
Menu callback: front page settings form.

File

./nodewords.module, line 688
Assign META tags to nodes, vocabularies, terms and pages.

Code

function _nodewords_form($type, $tags, $expanded = FALSE) {
  $settings = _nodewords_get_settings();
  $form = array();
  foreach (_nodewords_get_possible_tags() as $tag) {
    $function = _nodewords_get_builtin_function($tag, 'form');
    if ($settings['edit'][$tag] && function_exists($function)) {
      $element = $function($type, $tags[$tag], $settings);
      if ($element) {
        $form[$tag] = $element;
      }
    }
  }
  if (!empty($form)) {
    $form['#type'] = 'fieldset';
    $form['#title'] = t('Meta tags');
    $form['#tree'] = TRUE;
    $form['#collapsible'] = TRUE;
    $form['#collapsed'] = empty($tags) && !$expanded;
    $form['#weight'] = 20;
  }
  return $form;
}