You are here

function page_theme_admin_add in Page Theme 6

Same name and namespace in other branches
  1. 7.2 page_theme.admin.inc \page_theme_admin_add()
  2. 7 page_theme.admin.inc \page_theme_admin_add()

Menu callback; adds a theme.

1 string reference to 'page_theme_admin_add'
page_theme_menu in ./page_theme.module
Implementation of hook_menu().

File

./page_theme.admin.inc, line 119
Admin page callbacks for the page_theme module.

Code

function page_theme_admin_add() {
  $form = array();
  $form['theme'] = array(
    '#type' => 'select',
    '#title' => t('Theme'),
    '#description' => t('Choose which theme the page should display in.'),
    '#default_value' => '0',
    '#options' => page_theme_get_theme_options(),
    '#required' => TRUE,
  );
  $form['pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Pages'),
    '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
      '%blog' => 'blog',
      '%blog-wildcard' => 'blog/*',
      '%front' => '<front>',
    )),
    '#default_value' => '',
    '#required' => TRUE,
  );
  $form['status'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Status'),
    '#default_value' => array(
      'enabled',
    ),
    '#options' => array(
      'enabled' => t('Enabled'),
    ),
  );
  $form['weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
    '#default_value' => 0,
    '#delta' => 50,
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add theme'),
  );
  $form['actions']['cancel'] = array(
    '#value' => l(t('Cancel'), 'admin/build/page-theme'),
  );
  return $form;
}