@@ -45,8 +45,9 @@ function megatron_id_safe($string) {
45
45
// Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
46
46
$ string = strtolower (preg_replace ('/[^a-zA-Z0-9_-]+/ ' , '- ' , $ string ));
47
47
// If the first character is not a-z, add 'n' in front.
48
- if (!ctype_lower ($ string [0 ])) { // Don't use ctype_alpha since its locale aware.
49
- $ string = 'id ' . $ string ;
48
+ if (!ctype_lower ($ string [0 ])) {
49
+ // Don't use ctype_alpha since its locale aware.
50
+ $ string = 'id ' . $ string ;
50
51
}
51
52
return $ string ;
52
53
}
@@ -55,7 +56,7 @@ function megatron_id_safe($string) {
55
56
---------------------------------------------------------- */
56
57
function megatron_html_head_alter (&$ head_elements ) {
57
58
$ head_elements ['system_meta_content_type ' ]['#attributes ' ] = array (
58
- 'charset ' => 'utf-8 '
59
+ 'charset ' => 'utf-8 ' ,
59
60
);
60
61
}
61
62
@@ -221,7 +222,7 @@ function megatron_breadcrumb($variables) {
221
222
---------------------------------------------------------- */
222
223
function megatron_preprocess_node (&$ variables , $ hook ) {
223
224
// Add a striping class.
224
- $ variables ['classes_array ' ][] = 'node- ' . $ variables ['zebra ' ];
225
+ $ variables ['classes_array ' ][] = 'node- ' . $ variables ['zebra ' ];
225
226
// Add 'node-unpublished' class to unpublished nodes.
226
227
if (!$ variables ['status ' ]) {
227
228
$ variables ['classes_array ' ][] = 'node-unpublished ' ;
@@ -231,7 +232,7 @@ function megatron_preprocess_node(&$variables, $hook) {
231
232
$ variables ['unpublished ' ] = FALSE ;
232
233
}
233
234
if ($ variables ['teaser ' ]) {
234
- $ variables ['classes_array ' ][] = 'row-fluid ' ;
235
+ $ variables ['classes_array ' ][] = 'row-fluid ' ;
235
236
}
236
237
// add node template suggestions for teasers!
237
238
if ($ variables ['view_mode ' ] == 'teaser ' ) {
@@ -397,7 +398,6 @@ function _megatron_content_span($columns = 1) {
397
398
return $ class ;
398
399
}
399
400
400
-
401
401
function megatron_theme_get_info ($ setting_name , $ theme = NULL ) {
402
402
// If no key is given, use the current theme if we can determine it.
403
403
if (!isset ($ theme )) {
@@ -428,7 +428,6 @@ function megatron_theme_get_info($setting_name, $theme = NULL) {
428
428
return $ output ;
429
429
}
430
430
431
-
432
431
/** THEME MEGATRON MAIN MENU LINKS
433
432
Returns navigational links based on a menu tree */
434
433
function megatron_menu_navigation_links ($ tree , $ lvl = 0 ) {
@@ -463,7 +462,6 @@ function megatron_menu_navigation_links($tree, $lvl = 0) {
463
462
return $ result ;
464
463
}
465
464
466
-
467
465
/** OTHER THEME FUNCTIONS
468
466
---------------------------------------------------------- */
469
467
@@ -475,16 +473,15 @@ function megatron_preprocess_megatron_btn_dropdown(&$variables) {
475
473
476
474
// Check if its a array of links so we need to theme it first here.
477
475
if (is_array ($ variables ['links ' ])) {
478
- $ variables ['links ' ] = theme ('links ' , array (
479
- 'links ' => $ variables ['links ' ],
480
- 'attributes ' => array (
481
- 'class ' => array ('dropdown-menu ' ),
482
- ),
483
- ));
476
+ $ variables ['links ' ] = theme ('links ' , array (
477
+ 'links ' => $ variables ['links ' ],
478
+ 'attributes ' => array (
479
+ 'class ' => array ('dropdown-menu ' ),
480
+ ),
481
+ ));
484
482
}
485
483
}
486
484
487
-
488
485
/** theme_megatron_btn_dropdown
489
486
changes link to toggle and adds toggle graphic
490
487
---------------------------------------------------------- */
@@ -493,7 +490,7 @@ function megatron_megatron_btn_dropdown($variables) {
493
490
494
491
// Type class.
495
492
if (isset ($ variables ['type ' ])) {
496
- $ type_class = ' btn- ' . $ variables ['type ' ];
493
+ $ type_class = ' btn- ' . $ variables ['type ' ];
497
494
}
498
495
499
496
// Start markup.
@@ -517,7 +514,6 @@ function megatron_megatron_btn_dropdown($variables) {
517
514
return $ output ;
518
515
}
519
516
520
-
521
517
/** THEME MENU UNORDERED LIST MARKUP
522
518
theme all sets of links
523
519
-- you can override this for specific menus with megatron_menu_tree__menu_name
@@ -532,17 +528,15 @@ function megatron_menu_link(array $variables) {
532
528
$ sub_menu = '' ;
533
529
534
530
if ($ element ['#below ' ]) {
535
- $ sub_menu = drupal_render ($ element ['#below ' ]);
531
+ $ sub_menu = drupal_render ($ element ['#below ' ]);
536
532
}
537
533
538
534
$ element ['#attributes ' ]['class ' ][] = megatron_id_safe ($ element ['#title ' ]);
539
535
$ element ['#attributes ' ]['id ' ] = 'mid- ' . $ element ['#original_link ' ]['mlid ' ];
540
536
$ output = l ($ element ['#title ' ], $ element ['#href ' ], $ element ['#localized_options ' ]);
541
- return '<li ' . drupal_attributes ($ element ['#attributes ' ]) . '> ' . $ output . $ sub_menu . "</li> \n" ;
537
+ return '<li ' . drupal_attributes ($ element ['#attributes ' ]) . '> ' . $ output . $ sub_menu . "</li> \n" ;
542
538
}
543
539
544
-
545
-
546
540
/** TABS
547
541
ZEN TABS (also see custom styles in stylesheet)
548
542
Customize the PRIMARY and SECONDARY LINKS, to allow the admin tabs to work on all browsers
@@ -574,7 +568,6 @@ function megatron_menu_local_tasks() {
574
568
return drupal_render ($ output );
575
569
}
576
570
577
-
578
571
/** FORMS
579
572
Implements hook_form_alter().
580
573
---------------------------------------------------------- */
@@ -808,6 +801,9 @@ function megatron_preprocess_views_view_table(&$variables) {
808
801
$ variables ['classes_array ' ][] = 'table ' ;
809
802
}
810
803
804
+ /**
805
+ * Implements THEME_preprocess_views_view_grid().
806
+ */
811
807
function megatron_preprocess_views_view_grid (&$ variables ) {
812
808
$ variables ['class ' ] .= ' table ' ;
813
809
}
@@ -859,7 +855,6 @@ function megatron_css_alter(&$css) {
859
855
$ css = array_diff_key ($ css , $ excludes );
860
856
}
861
857
862
-
863
858
/** REPLACE CORE jQUERY
864
859
Replace jQuery with updated version
865
860
---------------------------------------------------------- */
@@ -876,13 +871,12 @@ function megatron_js_alter(&$javascript) {
876
871
}
877
872
}
878
873
879
-
880
874
function _megatron_alter ($ files , $ type ) {
881
875
$ output = array ();
882
876
883
- foreach ($ files as $ key => $ value ) {
877
+ foreach ($ files as $ key => $ value ) {
884
878
if (isset ($ files [$ key ][$ type ])) {
885
- foreach ($ files [$ key ][$ type ] as $ file => $ name ) {
879
+ foreach ($ files [$ key ][$ type ] as $ file => $ name ) {
886
880
$ output [$ name ] = FALSE ;
887
881
}
888
882
}
@@ -965,14 +959,14 @@ function megatron_megatron_links($variables) {
965
959
$ output .= '<span ' . $ span_attributes . '> ' . $ link ['title ' ] . '</span> ' ;
966
960
}
967
961
968
- if (count ($ children ) > 0 ) {
969
- $ attributes = array ();
970
- $ attributes ['class ' ] = array ('dropdown-menu ' );
971
- $ output .= theme ('megatron_links ' , array ('links ' => $ children , 'attributes ' => $ attributes ));
972
- $ output .= '</div> ' ;
973
- }
962
+ if (count ($ children ) > 0 ) {
963
+ $ attributes = array ();
964
+ $ attributes ['class ' ] = array ('dropdown-menu ' );
965
+ $ output .= theme ('megatron_links ' , array ('links ' => $ children , 'attributes ' => $ attributes ));
966
+ $ output .= '</div> ' ;
967
+ }
974
968
975
- $ output .= "</li> \n" ;
969
+ $ output .= "</li> \n" ;
976
970
}
977
971
978
972
$ output .= '</ul> ' ;
0 commit comments