Example #1
0
/**
 * Theme override function to output bootstrap-style textfield.
 * This is a workaround for the issue that bootstrap_element_info_alter
 * can be skipped due to theme not yet being initialized when drupal_alter
 * call made.
 *
 * @ingroup themeable
 * @see theme_textfield
 */
function cignaglobal_textfield($vars)
{
    $element = $vars['element'];
    $element['#attributes']['type'] = 'text';
    element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
    // Add form-control class if it does not exist.
    $classes = array('form-text');
    if (!isset($element['#attributes']['class']) || !in_array('form-control', $element['#attributes']['class'])) {
        $classes[] = 'form-control';
    }
    _form_set_class($element, $classes);
    $extra = '';
    if ($element['#autocomplete_path'] && !empty($element['#autocomplete_input'])) {
        drupal_add_library('system', 'drupal.autocomplete');
        $element['#attributes']['class'][] = 'form-autocomplete';
        $attributes = array();
        $attributes['type'] = 'hidden';
        $attributes['id'] = $element['#autocomplete_input']['#id'];
        $attributes['value'] = $element['#autocomplete_input']['#url_value'];
        $attributes['disabled'] = 'disabled';
        $attributes['class'][] = 'autocomplete';
        $extra = '<input' . drupal_attributes($attributes) . ' />';
    }
    $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
    return $output . $extra;
}
Example #2
0
/**
 * Implements template_form_alter.
 */
function brush_form_alter(&$form, &$form_state, $form_id)
{
    if (strstr($form_id, 'commerce_cart_add_to_cart_form') || $form_id == 'views_form_commerce_cart_form_default') {
        drupal_add_library('system', 'ui.spinner');
        $form['#attached']['js'] = array(drupal_get_path('theme', 'brush') . '/js/commerce_spinner.js');
    }
}
function omega_sr_form_system_theme_settings_alter(&$form, &$form_state)
{
    include_once 'template.php';
    drupal_add_js(drupal_get_path('theme', 'omega_sr') . '/js/theme.js');
    drupal_add_css(drupal_get_path('theme', 'omega_sr') . '/css/theme.css');
    drupal_add_css(drupal_get_path('theme', 'omega_sr') . '/js/rs-plugin/css/font-style.css');
    drupal_add_library('system', 'ui');
    drupal_add_library('system', 'farbtastic');
    drupal_add_library('system', 'ui.sortable');
    drupal_add_library('system', 'ui.draggable');
    drupal_add_library('system', 'ui.dialog');
    $form_state['build_info']['files'][] = drupal_get_path('theme', 'omega_sr') . '/theme-settings.php';
    $form['#validate'][] = 'omega_sr_settings_validate';
    $form['#submit'][] = 'omega_sr_settings_submit';
    $settings['slider'] = theme_get_setting('slider', 'omega_sr');
    $form['theme_settings']['#collapsible'] = TRUE;
    $form['theme_settings']['#collapsed'] = TRUE;
    $form['logo']['#collapsible'] = TRUE;
    $form['logo']['#collapsed'] = TRUE;
    $form['favicon']['#collapsible'] = TRUE;
    $form['favicon']['#collapsed'] = TRUE;
    $form['alpha_settings']['slider-revolution'] = array('#type' => 'fieldset', '#title' => t('Slider revolution'));
    // Breadcrumb elements
    $form['alpha_settings']['slider-revolution']['slider-show'] = array('#type' => 'select', '#title' => t('Enable front page slider'), '#options' => array("1" => t('Yes'), "0" => t('No')), '#default_value' => theme_get_setting('slider-show', 'omega_sr'));
    include_once drupal_get_path('theme', 'omega_sr') . '/js/rs-plugin/RevolutionSlider.slider.inc';
}
 function add_meta()
 {
     ctools_include('display-edit', 'panels');
     ctools_include('content');
     if (empty($this->display->cache_key)) {
         $this->cache = panels_edit_cache_get_default($this->display);
     }
     // @todo we may need an else to load the cache, but I am not sure we
     // actually need to load it if we already have our cache key, and doing
     // so is a waste of resources.
     ctools_include('cleanstring');
     $this->clean_key = ctools_cleanstring($this->display->cache_key);
     $button = array('#type' => 'link', '#title' => t('Customize this page'), '#href' => $this->get_url('save_form'), '#id' => 'panels-ipe-customize-page', '#attributes' => array('class' => array('panels-ipe-startedit', 'panels-ipe-pseudobutton')), '#ajax' => array('progress' => 'throbber', 'ipe_cache_key' => $this->clean_key), '#prefix' => '<div class="panels-ipe-pseudobutton-container">', '#suffix' => '</div>');
     panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-startedit', $button);
     // @todo this actually should be an IPE setting instead.
     if (user_access('change layouts in place editing')) {
         $button = array('#type' => 'link', '#title' => t('Change layout'), '#href' => $this->get_url('change_layout'), '#attributes' => array('class' => array('panels-ipe-change-layout', 'panels-ipe-pseudobutton', 'ctools-modal-layout')), '#ajax' => array('progress' => 'throbber', 'ipe_cache_key' => $this->clean_key), '#prefix' => '<div class="panels-ipe-pseudobutton-container">', '#suffix' => '</div>');
         panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-change-layout', $button);
     }
     ctools_include('ajax');
     ctools_include('modal');
     ctools_modal_add_js();
     ctools_add_css('panels_dnd', 'panels');
     ctools_add_css('panels_admin', 'panels');
     ctools_add_js('panels_ipe', 'panels_ipe');
     ctools_add_css('panels_ipe', 'panels_ipe');
     drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
     drupal_add_library('system', 'ui.draggable');
     drupal_add_library('system', 'ui.droppable');
     drupal_add_library('system', 'ui.sortable');
     parent::add_meta();
 }
Example #5
0
function analytics_portal_textfield($variables)
{
    $element = $variables['element'];
    $output = '';
    // login form adding glyphicon.
    if ($element['#name'] == 'name') {
        $output = '<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>';
    }
    // force type.
    $element['#attributes']['type'] = 'text';
    // set placeholder.
    if (isset($variables['element']['#description'])) {
        $element['#attributes']['placeholder'] = $variables['element']['#description'];
    }
    element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
    // adding bootstrap classes.
    _form_set_class($element, array('form-text', 'form-control', 'input-lg-3'));
    $extra = '';
    if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
        drupal_add_library('system', 'drupal.autocomplete');
        $element['#attributes']['class'][] = 'form-autocomplete';
        $attributes = array();
        $attributes['type'] = 'hidden';
        $attributes['id'] = $element['#attributes']['id'] . '-autocomplete';
        $attributes['value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
        $attributes['disabled'] = 'disabled';
        $attributes['class'][] = 'autocomplete';
        $extra = '<input' . drupal_attributes($attributes) . ' />';
    }
    $output .= '<input' . drupal_attributes($element['#attributes']) . ' />';
    return $output . $extra;
}
 protected static function get_form_html($args, $auth, $attributes)
 {
     // @todo Process the available data to load subsamples (habitats) and associated records correctly.
     // toggle the checkboxes to after the label to match the form.
     global $indicia_templates;
     drupal_add_library('system', 'ui.tooltip', true);
     $indicia_templates['check_or_radio_group_item'] = '<li><label for="{itemId}">{caption}</label><input type="{type}" name="{fieldname}" id="{itemId}" value="{value}"{class}{checked}{title} {disabled}/></li>';
     // Create an array of custom attributes keyed by caption for easy lookup later
     foreach ($attributes as $attr) {
         self::$attrsByCaption[strtolower($attr['caption'])] = $attr;
     }
     // Build a list of the habitat-level attributes as well.
     $attributeOpts = array('valuetable' => 'sample_attribute_value', 'attrtable' => 'sample_attribute', 'key' => 'sample_id', 'fieldprefix' => 'smpAttr', 'extraParams' => $auth['read'], 'survey_id' => $args['survey_id'], 'sample_method_id' => $args['habitat_sample_method_id']);
     $habitatAttributes = data_entry_helper::getAttributes($attributeOpts, false);
     foreach ($habitatAttributes as $attr) {
         self::$habitatAttrsByCaption[strtolower($attr['caption'])] = $attr;
     }
     // load the habitat attribute values, if we have an existing sample
     if (!empty(self::$loadedSampleId)) {
         self::load_existing(self::$loadedSampleId, $auth);
     } else {
         data_entry_helper::$javascript .= "indiciaData.existingSubsampleData=[];\n";
     }
     // output some attribute info we can use for validation & business logic
     data_entry_helper::$javascript .= "indiciaData.depthMinLimitAttrNames = " . json_encode(array(self::$attrsByCaption['depth shallow bsl']['fieldname'], self::$attrsByCaption['depth shallow bcd']['fieldname'])) . ";\n";
     data_entry_helper::$javascript .= "indiciaData.depthMaxLimitAttrNames = " . json_encode(array(self::$attrsByCaption['depth deepest bsl']['fieldname'], self::$attrsByCaption['depth deepest bcd']['fieldname'])) . ";\n";
     data_entry_helper::$javascript .= "indiciaData.driftAttrId = " . self::$attrsByCaption['drift dive?']['attributeId'] . ";\n";
     data_entry_helper::$javascript .= "indiciaData.depthCDAttrName = '" . self::$attrsByCaption['tidal correction to chart datum']['fieldname'] . "';\n";
     data_entry_helper::$javascript .= "indiciaData.habitatMinDepthSLAttrId = " . self::$habitatAttrsByCaption['upper depth from sea level']['attributeId'] . ";\n";
     data_entry_helper::$javascript .= "indiciaData.habitatMaxDepthSLAttrId = " . self::$habitatAttrsByCaption['lower depth from sea level']['attributeId'] . ";\n";
     data_entry_helper::$javascript .= "indiciaData.habitatMinDepthCDAttrId = " . self::$habitatAttrsByCaption['upper depth from chart datum']['attributeId'] . ";\n";
     data_entry_helper::$javascript .= "indiciaData.habitatMaxDepthCDAttrId = " . self::$habitatAttrsByCaption['lower depth from chart datum']['attributeId'] . ";\n";
     return parent::get_form_html($args, $auth, $attributes);
 }
Example #7
0
/**
 * Implements hook_preprocess_html
 */
function checkbook3_preprocess_html(&$vars)
{
    drupal_add_library('system', 'ui');
    drupal_add_css(path_to_theme() . '/css/ie-7.css', array('group' => CSS_THEME, 'weight' => 997, 'browsers' => array('IE' => 'IE 7', '!IE' => FALSE)));
    drupal_add_css(path_to_theme() . '/css/ie-8.css', array('group' => CSS_THEME, 'weight' => 998, 'browsers' => array('IE' => 'IE 8', '!IE' => FALSE)));
    drupal_add_css(path_to_theme() . '/css/ie-9.css', array('group' => CSS_THEME, 'weight' => 999, 'browsers' => array('IE' => 'IE 9', '!IE' => FALSE)));
}
/**
 * Overrides theme_textfield().
 */
function bootstrap_sst_textfield($variables)
{
    $element = $variables['element'];
    $element['#attributes']['type'] = 'text';
    element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
    _form_set_class($element, array('form-text'));
    $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
    $extra = '';
    if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
        drupal_add_library('system', 'drupal.autocomplete');
        $element['#attributes']['class'][] = 'form-autocomplete';
        $attributes = array();
        $attributes['type'] = 'hidden';
        $attributes['id'] = $element['#attributes']['id'] . '-autocomplete';
        $attributes['value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
        $attributes['disabled'] = 'disabled';
        $attributes['class'][] = 'autocomplete';
        // Uses icon for autocomplete "throbber".
        if ($icon = _bootstrap_icon('refresh')) {
            $output = '<div class="input-group">' . $output . '<span class="input-group-addon">' . $icon . '</span></div>';
        } else {
            $output = '<div class="input-group">' . $output . '<span class="input-group-addon">';
            // The throbber's background image must be set here because sites may not
            // be at the root of the domain (ie: /) and this value cannot be set via
            // CSS.
            $output .= '<span class="autocomplete-throbber" style="background-image:url(' . url('misc/throbber.gif') . ')"></span>';
            $output .= '</span></div>';
        }
        $extra = '<input' . drupal_attributes($attributes) . ' />';
    }
    return $output . $extra;
}
function velocity_preprocess_html(&$vars)
{
    $file = 'color-' . theme_get_setting('theme_color') . '-style.css';
    drupal_add_css(path_to_theme() . '/css/' . $file, array('group' => CSS_THEME, 'weight' => 115, 'browsers' => array(), 'preprocess' => FALSE));
    $file = theme_get_setting('theme_layout') . '-style.css';
    drupal_add_css(path_to_theme() . '/css/' . $file, array('group' => CSS_THEME, 'weight' => 116, 'browsers' => array(), 'preprocess' => FALSE));
    drupal_add_js('jQuery(document).ready(function($) { 
		$(window).scroll(function() {
			if($(this).scrollTop() != 0) {
				$("#toTop").fadeIn();	
			} else {
				$("#toTop").fadeOut();
			}
		});
		
		$("#toTop").click(function() {
			$("body,html").animate({scrollTop:0},800);
		});	
		
		});', array('type' => 'inline', 'scope' => 'header'));
    drupal_add_library('system', 'ui.accordion');
    drupal_add_library('system', 'ui.tabs');
    drupal_add_library('system', 'ui.progressbar');
    drupal_add_js(drupal_get_path('module', 'your_module_name') . '/exposedfilterquick.js', 'module');
}
 function add_meta()
 {
     ctools_include('display-edit', 'panels');
     ctools_include('content');
     if (empty($this->display->cache_key)) {
         $this->cache = panels_edit_cache_get_default($this->display);
     }
     // @todo we may need an else to load the cache, but I am not sure we
     // actually need to load it if we already have our cache key, and doing
     // so is a waste of resources.
     ctools_include('cleanstring');
     $this->clean_key = ctools_cleanstring($this->display->cache_key);
     $button = theme('panels_ipe_edit_button', array('class' => 'panels-ipe-startedit', 'text' => t('Customize this page')));
     panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-startedit', $button);
     //    panels_ipe_get_cache_key($this->clean_key);
     ctools_include('ajax');
     ctools_include('modal');
     ctools_modal_add_js();
     ctools_add_css('panels_dnd', 'panels');
     ctools_add_css('panels_admin', 'panels');
     ctools_add_js('panels_ipe', 'panels_ipe');
     ctools_add_css('panels_ipe', 'panels_ipe');
     $settings = array('formPath' => url($this->get_url('save-form')));
     drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
     drupal_add_js(array('PanelsIPESettings' => array($this->clean_key => $settings)), 'setting');
     drupal_add_library('system', 'ui.draggable');
     drupal_add_library('system', 'ui.droppable');
     drupal_add_library('system', 'ui.sortable');
     //    drupal_add_js('misc/ui/jquery.ui.draggable.min.js');
     //    drupal_add_js('misc/ui/jquery.ui.droppable.min.js');
     //    drupal_add_js('misc/ui/jquery.ui.sortable.min.js');
     //    jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
     parent::add_meta();
 }
Example #11
0
/**
 * Preprocess variables for html.tpl.php
 *
 * Implements template_preprocess_html(&$variables)
 * 
 * @see system_elements()
 * @see html.tpl.php
 */
function uw_boundless_preprocess_html(&$variables)
{
    // Adding jQuery UI effects library
    drupal_add_library('system', 'effects');
    // for other libraries see https://api.drupal.org/api/drupal/modules!system!system.module/function/system_library/7
    //    // Adding underscore.js
    //    $options = array();
    //    $options['type'] = 'external';
    //    $options['scope'] = 'header';
    //    $options['group'] = JS_LIBRARY;
    //    $options['weight'] = -20;
    //    drupal_add_js('//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js', $options);
    //
    //    // Adding backbone.js
    //    $options = array();
    //    $options['type'] = 'external';
    //    $options['scope'] = 'header';
    //    $options['group'] = JS_LIBRARY;
    //    $options['weight'] = -19;
    //    drupal_add_js('//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js', $options);
    // Adding the UW Alert Banner script
    $options = array();
    $options['type'] = 'external';
    $options['scope'] = 'header';
    $options['group'] = JS_THEME;
    drupal_add_js('//www.washington.edu/static/alert.js', $options);
}
 function add_meta()
 {
     ctools_include('display-edit', 'panels');
     ctools_include('content');
     if (empty($this->display->cache_key)) {
         $this->cache = panels_edit_cache_get_default($this->display);
     }
     // @todo we may need an else to load the cache, but I am not sure we
     // actually need to load it if we already have our cache key, and doing
     // so is a waste of resources.
     ctools_include('cleanstring');
     $this->clean_key = ctools_cleanstring($this->display->cache_key);
     $button = array('#type' => 'link', '#title' => t('Customize this page'), '#href' => $this->get_url('save_form'), '#id' => 'panels-ipe-customize-page', '#attributes' => array('class' => array('panels-ipe-startedit', 'panels-ipe-pseudobutton')), '#ajax' => array('progress' => 'throbber', 'ipe_cache_key' => $this->clean_key), '#prefix' => '<div class="panels-ipe-pseudobutton-container">', '#suffix' => '</div>');
     panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-startedit', $button);
     // @todo this actually should be an IPE setting instead.
     if (user_access('change layouts in place editing')) {
         $button = array('#type' => 'link', '#title' => t('Change layout'), '#href' => $this->get_url('change_layout'), '#attributes' => array('class' => array('panels-ipe-change-layout', 'panels-ipe-pseudobutton', 'ctools-modal-layout')), '#ajax' => array('progress' => 'throbber', 'ipe_cache_key' => $this->clean_key), '#prefix' => '<div class="panels-ipe-pseudobutton-container">', '#suffix' => '</div>');
         panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-change-layout', $button);
     }
     ctools_include('ajax');
     ctools_include('modal');
     ctools_modal_add_js();
     ctools_add_css('panels_dnd', 'panels');
     ctools_add_css('panels_admin', 'panels');
     ctools_add_css('panels_ipe', 'panels_ipe');
     // Add the JavaScript for the IPE. This must go as early as possible so
     // that its behaviors run first, allowing it to clone parts of the DOM
     // before other behaviors have been applied to them.
     drupal_add_js(drupal_get_path('module', 'panels_ipe') . '/js/panels_ipe.js', array('group' => JS_LIBRARY, 'weight' => -1000));
     drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
     drupal_add_library('system', 'ui.draggable');
     drupal_add_library('system', 'ui.droppable');
     drupal_add_library('system', 'ui.sortable');
     parent::add_meta();
 }
Example #13
0
/**
 * @file
 * The primary PHP file for this theme.
 */
function candidato_form_alter(&$form, &$form_state, $form_id)
{
    if ($form_id == 'webform_client_form_23') {
        //        $form['#attributes']['class'][] = 'form-horizontal';
    }
    drupal_add_library('system', 'ui.datepicker');
}
Example #14
0
/**
 * Preprocess html.tpl.php
 */
function favrskovtheme_preprocess_html(&$vars)
{
    drupal_add_library('system', 'ui.widget');
    drupal_add_js(libraries_get_path('swiper') . '/idangerous.swiper.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));
    drupal_add_css('https://fast.fonts.net/cssapi/cb2b1123-533e-44b1-af78-e3702f6bd579.css', array('type' => 'external', 'group' => 'CSS_THEME', 'every_page' => TRUE, 'media' => 'projection, screen'));
    $jwplayer = drupal_get_js('jwplayer');
    $vars['jwplayer'] = $jwplayer;
    // Added meta tag for IE.
    $meta_ie_render_engine = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('content' => 'IE=10', 'http-equiv' => 'X-UA-Compatible'));
    // Add header meta tag for IE to head
    drupal_add_html_head($meta_ie_render_engine, 'meta_ie_render_engine');
    $multisite_links = theme_get_setting('favrskovtheme_multisite_links');
    if (!empty($multisite_links)) {
        $vars['classes_array'][] = theme_get_setting('favrskovtheme_multisite_links');
    }
    $header_links = theme_get_setting('favrskovtheme_header_links');
    if (!empty($header_links)) {
        $vars['classes_array'][] = $header_links;
    }
    if (!empty($vars['background'])) {
        $vars['classes_array'][] = 'dynamic-background';
    }
    // jQuery custom content scroller
    drupal_add_js(libraries_get_path('malihu') . '/js/minified/jquery.mCustomScrollbar.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));
    drupal_add_css(libraries_get_path('malihu') . '/jquery.mCustomScrollbar.min.css', array('scope' => 'header', 'group' => CSS_THEME, 'every_page' => TRUE));
}
/**
 * Preprocess variables for html.tpl.php
 *
 * @see system_elements()
 * @see html.tpl.php
 */
function commerce_kickstart_theme_preprocess_html(&$variables)
{
    // Add conditional stylesheets for IE
    drupal_add_css(path_to_theme() . '/css/commerce-kickstart-theme-ie-lte-8.css', array('group' => CSS_THEME, 'weight' => 23, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
    drupal_add_css(path_to_theme() . '/css/commerce-kickstart-theme-ie-lte-7.css', array('group' => CSS_THEME, 'weight' => 24, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
    // Add external libraries.
    drupal_add_library('commerce_kickstart_theme', 'selectnav');
}
Example #16
0
/**
 * Override or insert variables into the page template.
 */
function fusion_prosper_process_page(&$variables)
{
    // Hook into color.module.
    drupal_add_library('system', 'ui');
    if (module_exists('color')) {
        _color_page_alter($variables);
    }
}
Example #17
0
/**
 * @file
 * This file is empty by default because the base theme chain (Alpha & Omega) provides
 * all the basic functionality. However, in case you wish to customize the output that Drupal
 * generates through Alpha & Omega this file is a good place to do so.
 * 
 * Alpha comes with a neat solution for keeping this file as clean as possible while the code
 * for your subtheme grows. Please read the README.txt in the /preprocess and /process subfolders
 * for more information on this topic.
 */
function quatro_preprocess_html(&$vars)
{
    $file = theme_get_setting('theme_color') . '-style.css';
    drupal_add_css(path_to_theme() . '/css/' . $file, array('group' => CSS_THEME, 'weight' => 115, 'browsers' => array(), 'preprocess' => FALSE));
    drupal_add_js(path_to_theme() . '/js/jquery.tooltipster.js');
    drupal_add_library('system', 'ui.accordion');
    drupal_add_library('system', 'ui.tabs');
}
Example #18
0
/**
 * Implements HOOK_preprocess_THEME()
 * @param $variables
 */
function realia_preprocess_html(&$variables)
{
    drupal_add_library('system', 'ui.slider');
    $prefix = theme_get_setting('prefix_currency', 'realia');
    if ($prefix) {
        $prefix = TRUE;
    } else {
        $prefix = FALSE;
    }
    drupal_add_js(array('theme' => array('currency' => theme_get_setting('currency', 'realia'), 'prefix' => $prefix)), 'setting');
}
/**
 * Implements hook_preprocess_page().
 */
function shelter_preprocess_page(&$variables)
{
    // Put the language switcher in a variable.
    $block = module_invoke('locale', 'block_view', 'language_content');
    $variables['language_switcher'] = $block['content'];
    global $base_url;
    $variables['base_url'] = $base_url;
    $current_path = current_path();
    // Adding the viewport for mobile view.
    $viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, maximum-scale=1, minimal-ui'));
    drupal_add_html_head($viewport, 'viewport');
    libraries_load('underscore');
    drupal_add_library('system', 'jquery.cookie');
    $variables['hot_responses'] = FALSE;
    $variables['is_regions_and_countries'] = FALSE;
    $variables['is_user_profile_pages'] = FALSE;
    $variables['is_search_documents'] = FALSE;
    $variables['global_docs_search_page_link'] = l(t('Search all documents'), 'search-documents', array('attributes' => array('class' => array('search-documents-link')), 'query' => array('sort' => 'date', 'sort_direction' => 'DESC')));
    $variables['global_events_page'] = FALSE;
    $variables['recent_documents'] = FALSE;
    if ($variables['is_front']) {
        $variables['hot_responses'] = cluster_og_hot_responses();
        $variables['upcoming_events'] = cluster_events_upcoming();
        $variables['recent_documents'] = cluster_docs_recent();
    }
    if ($current_path == 'regions-countries') {
        $variables['is_regions_and_countries'] = TRUE;
    }
    if ($current_path == 'search-documents') {
        $variables['is_search_documents'] = TRUE;
        $variables['hot_responses'] = cluster_og_hot_responses();
        $variables['upcoming_events'] = NULL;
    }
    if ($current_path == 'events') {
        $variables['hot_responses'] = cluster_og_hot_responses();
        $variables['global_events_page'] = TRUE;
    }
    if (arg(0) == 'user') {
        $variables['is_user_profile_pages'] = TRUE;
    }
    $variables['extra'] = FALSE;
    if (isset($variables['page']['content']['system_main']['side-column'])) {
        $variables['extra'] = $variables['page']['content']['system_main']['side-column'];
        unset($variables['page']['content']['system_main']['side-column']);
    } elseif ($node = menu_get_object()) {
        if (isset($variables['page']['content']['system_main']['nodes'][$node->nid][0]['side-column'])) {
            $variables['extra'] = $variables['page']['content']['system_main']['nodes'][$node->nid][0]['side-column'];
            unset($variables['page']['content']['system_main']['nodes'][$node->nid][0]['side-column']);
        }
    }
}
 function add_meta()
 {
     parent::add_meta();
     if ($this->admin) {
         ctools_include('ajax');
         ctools_include('modal');
         ctools_modal_add_js();
         ctools_add_js('panels-base', 'panels');
         ctools_add_js('display_editor', 'panels');
         ctools_add_css('panels_dnd', 'panels');
         ctools_add_css('panels_admin', 'panels');
         drupal_add_library('system', 'ui');
     }
 }
Example #21
0
function anchor_form_system_theme_settings_alter(&$form, $form_state)
{
    $path = drupal_get_path('theme', 'anchor');
    drupal_add_library('system', 'ui');
    drupal_add_library('system', 'farbtastic');
    drupal_add_js($path . '/js/anchor_admin.js');
    $form['settings'] = array('#type' => 'vertical_tabs', '#title' => t('Theme settings'), '#weight' => 2, '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['settings']['general'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['settings']['general']['show_node_title_on_full_page'] = array('#type' => 'select', '#title' => t('Show node title on full page'), '#options' => array(0 => t('No'), 1 => t('Yes')), '#default_value' => theme_get_setting('show_node_title_on_full_page'));
    $form['settings']['general']['preloader_icon_class'] = array('#type' => 'textfield', '#title' => t('Preloader fontawesome icon class name'), '#default_value' => theme_get_setting('preloader_icon_class', 'anchor'), '#description' => t('Default icon class: icon-anchor, you can find more icons class name available on <a href="!url" target="_blank">Fontawesome</a>', array('!url' => 'http://fortawesome.github.io/Font-Awesome/icons/')));
    $form['settings']['general']['header_bg'] = array('#type' => 'textfield', '#title' => t('Header background color'), '#default_value' => theme_get_setting('header_bg', 'anchor'), '#attributes' => array('class' => array('input color')), '#description' => t('default color is: #2980B9'));
    $form['settings']['general']['footer_columns_bg'] = array('#type' => 'textfield', '#title' => t('Footer columns background color'), '#default_value' => theme_get_setting('footer_columns_bg', 'anchor'), '#attributes' => array('class' => array('input color')), '#description' => t('default color is: #34495E'));
    $form['settings']['general']['footer_bottom_bg'] = array('#type' => 'textfield', '#title' => t('Footer bottom background color'), '#default_value' => theme_get_setting('footer_bottom_bg', 'anchor'), '#attributes' => array('class' => array('input color')), '#description' => t('default color is: #2C3E50'));
    $form['settings']['general']['custom_theme_css'] = array('#type' => 'textarea', '#title' => t('Custom theme css'), '#default_value' => theme_get_setting('custom_theme_css', 'anchor'), '#description' => t('Custom your own css, eg: <strong>#header-bg{background-color: #2980B9;}</strong>'));
}
function bunsen_preprocess_page(&$variables)
{
    drupal_add_library('system', 'ui.accordion');
    // Primary nav.
    $variables['primary_nav'] = FALSE;
    if ($variables['main_menu']) {
        // Build links.
        $variables['primary_nav'] = menu_tree_output(menu_tree_all_data(variable_get('menu_main_links_source', 'main-menu')));
        // Provide default theme wrapper function.
        $variables['primary_nav']['#theme_wrappers'] = array('menu_tree__primary');
    }
    if (drupal_is_front_page()) {
        $variables['content_column_class'] = 'col-lg-12 text-center';
    } else {
        $variables['content_column_class'] = 'col-lg-12 content-page';
    }
}
/**
 * Main search controller.
 * 
 * @param string $key
 */
function find_search($key)
{
    drupal_add_css(drupal_get_path('module', 'find') . '/css/find_search.css', array('group' => CSS_DEFAULT, 'every_page' => true));
    drupal_add_css(drupal_get_path('module', 'find') . '/css/find_print.css', array('group' => CSS_DEFAULT, 'every_page' => true, 'media' => 'print'));
    drupal_add_js('http://maps.google.com/maps/api/js?sensor=false&libraries=geometry,places', array('group' => JS_LIBRARY));
    drupal_add_library('system', 'ui.sortable');
    drupal_add_js(drupal_get_path('module', 'area') . '/css/overlay-style.js');
    drupal_add_js(drupal_get_path('module', 'area') . '/js/geometry.js');
    drupal_add_js(drupal_get_path('module', 'find') . '/js/find.js');
    drupal_add_css(drupal_get_path('module', 'gallery') . '/css/jquery.lightbox.css', array('group' => CSS_DEFAULT, 'every_page' => TRUE));
    drupal_add_js(drupal_get_path('module', 'gallery') . '/js/jquery.lightbox.js', array('weight' => 100));
    drupal_add_js(drupal_get_path('module', 'gallery') . '/js/gallery.lightbox.js');
    $variables = array('#theme' => 'find.search');
    // fetch $_GET parameters
    $params = find_query_params(array('search' => '', 'geo' => array(), 'date' => array(), 'class' => array(), 'user' => array(), 'family' => array(), 'genus' => array(), 'town' => array(), 'canton' => array(), 'redlist' => array(), 'habitat' => array(), 'image_type' => array(), 'columns' => array(), 'sort' => array()));
    $params['uid'] = $GLOBALS['user']->uid;
    try {
        $client = new Elastica_Client();
        $status = $client->getStatus();
        // ping to make sure elasticsearch is running
        $index = $client->getIndex('naturwerk');
        $parameters = new Parameters($params);
        $variables['#organisms'] = new Organisms($index, $parameters);
        $variables['#sightings'] = new Sightings($index, $parameters);
        $variables['#inventories'] = new Inventories($index, $parameters);
        $variables['#areas'] = new Areas($index, $parameters);
        $variables['#images'] = new Images($index, $parameters);
        // make parameters available to JavaScript
        $parameters = drupal_get_query_parameters();
        if (count($parameters) == 0) {
            $parameters = new stdClass();
            // force empty JSON object
        }
        drupal_add_js(array('find' => array('url' => url($_GET['q']), 'parameters' => $parameters, 'geo' => $params['geo'])), 'setting');
        $variables['#key'] = $key;
        $variables['#current'] = $variables['#' . $key];
        $output = array();
        $output['search'] = $variables;
        return $output;
    } catch (Elastica_Exception_Client $e) {
        watchdog('find', $e->getMessage(), array(), WATCHDOG_ERROR);
        drupal_set_message(t('Search error. Elasticsearch running?'), 'error');
        return array();
    }
}
Example #24
0
/**
 * Implements theme_preprocess_html().
 */
function loop_compact_preprocess_html(&$variables)
{
    $theme_path = path_to_theme();
    $current_theme = variable_get('theme_default', 'none');
    // Add conditional stylesheets
    drupal_add_css($theme_path . '/css/sidebar.css', array('group' => CSS_THEME));
    drupal_add_js($theme_path . '/js/modernizr.js', array('group' => JS_LIBRARY));
    drupal_add_js($theme_path . '/js/app.js', array('group' => JS_THEME));
    // Paths
    $variables['path_js'] = base_path() . drupal_get_path('theme', $current_theme) . '/js';
    $variables['path_img'] = base_path() . drupal_get_path('theme', $current_theme) . '/images';
    $variables['path_css'] = base_path() . drupal_get_path('theme', $current_theme) . '/css';
    $variables['path_font'] = base_path() . drupal_get_path('theme', $current_theme) . '/font';
    // Body classes
    $variables['classes_array'][] = 'simple-navigation-enabled-xs';
    // Load jQuery UI
    drupal_add_library('system', 'ui');
}
Example #25
0
/**
 * Implements theme_preprocess_html().
 */
function odsherredweb_preprocess_html(&$variables)
{
    $theme_path = path_to_theme();
    $current_theme = variable_get('theme_default', 'none');
    // Add conditional stylesheets
    drupal_add_css($theme_path . '/css/sidebar.css', array('group' => CSS_THEME));
    drupal_add_js($theme_path . '/js/modernizr.js', array('group' => JS_LIBRARY));
    drupal_add_js($theme_path . '/js/app.js', array('group' => JS_THEME));
    drupal_add_js($theme_path . '/js/jquery.form.js', array('group' => JS_THEME));
    drupal_add_js($theme_path . '/js/ie9.js', array('group' => JS_THEME, 'browsers' => array('IE' => 'lte IE 9', '!IE' => FALSE)));
    // Paths
    $variables['path_js'] = base_path() . drupal_get_path('theme', $current_theme) . '/js';
    $variables['path_img'] = base_path() . drupal_get_path('theme', $current_theme) . '/images';
    $variables['path_css'] = base_path() . drupal_get_path('theme', $current_theme) . '/css';
    $variables['path_font'] = base_path() . drupal_get_path('theme', $current_theme) . '/font';
    // Load jQuery UI
    drupal_add_library('system', 'ui');
}
/**
 * Preprocess html.tpl.php
 */
function ringstedtheme_preprocess_html(&$vars)
{
    drupal_add_library('system', 'ui.widget');
    drupal_add_js(libraries_get_path('swiper') . '/idangerous.swiper.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));
    drupal_add_js(libraries_get_path('selectboxit') . '/jquery.selectBoxIt.min.js', array('scope' => 'footer', 'group' => JS_LIBRARY, 'every_page' => TRUE));
    // Add resnponsive tables to all pages
    drupal_add_js(drupal_get_path('theme', 'ringstedtheme') . '/responsive_tables/responsive-tables.js');
    drupal_add_css(drupal_get_path('theme', 'ringstedtheme') . '/responsive_tables/responsive-tables.css');
    // drupal_add_css('http://fast.fonts.net/cssapi/424e6723-b2e3-4f68-8517-2854576d35a6.css',
    //   array('type' => 'external', 'group' => 'CSS_THEME', 'every_page' => TRUE, 'media' => 'projection, screen')
    // );
    $jwplayer = drupal_get_js('jwplayer');
    $vars['jwplayer'] = $jwplayer;
    // Color scheme selector
    $color_scheme = theme_get_setting('color_scheme');
    if ($color_scheme != 'default') {
        drupal_add_css(drupal_get_path('theme', 'ringstedtheme') . '/css/color-schemes/' . $color_scheme . '.css', array('group' => CSS_THEME, 'every_page' => TRUE));
    }
    $vars['classes_array'][] = $color_scheme;
}
Example #27
0
/**
 * Implements theme_preprocess_html().
 */
function subsite_1_preprocess_html(&$variables)
{
    $theme_path = path_to_theme();
    // Add conditional stylesheets for IE9 and lower.
    drupal_add_css($theme_path . '/dist/css/stylesheet.css', array('group' => CSS_THEME));
    drupal_add_css($theme_path . '/dist/css/stylesheet-ie9-1.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 9', '!IE' => FALSE)));
    drupal_add_css($theme_path . '/dist/css/stylesheet-ie9-2.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 9', '!IE' => FALSE)));
    drupal_add_js($theme_path . '/dist/js/modernizr.js', array('group' => JS_LIBRARY));
    drupal_add_js($theme_path . '/dist/js/app.js', array('group' => JS_THEME));
    drupal_add_js($theme_path . '/dist/js/ie9.js', array('group' => JS_THEME, 'browsers' => array('IE' => 'lte IE 9', '!IE' => FALSE)));
    // Add out fonts from Google Fonts API.
    drupal_add_html_head(array('#tag' => 'link', '#attributes' => array('href' => 'https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic|PT+Mono', 'rel' => 'stylesheet', 'type' => 'text/css')), 'google_font_subsite_1');
    // Body classes
    // $variables['classes_array'][] = 'footer-attached';
    $variables['classes_array'][] = 'simple-navigation-enabled-xs';
    $variables['classes_array'][] = 'simple-navigation-enabled-sm';
    $variables['classes_array'][] = 'main-navigation-enabled-md';
    $variables['classes_array'][] = 'main-navigation-enabled-lg';
    // Load jQuery UI
    drupal_add_library('system', 'ui');
}
function gd_accessibility_info() {
    drupal_add_library('gd', 'bootstrap');

    ob_start();
    print '<div class="container">';
    print '<h1 tabindex="3000" class="accessibility-title">GovDashboard Accessibility Information</h1>';
    print '<p tabindex="3000">GovDashboard  provides lightweight, easy to use, elegant dashboard solutions to  a large audience which includes individuals with disabilities.  GovDashboard follows Section 508 and Web Content Accessibility Guidelines (WCAG) 2.0 Level A standard requirements and guidelines to cater to a wide variety of audience.</p>';
    print '<p tabindex="3000">GovDashboard viewer tool is routinely tested for compatibility on Microsoft Internet Explorer 8 and 9. In addition JAWS 13 screen reader test are conducted on GovDashboard viewer tool to ensure compliance in accordance with Section 508 of the Rehabilitation Act. The Section 508 Technical Standards checklist along with policy experts and in-depth test plans are used as a basis for conducting these compliance tests. For more information on Section 508 technical standards please visit www.Section508.gov</p>';
    print '<h3 tabindex="3000">GovDashboard and Accessibility Requirements</h3>';
    print '<ul tabindex="3000">';
    print '<li>GovDashboard contain visualization tools such as charts and graphs that are not entirely accessible  to individuals with disabilities. For individuals with disabilities data tables are provided as an alternate to charts and graphs.. Individuals can access this option by selecting View Table option from the widget menu.</li>';
    print '<li>JavaScript support must be turned on and made available to support accessibility requirements.</li>';
    print '</ul>';
    print '<p tabindex="3000">The following areas of GovDashboard are not completely accessible for individuals with disabilities:</p>';
    print '<ul tabindex="3000">';
    print '<li>Designer: Some of the rich interactive interfaces for designer, such as drag-and-drop charts and filters are  currently not keyboard accessible.</li>';
    print '<li> Account Management is another area on the dashboard that is not accessible to individuals with disability.</li>';
    print '</ul>';
    print '<p tabindex="3000">GovDashboard will provide accessible documentation and support for all users. Please contact the support team if individuals using assistive technology (such as a screen reader, eye tracking device, voice recognition software, etc.)  are experiencing  difficulty in accessing information on GovDashboard, . In addition please provide the URL (web address) of the material  being accessed, the problem in detail, and contact information. A GovDashboard support team member will contact you and provide support for the issue.</p>';
    print '</div>';

    $page = array(
        '#show_messages' => false,
        '#theme' => 'page',
        '#type' => 'page',
        'content' => array(
            'system_main' => array(
                '#markup' => ob_get_clean()
            )
        ),
        'post_header' => array(
            '#markup' => ''
        ),
        'pre_content' => array(
            '#markup' => ''
        )
    );

    return $page;
}
Example #29
0
/**
 * Overrides theme_textfield().
 */
function evolve_textfield($variables)
{
    $element = $variables['element'];
    $element['#attributes']['type'] = 'text';
    element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
    _form_set_class($element, array('form-text'));
    $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
    $extra = '';
    if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
        drupal_add_library('system', 'drupal.autocomplete');
        $element['#attributes']['class'][] = 'form-autocomplete';
        $attributes = array();
        $attributes['type'] = 'hidden';
        $attributes['id'] = $element['#attributes']['id'] . '-autocomplete';
        $attributes['value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
        $attributes['disabled'] = 'disabled';
        $attributes['class'][] = 'autocomplete';
        $output = '<div class="input-group">' . $output . '<span class="input-group-addon">' . _bootstrap_icon('refresh') . '</span></div>';
        $extra = '<input' . drupal_attributes($attributes) . ' />';
    }
    return $output . $extra;
}
Example #30
0
/**
 * Implements hook_form_system_theme_settings_alter()
 */
function superhero_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL)
{
    $theme = superhero_get_theme();
    $theme_name = $theme->theme;
    drupal_add_library('system', 'ui.sortable');
    if (isset($form_id)) {
        return;
    }
    // Check if Superhero Theme module exists if not, dont allow access to tools
    if (!module_exists('superhero_theme')) {
        drupal_set_message(t('Please make sure you install the Superhero Theme. This module is required to manage theme settings'), 'warning');
        return;
    }
    $superhero_logo = drupal_get_path('theme', 'superhero') . '/images/logo.png';
    $form['superhero_logo'] = array('#prefix' => '<div id="framework-logo">', '#markup' => theme('image', array('path' => $superhero_logo)), '#suffix' => '</div>', '#weight' => -9);
    // Main Settings
    $form['superhero_settings'] = array('#type' => 'vertical_tabs', '#title' => t('Theme Settings'), '#weight' => -8);
    superhero_theme_settings_layout($form, $form_state);
    superhero_theme_settings_sections($form, $form_state);
    superhero_theme_settings_basic($form, $form_state);
    //superhero_theme_settings_color($form,$form_state);
    superhero_theme_settings_preset($form, $form_state);
    // Drupal Core Settings
    $form['superhero_settings']['drupal_settings'] = array('#type' => 'fieldset', '#title' => t('Drupal Core'));
    $form['superhero_settings']['drupal_settings']['theme_settings'] = $form['theme_settings'];
    $form['superhero_settings']['drupal_settings']['logo'] = $form['logo'];
    $form['superhero_settings']['drupal_settings']['favicon'] = $form['favicon'];
    unset($form['theme_settings']);
    unset($form['logo']);
    unset($form['favicon']);
    $theme_path = drupal_get_path('theme', 'superhero');
    $bootstrap_path = $theme_path . '/vendor/bootstrap';
    $fontawesome_path = $theme_path . '/vendor/font-awesome';
    $form['#attached'] = array('css' => array($bootstrap_path . '/css/bootstrap.min.css', $fontawesome_path . '/css/font-awesome.min.css', $theme_path . '/vendor/minicolors/jquery.minicolors.css', $theme_path . '/css/theme_admin.css'), 'js' => array($theme_path . '/js/superhero-admin.js', $bootstrap_path . '/js/bootstrap.min.js', $theme_path . '/vendor/minicolors/jquery.minicolors.min.js'));
    $form['#theme_object'] = $theme;
    $form['scss_css'] = array('#type' => 'hidden', '#default_value' => theme_get_setting('scss_css'));
    $form['#submit'][] = 'superhero_form_system_theme_settings_alter_submit';
}