Exemplo n.º 1
0
/**
* Catch the theme_user_profile function, and redirect through the template api
*/
function phptemplate_user_profile($user, $fields = array())
{
    // Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
    // will be assigned within your template.
    /* potential need for other code to extract field info */
    return _phptemplate_callback('user_profile', array('account' => $user, 'fields' => $fields));
}
Exemplo n.º 2
0
function phptemplate_search_block_form($form)
{
    /**
     * This snippet catches the default searchbox and looks for
     * search-block-form.tpl.php file in the same folder
     * which has the new layout.
     */
    return _phptemplate_callback('search-block-form', array('form' => $form));
}
Exemplo n.º 3
0
function phptemplate_field(&$node, &$field, &$items, $teaser, $page)
{
    $field_empty = TRUE;
    foreach ($items as $delta => $item) {
        if (!empty($item['view']) || $item['view'] === "0") {
            $field_empty = FALSE;
            break;
        }
    }
    $variables = array('node' => $node, 'field' => $field, 'field_type' => $field['type'], 'field_name' => $field['field_name'], 'field_type_css' => strtr($field['type'], '_', '-'), 'field_name_css' => strtr($field['field_name'], '_', '-'), 'label' => t($field['widget']['label']), 'label_display' => isset($field['display_settings']['label']['format']) ? $field['display_settings']['label']['format'] : 'above', 'field_empty' => $field_empty, 'items' => $items, 'teaser' => $teaser, 'page' => $page);
    return _phptemplate_callback('field', $variables, array('field-' . $field['field_name']));
}
Exemplo n.º 4
0
/**
 * views template to output a view.
 * This code was generated by the views theming wizard
 * Date: Tue, 05/27/2008 - 17:53
 * View: front_features
 *
 * This function goes in your template.php file
 */
function phptemplate_views_view_list_front_features($view, $nodes, $type)
{
    $fields = _views_get_fields();
    $taken = array();
    // Set up the fields in nicely named chunks.
    foreach ($view->field as $id => $field) {
        $field_name = $field['field'];
        if (isset($taken[$field_name])) {
            $field_name = $field['queryname'];
        }
        $taken[$field_name] = true;
        $field_names[$id] = $field_name;
    }
    // Set up some variables that won't change.
    $base_vars = array('view' => $view, 'view_type' => $type);
    foreach ($nodes as $i => $node) {
        $vars = $base_vars;
        $vars['node'] = $node;
        $vars['count'] = $i;
        $vars['stripe'] = $i % 2 ? 'even' : 'odd';
        $vars['position'] = '';
        foreach ($view->field as $id => $field) {
            $name = $field_names[$id];
            $vars[$name] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            if (isset($field['label'])) {
                $vars[$name . '_label'] = $field['label'];
            }
        }
        if ($i > 0) {
            $output .= '<div class="panel-separator"></div>';
        }
        $output .= _phptemplate_callback('views-list-front_features', $vars);
    }
    return $output;
}
Exemplo n.º 5
0
<?php

if ($node->type == 'page') {
    $title = $print["title"];
    $body = _phptemplate_callback('node-page', array('node' => $node));
}
if ($node->type == 'news') {
    $title = $print["title"];
    $date = $node->field_date[0]['view'];
    $body = $date . $node->content['body']['#value'];
} else {
    $title = $print["title"];
    $body = $node->body;
}
if (!$title) {
    $title = drupal_get_title();
}
?>
<!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 $print["language"];
?>
" xml:lang="<?php 
print $print["language"];
?>
">
  <head>
    <title><?php 
print $print["title"];
?>
</title>
Exemplo n.º 6
0
/**
 * Allow themable wrapping of all comments.
 */
function phptemplate_comment_wrapper($content, $type = null, $n = null)
{
    static $node_type;
    static $node;
    if (isset($type)) {
        $node_type = $type;
    }
    if (isset($n)) {
        $node = $n;
    }
    if ($node_type == 'forum' && module_exists('advanced_forum')) {
        $variables = array();
        $variables['node'] = $node;
        $variables['content'] = $content;
        advanced_forum_preprocess_comment_wrapper($variables);
        $forum_style = advanced_forum_get_current_style();
        return _phptemplate_callback('advf-comment-wrapper', $variables, array("{$forum_style}/advf-comment-wrapper"));
    }
    if (!$content || $node_type == 'forum') {
        return '<div id="comments">' . $content . '</div>';
    } else {
        return '<div id="comments"><h2 class="comments">' . t('Comments') . '</h2>' . $content . '</div>';
    }
}
Exemplo n.º 7
0
function phptemplate_maintenance_page($message)
{
    return _phptemplate_callback('offline', array('message' => $message, 'site_name' => variable_get('site_name', '')));
}
Exemplo n.º 8
0
/**
 * views template to output a view.
 * This code was generated by the views theming wizard
 * Date: Thu, 08/16/2007 - 3:44am
 * View: BibleStudyList
 *
 * This function goes in your template.php file
 */
function phptemplate_views_view_list_BibleStudyList($view, $nodes, $type)
{
    $fields = _views_get_fields();
    $taken = array();
    // Set up the fields in nicely named chunks.
    foreach ($view->field as $id => $field) {
        $field_name = $field['field'];
        if (isset($taken[$field_name])) {
            $field_name = $field['queryname'];
        }
        $taken[$field_name] = true;
        $field_names[$id] = $field_name;
    }
    // Set up some variables that won't change.
    $base_vars = array('view' => $view, 'view_type' => $type);
    foreach ($nodes as $i => $node) {
        $vars = $base_vars;
        $vars['node'] = $node;
        $vars['count'] = $i;
        $vars['stripe'] = $i % 2 ? 'even' : 'odd';
        foreach ($view->field as $id => $field) {
            $name = $field_names[$id];
            $vars[$name] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            if (isset($field['label'])) {
                $vars[$name . '_label'] = $field['label'];
            }
        }
        $items[] = _phptemplate_callback('views-list-BibleStudyList', $vars);
    }
    if ($items) {
        return theme('item_list', $items);
    }
}
Exemplo n.º 9
0
function phptemplate_jsdoc_object_children($children)
{
    return _phptemplate_callback('jsdoc_object_children', array('children' => $children));
}
Exemplo n.º 10
0
function phptemplate_user_register($form)
{
    return _phptemplate_callback('user_register', array('form' => $form));
}