Пример #1
0
 public function build($form, &$form_state)
 {
     /** @var Remote $remote */
     $remote = $this->getRemote($form_state);
     $form = array('#tree' => true, 'info' => array('#type' => 'html_tag', '#tag' => 'p', '#value' => t('Select the entities you would like to send to <strong>:remote.</strong><br /><a href="#" id="deselect-all-entities">Deselect All Items</a>', array(':remote' => $remote->label))));
     // If they have opted to display the forced message...
     if ($this->getForced($form_state)) {
         $form['forced_message'] = array('#type' => 'html_tag', '#tag' => 'p', '#value' => t('<strong>Note:</strong> It appears you have opted to force sending some entities to the ' . 'remote. If you notice a large number of entities marked as \'Must be synced,\' this is probably the ' . 'cause.'));
     }
     $form['entities'] = array();
     $statuses = $this->getStatuses($form_state);
     if (is_array($statuses)) {
         foreach ($statuses as $uuid => $status) {
             // Add the main form entity item.
             $form_entity = array('check' => array('#type' => 'checkbox', '#disabled' => $status['required'], '#default_value' => $status['required'] || $status['root_entity'], '#attributes' => array('data-entity-uuid' => $uuid, 'class' => array('entity-checkbox'))), 'label' => array('#type' => 'html_tag', '#tag' => 'span', '#attributes' => array('class' => 'entity-label'), '#value' => $status['label']), 'status' => array('#type' => 'html_tag', '#tag' => 'span', '#value' => $status['required'] ? 'Must be synced.' : 'Can be synced.', '#attributes' => array('class' => 'status-holder')));
             // Prepare the JS.
             $form_entity['check']['#attached']['js'][] = array('data' => drupal_get_path('module', 'publisher') . '/js/entity_select.js');
             $form_entity['check']['#attached']['js'][] = array('type' => 'setting', 'data' => array('publisher' => array($uuid => drupal_map_assoc($status['required_if']))));
             $form['entities'][$uuid] = $form_entity;
         }
     }
     $deleted_entities = publisher_deleted_entities();
     if (count($deleted_entities) > 0) {
         $form['deleted_entitites'] = array('#type' => 'html_tag', '#tag' => 'p', '#value' => t('Additionally, there are <strong>!count</strong> entities waiting to be deleted from @remote. Would you like to !link', array('!count' => count($deleted_entities), '@remote' => $remote->label, '!link' => l('review them now?', 'admin/reports/publisher/' . $remote->name . '/deleted', array('attributes' => array('target' => '_blank'))))));
     }
     if (count($form['entities']) > 0) {
         $form['actions'] = array('#type' => 'actions');
         $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Sync Entities'));
         $form['actions']['sync_all'] = array('#type' => 'submit', '#value' => t('Sync All Entities'));
         $form['actions']['cancel'] = array('#type' => 'submit', '#value' => t('Cancel'));
     }
     return $form;
 }
 protected function setTranslatableProperties()
 {
     /**
      * 0.  Logon Options
      */
     $values['authenticationModeOptions'] = array(LDAP_AUTHENTICATION_MIXED => t('Mixed mode. Drupal authentication is tried first.  On failure, LDAP authentication is performed.'), LDAP_AUTHENTICATION_EXCLUSIVE => t('Only LDAP Authentication is allowed except for user 1.
     If selected, (1) reset password links will be replaced with links to ldap end user documentation below.
     (2) The reset password form will be left available at user/password for user 1; but no links to it
     will be provided to anonymous users.
     (3) Password fields in user profile form will be removed except for user 1.'));
     $values['authenticationServersDescription'] = t('Check all LDAP server configurations to use in authentication.
  Each will be tested for authentication until successful or
  until each is exhausted.  In most cases only one server configuration is selected.');
     /**
      * 1.  User Login Interface
      */
     $values['loginUIUsernameTxtDescription'] = t('Text to be displayed to user below the username field of
  the user login screen.');
     $values['loginUIPasswordTxtDescription'] = t('Text to be displayed to user below the password field of
  the user login screen.');
     $values['ldapUserHelpLinkUrlDescription'] = t('URL to LDAP user help/documentation for users resetting
  passwords etc. Should be of form http://domain.com/. Could be the institutions ldap password support page
  or a page within this drupal site that is available to anonymous users.');
     $values['ldapUserHelpLinkTextDescription'] = t('Text for above link e.g. Account Help or Campus Password Help Page');
     /**
      * 2.  LDAP User Restrictions
      */
     $values['allowOnlyIfTextInDnDescription'] = t('A list of text such as ou=education
   or cn=barclay that at least one of be found in user\'s dn string.  Enter one per line
   such as <pre>ou=education') . "\n" . t('ou=engineering</pre>   This test will be case insensitive.');
     $values['excludeIfTextInDnDescription'] = t('A list of text such as ou=evil
   or cn=bad that if found in a user\'s dn, exclude them from ldap authentication.
   Enter one per line such as <pre>ou=evil') . "\n" . t('cn=bad</pre> This test will be case insensitive.');
     $values['allowTestPhpDescription'] = t('PHP code which should print 1
     for allowing ldap authentication or 0 for not allowed.  Available variables are:
     $_name and $_ldap_user_entry  See readme.txt for more info.');
     $values['excludeIfNoAuthorizationsDescription'] = t('If the user is not granted any drupal roles,
   organic groups, etc. by LDAP Authorization, login will be denied.  LDAP Authorization must be
   enabled for this to work.');
     /**
      * 4. Email
      */
     $values['emailOptionOptions'] = array(LDAP_AUTHENTICATION_EMAIL_FIELD_REMOVE => t('Don\'t show an email field on user forms.  LDAP derived email will be used for user and connot be changed by user'), LDAP_AUTHENTICATION_EMAIL_FIELD_DISABLE => t('Show disabled email field on user forms with LDAP derived email.  LDAP derived email will be used for user and connot be changed by user'), LDAP_AUTHENTICATION_EMAIL_FIELD_ALLOW => t('Leave email field on user forms enabled.  Generally used when provisioning to LDAP or not using email derived from LDAP.'));
     $values['emailUpdateOptions'] = array(LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE_NOTIFY => t('Update stored email if LDAP email differs at login and notify user.'), LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE => t('Update stored email if LDAP email differs at login but don\'t notify user.'), LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_DISABLE => t('Don\'t update stored email if LDAP email differs at login.'));
     /**
      * 5. Single Sign-On / Seamless Sign-On
      */
     $values['ldapImplementationOptions'] = array('mod_auth_sspi' => t('mod_auth_sspi'), 'mod_auth_kerb' => t('mod_auth_kerb'));
     $values['cookieExpirePeriod'] = array(0 => t('Immediately')) + drupal_map_assoc(array(3600, 86400, 604800, 2592000, 31536000, 315360000), 'format_interval') + array(-1 => t('Never'));
     $values['ssoEnabledDescription'] = '<strong>' . t('Single Sign on is enabled.') . '</strong> ' . t('To disable it, disable the LDAP SSO Module on the') . ' ' . l(t('Modules Form'), 'admin/modules') . '.<p>' . t('Single Sign-On enables ' . 'users of this site to be authenticated by visiting the URL ' . '"user/login/sso, or automatically if selecting "automated ' . 'single sign-on" below. Set up of LDAP authentication must be ' . 'performed on the web server. Please review the !readme file ' . 'for more information.', array('!readme' => l(t('README.txt'), drupal_get_path('module', 'ldap_sso') . '/README.txt'))) . '</p>';
     $values['ssoExcludedPathsDescription'] = '<p>' . t("Which paths will not check for SSO? cron.php is common example.  Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard.\n          Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
     '</p>';
     $values['ssoRemoteUserStripDomainNameDescription'] = t('Useful when the ' . 'WWW server provides authentication in the form of user@realm and you ' . 'want to have both SSO and regular forms based authentication ' . 'available. Otherwise duplicate accounts with conflicting e-mail ' . 'addresses may be created.');
     $values['seamlessLogInDescription'] = t('This requires that you ' . 'have operational NTLM or Kerberos authentication turned on for at least ' . 'the path user/login/sso, or for the whole domain.');
     $values['cookieExpireDescription'] = t('If using the seamless login, a ' . 'cookie is necessary to prevent automatic login after a user ' . 'manually logs out. Select the lifetime of the cookie.');
     $values['ldapImplementationDescription'] = t('Select the type of ' . 'authentication mechanism you are using.');
     foreach ($values as $property => $default_value) {
         $this->{$property} = $default_value;
     }
 }
/**
 * @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);
}
Пример #5
0
/**
 * Contains the form for the theme settings.
 *
 * @param array $form
 *   The form array, passed by reference.
 * @param array $form_state
 *   The form state array, passed by reference.
 */
function _fly_flower_settings_form(array &$form, array $form_state)
{
    $form['cdrupal'] = array('#type' => 'vertical_tabs', '#prefix' => '<h2><small>' . t('Fly Flower Settings') . '</small></h2>', '#weight' => -11);
    // cDrupal general.
    $form['general_settings'] = array('#type' => 'fieldset', '#title' => t('General'), '#group' => 'cdrupal');
    // Socials network.
    $form['general_settings']['socials'] = array('#type' => 'fieldset', '#title' => t('Socials network'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Facebook.
    $form['general_settings']['socials']['facebook'] = array('#type' => 'textfield', '#title' => t('Facebook'), '#default_value' => theme_get_setting('facebook'));
    // Twitter.
    $form['general_settings']['socials']['twitter'] = array('#type' => 'textfield', '#title' => t('Twitter'), '#default_value' => theme_get_setting('twitter'));
    // Pinterest.
    $form['general_settings']['socials']['pinterest'] = array('#type' => 'textfield', '#title' => t('Pinterest'), '#default_value' => theme_get_setting('pinterest'));
    // Footer.
    $form['footer'] = array('#type' => 'fieldset', '#title' => t('Footer'), '#group' => 'cdrupal');
    // Copyright text.
    $form['footer']['copyright'] = array('#type' => 'textarea', '#title' => t('Copyright'), '#default_value' => theme_get_setting('copyright'));
    // Credit.
    $form['footer']['credit'] = array('#type' => 'checkbox', '#title' => t('Don\'t not show theme author: Theme by <a href="http://cdrupal.com/"><strong>cDrupal</strong></a>'), '#default_value' => theme_get_setting('credit'));
    // Wrap global setting fieldsets in vertical tabs.
    $form['general'] = array('#type' => 'vertical_tabs', '#prefix' => '<h2><small>' . t('Override Global Settings') . '</small></h2>', '#weight' => -9);
    $form['theme_settings']['#group'] = 'general';
    $form['logo']['#group'] = 'general';
    $form['favicon']['#group'] = 'general';
    // Do not add Bootstrap specific settings to global settings.
    if (empty($form_state['build_info']['args'][0])) {
        unset($form['general']['#prefix']);
        return;
    }
    // BootstrapCDN.
    $form['advanced']['bootstrap_cdn'] = array('#type' => 'fieldset', '#title' => t('BootstrapCDN'), '#description' => t('Use !bootstrapcdn to serve the Bootstrap framework files. Enabling this setting will prevent this theme from attempting to load any Bootstrap framework files locally. !warning', array('!bootstrapcdn' => l(t('BootstrapCDN'), 'http://bootstrapcdn.com', array('external' => TRUE)), '!warning' => '<div class="alert alert-info messages info"><strong>' . t('NOTE') . ':</strong> ' . t('While BootstrapCDN (content distribution network) is the preferred method for providing huge performance gains in load time, this method does depend on using this third party service. BootstrapCDN is under no obligation or commitment to provide guaranteed up-time or service quality for this theme. If you choose to disable this setting, you must provide your own Bootstrap source and/or optional CDN delivery implementation.') . '</div>')), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['advanced']['bootstrap_cdn']['bootstrap_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN version'), '#options' => drupal_map_assoc(array('3.0.0', '3.0.1', '3.0.2', '3.3.4')), '#default_value' => theme_get_setting('bootstrap_cdn'), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
}
Пример #6
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function scholarly_lite_form_system_theme_settings_alter(&$form, &$form_state)
{
    $form['mtt_settings'] = array('#type' => 'fieldset', '#title' => t('MtT Theme Settings'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    $form['mtt_settings']['tabs'] = array('#type' => 'vertical_tabs', '#attached' => array('css' => array(drupal_get_path('theme', 'scholarly_lite') . '/scholarly_lite.settings.form.css')));
    $form['mtt_settings']['tabs']['basic_settings'] = array('#type' => 'fieldset', '#title' => t('Basic Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['breadcrumb'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Breadcrumb</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Show breadcrumb'), '#description' => t('Use the checkbox to enable or disable Breadcrumb.'), '#default_value' => theme_get_setting('breadcrumb_display'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['header'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Header positioning</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['fixed_header'] = array('#type' => 'checkbox', '#title' => t('Fixed position'), '#description' => t('Use the checkbox to apply fixed position to the header.'), '#default_value' => theme_get_setting('fixed_header'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['scrolltop'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Scroll to top</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['scrolltop_display'] = array('#type' => 'checkbox', '#title' => t('Show scroll-to-top button'), '#description' => t('Use the checkbox to enable or disable scroll-to-top button.'), '#default_value' => theme_get_setting('scrolltop_display'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['frontpage_content'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Front Page Behavior</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['frontpage_content_print'] = array('#type' => 'checkbox', '#title' => t('Drupal frontpage content'), '#description' => t('Use the checkbox to enable or disable the Drupal default frontpage functionality. Enable this to have all the promoted content displayed in the frontpage.'), '#default_value' => theme_get_setting('frontpage_content_print'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['bootstrap_cdn'] = array('#type' => 'fieldset', '#title' => t('BootstrapCDN'), '#group' => 'bootstrap');
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_css_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete CSS version'), '#options' => drupal_map_assoc(array('3.2.0', '3.3.6')), '#default_value' => theme_get_setting('bootstrap_css_cdn'), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_js_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete JavaScript version'), '#options' => drupal_map_assoc(array('3.2.0', '3.3.6')), '#default_value' => theme_get_setting('bootstrap_js_cdn'), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_fa_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete Font Awesome version'), '#options' => drupal_map_assoc(array('4.2.0', '4.5.0')), '#default_value' => theme_get_setting('bootstrap_fa_cdn'), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['layout'] = array('#type' => 'fieldset', '#title' => t('Layout'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['layout']['three_columns_grid_layout'] = array('#type' => 'select', '#title' => t('Adjustments to the three-column, Bootstrap layout grid'), '#description' => t('From the drop-down menu, select the grid of the three-column layout you would like to use. This way, you can set the width of each of your columns, when choosing a three-column layout. 
    <br><br>Note: All options refer to Bootstrap columns.'), '#default_value' => theme_get_setting('three_columns_grid_layout'), '#options' => array('grid_3_6_3' => t('3-6-3/Default'), 'grid_2_6_4' => t('2-6-4'), 'grid_4_6_2' => t('4-6-2')));
    $form['mtt_settings']['tabs']['looknfeel'] = array('#type' => 'fieldset', '#title' => t('Look\'n\'Feel'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['looknfeel']['color_scheme'] = array('#type' => 'select', '#title' => t('Color Schemes'), '#description' => t('From the drop-down menu, select the color scheme you prefer.'), '#default_value' => theme_get_setting('color_scheme'), '#options' => array('default' => t('Gray'), 'gray-green' => t('Gray Green'), 'gray-orange' => t('Gray Orange'), 'gray-red' => t('Gray Red'), 'gray-pink' => t('Gray Pink'), 'gray-purple' => t('Gray Purple'), 'blue' => t('Blue'), 'green' => t('Green'), 'orange' => t('Orange'), 'red' => t('Red'), 'pink' => t('Pink'), 'purple' => t('Purple')));
    $form['mtt_settings']['tabs']['font'] = array('#type' => 'fieldset', '#title' => t('Font Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['font']['font_title'] = array('#type' => 'item', '#markup' => 'For every region pick the <strong>font-family</strong> that corresponds to your needs.');
    $form['mtt_settings']['tabs']['font']['sitename_font_family'] = array('#type' => 'select', '#title' => t('Site name'), '#default_value' => theme_get_setting('sitename_font_family'), '#options' => array('sff-1' => t('Merriweather, Georgia, Times, Serif'), 'sff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'sff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'sff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'sff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'sff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'sff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'sff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'sff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'sff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'sff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'sff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'sff-13' => t('Georgia, Times, Serif'), 'sff-14' => t('Playfair Display, Times, Serif'), 'sff-15' => t('Philosopher, Georgia, Times, Serif'), 'sff-16' => t('Cinzel, Georgia, Times, Serif'), 'sff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'sff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'sff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'sff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'sff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'sff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'sff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'sff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'sff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'sff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'sff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'sff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'sff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'sff-30' => t('Times, Times New Roman, Serif'), 'sff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['font']['slogan_font_family'] = array('#type' => 'select', '#title' => t('Slogan'), '#default_value' => theme_get_setting('slogan_font_family'), '#options' => array('slff-1' => t('Merriweather, Georgia, Times, Serif'), 'slff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'slff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'slff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'slff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'slff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'slff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'slff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'slff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'slff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'slff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'slff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'slff-13' => t('Georgia, Times, Serif'), 'slff-14' => t('Playfair Display, Times, Serif'), 'slff-15' => t('Philosopher, Georgia, Times, Serif'), 'slff-16' => t('Cinzel, Georgia, Times, Serif'), 'slff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'slff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'slff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'slff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'slff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'slff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'slff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'slff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'slff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'slff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'slff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'slff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'slff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'slff-30' => t('Times, Times New Roman, Serif'), 'slff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['font']['headings_font_family'] = array('#type' => 'select', '#title' => t('Headings'), '#default_value' => theme_get_setting('headings_font_family'), '#options' => array('hff-1' => t('Merriweather, Georgia, Times, Serif'), 'hff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'hff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'hff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'hff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'hff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'hff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'hff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'hff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'hff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'hff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'hff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'hff-13' => t('Georgia, Times, Serif'), 'hff-14' => t('Playfair Display, Times, Serif'), 'hff-15' => t('Philosopher, Georgia, Times, Serif'), 'hff-16' => t('Cinzel, Georgia, Times, Serif'), 'hff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'hff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'hff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'hff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'hff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'hff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'hff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'hff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'hff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'hff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'hff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'hff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'hff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'hff-30' => t('Times, Times New Roman, Serif'), 'hff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['font']['paragraph_font_family'] = array('#type' => 'select', '#title' => t('Paragraph'), '#default_value' => theme_get_setting('paragraph_font_family'), '#options' => array('pff-1' => t('Merriweather, Georgia, Times, Serif'), 'pff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'pff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'pff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'pff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'pff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'pff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'pff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'pff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'pff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'pff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'pff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'pff-13' => t('Georgia, Times, Serif'), 'pff-14' => t('Playfair Display, Times, Serif'), 'pff-15' => t('Philosopher, Georgia, Times, Serif'), 'pff-16' => t('Cinzel, Georgia, Times, Serif'), 'pff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'pff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'pff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'pff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'pff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'pff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'pff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'pff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'pff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'pff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'pff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'pff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'pff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'pff-30' => t('Times, Times New Roman, Serif'), 'pff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['responsive_menu'] = array('#type' => 'fieldset', '#title' => t('Responsive menu'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_multiLevel_menu'] = array('#type' => 'fieldset', '#title' => t('Responsive Multilevel Menu'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_multiLevel_menu']['responsive_multilevelmenu_state'] = array('#type' => 'checkbox', '#title' => t('Enable responsive menu'), '#description' => t('Use the checkbox to enable the plugin which transforms the Main menu of your site to a responsive multilevel menu when your browser is at mobile widths.'), '#default_value' => theme_get_setting('responsive_multilevelmenu_state'));
    $form['mtt_settings']['tabs']['credits'] = array('#type' => 'fieldset', '#title' => t('Credits'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['mtt_settings']['tabs']['credits']['credits_display'] = array('#type' => 'checkbox', '#title' => t('Show credits'), '#description' => t('Use the checkbox to enable or disable credits.'), '#default_value' => theme_get_setting('credits_display'));
}
 /**
  * Implements EntityReferenceHandler::settingsForm().
  */
 public static function settingsForm($field, $instance)
 {
     $entity_info = entity_get_info($field['settings']['target_type']);
     if (!empty($entity_info['entity keys']['bundle'])) {
         $bundles = array();
         foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
             $bundles[$bundle_name] = $bundle_info['label'];
         }
         $form['target_bundles'] = array('#type' => 'select', '#title' => t('Target bundles'), '#options' => $bundles, '#default_value' => isset($field['settings']['handler_settings']['target_bundles']) ? $field['settings']['handler_settings']['target_bundles'] : array(), '#size' => 6, '#multiple' => TRUE, '#description' => t('The bundles of the entity type that can be referenced. Optional, leave empty for all bundles.'));
     } else {
         $form['target_bundles'] = array('#type' => 'value', '#value' => array());
     }
     $form['sort']['type'] = array('#type' => 'radios', '#title' => t('Sort by'), '#options' => array('none' => t("Don't sort"), 'property' => t('A property of the base table of the entity'), 'field' => t('A field attached to this entity')), '#default_value' => isset($field['settings']['handler_settings']['sort']['type']) ? $field['settings']['handler_settings']['sort']['type'] : 'none');
     $form['sort']['property'] = array('#type' => 'select', '#title' => t('Sort property'), '#options' => drupal_map_assoc($entity_info['schema_fields_sql']['base table']), '#default_value' => isset($field['settings']['handler_settings']['sort']['property']) ? $field['settings']['handler_settings']['sort']['property'] : '', '#states' => array('visible' => array(':input[name="field[settings][handler_settings][sort][type]"]' => array('value' => 'property'))));
     $fields = array();
     foreach (field_info_instances($field['settings']['target_type']) as $bundle_name => $bundle_instances) {
         foreach ($bundle_instances as $instance_name => $instance_info) {
             $field_info = field_info_field($instance_name);
             foreach ($field_info['columns'] as $column_name => $column_info) {
                 $fields[$instance_name . ':' . $column_name] = t('@label (column @column)', array('@label' => $instance_info['label'], '@column' => $column_name));
             }
         }
     }
     $form['sort']['field'] = array('#type' => 'select', '#title' => t('Sort field'), '#options' => $fields, '#default_value' => isset($field['settings']['handler_settings']['sort']['type']) ? $field['settings']['handler_settings']['sort']['type'] : '', '#states' => array('visible' => array(':input[name="field[settings][handler_settings][sort][type]"]' => array('value' => 'field'))));
     $form['sort']['direction'] = array('#type' => 'select', '#title' => t('Sort direction'), '#options' => array('ASC' => t('Ascending'), 'DESC' => t('Descending')), '#default_value' => isset($field['settings']['handler_settings']['sort']['direction']) ? $field['settings']['handler_settings']['sort']['direction'] : 'ASC', '#states' => array('invisible' => array(':input[name="field[settings][handler_settings][sort][type]"]' => array('value' => 'none'))));
     return $form;
 }
Пример #8
0
 /**
  * Preset form altering.
  *
  * @inhetirdoc
  */
 public function presetFormAlter(&$form, &$form_state, $preset_data)
 {
     $elements = array();
     $elements['maptype'] = array('#type' => 'select', '#title' => t('Map Type'), '#default_value' => !empty($preset_data['maptype']) ? $preset_data['maptype'] : '', '#options' => $this->mapTypes());
     $elements['zoom'] = array('#type' => 'select', '#title' => t('Zoom'), '#options' => array('auto' => t('Automatic')) + drupal_map_assoc(range(0, 21)), '#default_value' => isset($preset_data['zoom']) ? $preset_data['zoom'] : 'auto');
     return $elements;
 }
Пример #9
0
function update_script_selection_form()
{
    $form = array();
    $form['start'] = array('#tree' => TRUE, '#type' => 'fieldset', '#title' => 'Select versions', '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Ensure system.module's updates appear first
    $form['start']['system'] = array();
    $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);
    foreach ($modules as $module => $schema_version) {
        $updates = drupal_get_schema_versions($module);
        // Skip incompatible module updates completely, otherwise test schema versions.
        if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) {
            // module_invoke returns NULL for nonexisting hooks, so if no updates
            // are removed, it will == 0.
            $last_removed = module_invoke($module, 'update_last_removed');
            if ($schema_version < $last_removed) {
                $form['start'][$module] = array('#value' => '<em>' . $module . '</em> module can not be updated. Its schema version is ' . $schema_version . '. Updates up to and including ' . $last_removed . ' have been removed in this release. In order to update <em>' . $module . '</em> module, you will first <a href="http://drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.', '#prefix' => '<div class="warning">', '#suffix' => '</div>');
                $form['start']['#collapsed'] = FALSE;
                continue;
            }
            $updates = drupal_map_assoc($updates);
            $updates[] = 'No updates available';
            $default = $schema_version;
            foreach (array_keys($updates) as $update) {
                if ($update > $schema_version) {
                    $default = $update;
                    break;
                }
            }
            $form['start'][$module] = array('#type' => 'select', '#title' => $module . ' module', '#default_value' => $default, '#options' => $updates);
        }
    }
    $form['has_js'] = array('#type' => 'hidden', '#default_value' => FALSE);
    $form['submit'] = array('#type' => 'submit', '#value' => 'Update');
    return $form;
}
 protected function queryLoad($ids)
 {
     $multifields = multifield_get_fields();
     foreach (array_keys($multifields) as $field_name) {
         $query = new EntityFieldQuery();
         if ($ids) {
             $query->fieldCondition($field_name, 'id', $ids, 'IN');
         } else {
             $query->fieldCondition($field_name, 'id', 0, '>');
         }
         if ($results = $query->execute()) {
             $pseudo_entities = array();
             $field = field_info_field($field_name);
             foreach ($results as $entity_type => $entities) {
                 // Simply doing an entity load on the entities with multifield values
                 // will cause the cacheSet() from multifield_field_load() to get
                 // invoked.
                 $entities = entity_load($entity_type, array_keys($entities));
                 foreach ($entities as $entity) {
                     if ($items = field_get_items($entity_type, $entity, $field_name)) {
                         foreach ($items as $item) {
                             $pseudo_entities[$item['id']] = _multifield_field_item_to_entity($field['type'], $item);
                         }
                     }
                 }
             }
             $this->cacheSet($pseudo_entities);
         }
     }
     return array_intersect_key($this->entityCache, drupal_map_assoc($ids, $ids));
 }
Пример #11
0
 /**
  * Constructs a FullcalendarPluginBag object.
  *
  * @param \Drupal\Component\Plugin\PluginManagerInterface $manager
  *   The manager to be used for instantiating plugins.
  * @param \Drupal\views\Plugin\views\style\StylePluginBase $style
  *   The style plugin that contains these plugins.
  */
 public function __construct(PluginManagerInterface $manager, StylePluginBase $style)
 {
     $this->manager = $manager;
     $this->style = $style;
     // Store all display IDs to access them easy and fast.
     $definitions = $this->manager->getDefinitions();
     $this->instanceIDs = drupal_map_assoc(array_keys($definitions));
 }
 /**
  * Settings form for the simple scheduler.
  */
 public function settingsForm(&$form, &$form_state, $job = NULL)
 {
     $elements =& $form['settings'][$this->type][$this->name];
     $values =& $form_state['values']['settings'][$this->type][$this->name];
     $rule = is_array($values['rules']) ? reset($values['rules']) : '';
     $intervals = drupal_map_assoc($this->presets, 'format_interval');
     $options = array_combine(array_keys($this->presets), $intervals);
     $elements['rules'] = array('#type' => 'select', '#title' => t('Run cron every'), '#default_value' => $rule, '#description' => t('Select the interval you wish cron to run on.'), '#options' => $options, '#fallback' => TRUE, '#required' => TRUE);
 }
Пример #13
0
 function settingsForm()
 {
     $form = parent::settingsForm();
     // Provider specific settings.
     $form['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_categories'] = array('#type' => 'select', '#title' => t('Lorempixum Categories'), '#options' => drupal_map_assoc(array('any', 'abstract', 'animals', 'city', 'food', 'nightlife', 'fashion', 'people', 'nature', 'sports', 'technics', 'transport')), '#multiple' => TRUE, '#size' => 12, '#default_value' => isset($this->settings['devel_image_provider_categories']) ? $this->settings['devel_image_provider_categories'] : 'any');
     $form['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_include_text'] = array('#type' => 'radios', '#title' => t('Choose whether or not to add text inside the generated image'), '#default_value' => isset($this->settings['devel_image_provider_include_text']) ? $this->settings['devel_image_provider_include_text'] : 'default', '#options' => array('default' => t('No text'), 'random' => t('Random text'), 'custom' => t('Custom text')));
     $form['devel_image_provider_' . $this->plugin['name']]['devel_image_provider_custom_text'] = array('#type' => 'textfield', '#title' => t('Custom Text'), '#maxlength' => 255, '#description' => t('Enter some custom text to be rendered instead of the default image dimensions.'), '#default_value' => isset($this->settings['devel_image_provider_custom_text']) ? $this->settings['devel_image_provider_custom_text'] : NULL, '#states' => array('visible' => array(':input[name="available_providers[devel_image_provider_method_selected][devel_image_provider_' . $this->plugin['name'] . '][devel_image_provider_include_text]"]' => array('value' => 'custom'))));
     return $form;
 }
Пример #14
0
function update_script_selection_form()
{
    $form = array();
    $count = 0;
    $form['start'] = array('#tree' => TRUE, '#type' => 'fieldset', '#collapsed' => TRUE, '#collapsible' => TRUE);
    // Ensure system.module's updates appear first
    $form['start']['system'] = array();
    $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);
    foreach ($modules as $module => $schema_version) {
        $pending = array();
        $updates = drupal_get_schema_versions($module);
        // Skip incompatible module updates completely, otherwise test schema versions.
        if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) {
            // module_invoke returns NULL for nonexisting hooks, so if no updates
            // are removed, it will == 0.
            $last_removed = module_invoke($module, 'update_last_removed');
            if ($schema_version < $last_removed) {
                $form['start'][$module] = array('#title' => $module, '#item' => '<em>' . $module . '</em> module can not be updated. Its schema version is ' . $schema_version . '. Updates up to and including ' . $last_removed . ' have been removed in this release. In order to update <em>' . $module . '</em> module, you will first <a href="http://drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.', '#prefix' => '<div class="warning">', '#suffix' => '</div>');
                continue;
            }
            $updates = drupal_map_assoc($updates);
            foreach (array_keys($updates) as $update) {
                if ($update > $schema_version) {
                    // The description for an update comes from its Doxygen.
                    $func = new ReflectionFunction($module . '_update_' . $update);
                    $description = str_replace(array("\n", '*', '/'), '', $func->getDocComment());
                    $pending[] = "{$update} - {$description}";
                    if (!isset($default)) {
                        $default = $update;
                    }
                }
            }
            if (!empty($pending)) {
                if (!isset($default)) {
                    $default = $schema_version;
                }
                $form['start'][$module] = array('#type' => 'hidden', '#value' => $default);
                $form['start'][$module . '_updates'] = array('#markup' => theme('item_list', $pending, $module . ' module'));
            }
        }
        unset($default);
        $count = $count + count($pending);
    }
    if (empty($count)) {
        drupal_set_message(t('No pending updates.'));
        unset($form);
        $form['links'] = array('#markup' => theme('item_list', update_helpful_links()));
    } else {
        $form['help'] = array('#markup' => '<p>The version of Drupal you are updating from has been automatically detected.</p>', '#weight' => -5);
        $form['start']['#title'] = strtr('!num pending updates', array('!num' => $count));
        $form['has_js'] = array('#type' => 'hidden', '#default_value' => FALSE);
        $form['submit'] = array('#type' => 'submit', '#value' => 'Apply pending updates');
    }
    return $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;
}
Пример #17
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function dahal_form_system_theme_settings_alter(&$form, &$form_state)
{
    $form['mtt_settings'] = array('#type' => 'fieldset', '#title' => t('Bootstrap Business Theme Settings'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    $form['mtt_settings']['tabs'] = array('#type' => 'vertical_tabs');
    $form['mtt_settings']['tabs']['basic_settings'] = array('#type' => 'fieldset', '#title' => t('Basic Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Show breadcrumb'), '#description' => t('Use the checkbox to enable or disable the breadcrumb.'), '#default_value' => theme_get_setting('breadcrumb_display', 'dahal'));
    $form['mtt_settings']['tabs']['basic_settings']['scrolltop_display'] = array('#type' => 'checkbox', '#title' => t('Show scroll-to-top button'), '#description' => t('Use the checkbox to enable or disable scroll-to-top button.'), '#default_value' => theme_get_setting('scrolltop_display', 'dahal'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['bootstrap_cdn'] = array('#type' => 'fieldset', '#title' => t('BootstrapCDN'), '#group' => 'bootstrap');
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_css_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete CSS version'), '#options' => drupal_map_assoc(array('3.2.0')), '#default_value' => theme_get_setting('bootstrap_css_cdn'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_js_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete JavaScript version'), '#options' => drupal_map_assoc(array('3.2.0')), '#default_value' => theme_get_setting('bootstrap_js_cdn'), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['ie8_support'] = array('#type' => 'fieldset', '#title' => t('IE8 support'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['mtt_settings']['tabs']['ie8_support']['responsive_respond'] = array('#type' => 'checkbox', '#title' => t('Add Respond.js [<em>bootstrap-business/js/respond.min.js</em>] JavaScript to add basic CSS3 media query support to IE 6-8.'), '#default_value' => theme_get_setting('responsive_respond', 'dahal'), '#description' => t('IE 6-8 require a JavaScript polyfill solution to add basic support of CSS3 media queries. Note that you should enable <strong>Aggregate and compress CSS files</strong> through <em>/admin/config/development/performance</em>.'));
}
 /**
  * {@inheritdoc}
  */
 public function buildConfigurationForm(array $form, array &$form_state)
 {
     // Add a list of fields to include for autocomplete searches.
     $search = $this->getSearch();
     $fields = $search->index()->getFields();
     $fulltext_fields = $search->index()->getFulltextFields();
     $options = array();
     foreach ($fulltext_fields as $field) {
         $options[$field] = $fields[$field]['name'];
     }
     $form['fields'] = array('#type' => 'checkboxes', '#title' => t('Override used fields'), '#description' => t('Select the fields which should be searched for matches when looking for autocompletion suggestions. Leave blank to use the same fields as the underlying search.'), '#options' => $options, '#default_value' => drupal_map_assoc($this->configuration['fields']), '#attributes' => array('class' => array('search-api-checkboxes-list')));
     $form['#attached']['css'][] = drupal_get_path('module', 'search_api') . '/search_api.admin.css';
     return $form;
 }
Пример #19
0
/**
 * Implements hook_form_FORM_ID_alter().
 *
 * @param $form
 *   The form.
 * @param $form_state
 *   The form state.
 */
function myvastra_form_system_theme_settings_alter(&$form, &$form_state)
{
    $form['mtt_settings'] = array('#type' => 'fieldset', '#title' => t('MtT Theme Settings'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    $form['mtt_settings']['tabs'] = array('#type' => 'vertical_tabs', '#attached' => array('css' => array(drupal_get_path('theme', 'myvastra') . '/myvastra.settings.form.css')));
    $form['mtt_settings']['tabs']['basic_settings'] = array('#type' => 'fieldset', '#title' => t('Basic Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['breadcrumb'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Breadcrumb</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Show breadcrumb'), '#description' => t('Use the checkbox to enable or disable Breadcrumb.'), '#default_value' => theme_get_setting('breadcrumb_display'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['header'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Header positioning</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['fixed_header'] = array('#type' => 'checkbox', '#title' => t('Fixed position'), '#description' => t('Use the checkbox to apply fixed position to the header.'), '#default_value' => theme_get_setting('fixed_header'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['scrolltop'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Scroll to top</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['scrolltop_display'] = array('#type' => 'checkbox', '#title' => t('Show scroll-to-top button'), '#description' => t('Use the checkbox to enable or disable scroll-to-top button.'), '#default_value' => theme_get_setting('scrolltop_display'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['basic_settings']['frontpage_content'] = array('#type' => 'item', '#markup' => t('<div class="theme-settings-title">Front Page Behavior</div>'));
    $form['mtt_settings']['tabs']['basic_settings']['frontpage_content_print'] = array('#type' => 'checkbox', '#title' => t('Drupal frontpage content'), '#description' => t('Use the checkbox to enable or disable the Drupal default frontpage functionality. Enable this to have all the promoted content displayed in the frontpage.'), '#default_value' => theme_get_setting('frontpage_content_print'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['bootstrap_cdn'] = array('#type' => 'fieldset', '#title' => t('BootstrapCDN'), '#group' => 'bootstrap');
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_css_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete CSS version'), '#options' => drupal_map_assoc(array('3.2.0', '3.3.2')), '#default_value' => theme_get_setting('bootstrap_css_cdn'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['bootstrap_cdn']['bootstrap_js_cdn'] = array('#type' => 'select', '#title' => t('BootstrapCDN Complete JavaScript version'), '#options' => drupal_map_assoc(array('3.2.0', '3.3.2')), '#default_value' => theme_get_setting('bootstrap_js_cdn'), '#empty_option' => t('Disabled'), '#empty_value' => NULL);
    $form['mtt_settings']['tabs']['looknfeel'] = array('#type' => 'fieldset', '#title' => t('Look\'n\'Feel'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['looknfeel']['color_scheme'] = array('#type' => 'select', '#title' => t('Color Schemes'), '#description' => t('From the drop-down menu, select the color scheme you prefer.'), '#default_value' => theme_get_setting('color_scheme'), '#options' => array('default' => t('Gray Blue/Default'), 'gray-green' => t('Gray Green'), 'gray-orange' => t('Gray Orange'), 'gray-red' => t('Gray Red'), 'gray-pink' => t('Gray Pink'), 'gray-purple' => t('Gray Purple'), 'blue' => t('Blue'), 'green' => t('Green'), 'orange' => t('Orange'), 'red' => t('Red'), 'pink' => t('Pink'), 'purple' => t('Purple')));
    $form['mtt_settings']['tabs']['looknfeel']['form_style'] = array('#type' => 'select', '#title' => t('Form styles of contact page'), '#description' => t('From the drop-down menu, select the form style that you prefer.'), '#default_value' => theme_get_setting('form_style'), '#options' => array('form-style-1' => t('Style-1 (default)'), 'form-style-2' => t('Style-2')));
    $form['mtt_settings']['tabs']['layout_modes'] = array('#type' => 'fieldset', '#title' => t('Layout'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['layout_modes']['layout_mode'] = array('#type' => 'select', '#title' => t('Layout Mode'), '#description' => t('From the drop-down menu, select the layout mode you prefer.'), '#default_value' => theme_get_setting('layout_mode'), '#options' => array('wide' => t('Wide'), 'boxed' => t('Boxed')));
    $form['mtt_settings']['tabs']['font'] = array('#type' => 'fieldset', '#title' => t('Font Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['font']['font_title'] = array('#type' => 'item', '#markup' => 'For every region pick the <strong>font-family</strong> that corresponds to your needs.');
    $form['mtt_settings']['tabs']['font']['sitename_font_family'] = array('#type' => 'select', '#title' => t('Site name'), '#default_value' => theme_get_setting('sitename_font_family'), '#options' => array('sff-1' => t('Merriweather, Georgia, Times, Serif'), 'sff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'sff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'sff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'sff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'sff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'sff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'sff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'sff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'sff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'sff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'sff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'sff-13' => t('Georgia, Times, Serif'), 'sff-14' => t('Playfair Display, Times, Serif'), 'sff-15' => t('Philosopher, Georgia, Times, Serif'), 'sff-16' => t('Cinzel, Georgia, Times, Serif'), 'sff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'sff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'sff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'sff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'sff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'sff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'sff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'sff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'sff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'sff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'sff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'sff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'sff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'sff-30' => t('Times, Times New Roman, Serif'), 'sff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')));
    $form['mtt_settings']['tabs']['font']['slogan_font_family'] = array('#type' => 'select', '#title' => t('Slogan'), '#default_value' => theme_get_setting('slogan_font_family'), '#options' => array('slff-1' => t('Merriweather, Georgia, Times, Serif'), 'slff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'slff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'slff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'slff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'slff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'slff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'slff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'slff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'slff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'slff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'slff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'slff-13' => t('Georgia, Times, Serif'), 'slff-14' => t('Playfair Display, Times, Serif'), 'slff-15' => t('Philosopher, Georgia, Times, Serif'), 'slff-16' => t('Cinzel, Georgia, Times, Serif'), 'slff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'slff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'slff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'slff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'slff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'slff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'slff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'slff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'slff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'slff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'slff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'slff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'slff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'slff-30' => t('Times, Times New Roman, Serif'), 'slff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')));
    $form['mtt_settings']['tabs']['font']['headings_font_family'] = array('#type' => 'select', '#title' => t('Headings'), '#default_value' => theme_get_setting('headings_font_family'), '#options' => array('hff-1' => t('Merriweather, Georgia, Times, Serif'), 'hff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'hff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'hff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'hff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'hff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'hff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'hff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'hff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'hff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'hff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'hff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'hff-13' => t('Georgia, Times, Serif'), 'hff-14' => t('Playfair Display, Times, Serif'), 'hff-15' => t('Philosopher, Georgia, Times, Serif'), 'hff-16' => t('Cinzel, Georgia, Times, Serif'), 'hff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'hff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'hff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'hff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'hff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'hff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'hff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'hff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'hff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'hff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'hff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'hff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'hff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'hff-30' => t('Times, Times New Roman, Serif'), 'hff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')));
    $form['mtt_settings']['tabs']['font']['paragraph_font_family'] = array('#type' => 'select', '#title' => t('Paragraph'), '#default_value' => theme_get_setting('paragraph_font_family'), '#options' => array('pff-1' => t('Merriweather, Georgia, Times, Serif'), 'pff-2' => t('Source Sans Pro, Helvetica Neuee, Arial, Sans-serif'), 'pff-3' => t('Ubuntu, Helvetica Neue, Arial, Sans-serif'), 'pff-4' => t('PT Sans, Helvetica Neue, Arial, Sans-serif'), 'pff-5' => t('Roboto, Helvetica Neue, Arial, Sans-serif'), 'pff-6' => t('Open Sans, Helvetica Neue, Arial, Sans-serif'), 'pff-7' => t('Lato, Helvetica Neue, Arial, Sans-serif'), 'pff-8' => t('Roboto Condensed, Arial Narrow, Arial, Sans-serif'), 'pff-9' => t('Exo, Arial, Helvetica Neue, Sans-serif'), 'pff-10' => t('Roboto Slab, Trebuchet MS, Sans-serif'), 'pff-11' => t('Raleway, Helvetica Neue, Arial, Sans-serif'), 'pff-12' => t('Josefin Sans, Georgia, Times, Serif'), 'pff-13' => t('Georgia, Times, Serif'), 'pff-14' => t('Playfair Display, Times, Serif'), 'pff-15' => t('Philosopher, Georgia, Times, Serif'), 'pff-16' => t('Cinzel, Georgia, Times, Serif'), 'pff-17' => t('Oswald, Helvetica Neue, Arial, Sans-serif'), 'pff-18' => t('Playfair Display SC, Georgia, Times, Serif'), 'pff-19' => t('Cabin, Helvetica Neue, Arial, Sans-serif'), 'pff-20' => t('Noto Sans, Arial, Helvetica Neue, Sans-serif;'), 'pff-21' => t('Helvetica Neue, Arial, Sans-serif'), 'pff-22' => t('Droid Serif, Georgia, Times, Times New Roman, Serif'), 'pff-23' => t('PT Serif, Georgia, Times, Times New Roman, Serif'), 'pff-24' => t('Vollkorn, Georgia, Times, Times New Roman, Serif'), 'pff-25' => t('Alegreya, Georgia, Times, Times New Roman, Serif'), 'pff-26' => t('Noto Serif, Georgia, Times, Times New Roman, Serif'), 'pff-27' => t('Crimson Text, Georgia, Times, Times New Roman, Serif'), 'pff-28' => t('Gentium Book Basic, Georgia, Times, Times New Roman, Serif'), 'pff-29' => t('Volkhov, Georgia, Times, Times New Roman, Serif'), 'pff-30' => t('Times, Times New Roman, Serif'), 'pff-31' => t('Alegreya SC, Georgia, Times, Times New Roman, Serif')));
    $form['mtt_settings']['tabs']['responsive_menu'] = array('#type' => 'fieldset', '#title' => t('Responsive menu'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_multiLevel_menu'] = array('#type' => 'fieldset', '#title' => t('Responsive Multilevel Menu'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_multiLevel_menu']['responsive_multilevelmenu_state'] = array('#type' => 'checkbox', '#title' => t('Enable responsive menu'), '#description' => t('Use the checkbox to enable the plugin which transforms the Main menu of your site to a responsive multilevel menu when your browser is at mobile widths (requires jQuery >= 1.7.0 ).'), '#default_value' => theme_get_setting('responsive_multilevelmenu_state'));
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_select_menu'] = array('#type' => 'fieldset', '#title' => t('Responsive menu - Select list'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_select_menu']['responsive_menu_state'] = array('#type' => 'checkbox', '#title' => t('Enable responsive menu'), '#description' => t('Use the checkbox to enable the plugin which transforms the Main menu of your site to a dropdown select list when your browser is at mobile widths.'), '#default_value' => theme_get_setting('responsive_menu_state'));
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_select_menu']['responsive_menu_switchwidth'] = array('#type' => 'textfield', '#title' => t('Switch width (px)'), '#description' => t('Set the width (in pixels) at which the Main menu of the site will change to a dropdown select list.'), '#default_value' => theme_get_setting('responsive_menu_switchwidth'));
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_select_menu']['responsive_menu_topoptiontext'] = array('#type' => 'textfield', '#title' => t('Top option text'), '#description' => t('Set the very first option display text.'), '#default_value' => theme_get_setting('responsive_menu_topoptiontext'));
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_select_menu']['responsive_menu_optgroups'] = array('#type' => 'checkbox', '#title' => t('Enable responsive menu with optgroups'), '#description' => t('Use the checkbox to enable a dropdown select list with optgroups support.'), '#default_value' => theme_get_setting('responsive_menu_optgroups'));
    $form['mtt_settings']['tabs']['responsive_menu']['responsive_select_menu']['responsive_menu_nested'] = array('#type' => 'checkbox', '#title' => t('Enable nested responsive menu'), '#description' => t('Use the checkbox to enable the optgroups for the dropdown select list (acts only in dropdown select list with optgroups).'), '#default_value' => theme_get_setting('responsive_menu_nested'));
    $form['mtt_settings']['tabs']['parallax'] = array('#type' => 'fieldset', '#title' => t('Parallax region'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['parallax']['parallax_state'] = array('#type' => 'checkbox', '#title' => t('Enable parallax background effect'), '#default_value' => theme_get_setting('parallax_state'));
    $form['mtt_settings']['tabs']['parallax']['parallax_opacity'] = array('#type' => 'textfield', '#title' => t('Parallax Background Opacity'), '#description' => t('Set the % opacity for the background of the parallax region.'), '#default_value' => theme_get_setting('parallax_opacity'));
    $form['mtt_settings']['tabs']['google_map'] = array('#type' => 'fieldset', '#title' => t('Google Map'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mtt_settings']['tabs']['google_map']['google_map_js'] = array('#type' => 'checkbox', '#title' => t('Include Google Map javascript code'), '#default_value' => theme_get_setting('google_map_js', 'myvastra'));
    $form['mtt_settings']['tabs']['google_map']['google_map_latitude'] = array('#type' => 'textfield', '#title' => t('Google Map Latitude'), '#description' => t('For example 40.726576'), '#default_value' => theme_get_setting('google_map_latitude', 'myvastra'), '#size' => 5, '#maxlength' => 10);
    $form['mtt_settings']['tabs']['google_map']['google_map_longitude'] = array('#type' => 'textfield', '#title' => t('Google Map Longitude'), '#description' => t('For example -74.046822'), '#default_value' => theme_get_setting('google_map_longitude', 'myvastra'), '#size' => 5, '#maxlength' => 10);
    $form['mtt_settings']['tabs']['google_map']['google_map_zoom'] = array('#type' => 'textfield', '#title' => t('Google Map Zoom'), '#description' => t('For example 13'), '#default_value' => theme_get_setting('google_map_zoom', 'myvastra'), '#size' => 5, '#maxlength' => 10);
    $form['mtt_settings']['tabs']['google_map']['google_map_canvas'] = array('#type' => 'textfield', '#title' => t('Google Map Canvas Id'), '#description' => t('Set the Google Map Canvas Id. For example: map-canvas'), '#default_value' => theme_get_setting('google_map_canvas', 'myvastra'));
    $form['mtt_settings']['tabs']['credits'] = array('#type' => 'fieldset', '#title' => t('Credits'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['mtt_settings']['tabs']['credits']['credits_display'] = array('#type' => 'checkbox', '#title' => t('Show credits'), '#description' => t('Use the checkbox to enable or disable credits.'), '#default_value' => theme_get_setting('credits_display'));
}
Пример #20
0
/**
 * Exposes Nitobe's theme settings.
 *
 * @param array &$form
 *   Nested array of form elements that comprise the form.
 * @param array &$form_state
 *   A keyed array containing the current state of the form. The arguments that
 *   drupal_get_form() was originally called with are available in the array
 *   $form_state['build_info']['args'].
 */
function nitobe_form_system_theme_settings_alter(&$form, &$form_state)
{
    $form["nitobe_general_settings"] = array("#type" => "fieldset", "#title" => "General Nitobe settings");
    // -- What ordering should be used for the content and sidebars?
    $default = theme_get_setting("nitobe_content_placement", "nitobe");
    $desc = t("Where should the sidebars be placed?");
    $options = array("center" => "On either side of the content region.", "right" => "Right of the content region.", "left" => "Left of the content region.");
    $form["nitobe_general_settings"]['nitobe_content_placement'] = array("#type" => "select", "#title" => t("Sidebar placement"), "#options" => $options, "#default_value" => $default, "#description" => $desc);
    // -- How many page items to put in the pager widgets.
    $default = theme_get_setting("nitobe_pager_page_count", "nitobe");
    $options = range(3, 10);
    $desc = t("The number of default pages to include in pager controls. If you are using a three column layout, a lower number here will work better.");
    $form["nitobe_general_settings"]['nitobe_pager_page_count'] = array("#type" => 'select', "#title" => t('Pager item count'), "#options" => drupal_map_assoc($options), "#default_value" => $default, "#description" => $desc);
    _nitobe_add_header_settings($form);
    _nitobe_add_time_format_settings($form);
}
Пример #21
0
 /**
  * Gets all the module directories.
  *
  * @param bool $all
  *   Include values for disabled modules.
  *
  * @return array
  *   A list of module directories.
  */
 protected static function directories($all = FALSE)
 {
     $directories = array();
     if ($all) {
         // We cannot use module_list to get the disabled modules. Query the system
         // table instead.
         $sql = "SELECT name FROM {system} WHERE type = :type";
         $modules = db_query($sql, array(':type' => 'module'))->fetchCol();
         $modules = drupal_map_assoc($modules);
     } else {
         $modules = module_list();
     }
     foreach ($modules as $module) {
         $directories[$module] = drupal_get_path('module', $module);
     }
     return $directories;
 }
Пример #22
0
/**
 * Advanced theme settings.
 */
function perspective_form_system_theme_settings_alter(&$form, $form_state)
{
    $form['perspective_theme_slogan'] = array('#type' => 'textarea', '#title' => t('Theme slogan'), '#default_value' => theme_get_setting('perspective_theme_slogan', 'perspective'), '#description' => t('This is heading message on the site.'));
    $form['perspective_footer_copyright'] = array('#type' => 'textarea', '#title' => t('Footer copyright message'), '#default_value' => theme_get_setting('perspective_footer_copyright', 'perspective'), '#description' => t('This is copyright message in footer region.'));
    $form['perspective_footer_social_links'] = array('#type' => 'textarea', '#title' => t('Footer Social links'), '#default_value' => theme_get_setting('perspective_footer_social_links', 'perspective'), '#description' => t('This is social links in footer region.'));
    $form['slider'] = array('#type' => 'fieldset', '#title' => t('Slider managment'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Image upload section ======================================================
    $banners = perspective_get_banners();
    $form['slider']['banner']['images'] = array('#type' => 'vertical_tabs', '#title' => t('Banner images'), '#weight' => 2, '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE);
    $i = 0;
    foreach ($banners as $image_data) {
        $form['slider']['banner']['images'][$i] = array('#type' => 'fieldset', '#title' => t('Image !number: !title', array('!number' => $i + 1, '!title' => $image_data['image_title'])), '#weight' => $i, '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE, 'image' => _perspective_banner_form($image_data));
        $i++;
    }
    $form['slider']['banner']['image_upload'] = array('#type' => 'file', '#title' => t('Upload a new image'), '#weight' => $i);
    $form['#submit'][] = 'perspective_settings_submit';
    $form['home'] = array('#type' => 'fieldset', '#title' => t('Homepage settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['home']['perspective_homepage_type'] = array('#type' => 'select', '#title' => t('Hompage type'), '#options' => array('slider' => 'Slider', 'video' => 'Video'), '#default_value' => theme_get_setting('perspective_homepage_type', 'perspective'));
    if (theme_get_setting('perspective_homepage_type', 'perspective') == 'video') {
        $form['home']['video']['perspective_video_title'] = array('#type' => 'textfield', '#title' => t('Video title'), '#default_value' => theme_get_setting('perspective_video_title', 'perspective'));
        $form['home']['video']['perspective_video'] = array('#type' => 'textarea', '#title' => t('Video iframe code'), '#default_value' => theme_get_setting('perspective_video', 'perspective'), '#description' => t('This is iframe of video, or you can enter image code here.'));
        $form['home']['video']['perspective_video_description'] = array('#type' => 'textarea', '#title' => t('Description'), '#default_value' => theme_get_setting('perspective_video_description', 'perspective'), '#description' => t('Enter description.'));
        $form['home']['video']['perspective_video_link_title'] = array('#type' => 'textfield', '#title' => t('link title'), '#default_value' => theme_get_setting('perspective_video_link_title', 'perspective'));
        $form['home']['video']['perspective_video_link_url'] = array('#type' => 'textfield', '#title' => t('Link URL'), '#default_value' => theme_get_setting('perspective_video_link_url', 'perspective'), '#description' => t('This is the URL.'));
    }
    $blog_style_options = array('blog_meta_before' => t('[Default] big image - meta before'), 'blog_meta_after' => t('Big image - meta after'), 'blog_meta_icons_right' => t('Big image meta-icons right'), 'blog_meta_icons_left' => t('Big image meta-icons left'), 'blog_image_meta_31' => t('Image-Meta / 3:1'), 'blog_image_meta_13' => t('Meta-Image / 1:3'), 'blog_image_hidden_meta' => t('Hiden meta / Big image'), 'blog_small_image_left' => t('Small image left'), 'blog_small_image_right' => t('Small image right'), 'blog_75p_meta' => t('75% Image / Meta'), 'blog_meta_75p' => t('Meta / 75% Image'));
    $form['blog_display_setting'] = array('#type' => 'select', '#title' => t('Blog style options'), '#options' => $blog_style_options, '#default_value' => theme_get_setting('blog_display_setting', 'perspective'));
    $form['portfolio'] = array('#type' => 'fieldset', '#title' => t('Portfolio settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['portfolio']['default_portfolio'] = array('#type' => 'select', '#title' => t('Default portfolio display'), '#options' => array('1c' => 'Portfolio - 1col', '2c' => 'Portfolio - 2cols', '3c' => 'Portfolio - 3cols', '4c' => 'portfolio - 4cols'), '#default_value' => theme_get_setting('default_portfolio', 'perspective'));
    $form['portfolio']['default_nodes_portfolio'] = array('#type' => 'select', '#title' => t('Number nodes show on portfolio page'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)), '#default_value' => theme_get_setting('default_nodes_portfolio', 'perspective'));
    $form['contact'] = array('#type' => 'fieldset', '#title' => t('Contact settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['contact']['contact_map'] = array('#type' => 'textarea', '#title' => 'Map embed code', '#default_value' => theme_get_setting('contact_map', 'perspective'));
    $form['skin'] = array('#type' => 'fieldset', '#title' => t('Skins settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $skins_options = array();
    $dir = drupal_get_path('theme', 'perspective') . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'themes';
    $files = file_scan_directory($dir, '/.*\\.css/');
    if (!empty($files)) {
        foreach ($files as $file) {
            if (isset($file->filename)) {
                $skins_options[$file->name] = $file->filename;
            }
        }
    }
    $form['skin']['default_skin'] = array('#type' => 'select', '#title' => t('Default skin'), '#options' => $skins_options, '#default_value' => theme_get_setting('default_skin', 'perspective'));
    return $form;
}
 /**
  * Implements EntityReferenceHandler::settingsForm().
  */
 public static function settingsForm($field, $instance)
 {
     $entity_info = entity_get_info($field['settings']['target_type']);
     // Merge-in default values.
     $field['settings']['handler_settings'] += array('target_bundles' => array(), 'sort' => array('type' => 'none'));
     if (!empty($entity_info['entity keys']['bundle'])) {
         $bundles = array();
         foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
             $bundles[$bundle_name] = $bundle_info['label'];
         }
         $form['target_bundles'] = array('#type' => 'checkboxes', '#title' => t('Target bundles'), '#options' => $bundles, '#default_value' => $field['settings']['handler_settings']['target_bundles'], '#size' => 6, '#multiple' => TRUE, '#description' => t('The bundles of the entity type that can be referenced. Optional, leave empty for all bundles.'), '#element_validate' => array('_entityreference_element_validate_filter'));
     } else {
         $form['target_bundles'] = array('#type' => 'value', '#value' => array());
     }
     $form['sort']['type'] = array('#type' => 'select', '#title' => t('Sort by'), '#options' => array('none' => t("Don't sort"), 'property' => t('A property of the base table of the entity'), 'field' => t('A field attached to this entity')), '#ajax' => TRUE, '#limit_validation_errors' => array(), '#default_value' => $field['settings']['handler_settings']['sort']['type']);
     $form['sort']['settings'] = array('#type' => 'container', '#attributes' => array('class' => array('entityreference-settings')), '#process' => array('_entityreference_form_process_merge_parent'));
     if ($field['settings']['handler_settings']['sort']['type'] == 'property') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('property' => NULL);
         $form['sort']['settings']['property'] = array('#type' => 'select', '#title' => t('Sort property'), '#required' => TRUE, '#options' => drupal_map_assoc($entity_info['schema_fields_sql']['base table']), '#default_value' => $field['settings']['handler_settings']['sort']['property']);
     } elseif ($field['settings']['handler_settings']['sort']['type'] == 'field') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('field' => NULL);
         $fields = array();
         foreach (field_info_instances($field['settings']['target_type']) as $bundle_name => $bundle_instances) {
             foreach ($bundle_instances as $instance_name => $instance_info) {
                 $field_info = field_info_field($instance_name);
                 foreach ($field_info['columns'] as $column_name => $column_info) {
                     $fields[$instance_name . ':' . $column_name] = t('@label (column @column)', array('@label' => $instance_info['label'], '@column' => $column_name));
                 }
             }
         }
         $form['sort']['settings']['field'] = array('#type' => 'select', '#title' => t('Sort field'), '#required' => TRUE, '#options' => $fields, '#default_value' => $field['settings']['handler_settings']['sort']['field']);
     }
     if ($field['settings']['handler_settings']['sort']['type'] != 'none') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('direction' => 'ASC');
         $form['sort']['settings']['direction'] = array('#type' => 'select', '#title' => t('Sort direction'), '#required' => TRUE, '#options' => array('ASC' => t('Ascending'), 'DESC' => t('Descending')), '#default_value' => $field['settings']['handler_settings']['sort']['direction']);
     }
     // Provide an option to lock the entity reference to the current revision if
     // the entity supports it.
     if (!empty($entity_info['revision table'])) {
         $form['lock_revision'] = array('#type' => 'checkbox', '#title' => t('Lock the field to the revision of the entity at the time it was referenced.'), '#default_value' => !empty($field['settings']['handler_settings']['lock_revision']) ? TRUE : FALSE, '#description' => t('When this is enabled, the reference will track the latest revision to that entity when this field is saved. This, combined with e.g. the <a href="!url">Workbench Moderation module</a>, can be used to provide limited workflow functionality around the referenced content.', array('!url' => 'http://drupal.org/project/workbench_moderation')));
     }
     return $form;
 }
 /**
  * Implements EntityReferenceHandler::settingsForm().
  */
 public static function settingsForm($field, $instance)
 {
     $entity_info = entity_get_info($field['settings']['target_type']);
     // Merge-in default values.
     $field['settings']['handler_settings'] += array('target_bundles' => array(), 'sort' => array('type' => 'none'));
     if (!empty($entity_info['entity keys']['bundle'])) {
         $bundles = array();
         foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
             $bundles[$bundle_name] = $bundle_info['label'];
         }
         $form['target_bundles'] = array('#type' => 'checkboxes', '#title' => t('Target bundles'), '#options' => $bundles, '#default_value' => $field['settings']['handler_settings']['target_bundles'], '#size' => 6, '#multiple' => TRUE, '#description' => t('The bundles of the entity type that can be referenced. Optional, leave empty for all bundles.'), '#element_validate' => array('_entityreference_element_validate_filter'));
     } else {
         $form['target_bundles'] = array('#type' => 'value', '#value' => array());
     }
     $form['sort']['type'] = array('#type' => 'select', '#title' => t('Sort by'), '#options' => array('none' => t("Don't sort"), 'property' => t('A property of the base table of the entity'), 'field' => t('A field attached to this entity')), '#ajax' => TRUE, '#limit_validation_errors' => array(), '#default_value' => $field['settings']['handler_settings']['sort']['type']);
     $form['sort']['settings'] = array('#type' => 'container', '#attributes' => array('class' => array('entityreference-settings')), '#process' => array('_entityreference_form_process_merge_parent'));
     if ($field['settings']['handler_settings']['sort']['type'] == 'property') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('property' => NULL);
         $form['sort']['settings']['property'] = array('#type' => 'select', '#title' => t('Sort property'), '#required' => TRUE, '#options' => drupal_map_assoc($entity_info['schema_fields_sql']['base table']), '#default_value' => $field['settings']['handler_settings']['sort']['property']);
     } elseif ($field['settings']['handler_settings']['sort']['type'] == 'field') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('field' => NULL);
         $fields = array();
         foreach (field_info_instances($field['settings']['target_type']) as $bundle_name => $bundle_instances) {
             foreach ($bundle_instances as $instance_name => $instance_info) {
                 $field_info = field_info_field($instance_name);
                 foreach ($field_info['columns'] as $column_name => $column_info) {
                     $fields[$instance_name . ':' . $column_name] = t('@label (column @column)', array('@label' => $instance_info['label'], '@column' => $column_name));
                 }
             }
         }
         $form['sort']['settings']['field'] = array('#type' => 'select', '#title' => t('Sort field'), '#required' => TRUE, '#options' => $fields, '#default_value' => $field['settings']['handler_settings']['sort']['field']);
     }
     if ($field['settings']['handler_settings']['sort']['type'] != 'none') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('direction' => 'ASC');
         $form['sort']['settings']['direction'] = array('#type' => 'select', '#title' => t('Sort direction'), '#required' => TRUE, '#options' => array('ASC' => t('Ascending'), 'DESC' => t('Descending')), '#default_value' => $field['settings']['handler_settings']['sort']['direction']);
     }
     // Provide options to reference revisions if the entity supports it.
     if (!empty($entity_info['revision table'])) {
         $form['reference_revisions'] = array('#type' => 'checkbox', '#title' => t('Reference revisions'), '#default_value' => !empty($field['settings']['handler_settings']['reference_revisions']), '#description' => t('When this is enabled, the reference will track the current revision at the time it is referenced. When disabled the reference will always point to the newest revision of the entity.'));
         $form['lock_revision'] = array('#type' => 'checkbox', '#title' => t('Lock the revision.'), '#default_value' => !empty($field['settings']['handler_settings']['lock_revision']), '#description' => t('Locks the field to the revision of the entity at the time it was referenced. If this is disabled the revision will be updated each time the referencing entity is saved.'), '#states' => array('visible' => array(':input[name="field[settings][handler_settings][reference_revisions]"]' => array('checked' => TRUE))));
     }
     return $form;
 }
 /**
  * Builds extra settings for the block edit form.
  */
 public function form($bean, $form, &$form_state)
 {
     $form = array();
     $form['settings'] = array('#type' => 'fieldset', '#tree' => 1, '#title' => t('Options'));
     $form['settings']['button_type'] = array('#type' => 'select', '#title' => t('Button type'), '#description' => t('The value of this parameter determines what type of button to display. Possible values are "checkout" or "addressBook".'), '#options' => drupal_map_assoc(array('checkout', 'addressBook')), '#default_value' => isset($bean->settings['button_type']) ? $bean->settings['button_type'] : '');
     // Load all the beans that could be included in the options.
     $options = array();
     $beans = commerce_bean_get_beans('commerce_cba_address');
     foreach ($beans as $address_bean) {
         $options[$address_bean->delta] = $address_bean->adminTitle();
     }
     $form['settings']['addresswidget'] = array('#type' => 'select', '#title' => t('Select the address widget associated with this one'), '#description' => t('Only Address Widget beans are eligible.'), '#options' => $options, '#empty_option' => t('None'), '#default_value' => isset($bean->settings['addresswidget']) ? $bean->settings['addresswidget'] : '', '#states' => array('visible' => array(':input[name="settings[button_type]"]' => array('value' => 'addressBook'))));
     $form['settings']['button_settings'] = array('#type' => 'fieldset', '#tree' => 2, '#title' => t('Settings of the button'));
     $form['settings']['button_settings']['size'] = array('#type' => 'select', '#title' => t('Size of the button'), '#options' => array('medium' => t('Medium (126x24)'), 'large' => t('Large (151x27)'), 'x-large' => t('Extra large (173x27)')), '#default_value' => isset($bean->settings['button_settings']['size']) ? $bean->settings['button_settings']['size'] : '');
     $form['settings']['button_settings']['color'] = array('#type' => 'select', '#title' => t('Color of the button'), '#options' => array('orange' => t('Orange'), 'tan' => t('Tan')), '#default_value' => isset($bean->settings['button_settings']['color']) ? $bean->settings['button_settings']['color'] : '');
     $form['settings']['button_settings']['background'] = array('#type' => 'select', '#title' => t('Background of the button'), '#options' => array('white' => t('White'), 'light' => t('Light'), 'dark' => t('Dark')), '#default_value' => isset($bean->settings['button_settings']['background']) ? $bean->settings['button_settings']['background'] : '');
     return $form;
 }
 /**
  * Implements EntityReferenceHandler::settingsForm().
  */
 public static function settingsForm($field, $instance)
 {
     $entity_info = entity_get_info($field['settings']['target_type']);
     // Merge-in default values.
     $field['settings']['handler_settings'] += array('target_bundles' => array(), 'sort' => array('type' => 'none'));
     if (!empty($entity_info['entity keys']['bundle'])) {
         $bundles = array();
         foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
             $bundles[$bundle_name] = $bundle_info['label'];
         }
         $form['target_bundles'] = array('#type' => 'checkboxes', '#title' => t('Target bundles'), '#options' => $bundles, '#default_value' => $field['settings']['handler_settings']['target_bundles'], '#size' => 6, '#multiple' => TRUE, '#description' => t('The bundles of the entity type that can be referenced. Optional, leave empty for all bundles.'), '#element_validate' => array('_entityreference_element_validate_filter'));
     } else {
         $form['target_bundles'] = array('#type' => 'value', '#value' => array());
     }
     $form['sort']['type'] = array('#type' => 'select', '#title' => t('Sort by'), '#options' => array('none' => t("Don't sort"), 'property' => t('A property of the base table of the entity'), 'field' => t('A field attached to this entity')), '#ajax' => TRUE, '#limit_validation_errors' => array(), '#default_value' => $field['settings']['handler_settings']['sort']['type']);
     $form['sort']['settings'] = array('#type' => 'container', '#attributes' => array('class' => array('entityreference-settings')), '#process' => array('_entityreference_form_process_merge_parent'));
     if ($field['settings']['handler_settings']['sort']['type'] == 'property') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('property' => NULL);
         $form['sort']['settings']['property'] = array('#type' => 'select', '#title' => t('Sort property'), '#required' => TRUE, '#options' => drupal_map_assoc($entity_info['schema_fields_sql']['base table']), '#default_value' => $field['settings']['handler_settings']['sort']['property']);
     } elseif ($field['settings']['handler_settings']['sort']['type'] == 'field') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('field' => NULL);
         $fields = array();
         foreach (field_info_instances($field['settings']['target_type']) as $bundle_name => $bundle_instances) {
             foreach ($bundle_instances as $instance_name => $instance_info) {
                 $field_info = field_info_field($instance_name);
                 foreach ($field_info['columns'] as $column_name => $column_info) {
                     $fields[$instance_name . ':' . $column_name] = t('@label (column @column)', array('@label' => $instance_info['label'], '@column' => $column_name));
                 }
             }
         }
         $form['sort']['settings']['field'] = array('#type' => 'select', '#title' => t('Sort field'), '#required' => TRUE, '#options' => $fields, '#default_value' => $field['settings']['handler_settings']['sort']['field']);
     }
     if ($field['settings']['handler_settings']['sort']['type'] != 'none') {
         // Merge-in default values.
         $field['settings']['handler_settings']['sort'] += array('direction' => 'ASC');
         $form['sort']['settings']['direction'] = array('#type' => 'select', '#title' => t('Sort direction'), '#required' => TRUE, '#options' => array('ASC' => t('Ascending'), 'DESC' => t('Descending')), '#default_value' => $field['settings']['handler_settings']['sort']['direction']);
     }
     return $form;
 }
Пример #27
0
/**
 * Implements hook_field_group_format_settings().
 *
 * Defines configuration widget for the settings on a field group
 * formatter. Eache formatter can have different elements and storage.
 *
 * @params Object $group The group object.
 * @return Array $form The form element for the format settings.
 */
function hook_field_group_format_settings($group)
{
    // Add a wrapper for extra settings to use by others.
    $form = array('instance_settings' => array('#tree' => TRUE, '#weight' => 2));
    $field_group_types = field_group_formatter_info();
    $mode = $group->mode == 'form' ? 'form' : 'display';
    $formatter = $field_group_types[$mode][$group->format_type];
    // Add the required formatter type selector.
    if (isset($formatter['format_types'])) {
        $form['formatter'] = array('#title' => t('Fieldgroup settings'), '#type' => 'select', '#options' => drupal_map_assoc($formatter['format_types']), '#default_value' => isset($group->format_settings['formatter']) ? $group->format_settings['formatter'] : $formatter['default_formatter'], '#weight' => 1);
    }
    if ($mode == 'form') {
        $form['instance_settings']['required_fields'] = array('#type' => 'checkbox', '#title' => t('Mark group for required fields.'), '#default_value' => isset($group->format_settings['instance_settings']['required_fields']) ? $group->format_settings['instance_settings']['required_fields'] : (isset($formatter['instance_settings']['required_fields']) ? $formatter['instance_settings']['required_fields'] : ''), '#weight' => 2);
    }
    $form['instance_settings']['classes'] = array('#title' => t('Extra CSS classes'), '#type' => 'textfield', '#default_value' => isset($group->format_settings['instance_settings']['classes']) ? $group->format_settings['instance_settings']['classes'] : (isset($formatter['instance_settings']['classes']) ? $formatter['instance_settings']['classes'] : ''), '#weight' => 3, '#element_validate' => array('field_group_validate_css_class'));
    $form['instance_settings']['description'] = array('#title' => t('Description'), '#type' => 'textarea', '#default_value' => isset($group->format_settings['instance_settings']['description']) ? $group->format_settings['instance_settings']['description'] : (isset($formatter['instance_settings']['description']) ? $formatter['instance_settings']['description'] : ''), '#weight' => 0);
    // Add optional instance_settings.
    switch ($group->format_type) {
        case 'div':
            $form['instance_settings']['effect'] = array('#title' => t('Effect'), '#type' => 'select', '#options' => array('none' => t('None'), 'blind' => t('Blind')), '#default_value' => isset($group->format_settings['instance_settings']['effect']) ? $group->format_settings['instance_settings']['effect'] : $formatter['instance_settings']['effect'], '#weight' => 2);
            $form['instance_settings']['speed'] = array('#title' => t('Speed'), '#type' => 'select', '#options' => array('none' => t('None'), 'slow' => t('Slow'), 'fast' => t('Fast')), '#default_value' => isset($group->format_settings['instance_settings']['speed']) ? $group->format_settings['instance_settings']['speed'] : $formatter['instance_settings']['speed'], '#weight' => 3);
            break;
        case 'fieldset':
            $form['instance_settings']['classes'] = array('#title' => t('Extra CSS classes'), '#type' => 'textfield', '#default_value' => isset($group->format_settings['instance_settings']['classes']) ? $group->format_settings['instance_settings']['classes'] : $formatter['instance_settings']['classes'], '#weight' => 3, '#element_validate' => array('field_group_validate_css_class'));
            break;
        case 'tabs':
        case 'htabs':
        case 'accordion':
            unset($form['instance_settings']['description']);
            if (isset($form['instance_settings']['required_fields'])) {
                unset($form['instance_settings']['required_fields']);
            }
            break;
        case 'tab':
        case 'htab':
        case 'accordion-item':
        default:
    }
    return $form;
}
Пример #28
0
 /**
  * Implementation of the magic __get method.
  *
  * @param string $requested_property
  * @return mixed
  */
 public function &__get($requested_property)
 {
     if (!isset($this->object->{$requested_property}) && !$this->loaded) {
         switch ($requested_property) {
             case 'og_groups':
                 $this->object->og_groups = $this->load() ? drupal_map_assoc(array_keys($this->groups)) : array();
                 break;
             case 'og_groups_both':
                 $this->object->og_groups_both = $this->load() ? $this->groups : array();
                 break;
             default:
                 $this->loaded = true;
                 break;
         }
     }
     // Return the property.
     if (isset($this->object->{$requested_property})) {
         return $this->object->{$requested_property};
     } else {
         return $this->_null_value;
     }
 }
Пример #29
0
function proma_form_system_theme_settings_alter(&$form, $form_state)
{
    $form['home'] = array('#type' => 'fieldset', '#title' => t('Homepage settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['home']['home_tagline'] = array('#type' => 'textarea', '#title' => t('Home tagline'), '#default_value' => theme_get_setting('home_tagline', 'proma'));
    $form['footer'] = array('#type' => 'fieldset', '#title' => t('Footer settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['footer']['footer_copyright_message'] = array('#type' => 'textarea', '#title' => t('Footer copyright message'), '#default_value' => theme_get_setting('footer_copyright_message', 'proma'));
    $form['footer']['social'] = array('#type' => 'fieldset', '#title' => t('Social links setting'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['footer']['social']['facebook_url'] = array('#type' => 'textfield', '#title' => t('Facebook URL'), '#default_value' => theme_get_setting('facebook_url', 'proma'));
    $form['footer']['social']['twitter_url'] = array('#type' => 'textfield', '#title' => t('Twitter URL'), '#default_value' => theme_get_setting('twitter_url', 'proma'));
    $form['footer']['social']['linkedin_url'] = array('#type' => 'textfield', '#title' => t('Linkedin URL'), '#default_value' => theme_get_setting('linkedin_url', 'proma'));
    $form['footer']['social']['skype'] = array('#type' => 'textfield', '#title' => t('Skype'), '#default_value' => theme_get_setting('skype', 'proma'));
    $form['footer']['social']['rss_url'] = array('#type' => 'textfield', '#title' => t('RSS URL'), '#default_value' => theme_get_setting('rss_url', 'proma'));
    $form['portfolio'] = array('#type' => 'fieldset', '#title' => t('Portfolio settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['portfolio']['default_portfolio'] = array('#type' => 'select', '#title' => t('Default portfolio display'), '#options' => array('2c' => 'Portfolio - 2cols', '3c' => 'Portfolio - 3cols', '4c' => 'portfolio - 4cols'), '#default_value' => theme_get_setting('default_portfolio', 'proma'));
    $form['portfolio']['portfolio_heading'] = array('#type' => 'textarea', '#title' => t('Portfolio heading'), '#default_value' => theme_get_setting('portfolio_heading', 'proma'));
    $form['portfolio']['default_nodes_portfolio'] = array('#type' => 'select', '#title' => t('Number nodes show on portfolio page'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)), '#default_value' => theme_get_setting('default_nodes_portfolio', 'proma'));
    $form['skin'] = array('#type' => 'fieldset', '#title' => t('Skin setting'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $color_options = array('8CBD2E' => t('Default color #8CBD2E'), '00BFF3' => '#00BFF3', 'FF9108' => '#FF9108', 'FF0F00' => '#FF0F00', 'FCDF1F' => '#FCDF1F', 'FF197C' => '#FF197C', 'A0E0A9' => '#A0E0A9', 'A020F0' => '#A020F0', 'E9C75C' => '#E9C75C', 'A6B8A1' => '#A6B8A1', 'E1565C' => '#E1565C', 'A87C59' => '#A87C59', '2554C7' => '#2554C7', '1ABFB1' => '#1ABFB1', 'FFB19A' => '#FFB19A');
    $form['skin']['default_color'] = array('#type' => 'select', '#title' => t('Theme color'), '#default_value' => theme_get_setting('default_color', 'proma'), '#options' => $color_options);
    $theme_background = array('01.jpg' => '01.jpg', '02.jpg' => '02.jpg', '03.jpg' => '03.jpg', '04.jpg' => '04.jpg', '05.jpg' => '05.jpg', '06.jpg' => '06.jpg', '07.jpg' => '07.jpg', '08.jpg' => '08.jpg', 'none' => 'No background image');
    $form['skin']['default_background'] = array('#title' => t('Theme background'), '#type' => 'select', '#default_value' => theme_get_setting('default_background', 'proma'), '#options' => $theme_background);
    $form['#submit'][] = 'proma_settings_submit';
}
 /**
  * Implements hook_field_widget_form --> WidgetInterface::formElement().
  *
  * {@inheritdoc}
  *
  * Be careful: this widget may be shown in very different places. Test carefully!!
  *  - On a entity add/edit page
  *  - On a entity preview page
  *  - On a entity view page
  *  - On a entity 'workflow history' tab
  *  - On a comment display, in the comment history
  *  - On a comment form, below the comment history
  * @todo D8: change "array $items" to "FieldInterface $items"
  */
 public function formElement(array $items, $delta, array $element, $langcode, array &$form, array &$form_state)
 {
     $field_name = $this->field['field_name'];
     $field = $this->instance;
     $instance = $this->instance;
     $entity = $this->entity;
     $entity_type = $this->entity_type;
     $entity_id = entity_id($entity_type, $entity);
     if (!$entity) {
         // If no entity given, do not show a form. E.g., on the field settings page.
         return $element;
     }
     // Capture settings to format the form/widget.
     $settings_title_as_name = !empty($this->field['settings']['widget']['name_as_title']);
     // The schedule cannot be shown on a Content add page.
     $settings_schedule = !empty($this->field['settings']['widget']['schedule']) && $entity_id;
     $settings_schedule_timezone = !empty($this->field['settings']['widget']['schedule_timezone']);
     // Show comment, when both Field and Instance allow this.
     $settings_comment = $this->field['settings']['widget']['comment'] ? 'textarea' : 'hidden';
     $workflow = Workflow::load($this->field['settings']['wid']);
     $current_sid = workflow_node_current_state($entity, $entity_type, $field_name);
     $current_state = WorkflowState::load($current_sid);
     $options = array();
     $options = $current_state->getOptions($entity_type, $entity);
     // Determine the default value. If we are in CreationState, use a fast alternative for $workflow->getFirstSid().
     $default_value = $current_state->isCreationState() ? key($options) : $current_sid;
     // Get the scheduling info. This may change the $current_sid on the Form.
     $scheduled = '0';
     $timestamp = REQUEST_TIME;
     $comment = NULL;
     if ($settings_schedule) {
         // Read scheduled information.
         // Technically you could have more than one scheduled, but this will only add the soonest one.
         foreach (WorkflowScheduledTransition::load($entity_type, $entity_id, $field_name) as $scheduled_transition) {
             $scheduled = '1';
             $current_sid = $scheduled_transition->sid;
             $timestamp = $scheduled_transition->scheduled;
             $comment = $scheduled_transition->comment;
             break;
         }
     }
     // Fetch the form ID. This is unique for each entity, to allow multiple form per page (Views, etc.).
     $form_id = $form_state['build_info']['form_id'];
     $element_scheduled_name = 'workflow_scheduled_' . $form_id;
     $element_options_name = 'workflow_options_' . $form_id;
     $element_scheduled_name = 'workflow_scheduled';
     $element_options_name = 'workflow_options';
     $elt_state_name = 'workflow_scheduled_' . $form_id;
     $label = $workflow->label();
     // Prepare a wrapper. This might be a fieldset.
     $element['workflow']['#type'] = 'container';
     $element['workflow']['#attributes'] = array('class' => array('workflow-form-container'));
     // Save the current value of the node in the form, for later Workflow-module specific references.
     // We add prefix, since #tree == FALSE.
     $element['workflow']['workflow_entity'] = array('#type' => 'value', '#value' => $this->entity);
     $element['workflow']['workflow_entity_type'] = array('#type' => 'value', '#value' => $this->entity_type);
     $element['workflow']['workflow_field'] = array('#type' => 'value', '#value' => $this->field);
     $element['workflow']['workflow_instance'] = array('#type' => 'value', '#value' => $this->instance);
     // Save the form_id, so the form values can be retrieved in submit function.
     $element['workflow']['form_id'] = array('#type' => 'value', '#value' => $form_id);
     // First of all, we add the default value in the place were normal fields
     // have it. This is to cater for 'preview' of the entity.
     $element['#default_value'] = $default_value;
     // Decide if we show a widget or a formatter.
     // There is no need to a widget when the only choice is the current sid.
     if (!$current_state->showWidget($options)) {
         $element['workflow'][$element_options_name] = workflow_state_formatter($entity_type, $entity, $field, $instance);
         return $element;
     } else {
         $element['workflow'][$element_options_name] = array('#type' => $this->field['settings']['widget']['options'], '#title' => $settings_title_as_name ? t('Change !name state', array('!name' => $label)) : '', '#options' => $options, '#default_value' => $default_value);
     }
     // Display scheduling form, but only if entity is being edited and user has
     // permission. State change cannot be scheduled at entity creation because
     // that leaves the entity in the (creation) state.
     if ($settings_schedule == TRUE && user_access('schedule workflow transitions')) {
         global $user;
         if (variable_get('configurable_timezones', 1) && $user->uid && drupal_strlen($user->timezone)) {
             $timezone = $user->timezone;
         } else {
             $timezone = variable_get('date_default_timezone', 0);
         }
         $timezones = drupal_map_assoc(timezone_identifiers_list());
         $hours = format_date($timestamp, 'custom', 'H:i', $timezone);
         //      $element['workflow']['workflow_scheduled'] = array(
         $element['workflow'][$element_scheduled_name] = array('#type' => 'radios', '#title' => t('Schedule'), '#options' => array('0' => t('Immediately'), '1' => t('Schedule for state change')), '#default_value' => $scheduled, '#attributes' => array('id' => 'scheduled_' . $form_id));
         $element['workflow']['workflow_scheduled_date_time'] = array('#type' => 'fieldset', '#title' => t('At'), '#attributes' => array('class' => array('container-inline')), '#prefix' => '<div style="margin-left: 1em;">', '#suffix' => '</div>', '#states' => array('visible' => array(':input[id="' . 'scheduled_' . $form_id . '"]' => array('value' => '1'))));
         $element['workflow']['workflow_scheduled_date_time']['workflow_scheduled_date'] = array('#type' => 'date', '#default_value' => array('day' => date('j', $timestamp), 'month' => date('n', $timestamp), 'year' => date('Y', $timestamp)));
         $element['workflow']['workflow_scheduled_date_time']['workflow_scheduled_hour'] = array('#type' => 'textfield', '#title' => t('Time'), '#maxlength' => 5, '#size' => 6, '#default_value' => $scheduled ? $hours : '00:00');
         $element['workflow']['workflow_scheduled_date_time']['workflow_scheduled_timezone'] = array('#type' => $settings_schedule_timezone ? 'select' : 'hidden', '#title' => t('Time zone'), '#options' => $timezones, '#default_value' => array($timezone => $timezone));
         $element['workflow']['workflow_scheduled_date_time']['workflow_scheduled_help'] = array('#type' => 'item', '#prefix' => '<br />', '#description' => t('Please enter a time in 24 hour (eg. HH:MM) format.
       If no time is included, the default will be midnight on the specified date.
       The current time is: @time.', array('@time' => format_date(REQUEST_TIME, 'custom', 'H:i', $timezone))));
     }
     $element['workflow']['workflow_comment'] = array('#type' => $settings_comment, '#title' => t('Workflow comment'), '#description' => t('A comment to put in the workflow log.'), '#default_value' => $comment, '#rows' => 2);
     // The 'add submit' can explicitely set by workflowfield_field_formatter_view(),
     // to add the submit button on the Content view page and the Workflow history tab.
     if (!empty($this->instance['widget']['settings']['submit_function'])) {
         // Add a submit button, but only on Entity View and History page.
         $element['workflow']['submit'] = array('#type' => 'submit', '#value' => t('Update workflow'), '#executes_submit_callback' => TRUE, '#submit' => array($this->instance['widget']['settings']['submit_function']));
     }
     return $element;
 }