/** * 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)); }
function theme_block_overlay_store_form($form, $language) { $output = ""; $output .= drupal_get_css(); $output .= drupal_get_js(); $output .= '<div id="block-overlay-store" class="page-store">'; $output .= '<div id="block-map">'; $output .= '<img src="' . base_path() . drupal_get_path('module', 'storelocator_app') . '/images/carteBE-overlay.jpg' . '" '; $output .= ' class="maphilight" usemap="#Map" />'; $output .= '<map name="Map" id="Map">'; $output .= '<AREA SHAPE=POLY COORDS="19,53,70,30,73,41,68,58,76,86,47,82,34,90,24,83" HREF="javascript:displayRegion(\'' . t('Province Flandre Occidentale', array(), $language) . '\');" ALT="' . t('Province Flandre Occidentale', array(), $language) . '" TITLE="' . t('Province Flandre Occidentale', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="73,40,80,41,79,36,97,43,114,41,123,33,129,52,119,55,120,67,103,90,75,87,71,73,68,57,71,49" HREF="javascript:displayRegion(\'' . t('Province Flandre Orientale', array(), $language) . '\');" ALT="' . t('Province Flandre Orientale', array(), $language) . '" TITLE="' . t('Province Flandre Orientale', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="39,94,34,91,46,82,48,85,54,86,57,87,68,90,75,88,79,89,82,92,87,87,95,90,103,91,103,96,113,94,114,101,119,100,128,111,134,109,138,111,145,113,145,121,145,132,133,135,126,140,132,141,131,149,132,158,134,171,124,167,116,166,113,160,120,157,113,151,116,140,111,132,106,129,99,132,96,129,89,130,89,134,85,129,83,117,70,115,63,109,59,100,62,94,57,92,52,85" HREF="javascript:displayRegion(\'' . t('Province de Hainaut', array(), $language) . '\');" ALT="' . t('Province de Hainaut', array(), $language) . '" TITLE="' . t('Province de Hainaut', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="141,111,150,108,165,106,173,111,182,119,187,126,194,127,194,136,189,140,184,144,191,151,172,155,169,161,171,167,172,175,168,179,165,185,159,184,158,177,159,172,155,167,158,154,159,149,149,155,149,164,140,166,135,170,128,157,129,147,130,141,124,140,132,134,142,133,144,123,142,116" HREF="javascript:displayRegion(\'' . t('Province de Namur', array(), $language) . '\');" ALT="' . t('Province de Namur', array(), $language) . '" TITLE="' . t('Province de Namur', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="195,123,211,131,215,138,222,139,221,131,231,132,233,148,219,167,216,177,214,187,225,198,222,208,200,212,189,202,166,184,171,176,171,167,167,159,171,153,184,152,183,142,193,137" HREF="javascript:displayRegion(\'' . t('Province de Luxembourg', array(), $language) . '\');" ALT="' . t('Province de Luxembourg', array(), $language) . '" TITLE="' . t('Province de Luxembourg', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="171,96,199,93,211,86,215,92,224,93,231,91,239,94,247,102,247,105,243,106,247,116,253,115,255,124,255,126,257,134,242,143,241,153,232,146,230,133,222,133,224,140,212,140,211,131,196,125,186,128,174,113,167,102" HREF="javascript:displayRegion(\'' . t('Province de Liège', array(), $language) . '\');" ALT="' . t('Province de Liège', array(), $language) . '" TITLE="' . t('Province de Liège', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="183,42,199,38,204,47,212,50,221,52,215,72,209,81,210,86,193,94,176,97,180,78,169,75,175,65,167,62,184,53,179,47,181,45" HREF="javascript:displayRegion(\'' . t('Province du Limbourg', array(), $language) . '\');" ALT="' . t('Province du Limbourg', array(), $language) . '" TITLE="' . t('Province du Limbourg', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="122,28,133,31,132,22,141,20,143,26,150,25,154,18,159,20,160,26,166,27,170,20,176,24,175,30,179,36,183,37,182,48,185,53,170,62,157,65,145,66,131,67,124,63,120,64,120,54,128,54,126,41" HREF="javascript:displayRegion(\'' . t('Province Anvers', array(), $language) . '\');" ALT="' . t('Province d\'Anvers', array(), $language) . '" TITLE="' . t('Province d\'Anvers', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="111,99,111,94,113,92,118,96,125,96,126,93,129,93,130,91,135,89,137,92,143,90,147,90,149,84,156,84,159,87,164,88,166,90,171,88,171,97,157,103,147,102,145,107,141,107,141,110,137,110,136,108,127,107,121,102,117,101,117,98,114,97,111,98,111,99" HREF="javascript:displayRegion(\'' . t('Province du Brabant wallon', array(), $language) . '\');" ALT="' . t('Province du Brabant wallon', array(), $language) . '" TITLE="' . t('Province du Brabant wallon', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="124,78,133,74,135,79,136,81,134,88,129,89,123,85" HREF="javascript:displayRegion(\'' . t('Région de Bruxelles', array(), $language) . '\');" ALT="' . t('Région de Bruxelles', array(), $language) . '" TITLE="' . t('Région de Bruxelles', array(), $language) . '">'; $output .= '<AREA SHAPE=POLY COORDS="122,62,133,67,175,65,178,64,171,74,175,76,181,76,174,96,167,90,153,89,134,90,134,80,131,76,124,79,123,84,129,89,133,89,126,95,119,95,115,93,101,95,101,88,112,86,109,80,114,74,116,72,117,58,122,65" HREF="javascript:displayRegion(\'' . t('Province du Brabant flamand', array(), $language) . '\');" ALT="' . t('Province du Brabant flamand', array(), $language) . '" TITLE="' . t('Province du Brabant flamand', array(), $language) . '">'; $output .= '</map>'; $output .= '</div>'; $output .= drupal_render($form); $output .= '</div>'; return $output; }
/** * @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); }
/** * Verifies that the datepicker can be localized. * * @see locale_library_info_alter() */ public function testLibraryInfoAlter() { $attached['#attached']['library'][] = 'core/jquery.ui.datepicker'; drupal_render($attached); $scripts = drupal_get_js(); $this->assertTrue(strpos($scripts, 'locale.datepicker.js'), 'locale.datepicker.js added to scripts.'); }
/** * Image assist module support. */ function lotusPD_img_assist_page($content, $attributes = NULL) { $title = drupal_get_title(); $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; $output .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">' . "\n"; $output .= "<head>\n"; $output .= '<title>' . $title . "</title>\n"; // Note on CSS files from Benjamin Shell: // Stylesheets are a problem with image assist. Image assist works great as a // TinyMCE plugin, so I want it to LOOK like a TinyMCE plugin. However, it's // not always a TinyMCE plugin, so then it should like a themed Drupal page. // Advanced users will be able to customize everything, even TinyMCE, so I'm // more concerned about everyone else. TinyMCE looks great out-of-the-box so I // want image assist to look great as well. My solution to this problem is as // follows: // If this image assist window was loaded from TinyMCE, then include the // TinyMCE popups_css file (configurable with the initialization string on the // page that loaded TinyMCE). Otherwise, load drupal.css and the theme's // styles. This still leaves out sites that allow users to use the TinyMCE // plugin AND the Add Image link (visibility of this link is now a setting). // However, on my site I turned off the text link since I use TinyMCE. I think // it would confuse users to have an Add Images link AND a button on the // TinyMCE toolbar. // // Note that in both cases the img_assist.css file is loaded last. This // provides a way to make style changes to img_assist independently of how it // was loaded. $output .= drupal_get_html_head(); $output .= drupal_get_js(); $output .= "\n<script type=\"text/javascript\"><!-- \n"; $output .= " if (parent.tinyMCE && parent.tinyMCEPopup && parent.tinyMCEPopup.getParam('popups_css')) {\n"; $output .= " document.write('<link href=\"' + parent.tinyMCEPopup.getParam('popups_css') + '\" rel=\"stylesheet\" type=\"text/css\">');\n"; $output .= " } else {\n"; foreach (drupal_add_css() as $media => $type) { $paths = array_merge($type['module'], $type['theme']); foreach (array_keys($paths) as $path) { // Don't import img_assist.css twice. if (!strstr($path, 'img_assist.css')) { $output .= " document.write('<style type=\"text/css\" media=\"{$media}\">@import \"" . base_path() . $path . "\";<\\/style>');\n"; } } } $output .= " }\n"; $output .= "--></script>\n"; // Ensure that img_assist.js is imported last. $path = drupal_get_path('module', 'img_assist') . '/img_assist_popup.css'; $output .= "<style type=\"text/css\" media=\"all\">@import \"" . base_path() . $path . "\";</style>\n"; $output .= '<!--[if IE 6]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie6.css" type="text/css" /><![endif]-->' . "\n"; $output .= '<!--[if IE 7]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie7.css" type="text/css" /><![endif]-->' . "\n"; $output .= "</head>\n"; $output .= '<body' . drupal_attributes($attributes) . ">\n"; $output .= theme_status_messages(); $output .= "\n"; $output .= $content; $output .= "\n"; $output .= '</body>'; $output .= '</html>'; return $output; }
/** * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { /* Load js and css files */ drupal_add_js(path_to_theme() . '/js/aasa.js'); drupal_add_css(path_to_theme() . '/editor.css'); $node = aasa_theme_current_node(); $url = explode('/', $_GET['q']); /* BROWSER TITLE */ $vars['head_title'] = $node->field_browser_title[0]['value']; $vars['template'] = 'admin.inc.php'; $vars['classes'] = $node->type; switch ($node->type) { case 'front_page': $vars['template'] = 'front.inc.php'; if ($url[2] != 'edit') { drupal_add_js(path_to_theme() . '/js/jquery-1.6.2.js'); drupal_add_js(path_to_theme() . '/js/nivo-slider/jquery.nivo.slider.js'); } break; case 'internal_page': case 'board_of_director': case 'education_and_event': case 'member_resources': case 'membership': case 'sponsorship': case 'the_cutting_edge': case 'the_cutting_edge_past': case 'national_conference': case 'regional_conferences': case 'contact_form': case 'webinars_widget': case 'widget_container': case 'widget_gallery': $vars['template'] = 'node.tpl.php'; if ($url[2] != 'edit') { drupal_add_js(path_to_theme() . '/js/jquery-1.6.2.js'); drupal_add_js(path_to_theme() . '/js/nivo-slider/jquery.nivo.slider.js'); } break; } $vars['node_nid_widget'] = $node->nid; if ($url[0] == 'admin' || $url[2] == 'edit' || $url[1] == 'add' || $url[2] == 'delete') { $vars['template'] = 'admin.inc.php'; } if ($url[0] == 'node' && $url[1] == 'add' && $url[2] == 'profile') { $vars['template'] = 'node.tpl.php'; drupal_add_css(path_to_theme() . '/profile.css'); } $globals = node_load(56); /* FOOTER TEXT*/ $vars['title'] = $globals->title; $vars['field_footer_text'] = $globals->field_footer_text[0]['value']; $vars['node_nid_widget'] = $globals->title; /* Reload the javascript and css files */ $vars['scripts'] = drupal_get_js(); $vars['styles'] = drupal_get_css(); $vars['active_menu'] = title_internal(); }
function kalypso_preprocess_page(&$vars, $hook) { if (isset($vars['node'])) { $suggest = "page__node__{$vars['node']->type}"; $vars['theme_hook_suggestions'][] = $suggest; } $status = drupal_get_http_header("status"); if ($status == "404 Not Found") { $vars['theme_hook_suggestions'][] = 'page__404'; } // We need to rebuild the scripts variable with the new script included. $variables['scripts'] = drupal_get_js(); }
function autoservice_process_html(&$variables) { // The JavaScript file to load. $js = 'http://html5shim.googlecode.com/svn/trunk/html5.js'; // Compile the necessary HTML code. $output = "\n"; $output .= "<!--[if lt IE 9]>\n"; $output .= "<script src=\"{$js}\"></script>\n"; $output .= "<![endif]-->\n"; // Add the code after the other scripts. $variables['scripts'] .= $output; $variables['head_scripts'] = drupal_get_js('head_scripts'); }
/** * Override or insert variables into the html template. */ function sgarchive_preprocess_html(&$variables) { drupal_add_css(path_to_theme() . '/css/style.css', array('group' => CSS_THEME, 'type' => 'file', 'preprocess' => FALSE)); if (!theme_get_setting('responsive_respond', 'sgarchive')) { drupal_add_css(path_to_theme() . '/css/basic-layout.css', array('group' => CSS_THEME, 'browsers' => array('IE' => '(lte IE 8)&(!IEMobile)', '!IE' => FALSE), 'preprocess' => FALSE)); } drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('!IE' => FALSE), 'preprocess' => FALSE)); drupal_add_css('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css', array('group' => CSS_THEME, 'type' => 'file', 'preprocess' => FALSE, 'weight' => '-1000')); drupal_add_css('//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css', array('group' => CSS_THEME, 'type' => 'file', 'preprocess' => FALSE, 'weight' => '-1000')); drupal_add_js('//code.jquery.com/ui/1.9.2/jquery-ui.min.js'); drupal_add_js('//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js'); drupal_add_js(path_to_theme() . '/js/main.js'); $variables['bottom_scripts'] = drupal_get_js('bottom_scripts'); }
/** * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { // print_r($vars); $vars['primary_links'] = _opensourcery_primary_links($vars['primary_links']); $vars['secondary_links'] = _opensourcery_secondary_links($vars['secondary_links']); $vars['tabs2'] = menu_secondary_local_tasks(); // Hook into color.module if (module_exists('color')) { _color_page_alter($vars); } // Render the slideshow view for homepage $vars['embedded_slideshow'] = views_embed_view('homeslideshow', 'block_1'); //Reload the javascript into the scripts due to a problem with slideshow. $vars['scripts'] = drupal_get_js(); }
function mycinema_preprocess_page(&$vars, $hook) { if (true) { drupal_add_js(drupal_get_path('theme', 'mycinema') . '/js/custom.js'); $vars['scripts'] = drupal_get_js(); // necessary in D7? } //add news class //dpm( $vars['navbar_classes_array']); //$vars['navbar_classes_array'][] = 'new-class'; //remove class //unset($vars['navbar_classes_array'][1]); // you need change value 0 to value you want remove class // Default // 0 'navbar', 1 => 'container', 2 => 'navbar-default' }
function _phptemplate_variables($hook, $vars = array()) { switch ($hook) { case 'page': global $theme; drupal_add_css($vars['directory'] . '/additional.css', 'theme', 'all'); drupal_add_js($vars['directory'] . '/jquery.color.js', 'theme'); drupal_add_js($vars['directory'] . '/scripts.js', 'theme'); // turn off title? $vars['suppress_title'] = $vars['node']->type == 'crime'; break; } $vars['css'] = drupal_add_css(); $vars['styles'] = drupal_get_css(); $vars['scripts'] = drupal_get_js(); return $vars; }
/** * Override or insert variables into page templates. * * @param $vars * A sequential array of variables to pass to the theme template. * @param $hook * The name of the theme function being called. */ function u21dk2011_preprocess_page(&$vars, $hook) { global $theme; global $theme_path; // Detect if page is shown in a regional context $vars['is_region'] = FALSE; if ($hook == 'page') { if (isset($vars['node']) && property_exists($vars['node'], 'field_slug_ref') && $vars['node']->field_slug_ref[0]['nid']) { $vars['is_region'] = TRUE; } } // Don't display empty help from node_help(). if ($vars['help'] == "<div class=\"help\"> \n</div>") { $vars['help'] = ''; } // Set variables for the logo and site_name. if (!empty($vars['logo'])) { // Return the site_name even when site_name is disabled in theme settings. $vars['logo_alt_text'] = empty($vars['logo_alt_text']) ? variable_get('site_name', '') : $vars['logo_alt_text']; $vars['site_logo'] = '<a id="site-logo" href="' . $vars['front_page'] . '" title="' . t('Home page') . '" rel="home"><img src="' . $vars['logo'] . '" alt="' . $vars['logo_alt_text'] . '" /></a>'; } $vars['tournament_logo'] = '<img id="tournament-logo" src="/' . $theme_path . '/images/graphic-dk2011.png" alt="Denmark 2011" />'; if (!empty($vars['site_slogan'])) { $vars['tournament_date'] = '<img id="tournament-date" src="/' . $theme_path . '/images/graphic-date.png" alt="' . $vars['site_slogan'] . '" />'; } else { $vars['tournament_date'] = ''; } // Add regional context to body classes if (!$vars['is_front']) { $path_request = explode('/', $_SERVER['REQUEST_URI']); if ($path_request[1] == "location") { $vars['body_classes'] .= ' page-regional'; } } // Add profiles js if (isset($vars['node'])) { $node = $vars['node']; if ($node->type == 'profile') { jquery_ui_add('ui.tabs'); drupal_add_js(path_to_theme() . '/scripts/profiles.js'); $vars['scripts'] = drupal_get_js(); } } }
function comunececina_process_html(&$vars) { $before = array("/>\\s\\s+/", "/\\s\\s+</", "/>\t+</", "/\\s\\s+(?=\\w)/", "/(?<=\\w)\\s\\s+/"); $after = array('> ', ' <', '> <', ' ', ' '); // Page top. $page_top = $vars['page_top']; $page_top = preg_replace($before, $after, $page_top); $vars['page_top'] = $page_top; // Page content. if (!preg_match('/<pre|<textarea/', $vars['page'])) { $page = $vars['page']; $page = preg_replace($before, $after, $page); $vars['page'] = $page; } // Page bottom. $page_bottom = $vars['page_bottom']; $page_bottom = preg_replace($before, $after, $page_bottom); $vars['page_bottom'] = $page_bottom . drupal_get_js('footer'); }
/** * 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; }
function navin_process_maintenance_page(&$variables) { // Include @font-your-face support if (module_exists('fontyourface')) { fontyourface_preprocess_page($variables); $fonts = (array) $variables['fontyourface']; foreach ($fonts as $font) { if (module_hook($font->provider, 'preprocess_page')) { call_user_func_array($font->provider . '_preprocess_page', array(&$variables)); } } } // Add theme's maintenance CSS drupal_add_css(path_to_theme() . '/css/maintenance.css', array('group' => CSS_THEME, 'weight' => 10)); // Reset variables $variables['head'] = drupal_get_html_head(); $variables['css'] = drupal_add_css(); $variables['styles'] = drupal_get_css(); $variables['scripts'] = drupal_get_js(); }
function wistar_preprocess_page(&$vars) { jquery_ui_add(array('effects.slide')); if( $vars['is_front'] ) { $vars['homepage'] = wistar_theme_get_active('homepage'); $vars['head_title'] = $vars['homepage']->title; // load up the quicktabs $quicktabs = quicktabs_load(1); $vars['quicktabs'] = theme('quicktabs', $quicktabs); // load the alert $vars['alert'] = wistar_theme_get_alert(); // we need to re-render the js, since qt relies on it's own $vars['css'] = drupal_add_css(); $vars['styles'] = drupal_get_css(); $vars['scripts'] = drupal_get_js(); // rebuild the less files - this sucks, but is needed beacuse of how // quicktabs adds the required files in a theme function // this shouldn't be a problem in production, since this function only builds // the less files if they aren't built already. Otherwise, it just modifies the // css array to include the built files. _less_build($vars, 'page'); } if( isset($vars['title']) && $vars['title'] ) { $vars['body_classes'] .= ' ' . wistar_str2class($vars['title']); } if(isset($_SESSION['donation_form'])&&arg(0)!='give'&&arg(1)!='confirmation'){ unset($_SESSION['donation_form']); } $node = $vars['node']; if ($node->type=='microsite_subpage') { if ($node->field_template_type[0]['value'] == 1) { $vars['body_classes'] .= ' microsite-subpage-fullwidth'; } } }
public static function deliverMinimalHtmlPage($result) { if (is_int($result)) { drupal_deliver_html_page($result); return; } // Emit the correct charset HTTP header, but not if the page callback // result is NULL, since that likely indicates that it printed something // in which case, no further headers may be sent, and not if code running // for this page request has already set the content type header. if (isset($result) && is_null(drupal_get_http_header('Content-Type'))) { drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); } // Send appropriate HTTP-Header for browsers and search engines. global $language; drupal_add_http_header('Content-Language', $language->language); if (isset($result)) { print '<html><head><title>' . drupal_get_title() . '</title>' . drupal_get_css() . drupal_get_js() . '</head>'; print '<body>' . render($result) . '</body></html>'; } drupal_page_footer(); }
/** * Override or insert PHPTemplate variables into the templates. */ function _phptemplate_variables($hook, $vars) { if ($hook == 'page') { $vars['tabs'] = ''; $primary = menu_primary_local_tasks(); if (!empty($primary)) { $vars['tabs'] = '<ul class="arttabs_primary">' . $primary . '</ul>'; } $vars['tabs2'] = ''; $secondary = menu_secondary_local_tasks(); if (!empty($secondary)) { $vars['tabs2'] = '<ul class="arttabs_secondary">' . $secondary . '</ul>'; } // Hook into color.module if (module_exists('color')) { _color_page_alter($vars); } drupal_add_js(path_to_theme() . '/script.js', 'theme'); $vars['scripts'] = drupal_get_js(); return $vars; } return array(); }
"> <head> <meta http-equiv="X-UA-Compatible" content="IE=9" > <?php print $head; ?> <?php print $styles; ?> <?php $scripts = drupal_add_js(); $new_jquery = array('recline/vendor/jquery/1.7.1/jquery.js' => $scripts['core']['sites/all/modules/contrib/jquery_update/replace/jquery.min.js']); $scripts['core'] = array_merge($new_jquery, $scripts['core']); unset($scripts['core']['misc/jquery.js']); unset($scripts['core']['sites/all/modules/contrib/jquery_update/replace/jquery.min.js']); $visual_scripts = drupal_get_js('header', $scripts); print $visual_scripts; ?> <title>Data Portal India Visualization Engine</title> <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="stylesheet" href="/recline/vendor/bootstrap/2.0.2/css/bootstrap.css" /> <link rel="stylesheet" href="/recline/vendor/leaflet/0.3.1/leaflet.css"> <!--[if lte IE 8]> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.ie.css" /> <![endif]--> <!--[if lte IE 8]> <link rel="stylesheet" href="vendor/leaflet/0.3.1/leaflet.ie.css" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $GLOBALS['language']->language; ?> " xml:lang="<?php print $GLOBALS['language']->language; ?> "> <head> <title><?php print t('File Browser'); ?> </title> <?php print drupal_get_html_head(); print elfinder_browser_css(); print elfinder_browser_js(); ?> </head> <body class="elfinder"> <div id="elfinder-messages"><?php print theme('status_messages'); ?> </div> <div id="finder"></div> <?php print drupal_get_js('footer'); ?> </body> </html>
function phptemplate_preprocess_page(&$vars) { $eigen_risico = variable_get('eigen_risico', ''); $fysio = variable_get('fysio', ''); $tandarts = variable_get('tandarts', ''); $keuzevrijheid = variable_get('keuzevrijheid', ''); $default_title = variable_get('default_title', '0'); $default_sort = variable_get('default_sort', 'premium'); $default_beperkte_zorgkeuze = variable_get('default_beperkte_zorgkeuze', '0'); $default_vrije_zorgkeuze = variable_get('default_vrije_zorgkeuze', '0'); drupal_add_js(array('filter' => array('eigen_risico' => $eigen_risico, 'fysio' => $fysio, 'tandarts' => $tandarts, 'keuzevrijheid' => $keuzevrijheid, 'default_title' => $default_title, 'default_sort' => $default_sort, 'default_beperkte_zorgkeuze' => $default_beperkte_zorgkeuze, 'default_vrije_zorgkeuze' => $default_vrije_zorgkeuze)), 'setting'); drupal_add_js(array('filter_counts' => variable_get('default_count_of_contacts', 10)), 'setting'); if ($vars['node']->type == 'insurance' && isset($_GET['eigen_risico']) && isset($_GET['fysio']) && isset($_GET['tandarts']) && isset($_GET['keuzevrijheid'])) { $vars['contentBottom'] = ''; } global $user; $vars['path'] = base_path() . path_to_theme() . '/'; $vars['user'] = $user; if (!(!empty($_POST['save_Vergelijken']) && arg(0) == 'compare')) { if ($user->uid > 0) { db_query("DELETE FROM {flag_content} WHERE uid = %d", $user->uid); } else { db_query("DELETE FROM {flag_content} WHERE uid = 0 AND sid = %d", flag_get_sid(0)); } } // Fixup the $head_title and $title vars to display better. $title = drupal_get_title(); $vars['title'] = $title; $headers = drupal_set_header(); // wrap taxonomy listing pages in quotes and prefix with topic if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) { $title = t('Topic') . ' “' . $title . '”'; } elseif (strpos($headers, 'HTTP/1.1 403 Forbidden') && !$user->uid) { $title = t('Please login to continue'); } // Body class & Params if (module_exists('path')) { $alias = drupal_get_path_alias($_GET['q']); $vars['params'] = explode('/', $alias); $vars['body_id'] = $vars['params'][0]; if ($vars['body_id'] == 'compare') { $vars['body_id'] = 'vergelijk'; } if (empty($vars['body_id'])) { $vars['body_id'] = 'home'; } } // Base url $vars['baseUrl'] = 'http://' . $_SERVER['HTTP_HOST']; if (!drupal_is_front_page()) { $vars['head_title'] = $title . ' | ' . $vars['site_name']; if ($vars['site_slogan'] != '') { $vars['head_title'] .= ' – ' . $vars['site_slogan']; } } // Head title if (module_exists('page_title')) { $vars['head_title'] = page_title_page_get_title(); } elseif (!drupal_is_front_page()) { $vars['head_title'] = $title . ' | ' . $vars['site_name']; if ($vars['site_slogan'] != '') { $vars['head_title'] .= ' – ' . $vars['site_slogan']; } } // determine layout // 3 columns if ($vars['layout'] == 'both') { $vars['colls'] = 'bothCol'; } else { if ($vars['layout'] != 'none') { // left column & center if ($vars['layout'] == 'left') { $vars['colls'] = 'leftCol'; } else { if ($vars['layout'] == 'right') { $vars['colls'] = 'rightCol'; } } } else { $vars['colls'] = 'noCol'; } } $vars['scripts'] = drupal_get_js(); }
/** * Implementation of template_preprocess_page(). */ function csa_base_preprocess_page(&$variables) { $conditional = array(); $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1); $conditional['IE'] = array(); // Target all IE versions $conditional['IE 6'] = array(); // Target Internet Explorer 6 only $conditional['IE 7'] = array(); // Target Internet Explorer 7 only $conditional['IE 8'] = array(); // Target Internet Explorer 8 only $conditional['IE 6'][] .= '<script type="text/javascript">var blankImgIE="' . theme('theme_path', '/images/blank.gif') . '";</script>'; $conditional['IE 6'][] .= '<style type="text/css" media="all">@import "' . theme('theme_path', '/css/fix-ie-6.css') . $query_string . '";</style>'; $conditional['IE 6'][] .= '<style type="text/css">img { behavior: url(' . theme('theme_path', '/script/iepngfix.htc') . $query_string . ') }</style>'; $conditional['IE 7'][] .= '<style type="text/css" media="all">@import "' . theme('theme_path', '/css/fix-ie-7.css') . $query_string . '";</style>'; $conditional_output = ''; foreach ($conditional as $version => $rules) { if (count($rules)) { $conditional_output .= '<!--[if ' . $version . "]>\n"; foreach ($rules as $rule) { $conditional_output .= $rule . "\n"; } $conditional_output .= "<![endif]-->\n"; } } // Rebuild the $scripts output $js = drupal_add_js(); // remove sticky table headers, we use our own modified version for this unset($js['module']['misc/tableheader.js']); $variables['scripts'] = drupal_get_js('header', $js) . $conditional_output; // Rebuild the $styles output $css = drupal_add_css(); $variables['styles'] = drupal_get_css($css); $http = empty($_SERVER['HTTPS']) ? 'http' : 'https'; $variables['styles'] .= "<link href='" . $http . "://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'>\n"; $variables['styles'] .= "<link href='" . $http . "://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>\n"; // add a var $admin_section to see if we are in the admin section of the site $variables['admin_section'] = FALSE; if (arg(0) == 'admin' || arg(2) == 'edit' || arg(2) == 'webform-results') { $variables['body_classes'] .= ' admin-section'; $variables['admin_section'] = TRUE; } // Move second sidebar to first if this option is enabled in the theme settings and the user is viewing an admin page if (theme_get_setting('csa_base_move_sidebar') && $variables['admin_section']) { if (!empty($variables['sidebar_1']) && !empty($variables['sidebar_2'])) { $variables['sidebar_1'] .= $variables['sidebar_2']; unset($variables['sidebar_2']); } elseif (!empty($variables['sidebar_2'])) { $variables['sidebar_1'] = $variables['sidebar_2']; unset($variables['sidebar_2']); } } // Set up layout variable $variables['layout'] = 'none'; if (!empty($variables['sidebar_1'])) { $variables['layout'] = 'sidebar-1'; } if (!empty($variables['sidebar_2'])) { $variables['layout'] = $variables['layout'] == 'sidebar-1' ? 'both' : 'sidebar-2'; } // Strip sidebar classes from the body $variables['body_classes'] = str_replace(array('both', 'no-sidebars', 'two-sidebars', 'one-sidebar', 'sidebar-left', 'sidebar-right'), '', $variables['body_classes']); // Remove excess spaces $variables['body_classes'] = str_replace(' ', ' ', trim($variables['body_classes'])); // Add information about the number of sidebars if ($variables['layout'] == 'both') { $variables['body_classes'] .= ' two-sidebars'; } elseif ($variables['layout'] == 'none') { $variables['body_classes'] .= ' no-sidebars'; } else { $variables['body_classes'] .= ' one-sidebar ' . $variables['layout']; } // add the taxonomy terms to the body_classes if (module_exists('taxonomy') && !empty($variables['node_terms'])) { $terms = array(); foreach (taxonomy_node_get_terms($variables['node']) as $term) { $terms[] = $variables['node_terms'] . csa_base_safe_css_name($term->name); } if (count($terms)) { $variables['body_classes'] .= ' ' . implode(' ', $terms); } } if (!empty($variables['logo'])) { $logo_img = theme('image', substr($variables['logo'], strlen(base_path()), strlen($variables['logo'])), $variables['site_name'], $variables['site_name']); $variables['logo'] = l($logo_img, "<front>", array('html' => 'true', 'attributes' => array('title' => $variables['site_name']))); } // Display mission statement on all pages? if (theme_get_setting('mission_statement_pages') == 'all') { $variables['mission'] = theme_get_setting('mission', FALSE); } // Show the title in the breadcrumb? if (!theme_get_setting('breadcrumb_display_admin') && $variables['admin_section'] || theme_get_setting('breadcrumb_display') == 0 && !$variables['admin_section']) { //Hide breadcrumb on all pages? unset($variables['breadcrumb']); } elseif (theme_get_setting('breadcrumb_with_title')) { $variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb(), $variables['title']); } $title = t(variable_get('site_name', '')); $slogan = t(variable_get('site_slogan', '')); $mission = t(variable_get('site_mission', '')); $page_title = t(drupal_get_title()); $title_separator = theme_get_setting('configurable_separator'); // Front page title settings if (drupal_is_front_page()) { switch (theme_get_setting('front_page_title_display')) { case 'title_slogan': $variables['head_title'] = drupal_set_title($title . $title_separator . $slogan); break; case 'slogan_title': $variables['head_title'] = drupal_set_title($slogan . $title_separator . $title); break; case 'title_mission': $variables['head_title'] = drupal_set_title($title . $title_separator . $mission); break; case 'custom': if (theme_get_setting('page_title_display_custom') !== '') { $variabless['head_title'] = drupal_set_title(t(theme_get_setting('page_title_display_custom'))); } } } else { // Non-front page title settings switch (theme_get_setting('other_page_title_display')) { case 'ptitle_slogan': $variables['head_title'] = drupal_set_title($page_title . $title_separator . $slogan); break; case 'ptitle_stitle': $variables['head_title'] = drupal_set_title($page_title . $title_separator . $title); break; case 'ptitle_smission': $variables['head_title'] = drupal_set_title($page_title . $title_separator . $mission); break; case 'ptitle_custom': if (theme_get_setting('other_page_title_display_custom') !== '') { $variables['head_title'] = drupal_set_title($page_title . $title_separator . t(theme_get_setting('other_page_title_display_custom'))); } break; case 'custom': if (theme_get_setting('other_page_title_display_custom') !== '') { $variables['head_title'] = drupal_set_title(t(theme_get_setting('other_page_title_display_custom'))); } } } // Set variables for the primary and secondary links if (!empty($variables['primary_links'])) { if (theme_get_setting('primary_links_allow_tree')) { $variables['primary_menu'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links')); } else { $variables['primary_menu'] = theme('links', $variables['primary_links'], array('class' => 'menu primary-links')); } } if (!empty($variables['secondary_links'])) { if (theme_get_setting('secondary_links_allow_tree')) { $variables['secondary_menu'] = menu_tree(variable_get('menu_secondary_links_source', 'secondary-links')); } else { $variables['secondary_menu'] = theme('links', $variables['secondary_links'], array('class' => 'menu secondary-links')); } } if (theme_get_setting('hide_front_page_title') && drupal_is_front_page()) { $variables['title'] = NULL; } else { // Remove any potential html tags $variables['head_title'] = strip_tags($variables['head_title']); } }
?> " version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?> "<?php print $rdf_namespaces; ?> > <head profile="<?php print $grddl_profile; ?> "> <title><?php print $title; ?> </title> <?php print drupal_get_js(); ?> <?php print drupal_get_css(); ?> </head> <body class="shadowbox_login"> <?php print theme('status_messages'); print $content; ?> </body> </html>
/** * Tests post-render cache-integrated 'render_cache_placeholder' child * element. */ function testDrupalRenderChildElementRenderCachePlaceholder() { $container = array('#type' => 'container'); $context = array('bar' => $this->randomContextValue()); $callback = 'common_test_post_render_cache_placeholder'; $placeholder = drupal_render_cache_generate_placeholder($callback, $context); $test_element = array('#post_render_cache' => array($callback => array($context)), '#markup' => $placeholder, '#prefix' => '<foo>', '#suffix' => '</foo>'); $container['test_element'] = $test_element; $expected_output = '<div><foo><bar>' . $context['bar'] . '</bar></foo></div>' . "\n"; // #cache disabled. drupal_static_reset('_drupal_add_js'); $element = $container; $output = drupal_render($element); $this->assertIdentical($output, $expected_output, 'Placeholder was replaced in output'); $settings = $this->parseDrupalSettings(drupal_get_js()); $this->assertIdentical($settings['common_test'], $context, '#attached is modified; JavaScript setting is added to page.'); // The cache system is turned off for POST requests. $request_method = \Drupal::request()->getMethod(); \Drupal::request()->setMethod('GET'); // GET request: #cache enabled, cache miss. drupal_static_reset('_drupal_add_js'); $element = $container; $element['#cache'] = array('cid' => 'render_cache_placeholder_test_GET'); $element['test_element']['#cache'] = array('cid' => 'render_cache_placeholder_test_child_GET'); // Simulate element rendering in a template, where sub-items of a renderable // can be sent to drupal_render() before the parent. $child =& $element['test_element']; $element['#children'] = drupal_render($child, TRUE); // Eventually, drupal_render() gets called on the root element. $output = drupal_render($element); $this->assertIdentical($output, $expected_output, 'Placeholder was replaced in output'); $this->assertTrue(isset($element['#printed']), 'No cache hit'); $this->assertIdentical($element['#markup'], $expected_output, 'Placeholder was replaced in #markup.'); $settings = $this->parseDrupalSettings(drupal_get_js()); $this->assertIdentical($settings['common_test'], $context, '#attached is modified; JavaScript setting is added to page.'); // GET request: validate cached data for child element. $child_tokens = $element['test_element']['#post_render_cache']['common_test_post_render_cache_placeholder'][0]['token']; $parent_tokens = $element['#post_render_cache']['common_test_post_render_cache_placeholder'][0]['token']; $expected_token = $child_tokens; $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_child_GET')); $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Parse unique token out of the cached markup. $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); $this->assertTrue($nodes->length, 'The token attribute was found in the cached child element markup'); $token = ''; if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical for the child element'); // Verify the token is in the cached element. $expected_element = array('#markup' => '<foo><drupal-render-cache-placeholder callback="common_test_post_render_cache_placeholder" token="' . $expected_token . '"></drupal-render-cache-placeholder></foo>', '#post_render_cache' => array('common_test_post_render_cache_placeholder' => array($context)), '#cache' => array('tags' => array('rendered' => TRUE))); $this->assertIdentical($cached_element, $expected_element, 'The correct data is cached for the child element: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.'); // GET request: validate cached data (for the parent/entire render array). $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_GET')); $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Parse unique token out of the cached markup. $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); $this->assertTrue($nodes->length, 'The token attribute was found in the cached parent element markup'); $token = ''; if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical for the parent element'); // Verify the token is in the cached element. $expected_element = array('#markup' => '<div><foo><drupal-render-cache-placeholder callback="common_test_post_render_cache_placeholder" token="' . $expected_token . '"></drupal-render-cache-placeholder></foo></div>' . "\n", '#post_render_cache' => array('common_test_post_render_cache_placeholder' => array($context)), '#cache' => array('tags' => array('rendered' => TRUE))); $this->assertIdentical($cached_element, $expected_element, 'The correct data is cached for the parent element: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.'); // GET request: validate cached data. // Check the cache of the child element again after the parent has been // rendered. $element = array('#cache' => array('cid' => 'render_cache_placeholder_test_child_GET')); $cached_element = \Drupal::cache('render')->get(drupal_render_cid_create($element))->data; // Verify that the child element contains the correct // render_cache_placeholder markup. $expected_token = $child_tokens; $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); $this->assertTrue($nodes->length, 'The token attribute was found in the cached child element markup'); $token = ''; if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical for the child element'); // Verify the token is in the cached element. $expected_element = array('#markup' => '<foo><drupal-render-cache-placeholder callback="common_test_post_render_cache_placeholder" token="' . $expected_token . '"></drupal-render-cache-placeholder></foo>', '#post_render_cache' => array('common_test_post_render_cache_placeholder' => array($context)), '#cache' => array('tags' => array('rendered' => TRUE))); $this->assertIdentical($cached_element, $expected_element, 'The correct data is cached for the child element: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.'); // GET request: #cache enabled, cache hit. drupal_static_reset('_drupal_add_js'); $element = $container; $element['#cache'] = array('cid' => 'render_cache_placeholder_test_GET'); // Simulate element rendering in a template, where sub-items of a renderable // can be sent to drupal_render before the parent. $child =& $element['test_element']; $element['#children'] = drupal_render($child, TRUE); $output = drupal_render($element); $this->assertIdentical($output, $expected_output, 'Placeholder was replaced in output'); $this->assertFalse(isset($element['#printed']), 'Cache hit'); $this->assertIdentical($element['#markup'], $expected_output, 'Placeholder was replaced in #markup.'); $settings = $this->parseDrupalSettings(drupal_get_js()); $this->assertIdentical($settings['common_test'], $context, '#attached is modified; JavaScript setting is added to page.'); // Restore the previous request method. \Drupal::request()->setMethod($request_method); }
function gavias_laikafood_process_html(&$vars) { $vars['head_scripts'] = drupal_get_js('head_scripts'); }
/** * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { $vars['tabs2'] = menu_secondary_local_tasks(); // Hook into color.module if (module_exists('color')) { _color_page_alter($vars); } // Construct page title if (drupal_get_title()) { $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal')); } else { $head_title = array(variable_get('site_name', 'Drupal')); if (variable_get('site_slogan', '')) { $head_title[] = variable_get('site_slogan', ''); } } $crumb = drupal_get_breadcrumb(); $c = count($crumb); if(strip_tags($crumb[3])=="Hadith") { unset($crumb[3]); } if(strip_tags($crumb[2])=="Hadith") { $val = arg(2); switch ($val) { case "SAD" : $a[$c-1] = "Abu-Dawood"; $crumb=array_merge($crumb,$a); break; case "AMH" : $a[$c-1] = "Al-Muwatta"; $crumb=array_merge($crumb,$a); break; case "HDQ" : $a[$c-1] = "Al-Qudsi"; $crumb=array_merge($crumb,$a); break; case "TIR" : $a[$c-1] = "Al-Tirmidhi"; $crumb=array_merge($crumb,$a); break; case "fiq" : $a[$c-1] = "Fiqh-us-Sunnah"; $crumb=array_merge($crumb,$a); break; case "SHB" : $a[$c-1] = "Sahih Al-Bukhari"; $crumb=array_merge($crumb,$a); break; case "SHM" : $a[$c-1] = "Sahih Muslim"; $crumb=array_merge($crumb,$a); break; } } if(arg(3)=='english') { $val = arg(5); switch ($val) { case "TLT" : $a[$c-1] = "Transliteration"; $crumb=array_merge($crumb,$a); break; } switch ($val) { case "ASD" : $a[$c-1] = "Asad Translation"; $crumb=array_merge($crumb,$a); break; } switch ($val) { case "MAL" : $a[$c-1] = "Malik Translation"; $crumb=array_merge($crumb,$a); break; } switch ($val) { case "PIK" : $a[$c-1] = "Pickthall Translation"; $crumb=array_merge($crumb,$a); break; } switch ($val) { case "YAT" : $a[$c-1] = "Yusuf Ali Translation"; $crumb=array_merge($crumb,$a); break; } } if(arg(3)=='introduction') { $val = arg(5); switch ($val) { case "MAL" : $a[$c-1] = "Malik Surah Introductions"; $crumb=array_merge($crumb,$a); break; } switch ($val) { case "QSI" : $a[$c-1] = "Maududi Surah Introductions"; $crumb=array_merge($crumb,$a); break; } } if(strip_tags($crumb[$c-1])=="Hadith Narrator Index") { unset($crumb[$c-1]); } if(arg(2)=='subject' && arg(3)!='ayah') { unset($crumb[$c-1]); } if(arg(2)=='duas' && arg(3)=='content') { unset($crumb[$c-1]); } if(strip_tags($crumb[$c-1])=="Fiqh-us-Sunnah") { unset($crumb[$c-1]); } if(arg(2)=='islamposters' && arg(3)=='content') { // unset($crumb[$c-1]); } if(arg(2)=='narrator') { unset($crumb[$c-1]); } if(arg(2)=='narrators') { unset($crumb[$c-1]); } if(arg(2)=='khalifa' && arg(3)=='content') { unset($crumb[$c-1]); } if(arg(2)=='companion' && arg(3)=='content') { unset($crumb[$c-1]); } if(arg(1)=='163607') { unset($crumb[$c-1]); } if($c > 1 ){ unset($crumb[0]); } $crumblast = strip_tags($crumb[$c-1]); if($crumblast != '' ){ if(@substr_count($head_title,$crumblast) > 0 ){ unset($crumb[$c-1]); } } $crumb = array_reverse($crumb); if (drupal_get_title()) { //unset($crumb[$c-1]); $newhead_tit = strip_tags(implode(' | ', $crumb )); if(count($head_title)>1) { $vars['head_title'] = $head_title[0].' | '.$head_title[1]; } else { $vars['head_title'] = $newhead_tit.' | '.$head_title[0]; } } else{ $newhead_tit = strip_tags(implode(' | ', $crumb )); if(count($head_title)>1) { $vars['head_title'] = $head_title[0].' | '.$newhead_tit.' | '.$head_title[1]; } else { $vars['head_title'] = $newhead_tit.' | '.$head_title[0]; } } if(arg(1)=='163647') { $vars['head_title'] = 'Widgets | Alim.org'; } if(arg(0)=='recentcomments') { $vars['head_title'] = 'Recent Comments | Alim.org'; } if(arg(1)=='163664') { $vars['head_title'] = 'Donate| Alim.org'; } if(arg(1)=='163663') { $vars['head_title'] = 'Donate | Alim.org'; } if(arg(1)=='scholarpage') { $vars['head_title'] = 'Advisers and Scholars Details | Our Advisers and Scholars | Alim.org'; } if(arg(2)=='our-advisers-and-scholars') { $vars['head_title'] = 'Submit Advisers and Scholars | Our Advisers and Scholars | Alim.org'; } if(arg(2)=='our-advisers-and-scholars') { unset($vars['title']); //drupal_set_title('Submit Advisers and Scholars') $vars['title'] = 'Submit Advisers and Scholars'; } # User Profile, alter the title directly by cheking each page URl if(arg(0)=='userprofile') { $vars['head_title'] = 'Profile | Alim.org'; } if(arg(0)=='node' && arg(2)=='edit') { unset($breadcrumb); $vars['head_title'] = 'Edit Group | Profile | Alim.org'; } if(arg(0)=='node' && arg(2)=='delete') { unset($breadcrumb); $vars['head_title'] = 'Delete Group | Profile | Alim.org'; } if(arg(0)=='searchusers') { $vars['head_title'] = 'Search Users | Profile | Alim.org'; } if(arg(0)=='searchgroups'){ $vars['head_title'] = 'Search Groups | Profile | Alim.org'; } if(arg(0)=='relationships'){ $vars['head_title'] = 'My Relationships | Profile | Alim.org'; } if(arg(1)=='create_admin') { $vars['head_title'] = 'Confirm Admin | Group Members | Manage Groups | Profile | Alim.org'; } if(arg(1)=='subscribe') { $vars['head_title'] = 'Join Group | Profile | Alim.org'; } if(arg(1)=='unsubscribe') { $vars['head_title'] = 'Leave Group | Profile | Alim.org'; } if(arg(1)=='delete_admin') { $vars['head_title'] = 'Remove Admin | Profile | Alim.org'; } if(arg(1)=='scholarpage') { $vars['head_title'] = 'Advisers and Scholars Details | Our Advisers and Scholars | Alim.org'; } if(arg(2)=='dictionary') { $vars['head_title'] = 'Islamic Terms Dictionary | References | Qur\'an & Hadith | Alim.org'; } if(arg(0)=='recent-group-posts'){ $vars['head_title'] = 'Recent Group Posts | Alim.org'; } if(arg(1)=='all-recent-tags') { $vars['head_title'] = 'Recent Tags | Alim.org'; } if(arg(1)=='clippings') { $vars['head_title'] = 'Home | My Notebook | Alim.org'; } if(arg(0) == 'bookmarks') { $vars['head_title'] = 'Home | Bookmarks | Alim.org'; } if(arg(0)=='relationships') { alim_removetab('All', $vars);} if(arg(0)=='user' && arg(2)=='edit') { $vars['head_title'] = 'Edit Profile | Alim.org'; alim_removetab('View', $vars); alim_removetab('Edit', $vars); alim_removetab('Notifications', $vars); alim_removetab('3rd party identities', $vars); } global $user; $arr_role = $user->roles; if(in_array("Developer", $arr_role)==FALSE && in_array("System Administrator", $arr_role)==FALSE) { if(arg(0)=='node' && arg(2)=='edit') { //alim_removetab('View', $vars); //alim_removetab('Edit', $vars); alim_removetab('Broadcast', $vars); } } if(arg(2)=='our-advisers-and-scholars') { $vars['head_title'] = 'Submit Advisers and Scholars | Our Advisers and Scholars | Alim.org'; } if(arg(1)==163997) { $vars['head_title'] = 'Alim Content Sources | References| Qur\'an & Hadith|Alim.org'; } if(arg(2)=='AlQuran-tafsir') { $vars['head_title'] = 'AlQuran-tafsir | Qur\'an & Hadith | Alim.org'; } // Remove the tabs from pages. alim_removetab('Your votes', $vars); alim_removetab('Twitter', $vars); alim_removetab('Bookmarks', $vars); alim_removetab('Preset Bookmarks', $vars); jquery_ui_add(array('ui.draggable', 'ui.dialog')); jquery_ui_add(array('ui.draggable')); drupal_add_js(drupal_get_path('module', 'alim_searchtags') .'/mybookmarkmenu.js'); if(arg(1)=='biography') { drupal_add_js(drupal_get_path('theme', 'alim') . '/scroll_menu/c_config.js'); drupal_add_js(drupal_get_path('theme', 'alim') . '/scroll_menu/c_smartmenus.js'); drupal_add_js(drupal_get_path('theme', 'alim') . '/scroll_menu/c_addon_scrolling.js'); } drupal_add_js(drupal_get_path('theme', 'alim') . '/crawler.js'); drupal_add_js(drupal_get_path('theme', 'alim') . '/galleryview/jquery.timers-1.2.js'); drupal_add_js(drupal_get_path('theme', 'alim') . '/galleryview/jquery.easing.1.3.js'); drupal_add_js(drupal_get_path('theme', 'alim') . '/dhtml_menu/animatedcollapse.js'); drupal_add_js(drupal_get_path('theme', 'alim') . '/hoverjq.js'); $vars['scripts'] = drupal_get_js(); drupal_add_css(drupal_get_path('theme', 'alim') . '/galleryview/galleryview.css'); drupal_add_css(drupal_get_path('theme', 'alim') . '/splash.css'); $vars['styles'] = drupal_get_css(); alim_removetab('Voting details', $vars); if (arg(0) == 'bookmarks') { $vars['tabs'] = str_replace('Add item</span></a>', 'Add folder</span></a>', $vars['tabs']); $vars['tabs'] = str_replace('List items</span></a>', 'Manage Bookmarks</span></a>', $vars['tabs']); } //alim_removetab('Voting details', $vars); //alim_removetab('Search Lucene', $vars); //if(arg(0) == 'search' ) //alim_removetab('Content', $vars); $vars['bookmark'] = bookmark(); }
function clash_zen_preprocess_html(&$vars) { // Set External CSS $external = array('scope' => 'header', 'type' => 'external'); drupal_add_css('http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic|Questrial', $external); //drupal_add_css('http://fonts.googleapis.com/css?family=Questrial',$external); $path = drupal_get_path('theme', 'clash_zen'); $options = array('scope' => 'header', 'preprocess' => true); drupal_add_js($path . '/js/modernizr.custom.81183.js', $options); drupal_add_js($path . '/js/jquery.masonry.min.js', $options); drupal_add_js($path . '/js/swfobject.js', $options); drupal_add_js($path . '/js/jquery.flexslider-min.js', $options); drupal_add_js($path . '/js/jquery.cycle.lite.js', $options); drupal_add_js($path . '/js/script.js', $options); $vars["scripts_head"] = drupal_get_js('header'); //$vars["scripts_end"] = drupal_get_js('scripts_end'); //Get adpage name $vars["ad_page"] = clash_zen_get_adpage(); // If title has backslash remove it if (strpos($vars['head_title'], '\\') !== false) { $vars['head_title'] = clash_zen_rewrite_title($vars['head_title'], true); } if ($vars['menu_item']['path'] === 'embed-feed') { //if embed feed page set title and add class to html tag to override with overflow:hidden $vars['head_title'] = 'Embed the Clash Feed' . $vars['head_title']; $vars['html_attributes_array']['class'] = array('in-iframe'); } // Get takeovers $takeover = clash_zen_get_takeovers(); if ($takeover) { $output_css = 'background-image:url(' . $takeover['image'] . ');'; if (!empty($takeover['background_colour'])) { $output_css .= 'background-color: #' . $takeover['background_colour'] . ';'; } $output_css = 'style="' . $output_css . '"'; $output_script = '<script> var clash_takeover_link = "' . $takeover['link'] . '";</script>'; $vars['classes_array'][] = 'clash-ad-takeover'; $vars['takeover_css'] = $output_css; $vars['takeover_script'] = $output_script; } //Google verification $google_webmasters_verification = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'google-site-verification', 'content' => 'IKrYr_iTjNJexiCDl0RTMV_BblM5G20UKP_0S6vimPY')); // Add Google Webmasters Verification Meta Tag to head drupal_add_html_head($google_webmasters_verification, 'google_webmasters_verification'); }
function phptemplate_maintenance_page($content, $messages = TRUE, $partial = FALSE) { drupal_set_header('Content-Type: text/html; charset=utf-8'); //drupal_set_html_head('<style type="text/css" media="all">@import "'. base_path() .'misc/maintenance.css";</style>'); drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . drupal_get_path('theme', 'newsflash') . '/maintenance.css";</style>'); drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . drupal_get_path('module', 'system') . '/defaults.css";</style>'); drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . drupal_get_path('module', 'system') . '/system.css";</style>'); //drupal_set_html_head('<style type="text/css" media="all">@import "'. base_path() . drupal_get_path('theme', 'newsflash') .'/style.css";</style>'); drupal_set_html_head('<link rel="shortcut icon" href="' . base_path() . 'misc/favicon.ico" type="image/x-icon" />'); $output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; $output .= '<html xmlns="http://www.w3.org/1999/xhtml">'; $output .= '<head>'; $output .= '<title>Tribute Media</title>'; $output .= drupal_get_html_head(); $output .= drupal_get_js(); $output .= '</head>'; $output .= '<body>'; $output .= '<div class="logo"><img src="' . drupal_get_path('theme', 'newsflash') . '/images/tribute_comingsoon.png" id="logo"/></div>'; //$output .= '<h1 id="title">' . drupal_get_title() . '</h1>'; if ($messages) { $output .= theme('status_messages'); } $output .= "\n<!-- begin content -->\n"; //$output .= $content; $output .= "\n<!-- end content -->\n"; if (!$partial) { $output .= '</body></html>'; } return $output; }
function yui_grid_preprocess_node(&$vars) { $vars['comments'] = ''; $vars['comments_form'] = ''; $vars['comments_control'] = ''; if (function_exists('comment_render') && !empty($vars['node']) && $vars['node']->comment) { $arg2 = arg(2); $vars['comments'] .= comment_display_comment_render_without_form($vars['node'], $arg2 && is_numeric($arg2) ? $arg2 : NULL); $vars['comments_form'] .= comment_display_comment_form_render($vars['node'], 'comment_form'); $vars['comments_controls'] .= comment_display_comment_form_render($vars['node'], 'comment_controls'); // Reconstruct CSS and JS variables. $vars['css'] = drupal_add_css(); $vars['styles'] = drupal_get_css(); $vars['scripts'] = drupal_get_js(); } }