예제 #1
0
/**
 * If something don't work well try this
 */
function themename_preprocess(&$vars, $hook)
{
    switch ($hook) {
        case 'node':
            $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
            break;
        case 'page':
            $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
            break;
    }
}
예제 #2
0
/**
 * @file
 * Example template.php for service_links.module
 * Use <?php print $service_links ?> to insert links in your node.tpl.php or you page.tpl.php file.
 */
function _phptemplate_variables($hook, $vars)
{
    switch ($hook) {
        case 'node':
        case 'page':
            if (module_exists('service_links')) {
                $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
            }
            break;
    }
    return $vars;
}
예제 #3
0
파일: template.php 프로젝트: alauzon/pf
/**
 * If something doesn't work well try this.
 */
function themename_preprocess(&$vars, $hook)
{
    switch ($hook) {
        case 'node':
            if (module_exists('service_links')) {
                if (user_access('access service links') && service_links_show($vars['node'])) {
                    $vars['twitter'] = theme('links', array('links' => array($vars['node']->service_links['service-links-twitter'])));
                }
            }
            break;
        case 'page':
            if (module_exists('service_links')) {
                if (user_access('access service links') && service_links_show($vars['node'])) {
                    $vars['service_links'] = theme('links', array('links' => service_links_render($vars['node'], TRUE)));
                }
            }
            break;
    }
}
예제 #4
0
/**
 * Implements hook_preprocess_page().
 */
function barnard_theme_preprocess_page(&$vars)
{
    // If we have bc_islandora and this is the front page, invoke
    // _bc_islandora_featured() and set  $vars['page']['footer']['front_caption'].
    if (module_exists('bc_islandora') && $vars['is_front']) {
        module_load_include('inc', 'bc_islandora', 'includes/bc_islandora.theme');
        $vars['page']['footer']['front_caption'] = array('#markup' => _bc_islandora_featured(), '#prefix' => '<div id="block-views-featured-block">', '#suffix' => '</div>');
    }
    // If we have bc_islandora, this is NOT the front page, and this is not a
    // search result page, call bc_islandora's custom breadcrumb theming method
    // and set $vars['bc_breadcrumb'].
    if (module_exists('bc_islandora') && !$vars['is_front'] && arg(1) != 'search') {
        $vars['bc_breadcrumb'] = theme('bc_islandora_breadcrumb', array('breadcrumb' => array()));
    }
    // If we have service_links, set $vars['socialmedia'].
    if (module_exists('service_links') && _service_links_match_path()) {
        $vars['socialmedia'] = implode('', service_links_render(NULL));
    }
    // If we have bc_islandora and this is an exhibit node, add our exhibit js
    // and css.
    if (module_exists('bc_islandora') && (isset($vars['node']) && $vars['node']->type == 'exhibition' || count(arg()) == 1 && arg(0) == 'exhibits')) {
        drupal_add_js(drupal_get_path('module', 'bc_islandora') . '/js/dc_exhibit.js');
        drupal_add_css(drupal_get_path('module', 'bc_islandora') . '/css/dc_exhibit.css');
    }
    if (arg(0) == 'islandora' && arg(1) == 'object') {
        drupal_add_js(array('permalink_path' => $_GET['q']), 'setting');
        drupal_add_js(drupal_get_path('theme', 'barnard_theme') . '/js/permalink.js');
    }
    if (arg(0) == 'islandora' && arg(1) == 'search') {
        drupal_add_js(drupal_get_path('theme', 'barnard_theme') . '/js/hide_datepicker.js');
    }
}
    print $field->element_type;
    ?>
 class="field-content"><?php 
    print $field->content;
    ?>
</<?php 
    print $field->element_type;
    ?>
>
  </<?php 
    print $field->inline_html;
    ?>
>

<?php 
}
?>

<div class="share_links">
  		<h3><?php 
print t('Share This:');
?>
</h3>
		<?php 
if (module_exists('service_links')) {
    print theme('links', service_links_render($row, TRUE));
}
?>
</div>

<div class="clearfix"></div>
예제 #6
0
/**
 * Override or insert variables into the node templates.
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("node" in this case.)
 */
function nys_preprocess_node(&$vars, $hook)
{
    $vars['senator'] = nyss_senator_node($vars['node']);
    if ($vars['senator']->field_senators_district[0]['nid']) {
        $vars['district'] = node_load($vars['senator']->field_senators_district[0]['nid']);
    }
    if (module_exists('service_links')) {
        $vars['service_links'] = theme('links', service_links_render($vars['node'], TRUE));
    }
    $vars['terms'] = nys_get_comma_tax_list($vars);
}
예제 #7
0
    print '<a href="/10-things-you-can-do">' . $mytitle . '</a>';
    ?>
</div>
  <?php 
    if ($user->uid) {
        ?>
    <div class="ab-fivestar"><?php 
        print $node->content['fivestar_widget']['#value'];
        ?>
</div>
  <?php 
    }
    ?>
  <div class="ab-service"><?php 
    print "Bookmark/Search this post:<br>";
    foreach (service_links_render($node, $nodelink = FALSE) as $slink) {
        print $slink;
    }
    print '&nbsp;';
    ?>
</div>
  </div >
  </div>
  </div>
  
  <?php 
}
// if (!$page ....
?>

</div>