Permalink
Browse files

updated files, fixed code according to Drupal Coding Standards

  • Loading branch information...
1 parent 1a6d89e commit bcce35bf3369188c701423e67aa1209cdf889d2e @level09 committed Sep 15, 2011
Showing with 78 additions and 37 deletions.
  1. +12 −5 banner.php
  2. +7 −0 block.tpl.php
  3. +7 −0 head.php
  4. +10 −1 node.tpl.php
  5. +10 −3 page.tpl.php
  6. +14 −10 template.php
  7. +18 −18 x09.info
View
@@ -1,11 +1,18 @@
+<?php
+/**
+ * @file banner.php
+ * Banner of the theme (slideshow) : reads images from the banners directory
+ *
+ */
+?>
<div id="bannerwrap">
<div id="banner" class="container">
- <?php
+<?php
if(isset($banner)) {
- foreach ($banner as $img) {
- echo theme('image',path_to_theme() .'/images/banners/' .$img,'','');
- }
+ foreach ($banner as $img) {
+ echo theme('image', path_to_theme() . '/images/banners/' . $img, '', '');
+ }
}
- ?>
+?>
</div>
</div>
View
@@ -1,3 +1,10 @@
+<?php
+/**
+ * @file block.tpl.php
+ * Standard Drupal Block template
+ *
+ */
+?>
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">
<?php if (!empty($block->subject)): ?>
View
@@ -1,3 +1,10 @@
+<?php
+/**
+ * @file head.php
+ * HTML HEAD - for reuse on page-x.tpl.php templates
+ *
+ */
+?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
View
@@ -1,4 +1,13 @@
-<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">
+<?php
+/**
+ * @file node.tpl.php
+ * Standard Drupal Node template
+ *
+ */
+?>
+<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) {
+ print ' sticky'; } ?><?php if (!$status) {
+ print ' node-unpublished'; } ?> clear-block">
<?php print $picture ?>
View
@@ -1,3 +1,10 @@
+<?php
+/**
+ * @file Page.tpl.php
+ * Main page template
+ *
+ */
+?>
<?php include_once('head.php'); ?>
<body class="<?php echo $body_classes; ?>">
<div id="topstrip"></div>
@@ -11,8 +18,7 @@
<a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a>
<?php }
-
- ?>
+?>
</div>
<div id="nav">
<?php echo menu_tree($menu_name='primary-links'); ?>
@@ -27,7 +33,8 @@
<div id="main" class="span-15 column">
<div class="main-pad">
<?php echo $content_top; ?>
- <?php if($breadcrumb) print $breadcrumb; ?>
+ <?php if ($breadcrumb)
+print $breadcrumb; ?>
<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?>
<?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
<?php if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif; ?>
View
@@ -1,8 +1,12 @@
<?php
+/**
+ * @file template.php
+ * Do some preprocessing here
+ *
+ */
+?>
-
-
-
+<?php
function x09_preprocess_node(&$vars, $hook) {
@@ -12,24 +16,24 @@ function x09_preprocess_node(&$vars, $hook) {
}
function x09_preprocess_page(&$variables) {
-$variables['banner'] = listImages(path_to_theme() .'/images/banners');
+$variables['banner'] = list_images(path_to_theme() .'/images/banners');
}
-function listImages($dirname=".") {
+function list_images($dirname=".") {
$ext = array("jpg", "png", "jpeg", "gif");
$files = array();
- if($handle = opendir($dirname)) {
- while(false !== ($file = readdir($handle)))
- for($i=0;$i<sizeof($ext);$i++)
- if(strstr($file, ".".$ext[$i]))
+ if ($handle = opendir($dirname)) {
+ while (false !== ($file = readdir($handle)))
+ for ($i=0;$i<sizeof($ext);$i++)
+ if (strstr($file, "." . $ext[$i]))
$files[] = $file;
closedir($handle);
}
- return($files);
+ return ($files);
}
View
@@ -1,25 +1,25 @@
-name = X09 Theme
+name = "X09 Theme"
description = X09 Theme, by <a href='http://www.level09.net'>Level09 Technologies</a>
-core = 6.x
-version = 6.x-1.0
-engine = phptemplate
+core = "6.x"
+version = "6.x-1.0"
+engine = "phptemplate"
-regions[left] = Left sidebar
-regions[right] = Right sidebar
-regions[banner_left] = Banner Left
-regions[content_top] = Content Top
-regions[content] = Content
-regions[header] = Header
-regions[footer] = Footer
+regions["left"] = Left sidebar
+regions["right"] = Right sidebar
+regions["banner_left"] = Banner Left
+regions["content_top"] = Content Top
+regions["content"] = Content
+regions["header"] = Header
+regions["footer"] = Footer
-stylesheets[print][] = blueprint/print.css
-stylesheets[all][] = blueprint/screen.css
-stylesheets[all][] = blueprint/plugins/fancy-type/screen.css
-stylesheets[all][] = style.css
-conditional-stylesheets[if IE][all][] = blueprint/ie.css
+stylesheets["print"][] = "blueprint/print.css"
+stylesheets["all"][] = "blueprint/screen.css"
+stylesheets["all"][] = "blueprint/plugins/fancy-type/screen.css"
+stylesheets["all"][] = "style.css"
+conditional-stylesheets["if IE"]["all"][] = "blueprint/ie.css"
-scripts[] = js/jquery.cycle.lite.min.js
-scripts[] = js/script.js
+scripts[] = "js/jquery.cycle.lite.min.js"
+scripts[] = "js/script.js"

0 comments on commit bcce35b

Please sign in to comment.