function flickr_context_tags_settings()
{
    $form = array();
    $mt_ns = variable_get('flickr_context_tags_mech_namespace', '');
    //Make a qualified guess
    if (empty($mt_ns)) {
        $matches = array();
        $site_name = variable_get('site_name', '');
        if (preg_match('/^\\s*([^\\s\\.]+)/', $site_name, $matches)) {
            $mt_ns = drupal_strtolower($matches[1]);
        }
    }
    $form['flickr_context_tags_mech_namespace'] = array('#type' => 'textfield', '#title' => t('Machine-tag namespace'), '#default_value' => $mt_ns);
    $form['flickr_context_tags_userid'] = array('#type' => 'textfield', '#title' => t('Flickr id'), '#description' => t('Can be used to get photos from a specified flickr user'), '#default_value' => variable_get('flickr_context_tags_userid', ''));
    $form['flickr_context_tags_default_place_id'] = array('#type' => 'textfield', '#title' => t('Default place id'), '#description' => t('The default place id can be used to keep the flickr pictures relevant'), '#default_value' => variable_get('flickr_context_tags_default_place_id', ''));
    $form['flickr_context_tags_force_default_place_id'] = array('#type' => 'checkbox', '#title' => t('Always use the default place id'), '#default_value' => variable_get('flickr_context_tags_force_default_place_id', FALSE));
    $sizes = array('s' => t('Square'), 't' => t('Thumbnail'), 'm' => t('Small'), '-' => t('Medium'), 'b' => t('Large'), 'o' => t('Orginal'));
    $form['flickr_context_tags_size'] = array('#type' => 'select', '#title' => t('Select the size you want your photos in'), '#default_value' => variable_get('flickr_context_tags_size', 'm'), '#options' => $sizes);
    // Tag configuration textarea
    $paths = variable_get('flickr_context_tags_contexts', array());
    $form['flickr_context_tags_contexts'] = array('#type' => 'textarea', '#title' => t('Context tags for paths'), '#default_value' => flickr_context_tags_pack_contexts($paths), '#description' => t('Enter the path expression followed by a list of comma-separated tags'));
    // Piggyback on the system settings form for buttons and so on
    $form = system_settings_form($form);
    // ...but replace the #submit function
    $form['#submit'] = array('flickr_context_tags_settings_submit');
    return $form;
}
/**
 * @file
 * Admin functions for simple geo
 */
function simple_geo_settings()
{
    $form = array();
    $form['position_set'] = array('#type' => 'fieldset', '#title' => t('Default position'), '#after_build' => array('simple_geo_add_form_js'));
    $form['position_set']['simple_geo_default_position'] = array('#type' => 'textfield', '#title' => t('Coordinates'), '#default_value' => variable_get('simple_geo_default_position', ''), '#prefix' => '<div class="map-placeholder"></div><div id="edit-simple-geo-position-wrapper">', '#suffix' => '</div>', '#attributes' => array('id' => 'edit-simple-geo-position'));
    $form['user_set'] = array('#type' => 'fieldset', '#title' => t('Users'));
    $form['user_set']['simple_geo_position_users'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_position_users', 1), '#title' => t('Enable user positioning'));
    $form['user_set']['simple_geo_search_address'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_search_address', 1), '#title' => t('Enable "Search for address" field'));
    $form['user_set']['simple_geo_search_address_icon'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_search_address_icon', 1), '#title' => t('Enable marker icon for search result'));
    $form['node_set'] = array('#type' => 'fieldset', '#title' => t('Node rendering'));
    $form['node_set']['simple_geo_show_map_link'] = array('#type' => 'select', '#title' => t('Show map links for nodes'), '#options' => array('always' => t('Always'), 'teaser' => t('In teaser'), 'full' => t('When viewing full node'), 'never' => t('Never')), '#default_value' => variable_get('simple_geo_show_map_link', 'always'));
    $form['node_set']['simple_geo_add_microformat_tag'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_add_microformat_tag', 1), '#title' => t('Show microformat tag for node positions'));
    $form['micromap_set'] = array('#type' => 'fieldset', '#title' => t('Micromap'));
    $form['micromap_set']['simple_geo_use_microformat_map'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_use_microformat_map', 1), '#title' => t('Use map to display microformat positions'));
    $form['micromap_set']['simple_geo_micromap_parent'] = array('#type' => 'textfield', '#default_value' => variable_get('simple_geo_micromap_parent', '#main-inner'), '#title' => t('Parent element'), '#description' => t('The jQuery expression that should be used to find the micromap parent'));
    $form['micromap_set']['simple_geo_use_microformat_map'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_use_microformat_map', 1), '#title' => t('Use map to display microformat positions'));
    $form['micromap_set']['simple_geo_micromap_add_mode'] = array('#type' => 'select', '#title' => t('Add method'), '#options' => array('prepend' => t('Prepend'), 'append' => t('Append')), '#default_value' => variable_get('simple_geo_micromap_add_mode', 'prepend'));
    $form['micromap_set']['simple_geo_geocoding_suffix'] = array('#type' => 'textfield', '#default_value' => variable_get('simple_geo_geocoding_suffix', ''), '#title' => t('Geocoding suffix'), '#description' => t('Any suffix entered here will be appended to the address with a separating comma before a geocoding lookup is performed'));
    $array = drupal_map_assoc(range(1, 17));
    $form['micromap_set']['simple_geo_max_zoom'] = array('#type' => 'select', '#title' => t('Max zoom level'), '#options' => $array, '#default_value' => variable_get('simple_geo_max_zoom', 14), '#description' => t('This affects only the zoom level that\'s automatically chosen by the micromap'));
    $form['micromap_set']['simple_geo_min_zoom'] = array('#type' => 'select', '#title' => t('Minimum zoom level'), '#options' => $array, '#default_value' => variable_get('simple_geo_min_zoom', 1), '#description' => t('This affects only the zoom level that\'s automatically chosen by the micromap'));
    $form['google'] = array('#type' => 'fieldset', '#title' => t('Google maps'), '#description' => t('Google Maps must be configured for most of the simple_geo functionality'));
    $form['google']['simple_geo_manually_load'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_manually_load', 1), '#title' => t('Automatically load Google Maps scripts'));
    $form['google']['gmaps_api_key'] = array('#type' => 'textfield', '#default_value' => variable_get('gmaps_api_key', ''), '#title' => t('Your google maps api key'));
    $form['google']['simple_geo_add_google_jsapi'] = array('#type' => 'checkbox', '#default_value' => variable_get('simple_geo_add_google_jsapi', 1), '#title' => t('Add the Google AJAX API Loader to the page'), '#description' => t('Adds a script tag that loads the Google AJAX API Loader from Google. Disable this if another module or theme already handles this'));
    return system_settings_form($form);
}
/**
 * Form callback for "admin/config/administration/local_storage".
 */
function local_storage_admin_form($form, &$form_state)
{
    $form['local_storage_enable'] = array('#type' => 'checkbox', '#title' => t('Enable Local Storage'), '#description' => t('Enable automatic storing of entered data for all new fields by default.'), '#default_value' => variable_get('local_storage_enable', 0));
    $form['local_storage_default'] = array('#type' => 'checkbox', '#title' => t('Show default (original) value by default'), '#description' => t('Show default (original) value by default for all new fields by default.'), '#default_value' => variable_get('local_storage_default', 0));
    $form['local_storage_expire'] = array('#type' => 'select', '#options' => drupal_map_assoc(range(1, 48)), '#title' => t('Expiration time'), '#description' => t('Set default expiration time for stored data (in hours).'), '#default_value' => variable_get('local_storage_expire', 48));
    return system_settings_form($form);
}
Example #4
0
function os_poker_admin_form($form_state)
{
    $os_poker_abuse_mail_to = variable_get('os_poker_abuse_mail_to', 1);
    if (is_numeric($os_poker_abuse_mail_to)) {
        $os_poker_abuse_mail_to = user_load($os_poker_abuse_mail_to)->mail;
    }
    $form = array('email_addresses' => array('#type' => 'fieldset', '#title' => t('Email addresses'), '#description' => t('Email addresses used when sending email.'), 'os_poker_abuse_mail_to' => array('#type' => 'textfield', '#title' => t('Abuse reports receiver address'), '#description' => t('The email address abuse reports are sent to.'), '#default_value' => isset($form_state['values']['os_poker_abuse_mail_to']) ? $form_state['values']['os_poker_abuse_mail_to'] : $os_poker_abuse_mail_to), 'os_poker_support_mail' => array('#type' => 'textfield', '#title' => t('Support address'), '#description' => t("The support email address used in mails' body."), '#default_value' => isset($form_state['values']['os_poker_support_mail']) ? $form_state['values']['os_poker_support_mail'] : _os_poker_support_mail())), 'welcome_email' => array('#type' => 'fieldset', '#title' => t('Welome Email'), '#description' => t('Welcome email sent to user after first profile'), 'os_poker_mail_welcome_subject' => array('#type' => 'textfield', '#title' => t('Email Subject'), '#description' => t(''), '#default_value' => _os_poker_mail_text('welcome_subject')), 'os_poker_mail_welcome_body' => array('#type' => 'textarea', '#title' => t('Email Body'), '#description' => t(''), '#default_value' => _os_poker_mail_text('welcome_body'))), 'daily_gift_email' => array('#type' => 'fieldset', '#title' => t('Free Chips Email'), '#description' => t('Notification email sent when the user receive the Daily Gift from a budy'), 'os_poker_mail_daily_chips_subject' => array('#type' => 'textfield', '#title' => t('Email Subject'), '#description' => t(''), '#default_value' => _os_poker_mail_text('daily_gift_subject')), 'os_poker_mail_daily_chips_body' => array('#type' => 'textarea', '#title' => t('Email Body'), '#description' => t(''), '#default_value' => _os_poker_mail_text('daily_gift_body'))));
    return system_settings_form($form);
}
/**
 * Formulaire de config multilingue, drupal 7
 * @return mixed
 */
function pdt_cookie_consent_form()
{
    $form = array();
    $languages = language_list();
    foreach ($languages as $language) {
        $lang = $language->language;
        $form[$lang] = array('#type' => "fieldset", '#title' => "Configuration pour le language " . $lang);
        $form[$lang]["pdt_cookie_consent_message_{$lang}"] = array('#title' => 'Message', '#type' => 'textfield', '#description' => '', '#default_value' => variable_get("pdt_cookie_consent_message_{$lang}", ""));
    }
    return system_settings_form($form);
}
 /**
  * {inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $form['#form_horizontal'] = true;
     $form['interface'] = ['#type' => 'fieldset', '#title' => $this->t("User interface")];
     $form['interface'][APB_VAR_USER_PAGER_LIMIT] = ['#type' => 'select', '#title' => $this->t("User notification page limit"), '#options' => drupal_map_assoc([5, 10, 20, 30, 50, 100]), '#description' => $this->t("Number of notifications being displayed per page in user notification page."), '#default_value' => variable_get(APB_VAR_USER_PAGER_LIMIT, APB_DEF_USER_PAGER_LIMIT)];
     $form['interface'][APB_VAR_USER_BLOCK_LIMIT] = ['#type' => 'select', '#title' => $this->t("User notification block limit"), '#options' => drupal_map_assoc([3, 5, 8, 10, 13, 15, 20]), '#description' => $this->t("Number of notifications being displayed per in the user notification block."), '#default_value' => variable_get(APB_VAR_USER_BLOCK_LIMIT, APB_DEF_USER_BLOCK_LIMIT)];
     $form['interface'][APB_VAR_IMG_STYLE] = ['#type' => 'select', '#title' => $this->t("Notification image style"), '#empty_option' => $this->t("Do not display image"), '#options' => image_style_options(true), '#description' => $this->t("Number of notifications being displayed per page in user notification page."), '#default_value' => variable_get(APB_VAR_IMG_STYLE, APB_DEF_IMG_STYLE)];
     $form['advanced'] = ['#type' => 'fieldset', '#title' => $this->t("Advanced / Performance")];
     $form['advanced'][APB_VAR_ENABLE_PROD] = ['#type' => 'checkbox', '#title' => $this->t("Enable production mode"), '#description' => $this->t("Will suppress some warnings, errors and exceptions. Always check this option on a production site."), '#default_value' => variable_get(APB_VAR_ENABLE_PROD, APB_DEF_ENABLE_PROD)];
     $form['advanced'][APB_VAR_ENABLE_FORMATTED_CONTENT] = ['#type' => 'checkbox', '#title' => $this->t("Store content inside messages"), '#description' => $this->t("If checked, formatted messages will be sent in the message contents instead of being formatted at view time. This will bypass translation but allows you to display those notifications outside of the originating website. If checked generated links inside formatted notifications will all be absolute. Note that if you change this setting and data has already been sent some notifications might not be displayed correctly."), '#default_value' => variable_get(APB_VAR_ENABLE_FORMATTED_CONTENT, APB_DEF_ENABLE_FORMATTED_CONTENT)];
     return system_settings_form($form);
 }
/**
 * Presets form.
 */
function spaces_preset_list($form, &$form_state, $export_ui)
{
    // Some setup for the spaces_preset_name_validation
    $form_state['plugin'] = $export_ui->plugin;
    $form_state['object'] =& $export_ui;
    $types = array();
    foreach (spaces_types(TRUE) as $type => $info) {
        $types[$type] = $info['title'];
    }
    $form['new'] = array('#tree' => FALSE, '#theme' => 'spaces_preset_list_new', 'space_type' => array('#title' => t('Type'), '#type' => 'select', '#options' => $types), 'name' => array('#type' => 'textfield', '#maxlength' => 64, '#size' => 32, '#title' => t('Machine ID'), '#element_validate' => array('spaces_preset_name_validate')), 'title' => array('#type' => 'textfield', '#maxlength' => 64, '#size' => 32, '#title' => t('Name')), 'submit' => array('#type' => 'submit', '#value' => t('Create new preset'), '#submit' => array('spaces_preset_list_new')));
    // Generate preset options.
    foreach ($types as $type => $title) {
        module_load_include('inc', 'spaces', 'spaces.admin');
        $presets = spaces_preset_load(NULL, $type, TRUE);
        ksort($presets);
        $form[$type] = spaces_preset_form($presets, $type, TRUE);
        $form[$type]['#title'] = t('@spacetype presets', array('@spacetype' => $title));
        $form[$type]['#description'] = t('Select a default preset for each new @spacetype.', array('@spacetype' => $title));
        $plugin = $export_ui->plugin;
        foreach ($presets as $name => $item) {
            // Note: Creating this list seems a little clumsy, but can't think of
            // better ways to do this.
            $allowed_operations = drupal_map_assoc(array_keys($plugin['allowed operations']));
            $not_allowed_operations = array('import');
            if ($item->type == t('Normal')) {
                $not_allowed_operations[] = 'revert';
            } elseif ($item->type == t('Overridden')) {
                $not_allowed_operations[] = 'delete';
            } else {
                $not_allowed_operations[] = 'revert';
                $not_allowed_operations[] = 'delete';
            }
            $not_allowed_operations[] = empty($item->disabled) ? 'enable' : 'disable';
            foreach ($not_allowed_operations as $op) {
                // Remove the operations that are not allowed for the specific exportable.
                unset($allowed_operations[$op]);
            }
            $operations = array();
            foreach ($allowed_operations as $op) {
                $operations[$op] = array('title' => $plugin['allowed operations'][$op]['title'], 'href' => ctools_export_ui_plugin_menu_path($plugin, $op, $name));
                if (!empty($plugin['allowed operations'][$op]['token'])) {
                    $operations[$op]['query'] = array('token' => drupal_get_token($op));
                }
            }
            $form[$type]['storage'][$item->name] = array('#type' => 'markup', '#markup' => isset($item->disabled) && $item->disabled ? t('Disabled') : check_plain($item->type));
            $form[$type]['actions'][$item->name] = array('#type' => 'markup', '#markup' => theme('links', array('links' => $operations)));
            $form[$type]["spaces_preset_{$type}"][$name] = array();
        }
    }
    $form = system_settings_form($form);
    return $form;
}
Example #8
0
/**
 * Some custom form on your website, maybe global, or per-domain, or not.
 */
function YOURMODULE_custom_form($form, &$form_state)
{
    $form['test_wysiwyg3'] = array('#type' => 'text_format', '#title' => t('Pretty text 3'), '#default_value' => $value['value'], '#format' => $value['format'], '#vsf_file_usage_type' => 'YOURMODULE_custom_form', '#vsf_file_usage_id' => 'test_wysiwyg3', '#vsf_file_usage_id' => 1, '#vsf_file_usage_id' => $domain['domain_id']);
    // Custom forms that save into variables use this. Use whatever submit handler you want, but ADD
    // MINE TOO!
    $form = system_settings_form($form);
    // If you want automatic file_usage, YOU NEED THIS SUBMIT HANDLER.
    $form['#submit'][] = 'vsf_wysiwyg_save_file_usage_submit';
    // Note. If you don't care about {file_usage} at all (you silly you!), you don't need #vsf_file_usage_type
    // and #vsf_file_usage_id, but you will need #entity_type, #bundle and #field_name.
    // @see vsf_wysiwyg_pre_render_wysiwyg_element()
    return $form;
}
/**
 * @file
 */
function brukar_client_admin($form, &$form_state = array())
{
    $form['server'] = array('#type' => 'fieldset', '#title' => 'Server', '#collapsible' => variable_get('brukar_url', '') != '', '#collapsed' => variable_get('brukar_url', '') != '');
    $form['server']['brukar_url'] = array('#type' => 'textfield', '#title' => 'Adresse', '#default_value' => variable_get('brukar_url', ''));
    $form['server']['brukar_consumer_key'] = array('#type' => 'textfield', '#title' => 'Consumer key', '#default_value' => variable_get('brukar_consumer_key', ''));
    $form['server']['brukar_consumer_secret'] = array('#type' => 'textfield', '#title' => 'Consumer secret', '#default_value' => variable_get('brukar_consumer_secret', ''));
    $form['behavior'] = array('#type' => 'fieldset', '#title' => 'Behavior');
    $form['behavior']['brukar_keyword'] = array('#type' => 'textfield', '#title' => 'Keyword', '#default_value' => variable_get('brukar_keyword', 'brukar'));
    $form['behavior']['brukar_name'] = array('#type' => 'select', '#title' => 'Name in database', '#options' => array('!name' => '[Name]', '!name (!sident)' => '[Name] ([Short ident])', '!ident' => '[Ident]'), '#default_value' => variable_get('brukar_name', '!name'));
    $form['behavior']['brukar_forced'] = array('#type' => 'radios', '#title' => 'Forced login', '#options' => array('Nei', 'Ja'), '#default_value' => variable_get('brukar_forced', '0'));
    $form['behavior']['brukar_hidden'] = array('#type' => 'radios', '#title' => 'Hidden login', '#options' => array('Nei', 'Ja'), '#default_value' => variable_get('brukar_hidden', '0'));
    $form['behavior']['brukar_dup'] = array('#type' => 'radios', '#title' => 'Disable username/password', '#options' => array('Nei', 'Ja'), '#default_value' => variable_get('brukar_dup', '0'));
    return system_settings_form($form);
}
Example #10
0
 function createAdminForm()
 {
     if (!user_access('administer site configuration')) {
         drupal_set_message(t('Unauthorized access to administer site configuration'), 'error');
         return;
     }
     $form = array();
     $form['apiary_version'] = array('#type' => 'textfield', '#title' => t('Apiary Version'), '#default_value' => variable_get('apiary_version', 'apiary-0.1.1'), '#description' => t('The version of Apiary to be ran'), '#required' => true, '#weight' => -3);
     $form['apiary_object_timeout'] = array('#type' => 'textfield', '#title' => t('Apiary Object Timeout (in seconds)'), '#default_value' => variable_get('apiary_object_timeout', '1800'), '#description' => t('Timeout used for Apiary workflow objects'), '#required' => true, '#weight' => -2);
     $form['apiary_research_name'] = array('#type' => 'textfield', '#title' => t('Apiary Project Research Site name'), '#default_value' => variable_get('apiary_research_name', 'Apiary Research Project'), '#description' => t('The Name of this particular Apiary Research Site'), '#required' => true, '#weight' => -1);
     $form['apiary_research_base_url'] = array('#type' => 'textfield', '#title' => t('Apiary Project site Url'), '#default_value' => variable_get('apiary_research_base_url', 'http://localhost'), '#description' => t('The domain of the server this Apiary Research site is located'), '#required' => true, '#weight' => 0);
     $form['apiary_research_djatoka_url'] = array('#type' => 'textfield', '#title' => t('Apiary Research Djatoka server URL'), '#default_value' => variable_get('apiary_research_djatoka_url', 'http://localhost:8080/adore-djatoka'), '#description' => t('The url of the Apiary Research JPEG2000 image server'), '#required' => true, '#weight' => 0);
     $form['apiary_project_herbis_dir'] = array('#type' => 'textfield', '#title' => t('Apiary Project Herbis Directory'), '#default_value' => variable_get('apiary_project_herbis_dir', '/var/www/drupal/modules/apiary_project/herbis'), '#description' => t('The path to the herbis folder on the machine hosting the drupal module.'), '#required' => true, '#weight' => 0);
     $form['apiary_project_herbis_url'] = array('#type' => 'textfield', '#title' => t('Apiary Project HERBIS server URL'), '#default_value' => variable_get('apiary_project_herbis_url', 'http://txcdk3g.unt.edu:8080/HERBIS'), '#description' => t('The url of the Apiary Research natual language processing server'), '#required' => true, '#weight' => 0);
     return system_settings_form($form);
 }
function cobalt_settings()
{
    $form = array();
    $themes = cobalt_themes();
    $theme_options = array();
    foreach ($themes as $key => $info) {
        $theme_options[$key] = $info['name'];
    }
    $form['cobalt_theme'] = array('#type' => 'select', '#options' => $theme_options, '#default_value' => variable_get('cobalt_theme', ''), '#title' => t('Select a theme for cobalt'));
    $form['cobalt_shortcuts'] = array('#type' => 'textfield', '#default_value' => variable_get('cobalt_shortcuts', 'Alt+space, Ctrl+space'), '#title' => t('Shortcuts for activating cobalt'), '#description' => t('The shortcuts that can be used to activate Cobalt should be separated by a comma, like this: "Alt+space, Ctrl+space".') . ' ' . l(t('See the live demo for jshotkeys to get some help'), 'http://jshotkeys.googlepages.com/test-static-01.html'));
    $form['javascript_includes'] = array('#type' => 'fieldset', '#title' => t('Javascript includes'), '#description' => t('All the following libraries are needed for Cobalt to function properly. These options are here if you need Cobalt to play nice with any other modules or themes that use the same javascript libraries.'));
    $form['javascript_includes']['cobalt_gears_init'] = array('#type' => 'checkbox', '#default_value' => variable_get('cobalt_gears_init', 1), '#title' => t('Include the Google Gears init javascript'));
    $form['javascript_includes']['cobalt_jquery_json'] = array('#type' => 'checkbox', '#default_value' => variable_get('cobalt_jquery_json', 1), '#title' => t('Include the jQuery JSON plugin'));
    $form['javascript_includes']['cobalt_jquery_hotkeys'] = array('#type' => 'checkbox', '#default_value' => variable_get('cobalt_jquery_hotkeys', 1), '#title' => t('Include the jQuery Hotkeys plugin'));
    return system_settings_form($form);
}
Example #12
0
 /**
  * Administrative settings.
  *
  * @return array
  *   An array containing form items to place on the module settings page.
  */
 public static function hookAdminSettings()
 {
     $form['handle_content_expiry'] = array('#type' => 'fieldset', '#title' => t('Handle content expiry'), '#collapsible' => TRUE, '#collapsed' => FALSE);
     $form['handle_content_expiry']['node_expire_handle_content_expiry'] = array('#type' => 'radios', '#title' => t('Handle content expiry'), '#default_value' => ConfigHandler::getHandleContentExpiry(), '#options' => array(0 => t('In legacy mode'), 1 => t('Trigger "Content Expired" event every cron run when the node is expired'), 2 => t('Trigger "Content Expired" event only once when the node is expired')), '#description' => t('In non-legacy mode node expiry is set for each node type separately and disabled by default.') . ' ' . t('Enable it at Structure -> Content types -> {Your content type} -> Edit -> Publishing options.') . '<br />' . t('"Trigger "Content Expired" event only once " option allows to ignore nodes, which already have been processed.') . '<br />' . t('Legacy mode means: not possible to allow expiry separately for each particular node type, trigger "Content Expired" event every cron run, legacy data saving'));
     // Visibility.
     $states = array('visible' => array(':input[name="node_expire_handle_content_expiry"]' => array(array('value' => '1'), array('value' => '2'))));
     // Variable node_expire_date_entry_elements is not used in legacy mode,
     // so in legacy mode it is safe to keep any of it's value.
     // It is necessary just to take care about proper validation
     // (see node_expire_admin_settings_validate below).
     $form['date_entry_elements'] = array('#type' => 'fieldset', '#title' => t('Date values entry elements'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#states' => $states);
     $form['date_entry_elements']['node_expire_date_entry_elements'] = array('#type' => 'radios', '#title' => t('Enter date values using'), '#default_value' => ConfigHandler::getDateEntryElements(), '#options' => array(0 => t('Text fields'), 1 => t('Date popups')), '#description' => t('"Date popups" option requires Date module to be installed') . ' ' . t('with Date Popup enabled. This option is not available in legacy mode.'), '#states' => $states);
     $form['date_format'] = array('#type' => 'fieldset', '#title' => t('Format of expiry date'), '#collapsible' => TRUE, '#collapsed' => FALSE);
     $form['date_format']['node_expire_date_format'] = array('#type' => 'textfield', '#maxlength' => 25, '#title' => t('Format of expiry date'), '#default_value' => ConfigHandler::getDateFormat(), '#description' => t('Format of expiry date.') . ' ' . t('Format: PHP <a href="http://www.php.net/strtotime" target="_blank">strtotime format</a>.'));
     $form['past_date_allowed'] = array('#type' => 'fieldset', '#title' => t('Expire date in the past'), '#collapsible' => TRUE, '#collapsed' => FALSE);
     $form['past_date_allowed']['node_expire_past_date_allowed'] = array('#type' => 'checkbox', '#title' => t('Allow expire date in the past'), '#default_value' => ConfigHandler::getPastDateAllowed(), '#description' => t('Checking this box will allow to save nodes with expire date in the past. This is helpful during site development and testing.'));
     // End of node_expire_admin_settings().
     return system_settings_form($form);
 }
function flickr_context_tags_settings()
{
    $form = array();
    // Set machine tag name space to current domain, if not already set
    $url = parse_url(url('', array('absolute' => TRUE)));
    $mt_ns = variable_get('flickr_context_tags_mech_namespace', $url['host']);
    $form['flickr_context_tags_mech_namespace'] = array('#type' => 'textfield', '#title' => t('Machine-tag namespace'), '#default_value' => $mt_ns);
    $form['flickr_context_tags_userid'] = array('#type' => 'textfield', '#title' => t('Flickr id'), '#description' => t('Can be used to get photos from a specified flickr user'), '#default_value' => variable_get('flickr_context_tags_userid', ''));
    $form['flickr_context_tags_default_place_id'] = array('#type' => 'textfield', '#title' => t('Default place id'), '#description' => t('The default place id can be used to keep the flickr pictures relevant'), '#default_value' => variable_get('flickr_context_tags_default_place_id', ''));
    $form['flickr_context_tags_force_default_place_id'] = array('#type' => 'checkbox', '#title' => t('Always use the default place id'), '#default_value' => variable_get('flickr_context_tags_force_default_place_id', FALSE));
    $sizes = array('s' => t('Square'), 't' => t('Thumbnail'), 'm' => t('Small'), '-' => t('Medium'), 'b' => t('Large'), 'o' => t('Orginal'));
    $form['flickr_context_tags_size'] = array('#type' => 'select', '#title' => t('Select the size you want your photos in'), '#default_value' => variable_get('flickr_context_tags_size', 'm'), '#options' => $sizes);
    // Tag configuration textarea
    $paths = variable_get('flickr_context_tags_contexts', array());
    $form['flickr_context_tags_contexts'] = array('#type' => 'textarea', '#title' => t('Context tags for paths'), '#default_value' => flickr_context_tags_pack_contexts($paths), '#description' => t('Enter the path expression followed by a list of comma-separated tags'));
    // Piggyback on the system settings form for buttons and so on
    $form = system_settings_form($form);
    // ...but replace the #submit function
    $form['#submit'] = array('flickr_context_tags_settings_submit');
    return $form;
}
Example #14
0
/**
 * Admin page - set the mode and the content types to alter
 */
function nodereferrer_create_callback_admin()
{
    $form = array();
    /* Main settings */
    $form['nodereferrer_create_show_on_nodereferrer'] = array('#type' => 'checkbox', '#title' => t('Show menu items for nodereferrer fields'), '#description' => t('If this is checked, the create related items will include content linked via nodereferrer fields.'), '#default_value' => variable_get('nodereferrer_create_show_on_nodereferrer', 1));
    $form['nodereferrer_create_show_on_nodereference'] = array('#type' => 'checkbox', '#title' => t('Show menu items for nodereference fields'), '#description' => t('If this is checked, the create related items will include content linked via nodereference fields. This does not work for nodereference fields that use views.'), '#default_value' => variable_get('nodereferrer_create_show_on_nodereference', 1));
    $form['nodereferrer_create_inline'] = array('#type' => 'checkbox', '#title' => t('Create the add menu inline when possible'), '#description' => t('If this is checked, when the field is displayed on the page then the add menu will be added next to the field'), '#default_value' => variable_get('nodereferrer_create_inline', 1));
    $form['nodereferrer_create_javascript'] = array('#type' => 'checkbox', '#title' => t('Use a javascript popup rather than a redirect for the local task'), '#description' => t('If this is checked, when the local task to create content is clicked, node referrer create will attemp to make the form popup rather than use a redirect.'), '#default_value' => variable_get('nodereferrer_create_javascript', 1));
    /* Access settings */
    $form['nodereferrer_create_access_group'] = array('#type' => 'fieldset', '#collapsible' => true, '#collapsed' => true, '#title' => t('Access settings'));
    $form['nodereferrer_create_access_group']['nodereferrer_create_access_if_local_node'] = array('#type' => 'checkbox', '#title' => t('Only show menus if user can edit current node'), '#description' => t('By default, Nodereferrer Create will show \'create related content\' menus if the 
                         user has the access rights to create the related content - regardless of the user\'s
                         access rights to the current node. If this is checked, Nodereferrer Create will
                         only show the \'create related content\' menus if the user has the access rights
                         to the related content AND to the current node. This is cosmetic only - the user
                         can always create the related content some other way.'), '#default_value' => variable_get('nodereferrer_create_access_if_local_node', 0));
    /* Syncronisation settings */
    $form['nodereferrer_create_sync_group'] = array('#type' => 'fieldset', '#collapsible' => true, '#collapsed' => true, '#title' => t('Synchronisation settings'));
    $form['nodereferrer_create_sync_group']['nodereferrer_create_sync_title'] = array('#type' => 'checkbox', '#title' => t('Synchronise title'), '#description' => t('If this is checked, when creating related content the title will default to that of the current node'), '#default_value' => variable_get('nodereferrer_create_sync_title', 0));
    $form['nodereferrer_create_sync_group']['nodereferrer_create_sync_taxonomy'] = array('#type' => 'checkbox', '#title' => t('Synchronise taxonomy (not implemented)'), '#description' => t('If this is checked, when creating related content the taxonomy will default to that of the current node. This is not currently implemented.'), '#default_value' => variable_get('nodereferrer_create_sync_taxonomy', 0));
    $form['nodereferrer_create_sync_group']['nodereferrer_create_sync_fields'] = array('#type' => 'textarea', '#title' => t('Rules to synchronise other fields. Advanced users only.'), '#description' => t('This will copy the value of the source field to the default value of the destination field. Note that these are not always formatted in the same way, and as such this may not work. Use with caution. Format is one rule per line as : "source_field : destination_field". For instance to synchronise the title field to a CCK field named "parent_title" you\'d write "title : field_parent_title". Please only use this if you know what you are doing, no support will be given.'), '#default_value' => variable_get('nodereferrer_create_sync_fields', ''));
    /* JS effect settings */
    $form['nodereferrer_create_effect_group'] = array('#type' => 'fieldset', '#collapsible' => true, '#collapsed' => true, '#title' => t('Javascritp effect settings'));
    $form['nodereferrer_create_effect_group']['nodereferrer_create_effect'] = array('#type' => 'select', '#title' => t('Type of effect to use'), '#options' => array('show_hide' => t('Show/Hide'), 'slide' => t('Slide in/out')), '#default_value' => variable_get('nodereferrer_create_effect', 'slide'));
    $form['nodereferrer_create_effect_group']['nodereferrer_create_effect_speed'] = array('#type' => 'select', '#title' => t('Where applicable, speed of the effect'), '#options' => array('normal' => t('Normal'), 'slow' => t('Slow'), 'fast' => t('Fast')), '#default_value' => variable_get('nodereferrer_create_effect_speed', 'normal'));
    /* Label settings */
    $form['nodereferrer_create_labels'] = array('#type' => 'fieldset', '#collapsible' => true, '#collapsed' => true, '#title' => t('Labels'));
    $form['nodereferrer_create_labels']['nodereferrer_create_localtask_label'] = array('#type' => 'textfield', '#title' => t('Local task label for creating new content'), '#default_value' => variable_get('nodereferrer_create_localtask_label', 'Create related content'), '#description' => t('This is the label of the local task used to create related content'));
    $form['nodereferrer_create_labels']['nodereferrer_create_label'] = array('#type' => 'textfield', '#title' => t('Label for creating new referrers'), '#default_value' => variable_get('nodereferrer_create_label', 'Create new @type'), '#description' => t('This is the text generated in the menus to create a new referrer'));
    $form['nodereferrer_create_labels']['nodereferrer_create_add_label'] = array('#type' => 'textfield', '#title' => t('Label for adding to existing referrers'), '#default_value' => variable_get('nodereferrer_create_add_label', 'Add to existing @type'), '#description' => t('This is the text generated in the menus to add to an existing referrer'));
    $form['nodereferrer_create_labels']['nodereferrer_create_reference_label'] = array('#type' => 'textfield', '#title' => t('Label for creating a new referrence'), '#default_value' => variable_get('nodereferrer_create_reference_label', 'Create new @type'), '#description' => t('This is the text generated in the menus to create a new referrence'));
    $form['nodereferrer_create_labels']['nodereferrer_create_reference_label_add'] = array('#type' => 'textfield', '#title' => t('Label for adding an existing referrence'), '#default_value' => variable_get('nodereferrer_create_reference_label_add', 'Add existing @type'), '#description' => t('This is the text generated in the menus to add an existing referrence'));
    $form['nodereferrer_create_labels']['nodereferrer_create_reference_label_single'] = array('#type' => 'textfield', '#title' => t('Label for creating a new referrence to replace existing one'), '#default_value' => variable_get('nodereferrer_create_reference_label_single', 'Replace with new @type'), '#description' => t('This is the text generated in the menus to create a new referrence to replace the existing one'));
    $form['nodereferrer_create_labels']['nodereferrer_create_reference_label_add_single'] = array('#type' => 'textfield', '#title' => t('Label for replacing referrence with an existing one'), '#default_value' => variable_get('nodereferrer_create_reference_label_add_single', 'Replace with existing @type'), '#description' => t('This is the text generated in the menus to replace the referrence with an existing one'));
    return system_settings_form($form);
}
/**
 * Generate the administration form of the Shibboleth authentication module
 * @returns HTML text of the administration form
 */
function shib_auth_admin()
{
    global $base_url;
    $form = array();
    $form['shib_handler_settings'] = array('#type' => 'fieldset', '#title' => t('Shibboleth handler settings'), '#weight' => 0, '#collapsible' => FALSE);
    $form['shib_attribute_settings'] = array('#type' => 'fieldset', '#title' => t('Attribute settings'), '#weight' => 0, '#collapsible' => FALSE);
    $form['shib_handler_settings']['shib_auth_handler_url'] = array('#type' => 'textfield', '#title' => t('Shibboleth handler URL'), '#default_value' => variable_get('shib_auth_handler_url', '/Shibboleth.sso'), '#description' => t('The URL can be absolute or relative to the server base url: http://www.example.com/Shibboleth.sso; /Shibboleth.sso'));
    $form['shib_handler_settings']['shib_auth_handler_protocol'] = array('#type' => 'select', '#title' => t('Shibboleth handler protocol'), '#default_value' => variable_get('shib_auth_handler_protocol', 'https'), '#options' => array('http' => t('HTTP'), 'https' => t('HTTPS')), '#description' => t('This option will be effective only if the handler URL is a relative path.'));
    $form['shib_handler_settings']['shib_auth_wayf_uri'] = array('#type' => 'textfield', '#title' => t('WAYF location'), '#default_value' => variable_get('shib_auth_wayf_uri', '/DS'));
    $form['shib_attribute_settings']['shib_auth_username_variable'] = array('#type' => 'textfield', '#title' => t('Server variable for username'), '#default_value' => variable_get('shib_auth_username_variable', 'REMOTE_USER'));
    $form['shib_attribute_settings']['shib_auth_username_email'] = array('#type' => 'textfield', '#title' => t('Server variable for e-mail address'), '#default_value' => variable_get('shib_auth_username_email', 'HTTP_SHIB_MAIL'));
    $form['shib_attribute_settings']['shib_auth_mail_shib_only'] = array('#type' => 'radios', '#title' => t('E-mail source settings'), '#default_value' => variable_get('shib_auth_mail_shib_only', 0), '#options' => array(t('Require and use only Shibboleth-provided email address'), t('Ask for missing e-mail address')));
    $form['shib_attribute_debug'] = array('#type' => 'fieldset', '#title' => 'Debugging options');
    $form['shib_attribute_debug']['shib_auth_debug_state'] = array('#type' => 'checkbox', '#title' => t('Enable DEBUG mode.'), '#default_value' => variable_get('shib_auth_debug_state', FALSE));
    $form['shib_attribute_debug']['shib_auth_debug_url'] = array('#type' => 'textfield', '#title' => t('DEBUG path prefix'), '#default_value' => variable_get('shib_auth_debug_url', ''), '#description' => t('For example use \'user/\' for display DEBUG messages on paths \'user/*\'!'));
    $form['shib_auth_auto_destroy_session']['shib_auth_auto_destroy_session'] = array('#type' => 'checkbox', '#title' => t('Destroy Drupal session when the Shibboleth session expires.'), '#default_value' => variable_get('shib_auth_auto_destroy_session', FALSE));
    $form['shib_logout_settings'] = array('#type' => 'fieldset', '#title' => t('Change Logout settings'));
    $form['shib_logout_settings']['shib_logout_url'] = array('#type' => 'textfield', '#title' => t("URL to redirect to after logout"), '#default_value' => variable_get('shib_logout_url', $base_url), '#description' => t("The URL can be absolute or relative to the server base url. The relative paths will be automatically extended with the site base URL."));
    return system_settings_form($form);
}
Example #16
0
function bluemod_aprobacionautomatica_form()
{
    $form['listaaprobacion'] = array('#type' => 'textarea', '#title' => t('Dominios para aprobar automaticamente'), '#default_value' => variable_get('listaaprobacion', ''), '#required' => TRUE, '#description' => t('listado de dominios para aprobar usuarios automaticamente. uno por linea, en minuscula, sin incluir arroba.'));
    //$form['submit']['#submit'] = array('bluemod_precioscombustibles_form_submit');
    $form = system_settings_form($form);
    $form['#submit'][] = 'bluemod_aprobacionautomatica_form_submit';
    return $form;
}
function brafton_admin_form($form, &$form_state)
{
    $module_list = system_list('module_enabled');
    //debug($module_list);
    //Check if the importer should have run and it didn't
    $cron_time = variable_get('cron_safe_threshold');
    $cron_last = variable_get('cron_last');
    $current_time = time();
    $diff = $current_time - $cron_last;
    //if more time has passed than should have
    if ($diff > $cron_time) {
        drupal_set_message(t('It appears that your importer may have failed to run when is was scheduled.  A report has been sent to your CMS to ensure Delivery of content.'), 'warning');
        //$errors = new BraftonErrorReport(variable_get('brafton_api_key'), variable_get( 'brafton_api_root' ), (bool)variable_get('brafton_debug_mode') );
    }
    if (isset($_GET['b_error']) && $_GET['b_error'] == 'vital') {
        drupal_set_message(t('There was a fatal error when running the importer.  Please contact Tech support'), 'error');
    }
    $name = basename('brafton.module', '.module');
    /* This would be section to add new css rules for our admin page */
    drupal_add_css(drupal_get_path('module', $name) . '/brafton-admin.css', array('group' => CSS_THEME, 'type' => 'file'));
    $form = array();
    $types = node_type_get_types();
    $type_list = array();
    foreach ($types as $obj) {
        $type_list[] = array('name' => $obj->name, 'type' => $obj->type);
    }
    //Gets the users as an array for the author dropdown
    $results = db_query("SELECT uid, name FROM {users} WHERE status=1");
    $user_array = $results->fetchAllKeyed();
    //Add option for getting dynamic author.
    //0 is also the id for anonymous author as a fall back if no author is set in the feed
    $user_array[0] = 'Get Author from Article';
    //Renders the admin form using the Drupal forms API.
    /*
     *************************************************************************************
     * General Options
     *************************************************************************************
     */
    global $base_url;
    $form['brafton_general_options'] = array('#type' => 'fieldset', '#title' => 'General Options', '#collapsible' => true, '#collapsed' => true, '#description' => 'If you need help setting up your importer view our pdf Instructions <a href="' . $base_url . '/' . drupal_get_path('module', $name) . '/README.MD" target="_blank">Here</a>');
    $form['brafton_general_options']['brafton_feed_type'] = array('#type' => 'select', '#title' => t('Type of Content'), '#description' => t('The type(s) of content you are importing.'), '#options' => array('articles' => 'Articles', 'videos' => 'Videos', 'both' => 'Both'), '#default_value' => variable_get('brafton_feed_type', 'articles'), '#prefix' => '<h2>Choose Content Types</h2>');
    $form['brafton_general_options']['brafton_api_root'] = array('#type' => 'select', '#title' => t('API Root'), '#description' => t('The root domain of your Api key (i.e, api.brafton.com).'), '#options' => array('api.brafton.com' => 'Brafton', 'api.contentlead.com' => 'ContentLEAD', 'api.castleford.com.au' => 'Castleford'), '#default_value' => variable_get('brafton_api_root', 'api.brafton.com'));
    $form['brafton_general_options']['brafton_author'] = array('#type' => 'select', '#title' => t('Content Author'), '#description' => t('The author of the content.'), '#options' => $user_array, '#default_value' => variable_get('brafton_author', 1), '#prefix' => '<h2>Import Options</h2>');
    $form['brafton_general_options']['brafton_import_date'] = array('#type' => 'select', '#title' => t('Import Date'), '#description' => t('The date that the content is marked as having been published.'), '#options' => array('published' => 'Published Date', 'created' => 'Created Date', 'lastmodified' => 'Last Modified Date'), '#default_value' => variable_get('brafton_import_date', 'published'));
    $form['brafton_general_options']['brafton_comments'] = array('#type' => 'select', '#title' => t('Enable Comments?'), '#description' => t('Enable, Hide, or Disable Comments'), '#options' => array(0 => 'Disabled', 1 => 'Hidden', 2 => 'Enabled'), '#default_value' => variable_get('brafton_comments', 0));
    $form['brafton_general_options']['brafton_overwrite'] = array('#type' => 'checkbox', '#title' => t('Overwrite any changes made to existing content.'), '#default_value' => variable_get('brafton_overwrite', 0));
    $form['brafton_general_options']['brafton_published'] = array('#type' => 'checkbox', '#title' => t('Import Content as unpublished.'), '#default_value' => variable_get('brafton_published', 0));
    /*
     *************************************************************************************
     * Article Options
     *************************************************************************************
     */
    $form['brafton_article_options'] = array('#type' => 'fieldset', '#title' => 'Article Options', '#collapsible' => true, '#collapsed' => true);
    $form['brafton_article_options']['brafton_api_key'] = array('#type' => 'textfield', '#title' => t('Api Key'), '#description' => t('Your API key (of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'), '#default_value' => variable_get('brafton_api_key'), '#size' => 36, '#maxlength' => 36, '#prefix' => 'Options in this section apply to Articles ONLY.  Videos have seperate options');
    $form['brafton_article_options']['brafton_blog_page'] = array('#type' => 'checkbox', '#title' => t('Create a News Page at "mydomain.com/news".'), '#default_value' => variable_get('brafton_blog_page', 0), '#prefix' => '<h2>Integration Options for Articles</h2>');
    $form['brafton_article_options']['brafton_blog_archives'] = array('#type' => 'checkbox', '#title' => t('Create archives pages at "mydomain.com/news/archive/year/month" and an archives block.'), '#default_value' => variable_get('brafton_blog_archives', 0));
    $form['brafton_article_options']['brafton_blog_categories'] = array('#type' => 'checkbox', '#title' => t('Create a categories block.'), '#default_value' => variable_get('brafton_blog_categories', 0));
    $form['brafton_article_options']['brafton_blog_headlines'] = array('#type' => 'checkbox', '#title' => t('Create a headlines block.'), '#default_value' => variable_get('brafton_blog_headlines', 0));
    $form['brafton_article_options']['brafton_related_articles'] = array('#type' => 'checkbox', '#title' => t('Add related articles to Brafton posts.'), '#default_value' => variable_get('brafton_related_articles', 0));
    $form['brafton_article_options']['brafton_existing_type'] = array('#type' => 'select', '#title' => 'Content Type', '#options' => build_type_list($type_list), '#default_value' => variable_get('brafton_existing_type', 'b_news'), '#description' => 'Import Articles under the content type of your choice.<span class="disclaimer">ADVANCED OPTION.  Only change if you know what you are doing. Defaults to our News Article Content Type</span>', '#ajax' => array('callback' => 'ajax_brafton_test', 'wrapper' => 'brafton_type_info_block', 'replace' => 'replace', 'effect' => 'fade'));
    $form['brafton_article_options']['brafton_type_info'] = array('#title' => '', '#prefix' => '<div id="brafton_type_info_block">', '#suffix' => '</div>', '#type' => 'fieldset');
    //displays the form with values for existing post type on initial page load
    if (empty($form_state['values']['brafton_existing_type']) && variable_get('brafton_existing_type', 'b_news') != 'b_news') {
        $form['brafton_article_options']['brafton_type_info']['brafton_custom_body'] = array('#type' => 'select', '#prefix' => '<p>Map your content fields to the appropriate content parts.<span class="disclaimer">Caution the following are advanced options and should only be used if you know what your are doing</span></p>', '#title' => 'Content of the Article', '#options' => build_type_field_list(variable_get('brafton_existing_type')), '#default_value' => variable_get('brafton_custom_body', ''));
        $form['brafton_article_options']['brafton_type_info']['brafton_custom_image'] = array('#type' => 'select', '#title' => 'Image for Article', '#options' => build_type_field_list(variable_get('brafton_existing_type')), '#default_value' => variable_get('brafton_custom_image', ''));
        $form['brafton_article_options']['brafton_type_info']['brafton_custom_taxonomy'] = array('#type' => 'select', '#title' => 'Taxonomy for Article', '#options' => build_type_field_list(variable_get('brafton_existing_type')), '#default_value' => variable_get('brafton_custom_taxonomy', ''));
    }
    //used for displaying the ajax load of content type to display the fields available for mapping
    if (!empty($form_state['values']['brafton_existing_type']) && $form_state['values']['brafton_existing_type'] != 'b_news') {
        $current = $form_state['values']['brafton_existing_type'];
        $form['brafton_article_options']['brafton_type_info']['brafton_custom_body'] = array('#type' => 'select', '#prefix' => '<p>Map your content fields to the appropriate content parts.<span class="disclaimer">Caution the following are advanced options and should only be used if you know what your are doing</span></p>', '#title' => 'Content of the Article', '#options' => build_type_field_list($current), '#default_value' => '');
        $form['brafton_article_options']['brafton_type_info']['brafton_custom_image'] = array('#type' => 'select', '#title' => 'Image for Article', '#options' => build_type_field_list($current), '#default_value' => '');
        $form['brafton_article_options']['brafton_type_info']['brafton_custom_taxonomy'] = array('#type' => 'select', '#title' => 'Taxonomy for Article', '#options' => build_type_field_list($current), '#default_value' => '');
    }
    /*
     *************************************************************************************
     * Video Options
     *************************************************************************************
     */
    $form['brafton_video_options'] = array('#type' => 'fieldset', '#title' => 'Video Options', '#collapsible' => true, '#collapsed' => true);
    $form['brafton_video_options']['brafton_video_public_key'] = array('#type' => 'textfield', '#title' => t('Video Public Key'), '#description' => t('Your video Public Key.'), '#default_value' => variable_get('brafton_video_public_key'), '#size' => 8, '#maxlength' => 8, '#prefix' => '<h2>For Videos</h2>');
    $form['brafton_video_options']['brafton_video_secret_key'] = array('#type' => 'textfield', '#title' => t('Video Secret Key'), '#description' => t('Your video Secret Key.'), '#default_value' => variable_get('brafton_video_secret_key'), '#size' => 36, '#maxlength' => 36);
    $form['brafton_video_options']['brafton_video_feednum'] = array('#type' => 'textfield', '#title' => t('Video Feed Number'), '#description' => t('Your video feed number.'), '#default_value' => variable_get('brafton_video_feednum', 0), '#size' => 10, '#maxlength' => 10);
    $form['brafton_video_options']['brafton_video_page'] = array('#type' => 'checkbox', '#title' => t('Create a Video Page at "mydomain.com/video".'), '#default_value' => variable_get('brafton_video_page', 0), '#prefix' => '<h2>Integration Options for Videos</h2>');
    $form['brafton_video_options']['brafton_video_archives'] = array('#type' => 'checkbox', '#title' => t('Create video archives pages at "mydomain.com/video/archive/year/month" and a video archives block.'), '#default_value' => variable_get('brafton_video_archives', 0));
    $form['brafton_video_options']['brafton_video_categories'] = array('#type' => 'checkbox', '#title' => t('Create a video categories block.'), '#default_value' => variable_get('brafton_video_categories', 0));
    $form['brafton_video_options']['brafton_video_headlines'] = array('#type' => 'checkbox', '#title' => t('Create a video headlines block.'), '#default_value' => variable_get('brafton_video_headlines', 0));
    $form['brafton_video_options']['brafton_related_videos'] = array('#type' => 'checkbox', '#title' => t('Add related videos to Brafton videos.'), '#default_value' => variable_get('brafton_related_videos', ""));
    $form['b_cta'] = array('#type' => 'fieldset', '#title' => 'Brafton Video CTA\'s', '#collapsible' => true, '#collapsed' => true);
    $form['b_cta']['brafton_video_ctas'] = array('#type' => 'checkbox', '#title' => t('Use Video CTA\'s'), '#default_value' => variable_get('brafton_video_ctas'));
    $form['b_cta']['brafton_video_pause_cta_text'] = array('#type' => 'textfield', '#title' => t('Atlantis Pause CTA Text'), '#description' => t('Default video pause cta text every article imports'), '#default_value' => variable_get('brafton_video_pause_cta_text', ""), '#size' => 20, '#prefix' => variable_get('testingName'));
    $form['b_cta']['brafton_video_pause_cta_link'] = array('#type' => 'textfield', '#title' => t('Atlantis Pause Link'), '#description' => t('Default video pause cta link'), '#default_value' => variable_get('brafton_video_pause_cta_link'), '#size' => 20);
    $form['b_cta']['brafton_video_pause_cta_asset_gateway_id'] = array('#type' => 'textfield', '#title' => t('Pause Asset Gateway ID'), '#description' => t('Asset Gateay Form ID. disables pause link url'), '#default_value' => variable_get('brafton_video_pause_cta_asset_gateway_id'), '#size' => 20);
    $form['b_cta']['brafton_video_end_cta_title'] = array('#type' => 'textfield', '#title' => t('Atlantis End CTA Title'), '#description' => t('Default video end cta title every article imports'), '#default_value' => variable_get('brafton_video_end_cta_title', ""), '#size' => 20, '#maxlength' => 140);
    $form['b_cta']['brafton_video_end_cta_subtitle'] = array('#type' => 'textfield', '#title' => t('Atlantis End CTA Subtitle'), '#description' => t('Default video end cta subtitle every article imports'), '#default_value' => variable_get('brafton_video_end_cta_subtitle', ""), '#size' => 20, '#maxlength' => 140);
    $form['b_cta']['brafton_video_end_cta_link'] = array('#type' => 'textfield', '#title' => t('Atlantis End CTA Link'), '#description' => t('Default video end cta link every article imports. Requires http://'), '#default_value' => variable_get('brafton_video_end_cta_link', ""), '#size' => 20, '#maxlength' => 500);
    $form['b_cta']['brafton_video_end_cta_asset_gateway_id'] = array('#type' => 'textfield', '#title' => t('End Asset Gateway ID'), '#description' => t('Asset Gateay Form ID. disables end link url'), '#default_value' => variable_get('brafton_video_end_cta_asset_gateway_id'), '#size' => 20);
    $form['b_cta']['brafton_video_end_cta_text'] = array('#type' => 'textfield', '#title' => t('Atlantis End CTA Text'), '#description' => t('Default video end cta text every article imports'), '#default_value' => variable_get('brafton_video_end_cta_text', ""), '#size' => 20, '#maxlength' => 20);
    $form['b_cta']['brafton_video_end_cta_button_image'] = array('#type' => 'managed_file', '#title' => t('Ending CTA Button Image'), '#description' => '<span class="actual_description">This is Optional and wil override the end cta text </span>' . spit_image('brafton_video_end_cta_button_image'), '#upload_location' => 'public://', '#default_value' => variable_get('brafton_video_end_cta_button_image'));
    $form['b_cta']['brafton_video_end_cta_button_placement'] = array('#type' => 'select', '#title' => t(' Ending button image Placement'), '#description' => t('Choose the position of button image.  You can further affect the position via css rules'), '#options' => array(0 => 'Choose Position', 'tl' => 'Top Left', 'tr' => 'Top Right', 'bl' => 'Bottom Left', 'br' => 'Bottom Right'), '#default_value' => variable_get('brafton_video_end_cta_button_placement'));
    $form['b_cta']['brafton_video_end_cta_background'] = array('#type' => 'managed_file', '#title' => t('Ending Background Image'), '#description' => '<span class="actual_description">This is Optional</span>' . spit_image('brafton_video_end_cta_background'), '#upload_location' => 'public://', '#default_value' => variable_get('brafton_video_end_cta_background'));
    $form['b_error'] = array('#type' => 'fieldset', '#title' => 'Brafton Error Reporting', '#description' => 'Errors resulting in failed attempts to import content will turn on Debug mode and capture all errors for debugging.  These errors are reporting to your CMS so we can better resolve any issues in a timely manner.', '#collapsible' => true, '#collapsed' => true);
    $form['b_error']['brafton_error_logs'] = array('#type' => 'radio', '#title' => t('Report Log'), '#description' => get_errs(), '#format' => 'full_html', '#default_value' => variable_get('brafton_error_logs', 0), '#prefix' => '<h3>Error Report</h3>');
    $form['b_error']['brafton_debug_mode'] = array('#type' => 'checkbox', '#title' => 'Debug Mode', '#description' => 'Turns on debug mode to report all errors that occur during the importer operatin', '#default_value' => variable_get('brafton_debug_mode', 0));
    $form['b_error']['brafton_clear_report'] = array('#type' => 'checkbox', '#title' => t('Clear the Error Report Log'), '#default_value' => variable_get('brafton_clear_report', 0));
    $form['b_manual'] = array('#type' => 'fieldset', '#title' => 'Manual Control & Archive Uploads', '#collapsible' => true, '#collapsed' => true);
    /*
    $form['b_manual']['brafton_article'] = array(
        '#type' => 'fieldset',
    
    );
    */
    /*
    $form['b_manual']['brafton_article']['brafton_enable_article_import'] = array(
        '#type' => 'checkbox',
    		'#title' => t( 'Run Article Importer' ),
    		'#default_value' => variable_get( 'brafton_enable_article_import',0 ),
        '#prefix'   => '<h2>Run Article Importer</h2>'
    );
    */
    $form['b_manual']['brafton_run_importer'] = array('#type' => 'submit', '#title' => 'Run Article Importer', '#value' => 'Run Article Importer', '#submit' => array('brafton_run_manaul_article'));
    $form['b_manual']['brafton_run_video_importer'] = array('#type' => 'submit', '#title' => 'Run Video Importer', '#value' => 'Run Video Importer', '#submit' => array('brafton_run_video_importer'));
    if (variable_get('brafton_archive_file')) {
        $form['b_manual']['brafton_run_archive_importer'] = array('#type' => 'submit', '#title' => 'Run Archive Importer', '#value' => 'Run Archive Importer', '#submit' => array('brafton_run_manaul_article'));
    }
    $form['b_manual']['brafton_archive_file'] = array('#type' => 'managed_file', '#title' => t('Article Archive File'), '#description' => t('When using the Archive import feature you must click upload and than Save configuration.  Once you Save your configuration you may run the Archive Importer which will use the uploaded xml file.'), '#default_value' => variable_get('brafton_archive_file'), '#upload_validators' => array('file_validate_extensions' => array(0 => 'xml')));
    $form['#submit'][] = 'brafton_admin_form_submit';
    return system_settings_form($form);
}
Example #18
0
/**
 * Sets up administrative options for SOPAC and returns a systems settings form
 *
 * @return string Settings form HTML
 */
function sopac_admin()
{
    $form = array();
    $current_ils = variable_get('sopac_ils', FALSE);
    if (!$current_ils) {
        $form['starter_instruction'] = array('#type' => 'markup', '#value' => 'Please select your ILS, then submit this form to continue setup.');
    }
    $form['sopac_general'] = array('#type' => 'fieldset', '#title' => t('General Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['sopac_general']['sopac_ils'] = array('#type' => 'select', '#title' => t('Your ILS name'), '#default_value' => variable_get('sopac_ils', 'iii'), '#options' => array('iii' => 'iii', 'koha' => 'koha', 'sirsi' => 'sirsi'), '#required' => TRUE);
    // Start admin with only choice of ILS.
    if (!$current_ils) {
        $form['sopac_general']['#collapsed'] = FALSE;
        // This will call sopac_admin_submit() to clear menu cache
        $form = system_settings_form($form);
        $form['#submit'][] = 'sopac_admin_submit';
        return $form;
    }
    $form['sopac_general']['sopac_lib_name'] = array('#type' => 'textfield', '#title' => t('Your Institution\'s name'), '#default_value' => variable_get('sopac_lib_name', 'Anytown Public Library'), '#size' => 32, '#maxlength' => 254, '#description' => t("The name of your library or institution."), '#required' => TRUE);
    $locum_path = trim(variable_get('sopac_locum_path', '/usr/local/include/locum'));
    if ($locum_path[0] != '/') {
        $locum_path = '/' . $locum_path;
    }
    if (substr($locum_path, -1) != '/') {
        $locum_path .= '/';
    }
    if (!file_exists($locum_path . 'locum-client.php')) {
        $locum_error = '<br /><span style="color: red;">NOTE: ' . $locum_path . 'locum-client.php does not seem to exist!</span>';
    }
    $form['sopac_general']['sopac_locum_path'] = array('#type' => 'textfield', '#title' => t('Path to the Locum Client Library'), '#default_value' => variable_get('sopac_locum_path', '/usr/local/include/locum'), '#size' => 32, '#maxlength' => 128, '#description' => t("The path to where you have installed Locum." . $locum_error), '#required' => TRUE);
    $insurge_path = trim(variable_get('sopac_insurge_path', '/usr/local/include/insurge'));
    if ($insurge_path[0] != '/') {
        $insurge_path = '/' . $insurge_path;
    }
    if (substr($insurge_path, -1) != '/') {
        $insurge_path .= '/';
    }
    if (!file_exists($insurge_path . 'insurge-client.php')) {
        $insurge_error = '<br /><span style="color: red;">NOTE: ' . $insurge_path . 'insurge-client.php does not seem to exist!</span>';
    }
    $form['sopac_general']['sopac_insurge_path'] = array('#type' => 'textfield', '#title' => t('Path to the Insurge Client Library'), '#default_value' => variable_get('sopac_insurge_path', '/usr/local/include/insurge'), '#size' => 32, '#maxlength' => 128, '#description' => t("The path to where you have installed Insurge." . $insurge_error), '#required' => TRUE);
    $form['sopac_general']['sopac_url_prefix'] = array('#type' => 'textfield', '#title' => t('SOPAC URL prefix'), '#default_value' => variable_get('sopac_url_prefix', 'cat/seek'), '#size' => 24, '#maxlength' => 72, '#description' => t("This is the URL prefix you wish SOPAC to use within the site, for example, to use www.yoursite.com/cat/seek as the base URL for SOPAC, enter 'cat/seek' without the leading or trailing slash.  If you change this, you will likely need to clear your site cache in your ") . l(t('performance settings'), 'admin/settings/performance'), '#required' => TRUE);
    $form['sopac_general']['sopac_results_per_page'] = array('#type' => 'textfield', '#title' => t('Max # of results per page'), '#default_value' => variable_get('sopac_results_per_page', 20), '#size' => 10, '#maxlength' => 4, '#description' => t("This is the maxumum number of results that will be displayed per page in the catalog hit-list."), '#required' => TRUE);
    $form['sopac_general']['sopac_search_form_cfg'] = array('#type' => 'select', '#title' => t('Default Search Form Display'), '#default_value' => variable_get('sopac_search_form_cfg', 'both'), '#description' => t("This option allows you to configure how you want the search form to be displayed from within the SOPAC context.  You can Display Just the basic search box, or the basic search box and the advanced search form drop-down option."), '#options' => array('basic' => t('Display just the basic form'), 'both' => t('Display both basic and advanced forms')));
    $form['sopac_general']['sopac_multi_branch_enable'] = array('#type' => 'checkbox', '#title' => t('Enable Multi-Branch Support'), '#default_value' => variable_get('sopac_multi_branch_enable', 0), '#description' => t('Select this option if you plan to operate SOPAC in a multi-branch environment.'));
    // the next two settings to support giving users ability to select a home branch
    $description = t('Check this box if your library has multiple branches, and you would like each user to be able to select a home branch.');
    $description .= t('<br />NOTE: this feature requires that branches are set up in the locum config.');
    $description .= t('<br />NOTE: the user option will be set up during the first cron job after checking this box.');
    $form['sopac_general']['sopac_home_branch_enable'] = array('#type' => 'checkbox', '#title' => t('Allow Users to Select a Home Branch'), '#default_value' => variable_get('sopac_home_branch_enable', 0), '#description' => $description);
    $form['sopac_general']['sopac_ssl_enable'] = array('#type' => 'checkbox', '#title' => t('Enable SSL for Account Management'), '#default_value' => variable_get('sopac_ssl_enable', 0), '#description' => t("Selecting this option will cause SOPAC to redirect browsers to an encrypted page if the user is accesing their personal information.  You will need to have SSL enabled on your web server.  This is HIGHLY RECCOMENDED.  If you enable this option, you must put the following setting in your Apache vhost configuration for this site's <VirtualHost *:443> section: SetEnv HTTPS TRUE"));
    $form['sopac_general']['sopac_ssl_port'] = array('#type' => 'textfield', '#title' => t('SSL Connection Port'), '#default_value' => variable_get('sopac_ssl_port', 443), '#size' => 6, '#maxlength' => 4, '#description' => t("This is the port that your Apache SSL process is listening on."), '#required' => TRUE);
    $form['sopac_general']['sopac_catalog_disabled'] = array('#type' => 'checkbox', '#title' => t('Disable Catalog'), '#default_value' => variable_get('sopac_catalog_disabled', 0), '#description' => t("Selecting this option will disable Requests and the My Account information provided by the catalog. Searches and Social functions will still work."));
    $form['sopac_general']['sopac_catalog_disabled_message'] = array('#type' => 'textarea', '#title' => t('Catalog Disabled Message'), '#default_value' => variable_get('sopac_catalog_disabled_message', 'Catalog access is currently disabled'), '#description' => t("This is the message displayed on the My Account page and as a tool tip on Request buttons when catalog is disabled"), '#required' => TRUE);
    $form['sopac_fines'] = array('#type' => 'fieldset', '#title' => t('Fines Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['sopac_fines']['sopac_fines_enable'] = array('#type' => 'checkbox', '#title' => t('Enable Fines Management'), '#default_value' => variable_get('sopac_fines_enable', 1), '#description' => t("Check this box to allow users to access their fines through SOPAC."));
    $form['sopac_fines']['sopac_payments_enable'] = array('#type' => 'checkbox', '#title' => t('Enable Payments Management'), '#default_value' => variable_get('sopac_payments_enable', 1), '#description' => t("Check this box to allow users to pay their fines through SOPAC."));
    $form['sopac_fines']['sopac_fines_warning_amount'] = array('#type' => 'textfield', '#title' => t('Fine Warning Amount'), '#default_value' => variable_get('sopac_fines_warning_amount', ''), '#size' => 60, '#maxlength' => 128, '#description' => t("Warning will appear on the My Account page if fines are equal to or greater than this amount"));
    $form['sopac_social_features'] = array('#type' => 'fieldset', '#title' => t('Social Feature Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // This really isn't implemented yet and is here are a reminder
    $form['sopac_social_features']['sopac_social_enable'] = array('#type' => 'checkbox', '#title' => t('Enable the Social Catalog Components'), '#default_value' => variable_get('sopac_social_enable', 1), '#description' => t("Check this box if you would like to enable community-driven reviews, ratings, comments, and tagging in the catalog."));
    $form['sopac_social_features']['sopac_random_tags'] = array('#type' => 'checkbox', '#title' => t('Random Tags'), '#default_value' => variable_get('sopac_random_tags', 1), '#description' => t("Check this box if you would like to display tags in random order."));
    $form['sopac_social_features']['sopac_tag_limit'] = array('#type' => 'textfield', '#title' => t('Tag Limit'), '#default_value' => variable_get('sopac_tag_limit', 100), '#size' => 6, '#maxlength' => 5, '#description' => t("This is the maximum number of tags to display in the tag cloud."));
    $form['sopac_social_features']['sopac_tag_sort'] = array('#type' => 'select', '#title' => t('Tag Cloud Sorting'), '#default_value' => variable_get('sopac_tag_sort', 'ORDER BY count DESC'), '#description' => t("How to sort tags in tag cloud if Random Tags is not checked."), '#options' => array('ORDER BY count ASC' => t('By count, ascending'), 'ORDER BY count DESC' => t('By count, descending'), 'ORDER BY tag ASC' => t('Alphabeticaly, ascending'), 'ORDER BY tag DESC' => t('Alphabeticaly, descending')));
    $form['sopac_social_features']['sopac_lists_staff_roles'] = array('#type' => 'checkboxes', '#title' => t('Lists Staff Roles'), '#default_value' => variable_get('sopac_lists_staff_roles', array()), '#options' => user_roles(TRUE), '#description' => "Select which roles will be marked as STAFF on public list display");
    $form['sopac_account'] = array('#type' => 'fieldset', '#title' => t('Account Page Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['sopac_account']['sopac_summary_enable'] = array('#type' => 'checkbox', '#title' => t('Enable the Account Summary on the Account page'), '#default_value' => variable_get('sopac_summary_enable', 1), '#description' => t("Check this box if you would like to enable the Account Summary on the Account page.  You probably want this."));
    $form['sopac_account']['sopac_pname_enable'] = array('#type' => 'checkbox', '#title' => t('Display Patron Name in the Account Summary'), '#default_value' => variable_get('sopac_pname_enable', 1), '#description' => t("Check this box if you would like to have patron names appear in the Account Summary."));
    $form['sopac_account']['sopac_lcard_enable'] = array('#type' => 'checkbox', '#title' => t('Display Library Card Number in the Account Summary'), '#default_value' => variable_get('sopac_lcard_enable', 1), '#description' => t("Check this box if you would like to have library card numbers appear in the Account Summary."));
    $form['sopac_account']['sopac_numco_enable'] = array('#type' => 'checkbox', '#title' => t('Display # of checkouts in the Account Summary'), '#default_value' => variable_get('sopac_numco_enable', 1), '#description' => t("Check this box if you would like # of checkouts appear in the Account Summary."));
    $form['sopac_account']['sopac_checkout_history_enable'] = array('#type' => 'checkbox', '#title' => t('Display checkout history in the user area'), '#default_value' => variable_get('sopac_checkout_history_enable', 0), '#description' => t("Check this box if you would like checkout history to appear in the user area."));
    $form['sopac_account']['sopac_checkout_history_wipe'] = array('#type' => 'checkbox', '#title' => t('Delete checkout history from ILS after harvest'), '#default_value' => variable_get('sopac_checkout_history_wipe', 1), '#description' => t("Check this box if you would like to purge checkout history from the ILS after it's imported into SOPAC."));
    $form['sopac_account']['sopac_checkout_history_cache_time'] = array('#type' => 'textfield', '#title' => t('Checkout history cache time'), '#default_value' => variable_get('sopac_checkout_history_cache_time', 60), '#description' => t("How many minutes should SOPAC wait before checking the ILS for checkout history again?"), '#size' => 6, '#maxlength' => 5);
    $form['sopac_account']['sopac_hold_freezes_enable'] = array('#type' => 'checkbox', '#title' => t('Enable freezing holds'), '#default_value' => variable_get('sopac_hold_freezes_enable', 1), '#description' => t("Check this box if you would like users to be able to freeze holds."));
    if (variable_get('sopac_fines_enable', 1)) {
        $form['sopac_account']['sopac_fines_display'] = array('#type' => 'checkbox', '#title' => t('Display Fine Amounts in the Account Summary'), '#default_value' => variable_get('sopac_fines_display', 1), '#description' => t("Check this box if you would like fine amounts to appear in the Account Summary."));
    }
    $form['sopac_account']['sopac_cardexp_enable'] = array('#type' => 'checkbox', '#title' => t('Display Library Card Expiration Date in the Account Summary'), '#default_value' => variable_get('sopac_cardexp_enable', 1), '#description' => t("Check this box if you would like to have library card expiration dates appear in the Account Summary."));
    $form['sopac_account']['sopac_tel_enable'] = array('#type' => 'checkbox', '#title' => t('Display telephone # in the Account Summary'), '#default_value' => variable_get('sopac_tel_enable', 1), '#description' => t("Check this box if you would like the patron telephone # to appear in the Account Summary."));
    $form['sopac_account']['sopac_email_enable'] = array('#type' => 'checkbox', '#title' => t('Display Email Address in the Account Summary'), '#default_value' => variable_get('sopac_email_enable', 1), '#description' => t("Check this box if you would like the patron email address to appear in the Account Summary."));
    $form['sopac_account']['sopac_invalid_cardnum'] = array('#type' => 'textarea', '#title' => t('Invalid Library Card Message'), '#default_value' => variable_get('sopac_invalid_cardnum', 'It appears that your card number is invalid.  If you feel that this is in error, please contact us.'), '#description' => t("This is the message that is displayed to users if they have entered an invalid library card number.  HTML is OK."), '#required' => TRUE);
    $form['sopac_cardnum_verify'] = array('#type' => 'fieldset', '#title' => t('Card Number Verification Requirements'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['sopac_cardnum_verify']['sopac_require_cfg'] = array('#type' => 'select', '#title' => t('Require Patrons to Meet All or One of the Requirements'), '#default_value' => variable_get('sopac_require_cfg', 'one'), '#description' => t("This option allows you to tell SOPAC if you would like to require users to fulfill all of the following enabled requirements, or just one.  For example, if this is set to just 'One', users would have to enter one correct value instead of all corect values in order to have their library card verified."), '#options' => array('one' => t('Just One'), 'all' => t('All Requirements')));
    $form['sopac_cardnum_verify']['sopac_require_name'] = array('#type' => 'checkbox', '#title' => t('Require Patron name for Verification'), '#default_value' => variable_get('sopac_require_name', 1), '#description' => t("Check this box if you would like to require the patron to type in their name in order to verify their library card number."));
    $form['sopac_cardnum_verify']['sopac_require_tel'] = array('#type' => 'checkbox', '#title' => t('Require Telephone Number for Verification'), '#default_value' => variable_get('sopac_require_tel', 1), '#description' => t("Check this box if you would like to require the patron to type in their telephone number in order to verify their library card number."));
    $form['sopac_cardnum_verify']['sopac_require_streetname'] = array('#type' => 'checkbox', '#title' => t('Use Address Street Name for Verification'), '#default_value' => variable_get('sopac_require_streetname', 1), '#description' => t("Check this box if you would like to use the street name of the patron's address to verify their library card number."));
    $form['sopac_cardnum_verify']['sopac_uv_cardnum'] = array('#type' => 'textarea', '#title' => t('Unvalidated Library Card Message'), '#default_value' => variable_get('sopac_uv_cardnum', 'The card number you have provided has not yet been verified by you.  In order to make sure that you are the rightful owner of this library card number, we need to ask you some simple questions.'), '#description' => t("This is the message that is displayed to users on their account page if they have not yet verified their library card number.  HTML is OK."), '#required' => TRUE);
    if ($current_ils == 'sirsi') {
        $form['core']['sopac_changeable_pickup_location'] = array('#type' => 'hidden', '#value' => TRUE);
        $form['core']['sopac_suspend_holds'] = array('#type' => 'hidden', '#value' => TRUE);
    } else {
        $form['core']['sopac_changeable_pickup_location'] = array('#type' => 'hidden', '#value' => FALSE);
        $form['core']['sopac_suspend_holds'] = array('#type' => 'hidden', '#value' => FALSE);
    }
    // This will call sopac_admin_submit() to clear menu cache
    $form = system_settings_form($form);
    $form['#submit'][] = 'sopac_admin_submit';
    // Return the SOPAC configuration form
    return $form;
}
Example #19
0
/**
 * Set Google API Key
 */
function agenda_admin_googleapi($form, &$form_state)
{
    $form['agenda_googleapi'] = array('#type' => 'textfield', '#title' => t('Google API Key'), '#default_value' => variable_get('agenda_googleapi', ''), '#size' => 39, '#maxlength' => 39, '#description' => t('Key for server applications - <a href="https://developers.google.com/console/help/new/#usingkeys">https://developers.google.com/console/help/new/#usingkeys</a>'), '#required' => TRUE);
    return system_settings_form($form);
}
/**
 * Build and return the complete config form.
 */
function _groupadmin_settings_form($form_state, $context = '', $id = '')
{
    //drupal_set_message(sprintf('Settings form: [%s][%s][%s]', $form_state, $context, $id));
    //drupal_set_message(sprintf('Form state: %s', print_r($form_state, 1)));
    // Get fields (with default values) for form.
    $fields = _groupadmin_settings_fields($context .= $id);
    // Get additional fields from optional module.
    $groupadmin_cp = is_callable('_groupadmin_cp_settings_fields');
    if ($groupadmin_cp) {
        $fields = _groupadmin_cp_settings_fields($fields);
    }
    // Replace default values with current values from config.
    $config = variable_get('groupadmin', array());
    if ($context) {
        foreach ($config as $key => $value) {
            if (isset($fields[$key])) {
                $context_value =& $config[$context][$id][$key];
                $fields[$key][1] = isset($context_value) ? $context_value : $config[$key];
            }
        }
    } else {
        foreach ($config as $key => $value) {
            if (isset($fields[$key])) {
                $fields[$key][1] = $config[$key];
            }
        }
    }
    // Build the basic form.
    $form = _groupadmin_settings_form_build($fields);
    // Add validatation function(s) from other modules.
    $form['#validate'] = _groupadmin_get_modules('config_validate');
    $form['#validate'][] = '_groupadmin_settings_form_validate';
    // Add buttons (etc.) using system_settings_form().
    $form = system_settings_form($form);
    // We want to use *our* submit function, so remove the one put there by system_settings_from().
    unset($form['#submit']);
    return $form;
}
 public static function build()
 {
     $form = parent::build();
     return system_settings_form($form);
 }
/**
 * Implementation of hook_form_alter().
 *
 * Add a form element to configure whether or not week numbers are ISO-8601 (default: FALSE == US/UK/AUS norm).
 */
function date_api_form_system_regional_settings_alter(&$form, $form_state, $form_id = 'system_date_time_settings')
{
    $form['locale']['date_api_use_iso8601'] = array('#type' => 'checkbox', '#title' => t('Use ISO-8601 week numbers'), '#default_value' => variable_get('date_api_use_iso8601', FALSE), '#description' => t('IMPORTANT! If checked, First day of week MUST be set to Monday'));
    $form['#validate'][] = 'date_api_form_system_settings_validate';
    $form = system_settings_form($form);
}