2 function jsdemo2_admin_settings() {
3 $form['jsdemo2_author_max']=array(
4 '#type' => 'textfield',
5 '#title' => t('Maximum authors to display'),
6 '#default_value' => variable_get('jsdemo2_author_max', 10),
11 $form['jsdemo2_source_max']=array(
12 '#type' => 'textfield',
13 '#title' => t('Maximum sources to display'),
14 '#default_value' => variable_get('jsdemo2_source_max', 16),
19 $form['jsdemo2_subject_max']=array(
20 '#type' => 'textfield',
21 '#title' => t('Maximum subjects to display'),
22 '#default_value' => variable_get('jsdemo2_subject_max', 10),
27 return system_settings_form($form);
30 function jsdemo2_admin_settings_validate($form, $form_state) {
31 if (!is_numeric($form_state['values']['jsdemo2_source_max'])) {
32 form_set_error('jsdemo2_source_max', t('Please enter a number.'));
34 if (!is_numeric($form_state['values']['jsdemo2_author_max'])) {
35 form_set_error('jsdemo2_author_max', t('Please enter a number.'));
37 if (!is_numeric($form_state['values']['jsdemo2_subject_max'])) {
38 form_set_error('jsdemo2_subject_max', t('Please enter a number.'));