/** * Implements menu_link__cis_service_connection_all_active_outline(). */ function mooc_foundation_access_menu_link__cis_service_connection_all_active_outline($variables) { switch (theme_get_setting('mooc_foundation_access_outline_labeling')) { case 'auto_both': $word = theme_get_setting('mooc_foundation_access_outline_label'); $number = TRUE; break; case 'auto_num': $word = FALSE; $number = TRUE; break; case 'auto_text': $word = theme_get_setting('mooc_foundation_access_outline_label'); $number = FALSE; break; case 'none': $word = FALSE; $number = FALSE; break; default: $word = t('Lesson'); $number = TRUE; break; } return _foundation_access_menu_outline($variables, $word, $number); }
function manis_form_system_theme_settings_alter(&$form, $form_state) { $theme_path = drupal_get_path('theme', 'manis'); $form['settings'] = array('#type' => 'vertical_tabs', '#title' => t('Theme settings'), '#weight' => 2, '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['general_setting'] = array('#type' => 'fieldset', '#title' => t('General Settings'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['general_setting']['general_setting_tracking_code'] = array('#type' => 'textarea', '#title' => t('Tracking Code'), '#default_value' => theme_get_setting('general_setting_tracking_code', 'manis')); $form['settings']['header'] = array('#type' => 'fieldset', '#title' => t('Header settings'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['header']['header_style'] = array('#title' => t('Header style'), '#type' => 'select', '#options' => array('header1' => t('Header 1'), 'header2' => t('Header 2'), 'header3' => t('Header 3')), '#default_value' => theme_get_setting('header_style', 'manis')); $form['settings']['header']['phone_contact'] = array('#title' => t('Phone contact'), '#type' => 'textfield', '#default_value' => theme_get_setting('phone_contact', 'manis')); $form['settings']['header']['contact_email'] = array('#title' => t('Contact email'), '#type' => 'textfield', '#default_value' => theme_get_setting('contact_email', 'manis')); $form['settings']['header']['social_network'] = array('#title' => t('Header social network'), '#type' => 'textarea', '#default_value' => theme_get_setting('social_network', 'manis')); $form['settings']['blogs'] = array('#type' => 'fieldset', '#title' => t('Blogs'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['blogs']['blogs_list'] = array('#type' => 'select', '#title' => t('Blogs list style'), '#options' => array('style1' => t('Style 1'), 'style2' => t('Style 2')), '#default_value' => theme_get_setting('blogs_style', 'manis')); $form['settings']['footer'] = array('#type' => 'fieldset', '#title' => t('Footer settings'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['footer']['enable_footer_logo'] = array('#type' => 'select', '#title' => t('Enable footer logo'), '#options' => array('on' => t('ON'), 'off' => t('OFF')), '#default_value' => theme_get_setting('enable_footer_logo', 'manis')); $form['settings']['footer']['footer_copyright_message'] = array('#type' => 'textarea', '#title' => t('Footer copyright message'), '#default_value' => theme_get_setting('footer_copyright_message', 'manis')); $form['settings']['custom_css'] = array('#type' => 'fieldset', '#title' => t('Custom CSS'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['custom_css']['custom_css'] = array('#type' => 'textarea', '#title' => t('Custom CSS'), '#default_value' => theme_get_setting('custom_css', 'manis'), '#description' => t('<strong>Example:</strong><br/>h1 { font-family: \'Metrophobic\', Arial, serif; font-weight: 400; }')); $form['settings']['skin'] = array('#type' => 'fieldset', '#title' => t('Switcher Style'), '#collapsible' => TRUE, '#collapsed' => FALSE); //Disable Switcher style; $form['settings']['skin']['manis_disable_switch'] = array('#title' => t('Switcher style'), '#type' => 'select', '#options' => array('on' => t('ON'), 'off' => t('OFF')), '#default_value' => theme_get_setting('manis_disable_switch', 'manis')); $form['settings']['skin']['manis_layout'] = array('#title' => t('Layout'), '#type' => 'select', '#options' => array('wide' => t('Wide'), 'boxed' => t('Boxed')), '#default_value' => theme_get_setting('manis_layout', 'manis')); $form['settings']['skin']['manis_direction'] = array('#title' => t('Direction'), '#type' => 'select', '#options' => array('ltr' => t('LTR'), 'rtl' => t('RTL')), '#default_value' => theme_get_setting('manis_direction', 'manis')); $form['settings']['skin']['manis_style'] = array('#title' => t('Style'), '#type' => 'select', '#options' => array('light' => t('LIGHT'), 'dark' => t('DARK')), '#default_value' => theme_get_setting('manis_style', 'manis')); $form['settings']['skin']['manis_skin'] = array('#title' => t('Skins'), '#type' => 'select', '#options' => array('default' => t('Default'), 'alimbalmarina' => t('Alimbalmarina'), 'juicy' => t('Juicy'), 'spoonflower_goats' => t('Spoonflower goats'), 'nutricap_keratin_vit' => t('Nutricap keratin vit'), 'courtly_attire' => t('Courtly attire'), 'mondrian' => t('Mondrian'), 'sage' => t('Sage'), 'walking_by' => t('Walking by')), '#default_value' => theme_get_setting('manis_skin', 'manis')); $form['settings']['skin']['background'] = array('#type' => 'fieldset', '#title' => t('Background style'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['settings']['skin']['background']['background_style'] = array('#title' => t('Use style'), '#type' => 'select', '#options' => array('pattern' => t('Pattern'), 'image' => t('Image')), '#default_value' => theme_get_setting('background_style', 'manis')); $form['settings']['skin']['background']['manis_bg_pattern'] = array('#title' => t('Bg pattern'), '#type' => 'select', '#options' => array('swirl_pattern' => t('Swirl pattern'), 'sativa' => t('Sativa'), 'dimension' => t('Dimension'), 'symphony' => t('Symphony'), 'black_lozenge' => t('Black lozenge'), 'congruent_outline' => t('Congruent outline'), 'dark_exa' => t('Dark exa'), 'office_pattern' => t('Office pattern')), '#default_value' => theme_get_setting('manis_bg_pattern', 'manis')); $form['settings']['skin']['background']['manis_bg_image'] = array('#title' => t('Bg image'), '#type' => 'select', '#options' => array('1' => t('1'), '2' => t('2'), '3' => t('3'), '4' => t('4'), '5' => t('5'), '6' => t('6'), '7' => t('7'), '8' => t('8')), '#default_value' => theme_get_setting('manis_bg_image', 'manis')); }
/** * Implements hook_form_system_theme_settings_alter() function. */ function zen_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) { // Work-around for a core bug affecting admin themes. See issue #943212. if (isset($form_id)) { return; } // Create the form using Forms API $form['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb settings')); $form['breadcrumb']['zen_breadcrumb'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => theme_get_setting('zen_breadcrumb'), '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No'))); $form['breadcrumb']['breadcrumb_options'] = array('#type' => 'container', '#states' => array('invisible' => array(':input[name="zen_breadcrumb"]' => array('value' => 'no')))); $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => theme_get_setting('zen_breadcrumb_separator'), '#size' => 5, '#maxlength' => 10); $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => theme_get_setting('zen_breadcrumb_home')); $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => theme_get_setting('zen_breadcrumb_trailing'), '#description' => t('Useful when the breadcrumb is placed just before the title.'), '#states' => array('disabled' => array(':input[name="zen_breadcrumb_title"]' => array('checked' => TRUE)))); $form['breadcrumb']['breadcrumb_options']['zen_breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => theme_get_setting('zen_breadcrumb_title'), '#description' => t('Useful when the breadcrumb is not placed just before the title.')); $form['support'] = array('#type' => 'fieldset', '#title' => t('Accessibility and support settings')); // Only toggle the layout for the main Zen theme. if ($form['var']['#value'] == 'theme_zen_settings') { $form['support']['zen_layout'] = array('#type' => 'radios', '#title' => t('Layout'), '#options' => array('zen-responsive-sidebars' => t('Responsive sidebar layout') . ' <small>(layouts/responsive-sidebars.css)</small>', 'zen-fixed-width' => t('Fixed width layout') . ' <small>(layouts/fixed-width.css)</small>'), '#default_value' => theme_get_setting('zen_layout')); } $form['support']['zen_skip_link_anchor'] = array('#type' => 'textfield', '#title' => t('Anchor ID for the “skip link”'), '#default_value' => theme_get_setting('zen_skip_link_anchor'), '#field_prefix' => '#', '#description' => t('Specify the HTML ID of the element that the accessible-but-hidden “skip link” should link to. Note: that element should have the <code>tabindex="-1"</code> attribute to prevent an accessibility bug in webkit browsers. (<a href="!link">Read more about skip links</a>.)', array('!link' => 'https://drupal.org/node/467976'))); $form['support']['zen_skip_link_text'] = array('#type' => 'textfield', '#title' => t('Text for the “skip link”'), '#default_value' => theme_get_setting('zen_skip_link_text'), '#description' => t('For example: <em>Jump to navigation</em>, <em>Skip to content</em>')); $form['support']['zen_meta'] = array('#type' => 'checkboxes', '#title' => t('Add HTML5 and responsive scripts and meta tags to every page.'), '#default_value' => theme_get_setting('zen_meta'), '#options' => array('html5' => t('Add HTML5 shim JavaScript to add support to IE 6-8.'), 'meta' => t('Add meta tags to support responsive design on mobile devices.')), '#description' => t('IE 6-8 require a JavaScript polyfill solution to add basic support of HTML5. Mobile devices require a few meta tags for responsive designs.')); $form['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings')); $form['themedev']['zen_rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#default_value' => theme_get_setting('zen_rebuild_registry'), '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'https://drupal.org/node/173880#theme-registry'))); }
function cuflat_form_system_theme_settings_alter(&$form, &$form_state) { $theme = $form_state['build_info']['args'][0]; $form['cuflat_theme_settings'] = array('#type' => 'fieldset', '#title' => t('Flat Theme Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cuflat_theme_settings']['layout_style'] = array('#type' => 'radios', '#title' => t('Layout Style'), '#default_value' => theme_get_setting('layout_style', $theme) ? theme_get_setting('layout_style', $theme) : 'layout-wide', '#description' => t('Pick a layout style for your site.'), '#options' => array('layout-wide' => t('Wide'), 'layout-boxed' => t('Boxed'))); $form['cuflat_theme_settings']['banner_color'] = array('#type' => 'radios', '#title' => t('Banner Color'), '#default_value' => theme_get_setting('banner_color', $theme) ? theme_get_setting('banner_color', $theme) : 'black', '#description' => t('Pick a banner color for your site.'), '#options' => array('white' => t('White'), 'black' => t('Black'))); }
/** * Impliments hook_form_system_theme_settings_alter(). */ function ishopping_form_system_theme_settings_alter(&$form, $form_state) { $form['nucleus']['global_settings']['theme_settings']['hide_frontpage_main_content'] = array('#type' => 'checkbox', '#title' => t('Hide Main Content Block in Home Page'), '#default_value' => theme_get_setting('hide_frontpage_main_content')); $form['nucleus']['about_nucleus'] = array('#type' => 'fieldset', '#title' => t('Feedback'), '#weight' => 40); $form['nucleus']['about_nucleus']['about_nucleus_wrapper'] = array('#type' => 'container', '#attributes' => array('class' => array('about-nucleus-wrapper'))); $form['nucleus']['about_nucleus']['about_nucleus_wrapper']['about_nucleus_content'] = array('#markup' => '<iframe width="100%" height="650" scrolling="no" class="nucleus_frame" frameborder="0" src="http://www.weebpal.com/static/feedback/"></iframe>'); }
/** * Initialize theme settings if needed */ function fusion_core_initialize_theme_settings($theme_name) { $theme_settings = theme_get_settings($theme_name); if (!isset($theme_settings['primary_menu_dropdown']) || $theme_settings['rebuild_registry'] == 1) { static $registry_rebuilt = false; // avoid multiple rebuilds per page // Rebuild theme registry & notify user if (isset($theme_settings['rebuild_registry']) && $theme_settings['rebuild_registry'] == 1 && !$registry_rebuilt) { drupal_rebuild_theme_registry(); drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning'); $registry_rebuilt = true; } // Retrieve saved or site-wide theme settings $theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings'); $settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings(); // Skip toggle_node_info_ settings if (module_exists('node')) { foreach (node_get_types() as $type => $name) { unset($settings['toggle_node_info_' . $type]); } } // Combine default theme settings from .info file & theme-settings.php $theme_data = list_themes(); // get theme data for all themes $info_theme_settings = $theme_name ? $theme_data[$theme_name]->info['settings'] : array(); $defaults = array_merge(fusion_core_default_theme_settings(), $info_theme_settings); // Set combined default & saved theme settings variable_set($theme_setting_name, array_merge($defaults, $settings)); // Force theme settings refresh theme_get_setting('', TRUE); } }
function bones_form_system_theme_settings_alter(&$form, $form_state) { $grid_size = theme_get_setting('grid_size'); $col_number = get_columns(); $form['advanced_settings'] = array('#type' => 'vertical_tabs', '#title' => t('Advanced Theme Settings'), '#description' => t('Customize widths of the Preface and Postscript regions.'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => -10, '#prefix' => t('<h3> Advanced Settings </h3>')); // Styles $form['advanced_settings']['styles'] = array('#type' => 'fieldset', '#title' => t('Styles'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['advanced_settings']['styles']['style'] = array('#type' => 'select', '#title' => t('Style'), '#default_value' => theme_get_setting('style'), '#options' => array(1 => t('Style 1'), 2 => t('Style 2'), 3 => t('Style 3'), 4 => t('Style 4'), 5 => t('Style 5'))); // Grid Settings $form['advanced_settings']['grid_settings'] = array('#type' => 'fieldset', '#title' => t('Grid Settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => -10); $form['advanced_settings']['grid_settings']['grid_size'] = array('#type' => 'select', '#title' => t('Grid Size'), '#default_value' => theme_get_setting('grid_size'), '#options' => array(12 => t('12 columns'))); $form['advanced_settings']['grid_settings']['sidebar_grid_settings'] = array('#type' => 'fieldset', '#title' => t('Sidebar Grid Settings'), '#description' => t('Customize the Sidebars.'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => array('form-inline')), '#prefix' => t('<h3> Sidebar Grid Settings </h3>')); $form['advanced_settings']['grid_settings']['sidebar_grid_settings']['sidebar_layout'] = array('#type' => 'select', '#title' => t('Sidebar Layout'), '#default_value' => theme_get_setting('sidebar_layout'), '#options' => array('sidebars-both-first' => t('Both Sidebars First'), 'sidebars-both-second' => t('Both Sidebars Second'), 'sidebars-split' => t('Split Sidebars'))); $form['advanced_settings']['grid_settings']['sidebar_grid_settings']['sidebar_first_width'] = array('#type' => 'select', '#title' => t('Sidebar First'), '#default_value' => theme_get_setting('sidebar_first_width'), '#options' => $col_number); $form['advanced_settings']['grid_settings']['sidebar_grid_settings']['sidebar_second_width'] = array('#type' => 'select', '#title' => t('Sidebar Second'), '#default_value' => theme_get_setting('sidebar_second_width'), '#options' => $col_number); $form['advanced_settings']['grid_settings']['preface_settings'] = array('#type' => 'fieldset', '#title' => t('More Grid Settings'), '#description' => t('Customize widths of the Preface regions. Note that all four values combined should ideally add up to ' . $grid_size . '.'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => array('form-inline')), '#prefix' => t('<h3> Preface Grid Widths </h3>')); $form['advanced_settings']['grid_settings']['postscript_settings'] = array('#type' => 'fieldset', '#title' => t('More Grid Settings'), '#description' => t('Customize widths of the Postscript regions. Note that all four values combined should ideally add up to ' . $grid_size . '.'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => array('form-inline')), '#prefix' => t('<h3> Postscript Grid Widths </h3>')); for ($region_count = 1; $region_count <= 4; $region_count++) { $form['advanced_settings']['grid_settings']['preface_settings']['preface_' . $region_count . '_grid_width'] = array('#type' => 'select', '#title' => t('Preface ' . $region_count), '#default_value' => theme_get_setting('preface_' . $region_count . '_grid_width'), '#options' => $col_number); $form['advanced_settings']['grid_settings']['postscript_settings']['postscript_' . $region_count . '_grid_width'] = array('#type' => 'select', '#title' => t('Postscript ' . $region_count), '#default_value' => theme_get_setting('postscript_' . $region_count . '_grid_width'), '#options' => $col_number); } // Misc Settings (Facebook, Twitter, etc.) $form['advanced_settings']['misc_settings'] = array('#type' => 'fieldset', '#title' => t('Misc Settings'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['advanced_settings']['misc_settings']['twitter'] = array('#type' => 'textfield', '#title' => t('Twitter URL'), '#size' => 10, '#default_value' => theme_get_setting('twitter')); $form['advanced_settings']['misc_settings']['facebook'] = array('#type' => 'textfield', '#title' => t('Facebook URL'), '#size' => 10, '#default_value' => theme_get_setting('facebook')); }
/** * Implements hook_form_FORM_ID_alter(). * @param $form * @param $form_state */ function midnight_form_system_theme_settings_alter(&$form, &$form_state) { // Disabling responsiveness $form['advanced']['responsive_utilities'] = array('#type' => 'fieldset', '#title' => t('Responsive utilities'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['advanced']['responsive_utilities']['disabling_responsiveness'] = array('#type' => 'checkbox', '#title' => t('Disabling responsiveness'), '#default_value' => theme_get_setting('disabling_responsiveness'), '#description' => t('Enable this if you want to disabling responsiveness on theme.')); $form['advanced']['responsive_utilities']['non_responsive_width'] = array('#type' => 'select', '#title' => t('Default container width'), '#description' => t('Select your default width of container class on page.'), '#default_value' => theme_get_setting('non_responsive_width'), '#options' => array('970' => t('Medium devices (970px)'), '1170' => t('Large devices (1170px)')), '#states' => array('invisible' => array(':input[name="disabling_responsiveness"]' => array('checked' => FALSE)))); }
/** * Implements hook_form_system_theme_settings_alter() function. */ function glisseo_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) { // Bug workaround (#943212). if (isset($form_id)) { return; } // We move default theme settings to new fieldset. $form['theme_settings_fieldset'] = array('#type' => 'fieldset', '#title' => t('Base theme settings'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE); $form['theme_settings_fieldset']['theme_settings'] = $form['theme_settings']; unset($form['theme_settings']); $form['theme_settings_fieldset']['logo'] = $form['logo']; unset($form['logo']); $form['theme_settings_fieldset']['favicon'] = $form['favicon']; unset($form['favicon']); $form['developers_settings'] = array('#type' => 'fieldset', '#title' => t('Development'), '#weight' => 2, '#collapsible' => TRUE, '#collapsed' => TRUE); $form['developers_settings']['glisseo_rebuild_registry'] = array('#weight' => 1, '#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page load.'), '#default_value' => theme_get_setting('glisseo_rebuild_registry')); $form['developers_settings']['glisseo_body_classes'] = array('#weight' => 2, '#type' => 'checkbox', '#title' => t('Add HTML classes to body-tag element.'), '#description' => t('Adds classes to body element. F.e.: html front logged-in page-node ...'), '#default_value' => theme_get_setting('glisseo_body_classes')); $form['developers_settings']['glisseo_new_checkboxes'] = array('#weight' => 3, '#type' => 'checkbox', '#title' => t('New checkbox style.'), '#description' => t('Checkboxes will be displayed as switchers.'), '#default_value' => theme_get_setting('glisseo_new_checkboxes')); $form['developers_settings']['glisseo_new_radios'] = array('#weight' => 4, '#type' => 'checkbox', '#title' => t('New radio-button style.'), '#description' => t('Radio-buttons will be themed.'), '#default_value' => theme_get_setting('glisseo_new_radios')); $form['developers_settings']['glisseo_disable_grippie'] = array('#weight' => 5, '#type' => 'checkbox', '#title' => t('Disable textarea grippie.'), '#description' => t('Modern browser support textarea resize out the box. You can disable default grippie.'), '#default_value' => theme_get_setting('glisseo_disable_grippie')); // @TODO: manage all files without custom code. // This is some workaround for allow submit theme form with managed_file. //$theme = $GLOBALS['theme_key']; //$themes = list_themes(); //$form_state['build_info']['files'][] = str_replace("/$theme.info", '', $themes[$theme]->filename) . '/theme-settings.php'; //$form['#submit'][] = 'glisseo_theme_settings_form_submit'; }
/** * Implements hook_preprocess_region(). */ function bootstrap_preprocess_region(&$variables) { global $theme; $region = $variables['region']; $classes =& $variables['classes_array']; // Content region. if ($region === 'content') { // @todo is this actually used properly? $variables['theme_hook_suggestions'][] = 'region__no_wrapper'; } elseif ($region === 'help' && !empty($variables['content'])) { $variables['content'] = _bootstrap_icon('question-sign') . $variables['content']; $classes[] = 'alert'; $classes[] = 'alert-info'; $classes[] = 'messages'; $classes[] = 'info'; } // Support for "well" classes in regions. static $wells; if (!isset($wells)) { foreach (system_region_list($theme) as $name => $title) { $wells[$name] = theme_get_setting('bootstrap_region_well-' . $name); } } if (!empty($wells[$region])) { $classes[] = $wells[$region]; } }
/** * Override or insert variables into the html template. */ function garland_preprocess_html(&$vars) { // Toggle fixed or fluid width. if (theme_get_setting('garland_width') == 'fluid') { $vars['classes_array'][] = 'fluid-width'; } }
function razorDrupal_process_page(&$variables) { // Hook into color.module. if (module_exists('color')) { _color_page_alter($variables); } // Always print the site name and slogan, but if they are toggled off, we'll // just hide them visually. $variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE; $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE; if ($variables['hide_site_name']) { // If toggle_name is FALSE, the site_name will be empty, so we rebuild it. $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal')); } if ($variables['hide_site_slogan']) { // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it. $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', '')); } // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { // Add a wrapper div using the title_prefix and title_suffix render elements. $variables['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100); $variables['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99); // Make sure the shortcut link is the first item in title_suffix. $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } }
function corporateclean_preprocess_html(&$variables) { if (!theme_get_setting('responsive_respond', 'corporateclean')) { drupal_add_css(path_to_theme() . '/css/basic-layout.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE)); } drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE)); }
function sonambulo_form_system_theme_settings_alter(&$form, &$form_state) { $form['libraries'] = array('#type' => 'fieldset', '#title' => t('Additional Libraries')); $form['libraries']['html5shim'] = array('#type' => 'checkbox', '#title' => t('html5 Shim'), '#default_value' => theme_get_setting('html5shim'), '#description' => t('Adds the html5 shim, a library that enables non-modern browsers to recognize HTML5 elements.')); $form['libraries']['respond_js'] = array('#type' => 'checkbox', '#title' => t('Respond'), '#default_value' => theme_get_setting('respond_js'), '#description' => t('respond.js: A fast & lightweight polyfill for min/max-width CSS3 Media Queries (JavaScript library for IE 6-8, and more).')); $form['libraries']['normalize_css'] = array('#type' => 'checkbox', '#title' => t('normalize.css'), '#default_value' => theme_get_setting('normalize_css'), '#description' => t('A modern, HTML5-ready alternative to CSS resets.')); }
function cu_omega_form_system_theme_settings_alter(&$form, &$form_state) { $theme = $form_state['build_info']['args'][0]; $form['cu_omega_theme_settings'] = array('#type' => 'fieldset', '#title' => t('Theme Settings')); $form['cu_omega_theme_settings']['typography'] = array('#type' => 'fieldset', '#title' => t('Typography'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['typography']['headings'] = array('#type' => 'radios', '#title' => t('Heading Style'), '#default_value' => theme_get_setting('headings', $theme) ? theme_get_setting('headings', $theme) : 'headings-bold', '#description' => t('Pick a style for your sites headings.'), '#options' => array('headings-bold' => t('Bold'), 'headings-light' => t('Light'))); if (module_exists('cu_title_image')) { $form['cu_omega_theme_settings']['page_title_image'] = array('#type' => 'fieldset', '#title' => t('Page Title Image'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['page_title_image']['page_title_image_background'] = array('#type' => 'radios', '#title' => t('Page Title Image Style'), '#default_value' => theme_get_setting('page_title_image_background', $theme) ? theme_get_setting('page_title_image_background', $theme) : 'page-title-image-background-white', '#description' => t('Pick a style for page title image text.'), '#options' => array('page-title-image-background-white' => t('Solid'), 'page-title-image-background-transparent' => t('Transparent'))); $form['cu_omega_theme_settings']['page_title_image']['page_title_image_width'] = array('#type' => 'radios', '#title' => t('Page Title Image Width'), '#default_value' => theme_get_setting('page_title_image_width', $theme) ? theme_get_setting('page_title_image_width', $theme) : 'page-title-image-width-content', '#description' => t('Pick a width for page title image. The effect is more dramatic when the theme layout option is set to wide.'), '#options' => array('page-title-image-width-full' => t('Browser Width'), 'page-title-image-width-content' => t('Content Width'))); } $form['cu_omega_theme_settings']['columns'] = array('#type' => 'fieldset', '#title' => t('Column Options'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['columns']['after_content_columns'] = array('#type' => 'radios', '#title' => t('After Content Columns'), '#default_value' => theme_get_setting('after_content_columns', $theme) ? theme_get_setting('after_content_columns', $theme) : '3', '#description' => t('Pick how many columns for blocks after the content'), '#options' => array('6' => t('6'), '4' => t('4'), '3' => t('3'), '2' => t('2'), '1' => t('1'))); $form['cu_omega_theme_settings']['columns']['lower_columns'] = array('#type' => 'radios', '#title' => t('After Content 2 Columns'), '#default_value' => theme_get_setting('lower_columns', $theme) ? theme_get_setting('lower_columns', $theme) : '2', '#description' => t('Pick how many columns for blocks in the second after content region'), '#options' => array('6' => t('6'), '4' => t('4'), '3' => t('3'), '2' => t('2'), '1' => t('1'))); $form['cu_omega_theme_settings']['columns']['footer_columns'] = array('#type' => 'radios', '#title' => t('Footer Columns'), '#default_value' => theme_get_setting('footer_columns', $theme) ? theme_get_setting('footer_columns', $theme) : '4', '#description' => t('Pick how many columns for blocks in the footer'), '#options' => array('6' => t('6'), '4' => t('4'), '3' => t('3'), '2' => t('2'), '1' => t('1'))); $form['cu_omega_theme_settings']['breadcrumbs'] = array('#type' => 'fieldset', '#title' => t('Breadcrumbs'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['breadcrumbs']['use_breadcrumbs'] = array('#type' => 'checkbox', '#title' => t('Use Breadcrumbs'), '#default_value' => theme_get_setting('use_breadcrumbs', $theme) ? theme_get_setting('use_breadcrumbs', $theme) : FALSE, '#description' => t('Enable breadcrumb navigation.')); $form['cu_omega_theme_settings']['action_menu'] = array('#type' => 'fieldset', '#title' => t('Secondary Menu'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['action_menu']['use_action_menu'] = array('#type' => 'checkbox', '#title' => t('Placement'), '#default_value' => theme_get_setting('use_action_menu', $theme) ? theme_get_setting('use_action_menu', $theme) : FALSE, '#description' => t('Place secondary menu as buttons on main navigation bar. Secondary menu label does not display when this option is selected.')); $form['cu_omega_theme_settings']['action_menu']['action_menu_color'] = array('#type' => 'radios', '#title' => t('Color'), '#default_value' => theme_get_setting('action_menu_color', $theme) ? theme_get_setting('action_menu_color', $theme) : 'action-none', '#description' => t('Pick color for action menu'), '#options' => array('action-blue' => t('Blue'), 'action-gray' => t('Gray'), 'action-gold' => t('Gold'), 'action-none' => t('None (same as main menu navigation)'))); $form['cu_omega_theme_settings']['footer_menu'] = array('#type' => 'fieldset', '#title' => t('Footer Menu'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['footer_menu']['footer_menu_color'] = array('#type' => 'radios', '#title' => t('Color'), '#default_value' => theme_get_setting('footer_menu_color', $theme) ? theme_get_setting('footer_menu_color', $theme) : 'footer-menu-gray', '#description' => t('Pick color for footer menu.'), '#options' => array('footer-menu-gray' => t('Gray'), 'footer-menu-gold' => t('Gold'))); $form['cu_omega_theme_settings']['block_icons'] = array('#type' => 'fieldset', '#title' => t('Block Icons'), '#collapsible' => TRUE, '#collapsed' => TRUE); $form['cu_omega_theme_settings']['block_icons']['block_icons_color'] = array('#type' => 'radios', '#title' => t('Color'), '#default_value' => theme_get_setting('block_icons_color', $theme) ? theme_get_setting('block_icons_color', $theme) : 'block-icons-inherit', '#description' => t('Pick color for block title icons.'), '#options' => array('block-icons-inherit' => t('Same as block title text'), 'block-icons-gray' => t('Gray'), 'block-icons-gold' => t('Gold'))); }
function titan_form_system_theme_settings_alter(&$form, $form_state) { // Generate the form using Forms API. http://api.drupal.org/api/7 $form['custom'] = array('#title' => 'Custom theme settings', '#type' => 'fieldset'); $form['custom']['trim_pager'] = array('#type' => 'select', '#title' => 'Trim pager after specified number of pages', '#default_value' => theme_get_setting('trim_pager'), '#options' => titan_generate_array(4, 15, 1, '')); $form['custom']['copyright_information'] = array('#title' => 'Copyright information', '#description' => t('Information about copyright holder of the website - will show up at the bottom of the page'), '#type' => 'textfield', '#default_value' => theme_get_setting('copyright_information'), '#size' => 60, '#maxlength' => 128, '#required' => FALSE); }
/** * Implements THEME_form_system_theme_settings_alter(). */ function ember_form_system_theme_settings_alter(&$form, &$form_state) { $form['ember'] = array('#type' => 'fieldset', '#title' => t('Ember settings'), '#description' => t('Settings specific to Ember theme.')); $form['ember']['display_breadcrumbs'] = array('#type' => 'checkbox', '#title' => t('Toggle Breadcrumbs'), '#default_value' => theme_get_setting('display_breadcrumbs'), '#description' => t('If checked, breadcrumbs will not display')); $form['ember']['ember_no_fadein_effect'] = array('#type' => 'checkbox', '#title' => t('Toggle fade-in effect'), '#default_value' => theme_get_setting('ember_no_fadein_effect'), '#description' => t('If checked, the fade-in effect will not occur.')); $form['ember']['views_ui_override'] = array('#type' => 'checkbox', '#title' => t('Enable Views UI overrides'), '#default_value' => theme_get_setting('views_ui_override'), '#description' => t('Ember makes several improvements to the Views admin interface. You can disable those overrides here.')); }
/** * Implements hook_library(). */ function anakin_library() { $libraries = array(); // Check if we need to include the minified files. $minifed = theme_get_setting('minified'); if ($minifed) { $min_extension = '.min.js'; } else { $min_extension = '.js'; } /** * Modernizr tells you what HTML, CSS and JavaScript features the user’s * browser has to offer. * * @see http://modernizr.com/ */ $libraries['modernizr'] = array('title' => 'Modernizr', 'website' => 'http://modernizr.com/', 'version' => 'v3.2.0', 'js' => array(drupal_get_path('theme', 'anakin') . "/dist/js/vendor/modernizr{$min_extension}" => array())); /** * Underscore is a JavaScript library that provides lots of useful functional * programming helpers without extending any built-in objects. * E.G. map, filter, invoke, ... * * @see http://underscorejs.org/ */ $libraries['underscore'] = array('title' => 'Underscore', 'website' => 'http://underscorejs.org/', 'version' => '1.8.3', 'js' => array(drupal_get_path('theme', 'anakin') . "/bower_components/underscore/underscore-min.js" => array())); /** * A fast & lightweight polyfill for min/max-width CSS3 Media Queries * (for IE 6-8, and more) * * @see https://github.com/scottjehl/Respond */ $libraries['respond'] = array('title' => 'Respond', 'website' => 'https://github.com/scottjehl/Respond', 'version' => '1.4.2', 'js' => array(drupal_get_path('theme', 'anakin') . "/bower_components/respond/respond{$min_extension}" => array())); return $libraries; }
/** * Initialize theme settings if needed */ function fusion_core_initialize_theme_settings($theme_name) { $theme_settings = theme_get_settings($theme_name); if (is_null($theme_settings['theme_font_size']) || $theme_settings['rebuild_registry'] == 1) { // Rebuild theme registry & notify user if ($theme_settings['rebuild_registry'] == 1) { drupal_rebuild_theme_registry(); drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning'); } // Retrieve saved or site-wide theme settings $theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings'); $settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings(); // Skip toggle_node_info_ settings if (module_exists('node')) { foreach (node_get_types() as $type => $name) { unset($settings['toggle_node_info_' . $type]); } } // Retrieve default theme settings $defaults = fusion_core_default_theme_settings(); // Set combined default & saved theme settings variable_set($theme_setting_name, array_merge($defaults, $settings)); // Force theme settings refresh theme_get_setting('', TRUE); } }
/** * @file * webskillet theme-settings.php */ function webskillet_form_system_theme_settings_alter(&$form, $form_state) { $form['webskillet_navigation'] = array('#type' => 'fieldset', '#title' => 'Navigation', '#collapsible' => TRUE); $form['webskillet_navigation']['webskillet_navigation_title'] = array('#type' => 'textfield', '#title' => t('Navigation Title'), '#description' => t('Title to display for navigation (generally only shown on mobile)'), '#default_value' => theme_get_setting('webskillet_navigation_title')); $form['webskillet_navigation']['webskillet_navigation_icon'] = array('#type' => 'textfield', '#title' => t('Navigation Icon'), '#description' => t('Fontawesome icon class to add to navigation title (generally only shown on mobile)'), '#default_value' => theme_get_setting('webskillet_navigation_icon')); $form['webskillet_navigation']['webskillet_navigation_style'] = array('#type' => 'select', '#title' => t('Mobile Navigation Style'), '#options' => array('default' => 'Default', 'basic' => 'Basic'), '#description' => t('<strong>Default:</strong> On devices smaller than an iPad (768 pixels), clicking on navigation header slides menu in from the left side, with sub-menus opening downward<br /><strong>Basic:</strong> On devices smaller than an iPad (768 pixels), clicking on navigation header opens menu directly below the header, with sub-menus opening downward'), '#default_value' => theme_get_setting('webskillet_navigation_style')); $form['webskillet_navigation']['webskillet_dismiss_style'] = array('#type' => 'select', '#title' => t('Dismiss Icon Style'), '#options' => array('fa-times-circle-o' => 'Thick FontAwesome times-circle-o', 'css' => 'Thin CSS X'), '#default_value' => theme_get_setting('webskillet_dismiss_style')); $form['webskillet_section_navigation'] = array('#type' => 'fieldset', '#title' => 'In-page section navigation', '#collapsible' => true, '#collapsed' => theme_get_setting('webskillet_section_navigation_selector') != '.section-navigation' || theme_get_setting('webskillet_section_navigation_padding') != 20); $form['webskillet_section_navigation']['webskillet_section_navigation_selector'] = array('#type' => 'textfield', '#title' => t('Section Navigation Selector'), '#description' => t('jQuery selector to trigger in-page section navigation'), '#default_value' => theme_get_setting('webskillet_section_navigation_selector')); $form['webskillet_section_navigation']['webskillet_section_navigation_padding'] = array('#type' => 'textfield', '#title' => t('Section Navigation Padding'), '#description' => t('Number of pixels to leave at the top of the page when scrolling to another section of the page (increase if you are using a fixed header)'), '#default_value' => theme_get_setting('webskillet_section_navigation_padding')); $form['webskillet_external'] = array('#type' => 'fieldset', '#title' => 'External link handling', '#collapsible' => true, '#collapsed' => !theme_get_setting('webskillet_external_links_exceptions')); $form['webskillet_external']['webskillet_external_links'] = array('#type' => 'radios', '#title' => t('Open any links that go offsite in a new window'), '#default_value' => theme_get_setting('webskillet_external_links'), '#options' => array(1 => 'Yes', 0 => 'No')); $form['webskillet_external']['webskillet_external_links_exceptions'] = array('#type' => 'textfield', '#title' => t('Exceptions'), '#description' => t('jQuery selector for external links that should <strong>not</strong> be opened in a new window'), '#default_value' => theme_get_setting('webskillet_external_links_exceptions')); $form['webskillet_style'] = array('#type' => 'fieldset', '#title' => 'Style settings (css and fonts)', '#collapsible' => true, '#collapsed' => !(theme_get_setting('webskillet_google_webfonts') || theme_get_setting('webskillet_custom_css'))); $form['webskillet_style']['webskillet_google_webfonts'] = array('#type' => 'textfield', '#title' => t('Google webfonts'), '#description' => t('Will be appended to //fonts.googleapis.com/css?family='), '#default_value' => theme_get_setting('webskillet_google_webfonts')); $form['webskillet_style']['webskillet_custom_css'] = array('#type' => 'textarea', '#title' => t('Custom CSS'), '#description' => t('CSS to be added inside <style> tags in <head> element, after all other styles'), '#default_value' => theme_get_setting('webskillet_custom_css'), '#cols' => 60, '#rows' => 7); $form['webskillet_js'] = array('#type' => 'fieldset', '#title' => 'Javascript', '#collapsible' => true, '#collapsed' => !theme_get_setting('webskillet_custom_js')); $form['webskillet_js']['webskillet_js_validate_forms'] = array('#type' => 'radios', '#title' => t('Validate all forms using jquery validate?'), '#default_value' => theme_get_setting('webskillet_js_validate_forms'), '#options' => array(1 => 'Yes', 0 => 'No')); $form['webskillet_js']['webskillet_js_fix_footer'] = array('#type' => 'radios', '#title' => t('Fix footer to bottom of the window if page content is shorter than window height?'), '#default_value' => theme_get_setting('webskillet_js_fix_footer'), '#options' => array(1 => 'Yes', 0 => 'No')); $form['webskillet_js']['webskillet_js_shorten_links'] = array('#type' => 'radios', '#title' => t('Shorten any links that don\'t fit in their parent container?'), '#default_value' => theme_get_setting('webskillet_js_shorten_links'), '#options' => array(1 => 'Yes', 0 => 'No')); $form['webskillet_js']['webskillet_custom_js'] = array('#type' => 'textarea', '#title' => t('Custom Javascript'), '#description' => t('Javascript to be added inside <script> tags in <head> element, after all other scripts'), '#default_value' => theme_get_setting('webskillet_custom_js'), '#cols' => 60, '#rows' => 7); $form['webskillet_twitter'] = array('#type' => 'fieldset', '#title' => 'Twitter', '#collapsible' => true, '#collapsed' => !(theme_get_setting('webskillet_twitter_handle') || theme_get_setting('webskillet_twitter_hashtag') || theme_get_setting('webskillet_twitter_field'))); $form['webskillet_twitter']['webskillet_twitter_handle'] = array('#type' => 'textfield', '#title' => t('Twitter handle for sharing links'), '#description' => t('If you enter a Twitter handle here, it will be appended to "share this on Twitter" tweets'), '#default_value' => theme_get_setting('webskillet_twitter_handle')); $form['webskillet_twitter']['webskillet_twitter_hashtag'] = array('#type' => 'textfield', '#title' => t('Twitter hashtag for sharing links'), '#description' => t('If you enter a Twitter hashtag here, it will be appended to "share this on Twitter" tweets'), '#default_value' => theme_get_setting('webskillet_twitter_hashtag')); $form['webskillet_twitter']['webskillet_twitter_field'] = array('#type' => 'textfield', '#title' => t('Field to use for tweet'), '#description' => t('By default, the title of the node will be used for the tweet. Enter the machine name of a custom field to allow that field to override the title (title will still be used if this field is blank, or if the node type doesn\'t have the field). This <strong>will</strong> hide the field in the node display, unless you override that behavior in node.tpl.php.'), '#default_value' => theme_get_setting('webskillet_twitter_field')); $form['webskillet_blocks'] = array('#type' => 'fieldset', '#title' => 'Advanced block settings', '#collapsible' => true, '#collapsed' => !(theme_get_setting('webskillet_block_classes') || theme_get_setting('webskillet_block_icons'))); $form['webskillet_blocks']['webskillet_block_classes'] = array('#type' => 'textarea', '#title' => t('Block classes by region'), '#description' => t('<p>To add a class (such as a Bootstrap grid column class) to all blocks in a given region, use this format: region|class. One region per line, separate multiple classes with spaces.</p><p>Available regions: header, navigation, highlighted, content, sidebar_first, sidebar_second, prefooter1, prefooter2, utility, footer</p><p>By default, blocks in the Highlighted, Prefooter 1 and 2 and Footer region will be given the col-xs-12 class, to assure proper padding inside the row element.</p>'), '#default_value' => theme_get_setting('webskillet_block_classes'), '#cols' => 60, '#rows' => 7); $form['webskillet_blocks']['webskillet_block_icons'] = array('#type' => 'textarea', '#title' => t('Block Title Icons'), '#description' => t('To add an icon to the title of a block, use this format: block_id|icon. One block per line. icon can be either a class declaration, in which case an <i> element with the class will be prepended to the title, or any arbitrary html (such as an <img> tag).'), '#default_value' => theme_get_setting('webskillet_block_icons'), '#cols' => 60, '#rows' => 7); $form['webskillet_google_site_verification'] = array('#type' => 'textfield', '#title' => t('Google site verification code'), '#default_value' => theme_get_setting('webskillet_google_site_verification')); return $form; }
function andrupal_footer_scripts() { if (theme_get_setting("footer_scripts")) { return "<script type=text/javascript>" . theme_get_setting("footer_scripts") . "</script>" . "\n"; } return NULL; }
/** * Implements theme_settings(). */ function radix_form_system_theme_settings_alter(&$form, &$form_state) { $theme_path = drupal_get_path('theme', 'sizzle'); // Ensure this include file is loaded when the form is rebuilt from the cache. $form_state['build_info']['files']['form'] = $theme_path . '/theme-settings.php'; // Hide all theme settings $form['theme_settings']['#access'] = FALSE; // Add theme settings here. $form['default_theme_settings'] = array('#title' => t('Theme Settings'), '#type' => 'vertical_tabs'); $form['layout'] = array('#type' => 'fieldset', '#title' => t('Layout'), '#collapsible' => TRUE, '#group' => 'default_theme_settings'); $form['layout']['site_width'] = array('#title' => t('Width'), '#type' => 'radios', '#options' => array('full' => t('Full width'), 'boxed' => t('Boxed')), '#default_value' => theme_get_setting('site_width')); // Site background image. $form['layout']['site_background_image'] = array('#title' => t('Background image'), '#type' => 'managed_file', '#description' => t('The background image to use for the site.'), '#upload_location' => 'public://', '#theme' => 'restaurant_admin_thumbnail', '#default_value' => theme_get_setting('site_background_image')); // Create a branding group and move logo and favicon to it. $form['branding'] = array('#type' => 'fieldset', '#title' => t('Branding'), '#collapsible' => TRUE, '#group' => 'default_theme_settings'); $form['logo']['#group'] = 'branding'; $form['favicon']['#group'] = 'branding'; // Footer. $form['footer'] = array('#type' => 'fieldset', '#title' => t('Footer'), '#collapsible' => TRUE, '#group' => 'default_theme_settings'); // Footer background image. $form['footer']['footer_background_image'] = array('#title' => t('Background image'), '#type' => 'managed_file', '#description' => t('The background image to use for the site footer.'), '#upload_location' => 'public://', '#theme' => 'restaurant_admin_thumbnail', '#default_value' => theme_get_setting('footer_background_image')); // Footer text. $footer_text = theme_get_setting('footer_text'); $form['footer']['footer_text'] = array('#title' => t('Footer text'), '#type' => 'text_format', '#format' => $footer_text['format'], '#default_value' => $footer_text['value']); $form['footer']['show_footer_nav'] = array('#title' => t('Show the footer nav?'), '#type' => 'checkbox', '#default_value' => theme_get_setting('show_footer_nav')); // Copyright. $copyright = theme_get_setting('copyright'); $form['footer']['copyright'] = array('#title' => t('Copyright'), '#type' => 'text_format', '#format' => $copyright['format'], '#default_value' => $copyright['value']); // Add a custom submit handler. $form['#submit'][] = 'sizzle_form_system_theme_settings_submit'; // Return the additional form widgets. return $form; }
/** * Implements template_preprocess_html(). */ function SUBTHEME_preprocess_html(&$variables) { // CSS files for Internet Explorer-specific styles. drupal_add_css(path_to_theme() . '/css/ie/SUBTHEME-ielt9.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'screen', 'browsers' => array('IE' => 'lt IE 9', '!IE' => FALSE), 'preprocess' => FALSE)); drupal_add_css(path_to_theme() . '/css/ie/SUBTHEME-ielt8.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'screen', 'browsers' => array('IE' => 'lt IE 8', '!IE' => FALSE), 'preprocess' => FALSE)); // Responsive stylesheets. if (theme_get_setting('zentropy_responsive_enable')) { drupal_add_css(path_to_theme() . '/css/layout/SUBTHEME-320.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'only screen and (min-width : 320px) and (max-width : 480px)')); drupal_add_css(path_to_theme() . '/css/layout/SUBTHEME-480.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'only screen and (min-width : 480px) and (max-width: 768px)')); drupal_add_css(path_to_theme() . '/css/layout/SUBTHEME-768.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'only screen and (min-width : 768px) and (max-width: 992px)')); drupal_add_css(path_to_theme() . '/css/layout/SUBTHEME-992.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'only screen and (min-width : 992px) and (max-width: 1382px)')); drupal_add_css(path_to_theme() . '/css/layout/SUBTHEME-1382.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'only screen and (min-width : 1382px)')); // Styles for iPhone 4+, iPad 3+, Opera Mobile 11+ and other high pixel ratio browsers and devices. drupal_add_css(path_to_theme() . '/css/layout/SUBTHEME-hipixel.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'media' => 'only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min--moz-device-pixel-ratio: 1.5)')); } else { $fallback = theme_get_setting('zentropy_responsive_fallback'); drupal_add_css(path_to_theme() . "/css/layout/SUBTHEME-{$fallback}.css", array('group' => CSS_THEME, 'every_page' => TRUE)); } /* Add your own custom logic in between the following lines: --------------------------------------------------------------------*/ /* STOP!!!! Don't edit this function below this line! --------------------------------------------------------------------*/ // The below code comments are placeholders for Zentropy optional components downloaded and installed via Drush. // For more information see the section "Advanced Drush Integration" in Zentropy's README.txt or the project page on drupal.org: http://drupal.org/project/zentropy // To find out how to manually enable components (without Drush), read the handbook: http://drupal.org/node/1515894 // IMPORTANT: DO NOT EDIT OR REMOVE THE LINES BELOW UNLESS YOU REALLY KNOW WHAT YOU ARE DOING! $zentropy_scripts_head = array(); #modernizr# #easing# #hoverintent# #bgiframe# $variables['zentropy_scripts_head'] .= implode("\n", $zentropy_scripts_head); }
/** * Implements hook_preprocess_image_srcset(). */ function bootstrap_preprocess_image_srcset(&$variables) { // Add image shape, if necessary. if ($shape = theme_get_setting('bootstrap_image_shape')) { $variables['attributes']['class'][] = $shape; } }
/** * Implements hook_preprocess_page(). */ function carbon_preprocess_page(&$variables) { $is_front = $variables['is_front']; // Adjust the html element that wraps the site name. h1 on front page, p on other pages $variables['wrapper_site_name_prefix'] = ($is_front ? '<h1' : '<p'); $variables['wrapper_site_name_prefix'] .= ' id="site-name"'; $variables['wrapper_site_name_prefix'] .= ' class="site-name'.($is_front ? ' site-name-front' : '').'"'; $variables['wrapper_site_name_prefix'] .= '>'; $variables['wrapper_site_name_suffix'] = ($is_front ? '</h1>' : '</p>'); // If the theme's info file contains the custom theme setting // default_logo_path, set the $logo variable to that path. $default_logo_path = theme_get_setting('default_logo_path'); if (!empty($default_logo_path) && theme_get_setting('default_logo')) { $variables['logo'] = file_create_url(path_to_theme() . '/' . $default_logo_path); } else { $variables['logo'] = null; } //Arrange the elements of the main content area (content and sidebars) based on the layout class $layoutClass = _carbon_get_layout(); $layout = substr(strrchr($layoutClass, '-'), 1); //Get the last bit of the layout class, the 'abc' string $contentPos = strpos($layout, 'c'); $sidebarsLeft = substr($layout,0,$contentPos); $sidebarsRight = strrev(substr($layout,($contentPos+1))); // Reverse the string so that the floats are correct. $sidebarsHidden = ''; // Create a string of sidebars that are hidden to render and then display:none if(stripos($layout, 'a') === false) { $sidebarsHidden .= 'a'; } if(stripos($layout, 'b') === false) { $sidebarsHidden .= 'b'; } $variables['sidebars']['left'] = str_split($sidebarsLeft); $variables['sidebars']['right'] = str_split($sidebarsRight); $variables['sidebars']['hidden'] = str_split($sidebarsHidden); }
/** * Implements hook_form_FORM_ID_alter(). * * @param $form * The form. * @param $form_state * The form state. */ function rootcandy_form_system_theme_settings_alter(&$form, &$form_state) { global $custom_theme; $custom_theme = 'rootcandy'; // Create the form widgets using Forms API $form['header'] = array('#type' => 'fieldset', '#title' => t('Header'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE); $form['header']['rootcandy_header_display'] = array('#type' => 'checkbox', '#title' => t('Disable header'), '#default_value' => theme_get_setting('rootcandy_header_display')); $form['header']['rootcandy_header_display_overlay'] = array('#type' => 'checkbox', '#title' => t('Disable header in overlay'), '#default_value' => theme_get_setting('rootcandy_header_display_overlay')); $form['header']['rootcandy_hide_panel'] = array('#type' => 'checkbox', '#title' => t('Disable sliding panel'), '#default_value' => theme_get_setting('rootcandy_hide_panel')); $form['header']['rootcandy_hide_panel_overlay'] = array('#type' => 'checkbox', '#title' => t('Disable sliding panel in overlay'), '#default_value' => theme_get_setting('rootcandy_hide_panel_overlay')); $form['navigation'] = array('#type' => 'fieldset', '#title' => t('Navigation'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE); // Create the form widgets using Forms API $form['navigation']['rootcandy_navigation_icons'] = array('#type' => 'checkbox', '#title' => t('Disable icons for main navigation'), '#default_value' => theme_get_setting('rootcandy_navigation_icons')); $form['navigation']['rootcandy_navigation_icons_size'] = array('#type' => 'select', '#options' => array(16 => 16, 24 => 24, 32 => 32), '#title' => t('Set icons size for main navigation'), '#default_value' => theme_get_setting('rootcandy_navigation_icons_size')); $menu_options = array_merge(array('_rootcandy_default_navigation' => t('default navigation')), menu_get_menus()); if (!($rootcandy_navigation_source_admin = theme_get_setting('rootcandy_navigation_source_admin'))) { $rootcandy_navigation_source_admin = '_rootcandy_default_navigation'; } $form['navigation']['rootcandy_superuser_menu'] = array('#type' => 'fieldset', '#title' => t('Super user (uid 1) menu'), '#weight' => 1, '#collapsible' => TRUE, '#collapsed' => TRUE); $form['navigation']['rootcandy_superuser_menu']['rootcandy_navigation_source_admin'] = array('#type' => 'select', '#default_value' => theme_get_setting('rootcandy_navigation_source_admin'), '#options' => $menu_options, '#tree' => FALSE); $primary_options = array(NULL => t('None')); $primary_options = array_merge($primary_options, $menu_options); $form['navigation']['role-weights'] = array('#type' => 'fieldset', '#title' => t('Menu by role and weights'), '#weight' => 2, '#collapsible' => TRUE, '#collapsed' => TRUE); // roles setting $roles = user_roles(FALSE); $max_weight = 0; foreach ($roles as $rid => $role) { $form['navigation']['role-weights']['group-' . $rid] = array('#type' => 'fieldset', '#title' => $role, '#collapsible' => TRUE, '#collapsed' => TRUE); $form['navigation']['role-weights']['group-' . $rid]['rootcandy_navigation_source_' . $rid] = array('#type' => 'select', '#default_value' => theme_get_setting('rootcandy_navigation_source_' . $rid), '#options' => $primary_options, '#tree' => FALSE); // TODO: calculate defaults - change to select $form['navigation']['role-weights']['group-' . $rid]['role-weight-' . $rid] = array('#type' => 'textfield', '#title' => t('Weight'), '#default_value' => theme_get_setting('role-weight-' . $rid), '#size' => 4, '#maxlength' => 4); } // Return the additional form widgets return $form; }
function apigee_devconnect_form_system_theme_settings_alter(&$form, $form_state) { $form['welcome_message'] = array('#type' => 'textfield', '#title' => t('Welcome Message'), '#default_value' => theme_get_setting('welcome_message'), '#description' => t("Use this field to change the default welcome message"), '#weight' => -11); $form['devconnect_branding'] = array('#type' => 'fieldset', '#weight' => -10, '#title' => t('Site Branding')); $form['devconnect_branding']['header_bg_color'] = array('#type' => 'textfield', '#title' => t('Header Background Color'), '#default_value' => theme_get_setting('header_bg_color'), '#description' => t("Use this field to change the header background color")); $form['devconnect_branding']['header_txt_color'] = array('#type' => 'textfield', '#title' => t('Header Text Color'), '#default_value' => theme_get_setting('header_txt_color'), '#description' => t("Use this field to change the header text color")); $form['devconnect_branding']['header_hover_bg_color'] = array('#type' => 'textfield', '#title' => t('Header Hover Background Color'), '#default_value' => theme_get_setting('header_hover_bg_color'), '#description' => t("Use this field to change the header background color on hover")); $form['devconnect_branding']['header_hover_txt_color'] = array('#type' => 'textfield', '#title' => t('Header Hover Text Color'), '#default_value' => theme_get_setting('header_hover_txt_color'), '#description' => t("Use this field to change the header text color on hover")); $form['devconnect_branding']['link_color'] = array('#type' => 'textfield', '#title' => t('Link Color'), '#default_value' => theme_get_setting('link_color'), '#description' => t("Use this field to change the color of links")); $form['devconnect_branding']['link_hover_color'] = array('#type' => 'textfield', '#title' => t('Link Hover Color'), '#default_value' => theme_get_setting('link_hover_color'), '#description' => t("Use this field to change the color of links on hover")); $form['devconnect_branding']['footer_bg_color'] = array('#type' => 'textfield', '#title' => t('Footer Background Color'), '#default_value' => theme_get_setting('footer_bg_color'), '#description' => t("Use this field to change the footer background color")); $form['devconnect_branding']['footer_link_color'] = array('#type' => 'textfield', '#title' => t('Footer Link Color'), '#default_value' => theme_get_setting('footer_link_color'), '#description' => t("Use this field to change the color of footer links")); $form['devconnect_branding']['footer_link_hover_color'] = array('#type' => 'textfield', '#title' => t('Footer Link Hover Color'), '#default_value' => theme_get_setting('footer_link_hover_color'), '#description' => t("Use this field to change the color of footer links on hover")); $form['devconnect_branding']['button_background_color'] = array('#type' => 'textfield', '#title' => t('Button Background Color'), '#default_value' => theme_get_setting('button_background_color'), '#description' => t("Use this field to change the button background color")); $form['devconnect_branding']['button_text_color'] = array('#type' => 'textfield', '#title' => t('Button Text Color'), '#default_value' => theme_get_setting('button_text_color'), '#description' => t("Use this field to change the button text color")); $form['devconnect_branding']['devconnect_branding']['button_hover_background_color'] = array('#type' => 'textfield', '#title' => t('Button Hover Background Color'), '#default_value' => theme_get_setting('button_hover_background_color'), '#description' => t("Use this field to change the button background color on hover")); $form['devconnect_branding']['devconnect_branding']['button_hover_text_color'] = array('#type' => 'textfield', '#title' => t('Button Hover Text Color'), '#default_value' => theme_get_setting('button_hover_text_color'), '#description' => t("Use this field to change the button text color on hover")); $form['responsive_design'] = array('#type' => 'fieldset', '#title' => t('Responsive Layouts'), '#description' => t("Enable/Disable responsive layouts")); $form['responsive_design']['wide_layout'] = array('#type' => 'checkbox', '#title' => t('Wide Layout'), '#default_value' => theme_get_setting('wide_layout')); $form['logo_variant'] = array('#type' => 'fieldset', '#title' => t('Logo Settings'), '#description' => t("Define the logo size for the header of the site")); $form_state['values']['logo_size'] = theme_get_setting('logo_size'); $size = apigee_devconnect_logo_size_example($form, $form_state); $form['logo_variant']['logo_size'] = array('#type' => 'select', '#default_value' => theme_get_setting('logo_size'), '#options' => array('standard' => t('71px x 26px (standard)'), 'big' => '272px x 100px (big)', 'bigger' => '372px x 136px (bigger)'), '#submit' => array('apigee_devconnect_logo_size_submit'), '#ajax' => array('wrapper' => 'logo-size-example', 'callback' => 'apigee_devconnect_logo_size_example', 'effect' => 'fade', 'progress' => 'none'), '#suffix' => $size); //settings to diable the deprecation message. $form['disable_deprecation_message'] = array('#type' => 'checkbox', '#title' => t("Disable deprecation message"), '#default_value' => theme_get_setting('disable_deprecation_message'), '#description' => t("Select this option to disable the deprecation message that is shown to the administrative users.")); }
/** * Implements hook_form_system_theme_settings_alter(). */ function professional_pro_form_system_theme_settings_alter(&$form, &$form_state) { $form['professional_pro_settings']['top_social_link'] = array('#type' => 'fieldset', '#title' => t('Social links in header'), '#collapsible' => TRUE, '#collapsed' => FALSE); $form['professional_pro_settings']['top_social_link']['social_links'] = array('#type' => 'checkbox', '#title' => t('Show social icons (Facebook, Twitter and RSS) in header'), '#default_value' => theme_get_setting('social_links', 'professional_pro'), '#description' => t("Check this option to show twitter, facebook, rss icons in header. Uncheck to hide.")); $form['professional_pro_settings']['top_social_link']['twitter_username'] = array('#type' => 'textfield', '#title' => t('Twitter Username'), '#default_value' => theme_get_setting('twitter_username', 'professional_pro'), '#description' => t("Enter your Twitter username.")); $form['professional_pro_settings']['top_social_link']['facebook_username'] = array('#type' => 'textfield', '#title' => t('Facebook Username'), '#default_value' => theme_get_setting('facebook_username', 'professional_pro'), '#description' => t("Enter your Facebook username.")); }
/** * Implements template_preprocess_page(). */ function asf_preprocess_page(&$variables) { // Add copyright to theme. if ($copyright = theme_get_setting('copyright')) { $variables['copyright'] = check_markup($copyright['value'], $copyright['format']); } }
/** * Implements hook_preprocess_picture(). */ function bootstrap_preprocess_picture(&$variables) { // Add responsiveness, if necessary. if ($shape = theme_get_setting('bootstrap_image_responsive')) { $variables['attributes']['class'][] = 'img-responsive'; } }