t('jWYSIWYG settings'), 'description' => t('Allows administrators to configure several options of this module'), 'page callback' => 'drupal_get_form', 'page arguments' => array('jwysiwyg_settings'), 'access arguments' => array(array('access administration pages', JWYSIWYG_PERM)), 'type' => MENU_NORMAL_ITEM, 'weight' => 0, ); return $items; } /////////////////////////////////////////////////////////////////////////////////////// // Implementation of hook_form_alter /////////////////////////////////////////////////////////////////////////////////////// function jwysiwyg_form_alter(&$form, $form_state, $form_id) { } function jwysiwyg_settings() { $form = array(); // Get the current settings $visibility = variable_get(JWYSIWYG_VISIBILITY, array()); $form[JWYSIWYG_VISIBILITY] = array( '#type' => 'fieldset', '#title' => t('Visibility settings'), '#tree' => TRUE, '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form[JWYSIWYG_VISIBILITY][JWYSIWYG_ACTION] = array( '#type' => 'radios', '#title' => t('Where to show the rich text editor?'), '#default_value' => isset($visibility[JWYSIWYG_ACTION]) ? $visibility[JWYSIWYG_ACTION] : JWYSIWYG_ACTION_DEFAULT, '#options' => array(0 => t('Show in each textarea'), 1 => t('Show in all text areas, except in the fields listed bellow'), 2 => t('Show only in the fields listed bellow')), '#description' => t("Choose where to include the jWYSIWYG rich text editor."), '#required' => TRUE, '#weight' => -4, ); $form[JWYSIWYG_VISIBILITY][JWYSIWYG_FIELDS] = array( '#type' => 'textarea', '#title' => t('Field names'), '#default_value' => isset($visibility[JWYSIWYG_FIELDS]) ? $visibility[JWYSIWYG_FIELDS] : '', '#description' => t("Type the name of a field by line, separating them with an enter."), '#required' => FALSE, '#weight' => -3, ); return system_settings_form($form); } /////////////////////////////////////////////////////////////////////////////////////// // Implementation of hook_help(). /////////////////////////////////////////////////////////////////////////////////////// function jwysiwyg_help($path, $arg) { } /////////////////////////////////////////////////////////////////////////////////////// // Implementation of hook_help(). /////////////////////////////////////////////////////////////////////////////////////// function jwysiwyg_perm() { return array(JWYSIWYG_PERM); }