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(); }
/** * Override theme_ting_search_form(). */ function kolding_ting_search_form($form) { jquery_ui_add('ui.dialog'); jquery_ui_theme_load(); drupal_add_js(drupal_get_path('theme', 'kolding') . '/js/selectmenu.js', 'module', 'footer', TRUE); $form['submit']['#type'] = "image_button"; $form['submit']['#src'] = drupal_get_path('theme', 'kolding') . "/images/search-btn.png"; $form['submit']['#attributes']['class'] = ""; return drupal_render($form); }
/** * 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 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'; } } }
<?php jquery_ui_add(array('ui.core', 'ui.tabs')); drupal_add_js(' $(function() { $("#course_tabs").tabs(); });', 'inline'); // Summer 2009, Autumn 2009, etc... $sessions = array_keys($all_schedule_data); ?> <div id="course_tabs"> <!-- Output the jquery ui tab menu --> <ul> <?php foreach ($sessions as $session) { ?> <li><a href="#<?php print preg_replace('/[^a-zA-Z0-9]/', '', $session); ?> "><?php print $session; ?> </a></li> <?php } ?> </ul> <!-- Output the jquery ui tab contents -->
<?php // $Id$ /** * Render funky slideshow thingie for frontpage. */ // We need jQuery UI tabs for this. jquery_ui_add('ui.tabs'); ?> <div id="featured"> <ul class="ui-tabs-nav"> <?php for ($i = 0; $i < 5; $i++) { if ($i == 0) { print '<li class="ui-tabs-nav-item ui-tabs-selected"><a href="#fragment-' . $i . ' ">' . $view->result[$i]->node_title . '</a></li>'; } else { print '<li class="ui-tabs-nav-item count-' . $i . '"><a href="#fragment-' . $i . ' ">' . $view->result[$i]->node_title . '</a></li>'; } } ?> </ul> <?php foreach ($rows as $id => $row) { ?> <div id="fragment-<?php print $id; ?> " class="ui-tabs-panel <?php if ($id >= "1") { print "ui-tabs-hide";
/** * Preprocessor for theme_block(). */ function ginkgo_preprocess_block(&$vars) { // If block is in a toggleable region and does not have a subject, mark it as a "widget," // i.e. show its contents rather than a toggle trigger label. if (in_array($vars['block']->region, array('header', 'page_tools', 'space_tools'))) { if (empty($vars['block']->subject)) { $vars['attr']['class'] .= ' block-widget'; } else { $vars['attr']['class'] .= ' block-toggle'; // Add invisible link element for toggling block via keyboard. $vars['title'] = l(t('Toggle'), $_GET['q'], array('fragment' => $vars['attr']['id'], 'attributes' => array('class' => 'toggle element-invisible'))) . $vars['title']; } } if ($vars['block']->region === 'palette') { // Palette region requires module-level jQuery UI, Cookie, JSON includes. // Note that drupal_add_js() only works here because blocks are rendered // prior to the retrieval of javascript files in template_preprocess_page(). module_exists('admin') ? drupal_add_js(drupal_get_path('module', 'admin') .'/includes/jquery.cookie.js') : ''; module_exists('jquery_ui') ? jquery_ui_add(array('ui.draggable')) : ''; module_exists('context_ui') ? drupal_add_js(drupal_get_path('module', 'context_ui') .'/json2.js') : ''; // Add close button to palette region blocks. $vars['title'] = "<span class='close'></span>{$vars['title']}"; } $vars['attr']['class'] .= empty($vars['block']->subject) ? ' block-notitle' : ''; }
/** * 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(); }
<?php // $Id: views-view-unformatted.tpl.php,v 1.6 2008/10/01 20:52:11 merlinofchaos Exp $ /** * @file views-view-unformatted.tpl.php * Default simple view template to display a list of rows. * * @ingroup views_templates */ jquery_ui_add(array('ui.tabs')); drupal_add_js(drupal_get_path('theme', 'bbcom_theme') . '/js/marketing-deck.js', 'theme'); //drupal_add_css(drupal_get_path('module', 'jquery_ui') .'/jquery.ui/themes/default/ui.all.css'); if (!empty($title)) { ?> <h3><?php print $title; ?> </h3> <?php } ?> <div class="tabs"> <ul class="tabNavigation clear-block"> <?php foreach ($rows as $id => $row) { ?> <li><a href="#tab-<?php print $id; ?> "><?php print $view->result[$id]->node_title;
<?php /** * This is a bunch of custom form code to show a much prettier story create form within the group * Extensive use of suggestions at: * http://drupal.org/node/601646 **/ // remove some other buttons unset($form['buttons']['preview']); // include the libraries for geocoding from the single address text input field drupal_set_html_head('<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>'); jquery_ui_add(array("jquery.ui.core", "jquery.ui.widget", "jquery.ui.position", "jquery.ui.autocomplete")); drupal_add_js(drupal_get_path('theme', 'cdh_juarez') . '/js/location-autocomplete.js'); ?> <div class="row cdhj-submit-form"> <div class="sixcol"> <?php print drupal_render($form['title']); ?> <?php print drupal_render($form['body_field']); ?> <div class="form-item"> <?php print drupal_render($form['field_image']); ?>
/** * Support for image_annotate on img_assist inserted images * */ function phptemplate_img_assist_inline($node, $size, $attributes) { $caption = ''; if ($attributes['title'] && $attributes['desc']) { $caption = '<strong>' . $attributes['title'] . ': </strong>' . $attributes['desc']; } elseif ($attributes['title']) { $caption = '<strong>' . $attributes['title'] . '</strong>'; } elseif ($attributes['desc']) { $caption = $attributes['desc']; } // Change the node title because img_assist_display() uses the node title for // alt and title. $node->title = strip_tags($caption); // -------------------------- if (user_access('view image annotations') || user_access('create image annotations') || user_access('administer image annotations')) { // Retrieve all the annotations for that image field // We sort by area (height*width) to make sure small annotations are always on the top and avoid having some unhoverable ones $result = db_query('SELECT i.*, c.uid, c.comment, u.name FROM {image_annotate} i INNER JOIN {comments} c ON i.cid = c.cid JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d ORDER BY (i.size_height*i.size_width) ASC', $node->nid); // Build the array of notes settings global $user; $notes = array(); while ($note = db_fetch_object($result)) { $editable = user_access('administer image annotations') || user_access('create image annotations') && $note->uid && $note->uid == $user->uid; $author = theme('username', $note); $text = check_plain($note->comment); // . '"<span class="author"> '. t('by') .' '. $author . '</span>'; // if (user_access('access comments')) { // $text .= '<span class="actions"> » '. l(t('View comment'), $_GET['q'], array('fragment'=>'comment-'. $note->cid)) .'</span>'; // } $notes[] = array('aid' => $note->aid, 'cid' => $note->cid, 'uid' => $note->uid, 'height' => $note->size_height, 'width' => $note->size_width, 'top' => $note->position_top, 'left' => $note->position_left, 'text' => $text, 'editable' => FALSE); } // Build the field settings $settings = array(array('nid' => $node->nid, 'field' => 'image', 'notes' => $notes, 'editable' => user_access('administer image annotations') || user_access('create image annotations'))); module_load_include('module', 'jquery_ui'); // Load all the JS and CSS magic drupal_add_js(array('imageAnnotate' => $settings), 'setting'); jquery_ui_add(array('ui.resizable', 'ui.draggable')); drupal_add_js('misc/collapse.js'); drupal_add_js(drupal_get_path('module', 'image_annotate') . '/tag.js'); drupal_add_css(drupal_get_path('module', 'image_annotate') . '/tag.css'); //BVDM 13/09/09: substitute image-annotate-image for image-annotate-nid-$node->nid to create a unique class per inserted image $class = 'imagefield imagefield-image image-annotate-nid-' . $node->nid; $img_tag = img_assist_display($node, $size, array('class' => $class)); } else { $img_tag = img_assist_display($node, $size); } // ----------------------- // Always define an alignment class, even if it is 'none'. $output = '<span class="inline inline-' . $attributes['align'] . '">'; $link = $attributes['link']; $url = ''; // Backwards compatibility: Also parse link/url in the format link=url,foo. if (strpos($link, ',') !== FALSE) { list($link, $url) = explode(',', $link, 2); } elseif (isset($attributes['url'])) { $url = $attributes['url']; } if ($link == 'node') { $output .= l($img_tag, 'node/' . $node->nid, array('html' => TRUE)); } elseif ($link == 'popup') { $popup_size = variable_get('img_assist_popup_label', IMAGE_PREVIEW); $info = image_get_info(file_create_path($node->images[$popup_size])); $width = $info['width']; $height = $info['height']; $popup_url = file_create_url($node->images[variable_get('img_assist_popup_label', IMAGE_PREVIEW)]); $output .= l($img_tag, $popup_url, array('attributes' => array('onclick' => "launch_popup({$node->nid}, {$width}, {$height}); return false;", 'target' => '_blank'), 'html' => TRUE)); } elseif ($link == 'url') { $output .= l($img_tag, $url, array('html' => TRUE)); } else { $output .= $img_tag; } if ($caption) { if ($attributes['align'] != 'center') { $info = image_get_info(file_create_path($node->images[$size['key']])); // Reduce the caption width slightly so the variable width of the text // doesn't ever exceed image width. $width = $info['width'] - 2; $output .= '<span class="caption" style="width: ' . $width . 'px;">' . $caption . '</span>'; } else { $output .= '<span class="caption">' . $caption . '</span>'; } } $output .= '</span>'; return $output; }
function os_poker_tos_page() { drupal_set_title(''); jquery_ui_add('ui.tabs'); return theme('os_poker_tos'); }