You are here

function activeedit_theme_assist_form in Javascript Tools 5

Menu callback. Render a form with sample theme overrides.

1 string reference to 'activeedit_theme_assist_form'
activeedit_theme_assist_menu in activeedit/activeedit_theme_assist/activeedit_theme_assist.module
Implementation of hook_menu().

File

activeedit/activeedit_theme_assist/activeedit_theme_assist.module, line 23

Code

function activeedit_theme_assist_form() {
  $form = array();
  $text = "function activeedit_theme_data() {\n";
  $text .= '  $selectors = array();' . "\n";
  $text .= "\n";
  $elements = activeedit_get_targets('elements', FALSE, TRUE);
  foreach ($elements as $id => $element) {
    if (isset($element['#title']) && $element['#title']) {
      $text .= '  // ' . t('Selector for @title', array(
        '@title' => $element['#title'],
      )) . ".\n";
    }
    $text .= '  $selectors[\'' . $id . '\'] = \'' . $element['#selector'] . '\';' . "\n";
  }
  $text .= "\n";
  $text .= '  return $selectors;' . "\n";
  $text .= "}\n";
  $form['activeedit_theme_assist_tabs_mode'] = array(
    '#type' => 'textarea',
    '#title' => t('Sample theme override'),
    '#default_value' => $text,
    '#rows' => 25,
    '#description' => t('This is a sample theme override, showing all the available elements and their default selectors. To convert this into theme override file, save it as themename.inc, where themename is the name of your theme, in the Active Edit module\'s theme directory. Then edit the file to reflect the selectors for your theme. If the selectors are the same as the defaults, you can delete their lines.'),
  );
  return $form;
}