You are here

function title_override_config_edit_form in Title Override 7.2

Provides form for overriding H1 titles

_state

Parameters

unknown_type $form:

unknown_type $context:

1 string reference to 'title_override_config_edit_form'
title_override_menu in ./title_override.module
Implements hook_menu()

File

./title_override.admin.inc, line 108
Admin page implementations for Title Override.

Code

function title_override_config_edit_form($form, &$form_state, $context) {
  $form_state['to_title_override']['context'] = $context;
  $form = array();
  $form['paths'] = array(
    '#title' => 'Path',
    '#description' => 'Set this title context when any of the paths above match the page path. Put each path on a separate line. You can use the <code>*</code> character (asterisk) as a wildcard and the <code>~</code> character (tilde) to exclude one or more paths. Use &lt;front&gt; for the site front page.',
    '#type' => 'textarea',
    '#default_value' => isset($context->conditions['path']['values']) ? html_entity_decode(implode('&#13;&#10;', $context->conditions['path']['values'])) : '',
    '#required' => 1,
    '#weight' => -100,
  );
  $form['title'] = array(
    '#title' => t('Title tag'),
    '#description' => t('Overrides the H1 title'),
    '#type' => 'textfield',
    '#maxlength' => 400,
    '#default_value' => isset($context->reactions['title_override']['title']) ? $context->reactions['title_override']['title'] : '',
  );
  $form['tokens'] = array(
    '#theme' => 'token_tree',
  );
  $form['actions']['#type'] = 'actions';
  $form['actions']['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['actions']['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
    '#submit' => array(
      'title_override_config_edit_form_cancel_submit',
    ),
    '#limit_validation_errors' => array(),
  );
  $form['#submit'][] = 'title_override_config_edit_form_submit';
  return $form;
}