You are here

function layouter_choose_layout_form in Layouter - WYSIWYG layout templates 7

Returns form for choose a template.

2 string references to 'layouter_choose_layout_form'
layouter_choose_layout in includes/layouter.pages.inc
Callback for layouter/%ctools_js/% path.
layouter_extension_example_form_alter in modules/layouter_extension_example/layouter_extension_example.module
Implements hook_form_alter().

File

includes/layouter.pages.inc, line 107
File with pages callbacks.

Code

function layouter_choose_layout_form($form, &$form_state) {
  $form_state['title'] = t('Layouter');
  $templates = layouter_templates();
  $options = array();
  foreach ($templates as $id => $template) {
    $options[$id] = $template['title'];
  }
  $form['type'] = array(
    '#title' => t('Choose the layout'),
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => $form_state['object']->type,
    '#required' => 1,
    '#after_build' => array(
      '_layouter_process_layout_type_radios',
    ),
  );
  $form['#attributes']['class'][] = 'layouter-form';
  $module_path = drupal_get_path('module', 'layouter');
  $form['#attached']['css'] = array(
    $module_path . '/theme/layouter.css',
  );
  $form['#attached']['js'] = array(
    $module_path . '/theme/layouter_inside.js',
  );
  $form['#attached']['js'][] = array(
    'data' => array(
      'layouter_modal_style' => variable_get('layouter_modal_style', 0),
    ),
    'type' => 'setting',
  );
  return $form;
}