function stylizer_ui::list_form
Overrides ctools_export_ui::list_form
File
-
stylizer/
plugins/ export_ui/ stylizer_ui.class.php, line 19
Class
- stylizer_ui
- UI class for Stylizer.
Code
public function list_form(&$form, &$form_state) {
ctools_include('stylizer');
parent::list_form($form, $form_state);
$all = array(
'all' => t('- All -'),
);
if (empty($this->base_types)) {
// Give a warning about the missing base styles.
drupal_set_message($this->plugin['strings']['message']['missing base type'], 'warning');
}
$types = $all;
foreach ($this->base_types as $module => $info) {
foreach ($info as $key => $base_type) {
$types[$module . '-' . $key] = $base_type['title'];
}
}
$form['top row']['type'] = array(
'#type' => 'select',
'#title' => t('Type'),
'#options' => $types,
'#default_value' => 'all',
'#weight' => -10,
'#attributes' => array(
'class' => array(
'ctools-auto-submit',
),
),
);
$plugins = ctools_get_style_bases();
$form_state['style_plugins'] = $plugins;
$options = $all;
// @todo base should use $module . '-' . $name
foreach ($plugins as $name => $plugin) {
$options[$name] = $plugin['title'];
}
$form['top row']['base'] = array(
'#type' => 'select',
'#title' => t('Base'),
'#options' => $all + $options,
'#default_value' => 'all',
'#weight' => -9,
'#attributes' => array(
'class' => array(
'ctools-auto-submit',
),
),
);
}