예제 #1
0
파일: template.php 프로젝트: TechBK/noname
function forum_plus_preprocess_page(&$vars)
{
    global $theme_key;
    $vars['page_css'] = '';
    $vars['regions_width'] = forum_plus_regions_width($vars['page']);
    $panel_regions = forum_plus_panel_regions();
    if (count($panel_regions)) {
        foreach ($panel_regions as $panel_name => $panels_list) {
            $panel_markup = theme("render_panel", array('page' => $vars['page'], 'panels_list' => $panels_list, 'regions_width' => $vars['regions_width']));
            $panel_markup = trim($panel_markup);
            $vars['page'][$panel_name] = empty($panel_markup) ? FALSE : array('content' => array('#markup' => $panel_markup));
        }
    }
    if (isset($vars['node']) && $vars['node']->type != 'page' && !in_array('page__node__delete', $vars['theme_hook_suggestions'])) {
        $result = db_select('node_type', NULL, array('fetch' => PDO::FETCH_ASSOC))->fields('node_type', array('name'))->condition('type', $vars['node']->type)->execute()->fetchField();
        $vars['title'] = $result;
    }
    $current_skin = theme_get_setting('skin');
    if (isset($_COOKIE['weebpal_skin'])) {
        $current_skin = $_COOKIE['weebpal_skin'];
    }
    $layout_width = theme_get_setting('layout_width') == '' ? theme_get_setting('layout_width_default') : theme_get_setting('layout_width');
    $vars['page']['show_skins_menu'] = $show_skins_menu = theme_get_setting('show_skins_menu');
    if ($show_skins_menu) {
        $current_layout = theme_get_setting('layout');
        if (isset($_COOKIE['weebpal_layout'])) {
            $current_layout = $_COOKIE['weebpal_layout'];
        }
        if ($current_layout == 'layout-boxed') {
            $vars['page_css'] = 'style="max-width:' . $layout_width . 'px;margin: 0 auto;" class="boxed"';
        }
        $data = array('layout_width' => $layout_width, 'current_layout' => $current_layout);
        $skins_menu = theme_render_template(drupal_get_path('theme', 'forum_plus') . '/tpl/skins-menu.tpl.php', $data);
        $vars['page']['show_skins_menu'] = $skins_menu;
    }
    $vars['page']['weebpal_skin_classes'] = !empty($current_skin) ? $current_skin . "-skin" : "";
    if (!empty($current_skin) && $current_skin != 'default' && theme_get_setting("default_logo") && theme_get_setting("toggle_logo")) {
        $vars['logo'] = file_create_url(drupal_get_path('theme', $theme_key)) . "/css/colors/" . $current_skin . "/images/logo.png";
    }
    ////////
    $skin = theme_get_setting('skin');
    if (isset($_COOKIE['weebpal_skin'])) {
        $skin = $_COOKIE['weebpal_skin'] == 'default' ? '' : $_COOKIE['weebpal_skin'];
    }
    if (!empty($skin) && file_exists(drupal_get_path('theme', $theme_key) . "/css/colors/" . $skin . "/style.css")) {
        $css = drupal_add_css(drupal_get_path('theme', $theme_key) . "/css/colors/" . $skin . "/style.css", array('group' => CSS_THEME));
    }
}
예제 #2
0
function business_preprocess_page(&$vars)
{
    global $theme_key;
    $vars['page_css'] = '';
    $vars['regions_width'] = business_regions_width($vars['page']);
    $panel_regions = business_panel_regions();
    if (count($panel_regions)) {
        foreach ($panel_regions as $panel_name => $panels_list) {
            $panel_markup = theme("render_panel", array('page' => $vars['page'], 'panels_list' => $panels_list, 'regions_width' => $vars['regions_width']));
            $panel_markup = trim($panel_markup);
            $vars[$panel_name] = empty($panel_markup) ? FALSE : $panel_markup;
        }
    }
    $current_skin = theme_get_setting('skin');
    if (isset($_COOKIE['weebpal_skin'])) {
        $current_skin = $_COOKIE['weebpal_skin'];
    }
    $layout_width = theme_get_setting('layout_width') == '' ? theme_get_setting('layout_width_default') : theme_get_setting('layout_width');
    $vars['page']['show_skins_menu'] = $show_skins_menu = theme_get_setting('show_skins_menu');
    if ($show_skins_menu) {
        $current_layout = theme_get_setting('layout');
        if (isset($_COOKIE['weebpal_layout'])) {
            $current_layout = $_COOKIE['weebpal_layout'];
        }
        if ($current_layout == 'layout-boxed') {
            $vars['page_css'] = 'style="max-width:' . $layout_width . 'px;margin: 0 auto;" class="boxed"';
        }
        $data = array('layout_width' => $layout_width, 'current_layout' => $current_layout);
        $skins_menu = theme_render_template(drupal_get_path('theme', 'business') . '/tpl/skins-menu.tpl.php', $data);
        $vars['page']['show_skins_menu'] = $skins_menu;
    }
    $vars['page']['weebpal_skin_classes'] = !empty($current_skin) ? $current_skin . "-skin" : "";
    if (!empty($current_skin) && $current_skin != 'default' && theme_get_setting("default_logo") && theme_get_setting("toggle_logo")) {
        $vars['logo'] = file_create_url(drupal_get_path('theme', $theme_key)) . "/css/colors/" . $current_skin . "/images/logo.png";
    }
    $skin = theme_get_setting('skin');
    if (isset($_COOKIE['weebpal_skin'])) {
        $skin = $_COOKIE['weebpal_skin'] == 'default' ? '' : $_COOKIE['weebpal_skin'];
    }
    if (!empty($skin) && file_exists(drupal_get_path('theme', $theme_key) . "/css/colors/" . $skin . "/style.css")) {
        drupal_add_css(drupal_get_path('theme', $theme_key) . "/css/colors/" . $skin . "/style.css", array('group' => CSS_THEME));
    }
}
예제 #3
0
파일: index.php 프로젝트: haxelsson/emoncms
// Primary Menu
//----------------------------------------------------------------
$variables['menu'] = "";
if ($_SESSION['valid']) {
    $variables['menu'] .= "<a href='" . $systempath . "home'>Home</a> | <a href='" . $systempath . "feed/view'>Feeds</a>";
}
if (!$_SESSION['valid']) {
    $variables['menu'] .= "<a href='" . $systempath . "home'>Home</a>";
}
//----------------------------------------------------------------
// 6) Content wrapper
//----------------------------------------------------------------
$variables['userbox'] = $userbox;
$variables['path'] = $systempath;
//These variables will be passed to the theme to be wrapped...
print theme_render_template("theme/theme.php", $variables);
//and pass it here!
//This function is a direct copy from drupal's theme.inc script
function theme_render_template($template_file, $variables)
{
    extract($variables, EXTR_SKIP);
    // Extract the variables to a local namespace
    ob_start();
    // Start output buffering
    include "{$template_file}";
    // Include the template file
    $contents = ob_get_contents();
    // Get the contents of the buffer
    ob_end_clean();
    // End buffering and discard
    return $contents;
            <div id="management-main" class="clearfix">

                <div id="management-content">

                    <div class="device-section">

                        <?php 
echo theme_render_template(path_to_theme() . '/templates/widget--accordion.tpl.php', ['items' => $accordion_items, 'footer' => '<div class="scan-for-device action button">Scan For Devices</div>']);
?>

                    </div>

                    <div class="workspace-section">

                        <?php 
echo theme_render_template(path_to_theme() . '/templates/widget--manage-devices.tpl.php', ['devices' => $devices, 'user' => $user]);
?>

                    </div>

                </div>
                <!-- /.section, /#content -->

            </div>

        </div>
        <!-- /#main, /#main-wrapper -->

    </div>
    <!-- /.section, /#footer-wrapper -->
                                $events[] = $node;
                            } else {
                                $elements[] = $node;
                            }
                        }
                    }
                }
            }
        }
        $languages = osha_language_list();
        usort($languages, function ($a, $b) {
            return strcmp($a->name, $b->name);
        });
        print theme_render_template($module_templates_path . '/newsletter_header.tpl.php', array('languages' => $languages, 'newsletter_title' => $newsletter_title, 'newsletter_id' => $newsletter_id, 'newsletter_date' => $newsletter_date));
        print theme_render_template($module_templates_path . '/newsletter_body.tpl.php', array('items' => $elements, 'blogs' => $blogs, 'news' => $news, 'events' => $events));
        print theme_render_template($module_templates_path . '/newsletter_footer.tpl.php', array());
    }
} else {
    ?>
  <div class="<?php 
    print $classes;
    ?>
">
    <?php 
    print render($title_prefix);
    ?>
    <?php 
    if ($show_title) {
        ?>
      <h2><?php 
        print $title;
  <?php 
if ($page == 0) {
    ?>
    <h2><a href="<?php 
    print $node_url;
    ?>
" title="<?php 
    print $title;
    ?>
"><?php 
    print $title;
    ?>
</a></h2>
  <?php 
}
?>

    <?php 
print $node->content['body']['#value'];
?>
    
    <?php 
print views_embed_view('product_category', 'page_1');
?>
 
    <?php 
print theme_render_template('/sites/all/themes/gfscanada/two_exhibits_partial.tpl.php', array('node_with_two_exhibits' => $node));
?>
  </div>
</div>
                            $news[] = $node;
                        } else {
                            if ($last_section == 'Events') {
                                $events[] = $node;
                            } else {
                                $elements[] = $node;
                            }
                        }
                    }
                }
            }
        }
        $languages = osha_language_list(TRUE);
        print theme_render_template($module_templates_path . '/newsletter_header.tpl.php', array('languages' => $languages, 'newsletter_title' => $newsletter_title, 'newsletter_id' => $newsletter_id, 'newsletter_date' => $newsletter_date, 'campaign_id' => $campaign_id));
        print theme_render_template($module_templates_path . '/newsletter_body.tpl.php', array('items' => $elements, 'blogs' => $blogs, 'news' => $news, 'events' => $events, 'campaign_id' => $campaign_id));
        print theme_render_template($module_templates_path . '/newsletter_footer.tpl.php', array('campaign_id' => $campaign_id));
    }
} else {
    ?>
  <div class="<?php 
    print $classes;
    ?>
">
    <?php 
    print render($title_prefix);
    ?>
    <?php 
    if ($show_title) {
        ?>
      <h2><?php 
        print $title;
예제 #8
0
        <?php 
    }
    ?>
      </div>
      <?php 
}
?>
    </div>
  </div>
</div><!-- End Nav -->

</header><!-- End of The Header -->

<main>
<?php 
print theme_render_template(path_to_theme() . '/templates/partials/slider-revolution.tpl.php', $variables = array());
?>
<section id="eventos">
<div class="container">
<?php 
//print render($page['content']);
?>
</div>
</section>
</main>

<footer>
  <div class="container">
    <div class='row'>
      <?php 
print render($page['footer']);
예제 #9
0
function get_exhibit_html($exhibit_node, $use_small_image = false)
{
    return theme_render_template('/sites/all/themes/gfscanada/exhibit_partial.tpl.php', array('exhibit_node' => $exhibit_node, 'use_small_image' => $use_small_image));
}
if (!$status) {
    print ' node-unpublished';
}
?>
">
  <?php 
print $picture;
?>

<?php 
if ($page == 0) {
    ?>
  <h2><a href="<?php 
    print $node_url;
    ?>
" title="<?php 
    print $title;
    ?>
"><?php 
    print $title;
    ?>
</a></h2>
<?php 
}
?>

  <?php 
print theme_render_template('/sites/all/themes/gfscanada/news_and_events_partial.tpl.php', array('node' => $node, 'taxonomy' => $taxonomy, 'terms' => $terms));
?>

</div>
예제 #11
-1
function marketplace_preprocess_page(&$vars)
{
    global $theme_key;
    $vars['page_css'] = '';
    $vars['regions_width'] = marketplace_regions_width($vars['page']);
    $panel_regions = marketplace_panel_regions();
    if (count($panel_regions)) {
        foreach ($panel_regions as $panel_name => $panels_list) {
            $panel_markup = theme("render_panel", array('page' => $vars['page'], 'panels_list' => $panels_list, 'regions_width' => $vars['regions_width']));
            $panel_markup = trim($panel_markup);
            $vars['page'][$panel_name] = empty($panel_markup) ? FALSE : array('content' => array('#markup' => $panel_markup));
        }
    }
    $current_skin = theme_get_setting('skin');
    if (isset($_COOKIE['weebpal_skin'])) {
        $current_skin = $_COOKIE['weebpal_skin'];
    }
    $layout_width = theme_get_setting('layout_width') == '' ? theme_get_setting('layout_width_default') : theme_get_setting('layout_width');
    $vars['page']['show_skins_menu'] = $show_skins_menu = theme_get_setting('show_skins_menu');
    if ($show_skins_menu) {
        $current_layout = theme_get_setting('layout');
        if (isset($_COOKIE['weebpal_layout'])) {
            $current_layout = $_COOKIE['weebpal_layout'];
        }
        if ($current_layout == 'layout-boxed') {
            $vars['page_css'] = 'style="max-width:' . $layout_width . 'px;margin: 0 auto;" class="boxed"';
        }
        $data = array('layout_width' => $layout_width, 'current_layout' => $current_layout);
        $skins_menu = theme_render_template(drupal_get_path('theme', 'marketplace') . '/tpl/skins-menu.tpl.php', $data);
        $vars['page']['show_skins_menu'] = $skins_menu;
    }
    $vars['page']['weebpal_skin_classes'] = !empty($current_skin) ? $current_skin . "-skin" : "";
    if (!empty($current_skin) && $current_skin != 'default' && theme_get_setting("default_logo") && theme_get_setting("toggle_logo")) {
        $vars['logo'] = file_create_url(drupal_get_path('theme', $theme_key)) . "/css/colors/" . $current_skin . "/images/logo.png";
    }
    //////////////////////////////////////
    $skin = theme_get_setting('skin');
    if (isset($_COOKIE['weebpal_skin'])) {
        $skin = $_COOKIE['weebpal_skin'] == 'default' ? '' : $_COOKIE['weebpal_skin'];
    }
    if (!empty($skin)) {
        $pathfile = drupal_get_path('theme', $theme_key) . "/css/colors/" . $skin . "/style.css";
        if (file_exists($pathfile)) {
            drupal_add_css($pathfile, array('group' => CSS_THEME));
        }
    }
    drupal_add_css('http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800', array('group' => CSS_SYSTEM, 'weight' => -10, 'type' => 'external'));
}