function equalheights_admin in Equal Heights jQuery 7.2
Same name and namespace in other branches
- 6 equalheights.admin.inc \equalheights_admin()
- 7 equalheights.admin.inc \equalheights_admin()
Administration settings page.
1 string reference to 'equalheights_admin'
- equalheights_menu in ./
equalheights.module - Implements hook_menu().
File
- ./
equalheights.admin.inc, line 12 - Provides the administration page for Equal Heights.
Code
function equalheights_admin($form, $form_state) {
$form = array();
$form['equalheights_classes'] = array(
'#tree' => TRUE,
'#theme' => 'equalheights_classes',
);
// See how many rows there should be.
$classes = variable_get("equalheights_css_classes", array());
$rows_count = 0;
if (isset($form_state['rows_count'])) {
$rows_count = $form_state['rows_count'];
}
else {
$rows_count = count($classes) + 1;
}
for ($index = 0; $index < $rows_count; $index++) {
if (isset($classes[$index])) {
$setting = $classes[$index];
$form['equalheights_classes'][$index] = equalheights_settings_fields($setting);
}
else {
$form['equalheights_classes'][$index] = equalheights_settings_fields();
}
}
$form['more'] = array(
'#type' => 'submit',
'#value' => t('Add row'),
'#description' => t('Add a new row'),
'#submit' => array(
'equalheights_more_submit',
),
'#ajax' => array(
'callback' => 'equalheights_ajax',
'wrapper' => 'equalheights_wrapper',
'method' => 'replace',
'effect' => 'none',
),
);
$form['imagesloaded'] = array(
'#type' => 'checkbox',
'#description' => t('Load the minified version of the imagesloaded plugin for performance.'),
'#default_value' => variable_get('equalheights_imagesloaded_min', TRUE),
'#title' => t('Enable midisablenified imagesloaded plugin'),
);
$form['imagesloaded_ie8'] = array(
'#type' => 'checkbox',
'#description' => t('Disable imagesloaded plugin for <=Internet Explorer 8 (has been known to cause issues).'),
'#default_value' => variable_get('equalheights_imagesloaded_iele8', TRUE),
'#title' => t('Disable imagesloaded plugin for IE8 and earlier (recommended)'),
);
$form['save'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
);
return $form;
}