responsive_navigation_admin.inc in Responsive Navigation 7
File
responsive_navigation_admin.inc
View source
<?php
include_once 'responsive_navigation_common.inc';
function responsive_navigation_admin_settings($form, &$form_state) {
$form['responsive_navigation_number'] = array(
'#type' => 'select',
'#description' => '<b>' . t('NOTE: responsive-nav.js only supports one navigation menu. This setting will be increased when responsive-nav.js supports more than one.') . '</b><br />' . t('Enter the total number of independent Responsive Navigation menu blocks you want. Enter a number between 0 and 1. If you set this to 0, you will have no blocks created but you can still use the !rnjs theme functions and Javascript/CSS directly in your theme.', array(
'!rnjs' => l(RNJS_MAIN_JS, RNJS_SITE_URL),
)),
'#default_value' => variable_get('responsive_navigation_number', '1'),
'#options' => drupal_map_assoc(range(0, 1)),
'#size' => 1,
);
$form['#validate'][] = 'responsive_navigation_settings_validate';
return system_settings_form($form);
}
function responsive_navigation_settings_validate($form, &$form_state) {
$number = $form_state['values']['responsive_navigation_number'];
if (!is_numeric($number) || strlen($number) > 2) {
form_set_error('responsive_navigation_number', t('You must enter a number from 0 to 99.'));
}
}