| 1 |
<?php
|
| 2 |
|
| 3 |
if (is_null(theme_get_setting('denver_style'))) {
|
| 4 |
global $theme_key;
|
| 5 |
// Save default theme settings
|
| 6 |
$defaults = array(
|
| 7 |
|
| 8 |
'denver_suckerfish' => 0,
|
| 9 |
'denver_suckerfishcolor' => 'blue',
|
| 10 |
'denver_bodybg' => 'bodybg-gradient',
|
| 11 |
'denver_custombodybg' => '',
|
| 12 |
'denver_font' => 'font-arial-verdana-sansserif',
|
| 13 |
'denver_customfont' => '',
|
| 14 |
'denver_width' => 'width-80',
|
| 15 |
'denver_customwidth' => '',
|
| 16 |
'denver_padding' => 'padding-20px-0',
|
| 17 |
'denver_custompadding' => '',
|
| 18 |
'denver_pgheader' => 'pgheader-tealgradient',
|
| 19 |
'denver_custompgheader' => '',
|
| 20 |
'denver_pgheaderh' => 'pgheaderh-auto',
|
| 21 |
'denver_custompgheaderh' => '',
|
| 22 |
'denver_logohalign' => 'logohalign-left',
|
| 23 |
'denver_navbg' => 'navbg-silvergradient',
|
| 24 |
'denver_customnavbg' => '',
|
| 25 |
'denver_ptabsposition' => 'ptabs-navleft',
|
| 26 |
'denver_ptabs' => 'ptabs-blue',
|
| 27 |
'denver_customptabs' => '',
|
| 28 |
'denver_customptabsah' => '',
|
| 29 |
'denver_customptabsaa' => '',
|
| 30 |
'denver_plinksa' => 'plinksa-gray',
|
| 31 |
'denver_customplinksa' => '',
|
| 32 |
'denver_customplinksah' => '',
|
| 33 |
'denver_customplinksaa' => '',
|
| 34 |
'denver_searchposition' => 'search-navright',
|
| 35 |
'denver_secposition' => 'secondary-center',
|
| 36 |
'denver_secbg' => 'secbg-gray',
|
| 37 |
'denver_customsecbg' => '',
|
| 38 |
'denver_pgbg' => 'pgbg-lightgradient',
|
| 39 |
'denver_custompgbg' => '',
|
| 40 |
'denver_centerbg' => 'centerbg-trans',
|
| 41 |
'denver_customcenterbg' => '',
|
| 42 |
'denver_pgcontentbg' => 'pgcontentbg-lightgradient',
|
| 43 |
'denver_custompgcontentbg' => '',
|
| 44 |
'denver_mainbg' => 'mainbg-trans',
|
| 45 |
'denver_custommainbg' => '',
|
| 46 |
'denver_nodebg' => 'nodebg-trans',
|
| 47 |
'denver_customnodebg' => '',
|
| 48 |
'denver_nodecontentbg' => 'nodecontentbg-trans',
|
| 49 |
'denver_customnodecontentbg' => '',
|
| 50 |
'denver_leftsidebarwidth' => 'leftsidebarwidth-200',
|
| 51 |
'denver_customleftsidebarwidth' => '',
|
| 52 |
'denver_rightsidebarwidth' => 'rightsidebarwidth-200',
|
| 53 |
'denver_customrightsidebarwidth' => '',
|
| 54 |
'denver_leftbg' => 'leftbg-trans',
|
| 55 |
'denver_customleftbg' => '',
|
| 56 |
'denver_blocklbg' => 'blocklbg-trans',
|
| 57 |
'denver_customblocklbg' => '',
|
| 58 |
'denver_blockltitle' => 'blockltitle-blue',
|
| 59 |
'denver_customblockltitle' => '',
|
| 60 |
'denver_blocklcontent' => 'blocklcontent-lightgray',
|
| 61 |
'denver_customblocklcontent' => '',
|
| 62 |
'denver_rightbg' => 'rightbg-trans',
|
| 63 |
'denver_customrightbg' => '',
|
| 64 |
'denver_blockrbg' => 'blockrbg-trans',
|
| 65 |
'denver_customblockrbg' => '',
|
| 66 |
'denver_blockrtitle' => 'blockrtitle-blue',
|
| 67 |
'denver_customblockrtitle' => '',
|
| 68 |
'denver_blockrcontent' => 'blockrcontent-lightgray',
|
| 69 |
'denver_customblockrcontent' => '',
|
| 70 |
'denver_footerbg' => 'footerbg-darkgray',
|
| 71 |
'denver_customfooterbg' => '',
|
| 72 |
'denver_style' => 'blue',
|
| 73 |
'denver_cssfile' => 0,
|
| 74 |
'denver_customcssfile' => '',
|
| 75 |
'denver_csstype' => 0,
|
| 76 |
'denver_customcsstype' => '',
|
| 77 |
'denver_jsfile' => 0,
|
| 78 |
'denver_customjsfile' => '',
|
| 79 |
'denver_jstype' => 0,
|
| 80 |
'denver_customjstype' => '',
|
| 81 |
'denver_breadcrumb' => 0,
|
| 82 |
'denver_iepngfix' => 1,
|
| 83 |
'denver_themelogo' => 0,
|
| 84 |
);
|
| 85 |
variable_set(
|
| 86 |
str_replace('/', '_', 'theme_'. $theme_key .'_settings'),
|
| 87 |
array_merge(theme_get_settings($theme_key), $defaults)
|
| 88 |
);
|
| 89 |
// Force refresh of Drupal internals
|
| 90 |
theme_get_setting('', TRUE);
|
| 91 |
}
|
| 92 |
|
| 93 |
$bodybg = theme_get_setting('denver_bodybg');
|
| 94 |
if (!$bodybg)
|
| 95 |
{
|
| 96 |
$bodybg = '';
|
| 97 |
}
|
| 98 |
|
| 99 |
$font = theme_get_setting('denver_font');
|
| 100 |
if (!$font)
|
| 101 |
{
|
| 102 |
$font = '';
|
| 103 |
}
|
| 104 |
|
| 105 |
$width = theme_get_setting('denver_width');
|
| 106 |
if (!$width)
|
| 107 |
{
|
| 108 |
$width = '';
|
| 109 |
}
|
| 110 |
|
| 111 |
$padding = theme_get_setting('denver_padding');
|
| 112 |
if (!$padding)
|
| 113 |
{
|
| 114 |
$padding = '';
|
| 115 |
}
|
| 116 |
|
| 117 |
$pgheader = theme_get_setting('denver_pgheader');
|
| 118 |
if (!$pgheader)
|
| 119 |
{
|
| 120 |
$pgheader = '';
|
| 121 |
}
|
| 122 |
|
| 123 |
$pgheaderh = theme_get_setting('denver_pgheaderh');
|
| 124 |
if (!$pgheaderh)
|
| 125 |
{
|
| 126 |
$pgheaderh = '';
|
| 127 |
}
|
| 128 |
|
| 129 |
$logohalign = theme_get_setting('denver_logohalign');
|
| 130 |
if (!$logohalign)
|
| 131 |
{
|
| 132 |
$logohalign = '';
|
| 133 |
}
|
| 134 |
|
| 135 |
$navbg = theme_get_setting('denver_navbg');
|
| 136 |
if (!$navbg)
|
| 137 |
{
|
| 138 |
$navbg = '';
|
| 139 |
}
|
| 140 |
|
| 141 |
$ptabsposition = theme_get_setting('denver_ptabsposition');
|
| 142 |
if (!$ptabsposition)
|
| 143 |
{
|
| 144 |
$ptabsposition = '';
|
| 145 |
}
|
| 146 |
|
| 147 |
$ptabs = theme_get_setting('denver_ptabs');
|
| 148 |
if (!$ptabs)
|
| 149 |
{
|
| 150 |
$ptabs = '';
|
| 151 |
}
|
| 152 |
|
| 153 |
$plinksa = theme_get_setting('denver_plinksa');
|
| 154 |
if (!$plinksa)
|
| 155 |
{
|
| 156 |
$plinksa = '';
|
| 157 |
}
|
| 158 |
|
| 159 |
$searchposition = theme_get_setting('denver_searchposition');
|
| 160 |
if (!$searchposition)
|
| 161 |
{
|
| 162 |
$searchposition = '';
|
| 163 |
}
|
| 164 |
|
| 165 |
$secposition = theme_get_setting('denver_secposition');
|
| 166 |
if (!$secposition)
|
| 167 |
{
|
| 168 |
$secposition = '';
|
| 169 |
}
|
| 170 |
|
| 171 |
$secbg = theme_get_setting('denver_secbg');
|
| 172 |
if (!$secbg)
|
| 173 |
{
|
| 174 |
$secbg = '';
|
| 175 |
}
|
| 176 |
|
| 177 |
$pgbg = theme_get_setting('denver_pgbg');
|
| 178 |
if (!$pgbg)
|
| 179 |
{
|
| 180 |
$pgbg = '';
|
| 181 |
}
|
| 182 |
|
| 183 |
$centerbg = theme_get_setting('denver_centerbg');
|
| 184 |
if (!$centerbg)
|
| 185 |
{
|
| 186 |
$centerbg = '';
|
| 187 |
}
|
| 188 |
|
| 189 |
$pgcontentbg = theme_get_setting('denver_pgcontentbg');
|
| 190 |
if (!$pgcontentbg)
|
| 191 |
{
|
| 192 |
$pgcontentbg = '';
|
| 193 |
}
|
| 194 |
|
| 195 |
$mainbg = theme_get_setting('denver_mainbg');
|
| 196 |
if (!$mainbg)
|
| 197 |
{
|
| 198 |
$mainbg = '';
|
| 199 |
}
|
| 200 |
|
| 201 |
$nodebg = theme_get_setting('denver_nodebg');
|
| 202 |
if (!$nodebg)
|
| 203 |
{
|
| 204 |
$nodebg = '';
|
| 205 |
}
|
| 206 |
|
| 207 |
$nodecontentbg = theme_get_setting('denver_nodecontentbg');
|
| 208 |
if (!$nodecontentbg)
|
| 209 |
{
|
| 210 |
$nodecontentbg = '';
|
| 211 |
}
|
| 212 |
|
| 213 |
$leftsidebarwidth = theme_get_setting('denver_leftsidebarwidth');
|
| 214 |
if (!$leftsidebarwidth)
|
| 215 |
{
|
| 216 |
$leftsidebarwidth = '';
|
| 217 |
}
|
| 218 |
|
| 219 |
$rightsidebarwidth = theme_get_setting('denver_rightsidebarwidth');
|
| 220 |
if (!$rightsidebarwidth)
|
| 221 |
{
|
| 222 |
$rightsidebarwidth = '';
|
| 223 |
}
|
| 224 |
|
| 225 |
$leftbg = theme_get_setting('denver_leftbg');
|
| 226 |
if (!$leftbg)
|
| 227 |
{
|
| 228 |
$leftbg = '';
|
| 229 |
}
|
| 230 |
|
| 231 |
$blocklbg = theme_get_setting('denver_blocklbg');
|
| 232 |
if (!$blocklbg)
|
| 233 |
{
|
| 234 |
$blocklbg = '';
|
| 235 |
}
|
| 236 |
|
| 237 |
$blockltitle = theme_get_setting('denver_blockltitle');
|
| 238 |
if (!$blockltitle)
|
| 239 |
{
|
| 240 |
$blockltitle = '';
|
| 241 |
}
|
| 242 |
|
| 243 |
$blocklcontent = theme_get_setting('denver_blocklcontent');
|
| 244 |
if (!$blocklcontent)
|
| 245 |
{
|
| 246 |
$blocklcontent = '';
|
| 247 |
}
|
| 248 |
|
| 249 |
$rightbg = theme_get_setting('denver_rightbg');
|
| 250 |
if (!$rightbg)
|
| 251 |
{
|
| 252 |
$rightbg = '';
|
| 253 |
}
|
| 254 |
|
| 255 |
$blockrbg = theme_get_setting('denver_blockrbg');
|
| 256 |
if (!$blockrbg)
|
| 257 |
{
|
| 258 |
$blockrbg = '';
|
| 259 |
}
|
| 260 |
|
| 261 |
$blockrtitle = theme_get_setting('denver_blockrtitle');
|
| 262 |
if (!$blockrtitle)
|
| 263 |
{
|
| 264 |
$blockrtitle = '';
|
| 265 |
}
|
| 266 |
|
| 267 |
$blockrcontent = theme_get_setting('denver_blockrcontent');
|
| 268 |
if (!$blockrcontent)
|
| 269 |
{
|
| 270 |
$blockrcontent = '';
|
| 271 |
}
|
| 272 |
|
| 273 |
$footerbg = theme_get_setting('denver_footerbg');
|
| 274 |
if (!$footerbg)
|
| 275 |
{
|
| 276 |
$footerbg = '';
|
| 277 |
}
|
| 278 |
|
| 279 |
$style = theme_get_setting('denver_style');
|
| 280 |
if (!$style)
|
| 281 |
{
|
| 282 |
$style = '';
|
| 283 |
}
|
| 284 |
|
| 285 |
$suckerfishcolor = theme_get_setting('denver_suckerfishcolor');
|
| 286 |
if (!$suckerfishcolor)
|
| 287 |
{
|
| 288 |
$suckerfishcolor = '';
|
| 289 |
}
|
| 290 |
|
| 291 |
if (isset($_COOKIE["denverstyle"])) {
|
| 292 |
$style = $_COOKIE["denverstyle"];
|
| 293 |
}
|
| 294 |
|
| 295 |
if (theme_get_setting('denver_suckerfish')) {
|
| 296 |
drupal_add_js(drupal_get_path('theme', 'denver') . '/js/suckerfish.js', 'theme');
|
| 297 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/suckerfish_' . $suckerfishcolor . '.css', 'theme');
|
| 298 |
}
|
| 299 |
|
| 300 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $style . '.css', 'theme');
|
| 301 |
|
| 302 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $bodybg . '.css', 'theme');
|
| 303 |
|
| 304 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $font . '.css', 'theme');
|
| 305 |
|
| 306 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $width . '.css', 'theme');
|
| 307 |
|
| 308 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $padding . '.css', 'theme');
|
| 309 |
|
| 310 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $pgheader . '.css', 'theme');
|
| 311 |
|
| 312 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $pgheaderh . '.css', 'theme');
|
| 313 |
|
| 314 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $logohalign . '.css', 'theme');
|
| 315 |
|
| 316 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $navbg . '.css', 'theme');
|
| 317 |
|
| 318 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $ptabsposition . '.css', 'theme');
|
| 319 |
|
| 320 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $ptabs . '.css', 'theme');
|
| 321 |
|
| 322 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $plinksa . '.css', 'theme');
|
| 323 |
|
| 324 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $searchposition . '.css', 'theme');
|
| 325 |
|
| 326 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $secposition . '.css', 'theme');
|
| 327 |
|
| 328 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $secbg . '.css', 'theme');
|
| 329 |
|
| 330 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $pgbg . '.css', 'theme');
|
| 331 |
|
| 332 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $centerbg . '.css', 'theme');
|
| 333 |
|
| 334 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $pgcontentbg . '.css', 'theme');
|
| 335 |
|
| 336 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $mainbg . '.css', 'theme');
|
| 337 |
|
| 338 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $nodebg . '.css', 'theme');
|
| 339 |
|
| 340 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $nodecontentbg . '.css', 'theme');
|
| 341 |
|
| 342 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $leftsidebarwidth . '.css', 'theme');
|
| 343 |
|
| 344 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $rightsidebarwidth . '.css', 'theme');
|
| 345 |
|
| 346 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $leftbg . '.css', 'theme');
|
| 347 |
|
| 348 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $blocklbg . '.css', 'theme');
|
| 349 |
|
| 350 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $blockltitle . '.css', 'theme');
|
| 351 |
|
| 352 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $blocklcontent . '.css', 'theme');
|
| 353 |
|
| 354 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $rightbg . '.css', 'theme');
|
| 355 |
|
| 356 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $blockrbg . '.css', 'theme');
|
| 357 |
|
| 358 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $blockrtitle . '.css', 'theme');
|
| 359 |
|
| 360 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $blockrcontent . '.css', 'theme');
|
| 361 |
|
| 362 |
drupal_add_css(drupal_get_path('theme', 'denver') . '/css/' . $footerbg . '.css', 'theme');
|
| 363 |
|
| 364 |
if (theme_get_setting('denver_themelogo'))
|
| 365 |
{
|
| 366 |
function _phptemplate_variables($hook, $variables = array()) {
|
| 367 |
$variables['logo'] = base_path() . path_to_theme() . '/css/' . theme_get_setting('denver_style') . '/logo.gif';
|
| 368 |
return $variables;
|
| 369 |
}
|
| 370 |
}
|
| 371 |
|
| 372 |
if (theme_get_setting('denver_iepngfix')) {
|
| 373 |
drupal_add_js(drupal_get_path('theme', 'denver') . '/js/jquery.pngFix.js', 'theme');
|
| 374 |
}
|
| 375 |
|
| 376 |
function phptemplate_linksnew($links, $attributes = array('class' => 'links')) {
|
| 377 |
$output = '';
|
| 378 |
if (count($links) > 0) {
|
| 379 |
$output = '<ul'. drupal_attributes($attributes) .'>';
|
| 380 |
$num_links = count($links);
|
| 381 |
$i = 1;
|
| 382 |
foreach ($links as $key => $link) {
|
| 383 |
$class = '';
|
| 384 |
// Automatically add a class to each link and also to each LI
|
| 385 |
if (isset($link['attributes']) && isset($link['attributes']['class'])) {
|
| 386 |
$link['attributes']['class'] .= ' ' . $key;
|
| 387 |
$class = $key;
|
| 388 |
}
|
| 389 |
else {
|
| 390 |
$link['attributes']['class'] = $key;
|
| 391 |
$class = $key;
|
| 392 |
}
|
| 393 |
// Add first and last classes to the list of links to help out themers.
|
| 394 |
$extra_class = '';
|
| 395 |
if ($i == 1) {
|
| 396 |
$extra_class .= 'first ';
|
| 397 |
}
|
| 398 |
if ($i == $num_links) {
|
| 399 |
$extra_class .= 'last ';
|
| 400 |
}
|
| 401 |
// Add class active to active li
|
| 402 |
$current = '';
|
| 403 |
if (strstr($class, 'active')) {
|
| 404 |
$current = ' active';
|
| 405 |
}
|
| 406 |
$output .= '<li class="'. $extra_class . $class . $current .'"><span>';
|
| 407 |
// Is the title HTML?
|
| 408 |
$html = isset($link['html']) && $link['html'];
|
| 409 |
// Initialize fragment and query variables.
|
| 410 |
$link['query'] = isset($link['query']) ? $link['query'] : NULL;
|
| 411 |
$link['fragment'] = isset($link['fragment']) ? $link['fragment'] : NULL;
|
| 412 |
if (isset($link['href'])) {
|
| 413 |
$output .= l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment'], FALSE, $html);
|
| 414 |
}
|
| 415 |
else if ($link['title']) {
|
| 416 |
//Some links are actually not links, but we wrap these in <span> for adding title and class attributes
|
| 417 |
if (!$html) {
|
| 418 |
$link['title'] = check_plain($link['title']);
|
| 419 |
}
|
| 420 |
$output .= '<span'. drupal_attributes($link['attributes']) .'>'. $link['title'] .'</span>';
|
| 421 |
}
|
| 422 |
$i++;
|
| 423 |
$output .= "</span></li>\n";
|
| 424 |
}
|
| 425 |
$output .= '</ul>';
|
| 426 |
}
|
| 427 |
return $output;
|
| 428 |
}
|
| 429 |
|
| 430 |
// Breadcrumb override
|
| 431 |
function denver_breadcrumb($breadcrumb) {
|
| 432 |
if (!empty($breadcrumb)) {
|
| 433 |
$breadcrumb[] = drupal_get_title(); // RADUT's complete breadcrumb ( = ⺠, » = » »)
|
| 434 |
return '<div class="breadcrumb">'. implode(' » ', $breadcrumb) .'</div>';
|
| 435 |
}
|
| 436 |
}
|
| 437 |
|
| 438 |
// get the description displayed when hovering over a menu item
|
| 439 |
function menu_get_active_description() {
|
| 440 |
if ($mid = menu_get_active_nontask_item()) {
|
| 441 |
$item = menu_get_item($mid);
|
| 442 |
return $item['description'];
|
| 443 |
}
|
| 444 |
}
|
| 445 |
|
| 446 |
// Quick fix for the validation error: 'ID "edit-submit" already defined'
|
| 447 |
$elementCountForHack = 0;
|
| 448 |
function phptemplate_submit($element) {
|
| 449 |
global $elementCountForHack;
|
| 450 |
return str_replace('edit-submit', 'edit-submit-' . ++$elementCountForHack, theme('button', $element));
|
| 451 |
}
|
| 452 |
|
| 453 |
function denver_regions() {
|
| 454 |
return array(
|
| 455 |
'page_top' => t('page top'),
|
| 456 |
'header' => t('header'),
|
| 457 |
'header_right' => t('header right'),
|
| 458 |
'suckerfish_menu' => t('suckerfish menu'),
|
| 459 |
'sub_nav' => t('sub nav'),
|
| 460 |
'node_top' => t('node top'),
|
| 461 |
'sidebar_left' => t('left sidebar'),
|
| 462 |
'sidebar_right' => t('right sidebar'),
|
| 463 |
'content_top' => t('content top'),
|
| 464 |
'user1' => t('user1'),
|
| 465 |
'user2' => t('user2'),
|
| 466 |
'user3' => t('user3'),
|
| 467 |
'user4' => t('user4'),
|
| 468 |
'user5' => t('user5'),
|
| 469 |
'user6' => t('user6'),
|
| 470 |
'content_bottom' => t('content bottom'),
|
| 471 |
'footer' => t('footer'),
|
| 472 |
'page_bottom' => t('page bottom')
|
| 473 |
);
|
| 474 |
}
|