summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshivcharan Patil2013-08-18 22:27:34 +0530
committershivcharan Patil2013-08-18 22:27:34 +0530
commit45082f2d18caed998302dd337fa3b1c89efb71dd (patch)
treee3858505307b64180bea645079d9d8edab23e621
parent3f32e500e2fd4db105f5120e8832d2cfda0a73b8 (diff)
Initial commit for 7.x branch
-rw-r--r--README.txt5
-rw-r--r--beach.info15
-rw-r--r--block.tpl.php10
-rw-r--r--comment.tpl.php48
-rw-r--r--node.tpl.php50
-rw-r--r--page-node.tpl.php185
-rw-r--r--page.tpl.php125
-rw-r--r--template.php370
-rw-r--r--theme-settings.php85
9 files changed, 53 insertions, 840 deletions
diff --git a/README.txt b/README.txt
index 9d0279d..8795551 100644
--- a/README.txt
+++ b/README.txt
@@ -5,10 +5,13 @@ Drupal Beach Theme
Project page : http://drupal.org/project/beach
Provider : Drupal Thailand (http://drupal.in.th/)
+ + India
+ May be we call Indothai community.
Maintainers : (Trible "S")
1. Sugree Phatanapherom (http://sugree.com/)
2. Suksit Sripitchayaphan (http://suksit.com/)
- 3. Sungsit Sawaiwan (http://webzer.net/)
+ 3. Sungsit Sawaiwan (http://webzer.net/)
+ 4. Shivcharan Patil (http://itapplication.net)
Using Beach Theme Settings
diff --git a/beach.info b/beach.info
index 3102998..97e8794 100644
--- a/beach.info
+++ b/beach.info
@@ -1,19 +1,22 @@
name = Beach
description = Drupal On The Beach.
-version = VERSION
-core = 6.x
-engine = phptemplate
+
+core = 7.x
screenshot = images/screenshot.png
-regions[left] = Left sidebar
-regions[right] = Right sidebar
+regions[sidebar_first] = Left sidebar
+regions[sidebar_second] = Right sidebar
+regions[highlighted] = Highlighted
regions[content_top] = Top Content
+regions[content] = Content
regions[content_bottom] = Bottom Content
regions[footer_1] = Footer Block 1
regions[footer_2] = Footer Block 2
regions[footer_3] = Footer Block 3
regions[footer_4] = Footer Block 4
+regions[page_top] = Page top
+regions[page_bottom] = Page bottom
features[] = logo
features[] = name
@@ -39,4 +42,4 @@ stylesheets[all][] = css/beach.css
; Add a stylesheet for print media
;stylesheets[print][] = css/print.css
-; scripts[] = yourscript.js \ No newline at end of file
+; scripts[] = yourscript.js
diff --git a/block.tpl.php b/block.tpl.php
deleted file mode 100644
index d148131..0000000
--- a/block.tpl.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-?><div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?> clear-block">
-<?php if ($block->subject): ?>
- <h2 class="block-title"><?php print $block->subject ?></h2>
-<?php endif;?>
-
- <div class="content clear-block">
- <?php print $block->content ?>
- </div>
-</div> \ No newline at end of file
diff --git a/comment.tpl.php b/comment.tpl.php
deleted file mode 100644
index 6ad928b..0000000
--- a/comment.tpl.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-?><div class="comment<?php print(isset($comment->status) && $comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; ?> <?php print comment_classes($comment) .' '. $zebra ?> clear-block">
-
- <div class="comment-info">
-
- <?php if ($submitted): ?>
- <?php if ($picture): ?><?php print $picture ?><?php endif; ?>
-
- <span class="username"><strong><?php print t('By ') ?><?php print theme('username', $comment); ?></strong></span>
- <?php endif; ?>
-
- <div class="meta">
- <span class="date">
- <?php print t('!date ago', array( '!date' => format_interval(time() - $comment->timestamp))); ?>
- </span>
- <?php if ($comment->new) : ?>
- <a id="new"></a>
- <span class="new"><?php print drupal_ucfirst($new) ?></span>
- <?php endif; ?>
- </div>
-
- </div> <!--/comment-info-->
-
- <div class="comment-content">
-
- <div class="permalink">
- <?php print l('#'. $comment->cid, 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)); ?>
- </div>
-
- <?php if ($title): ?><h3 class="title"><?php print $title; ?></h3><?php endif; ?>
-
- <?php print $content ?>
-
- <?php if ($links): ?>
- <div class="links">
- <?php print $links ?>
- </div>
- <?php endif; ?>
-
- <?php if ($signature): ?>
- <div class="user-signature clear-block">
- <?php print $signature ?>
- </div>
- <?php endif; ?>
-
- </div> <!--/comment-content-->
-
-</div>
diff --git a/node.tpl.php b/node.tpl.php
deleted file mode 100644
index e9e6e47..0000000
--- a/node.tpl.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-?><div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">
-
- <?php if (!$page && $submitted): ?>
- <div class="post-info">
-
- <?php if ($teaser || $preview): ?>
- <span class="post-date"><?php print (format_date($node->created, 'custom', 'F d, Y')) ?></span>
- <span class="node-author"><?php print t('By ') ?><?php print $name ?></span>
- <?php endif; ?>
-
- <?php if($comment_count && $teaser): ?>
- <span class="commment-count"><a rel="nofollow" href="<?php print $node_url ?>#comment-number" title="<?php print t('Comment on ') ?><?php print $title?>"><?php print $comment_count.' '. format_plural($node->comment_count, 'comment', 'comments') ?></a></span>
- <?php endif; ?>
- </div> <!--/post-info-->
- <?php endif; ?>
-
- <?php if (!$page): ?>
- <h2 class="node-title">
- <a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a>
- </h2>
- <?php endif; ?>
-
- <?php if (!$teaser && !$preview): ?>
- <h1 class="title"><?php print $title ?></h1>
- <?php if ($submitted): ?>
- <div class="node-info">
- <span class="node-author"><strong><?php print t('By ') ?><?php print $name ?></strong></span>
- <span class="post-date"><?php print (format_date($node->created, 'custom', 'F d, Y')) ?></span>
- </div>
- <?php if ($picture): ?><?php print $picture ?><?php endif; ?>
- <?php endif; ?>
- <?php endif; ?>
-
-
- <div class="content clear-block"><?php print $content ?></div>
-
- <?php if ($teaser && $readmore): ?>
- <p class="node-more clear-block"><a class="node-more" href="<?php print $node_url ?>" title="<?php print t('More on ').$title ?>"><?php print t('More') ?></a></p>
- <?php endif;?>
-
- <?php if ($terms): ?><div class="terms" title="<?php print t('Terms') ?>"><?php print $terms ?></div><?php endif;?>
-
- <?php if (!$teaser && $links): ?>
- <div class="node-links">
- <?php print $links; ?>
- </div>
- <?php endif; ?>
-
-</div> \ No newline at end of file
diff --git a/page-node.tpl.php b/page-node.tpl.php
deleted file mode 100644
index 1d70f13..0000000
--- a/page-node.tpl.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-?><!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" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
-
- <head>
-
- <title><?php print $head_title ?></title>
- <meta http-equiv="content-language" content="<?php print $language->language ?>" />
- <?php print $meta; ?>
- <?php print $head ?>
- <?php print $styles ?>
- <?php print $scripts ?>
-
- <!--[if IE 7]>
- <link type="text/css" rel="stylesheet" media="all" href="<?php print $base_path . $directory ?>/css/ie7.css" />
- <![endif]-->
-
- <!--[if lte IE 6]>
- <link type="text/css" rel="stylesheet" media="all" href="<?php print $base_path . $directory ?>/css/ie6.css" />
- <![endif]-->
-
- <?php if (theme_get_setting('iepngfix')) : ?>
- <!--[if lte IE 6]>
- <script type="text/javascript">
- $(document).ready(function(){
- $(document).pngFix();
- });
- </script>
- <![endif]-->
- <?php endif; ?>
-
- </head>
-
- <body class="<?php print $body_classes ?>">
-
- <?php print $nav_access ?>
-
- <div id="top-wrapper" class="clear-block">
- <div id="header" class="section <?php print $container_class ?>">
-
- <div id="branding" class="clear-block">
- <?php if ($logo): ?>
- <a href="<?php print check_url($front_page) ?>" title="<?php print t('Home') ?>"><img id="logo" src="<?php print $logo ?>" alt="<?php print t('Site Logo')?>" /></a>
- <?php endif; ?>
-
- <?php if ($site_name): ?>
- <h1 id="<?php print $sitename_id ?>">
- <a href="<?php print check_url($front_page) ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a>
- </h1>
- <?php endif; ?>
-
- <?php if ($site_slogan): ?>
- <p id="slogan"><?php print $site_slogan ?></p>
- <?php endif; ?>
- </div> <!-- /branding -->
-
- <?php if (!empty($primary_menu)): ?>
- <div id="primary-menu">
- <h3 class="hidden">Primary Menu</h3>
- <?php print $primary_menu; ?>
- </div>
- <?php endif; ?>
-
- </div>
- </div> <!--/top-wrapper-->
-
- <div id="middle-wrapper" class="clear-block">
- <div id="middle-inner" class="clear-block">
- <div class="section <?php print $container_class ?> clear-block">
-
- <?php if (($feed_icons) || !empty($secondary_menu) || ($search_box)): ?>
- <div id="menu-bar" class="clear-block">
-
- <?php print $search_box ?>
-
- <?php if (!empty($secondary_menu)): ?>
- <h3 class="hidden">Secondary Menu</h3>
- <?php print $secondary_menu; ?>
- <?php endif; ?>
-
- <?php print $feed_icons ?>
-
- </div>
- <?php endif; ?>
-
- <div id="main-content" class="column">
- <div class="content-inner clear-block">
-
- <?php if ($breadcrumb): ?><div class="top-breadcrumb clear-block"><?php print $breadcrumb; ?></div><?php endif; ?>
-
- <?php if ($mission): ?>
- <div id="mission"><?php print $mission ?></div>
- <?php endif; ?>
-
- <?php if ($content_top): ?>
- <div id="top-content-block" class="content-block clear-block">
- <?php print $content_top ?>
- </div>
- <?php endif; ?>
-
- <?php if (!empty($messages)): ?><?php print $messages ?><?php endif; ?>
-
- <?php if (!empty($help)): ?><?php print $help ?><?php endif; ?>
-
- <?php if (!empty($tabs)): ?><?php print $tabs ?><?php endif; ?>
-
- <?php print $content ?>
-
-<?php if ($links): ?><div class="node-links"><?php print $links; ?></div><?php endif; ?>
-
- <?php if ($content_bottom): ?>
- <div id="bottom-content-block" class="content-block clear-block">
- <?php print $content_bottom ?>
- </div>
- <?php endif; ?>
-
- <?php if ($breadcrumb): ?><div class="bottom-breadcrumb clear-block"><?php print $breadcrumb; ?></div><?php endif; ?>
-
- </div>
- </div>
-
- <?php if ($left): ?>
- <div id="sidebar-left" class="column sidebar">
- <?php print $left ?>
- </div>
- <?php endif; ?>
-
- <?php if ($right): ?>
- <div id="sidebar-right" class="column sidebar">
- <?php print $right ?>
- </div>
- <?php endif; ?>
-
- </div>
- </div> <!--/middle-inner-->
- </div> <!--/middle-wrapper-->
-
-
- <div id="bottom-wrapper" class="clear-block">
- <div id="footer" class="section <?php print $container_class ?>">
-
- <?php if ($footer_column_count !== 0): ?>
- <div class="wrap-<?php print $footer_column_count ?>-col column-wrapper clear-block">
-
- <?php if ($footer_1): ?>
- <div class="footer-column">
- <?php print $footer_1 ?>
- </div>
- <?php endif; ?>
-
- <?php if ($footer_2): ?>
- <div class="footer-column<?php print $column2_is_last ?>">
- <?php print $footer_2 ?>
- </div>
- <?php endif; ?>
-
- <?php if ($footer_3): ?>
- <div class="footer-column<?php print $column3_is_last ?>">
- <?php print $footer_3 ?>
- </div>
- <?php endif; ?>
-
- <?php if ($footer_4): ?>
- <div class="footer-column<?php print $column4_is_last ?>">
- <?php print $footer_4 ?>
- </div>
- <?php endif; ?>
-
- </div> <!-- /footer-column-wrap -->
- <?php endif; ?>
-
- <div id="credit-wrap" class="clear-block">
- <?php if ($footer_message): ?>
- <p id="site-info"><?php print $footer_message ?></p>
- <?php endif; ?>
-
- <?php print $to_top ?>
-
- <?php print $closure ?>
- </div> <!--/credit-wrap-->
- </div>
- </div> <!--/bottom-wrapper-->
-
- </body>
-</html> \ No newline at end of file
diff --git a/page.tpl.php b/page.tpl.php
index 8da817d..2db47e6 100644
--- a/page.tpl.php
+++ b/page.tpl.php
@@ -1,42 +1,13 @@
<?php
-?><!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" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
-
- <head>
-
- <title><?php print $head_title ?></title>
- <meta http-equiv="content-language" content="<?php print $language->language ?>" />
- <?php print $meta; ?>
- <?php print $head ?>
- <?php print $styles ?>
- <?php print $scripts ?>
-
- <!--[if IE 7]>
- <link type="text/css" rel="stylesheet" media="all" href="<?php print $base_path . $directory ?>/css/ie7.css" />
- <![endif]-->
-
- <!--[if lte IE 6]>
- <link type="text/css" rel="stylesheet" media="all" href="<?php print $base_path . $directory ?>/css/ie6.css" />
- <![endif]-->
-
- <?php if (theme_get_setting('iepngfix')) : ?>
- <!--[if lte IE 6]>
- <script type="text/javascript">
- $(document).ready(function(){
- $(document).pngFix();
- });
- </script>
- <![endif]-->
- <?php endif; ?>
-
- </head>
-
- <body class="<?php print $body_classes ?>">
- <?php print $nav_access ?>
+/**
+ * @file
+ * Default theme implementation to display a single Drupal page.
+ */
+?>
<div id="top-wrapper" class="clear-block">
- <div id="header" class="section <?php print $container_class ?>">
+ <div id="header" class="section <?php print $attributes ?>">
<div id="branding" class="clear-block">
<?php if ($logo): ?>
@@ -44,7 +15,7 @@
<?php endif; ?>
<?php if ($site_name): ?>
- <h1 id="<?php print $sitename_id ?>">
+ <h1 id="site-name">
<a href="<?php print check_url($front_page) ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a>
</h1>
<?php endif; ?>
@@ -54,28 +25,26 @@
<?php endif; ?>
</div> <!-- /branding -->
- <?php if (!empty($primary_menu)): ?>
- <div id="primary-menu">
- <h3 class="hidden">Primary Menu</h3>
- <?php print $primary_menu; ?>
- </div>
- <?php endif; ?>
+ <?php if ($main_menu): ?>
+ <div id="navigation"><div class="section">
+ <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Main menu'))); ?>
+ </div></div> <!-- /.section, /#navigation -->
+ <?php endif; ?>
</div>
</div> <!--/top-wrapper-->
<div id="middle-wrapper" class="clear-block">
<div id="middle-inner" class="clear-block">
- <div class="section <?php print $container_class ?> clear-block">
+ <div class="section <?php print $attributes ?> clear-block">
- <?php if (($feed_icons) || !empty($secondary_menu) || ($search_box)): ?>
+ <?php if (($feed_icons) || !empty($secondary_menu)): ?>
<div id="menu-bar" class="clear-block">
- <?php print $search_box ?>
<?php if (!empty($secondary_menu)): ?>
<h3 class="hidden">Secondary Menu</h3>
- <?php print $secondary_menu; ?>
+ <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Secondary menu'))); ?>
<?php endif; ?>
<?php print $feed_icons ?>
@@ -88,31 +57,26 @@
<?php if ($breadcrumb): ?><div class="top-breadcrumb clear-block"><?php print $breadcrumb; ?></div><?php endif; ?>
- <?php if ($mission): ?>
- <div id="mission"><?php print $mission ?></div>
- <?php endif; ?>
+ <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
- <?php if ($content_top): ?>
+ <?php if ($page['content_top']): ?>
<div id="top-content-block" class="content-block clear-block">
- <?php print $content_top ?>
+ <?php print render($page['content_top']); ?>
</div>
<?php endif; ?>
- <?php if ($title): ?>
- <h1 class="title"><?php print $title ?></h1>
- <?php endif; ?>
-
- <?php if (!empty($messages)): ?><?php print $messages ?><?php endif; ?>
-
- <?php if (!empty($help)): ?><?php print $help ?><?php endif; ?>
+ <?php print render($title_prefix); ?>
+ <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
+ <?php print render($title_suffix); ?>
+ <?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
+ <?php print render($page['help']); ?>
+ <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
+ <?php print render($page['content']); ?>
+ <?php print $feed_icons; ?>
- <?php if (!empty($tabs)): ?><?php print $tabs ?><?php endif; ?>
-
- <?php print $content ?>
-
- <?php if ($content_bottom): ?>
+ <?php if ($page['content_bottom']): ?>
<div id="bottom-content-block" class="content-block clear-block">
- <?php print $content_bottom ?>
+ <?php print render($page['content_bottom']) ?>
</div>
<?php endif; ?>
@@ -121,17 +85,17 @@
</div>
</div>
- <?php if ($left): ?>
- <div id="sidebar-left" class="column sidebar">
- <?php print $left ?>
- </div>
- <?php endif; ?>
+ <?php if ($page['sidebar_first']): ?>
+ <div id="sidebar-left" class="column sidebar"><div class="section">
+ <?php print render($page['sidebar_first']); ?>
+ </div></div> <!-- /.section, /#sidebar-first -->
+ <?php endif; ?>
- <?php if ($right): ?>
- <div id="sidebar-right" class="column sidebar">
- <?php print $right ?>
- </div>
- <?php endif; ?>
+ <?php if ($page['sidebar_second']): ?>
+ <div id="sidebar-right" class="column sidebar"><div class="section">
+ <?php print render($page['sidebar_second']); ?>
+ </div></div> <!-- /.section, /#sidebar-second -->
+ <?php endif; ?>
</div>
</div> <!--/middle-inner-->
@@ -139,7 +103,7 @@
<div id="bottom-wrapper" class="clear-block">
- <div id="footer" class="section <?php print $container_class ?>">
+ <div id="footer" class="section <?php print $attributes ?>">
<?php if ($footer_column_count !== 0): ?>
<div class="wrap-<?php print $footer_column_count ?>-col column-wrapper clear-block">
@@ -172,16 +136,7 @@
<?php endif; ?>
<div id="credit-wrap" class="clear-block">
- <?php if ($footer_message): ?>
- <p id="site-info"><?php print $footer_message ?></p>
- <?php endif; ?>
-
- <?php print $closure ?>
-
- <?php print $to_top ?>
+ <?php print render($page['footer']); ?>
</div> <!--/credit-wrap-->
</div>
</div> <!--/bottom-wrapper-->
-
- </body>
-</html> \ No newline at end of file
diff --git a/template.php b/template.php
deleted file mode 100644
index 1f47448..0000000
--- a/template.php
+++ /dev/null
@@ -1,370 +0,0 @@
-<?php
-
-/**
- * Force refresh of theme registry.
- * DEVELOPMENT USE ONLY - COMMENT OUT FOR PRODUCTION
- */
-// drupal_rebuild_theme_registry();
-
-/**
- * Initialize theme settings
- */
-if (is_null(theme_get_setting('container_class'))) {
- global $theme_key;
- // Save default theme settings
- $defaults = array(
- 'container_class' => 'medium',
- 'iepngfix' => 1,
- 'custom' => 0,
- 'breadcrumb' => 0,
- 'totop' => 0,
- );
-
- variable_set(
- str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
- array_merge(theme_get_settings($theme_key), $defaults)
- );
- // Force refresh of Drupal internals
- theme_get_setting('', TRUE);
-}
-
-function phptemplate_preprocess(&$vars, $hook) {
- global $theme;
-
- // Set Page Class
- $vars['container_class'] = theme_get_setting('container_class');
-
- // Hide breadcrumb on all pages
- if (theme_get_setting('breadcrumb') == 0) {
- $vars['breadcrumb'] = '';
- }
-
- // Theme primary and secondary links.
- $vars['primary_menu'] = theme('links', $vars['primary_links']);
- $vars['secondary_menu'] = theme('links', $vars['secondary_links']);
-
- // Set Accessibility nav bar
- if ($vars['primary_menu'] != '') {
- $vars['nav_access'] = '
- <ul id="nav-access" class="hidden">
- <li><a href="#primary-menu" accesskey="N" title="'.t('Skip to Primary Menu').'">'. t('Skip to Primary Menu') .'</a></li>
- <li><a href="#main-content" accesskey="M" title="'.t('Skip to Main Content').'">'.t('Skip to Main Content').'</a></li>
- </ul>
- ';
- }
- else {
- $vars['nav_access'] = '
- <ul id="nav-access" class="hidden">
- <li><a href="#main-content" accesskey="M" title="'.t('Skip to Main Content').'">'.t('Skip to Main Content').'</a></li>
- </ul>
- ';
- }
-
- // SEO optimization, add in the node's teaser, or if on the homepage, the mission statement
- // as a description of the page that appears in search engines
- // (Code sample from Blueprint theme.)
- $vars['meta'] = '';
-
- if ($vars['is_front'] && $vars['mission'] != '') {
- $vars['meta'] .= '<meta name="description" content="'. trim_text($vars['mission']) .'" />'."\n";
- }
- else if (isset($vars['node']->teaser) && $vars['node']->teaser != '') {
- $vars['meta'] .= '<meta name="description" content="'. trim_text($vars['node']->teaser) .'" />'."\n";
- }
- else if (isset($vars['node']->body) && $vars['node']->body != '') {
- $vars['meta'] .= '<meta name="description" content="'. trim_text($vars['node']->body) .'" />'."\n";
- }
- // SEO optimization, if the node has tags, use these as keywords for the page
- if (isset($vars['node']->taxonomy)) {
- $keywords = array();
- foreach ($vars['node']->taxonomy as $term) {
- $keywords[] = $term->name;
- }
- $vars['meta'] .= '<meta name="keywords" content="'. implode(',', $keywords) .'" />'."\n";
- }
-
- // SEO optimization, avoid duplicate titles in search indexes for pager pages
- if (isset($_GET['page']) || isset($_GET['sort'])) {
- $vars['meta'] .= '<meta name="robots" content="noindex,follow" />'. "\n";
- }
-
- /* Embed the Google search in various places, uncomment to make use of this
- // setup search for custom placement
- $search = module_invoke('google_cse', 'block', 'view', '0');
- $vars['search'] = $search['content'];
- */
-
- // Make sure framework styles are placed above all others.
- if ($vars['css']) {
- $vars['css_alt'] = css_rearrange($vars['css']);
- $vars['styles'] = drupal_get_css($vars['css_alt']);
- }
-
- // Change sitename text style to be look like site logo if there's no logo.
- $vars['sitename_id'] = 'site-name';
- if (!$vars['logo']) {
- $vars['sitename_id'] = 'site-name-logo';
- }
-
- // Set Back to Top link toggle
- $vars['to_top'] = theme_get_setting('totop');
- if (theme_get_setting('totop') == 0) {
- $vars['to_top'] = '';
- }
- else {
- $vars['to_top'] = '<p id="to-top"><a href="#top-wrapper">'. t('Back To Top') .'</a></p>';
- }
-
- $vars['closure'] .= '
- <p id="theme-credit"><a href="http://drupal.org/project/beach">Beach Theme</a> '. t('Provided By ') . '<a href="http://drupal.in.th/">'.t('Drupal Thailand').'</a>. '.t('Designed by ').'<a href="http://webzer.net/">Gibbo</a>.</p>
- ';
-
- // count footer columns and add last-column class for footer block regions
- // this class will useful for layouting
- $vars['footer_column_count'] = 0;
- $vars['column2_is_last'] = '';
- $vars['column3_is_last'] = '';
- $vars['column4_is_last'] = '';
-
- if ($vars['footer_1']) {
- $vars['footer_column_count']++;
- }
-
- if ($vars['footer_2']) {
- $vars['footer_column_count']++;
- if ($vars['footer_1'] && empty($vars['footer_3']) && empty($vars['footer_4'])) {
- $vars['column2_is_last'] = ' last-column';
- }
- }
-
- if ($vars['footer_3']) {
- $vars['footer_column_count']++;
- if ($vars['footer_1'] || $vars['footer_2']) {
- if (empty($vars['footer_4'])) {
- $vars['column3_is_last'] = ' last-column';
- }
- }
- }
-
- if ($vars['footer_4']) {
- $vars['footer_column_count']++;
- if ($vars['footer_1'] || $vars['footer_2'] || $vars['footer_3']) {
- $vars['column4_is_last'] = ' last-column';
- }
- }
-
-}
-
-/**
- * This rearranges how the style sheets are included so the framework styles
- * are included first.
- * Code sample from "Ninesixty" Drupal7.x Theme
- */
-function css_rearrange($css) {
- global $theme_info, $base_theme_info;
-
- // Remove almost drupal core module CSS files except those specified in $exclude_list
- // to use only one CSS file (drupal-core.css)
-
- // This will reduce HTTP request for external CSS files
-
- $core_css = array(
- 'aggregator/aggregator-rtl.css',
- 'aggregator/aggregator.css',
- 'block/block.css',
- 'book/book-rtl.css',
- 'book/book.css',
- 'color/color-rtl.css',
- 'color/color.css',
- 'comment/comment-rtl.css',
- 'comment/comment.css',
- 'dblog/dblog-rtl.css',
- 'dblog/dblog.css',
- 'forum/forum-rtl.css',
- 'forum/forum.css',
- 'help/help-rtl.css',
- 'help/help.css',
- 'locale/locale.css',
- 'node/node-rtl.css',
- 'node/node.css',
- 'openid/openid.css',
- 'poll/poll-rtl.css',
- 'poll/poll.css',
- 'profile/profile.css',
- 'search/search-rtl.css',
- 'search/search.css',
- 'system/admin-rtl.css',
- 'system/admin.css',
- 'system/defaults-rtl.css',
- 'system/defaults.css',
- 'system/maintenance.css',
- 'system/system-menus-rtl.css',
- 'system/system-menus.css',
- 'system/system-rtl.css',
- 'system/system.css',
- 'taxonomy/taxonomy.css',
- 'tracker/tracker.css',
- 'update/update-rtl.css',
- 'update/update.css',
- 'user/user-rtl.css',
- 'user/user.css',
- );
-
- $exclude_list = array(
- 'color/color-rtl.css',
- 'color/color.css',
- );
-
- foreach ($core_css as $file) {
- if ( ! in_array($file, $exclude_list)) {
- unset($css['all']['module']['modules/' . $file]);
- }
- }
-
- // Dig into the framework .info data.
- $framework = !empty($base_theme_info) ? $base_theme_info[0]->info : $theme_info->info;
-
- // Pull framework styles from the themes .info file and place them above all stylesheets.
- if (isset($framework['stylesheets'])) {
-
- foreach ($framework['stylesheets'] as $media => $styles_from_framework) {
- // Setup framework group.
- if (isset($css[$media])) {
- $css[$media] = array_merge(array('framework' => array()), $css[$media]);
- }
- else {
- $css[$media]['framework'] = array();
- }
- foreach ($styles_from_framework as $style_from_framework) {
- // Force framework styles to come first.
- if (strpos($style_from_framework, 'framework') !== FALSE) {
- $framework_shift = $style_from_framework;
- $remove_styles = array($style_from_framework);
- $css[$media]['framework'][$framework_shift] = TRUE;
- foreach ($remove_styles as $remove_style) {
- unset($css[$media]['theme'][$remove_style]);
- }
- }
- }
- }
- }
- return $css;
-}
-
-/**
- * Intercept comment template variables
- */
-function phptemplate_preprocess_comment(&$vars, $hook) {
- static $comment_count = 1; // keep track the # of comments rendered
-
- // if the author of the node comments as well, highlight that comment
- $node = node_load($vars['comment']->nid);
- if ($vars['comment']->uid == $node->uid) {
- $vars['author_comment'] = TRUE;
- }
- // only show links for users that have permission to post or administer comments
- if (!user_access('post comments')) {
- $vars['links'] = '';
- }
-
- // if subjects in comments are turned off, don't show the title then
- if (variable_get('comment_subject_field', 1) == 0) {
- $vars['title'] = '';
- }
-
- // if user has no picture, remove div.picture
- if (empty($vars['comment']->picture)) {
- $vars['picture'] = '';
- }
-
- $vars['comment_count'] = $comment_count++;
-}
-
-/**
- * Create some custom classes for comments
- */
-function comment_classes($comment) {
- global $user;
-
- $node = node_load($comment->nid);
- $output .= ($comment->new) ? ' comment-new' : '';
- $output .= ' '. $status .' ';
- if ($node->name == $comment->name) {
- $output .= 'node-author';
- }
- if ($user->name == $comment->name) {
- $output .= ' mine';
- }
- return $output;
-}
-
-/**
- * Override comment wrapper to show you must login to comment.
- */
-function beach_comment_wrapper($content, $node) {
- global $user;
- $output = '';
-
- if ($node = menu_get_object()) {
- $count = $node->comment_count .' '. format_plural($node->comment_count, 'comment', 'comments');
-
- if ($node->comment_count < 1) {
- $output .= $content;
- }
- else {
- $output .= '<h3 id="comment-number">'.$count.'</h3>';
- $output .= '<div id="comments">'.$content.'</div>';
- }
- }
- return $output;
-}
-
-/**
- * Change Feed Icon to text only or use CSS background instead of IMG tag
- */
-
-function phptemplate_feed_icon($url, $title) {
- return '<a href="'. check_url($url) .'" class="feed-icon" title="'.t('Syndicate content').'">'.t('RSS').'</a>';
-}
-
-/**
- * Set default form file input size to prevent overlapping
- */
-function phptemplate_file($element) {
- $element['#size'] = 30;
- return theme_file($element);
-}
-
-/**
- * Set Custom Stylesheet
- */
-if (theme_get_setting('custom')) {
- drupal_add_css(drupal_get_path('theme', 'beach') .'/css/custom.css', 'theme');
-}
-
-/**
- * Add IE PNG Transparent fix
- */
-if (theme_get_setting('iepngfix')) {
- drupal_add_js(drupal_get_path('theme', 'beach') .'/js/jquery.pngFix.js', 'theme');
-}
-
-/**
- * Trim a post to a certain number of characters, removing all HTML. (Code sample from Blueprint theme.)
- */
-function trim_text($text, $length = 150) {
- // remove any HTML or line breaks so these don't appear in the text
- $text = trim(str_replace(array("\n", "\r"), ' ', strip_tags($text)));
- $text = trim(substr($text, 0, $length));
- $lastchar = substr($text, -1, 1);
- // check to see if the last character in the title is a non-alphanumeric character, except for ? or !
- // if it is strip it off so you don't get strange looking titles
- if (preg_match('/[^0-9A-Za-z\!\?]/', $lastchar)) {
- $text = substr($text, 0, -1);
- }
- // ? and ! are ok to end a title with since they make sense
- if ($lastchar != '!' && $lastchar != '?') {
- $text .= '...';
- }
- return $text;
-}
diff --git a/theme-settings.php b/theme-settings.php
deleted file mode 100644
index 29774ee..0000000
--- a/theme-settings.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-
-function phptemplate_settings($saved_settings) {
-
- $settings = theme_get_settings('beach');
-
-/**
- * The default values for the theme variables. Make sure $defaults exactly
- * matches the $defaults in the template.php file.
- */
- $defaults = array(
- 'container_class' => 'medium',
- 'iepngfix' => 1,
- 'custom' => 0,
- 'breadcrumb' => 0,
- 'totop' => 0,
- );
-
- // Merge the saved variables and their default values
- $settings = array_merge($defaults, $saved_settings);
-
- $css_path = drupal_get_path('theme', 'beach') . '/css';
- $custom_css = file_exists($css_path . '/custom.css');
-
- // Create theme settings form widgets using Forms API
- // Theme Settings Fieldset
- $form['container'] = array(
- '#type' => 'fieldset',
- '#title' => t('Beach Theme Settings'),
- '#description' => t('Use these settings to change what and how information is displayed in this theme.'),
- '#collapsible' => TRUE,
- '#collapsed' => FALSE,
- );
-
- $form['container']['container_class'] = array(
- '#type' => 'radios',
- '#title' => t('Container Width'),
- '#description' => t('Select the container width you need. <strong>Be careful</strong>, the Narrow and Medium Width may not suite 2 sidebars page.'),
- '#default_value' => $settings['container_class'],
- '#options' => array(
- 'narrow' => t('Narrow (Fixed width: 780px)'),
- 'medium' => t('Medium (Fixed width: 840px)'),
- 'wide' => t('Wide (Fixed width: 960px)'),
- 'super-wide' => t('Super Wide (Fixed width: 1020px)'),
- 'extreme-wide' => t('Extreme Wide (Fixed width: 1140px)'),
- 'fluid' => t('Fluid (min-width: 780px)'),
- ),
- );
-
- $form['container']['features'] = array(
- '#type' => 'fieldset',
- '#title' => t('Other Features'),
- '#description' => t('Check / Uncheck each themes features you want to activate or deactivate for your site.'),
- '#collapsible' => TRUE,
- '#collapsed' => FALSE,
- );
-
- $form['container']['features']['iepngfix'] = array(
- '#type' => 'checkbox',
- '#title' => t('Use <strong>IE Transparent PNG Fix</strong>'),
- '#default_value' => $settings['iepngfix'],
- );
-
- $form['container']['features']['custom'] = array(
- '#type' => 'checkbox',
- '#title' => t('Add <strong>Customized Stylesheet (custom.css)</strong>'),
- '#default_value' => $settings['custom'],
- '#description' => $custom_css ? '' : 'To enable this option, please see ' . $css_path . '/custom-sample.css',
- '#disabled' => $custom_css ? FALSE : TRUE,
- );
-
- $form['container']['features']['breadcrumb'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show <strong>Breadcrumbs</strong>'),
- '#default_value' => $settings['breadcrumb'],
- );
-
- $form['container']['features']['totop'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show <strong>Back to Top link</strong> (the link will appear at footer)'),
- '#default_value' => $settings['totop'],
- );
-
- return $form;
-} \ No newline at end of file