Révision a08833bd
Ajouté par Assos Assos il y a presque 8 ans
drupal7/sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc | ||
---|---|---|
63 | 63 |
at_load_layout_js_settings($theme_name); |
64 | 64 |
|
65 | 65 |
// Load Responsive Styles. |
66 |
if (at_get_setting('disable_responsive_styles', $theme_name) === 0) {
|
|
66 |
if (at_get_setting('disable_responsive_styles', $theme_name) == 0) { |
|
67 | 67 |
at_load_responsive_css($path, $theme_name); |
68 | 68 |
} |
69 | 69 |
|
70 | 70 |
// Load fonts and/or Custom CSS and the menu toggle files |
71 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
71 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
72 | 72 |
// Fonts CSS |
73 |
if (at_get_setting('enable_font_settings', $theme_name) === 1) {
|
|
73 |
if (at_get_setting('enable_font_settings', $theme_name) == 1) { |
|
74 | 74 |
at_load_fonts($path, $theme_name); |
75 | 75 |
} |
76 | 76 |
// Custom CSS |
77 |
if (at_get_setting('enable_custom_css', $theme_name) === 1) {
|
|
77 |
if (at_get_setting('enable_custom_css', $theme_name) == 1) { |
|
78 | 78 |
at_load_custom_css($path, $theme_name); |
79 | 79 |
} |
80 | 80 |
// Load the menu toggle js and css files |
81 |
if (at_get_setting('enable_menu_toggle', $theme_name) === 1) {
|
|
81 |
if (at_get_setting('enable_menu_toggle', $theme_name) == 1) { |
|
82 | 82 |
at_load_menu_toggle($path, $theme_name); |
83 | 83 |
} |
84 | 84 |
// Load Extension Settings CSS |
... | ... | |
91 | 91 |
} |
92 | 92 |
|
93 | 93 |
// Load specific subtheme scripts |
94 |
if (at_get_setting('load_onmediaqueryjs', $theme_name) === 1) {
|
|
94 |
if (at_get_setting('load_onmediaqueryjs', $theme_name) == 1) { |
|
95 | 95 |
at_load_subtheme_script('scripts/media_queries.js', $theme_name, 'footer', '100'); |
96 | 96 |
} |
97 | 97 |
|
... | ... | |
101 | 101 |
// Set the skip navigation target ID |
102 | 102 |
$vars['skip_link_target'] = '#main-content'; |
103 | 103 |
if (at_get_setting('skip_link_target', $theme_name)) { |
104 |
$skip_link_target = at_get_setting('skip_link_target', $theme_name); |
|
105 |
$vars['skip_link_target'] = check_plain($skip_link_target); |
|
104 |
$vars['skip_link_target'] = check_plain(at_get_setting('skip_link_target', $theme_name)); |
|
106 | 105 |
} |
107 | 106 |
|
108 | 107 |
// Generate body classes |
... | ... | |
115 | 114 |
// Do some legacy stuff for 7.x-2.x themes that have google webfonts running |
116 | 115 |
// on the old system. Scan for the existence of a "release" key and |
117 | 116 |
// conditionally load google.web.fonts.inc |
118 |
if (!isset($info['release']) || $info['release'] === '7.x-2.x') {
|
|
117 |
if (!isset($info['release']) || $info['release'] == '7.x-2.x') { |
|
119 | 118 |
include_once(drupal_get_path('theme', 'adaptivetheme') . '/inc/google.web.fonts.inc'); |
120 | 119 |
} |
121 | 120 |
|
122 | 121 |
// Load debuggers if enabled. |
123 |
if (at_get_setting('expose_regions', $theme_name) === 1 || at_get_setting('show_window_size', $theme_name) === 1 || at_get_setting('load_all_panels', $theme_name) === 1) {
|
|
122 |
if (at_get_setting('expose_regions', $theme_name) == 1 || at_get_setting('show_window_size', $theme_name) == 1 || at_get_setting('load_all_panels', $theme_name) == 1) {
|
|
124 | 123 |
at_load_debuggers($theme_name); |
125 | 124 |
} |
126 | 125 |
} |
... | ... | |
133 | 132 |
$theme_name = $theme_key; |
134 | 133 |
|
135 | 134 |
// Set up logo element |
136 |
if (at_get_setting('toggle_logo', $theme_name) === 1) {
|
|
135 |
if (at_get_setting('toggle_logo', $theme_name) == 1) { |
|
137 | 136 |
$vars['site_logo'] = &drupal_static('adaptivetheme_preprocess_page_site_logo'); |
138 | 137 |
if (empty($vars['site_logo'])) { |
139 | 138 |
$logo_image_path = check_url($vars['logo']); |
... | ... | |
160 | 159 |
$vars['site_name'] = &drupal_static('adaptivetheme_preprocess_page_site_name'); |
161 | 160 |
if (empty($vars['site_name'])) { |
162 | 161 |
$vars['site_name_title'] = variable_get('site_name', 'Drupal'); |
163 |
$vars['site_name'] = l($vars['site_name_title'], '<front>', array('attributes' => array('title' => t('Home page')))); |
|
162 |
$vars['site_name'] = l($vars['site_name_title'], '<front>', $options = array('attributes' => array('title' => t('Home page'))));
|
|
164 | 163 |
$vars['site_name_unlinked'] = $vars['site_name_title']; |
165 | 164 |
} |
166 | 165 |
|
... | ... | |
168 | 167 |
$vars['site_name_attributes_array'] = array(); |
169 | 168 |
$vars['visibility'] = ''; |
170 | 169 |
$vars['hide_site_name'] = FALSE; |
171 |
if (at_get_setting('toggle_name', $theme_name) === 0) {
|
|
170 |
if (at_get_setting('toggle_name', $theme_name) == 0) { |
|
172 | 171 |
// Keep the visibility variable to maintain backwards compatibility |
173 | 172 |
$vars['visibility'] = 'element-invisible'; |
174 | 173 |
$vars['site_name_attributes_array']['class'][] = $vars['visibility']; |
... | ... | |
218 | 217 |
$vars['search_box'] = '<div id="search-box" role="search">' . drupal_render($search_box) . '</div>'; |
219 | 218 |
} |
220 | 219 |
|
220 |
// Test if this is a page manager page, we need this to set things like the page title in themes |
|
221 |
// want to control the page title, e.g. not show it on nodes. |
|
222 |
$vars['page_manager_get_current_page'] = FALSE; |
|
223 |
if (function_exists('page_manager_get_current_page')) { |
|
224 |
if (page_manager_get_current_page()) { |
|
225 |
$vars['page_manager_get_current_page'] = TRUE; |
|
226 |
} |
|
227 |
} |
|
228 |
|
|
221 | 229 |
// Process enabled Extensions |
222 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
230 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
223 | 231 |
// Generate page classes, in AT Core these are all Extensions |
224 | 232 |
if ($page_classes = at_generate_page_classes($vars, $theme_name)) { |
225 | 233 |
foreach ($page_classes as $class_name) { |
... | ... | |
227 | 235 |
} |
228 | 236 |
} |
229 | 237 |
// Process modify markup settings |
230 |
if (at_get_setting('enable_markup_overides', $theme_name) === 1) {
|
|
238 |
if (at_get_setting('enable_markup_overides', $theme_name) == 1) { |
|
231 | 239 |
// Remove the infernal feed icons |
232 |
if (at_get_setting('feed_icons_hide', $theme_name) === 1) {
|
|
240 |
if (at_get_setting('feed_icons_hide', $theme_name) == 1) { |
|
233 | 241 |
$vars['feed_icons'] = ''; |
234 | 242 |
} |
243 |
// Remove local tasks |
|
244 |
if (at_get_setting('unset_local_tasks', $theme_name) == 1) { |
|
245 |
$vars['primary_local_tasks'] = ''; |
|
246 |
$vars['secondary_local_tasks'] = ''; |
|
247 |
} |
|
235 | 248 |
} |
236 | 249 |
} |
237 | 250 |
|
... | ... | |
278 | 291 |
|
279 | 292 |
// Attribution variable used in admin theme and some others |
280 | 293 |
$vars['attribution'] = ''; |
281 |
if (at_get_setting('attribution_toggle', $theme_name) === 1) {
|
|
294 |
if (at_get_setting('attribution_toggle', $theme_name) == 1) { |
|
282 | 295 |
$vars['attribution'] = "<small class=\"attribution\">Premium Drupal Theme by <a href=\"http://adaptivethemes.com\">Adaptivethemes.com</a></small>"; |
283 | 296 |
} |
284 | 297 |
|
285 | 298 |
// Work around a perculier bug/feature(?) in Drupal 7 which incorrectly sets |
286 | 299 |
// the page title to "User account" for all three of these pages. |
287 | 300 |
$title = drupal_get_title(); |
288 |
if (arg(0) === 'user' && $title == t('User account')) {
|
|
289 |
if (arg(1) === 'login' || arg(1) == '') {
|
|
301 |
if (arg(0) == 'user' && $title == t('User account')) { |
|
302 |
if (arg(1) == 'login' || arg(1) == '') { |
|
290 | 303 |
drupal_set_title(t('User login')); |
291 | 304 |
} |
292 |
if (arg(1) === 'password') {
|
|
305 |
if (arg(1) == 'password') { |
|
293 | 306 |
drupal_set_title(t('Request new password')); |
294 | 307 |
} |
295 |
if (arg(1) === 'register') {
|
|
308 |
if (arg(1) == 'register') { |
|
296 | 309 |
drupal_set_title(t('Create new account')); |
297 | 310 |
} |
298 | 311 |
} |
... | ... | |
308 | 321 |
$region = $vars['region']; |
309 | 322 |
|
310 | 323 |
// Add a "sidebar" class to sidebar regions |
311 |
if (strpos($region, 'sidebar_') === 0) {
|
|
324 |
if ($region == 'sidebar_first' || $region == 'sidebar_second') {
|
|
312 | 325 |
$vars['classes_array'][] = 'sidebar'; |
313 | 326 |
// Allow a region-specific template to override the region--sidebar suggestion. |
314 | 327 |
array_unshift($vars['theme_hook_suggestions'], 'region__sidebar'); |
315 | 328 |
} |
316 | 329 |
|
317 | 330 |
// Float region block classes |
318 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
319 |
if (at_get_setting('enable_float_region_blocks', $theme_name) === 1) {
|
|
331 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
332 |
if (at_get_setting('enable_float_region_blocks', $theme_name) == 1) { |
|
320 | 333 |
|
321 | 334 |
// Make sure there is something set for the region, get the column count |
322 | 335 |
if ($float_blocks_regions_class = at_get_setting('float_block_' . $region)) { |
... | ... | |
402 | 415 |
} |
403 | 416 |
|
404 | 417 |
// Search is never a section, its just a div |
405 |
if ($vars['block_html_id'] === 'block-search-form') {
|
|
418 |
if ($vars['block_html_id'] == 'block-search-form') { |
|
406 | 419 |
$vars['tag'] = 'div'; |
407 | 420 |
} |
408 | 421 |
|
... | ... | |
424 | 437 |
} |
425 | 438 |
|
426 | 439 |
// The menu bar region gets special treatment for the block template |
427 |
if ($vars['block']->region === 'menu_bar') {
|
|
440 |
if ($vars['block']->region == 'menu_bar') { |
|
428 | 441 |
$vars['classes_array'][] = 'menu-wrapper'; |
429 | 442 |
$vars['classes_array'][] = 'menu-bar-wrapper'; |
430 | 443 |
$vars['classes_array'][] = 'clearfix'; |
... | ... | |
432 | 445 |
} |
433 | 446 |
|
434 | 447 |
// The menu bar region gets special treatment for the block template |
435 |
if (at_get_setting('enable_menu_toggle', $theme_name) === 1) {
|
|
436 |
if (at_get_setting('menu_toggle_menu_bar', $theme_name) === 1) {
|
|
437 |
if ($vars['block']->region === 'menu_bar') {
|
|
448 |
if (at_get_setting('enable_menu_toggle', $theme_name) == 1) { |
|
449 |
if (at_get_setting('menu_toggle_menu_bar', $theme_name) == 1) { |
|
450 |
if ($vars['block']->region == 'menu_bar') { |
|
438 | 451 |
$vars['classes_array'][] = 'at-menu-toggle'; |
439 | 452 |
} |
440 | 453 |
} |
441 |
if (at_get_setting('menu_toggle_leaderboard', $theme_name) === 1 && $vars['block']->region === 'leaderboard') {
|
|
454 |
if (at_get_setting('menu_toggle_leaderboard', $theme_name) == 1 && $vars['block']->region == 'leaderboard') {
|
|
442 | 455 |
$vars['classes_array'][] = 'at-menu-toggle'; |
443 | 456 |
$vars['classes_array'][] = 'clearfix'; |
444 | 457 |
} |
445 |
if (at_get_setting('menu_toggle_header', $theme_name) === 1 && $vars['block']->region === 'header') {
|
|
458 |
if (at_get_setting('menu_toggle_header', $theme_name) == 1 && $vars['block']->region == 'header') {
|
|
446 | 459 |
$vars['classes_array'][] = 'at-menu-toggle'; |
447 | 460 |
$vars['classes_array'][] = 'clearfix'; |
448 | 461 |
} |
449 | 462 |
} |
450 | 463 |
|
451 | 464 |
// Add extra classes if required |
452 |
if (at_get_setting('extra_block_classes', $theme_name) === 1) {
|
|
465 |
if (at_get_setting('extra_block_classes', $theme_name) == 1) { |
|
453 | 466 |
|
454 | 467 |
// Zebra |
455 | 468 |
$vars['classes_array'][] = $vars['block_zebra']; |
456 | 469 |
|
457 | 470 |
// Position? |
458 |
if ($vars['block_id'] === 1) {
|
|
471 |
if ($vars['block_id'] == 1) { |
|
459 | 472 |
$vars['classes_array'][] = 'first'; |
460 | 473 |
} |
461 | 474 |
if (isset($vars['block']->last_in_region)) { |
... | ... | |
473 | 486 |
} |
474 | 487 |
|
475 | 488 |
// Add classes to theme the horizontal block option |
476 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
477 |
if (at_get_setting('enable_markup_overides', $theme_name) === 1) {
|
|
489 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
490 |
if (at_get_setting('enable_markup_overides', $theme_name) == 1) { |
|
478 | 491 |
// Change the user menu title to the user name. |
479 |
if (at_get_setting('user_block_user_name', $theme_name) === 1) {
|
|
492 |
if (at_get_setting('user_block_user_name', $theme_name) == 1) { |
|
480 | 493 |
if ($vars['block']->module == 'system' && $vars['block']->delta == 'user-menu') { |
481 | 494 |
if (user_is_logged_in()) { |
482 | 495 |
$vars['title'] = check_plain($user->name); |
... | ... | |
484 | 497 |
} |
485 | 498 |
} |
486 | 499 |
// Horizontal block classes. |
487 |
if (at_get_setting('horizontal_login_block', $theme_name) === 1 && $vars['block']->module === 'user' && $vars['block']->delta === 'login') {
|
|
500 |
if (at_get_setting('horizontal_login_block', $theme_name) == 1 && $vars['block']->module == 'user' && $vars['block']->delta == 'login') {
|
|
488 | 501 |
$vars['classes_array'][] = 'lb-h'; |
489 | 502 |
$vars['title_attributes_array']['class'][] = 'element-invisible'; |
490 | 503 |
} |
491 |
if (at_get_setting('slider_login_block', $theme_name) === 1 && $vars['block']->module === 'user' && $vars['block']->delta === 'login') {
|
|
504 |
if (at_get_setting('slider_login_block', $theme_name) == 1 && $vars['block']->module == 'user' && $vars['block']->delta == 'login') {
|
|
492 | 505 |
$vars['classes_array'][] = 'lb-s'; |
493 | 506 |
} |
494 | 507 |
} |
... | ... | |
609 | 622 |
} |
610 | 623 |
|
611 | 624 |
// Image fields |
612 |
if ($element['#field_type'] === 'image') {
|
|
625 |
if ($element['#field_type'] == 'image') { |
|
613 | 626 |
|
614 | 627 |
// Set some vars for image captioning, these always need to be initialized |
615 | 628 |
$vars['image_caption_teaser'] = FALSE; |
616 | 629 |
$vars['image_caption_full'] = FALSE; |
617 | 630 |
|
618 | 631 |
// Dont run anything if extensions or image settings are disabled |
619 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
620 |
if (at_get_setting('enable_image_settings', $theme_name) === 1) {
|
|
632 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
633 |
if (at_get_setting('enable_image_settings', $theme_name) == 1) { |
|
621 | 634 |
|
622 | 635 |
// Reduce number of images in teaser view mode to single image |
623 |
if (at_get_setting('image_teaser', $theme_name) === 1) {
|
|
636 |
if (at_get_setting('image_teaser', $theme_name) == 1) { |
|
624 | 637 |
if ($element['#view_mode'] == 'teaser') { |
625 | 638 |
$item = reset($vars['items']); |
626 | 639 |
$vars['items'] = array($item); |
... | ... | |
628 | 641 |
} |
629 | 642 |
|
630 | 643 |
// Captions |
631 |
if (at_get_setting('image_caption_teaser', $theme_name) === 1) {
|
|
644 |
if (at_get_setting('image_caption_teaser', $theme_name) == 1) { |
|
632 | 645 |
$vars['image_caption_teaser'] = TRUE; |
633 | 646 |
} |
634 |
if (at_get_setting('image_caption_full', $theme_name) === 1) {
|
|
647 |
if (at_get_setting('image_caption_full', $theme_name) == 1) { |
|
635 | 648 |
$vars['image_caption_full'] = TRUE; |
636 | 649 |
} |
637 | 650 |
} |
... | ... | |
650 | 663 |
$vars['classes_array'][] = 'article'; |
651 | 664 |
|
652 | 665 |
// Extra classes if required |
653 |
if (at_get_setting('extra_article_classes', $theme_name) === 1) {
|
|
666 |
if (at_get_setting('extra_article_classes', $theme_name) == 1) { |
|
654 | 667 |
|
655 | 668 |
// Zebra |
656 | 669 |
$vars['classes_array'][] = $vars['zebra']; |
... | ... | |
664 | 677 |
|
665 | 678 |
// User picture? |
666 | 679 |
// Should we all a check for the global settings here? SEE: https://drupal.org/node/2020687 |
667 |
if (at_get_setting('toggle_node_user_picture', $theme_name) === 1) {
|
|
680 |
if (at_get_setting('toggle_node_user_picture', $theme_name) == 1) { |
|
668 | 681 |
if ($vars['display_submitted'] && !empty($vars['picture'])) { |
669 | 682 |
$vars['classes_array'][] = 'node-with-picture'; |
670 | 683 |
} |
... | ... | |
677 | 690 |
} |
678 | 691 |
|
679 | 692 |
// Image alignment and caption classes |
680 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
681 |
if (at_get_setting('enable_image_settings', $theme_name) === 1) {
|
|
693 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
694 |
if (at_get_setting('enable_image_settings', $theme_name) == 1) { |
|
682 | 695 |
if ($vars['view_mode'] !== 'teaser') { |
683 | 696 |
if ($image_caption_full = at_get_setting('image_caption_full', $theme_name)) { |
684 | 697 |
$vars['classes_array'][] = $image_caption_full; |
... | ... | |
720 | 733 |
$vars['datetime'] = format_date($vars['created'], 'custom', 'Y-m-d\TH:i:sO'); // PHP 'c' format is not proper ISO8601! |
721 | 734 |
|
722 | 735 |
// Publication date, formatted with time element |
723 |
$vars['publication_date'] = '<time datetime="' . $vars['datetime'] . '" pubdate="pubdate">' . $vars['date'] . '</time>';
|
|
736 |
$vars['publication_date'] = '<time datetime="' . $vars['datetime'] . '">' . $vars['date'] . '</time>'; |
|
724 | 737 |
|
725 | 738 |
// Last update variables |
726 | 739 |
$vars['datetime_updated'] = format_date($vars['node']->changed, 'custom', 'Y-m-d\TH:i:sO'); |
727 | 740 |
$vars['custom_date_and_time'] = date('jS F, Y - g:ia', $vars['node']->changed); |
728 | 741 |
|
729 | 742 |
// Last updated formatted in time element |
730 |
$vars['last_update'] = '<time datetime="' . $vars['datetime_updated'] . '" pubdate="pubdate">' . $vars['custom_date_and_time'] . '</time>';
|
|
743 |
$vars['last_update'] = '<time datetime="' . $vars['datetime_updated'] . '">' . $vars['custom_date_and_time'] . '</time>'; |
|
731 | 744 |
|
732 | 745 |
// Build the submitted variable used by default in node templates |
733 | 746 |
if (variable_get('node_submitted_' . $vars['node']->type, TRUE)) { |
... | ... | |
763 | 776 |
$theme_name = $theme_key; |
764 | 777 |
|
765 | 778 |
// Extra comment classes if required |
766 |
if (at_get_setting('extra_comment_classes', $theme_name) === 1) {
|
|
779 |
if (at_get_setting('extra_comment_classes', $theme_name) == 1) { |
|
767 | 780 |
|
768 | 781 |
// Zebra |
769 | 782 |
$vars['classes_array'][] = $vars['zebra']; |
770 | 783 |
|
771 | 784 |
// Position? |
772 |
if ($vars['id'] === 1) {
|
|
785 |
if ($vars['id'] == 1) { |
|
773 | 786 |
$vars['classes_array'][] = 'first'; |
774 | 787 |
} |
775 |
if ($vars['id'] === $vars['node']->comment_count) {
|
|
788 |
if ($vars['id'] == $vars['node']->comment_count) { |
|
776 | 789 |
$vars['classes_array'][] = 'last'; |
777 | 790 |
} |
778 | 791 |
|
779 | 792 |
// Title hidden? |
780 |
if (at_get_setting('comments_hide_title', $theme_name) === 1) {
|
|
793 |
if (at_get_setting('comments_hide_title', $theme_name) == 1) { |
|
781 | 794 |
$vars['classes_array'][] = 'comment-title-hidden'; |
782 | 795 |
} |
783 | 796 |
|
784 | 797 |
// User picture? |
785 | 798 |
// Should we add a check for the global settings here? SEE: https://drupal.org/node/2020687 |
786 |
if (at_get_setting('toggle_comment_user_picture', $theme_name) === 1) {
|
|
799 |
if (at_get_setting('toggle_comment_user_picture', $theme_name) == 1) { |
|
787 | 800 |
if (!empty($vars['picture'])) { |
788 | 801 |
$vars['classes_array'][] = 'comment-with-picture'; |
789 | 802 |
} |
... | ... | |
799 | 812 |
$vars['title_attributes_array']['class'][] = 'comment-title'; |
800 | 813 |
|
801 | 814 |
// Title hidden? |
802 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
803 |
if (at_get_setting('enable_markup_overides', $theme_name) === 1) {
|
|
804 |
if (at_get_setting('comments_hide_title', $theme_name) === 1) {
|
|
815 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
816 |
if (at_get_setting('enable_markup_overides', $theme_name) == 1) { |
|
817 |
if (at_get_setting('comments_hide_title', $theme_name) == 1) { |
|
805 | 818 |
$vars['title_attributes_array']['class'][] = 'element-invisible'; |
806 | 819 |
} |
807 | 820 |
} |
... | ... | |
835 | 848 |
$vars['submitted'] = t('Submitted by !username on !datetime', |
836 | 849 |
array( |
837 | 850 |
'!username' => $vars['author'], |
838 |
'!datetime' => '<time datetime="' . $vars['datetime'] . '" pubdate="pubdate">' . $vars['created'] . '</time>',
|
|
851 |
'!datetime' => '<time datetime="' . $vars['datetime'] . '">' . $vars['created'] . '</time>', |
|
839 | 852 |
) |
840 | 853 |
); |
841 | 854 |
|
842 | 855 |
// Unpublished? |
843 | 856 |
$vars['unpublished'] = ''; // Initialize for backwards compatibility |
844 |
if ($vars['status'] === 'comment-unpublished') {
|
|
857 |
if ($vars['status'] == 'comment-unpublished') { |
|
845 | 858 |
// Use the title prefix to render the unpublished message |
846 | 859 |
$vars['title_prefix']['unpublished']['#markup'] = '<p class="unpublished">' . t('Unpublished') . '</p>'; |
847 | 860 |
} |
... | ... | |
884 | 897 |
$vars['classes_array'] = array('nav', 'clearfix'); |
885 | 898 |
|
886 | 899 |
// Classes for toggle menus |
887 |
if (at_get_setting('enable_menu_toggle', $theme_name) === 1) {
|
|
888 |
if (at_get_setting('menu_toggle_main_menu', $theme_name) === 1 && $type === 'primary') {
|
|
900 |
if (at_get_setting('enable_menu_toggle', $theme_name) == 1) { |
|
901 |
if (at_get_setting('menu_toggle_main_menu', $theme_name) == 1 && $type == 'primary') {
|
|
889 | 902 |
$vars['classes_array'][] = 'at-menu-toggle'; |
890 | 903 |
} |
891 |
if (at_get_setting('menu_toggle_secondary_menu', $theme_name) === 1 && $type === 'secondary') {
|
|
904 |
if (at_get_setting('menu_toggle_secondary_menu', $theme_name) == 1 && $type == 'secondary') {
|
|
892 | 905 |
$vars['classes_array'][] = 'at-menu-toggle'; |
893 | 906 |
} |
894 | 907 |
} |
... | ... | |
912 | 925 |
global $theme_key; |
913 | 926 |
$theme_name = $theme_key; |
914 | 927 |
// Add rel=author for SEO and supporting search engines |
915 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
916 |
if (at_get_setting('enable_markup_overides', $theme_name) === 1) {
|
|
917 |
if (at_get_setting('rel_author', $theme_name) === 1) {
|
|
928 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
929 |
if (at_get_setting('enable_markup_overides', $theme_name) == 1) { |
|
930 |
if (at_get_setting('rel_author', $theme_name) == 1) { |
|
918 | 931 |
if (isset($vars['link_path'])) { |
919 | 932 |
$vars['link_attributes']['rel'][] = 'author'; |
920 | 933 |
} |
... | ... | |
967 | 980 |
at_load_layout_css($path, $theme_name); |
968 | 981 |
|
969 | 982 |
// Load Responsive Styles. |
970 |
if (at_get_setting('disable_responsive_styles', $theme_name) === 0) {
|
|
983 |
if (at_get_setting('disable_responsive_styles', $theme_name) == 0) { |
|
971 | 984 |
at_load_responsive_css($path, $theme_name); |
972 | 985 |
} |
973 | 986 |
|
974 | 987 |
// Load fonts and/or Custom CSS |
975 |
if (at_get_setting('enable_extensions', $theme_name) === 1) {
|
|
988 |
if (at_get_setting('enable_extensions', $theme_name) == 1) { |
|
976 | 989 |
// Fonts CSS |
977 |
if (at_get_setting('enable_font_settings', $theme_name) === 1) {
|
|
990 |
if (at_get_setting('enable_font_settings', $theme_name) == 1) { |
|
978 | 991 |
at_load_fonts($path, $theme_name); |
979 | 992 |
} |
980 | 993 |
// Custom CSS |
981 |
if (at_get_setting('enable_custom_css', $theme_name) === 1) {
|
|
994 |
if (at_get_setting('enable_custom_css', $theme_name) == 1) { |
|
982 | 995 |
at_load_custom_css($path, $theme_name); |
983 | 996 |
} |
984 | 997 |
// Load Extension Settings CSS |
... | ... | |
1004 | 1017 |
|
1005 | 1018 |
// Attribution variable used in admin theme and some others |
1006 | 1019 |
$vars['attribution'] = ''; |
1007 |
if (at_get_setting('attribution_toggle', $theme_name) === 1) {
|
|
1020 |
if (at_get_setting('attribution_toggle', $theme_name) == 1) { |
|
1008 | 1021 |
$vars['attribution'] = "<small class=\"attribution\">Premium Drupal Theme by <a href=\"http://adaptivethemes.com\">Adaptivethemes.com</a></small>"; |
1009 | 1022 |
} |
1010 | 1023 |
} |
... | ... | |
1021 | 1034 |
*/ |
1022 | 1035 |
function adaptivetheme_preprocess_breadcrumb(&$vars) { |
1023 | 1036 |
// Add Google rich snippets to breadcrumbs using RDFa |
1024 |
if (module_exists('rdf')) { |
|
1037 |
if (module_exists('rdf') && !empty($vars['breadcrumb'])) {
|
|
1025 | 1038 |
$snippet_url = ' rel="v:url" '; |
1026 | 1039 |
$snippet_title = ' property="v:title" '; |
1040 |
|
|
1027 | 1041 |
foreach ($vars['breadcrumb'] as $key => $breadcrumb) { |
1028 | 1042 |
preg_match_all('/<([\w]+)[^>]*>.*?<\/\\1>/', $breadcrumb, $matches); |
1029 | 1043 |
if (count($matches[0]) > 0) { |
Formats disponibles : Unified diff
Weekly update of contrib modules