summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2007-12-10 01:58:50 (GMT)
committer JohnAlbin2007-12-10 01:58:50 (GMT)
commit8afee8f67c6f791a50f82f4e574d0d142a73709b (patch)
tree1b97abee8a84b25a319a599b0b3d29f830ff5cf1
parentac7cce82fbdd42440785e7aa6bde77400663d695 (diff)
Added wireframes css and new theme settings.
-rw-r--r--layout-liquid.css (renamed from layout.css)25
-rw-r--r--template.php26
-rw-r--r--theme-settings-init.php4
-rw-r--r--theme-settings.css27
-rw-r--r--theme-settings.php33
-rw-r--r--wireframes.css22
-rw-r--r--zen_classic/theme-settings.php3
7 files changed, 109 insertions, 31 deletions
diff --git a/layout.css b/layout-liquid.css
index d02e387..21868cd 100644
--- a/layout.css
+++ b/layout-liquid.css
@@ -25,16 +25,6 @@
#page
{
- /*
- * If you want to make the page a fixed width and centered in the viewport,
- * this is the standards-compliant way to do that. See also the ie.css file
- * for the necessary IE5 hack to center a div.
- */
- /*
- margin-left: auto;
- margin-right: auto;
- width: 960px;
- */
}
#skip-to-nav
@@ -109,7 +99,7 @@
width: 100%;
margin-left: 0;
margin-right: -100%; /* Negative value of #content's width. */
- padding: 0; /* DO NOT CHANGE. Add padding to #content-inner. */
+ padding: 0; /* DO NOT CHANGE. Add padding or margin to #content-inner. */
}
.two-sidebars #content-inner
@@ -132,6 +122,7 @@
#content-inner
{
+ margin: 0;
padding: 0;
}
@@ -142,12 +133,13 @@
width: 200px;
margin-left: 0;
margin-right: -200px; /* Negative value of #sidebar-left's width. */
- padding: 0; /* DO NOT CHANGE. Add padding to #sidebar-left-inner. */
+ padding: 0; /* DO NOT CHANGE. Add padding or margin to #sidebar-left-inner. */
}
#sidebar-left-inner
{
- padding-right: 20px;
+ margin: 0 20px 0 0;
+ padding: 0;
}
/** sidebar-right **/
@@ -157,12 +149,13 @@
width: 200px;
margin-left: -200px; /* Negative value of #sidebar-right's width. */
margin-right: 0;
- padding: 0; /* DO NOT CHANGE. Add padding to #sidebar-right-inner. */
+ padding: 0; /* DO NOT CHANGE. Add padding or margin to #sidebar-right-inner. */
}
#sidebar-right-inner
{
- padding-left: 20px;
+ margin: 0 0 0 20px;
+ padding: 0;
}
/** navbar **/
@@ -172,7 +165,7 @@
width: 100%;
margin-left: 0;
margin-right: -100%; /* Negative value of #navbar's width. */
- padding: 0; /* DO NOT CHANGE. Add padding to #navbar-inner. */
+ padding: 0; /* DO NOT CHANGE. Add padding or margin to #navbar-inner. */
height: 3.6em; /* The navbar can have any arbritrary height. We picked one
that is twice the line-height pluse 1em: 2 x 1.3 + 1 = 3.6
Set this to the same value as the margin-top below. */
diff --git a/template.php b/template.php
index 394287b..fd1a5ed 100644
--- a/template.php
+++ b/template.php
@@ -166,21 +166,29 @@ function _phptemplate_variables($hook, $vars = array()) {
case 'page':
global $theme, $theme_key;
- // If we're in the main theme
- if ($theme == $theme_key) {
- // These next lines add additional CSS files and redefine
- // the $css and $styles variables available to your page template
- // We had previously used @import declarations in the css files,
- // but these are incompatible with the CSS caching in Drupal 5
- drupal_add_css($vars['directory'] .'/layout.css', 'theme', 'all');
+ // These next lines add additional CSS files and redefine
+ // the $css and $styles variables available to your page template
+ if ($theme == $theme_key) { // If we're in the main theme
+ // Load the stylesheet for a liquid layout
+ if (theme_get_setting('zen_layout') == 'slurpy-liquid') {
+ drupal_add_css($vars['directory'] .'/layout-liquid.css', 'theme', 'all');
+ }
+ // Or load the stylesheet for a fixed width layout
+ else {
+ drupal_add_css($vars['directory'] .'/layout-fixed.css', 'theme', 'all');
+ }
drupal_add_css($vars['directory'] .'/html-elements.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/tabs.css', 'theme', 'all');
drupal_add_css($vars['directory'] .'/zen.css', 'theme', 'all');
- $vars['css'] = drupal_add_css();
- $vars['styles'] = drupal_get_css();
// Avoid IE5 bug that always loads @import print stylesheets
$vars['head'] = zen_add_print_css($vars['directory'] .'/print.css');
}
+ // Optionally add the wireframes style.
+ if (theme_get_setting('zen_wireframes')) {
+ drupal_add_css($vars['directory'] .'/wireframes.css', 'theme', 'all');
+ }
+ $vars['css'] = drupal_add_css();
+ $vars['styles'] = drupal_get_css();
// Send a new variable, $logged_in, to page.tpl.php to tell us if the
// current user is logged in or out. An anonymous user has a user id of 0.
diff --git a/theme-settings-init.php b/theme-settings-init.php
index d88cf81..86d6412 100644
--- a/theme-settings-init.php
+++ b/theme-settings-init.php
@@ -1,7 +1,7 @@
<?php
// $Id$
-if (is_null(theme_get_setting('zen_breadcrumb_trailing'))) {
+if (is_null(theme_get_setting('zen_wireframes'))) {
global $theme_key;
// Save default theme settings
$defaults = array(
@@ -9,6 +9,8 @@ if (is_null(theme_get_setting('zen_breadcrumb_trailing'))) {
'zen_breadcrumb_separator' => ' › ',
'zen_breadcrumb_home' => 1,
'zen_breadcrumb_trailing' => 1,
+ 'zen_layout' => 'slurpy-liquid',
+ 'zen_wireframes' => 0,
);
variable_set(
str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
diff --git a/theme-settings.css b/theme-settings.css
index a584beb..0d06a30 100644
--- a/theme-settings.css
+++ b/theme-settings.css
@@ -36,3 +36,30 @@
margin-right: 0;
text-align: left;
}
+
+ #div-zen-wireframes
+ {
+ margin: 1em 0;
+ }
+
+ #div-zen-wireframes strong
+ {
+ float: left;
+ width: 190px;
+ margin-left: 0;
+ margin-right: 10px;
+ text-align: right;
+ }
+
+ #div-zen-wireframes .form-item
+ {
+ display: inline;
+ margin-left: 0;
+ padding-left: 0;
+ }
+
+ #div-zen-wireframes .form-item .description
+ {
+ display: block;
+ margin-left: 200px;
+ }
diff --git a/theme-settings.php b/theme-settings.php
index 2b16cd9..27c53cc 100644
--- a/theme-settings.php
+++ b/theme-settings.php
@@ -49,15 +49,15 @@ function zen_settings($saved_settings, $subtheme_defaults = array()) {
'#title' => t('Display breadcrumb'),
'#default_value' => $settings['zen_breadcrumb'],
'#options' => array(
- 'yes' => 'Yes',
- 'admin' => 'Only in admin section',
- 'no' => 'No',
+ 'yes' => t('Yes'),
+ 'admin' => t('Only in admin section'),
+ 'no' => t('No'),
),
);
$form['breadcrumb']['zen_breadcrumb_separator'] = array(
'#type' => 'textfield',
'#title' => t('Breadcrumb separator'),
- '#description' => 'Text only. Don’t forget to include spaces.',
+ '#description' => t('Text only. Don’t forget to include spaces.'),
'#default_value' => $settings['zen_breadcrumb_separator'],
'#size' => 5,
'#maxlength' => 10,
@@ -72,10 +72,33 @@ function zen_settings($saved_settings, $subtheme_defaults = array()) {
'#type' => 'checkbox',
'#title' => t('Append a separator to the end of the breadcrumb'),
'#default_value' => $settings['zen_breadcrumb_trailing'],
- '#description' => 'Useful when the breadcrumb is placed just before the title.',
+ '#description' => t('Useful when the breadcrumb is placed just before the title.'),
'#suffix' => '</div>', // #div-zen-breadcrumb
);
+ $form['themedev'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Theme development settings'),
+ '#attributes' => array('id' => 'zen-themedev'),
+ );
+ $form['themedev']['zen_layout'] = array(
+ '#type' => 'radios',
+ '#title' => t('Layout method'),
+ '#options' => array(
+ 'slurpy-liquid' => t('Liquid layout') .' <small>(layout-liquid.css)</small>',
+ 'slurpy-fixed' => t('Fixed layout') .' <small>(layout-fixed.css)</small>',
+ ),
+ '#default_value' => $settings['zen_layout'],
+ );
+ $form['themedev']['zen_wireframes'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display borders around main layout elements'),
+ '#default_value' => $settings['zen_wireframes'],
+ '#description' => l(t('Wireframes'), 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain') . t(' are useful when prototyping a website.'),
+ '#prefix' => '<div id="div-zen-wireframes"><strong>'. t('Wireframes:') .'</strong>',
+ '#suffix' => '</div>',
+ );
+
$form['zen-div-closing'] = array(
'#value' => '</div>',
);
diff --git a/wireframes.css b/wireframes.css
new file mode 100644
index 0000000..fb2d1c3
--- /dev/null
+++ b/wireframes.css
@@ -0,0 +1,22 @@
+/* $Id$ */
+
+/*
+ * WIREFRAMES STYLE
+ *
+ * Add wireframes to the basic layout elements.
+ */
+
+
+ #header-inner,
+ #content-inner,
+ #content-inner>*,
+ #navbar-inner,
+ #sidebar-left-inner,
+ #sidebar-right-inner,
+ #footer-inner,
+ #closure-blocks
+ {
+ margin: 1px;
+ padding: 2px;
+ border: 1px solid #ccc;
+ }
diff --git a/zen_classic/theme-settings.php b/zen_classic/theme-settings.php
index de369a2..b67ddca 100644
--- a/zen_classic/theme-settings.php
+++ b/zen_classic/theme-settings.php
@@ -39,6 +39,9 @@ function zen_classic_settings($saved_settings) {
// Add the base theme's settings.
$form += zen_settings($saved_settings, $defaults);
+ // Remove some of the base theme's settings.
+ unset($form['themedev']);
+
// Return the form
return $form;
}