/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function phptemplate_settings($saved_settings)
{
    // Empty the cached css...
    cache_clear_all('abessive_custom_css', 'cache');
    $form = array();
    require_once path_to_theme() . '/abessive_settings.php';
    // Add Farbtastic color picker
    drupal_add_css('misc/farbtastic/farbtastic.css', 'module', 'all', FALSE);
    drupal_add_js('misc/farbtastic/farbtastic.js');
    drupal_add_js(path_to_theme() . '/theme-settings.js');
    $defaults = _abessive_default_settings();
    $settings = array_merge($defaults, $saved_settings);
    $form['abessive_picker'] = array('#type' => 'markup', '#value' => '<div id="picker"></div>');
    $form['abessive_background_color'] = array('#type' => 'textfield', '#title' => t('Background Color'), '#description' => t('What colour should the body background behind all the containers be? Default: %val', array('%val' => $defaults['abessive_background_color'])), '#default_value' => $settings['abessive_background_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field'));
    $form['abessive_border_color'] = array('#type' => 'textfield', '#title' => t('Border Color'), '#description' => t('What colour should the border around all the containers be? Default: %val', array('%val' => $defaults['abessive_border_color'])), '#default_value' => $settings['abessive_border_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field'));
    $form['abessive_content_background_color'] = array('#type' => 'textfield', '#title' => t('Content Background Color'), '#description' => t('What colour should the background of all the containers be? Default: %val', array('%val' => $defaults['abessive_content_background_color'])), '#default_value' => $settings['abessive_content_background_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field', 'abessive_calculate_gradient'));
    $form['abessive_content_background_color']['abessive_r5'] = $form['abessive_content_background_color']['abessive_r4'] = $form['abessive_content_background_color']['abessive_r3'] = $form['abessive_content_background_color']['abessive_r2'] = array('#type' => 'value', '#default_value' => 0);
    $form['abessive_text_color'] = array('#type' => 'textfield', '#title' => t('Text Color'), '#description' => t('What colour should the text be? Default: %val', array('%val' => $defaults['abessive_text_color'])), '#default_value' => $settings['abessive_text_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field'));
    $form['abessive_link_color'] = array('#type' => 'textfield', '#title' => t('Hyperlink Color'), '#description' => t('What colour should hyperlinks be? Default: %val', array('%val' => $defaults['abessive_link_color'])), '#default_value' => $settings['abessive_link_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field'));
    $form['abessive_link_hover_color'] = array('#type' => 'textfield', '#title' => t('Hyperlink Hover Color'), '#description' => t('What colour should hyperlinks be when hovered over? Default: %val', array('%val' => $defaults['abessive_link_hover_color'])), '#default_value' => $settings['abessive_link_hover_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field'));
    $form['abessive_link_active_color'] = array('#type' => 'textfield', '#title' => t('Hyperlink Active Color'), '#description' => t('What colour should active hyperlinks be? Default: %val', array('%val' => $defaults['abessive_link_active_color'])), '#default_value' => $settings['abessive_link_active_color'], '#size' => 7, '#maxlength' => 7, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#attributes' => array('class' => 'form-item-use-colorpicker'), '#element_validate' => array('abessive_validate_hex_field'));
    $form['abessive_left_width'] = array('#type' => 'textfield', '#title' => t('Left Column Width'), '#description' => t('How wide should the left column be? Default: %val', array('%val' => $defaults['abessive_left_width'])), '#default_value' => $settings['abessive_left_width'], '#size' => 3, '#maxlength' => 3, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#field_suffix' => 'px', '#element_validate' => array('abessive_validate_numeric_field'));
    $form['abessive_right_width'] = array('#type' => 'textfield', '#title' => t('Right Column Width'), '#description' => t('How wide should the right column be? Default: %val', array('%val' => $defaults['abessive_right_width'])), '#default_value' => $settings['abessive_right_width'], '#size' => 3, '#maxlength' => 3, '#prefix' => '<div class="container-inline">', '#suffix' => '</div>', '#field_suffix' => 'px', '#element_validate' => array('abessive_validate_numeric_field'));
    $form['#submit'][] = 'abessive_submit_settings';
    return $form;
}
Beispiel #2
1
function lamtech_preprocess_html(&$vars)
{
    drupal_add_html_head_link(array('href' => 'http://fonts.googleapis.com/css?family=Roboto:300', 'rel' => 'stylesheet', 'type' => 'text/css'));
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/html-elements.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/forms.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/page.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/comments.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/views.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/forums.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/fields.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/blocks.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/css/navigation.css');
    //  drupal_add_css(drupal_get_path('theme', 'lamtech') . '/bootstrap/css/bootstrap.min.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/bootstrap/css/bootstrap-theme.min.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/responsive.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/lamtech.bootstrap.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/lamtech.core.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/lamtech.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/lamtech.common.css', array('group' => 1));
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/lamtech.typography.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/lamtech.forms.css');
    drupal_add_css(drupal_get_path('theme', 'lamtech') . '/tpl/anb/css/off-canvas.css');
    drupal_add_js(drupal_get_path('theme', 'lamtech') . '/bootstrap/js/bootstrap.js');
    drupal_add_js(drupal_get_path('theme', 'lamtech') . '/js/jquery.smooth-scroll.js');
}
Beispiel #3
0
/**
 * Implementation of hook_preprocess_page().
 */
function stability_process_page(&$variables)
{
    global $user;
    $variables['login_account_links'] = '';
    if (theme_get_setting('login_account_links') || module_exists('uc_cart')) {
        $output = '';
        if (theme_get_setting('login_account_links')) {
            $output .= '<span class="login">
        <i class="fa fa-lock"></i> ' . l($user->uid ? t('My Account') : t('Login'), 'user') . '
      </span>';
            $output .= $user->uid ? '<span class="logout"><i class="fa fa-sign-out"></i> ' . l(t('Logout'), 'user/logout') . '</span>' : '';
            $output .= !$user->uid ? '<span class="register"><i class="fa fa-pencil-square-o"></i>' . t('Not a Member?') . ' ' . l(t('Register'), 'user/register') . '</span>' : '';
        }
        if (module_exists('uc_cart')) {
            $output .= '<span class="cart">
        <i class="fa fa-shopping-cart"></i> ' . l(t('Shopping Cart'), 'cart') . '
      </span>';
        }
        $variables['login_account_links'] = '
      <div class="header-top-right">
        ' . $output . '
      </div>';
    }
    $header_top_menu_tree = module_exists('i18n_menu') ? i18n_menu_translated_tree('menu-header-top-menu') : menu_tree('menu-header-top-menu');
    $variables['header_top_menu_tree'] = drupal_render($header_top_menu_tree);
    // Process Slideshow Sub Header
    if (theme_get_setting('sub_header') == 5 || arg(2) == 'sub-header' && arg(3) == '5') {
        drupal_add_js(drupal_get_path('theme', 'stability') . '/vendor/jquery.glide.min.js');
    }
    if (theme_get_setting('retina')) {
        drupal_add_js(drupal_get_path('theme', 'stability') . '/vendor/jquery.retina.js');
    }
    drupal_add_js(array('stability' => array('flickr_id' => theme_get_setting('flickr_id'), 'logo_sticky' => theme_get_setting('logo_sticky'))), 'setting');
}
function mvp_preprocess_html(&$vars)
{
    drupal_add_js(drupal_get_path('theme', 'mvp') . '/js/modernizr.min.js', array('scope' => 'header_scripts', 'every_page' => TRUE, 'weight' => 0));
    drupal_add_js(drupal_get_path('theme', 'mvp') . '/js/jquery-1.8.2.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE, 'weight' => 0));
    drupal_add_js(drupal_get_path('theme', 'mvp') . '/js/jquery-ui-1.10.4.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE, 'weight' => 3));
    if (request_uri() == '/content-dashboard') {
        drupal_add_js('(function($) {
      Drupal.behaviors.chosenSelects = {
        attach: function(context, settings) {
          $(".views-widget-filter-edit-type select#edit-type").chosen({
            width: "200px",
            placeholder_text_multiple: "Enter in a Content Type"
          });
          $(".views-widget-filter-edit-status-1 select").chosen({
            width: "200px",
            disable_search_threshold: 3
          });
        }
      };
    })(jQuery);', array('type' => 'inline', 'group' => JS_THEME, 'weight' => 2, 'defer' => TRUE));
    }
    $node = menu_get_object();
    if ($node && $node->nid) {
        $vars['theme_hook_suggestions'][] = 'html__' . $node->type;
    }
}
Beispiel #5
0
/**
 * Implementation of hook_preprocess_html().
 */
function progressive_sub_preprocess_html(&$variables)
{
    global $language;
    $css_customizer = theme_get_setting('skin') . '-pages-customizer.css';
    drupal_add_css(drupal_get_path('theme', 'progressive') . '/css/customizer/' . $css_customizer, array('group' => CSS_THEME));
    drupal_add_css(drupal_get_path('theme', 'progressive_sub_sub') . '/css/custom.css');
    if ($language->dir == 'rtl') {
        drupal_add_css(drupal_get_path('theme', 'progressive') . '/css/drupal-rtl.css', array('group' => CSS_THEME));
    }
    drupal_add_js(array('theme_path' => drupal_get_path('theme', 'progressive'), 'basePath' => base_path(), 'progressive' => array('mobile_menu_toggle' => theme_get_setting('mobile_menu_toggle')), 'ubercart_currency' => variable_get('uc_currency_sign')), 'setting');
    // Page 404
    if (arg(0) == 'page-404-bg') {
        $variables['classes_array'][] = 'page-404-promo';
    }
    // Login Page
    global $user;
    if (arg(0) == 'user' && (in_array(arg(1), array('register', 'password', 'login')) || arg(1) == '' && !$user->uid)) {
        $variables['classes_array'][] = 'page-login-promo';
    }
    if (theme_get_setting('boxed') || $_GET['q'] == 'node/107' && strpos($_SERVER['HTTP_HOST'], 'nikadevs') !== FALSE) {
        $variables['classes_array'][] = 'boxed';
    }
    $layout = _nikadevs_cms_get_active_layout();
    $one_page = isset($layout['settings']['one_page']) && $layout['settings']['one_page'] ? 1 : 0;
    if (theme_get_setting('header_top_menu') && !in_array($_GET['q'], array('user/login', 'user/register', 'user/password')) && !$one_page) {
        $variables['classes_array'][] = 'hidden-top';
    }
    if ($one_page) {
        $variables['classes_array'][] = 'one-page';
    }
}
/**
 * Implements hook_preprocess_html().
 */
function cu_omega_preprocess_html(&$vars)
{
    // Remove page-node- body class
    foreach ($vars['attributes_array']['class'] as $key => $value) {
        if ($value == 'page-node-') {
            unset($vars['attributes_array']['class'][$key]);
        }
    }
    $vars['head_title_array']['slogan'] = 'University of Colorado Boulder';
    $vars['head_title'] = implode(' | ', $vars['head_title_array']);
    //$vars['attributes_array']['class'][]='banner-white';
    $headings = theme_get_setting('headings') ? theme_get_setting('headings') : 'headings-bold';
    $vars['attributes_array']['class'][] = $headings;
    $page_title_image_background = theme_get_setting('page_title_image_background') ? theme_get_setting('page_title_image_background') : 'page-title-image-background-white';
    $vars['attributes_array']['class'][] = $page_title_image_background;
    $icon_color = theme_get_setting('block_icons_color') ? theme_get_setting('block_icons_color') : 'block-icons-inherit';
    $vars['attributes_array']['class'][] = $icon_color;
    drupal_add_js(drupal_get_path('theme', 'cu_omega') . '/js/mobile-menu-toggle.js');
    drupal_add_js(drupal_get_path('theme', 'cu_omega') . '/js/track-focus.js', array('scope' => 'footer'));
    $element = array('#tag' => 'link', '#attributes' => array('href' => '//fast.fonts.net/cssapi/86696b99-fb1a-4964-9676-9233fb4fca8f.css', 'rel' => 'stylesheet', 'type' => 'text/css'));
    if (variable_get('use_fonts', TRUE)) {
        drupal_add_html_head($element, 'web_fonts');
    }
    // Turn off IE Compatibility Mode
    $element = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge'));
    drupal_add_html_head($element, 'ie_compatibility_mode');
    // Check to see if site is responsive or not...
    $responsive = theme_get_setting('alpha_responsive') ? 'is-responsive' : 'is-not-responsive';
    $vars['attributes_array']['class'][] = $responsive;
}
function desenalaw_preprocess_page(&$vars)
{
    if (request_path() == 'contact') {
        $googleMapsAPIKey = 'AIzaSyDzMhdB1eRFcpPFxwe4A0FG7M7FGc0YtVY';
        drupal_add_js("https://maps.googleapis.com/maps/api/js?key={$googleMapsAPIKey}", 'external');
    }
}
Beispiel #8
0
/**
 * Implements hook_preprocess_html().
 */
function omega_alpha_preprocess_html(&$vars)
{
    $theme = alpha_get_theme();
    $vars['doctype'] = '<!DOCTYPE html>' . "\n";
    $vars['rdf'] = new stdClass();
    $vars['rdf']->version = '';
    $vars['rdf']->namespaces = '';
    $vars['rdf']->profile = '';
    // Serialize RDF Namespaces into an RDFa 1.1 prefix attribute.
    if ($vars['rdf_namespaces']) {
        $prefixes = array();
        foreach (explode("\n  ", ltrim($vars['rdf_namespaces'])) as $namespace) {
            // Remove xlmns: and ending quote and fix prefix formatting.
            $prefixes[] = str_replace('="', ': ', substr($namespace, 6, -1));
        }
        $vars['rdf']->namespaces = ' prefix="' . implode(' ', $prefixes) . '"';
    }
    if (alpha_library_active('omega_mediaqueries')) {
        $layouts = array();
        if (isset($theme->grids[$theme->settings['grid']])) {
            foreach ($theme->grids[$theme->settings['grid']]['layouts'] as $layout) {
                if ($layout['enabled']) {
                    $layouts[$layout['layout']] = $layout['media'];
                }
            }
            drupal_add_js(array('omega' => array('layouts' => array('primary' => $theme->grids[$theme->settings['grid']]['primary'], 'order' => array_keys($layouts), 'queries' => $layouts))), 'setting');
        }
    }
}
/** hook_preprocess_page(&$variables) */
function gitp_preprocess_page(&$variables)
{
    $path = drupal_get_path('theme', 'gitp');
    if ($variables['theme_hook_suggestions'][0] == 'page__taxonomy') {
        drupal_add_js('/' . $path . '/assets/js/init-bs-popover.js', 'file');
    }
}
Beispiel #10
0
/**
 * @file template.php
 * This file provides theme functions to override or extend Drupal behavior.
 *
 * @author Raymond Jelierse
 */

function equinox_preprocess_page(&$variables) {
  // Default JavaScript settings
  $theme_settings = array(
      'carouselTimeout' => 10000,
      'carouselTransitionSpeed' => 500,
  );

  // Refresh theme settings
  theme_get_setting('', TRUE);

  if (theme_get_setting('carousel_timeout') !== NULL) {
    $theme_settings['carouselTimeout'] = intval(theme_get_setting('carousel_timeout'));
  }

  if (theme_get_setting('carousel_transition_speed') !== NULL) {
    $theme_settings['carouselTransitionSpeed'] = intval(theme_get_setting('carousel_transition_speed'));
  }

  drupal_add_js(array('equinox' => $theme_settings), 'setting');
  $variables['scripts'] = drupal_get_js();

  // Create user menu
  $variables['user_menu'] = theme('links', menu_navigation_links('navigation'), array('id' => 'user-links-menu', 'class' => 'links user-links'));

  // Add check variable for administration section.
  $variables['is_admin'] = (arg(0) == 'admin');

  // Remove breadcrumb if not in the administration section.
  if (!$variables['is_admin']) {
    $variables['breadcrumb'] = '';
  }

  // Multilanguage site logo
  $variables['logo'] = sprintf('%s/images/logo-%s.png', url(drupal_get_path('theme', 'equinox')), $variables['language']->language);
}
/**
 * Implements hook_preprocess_html().
 */
function omega_alpha_preprocess_html(&$vars)
{
    $theme = alpha_get_theme();
    $vars['rdf'] = new stdClass();
    if (module_exists('rdf')) {
        $vars['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
        $vars['rdf']->version = ' version="HTML+RDFa 1.1"';
        $vars['rdf']->namespaces = $vars['rdf_namespaces'];
        $vars['rdf']->profile = ' profile="' . $vars['grddl_profile'] . '"';
    } else {
        $vars['doctype'] = '<!DOCTYPE html>' . "\n";
        $vars['rdf']->version = '';
        $vars['rdf']->namespaces = '';
        $vars['rdf']->profile = '';
    }
    if (alpha_library_active('omega_mediaqueries')) {
        $layouts = array();
        if (isset($theme->grids[$theme->settings['grid']])) {
            foreach ($theme->grids[$theme->settings['grid']]['layouts'] as $layout) {
                if ($layout['enabled']) {
                    $layouts[$layout['layout']] = $layout['media'];
                }
            }
            drupal_add_js(array('omega' => array('layouts' => array('primary' => $theme->grids[$theme->settings['grid']]['primary'], 'order' => array_keys($layouts), 'queries' => $layouts))), 'setting');
        }
    }
}
Beispiel #12
0
/**
 * @file
 * The primary PHP file for this theme.
 */
function basukebu_preprocess_page(&$variables)
{
    $js_path = drupal_get_path('theme', 'basukebu') . '/js/';
    if (user_has_role(IS_AUTH_USER)) {
        drupal_add_js($js_path . 'basukebu.sticky_header.js');
    }
}
Beispiel #13
0
/**
 * Implements template_preprocess_maintenance_page().
 */
function solkit_octal_preprocess_maintenance_page(&$variables)
{
    global $install_state;
    if ($install_state) {
        // Find the number of tasks to run.
        $tasks = install_tasks_to_display($install_state);
        $total = sizeof($tasks);
        // Find the position of the active task.
        $keys = array_keys($tasks);
        $active_task = $install_state['active_task'];
        $current = array_search($active_task, $keys) + 1;
        // Show steps.
        $variables['steps'] = t('Step @current of @total', array('@current' => $current, '@total' => $total));
        $variables['title'] = $tasks[$active_task];
    }
    $profile = isset($_GET['profile']) ? $_GET['profile'] : '';
    if ($profile) {
        $path = drupal_get_path('profile', $profile);
        $info_file = $path . '/' . $profile . '.info';
        $info = drupal_parse_info_file($info_file);
        $variables['site_name'] = $info['name'];
        $version['version'] = $info['version'];
        // Use copyright from distro info file.
        if (isset($info['copyright'])) {
            $variables['copyright'] = $info['copyright'];
        } else {
            $variables['copyright'] = st('@name @version', array('@name' => $info['name'], '@version' => $info['version']));
        }
        // Quick fix to add the required radix-progress.js.
        // We assume that Radix is at profiles/*/themes/radix.
        // TODO: handle this better.
        drupal_add_js($path . '/themes/radix/assets/javascripts/radix-progress.js');
    }
}
Beispiel #14
0
function infopeople_preprocess_html(&$variables)
{
    drupal_add_css('//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css', array('group' => CSS_DEFAULT, 'weight' => -50, 'type' => 'external'));
    drupal_add_css('//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css', array('group' => CSS_DEFAULT, 'weight' => -48, 'type' => 'external'));
    drupal_add_css('//infopeople.org/sites/all/modules/civicrm/css/navigation.css', array('group' => CSS_DEFAULT, 'weight' => -50, 'type' => 'external'));
    drupal_add_js('//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js', array('weight' => '-1000', 'type' => 'external'));
}
Beispiel #15
0
function intranet_preprocess_html(&$variables)
{
    drupal_add_css(base_path() . path_to_theme() . '/styles/style.css', array('type' => 'external'));
    drupal_add_css(base_path() . path_to_theme() . '/styles/icons.css', array('type' => 'external'));
    drupal_add_css(base_path() . path_to_theme() . '/styles/animate.css', array('type' => 'external'));
    drupal_add_css(base_path() . path_to_theme() . '/styles/responsive.css', array('type' => 'external'));
    /*$styling = theme_get_setting('styling', 'intranet');
      if ($styling == 'rtl')
        drupal_add_css(base_path() . path_to_theme() . '/styles/rtl.css', array('type' => 'external'));
    
      //Version background
      $version = theme_get_setting('version_c', 'intranet');
      if ($version == 'dark')
        drupal_add_css(base_path() . path_to_theme() . '/styles/dark.css', array('type' => 'external'));
      */
    drupal_add_css(base_path() . path_to_theme() . '/styles/update.css', array('type' => 'external'));
    drupal_add_js(base_path() . path_to_theme() . '/js/intranet.js', array('type' => 'file', 'scope' => 'footer'));
    drupal_add_js(base_path() . path_to_theme() . '/js/jquery.ticker.js', array('type' => 'file', 'scope' => 'header'));
    drupal_add_js(base_path() . path_to_theme() . '/js/custom.js', array('type' => 'file', 'scope' => 'footer'));
    /*
    
      $disable_switcher = theme_get_setting('intranet_disable_switch', 'intranet');
      if (empty($disable_switcher))
        $disable_switcher = 'on';
      if (!empty($disable_switcher) && $disable_switcher == 'on') {
        //Style
        drupal_add_js(base_path() . path_to_theme() . '/customizer/script.js', array('type' => 'file', 'scope' => 'footer'));
        drupal_add_css(base_path() . path_to_theme() . '/customizer/style.css', array('type' => 'external'));
        //End style
      }  */
    drupal_add_js(base_path() . path_to_theme() . '/js/update.js', array('type' => 'file', 'scope' => 'footer'));
    //included file validation js function
    include_file_validation_js_function();
}
Beispiel #16
0
/**
 * Implementation of hook_settings() for themes.
 */
function ginkgo_settings($settings)
{
    // Add js & css
    drupal_add_css('misc/farbtastic/farbtastic.css', 'module', 'all', FALSE);
    drupal_add_js('misc/farbtastic/farbtastic.js');
    drupal_add_css(drupal_get_path('theme', 'ginkgo') . '/settings.css');
    drupal_add_js(drupal_get_path('theme', 'ginkgo') . '/js/settings.js');
    $form = array();
    $form['settings'] = array('#type' => 'fieldset', '#tree' => FALSE, '#title' => t('Settings'));
    $form['settings']['emblem'] = array('#title' => t('Show site emblem'), '#type' => 'checkbox', '#default_value' => isset($settings['emblem']) ? $settings['emblem'] : 1);
    // Build color defaults
    $themes = list_themes();
    $theme_info = !empty($themes['ginkgo']->info) ? $themes['ginkgo']->info : array();
    $defaults = array();
    foreach (array('site', 'og', 'user') as $type) {
        // Retrieve default colors from info file
        if (isset($theme_info["spaces_design_{$type}"])) {
            $defaults[$type] = $theme_info["spaces_design_{$type}"];
        } else {
            $defaults[$type] = '#3399aa';
        }
    }
    $form['color'] = array('#type' => 'fieldset', '#tree' => FALSE, '#title' => t('Color'), '#value' => "<div class='description'>" . t('These color settings can be overridden by color customizations per space.') . "</div>");
    $form['color']['color_site'] = array('#title' => t('Default site color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['color_site']) ? $settings['color_site'] : $defaults['site'], '#suffix' => '<div class="colorpicker" id="edit-color-site-colorpicker"></div>', '#attributes' => array('class' => 'colorpicker'));
    $form['color']['color_og'] = array('#title' => t('Default group color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['color_og']) ? $settings['color_og'] : $defaults['og'], '#suffix' => '<div class="colorpicker" id="edit-color-og-colorpicker"></div>', '#attributes' => array('class' => 'colorpicker'));
    $form['color']['color_user'] = array('#title' => t('Default profile color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['color_user']) ? $settings['color_user'] : $defaults['user'], '#suffix' => '<div class="colorpicker" id="edit-color-user-colorpicker"></div>', '#attributes' => array('class' => 'colorpicker'));
    return $form;
}
Beispiel #17
0
/**
 * Implementation of hook_settings() for themes.
 */
function singular_settings($settings)
{
    // Add js & css
    drupal_add_css('misc/farbtastic/farbtastic.css', 'module', 'all', FALSE);
    drupal_add_js('misc/farbtastic/farbtastic.js');
    drupal_add_js(drupal_get_path('theme', 'singular') . '/js/settings.js');
    drupal_add_css(drupal_get_path('theme', 'singular') . '/css/settings.css');
    file_check_directory(file_directory_path(), FILE_CREATE_DIRECTORY, 'file_directory_path');
    // Check for a new uploaded logo, and use that instead.
    if ($file = file_save_upload('background_file', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = 'singular_background.' . $parts['extension'];
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['background_path'] = $file->filepath;
        }
    }
    $form = array();
    $form['layout'] = array('#title' => t('Layout'), '#type' => 'select', '#options' => array('fixed' => t('Fixed width'), 'fluid' => t('Fluid width')), '#default_value' => !empty($settings['layout']) ? $settings['layout'] : 'fixed');
    $form['messages'] = array('#type' => 'fieldset', '#tree' => FALSE, '#title' => t('Autoclose messages'), '#descriptions' => t('Select the message types to close automatically after a few seconds.'));
    $form['messages']['autoclose'] = array('#type' => 'checkboxes', '#options' => array('status' => t('Status'), 'warning' => t('Warning'), 'error' => t('Error')), '#default_value' => !empty($settings['autoclose']) ? $settings['autoclose'] : array('status'));
    $form['style'] = array('#title' => t('Styles'), '#type' => 'select', '#options' => singular_get_styles(), '#default_value' => !empty($settings['style']) ? $settings['style'] : 'sea');
    $form['custom'] = array('#tree' => FALSE, '#type' => 'fieldset', '#attributes' => array('class' => $form['style']['#default_value'] == 'custom' ? 'singular-custom-settings' : 'singular-custom-settings hidden'));
    $form['custom']['background_file'] = array('#type' => 'file', '#title' => t('Background image'), '#maxlength' => 40);
    if (!empty($settings['background_path'])) {
        $form['custom']['background_preview'] = array('#type' => 'markup', '#value' => !empty($settings['background_path']) ? theme('image', $settings['background_path'], NULL, NULL, array('width' => '100'), FALSE) : '');
    }
    $form['custom']['background_path'] = array('#type' => 'value', '#value' => !empty($settings['background_path']) ? $settings['background_path'] : '');
    $form['custom']['background_color'] = array('#title' => t('Background color'), '#type' => 'textfield', '#size' => '7', '#maxlength' => '7', '#default_value' => !empty($settings['background_color']) ? $settings['background_color'] : '#888888', '#suffix' => '<div id="singular-colorpicker"></div>');
    $form['custom']['background_repeat'] = array('#title' => t('Tile'), '#type' => 'select', '#options' => array('no-repeat' => t('Don\'t tile'), 'repeat-x' => t('Horizontal'), 'repeat-y' => t('Vertical'), 'repeat' => t('Both')), '#default_value' => !empty($settings['background_repeat']) ? $settings['background_repeat'] : 'no-repeat');
    return $form;
}
function loadjs($scripts, $location = "footer")
{
    $program_module_path = drupal_get_path('module', 'program');
    foreach ($scripts as $src) {
        drupal_add_js($program_module_path . $src, array('scope' => $location));
    }
}
/**
 * Add the comic strip name right above the body field.
 */
function whaleocalypse_preprocess_field(&$vars)
{
    if (isset($vars['element']['#bundle']) && $vars['element']['#bundle'] == 'comic' && isset($vars['element']['#field_name']) && $vars['element']['#field_name'] == 'body') {
        $vars['label'] = $vars['element']['#object']->title;
    }
    //Add the transcript expand js if the field is populated
    if ($vars['element']['#field_name'] == 'field_transcript') {
        drupal_add_js(drupal_get_path('theme', 'whaleocalypse') . '/js/expand-transcript.js', array('scope' => 'footer', 'type' => 'file'));
    }
    //Create the custom "story arc" functionality
    if (isset($vars['element']['#field_name']) && $vars['element']['#field_name'] == 'field_story_arc') {
        $tid = $vars['element']['#object']->field_story_arc[LANGUAGE_NONE][0]['tid'];
        $nid = $vars['element']['#object']->nid;
        $story_arc_count = new EntityFieldQuery();
        $vars['story_arc_count'] = $story_arc_count->entityCondition('entity_type', 'node')->entityCondition('bundle', 'comic')->fieldCondition('field_story_arc', 'tid', $tid, '=')->count()->execute();
        $story_arc_position = new EntityFieldQuery();
        $story_arc_position = $story_arc_position->entityCondition('entity_type', 'node')->entityCondition('bundle', 'comic')->fieldCondition('field_story_arc', 'tid', $tid, '=')->propertyOrderBy('created', 'ASC')->execute();
        $vars['story_arc_position'] = array_search($nid, array_keys($story_arc_position['node'])) + 1;
    }
    //Add the author URL if it is set.
    if (isset($vars['element']['#field_name']) && $vars['element']['#field_name'] == 'field_contributing_author') {
        if (isset($vars['element']['#object']->field_contributing_author_url[LANGUAGE_NONE][0])) {
            $vars['items'][0]['#markup'] = l($vars['items'][0]['#markup'], $vars['element']['#object']->field_contributing_author_url[LANGUAGE_NONE][0]['value'], array("attributes" => array("target" => "_blank")));
        }
        $vars['call_to_action'] = 'You can ' . l('write your own whaleocalypse too.', 'node/169', array());
    }
}
Beispiel #20
0
/**
 * main function for churchauth
 * @return string
 */
function churchauth_main()
{
    if (!user_access("administer persons", "churchcore")) {
        addInfoMessage(t("no.permission.for", "<i>administer persons</i>"));
        return " ";
    }
    drupal_add_css(ASSETS . '/fileuploader/fileuploader.css');
    drupal_add_js(BOOTSTRAP . '/js/bootstrap-multiselect.js');
    drupal_add_js(ASSETS . '/fileuploader/fileuploader.js');
    drupal_add_js(ASSETS . '/js/jquery.history.js');
    drupal_add_css(ASSETS . '/dynatree/ui.dynatree.css');
    drupal_add_js(ASSETS . '/dynatree/jquery.dynatree-1.2.4.js');
    drupal_add_js(CHURCHCORE . '/churchcore.js');
    drupal_add_js(CHURCHCORE . '/churchforms.js');
    drupal_add_js(CHURCHCORE . '/cc_abstractview.js');
    drupal_add_js(CHURCHCORE . '/cc_standardview.js');
    drupal_add_js(CHURCHCORE . '/cc_maintainstandardview.js');
    drupal_add_js(CHURCHCORE . '/cc_interface.js');
    drupal_add_js(CHURCHCORE . '/cc_authview.js');
    drupal_add_js(CHURCHCORE . '/cc_authmain.js');
    drupal_add_js(createI18nFile("churchcore"));
    $content = '
<div class="row-fluid">
  <div class="span3">
    <div id="cdb_menu"></div>
    <div id="cdb_filter"></div>
  </div>
  <div class="span9">
    <div id="cdb_search"></div>
    <div id="cdb_group"></div>
    <div id="cdb_content"></div>
  </div>
</div>';
    return $content;
}
/**
 * Implements hook_preprocess_html()
 */
function nestor_preprocess_html(&$variables)
{
    global $base_url;
    $variables['nestor_base_url'] = $base_url;
    $variables['switcher'] = theme_get_setting('switcher');
    /**** Set the background pattern to the body when the layout is boxed ****/
    $variables['boxed_bPattern'] = '';
    if (theme_get_setting('layout_version') === "boxed") {
        $variables['boxed_bPattern'] .= theme_get_setting('boxed_bPattern');
    }
    /**** Sending required settings and variables to the javascript ****/
    $google_latitude = theme_get_setting('latitude');
    $google_longitude = theme_get_setting('longitude');
    $google_zoom = theme_get_setting('google_zoom');
    $google_title = theme_get_setting('google_title');
    $google_description = theme_get_setting('google_description');
    $settings = array('nestor_base_url' => $base_url, 'google_latitude' => $google_latitude, 'google_longitude' => $google_longitude, 'google_zoom' => $google_zoom, 'google_title' => $google_title, 'google_description' => $google_description);
    drupal_add_js(array("settings" => $settings), 'setting');
    /**** Add the color css ****/
    $path = path_to_theme();
    $color = theme_get_setting('theme_color');
    drupal_add_css($path . '/css/color/' . $color . '.css', array('group' => CSS_THEME, 'type' => 'file', 'id' => 'themeColor'));
    // external javascript for google maps
    drupal_add_js('//maps.google.com/maps/api/js?sensor=false', 'external');
    // Check if the Sticky Header is activated or not and import the JS files to make it work
    if (theme_get_setting('sticky_header') === "on") {
        drupal_add_js($path . '/js/waypoints.min.js');
        drupal_add_js($path . '/js/waypoints-sticky.min.js');
    }
    if ($variables['switcher'] === "on") {
        drupal_add_js($path . '/js/demo-switcher.js');
    }
}
Beispiel #22
0
/**
 * Implements hook_preprocess_html().
 * Meta tags https://drupal.org/node/1468582#comment-5698732
 */
function importacionesgm_preprocess_html(&$variables)
{
    $meta_charset = array('#tag' => 'meta', '#attributes' => array('charset' => 'utf-8'));
    drupal_add_html_head($meta_charset, 'meta_charset');
    $meta_x_ua_compatible = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'x-ua-compatible', 'content' => 'ie=edge, chrome=1'));
    drupal_add_html_head($meta_x_ua_compatible, 'meta_x_ua_compatible');
    $meta_mobile_optimized = array('#tag' => 'meta', '#attributes' => array('name' => 'MobileOptimized', 'content' => 'width'));
    drupal_add_html_head($meta_mobile_optimized, 'meta_mobile_optimized');
    $meta_handheld_friendly = array('#tag' => 'meta', '#attributes' => array('name' => 'HandheldFriendly', 'content' => 'true'));
    drupal_add_html_head($meta_handheld_friendly, 'meta_handheld_friendly');
    $meta_viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1'));
    drupal_add_html_head($meta_viewport, 'meta_viewport');
    $meta_cleartype = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'cleartype', 'content' => 'on'));
    drupal_add_html_head($meta_cleartype, 'meta_cleartype');
    // Use html5shiv.
    if (theme_get_setting('html5shim')) {
        $element = array('element' => array('#tag' => 'script', '#value' => '', '#attributes' => array('type' => 'text/javascript', 'src' => file_create_url(drupal_get_path('theme', 'importacionesgm') . '/js/html5shiv-printshiv.js'))));
        $html5shim = array('#type' => 'markup', '#markup' => "<!--[if lt IE 9]>\n" . theme('html_tag', $element) . "<![endif]-->\n");
        drupal_add_html_head($html5shim, 'sonambulo_html5shim');
    }
    // Use Respond.js.
    if (theme_get_setting('respond_js')) {
        drupal_add_js(drupal_get_path('theme', 'importacionesgm') . '/js/respond.min.js', array('group' => JS_LIBRARY, 'weight' => -100));
    }
    // Use normalize.css
    if (theme_get_setting('normalize_css')) {
        drupal_add_css(drupal_get_path('theme', 'importacionesgm') . '/css/normalize.css', array('group' => CSS_SYSTEM, 'weight' => -100));
    }
}
Beispiel #23
0
function open_framework_js_alter(&$javascript)
{
    // Update jquery version for non-administration pages
    if (arg(0) != 'admin' && arg(0) != 'panels' && arg(0) != 'ctools' && !module_exists('jquery_update')) {
        $jquery_file = drupal_get_path('theme', 'open_framework') . '/js/jquery-1.9.1.min.js';
        $jquery_version = '1.9.1';
        $migrate_file = drupal_get_path('theme', 'open_framework') . '/js/jquery-migrate-1.2.1.min.js';
        $migrate_version = '1.2.1';
        $form_file = drupal_get_path('theme', 'open_framework') . '/js/jquery-form-3.31.0.min.js';
        $form_version = '3.31.0';
        $javascript['misc/jquery.js']['data'] = $jquery_file;
        $javascript['misc/jquery.js']['version'] = $jquery_version;
        $javascript['misc/jquery.js']['weight'] = 0;
        $javascript['misc/jquery.js']['group'] = -101;
        drupal_add_js($migrate_file);
        if (isset($javascript["{$migrate_file}"])) {
            $javascript["{$migrate_file}"]['version'] = $migrate_version;
            $javascript["{$migrate_file}"]['weight'] = 1;
            $javascript["{$migrate_file}"]['group'] = -101;
        }
        if (isset($javascript['misc/jquery.form.js'])) {
            $javascript['misc/jquery.form.js']['data'] = $form_file;
            $javascript['misc/jquery.form.js']['version'] = $form_version;
            $javascript['misc/jquery.form.js']['weight'] = 2;
            $javascript['misc/jquery.form.js']['group'] = -101;
        }
    }
}
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   An array of saved settings for this theme.
 * @param $subtheme_defaults
 *   Allow a subtheme to override the default values.
 * @return
 *   A form array.
 */
function zen_settings($saved_settings, $subtheme_defaults = array())
{
    // Add the form's CSS
    drupal_add_css(drupal_get_path('theme', 'zen') . '/theme-settings.css', 'theme');
    // Add javascript to show/hide optional settings
    drupal_add_js(drupal_get_path('theme', 'zen') . '/theme-settings.js', 'theme');
    /*
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the theme-settings-init.php file.
     */
    $defaults = array('zen_block_editing' => 1, 'zen_breadcrumb' => 'yes', 'zen_breadcrumb_separator' => ' › ', 'zen_breadcrumb_home' => 1, 'zen_breadcrumb_trailing' => 1, 'zen_layout' => 'border-politics-liquid', 'zen_wireframes' => 0);
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    /*
     * Create the form using Form API
     */
    $form['zen-div-opening'] = array('#value' => '<div id="zen-settings">');
    $form['zen_block_editing'] = array('#type' => 'checkbox', '#title' => t('Show block editing on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), '#default_value' => $settings['zen_block_editing']);
    $form['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb settings'), '#attributes' => array('id' => 'zen-breadcrumb'));
    $form['breadcrumb']['zen_breadcrumb'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => $settings['zen_breadcrumb'], '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No')));
    $form['breadcrumb']['zen_breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => $settings['zen_breadcrumb_separator'], '#size' => 5, '#maxlength' => 10, '#prefix' => '<div id="div-zen-breadcrumb-collapse">');
    $form['breadcrumb']['zen_breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => $settings['zen_breadcrumb_home']);
    $form['breadcrumb']['zen_breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['zen_breadcrumb_trailing'], '#description' => t('Useful when the breadcrumb is placed just before the title.'), '#suffix' => '</div>');
    $form['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#attributes' => array('id' => 'zen-themedev'));
    $form['themedev']['zen_layout'] = array('#type' => 'radios', '#title' => t('Layout method'), '#options' => array('border-politics-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>', 'border-politics-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>'), '#default_value' => $settings['zen_layout']);
    $form['themedev']['zen_wireframes'] = array('#type' => 'checkbox', '#title' => t('Display borders around main layout elements'), '#default_value' => $settings['zen_wireframes'], '#description' => l(t('Wireframes'), 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain') . t(' are useful when prototyping a website.'), '#prefix' => '<div id="div-zen-wireframes"><strong>' . t('Wireframes:') . '</strong>', '#suffix' => '</div>');
    $form['zen-div-closing'] = array('#value' => '</div>');
    // Return the form
    return $form;
}
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   An array of saved settings for this theme.
 * @param $subtheme_defaults
 *   Allow a subtheme to override the default values.
 * @return
 *   A form array.
 */
function zen_settings($saved_settings, $subtheme_defaults = array())
{
    // Add the form's CSS
    drupal_add_css(drupal_get_path('theme', 'zen') . '/theme-settings.css', 'theme');
    // Add javascript to show/hide optional settings
    drupal_add_js(drupal_get_path('theme', 'zen') . '/theme-settings.js', 'theme');
    // Get the default values from the .info file.
    $defaults = zen_theme_get_default_settings('zen');
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merge the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    /*
     * Create the form using Forms API
     */
    $form['zen-div-opening'] = array('#value' => '<div id="zen-settings">');
    $form['zen_block_editing'] = array('#type' => 'checkbox', '#title' => t('Show block editing on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), '#default_value' => $settings['zen_block_editing']);
    $form['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb settings'), '#attributes' => array('id' => 'zen-breadcrumb'));
    $form['breadcrumb']['zen_breadcrumb'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => $settings['zen_breadcrumb'], '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No')));
    $form['breadcrumb']['zen_breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => $settings['zen_breadcrumb_separator'], '#size' => 5, '#maxlength' => 10, '#prefix' => '<div id="div-zen-breadcrumb-collapse">');
    $form['breadcrumb']['zen_breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => $settings['zen_breadcrumb_home']);
    $form['breadcrumb']['zen_breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['zen_breadcrumb_trailing'], '#description' => t('Useful when the breadcrumb is placed just before the title.'));
    $form['breadcrumb']['zen_breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => $settings['zen_breadcrumb_title'], '#description' => t('Useful when the breadcrumb is not placed just before the title.'), '#suffix' => '</div>');
    $form['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#attributes' => array('id' => 'zen-themedev'));
    $form['themedev']['zen_rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#default_value' => $settings['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' => 'http://drupal.org/node/173880#theme-registry')), '#prefix' => '<div id="div-zen-registry"><strong>' . t('Theme registry:') . '</strong>', '#suffix' => '</div>');
    $form['themedev']['zen_layout'] = array('#type' => 'radios', '#title' => t('Layout method'), '#options' => array('border-politics-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>', 'border-politics-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>'), '#default_value' => $settings['zen_layout']);
    $form['themedev']['zen_wireframes'] = array('#type' => 'checkbox', '#title' => t('Display borders around main layout elements'), '#default_value' => $settings['zen_wireframes'], '#description' => t('<a href="!link">Wireframes</a> are useful when prototyping a website.', array('!link' => 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain')), '#prefix' => '<div id="div-zen-wireframes"><strong>' . t('Wireframes:') . '</strong>', '#suffix' => '</div>');
    $form['zen-div-closing'] = array('#value' => '</div>');
    // Return the form
    return $form;
}
Beispiel #26
0
/**
 * Implements template_preprocess_html().
 */
function radix_preprocess_html(&$variables)
{
    global $base_url;
    // Add Bootstrap JS from CDN if bootstrap library is not installed.
    if (!module_exists('bootstrap_library')) {
        $base = parse_url($base_url);
        $url = $base['scheme'] . '://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js';
        drupal_add_js($url, 'external');
    }
    // Add support for the Modenizr module.
    // Load modernizr.js only if modernizr module is not present.
    if (!module_exists('modernizr')) {
        drupal_add_js(drupal_get_path('theme', 'radix') . '/assets/javascripts/modernizr.js');
    }
    // Add meta for Bootstrap Responsive.
    // <meta name="viewport" content="width=device-width, initial-scale=1.0">
    $element = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'));
    drupal_add_html_head($element, 'bootstrap_responsive');
    // Add some custom classes for panels pages.
    if (module_exists('page_manager') && count(page_manager_get_current_page())) {
        $variables['is_panel'] = TRUE;
        // Get the current panel display and add some classes to body.
        if ($display = panels_get_current_page_display()) {
            $variables['classes_array'][] = 'panel-layout-' . $display->layout;
            // Add a custom class for each region that has content.
            $regions = array_keys($display->panels);
            foreach ($regions as $region) {
                $variables['classes_array'][] = 'panel-region-' . $region;
            }
        }
    }
}
 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);
     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');
     jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
     parent::add_meta();
 }
/**
 * Implements hook_preprocess_page().
 */
function ctsibamboo_preprocess_page(&$vars)
{
    // This js code needs to be processed before Beauty Tips js
    //  JS_LIBRARY > JS_MODULE > JS_THEME
    //  that plus the weight seems to do it
    drupal_add_js(drupal_get_path('theme', 'ctsibamboo') . '/js/profiletip.js', array('type' => 'file', 'scope' => 'header', 'group' => JS_LIBRARY, 'weight' => -20));
}
Beispiel #29
0
/**
 * Implements hook_preproces_html().
 */
function cmstheme_preprocess_html(&$variables)
{
    $theme_path = path_to_theme();
    drupal_add_js($theme_path . '/js/script.js');
    drupal_add_js($theme_path . '/js/jquery.phonenumber.js');
    drupal_add_js($theme_path . '/js/jquery.dagsorden.js', array('scope' => 'footer', 'weight' => 5));
}
Beispiel #30
0
 /**
  * @see AdminState::render()
  * @param $form
  * @param $form_state
  */
 public function render(&$form, $form_state)
 {
     drupal_add_js("admin/settings/jwplayermodule/adminjs", "module", "header", FALSE, FALSE);
     $form["Version"] = array("#description" => JW_SETUP_DESC, "#type" => "fieldset", "#title" => "JW Player Version");
     $form["Version"]["Current"] = array("#type" => "item");
     $version = variable_get(LONGTAIL_KEY . "version", "");
     if (isset($version) && !empty($version)) {
         $value = "<p><strong>Current Player</strong>: JW Player " . $version . "</p>";
         $upgrade = "";
         if (!strstr($version, "Licensed")) {
             $value .= "<p>" . JW_LICENSED . "</p>";
             $upgrade = "Click Here to Upgrade";
         }
     } else {
         $value = "<p><strong>Current Player: Version Unknown</strong></p>";
         $upgrade = "Click Here to Reinstall";
     }
     $form["Version"]["Current"]["#value"] = $value;
     $form["Version"]["Upgrade"] = array("#type" => "item", "#name" => "Update_Player", "#value" => "<a href='" . base_path() . "admin/settings/jwplayermodule/upgrade'>{$upgrade}</a>");
     $form["Manage"] = array("#description" => JW_SETUP_EDIT_PLAYERS, "#type" => "fieldset", "#title" => "Manage Players");
     $form["Manage"]["Players"] = array();
     $this->renderDefaultPlayer($form);
     $this->renderPlayers($form);
     $form["Manage"]["Create"] = array("#type" => "submit", "#name" => "Next", "#value" => t("Create Custom Player"));
     $form["Manage"]["Hidden"][LONGTAIL_KEY . "new_player"] = array("#type" => "hidden", "#id" => LONGTAIL_KEY . "new_player", "#name" => LONGTAIL_KEY . "new_player");
     $form["Manage"]["Hidden"][LONGTAIL_KEY . "config"] = array("#type" => "hidden", "#id" => LONGTAIL_KEY . "player", "#name" => LONGTAIL_KEY . "config");
     $form["Manage"]["Hidden"][LONGTAIL_KEY . "state"] = array("#type" => "hidden", "#value" => PlayerState::getID(), "#name" => LONGTAIL_KEY . "state");
 }