--- jquery_ui.module Wed Nov 10 15:52:26 2010 +++ jquery_ui.module Thu Dec 09 14:25:24 2010 @@ -1,136 +1,193 @@ - 'jQuery UI', + 'description' => 'Configure settings for jQuery UI module.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('jquery_ui_settings'), + 'access arguments' => array('administer site configuration'), + ); + return $items; +} + +/** + * Menu callback to display settings form. + */ +function jquery_ui_settings() { + $theme_path = jquery_ui_get_path() . '/themes'; + $options = array('base' => '<' . t('default') . '>'); + + $files = file_scan_directory($theme_path, '.*', array('.', '..', 'CVS', 'base', '.DS_Store'), 0, FALSE, 'basename'); + foreach ($files as $name => $file) { + $options[$name] = $name; + } + + $form['jquery_ui_theme'] = array( + '#type' => 'radios', + '#title' => t('Select jQuery UI theme'), + '#default_value' => variable_get('jquery_ui_theme', 'base'), + '#options' => $options, + ); + + return system_settings_form($form); +}