/** * Intercept node template variables * * @param $vars * A sequential array of variables passed to the theme function. */ function vozmob_white_label_preprocess_node(&$vars) { jquery_plugin_add('cycle', 'theme', 'header'); jquery_plugin_add('expose'); jquery_plugin_add('overlay'); drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/cycle.js', 'theme'); $node = $vars['node']; // for easy reference // for easy variable adding for different node types // jquery_plugin_add('jquery.sound'); // drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/jquery.sound.js', 'theme'); // Hackish way of adding video thumbnail into the node view. // This should get cleaned up (e.g. using CCK to render media mover video). $vars['overlay_launcher'] = FALSE; if (empty($node->field_image[0]['view']) && !empty($node->media_mover)) { foreach ($node->media_mover as $cid) { foreach ($cid as $mmfid) { if (substr($mmfid['complete_file'], -4, 4) == '.jpg') { $vars['overlay_launcher'] = TRUE; $vars['overlay_launcher_image'] = $mmfid['complete_file']; break 2; } } } } // Hackish way of adding audio overlay launcher into the node view. // This should get cleaned up (e.g. using CCK to render media mover audio). if (!$vars['overlay_launcher'] && empty($node->field_image[0]['view']) && !empty($node->media_mover)) { foreach ($node->media_mover as $cid) { foreach ($cid as $mmfid) { if (substr($mmfid['complete_file'], -4, 4) == '.mp3') { $vars['overlay_launcher'] = TRUE; $vars['overlay_launcher_image'] = drupal_get_path('theme', 'vozmob_white_label') . '/images/' . ($vars['teaser'] ? 'audio_icon_whitebg.gif' : 'audio_icon_large.gif'); break 2; } } } } // split term by vocabulary and format appropriatly $vocabulary = array(); foreach ($node->taxonomy as $tid => $term) { $vocabulary[$term->vid]['taxonomy_term_' . $term->tid] = array('tid' => $term->tid, 'name' => $term->name, 'title' => $term->name, 'href' => taxonomy_term_path($term), 'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)), 'path' => taxonomy_term_path($term)); } // tags $vars['terms'] = theme('links', $vocabulary[1], array('class' => 'links inline')); if (module_exists('uploadterm') && module_exists('taxonomy_image')) { // media terms $term_image_links = array(); foreach ($vocabulary[variable_get('uploadterm_vocabulary', 0)] as $term) { $term_image_links[] = l(taxonomy_image_display($term['tid']), $term['path'], array('html' => TRUE)); // can add size here } $vars['mediaterms'] = theme('item_list', $term_image_links, NULL, 'ul', array('class' => 'links inline media')); } switch ($node->type) { case 'page': break; // case 'slideshow': //add the sound plugin // jquery_plugin_add('jquery.sound'); // drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/jquery.sound.js', 'theme'); } }
* - $css_name: A css-safe version of the view name. * - $css_class: The user-specified classes names, if any * - $header: The view header * - $footer: The view footer * - $rows: The results of the view query, if any * - $empty: The empty text to display if the view is empty * - $pager: The pager next/prev links to display, if any * - $exposed: Exposed widget form/info to display * - $feed_icon: Feed icon to display, if any * - $more: A link to view more, if any * - $admin_links: A rendered list of administrative links * - $admin_links_raw: A list of administrative links suitable for theme('links') * * @ingroup views_templates */ jquery_plugin_add('cycle', 'theme', 'header'); drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/cycle.js', 'theme'); ?> <div class="<?php print $classes; ?> "> <?php if ($admin_links) { ?> <div class="views-admin-links views-hide"> <?php print $admin_links; ?> </div> <?php
/** * Intercept node template variables * * @param $vars * A sequential array of variables passed to the theme function. */ function phptemplate_preprocess_node(&$vars) { jquery_plugin_add('cycle', 'theme', 'header'); jquery_plugin_add('expose'); jquery_plugin_add('overlay'); drupal_add_js(drupal_get_path('theme', 'blueprint') . '/scripts/cycle.js', 'theme'); $node = $vars['node']; // for easy reference // for easy variable adding for different node types // jquery_plugin_add('jquery.sound'); // drupal_add_js(drupal_get_path('theme', 'blueprint') . '/scripts/jquery.sound.js', 'theme'); // Hackish way of adding video thumbnail into the node view. // This should get cleaned up (e.g. using CCK to render media mover video). $vars['overlay_launcher'] = FALSE; if (empty($node->field_image[0]['view']) && !empty($node->media_mover)) { foreach ($node->media_mover as $cid) { foreach ($cid as $mmfid) { if (substr($mmfid['complete_file'], -4, 4) == '.jpg') { $vars['overlay_launcher'] = TRUE; $vars['overlay_launcher_image'] = $mmfid['complete_file']; break 2; } } } } // Hackish way of adding audio overlay launcher into the node view. // This should get cleaned up (e.g. using CCK to render media mover audio). if (!$vars['overlay_launcher'] && empty($node->field_image[0]['view']) && !empty($node->media_mover)) { foreach ($node->media_mover as $cid) { foreach ($cid as $mmfid) { if (substr($mmfid['complete_file'], -4, 4) == '.mp3') { $vars['overlay_launcher'] = TRUE; $vars['overlay_launcher_image'] = drupal_get_path('theme', 'blueprint') . '/images/' . ($vars['teaser'] ? 'audio_icon_whitebg.gif' : 'audio_icon_large.gif'); break 2; } } } } switch ($node->type) { case 'page': break; // case 'slideshow': //add the sound plugin // jquery_plugin_add('jquery.sound'); // drupal_add_js(drupal_get_path('theme', 'blueprint') . '/scripts/jquery.sound.js', 'theme'); } }
/** * Intercept node template variables * * @param $vars * A sequential array of variables passed to the theme function. */ function phptemplate_preprocess_node(&$vars) { jquery_plugin_add('cycle'); drupal_add_js(drupal_get_path('theme', 'blueprint') . '/scripts/cycle.js', 'theme'); $node = $vars['node']; // for easy reference // for easy variable adding for different node types switch ($node->type) { case 'page': break; } }
<?php /** * @file views-view-list.tpl.php * Default simple view template to display a list of rows. * * - $title : The title of this group of rows. May be empty. * - $options['type'] will either be ul or ol. * @ingroup views_templates */ // Load jcycle plugin jquery_plugin_add('cycle', 'module', 'header'); drupal_add_js(drupal_get_path('module', 'vojo') . '/js/cycle.js', 'module'); print $wrapper_prefix; ?> <?php if (!empty($title)) { ?> <h3><?php print $title; ?> </h3> <?php } ?> <?php print $list_type_prefix; ?> <?php foreach ($rows as $id => $row) { ?>