Skip to content
Snippets Groups Projects
Commit b23802ab authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-268] Merging test into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1359 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent aea462dc
Branches
Tags
No related merge requests found
Showing with 547 additions and 12 deletions
......@@ -476,6 +476,34 @@ function unl_file_validate($file) {
return;
}
/**
* Implementation of hook_form_FORM_ID_alter() for system_theme_settings.
* This is used in addition to unl_wdn_form_system_theme_settings_alter because that hook
* runs before color_form_system_theme_settings_alter which overwrites an attempt
* at setting $form['color']['#access'].
*/
function unl_form_system_theme_settings_alter(&$form, &$form_state) {
global $user;
$form['advanced_settings']['unl_affiliate']['#access'] = unl_user_is_administrator();
$is_affiliate = $form['advanced_settings']['unl_affiliate']['#default_value'];
$form['color']['#access'] = $is_affiliate;
$form['logo']['#access'] = $is_affiliate;
$form['favicon']['#access'] = $is_affiliate;
// These are settings manipulations that we want for UNL but don't necessarily belong in the theme
if (!$is_affiliate && !unl_user_is_administrator()) {
$form['theme_settings']['toggle_logo']['#access'] = false;
$form['theme_settings']['toggle_favicon']['#access'] = false;
$form['theme_settings']['toggle_name']['#access'] = false;
$form['theme_settings']['toggle_comment_user_verification']['#access'] = false;
$form['theme_settings']['toggle_main_menu']['#access'] = false;
$form['theme_settings']['toggle_secondary_menu']['#access'] = false;
}
}
/**
* Implementation of hook_form_FORM_ID_alter() for field_ui_display_overview_form.
*/
......@@ -1332,7 +1360,7 @@ function unl_query_alter(QueryAlterableInterface $query)
$usersTableAlias = NULL;
foreach ($query->getTables() as $alias => $table) {
if ($table['table'] == 'users') {
$usersTableAlias = $alias;
$usersTableAlias = $alias;
}
}
// If we actually find a users table
......
sites/all/themes/unl_wdn/color/base.png

106 B

<?php
// Put the logo path into JavaScript for the live preview.
drupal_add_js(array('color' => array('logo' => theme_get_setting('logo', 'unl_wdn'))), 'setting');
$info = array(
// Available colors and color labels used in theme.
'fields' => array(
'top' => t('Navigation top'),
'bottom' => t('Navigation bottom'),
'navhovertop' => t('Nav hover top'),
'navhoverbottom' => t('Nav hover bottom'),
'footertop' => t('Footer top'),
'footerbottom' => t('Footer bottom'),
'link' => t('Link color'),
),
// Pre-defined color schemes.
'schemes' => array(
'default' => array(
'title' => t('UNL (default)'),
'colors' => array(
'top' => '#b70302',
'bottom' => '#9d0201',
'navhovertop' => '#c12726',
'navhoverbottom' => '#ac2625',
'footertop' => '#b70303',
'footerbottom' => '#9d0202',
'link' => '#ba0000',
),
),
'brown' => array(
'title' => t('Brown'),
'colors' => array(
'top' => '#906337',
'bottom' => '#654424',
'navhovertop' => '#a3774b',
'navhoverbottom' => '#765330',
'footertop' => '#654425',
'footerbottom' => '#513316',
'link' => '#0081AF',
),
),
'blue' => array(
'title' => t('Blue Steel'),
'colors' => array(
'top' => '#1972a7',
'bottom' => '#0e4e74',
'navhovertop' => '#208dcd',
'navhoverbottom' => '#1c94db',
'footertop' => '#0e4e74',
'footerbottom' => '#02314e',
'link' => '#0064f8',
),
),
),
// CSS files (excluding @import) to rewrite with new color scheme.
'css' => array(
'css/colors.css',
),
// Files to copy.
'copy' => array(
//'logo.png',
),
// Gradient definitions.
'gradients' => array(
array(
// (x, y, width, height).
'dimension' => array(0, 0, 0, 0),
// Direction of gradient ('vertical' or 'horizontal').
'direction' => 'vertical',
// Keys of colors to use for the gradient.
'colors' => array('top', 'bottom'),
),
),
// Color areas to fill (x, y, width, height).
'fill' => array(),
// Coordinates of all the theme slices (x, y, width, height)
// with their filename as used in the stylesheet.
'slices' => array(),
// Reference color used for blending. Matches the base.png's colors.
'blend_target' => '#ffffff',
// Preview files.
'preview_css' => 'color/preview.css',
'preview_js' => 'color/preview.js',
'preview_html' => 'color/preview.html',
// Base file for image generation. (Not used, but causes error without it.)
'base_image' => 'color/base.png',
);
\ No newline at end of file
/* ---------- Color form ----------- */
#color_scheme_form #palette .form-item {
width: 25em;
}
#color_scheme_form #palette .form-item label {
width: 15em;
}
/* ---------- Preview Styles ----------- */
html.js #preview {
clear: both;
float: none !important;
}
#preview {
border: 12px solid #EEE;
border-radius: 10px;
box-shadow: 0px 1px 5px #AAA;
background-color: #fff;
font-family: "Lucida Grande",Verdana,Arial,sans-serif;
color: #333;
font-size: 12px;
line-height: 1.5;
overflow: hidden;
word-wrap: break-word;
margin-bottom: 10px;
}
#preview-header {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
position: relative;
}
#preview-logo {
float: left;
padding: 15px 15px 15px 10px;
}
#preview-site-name {
color: #555;
font-weight: normal;
font-size: 2.821em;
line-height: 1;
margin-bottom: 30px;
margin-left: 15px;
padding-top: 34px;
}
/* - Menu - */
#preview-main-menu {
font-size: 14px;
clear: both;
padding: 0 15px 3px;
margin: 0 12px;
border-radius: 5px;
}
#preview-main-menu-links a {
color: #fff;
padding: 0.6em 1em 0.4em;
text-shadow: 1px 1px 1px #424242;
}
#preview-main-menu-links {
margin: 0;
padding: 3px 0;
}
#preview-main-menu-links li {
display: inline;
list-style-type: none;
padding: 0.6em 0 0.4em;
}
/* - Sidebar/Content - */
#preview-sidebar,
#preview-content {
display: inline;
float: left;
position: relative;
}
#preview-sidebar {
margin-left: 15px;
width: 210px;
}
#preview-content {
margin-left: 30px;
width: 26.5em;
}
#preview-sidebar .preview-block {
border: 1px solid;
margin: 20px 0;
padding: 15px 20px;
}
#preview-sidebar h2 {
border-bottom: 1px solid #d6d6d6;
font-size: 1.071em;
font-weight: normal;
line-height: 1.2;
margin: 0 0 0.5em;
padding-bottom: 5px;
text-shadow: 0 1px 0 #fff;
}
#preview .preview-block .preview-content {
margin-top: 1em;
}
#preview .preview-block-menu .preview-content,
#preview .preview-block-menu .preview-content ul {
margin-top: 0;
}
#preview-main {
margin-bottom: 40px;
margin-top: 20px;
}
#preview-page-title {
color: #535353;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 2em;
font-weight: bold;
line-height: 1.2;
padding-bottom: 0.3em;
padding-top: 0.4em;
}
/* - Footer - */
#preview-footer-wrapper {
color: #ffffff;
display: block !important;
font-size: 11px;
padding: 10px 20px 15px;
text-shadow: 0px 1px 0px #424242;
}
#preview-footer-wrapper a {
color: #ffffff;
text-decoration: underline;
}
\ No newline at end of file
<div id="preview">
<div id="preview-header">
<div id="preview-logo"><img src="../../../themes/unl_wdn/logo.png" alt="Site Logo" /></div>
<div id="preview-site-name">UNL WDN</div>
<div id="preview-main-menu">
<ul id="preview-main-menu-links">
<li><a>Home</a></li>
<li><a>Te Quidne</a></li>
<li><a>Vel Torqueo Quae Erat</a></li>
</ul>
</div>
</div>
<div id="preview-main" class="clearfix">
<div id="preview-sidebar">
<div id="preview-block" class="preview-block">
<h2>Etiam est risus</h2>
<div class="preview-content">
Maecenas id porttitor Ut enim ad minim veniam, quis nostrudfelis.
Laboris nisi ut aliquip ex ea.
</div>
</div>
</div>
<div id="preview-content">
<h1 id="preview-page-title">Lorem ipsum dolor</h1>
<div id="preview-node">
<div class="preview-content">
Sit amet, <a>consectetur adipisicing elit</a>, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud <a>exercitation ullamco</a> laboris nisi ut aliquip ex ea
commodo consequat. Maecenas id porttitor Ut enim ad minim veniam, quis nostr udfelis.
</div>
</div>
</div>
</div>
<div id="preview-footer-wrapper">
<p>Copyright University of Nebraska–Lincoln | Lincoln, NE 68588 | 402-472-7211 | <a>About UNL</a></p>
<p>UNL is an equal opportunity employer with a comprehensive plan for diversity.</p>
</div>
</div>
\ No newline at end of file
(function ($) {
Drupal.color = {
logoChanged: false,
callback: function(context, settings, form, farb, height, width) {
// Change the logo to be the real one.
if (!this.logoChanged) {
$('#preview #preview-logo img').attr('src', Drupal.settings.color.logo);
this.logoChanged = true;
}
// Remove the logo if the setting is toggled off.
if (Drupal.settings.color.logo == null) {
$('div').remove('#preview-logo');
}
// Text preview.
$('#preview #preview-content a', form).css('color', $('#palette input[name="palette[link]"]', form).val());
// CSS3 Gradients - navigation.
var gradient_start = $('#palette input[name="palette[top]"]', form).val();
var gradient_end = $('#palette input[name="palette[bottom]"]', form).val();
$('#preview #preview-main-menu', form).attr('style', "background-color: " + gradient_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + gradient_start + "), to(" + gradient_end + ")); background-image: -moz-linear-gradient(-90deg, " + gradient_start + ", " + gradient_end + ");");
// CSS3 Gradients - navigation hover.
var navhover_start = $('#palette input[name="palette[navhovertop]"]', form).val();
var navhover_end = $('#palette input[name="palette[navhoverbottom]"]', form).val();
$('#preview #preview-main-menu', form).hover(
function(){
$(this).attr('style', "background-color: " + navhover_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + navhover_start + "), to(" + navhover_end + ")); background-image: -moz-linear-gradient(-90deg, " + navhover_start + ", " + navhover_end + ");");
},
function(){
$(this).attr('style', "background-color: " + gradient_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + gradient_start + "), to(" + gradient_end + ")); background-image: -moz-linear-gradient(-90deg, " + gradient_start + ", " + gradient_end + ");");
}
);
// CSS3 Gradients - footer.
var footer_start = $('#palette input[name="palette[footertop]"]', form).val();
var footer_end = $('#palette input[name="palette[footerbottom]"]', form).val();
$('#preview #preview-footer-wrapper', form).attr('style', "background-color: " + footer_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + footer_start + "), to(" + footer_end + ")); background-image: -moz-linear-gradient(-90deg, " + footer_start + ", " + footer_end + ");");
}
};
})(jQuery);
\ No newline at end of file
/* ---------- Color Module Styles ----------- */
#wdn_identity_management {left: 480px;}
/* - breadcrumbs - */
#breadcrumbs > ul > li > a{
background: url('/sharedcode/affiliate_imgs/2011_breadcrumb_li.png') no-repeat right 3px;
}
#breadcrumbs > ul > li.selected > a {
color: #9d0201;
}
/* - navigation - */
#navigation > ul > li > a, #navigation > ul > li.empty a, #navigation > ul > li.empty:hover a {
background: #9d0201;
background: -moz-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#b70302),color-stop(100%,#9d0201));
background: -webkit-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: -o-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: -ms-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: linear-gradient(top,#b70302 0%,#9d0201 100%);
border-right: 1px solid #9d0201;
border-left: 1px solid #b70302;
border-top: 1px solid #9d0201!important;
}
#navigation > ul > li.empty a, #navigation > ul > li.empty:hover a {border-left-color: transparent; border-right-color: transparent;}
#navigation > ul > li:hover > a {
background: #ac2625;
background: -moz-linear-gradient(top,#c12726 0%,#ac2625 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#c12726),color-stop(100%,#ac2625));
background: -webkit-linear-gradient(top,#c12726 0%,#ac2625 100%);
background: -o-linear-gradient(top,#c12726 0%,#ac2625 100%);
background: -ms-linear-gradient(top,#c12726 0%,#ac2625 100%);
background: linear-gradient(top,#c12726 0%,#ac2625 100%);
}
#navigation > ul > li:nth-child(n+7) > a {
border-top: 1px solid #9d0201;
box-shadow: 0px -1px 0px #9d0201;
}
/* - search box - */
#wdn_search {
background: #9d0201;
background: -moz-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#b70302),color-stop(100%,#9d0201));
background: -webkit-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: -o-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: -ms-linear-gradient(top,#b70302 0%,#9d0201 100%);
background: linear-gradient(top,#b70302 0%,#9d0201 100%);
}
#wdn_search form #q{
border-color: #9d0201
}
/* - links - */
#maincontent a {
color: #ba0000;
}
#maincontent a:hover {
color: #ee0000 !important;
}
#maincontent a:focus {
color: #cc0000 !important;
}
/* - copyright footer - */
#wdn_copyright {
background: #9d0202;
background: -moz-linear-gradient(top,#b70303 0%,#9d0202 100%);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#b70303),color-stop(100%,#9d0202));
background: -webkit-linear-gradient(top,#b70303 0%,#9d0202 100%);
background: -o-linear-gradient(top,#b70303 0%,#9d0202 100%);
background: -ms-linear-gradient(top,#b70303 0%,#9d0202 100%);
background: linear-gradient(top,#b70303 0%,#9d0202 100%);
text-shadow: 0 1px 0 #9d0202;
}
#wdn_logos #unl_wordmark {
-webkit-box-shadow: 1px 0px 0px #9d0202;
-moz-box-shadow: 1px 0px 0px #9d0202;
box-shadow: 1px 0px 0px #9d0202;
}
......@@ -77,6 +77,16 @@ $html = str_replace(
$page_bottom . PHP_EOL . '</body>'),
$html);
// Replace the header logo (used by affiliates)
if (isset($t->logo)) {
$html = str_replace('<a href="http://www.unl.edu/" title="UNL website"><img src="/wdn/templates_3.0/images/logo.png" alt="UNL graphic identifier" id="logo" /></a>',
$t->logo,
$html);
$html = str_replace('<h1>University of Nebraska&ndash;Lincoln</h1>',
'<h1>An Affiliate of the University of Nebraska&ndash;Lincoln</h1>',
$html);
}
$format = filter_input(INPUT_GET, 'format', FILTER_SANITIZE_STRING);
if ($format == 'partial') {
echo $t->maincontentarea;
......
sites/all/themes/unl_wdn/logo.png

8.22 KiB

......@@ -70,17 +70,28 @@ Any real output is being deferred to html.tpl.php
$t = unl_wdn_get_instance();
// Site Logo (for affiliates)
if (theme_get_setting('unl_affiliate') && $logo) {
$t->logo = '<a href="'.$front_page.'" title="Home">
<img src="'.$logo.'" alt="'.$site_name.' logo" id="logo" />
</a>';
}
// Breadcrumbs
if (isset($breadcrumb)) {
$t->breadcrumbs = PHP_EOL.$breadcrumb.PHP_EOL;
$t->breadcrumbs = PHP_EOL . $breadcrumb . PHP_EOL;
}
// Navigation
$t->navlinks = PHP_EOL.render($page['navlinks']);
$t->navlinks = PHP_EOL . render($page['navlinks']);
// Site Title and Page Title
if (isset($site_name) && $site_name) {
$t->titlegraphic = '<h1>' . $site_name . '</h1>';
$t->titlegraphic = '<h1>' . $site_name;
if (!empty($site_slogan)) {
$t->titlegraphic .= '<span>' . $site_slogan . '</span>';
}
$t->titlegraphic .= '</h1>';
}
if (isset($title) && $title) {
$t->pagetitle = '<h2>' . render($title_prefix) . $title . render($title_suffix) . '</h2>';
......
......@@ -26,6 +26,24 @@ function unl_wdn_preprocess_field(&$vars, $hook) {
* Implements template_preprocess_html().
*/
function unl_wdn_preprocess_html(&$vars, $hook) {
if (theme_get_setting('unl_affiliate')) {
if (!theme_get_setting('toggle_unl_banner')) {
drupal_add_css('#header h1{display:none;}', array('type'=>'inline', 'group' => CSS_THEME));
}
if (!theme_get_setting('toggle_unl_branding')) {
drupal_add_css('#footer_floater,#wdn_logos{display:none;}', array('type'=>'inline', 'group' => CSS_THEME));
}
if (!theme_get_setting('toggle_unl_breadcrumb')) {
drupal_add_css('#breadcrumbs > ul > li:first-child{display:none;}', array('type'=>'inline', 'group' => CSS_THEME));
}
if (!theme_get_setting('toggle_unl_search')) {
drupal_add_css('#wdn_search{display:none;}', array('type'=>'inline', 'group' => CSS_THEME));
}
if (!theme_get_setting('toggle_unl_tools')) {
drupal_add_css('#wdn_tool_links{display:none;}', array('type'=>'inline', 'group' => CSS_THEME));
}
}
/**
* Change the <title> tag to UNL format: UNL | Department | Section | Page
*/
......@@ -56,6 +74,16 @@ function unl_wdn_preprocess_html(&$vars, $hook) {
$vars['head_title'] = check_plain(implode(' | ', $head_title));
}
/**
* Implements template_process_html().
*/
function unl_wdn_process_html(&$vars) {
// Hook into color.module.
if (theme_get_setting('unl_affiliate') && module_exists('color')) {
_color_html_alter($vars);
}
}
/**
* Implements template_preprocess_region().
* Adds grid classes for sidebar_first, sidebar_second, and content regions.
......@@ -145,6 +173,16 @@ function unl_wdn_preprocess_page(&$vars, $hook) {
}
}
/**
* Implements template_process_page().
*/
function unl_wdn_process_page(&$vars) {
// Hook into color.module.
if (theme_get_setting('unl_affiliate') && module_exists('color')) {
_color_page_alter($vars);
}
}
/**
* Called in html.tpl.php and page.tpl.php.
*/
......
<?php
/**
* Implements hook_form_system_theme_settings_alter().
* Done as THEMENAME_form_system_theme_settings_alter(), reference http://drupal.org/node/177868
*/
function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) {
global $user;
// Add checkboxes to the Toggle Display form to hide UNL template items on an affiliate site
$form['theme_settings'] += array(
'toggle_unl_banner' => array(
'#type' => 'checkbox',
'#title' => t('UNL Affiliate Banner'),
'#default_value' => theme_get_setting('toggle_unl_banner'),
'#access' => theme_get_setting('unl_affiliate'),
),
'toggle_unl_branding' => array(
'#type' => 'checkbox',
'#title' => t('UNL Branding Elements'),
'#default_value' => theme_get_setting('toggle_unl_branding'),
'#access' => theme_get_setting('unl_affiliate'),
),
'toggle_unl_breadcrumb' => array(
'#type' => 'checkbox',
'#title' => t('UNL Breadcrumb'),
'#default_value' => theme_get_setting('toggle_unl_breadcrumb'),
'#access' => theme_get_setting('unl_affiliate'),
),
'toggle_unl_search' => array(
'#type' => 'checkbox',
'#title' => t('UNL Search box'),
'#default_value' => theme_get_setting('toggle_unl_search'),
'#access' => theme_get_setting('unl_affiliate'),
),
'toggle_unl_tools' => array(
'#type' => 'checkbox',
'#title' => t('UNL Tools'),
'#default_value' => theme_get_setting('toggle_unl_tools'),
'#access' => theme_get_setting('unl_affiliate'),
),
);
$form[] = array(
'#type' => 'fieldset',
'#title' => t('Site Name Abbreviation'),
......@@ -76,6 +113,12 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) {
'#description' => t('Replaces the links in &lt;head&gt; to the stable /wdn directory with the latest development versions.'),
'#access' => _unl_wdn_use_wdn_beta(),
),
'unl_affiliate' => array(
'#type' => 'checkbox',
'#title' => t('Affiliate Site'),
'#default_value' => theme_get_setting('unl_affiliate'),
'#description' => t('Grants access to the Color scheme picker, Logo image settings, Shortcut icon settings on this page for customizing the UNL template.'),
),
);
}
......
......@@ -5,15 +5,10 @@ core = 7.x
engine = phptemplate
stylesheets[all][] = style.css
stylesheets[all][] = css/colors.css
scripts[] = theme.js
features[] = main_menu
features[] = name
features[] = node_user_picture
features[] = comment_user_picture
features[] = comment_user_verification
regions[page_top] = Page top
regions[page_bottom] = Page bottom
......@@ -29,8 +24,12 @@ regions[footercontent] = Footer Content
plugins[panels][layouts] = layouts
settings[toggle_logo] = 0
settings[toggle_slogan] = 0
settings[toggle_favicon] = 0
settings[zen_forms] = 0
settings[wdn_beta] = 0
settings[sidebar_first_width] = 3
settings[sidebar_second_width] = 3
settings[zen_forms] = 0
settings[wdn_beta] = 0
settings[unl_affiliate] = 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment