/[drupal]/contributions/themes/Plain1/page.tpl.php
ViewVC logotype

Contents of /contributions/themes/Plain1/page.tpl.php

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


Revision 1.5 - (show annotations) (download) (as text)
Mon Mar 20 10:28:55 2006 UTC (3 years, 8 months ago) by robonoob
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-4-6
Changes since 1.4: +0 -0 lines
File MIME type: text/x-php
# update the cvs version to drupal-4-6 branch
1 <?php
2 /**
3 * This snippet correct Doctype for Firefox/Opera and XML complient browser
4 */
5 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")){
6 // header("Content-Type: application/xhtml+xml; charset=UTF-8");
7 // print('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
8 header("Content-Type: text/html; charset=UTF-8");
9 print('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
10 }
11 else {
12 header("Content-Type: text/html; charset=UTF-8");
13 print('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
14 }
15 /**
16 * This snippet creates a <body> class and id for each page.
17 *
18 * - Class names are general, applying to a whole section of documents (e.g. admin or ).
19 * - Id names are unique, applying to a single page.
20 */
21 // Remove any leading and trailing slashes.
22 $uri_path = trim($_SERVER['REQUEST_URI'], '/');
23 // Split up the remaining URI into an array, using '/' as delimiter.
24 $uri_parts = explode('/', $uri_path);
25 // If the first part is empty, label both id and class 'main'.
26 if ($uri_parts[0] == '') {
27 $body_id = 'main';
28 $body_class = 'main';
29 }
30 else {
31 // Construct the id name from the full URI, replacing slashes with dashes.
32 $body_id = str_replace('/','-', $uri_path);
33 // Construct the class name from the first part of the URI only.
34 $body_class = $uri_parts[0];
35 }
36 /**
37 * Add prefixes to create a kind of protective namepace to prevent possible
38 * conflict with other css selectors.
39 *
40 * - Prefix body ids with "page-"(since we use them to target a specific page).
41 * - Prefix body classes with "section-"(since we use them to target a whole sections).
42 */
43 $body_id = 'page-'.$body_id;
44 $body_class = 'section-'.$body_class;
45 ?>
46 <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?> ">
47 <head>
48 <title>
49 <?php print $title ?>
50 </title>
51 <!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
52 <script type="text/javascript"></script>
53 <meta http-equiv="Content-Style-Type" content="text/css" />
54 <?php print $head ?>
55 <?php print $styles ?>
56 </head>
57 <body <?php
58 print "class=\"$body_class sb-$layout\" id=\"$body_id\"";
59 print theme("onload_attribute"); ?>
60 >
61 <div id="top-nav">
62 <?php if (is_array($primary_links)) : ?>
63 <?php $i=0; ?>
64 <ul id="primary">
65 <?php foreach ($primary_links as $link): ?>
66 <?php $i=$i+1; ?>
67 <?php if ($i==count($primary_links)) print ('<li class="last">');
68 else print ('<li>');
69 ?>
70 <?php print $link?></li>
71 <?php endforeach; ?>
72 </ul>
73 <?php endif; ?>
74 <?php if (is_array($secondary_links)) : ?>
75 <ul id="secondary">
76 <?php foreach ($secondary_links as $link): ?>
77 <li>
78 <?php print $link?></li>
79 <?php endforeach; ?>
80 </ul>
81 <?php endif; ?>
82 </div>
83 <div id="page_wrapper">
84 <div id="header">
85 <?php if ($logo) : ?>
86 <div id="sitelogo">
87 <a href="<?php print url() ?>" title="Index Page">
88 <img src="<?php print($logo) ?>" alt="Logo" /></a>
89 </div>
90 <?php endif; ?>
91 <?php if ($search_box): ?>
92 <div id="search">
93 <form action="<?php print url("search") ?>" method="post">
94 <input class="form-text" type="text" size="15" value="" name="keys" />
95 <input class="form-submit" type="submit" value="<?php print t("Search")?>" />
96 </form>
97 </div>
98 <?php endif; ?>
99 <?php if ($site_name) : ?>
100 <h1 id="site-name">
101 <a href="<?php print url() ?>" title="Index Page">
102 <?php print($site_name) ?></a></h1>
103 <?php endif;?>
104 <?php if ($site_slogan) : ?>
105 <div id="site-slogan">
106 <?php print($site_slogan) ?>
107 </div>
108 <?php endif;?>
109 <?php $mission = theme_get_setting('mission', false); ?>
110 <?php if ($mission != ""): ?>
111 <p id="mission">
112 <?php print $mission ?>
113 </p>
114 <?php endif; ?>
115 <br class="clear" />
116 </div>
117 <div id="wrapper">
118 <?php if ($sidebar_left != ""): ?>
119 <div id="sidebar-left">
120 <?php print $sidebar_left ?>
121 </div>
122 <?php endif; ?>
123 <div id="main-content" class="content <?php echo $layout;?>">
124 <div class="w1"><div class="w2"><div class="w3"><div class="w4">
125 <?php if ($breadcrumb != ""): ?>
126 <?php print $breadcrumb ?>
127 <?php endif; ?>
128 <?php if ($title != ""): ?>
129 <h2 class="content-title">
130 <?php print $title ?></h2>
131 <?php endif; ?>
132 <?php if ($tabs != ""): ?>
133 <?php print $tabs ?>
134 <?php endif; ?>
135 <?php if ($help != ""): ?>
136 <p id="help">
137 <?php print $help ?>
138 </p>
139 <?php endif; ?>
140 <?php if ($messages != ""): ?>
141 <div id="message">
142 <?php print $messages ?>
143 </div>
144 <?php endif; ?>
145 <!-- start main content -->
146 <?php print($content) ?>
147 <br />
148 <!-- end main content -->
149 </div></div></div></div>
150 </div>
151 <?php if ($sidebar_right != ""): ?>
152 <div id="sidebar-right">
153 <?php print $sidebar_right ?>
154 </div>
155 <?php endif; ?>
156 </div>
157 </div>
158 <div id="footer">
159 <div class="w1">
160 <div class="w2">
161 <?php if ($footer_message) : ?>
162 <p>
163 <?php print $footer_message;?>
164 </p>
165 <?php endif; ?>
166 <!-- <p>
167 design <a title="OSWD design work" href="http://oswd.org/userinfo.phtml?user=snop">snop</a> + photo <a title="stock.xchng" href="http://www.sxc.hu/browse.phtml?f=profile&amp;l=plasticboy&amp;p=1">plasticboy</a> = valid <a title="validate XHTML" href="http://validator.w3.org/check?uri=referer">XHTML</a> &amp; <a title="validate CSS" href="http://jigsaw.w3.org/css-validator">CSS</a>
168 </p>
169 -->
170 </div>
171 </div>
172 </div>
173 <!-- footer -->
174 <?php print $closure;?>
175 </body>
176 </html>

  ViewVC Help
Powered by ViewVC 1.1.2