/[drupal]/contributions/themes/yui-framework/template.php
ViewVC logotype

Contents of /contributions/themes/yui-framework/template.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Fri Apr 11 09:03:30 2008 UTC (19 months, 2 weeks ago) by xavierbriand
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
création
1 <?php
2 // $Id$
3 ?>
4 <?php
5 /**
6 * Drupal 5.7 Yahoo: UI Framework - Created Xavier Briand
7 * From Drupal 5.7 Framework - Created Andre Griffin
8 * Template.php
9 */
10
11 /**
12 * Sets the page width according to YUI specification
13 *
14 * http://developer.yahoo.com/yui/examples/grids/grids-doc.html
15 */
16 function phptemplate_page_width() {
17 echo 'doc'; //750px width, centered
18 //echo 'doc2'; //950px width, centered
19 //echo 'doc3'; //100% width
20 //echo 'doc4'; //974px width, centered
21 }
22
23
24 /**
25 * Sets the page template
26 *
27 * Source-Order Independence for SEO
28 */
29 function phptemplate_page_template($sidebar_left, $sidebar_right) {
30 $template = '';
31
32 switch( true ) {
33 case $sidebar_left != '' && $sidebar_right == '' :
34 $template = 'yui-t1'; //160px
35 //$template = 'yui-t2'; //180px
36 //$template = 'yui-t3'; //300px
37 break;
38 case $sidebar_right != '' :
39 //$template = 'yui-t4'; //180px
40 $template = 'yui-t5'; //240px
41 //$template = 'yui-t6'; //300px
42 break;
43 }
44
45 echo $template;
46 }
47
48 /**
49 * Return a themed breadcrumb trail.
50 *
51 * @param $breadcrumb
52 * An array containing the breadcrumb links.
53 * @return a string containing the breadcrumb output.
54 */
55 function phptemplate_breadcrumb($breadcrumb) {
56 if (!empty($breadcrumb)) {
57 return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
58 }
59 }
60
61 /**
62 * Allow themable wrapping of all comments.
63 */
64 function phptemplate_comment_wrapper($content, $type = null) {
65 static $node_type;
66 if (isset($type)) $node_type = $type;
67
68 if (!$content || $node_type == 'forum') {
69 return '<div id="comments">'. $content . '</div>';
70 }
71 else {
72 return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
73 }
74 }
75
76 /**
77 * Override or insert PHPTemplate variables into the templates.
78 */
79 function _phptemplate_variables($hook, $vars) {
80 if ($hook == 'page') {
81
82 if ($secondary = menu_secondary_local_tasks()) {
83 $output = '<span class="clear"></span>';
84 $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
85 $vars['tabs2'] = $output;
86 }
87
88 // Hook into color.module
89 if (module_exists('color')) {
90 _color_page_alter($vars);
91 }
92 return $vars;
93 }
94 return array();
95 }
96
97 /**
98 * Returns the rendered local tasks. The default implementation renders
99 * them as tabs.
100 *
101 * @ingroup themeable
102 */
103 function phptemplate_menu_local_tasks() {
104 $output = '';
105
106 if ($primary = menu_primary_local_tasks()) {
107 $output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
108 }
109
110 return $output;
111 }

  ViewVC Help
Powered by ViewVC 1.1.2