📜 ⬆️ ⬇️

Create a theme for Drupal. Part 2

image Part 1

Preprocesses


Preprocesses are needed to determine which variables will be available in the templates. We will add preprocesses to sites / all / themes / mytheme / preprocess . Create preprocess-page.inc files - for the page, preprocess-node.inc - for content, preprocess-header.inc - for the header, preprocess-footer.inc - for the basement, preprocess-region.inc - for regions, preprocess-block .inc - for blocks, preprocess-comment.inc - for comments. We can also create files of the type preprocess-node-story.inc for processing material of the story or preprocess-block-user.inc type for the user block. This allows you to handle separately different types of site content. Mostly in the preprocessing, I defined classes for different regions of the site.

preprocess-page.inc


Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  1. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  2. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  3. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  4. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  5. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  6. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  7. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  8. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  9. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  10. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  11. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  12. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  13. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  14. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  15. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  16. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  17. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  18. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  19. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  20. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  21. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  22. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  23. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  24. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  25. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  26. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  27. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  28. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  29. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  30. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  31. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  32. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }
  33. Copy Source | Copy HTML if ( $index = array_search(preg_replace( '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s' , '' , 'page-' . drupal_strtolower(arg( 0 ))), $vars [ 'classes_array' ])) { unset ( $vars [ 'classes_array' ][ $index ]); } // $vars [ 'header' ] = theme( 'header' , array ( // => 'front_page' => $vars [ 'front_page' ], 'logo' => $vars [ 'logo' ], 'search_box' => $vars [ 'search_box' ], 'header_line' => $vars [ 'header_line' ], )); $vars [ 'footer' ] = theme( 'footer' , array ( 'front_page' => $vars [ 'front_page' ], 'footer_line' => $vars [ 'footer_line' ], 'page_bottom' => $vars [ 'page_bottom' ], )); // _ if (! $vars [ 'is_front' ]) { // $path = drupal_get_path_alias( $_GET [ 'q' ]); $vars [ 'classes_array' ][] = drupal_html_class( 'page-' . $path ); // list ( $section , ) = explode( '/' , $path , 2 ); if (arg( 0 ) == 'node' ) { if (arg( 1 ) == 'add' ) { $section = 'node-add' ; } elseif (is_numeric(arg( 1 )) && (arg( 2 ) == 'edit' || arg( 2 ) == 'delete' )) { $section = 'node-' . arg( 2 ); } } $vars [ 'classes_array' ][] = drupal_html_class( 'section-' . $section ); }


preprocess-node.inc


Copy Source | Copy HTML
  1. // Create the $ build_mode variable depending on the node display type
  2. switch ( $ vars [ 'node' ] -> build_mode) {
  3. case NODE_BUILD_NORMAL:
  4. $ vars [ 'build_mode' ] = $ vars [ 'teaser' ]? 'teaser' : 'full' ;
  5. break ;
  6. case NODE_BUILD_PREVIEW:
  7. $ vars [ 'build_mode' ] = 'preview' ;
  8. break ;
  9. case NODE_BUILD_SEARCH_INDEX:
  10. $ vars [ 'build_mode' ] = 'search_index' ;
  11. break ;
  12. case NODE_BUILD_SEARCH_RESULT:
  13. $ vars [ 'build_mode' ] = 'search_result' ;
  14. break ;
  15. case NODE_BUILD_RSS:
  16. $ vars [ 'build_mode' ] = 'rss' ;
  17. break ;
  18. case NODE_BUILD_PRINT:
  19. $ vars [ 'build_mode' ] = 'print' ;
  20. break ;
  21. }
  22. // Create $ user_picture variable
  23. $ vars [ 'user_picture' ] = $ vars [ 'picture' ];
  24. // Special classes for materials, depending on the type
  25. // For example: "node-type-page", "node-type-story", "node-type-my-custom-type"
  26. $ vars [ 'classes_array' ] [] = drupal_html_class ( 'node-type-' . $ vars [ 'type' ]);
  27. if ( $ vars [ 'promote' ]) {
  28. $ vars [ 'classes_array' ] [] = 'node-promoted' ;
  29. }
  30. if ( $ vars [ 'sticky' ]) {
  31. $ vars [ 'classes_array' ] [] = 'node-sticky' ;
  32. }
  33. if (! $ vars [ 'status' ]) {
  34. $ vars [ 'classes_array' ] [] = 'node-unpublished' ;
  35. $ vars [ 'unpublished' ] = TRUE;
  36. }
  37. else {
  38. $ vars [ 'unpublished' ] = FALSE;
  39. }
  40. if ( $ vars [ 'uid' ] && $ vars [ 'uid' ] == $ GLOBALS [ 'user' ] -> uid) {
  41. $ vars [ 'classes_array' ] [] = 'node-by-viewer' ; // The node of the current user.
  42. }
  43. if ( $ vars [ 'teaser' ]) {
  44. $ vars [ 'classes_array' ] [] = 'node-teaser' ; // Teaser.
  45. }
  46. if ( isset ( $ vars [ 'preview' ])) {
  47. $ vars [ 'classes_array' ] [] = 'node-preview' ;
  48. }

')

preprocess-header.inc, preprocess-footer.inc


Copy Source | Copy HTML
  1. if ( $ vars [ 'elements' ]) {
  2. // Parse the array that came from the theme () function and add parameters to the variables
  3. foreach ( $ vars [ 'elements' ] as $ ind => $ val ) {
  4. $ vars [ $ ind ] = $ val ;
  5. }
  6. unset ( $ vars [ 'elements' ]);
  7. }


preprocess-region.inc


Copy Source | Copy HTML
  1. // Create $ content and $ region variables
  2. $ vars [ 'content' ] = $ vars [ 'elements' ] [ '#children' ];
  3. $ vars [ 'region' ] = $ vars [ 'elements' ] [ '#region' ];
  4. // Set Classes
  5. $ region = 'region-' . str_replace ( '_' , '-' , $ vars [ 'region' ]);
  6. $ vars [ 'classes_array' ] = array ( 'region' , $ region );
  7. // And the pattern
  8. $ vars [ 'template_files' ] [] = $ region ;


preprocess-block.inc


Copy Source | Copy HTML
  1. $ block = $ vars [ 'block' ];
  2. // Set the $ title and $ content variables
  3. $ vars [ 'content' ] = $ block -> content;
  4. $ vars [ 'title' ] = $ block -> subject;
  5. // Set Classes
  6. $ vars [ 'classes_array' ] [] = 'block-' . $ block -> module;
  7. $ vars [ 'classes_array' ] [] = 'region-' . $ vars [ 'block_zebra' ];
  8. $ vars [ 'classes_array' ] [] = $ vars [ 'zebra' ];
  9. $ vars [ 'classes_array' ] [] = 'region-count-' . $ vars [ 'block_id' ];
  10. $ vars [ 'classes_array' ] [] = 'count-' . $ vars [ 'id' ];
  11. $ vars [ 'edit_links_array' ] = array ();


preprocess-comment.inc


Copy Source | Copy HTML
  1. // Create the $ created variable
  2. $ vars [ 'created' ] = $ vars [ 'date' ];
  3. // Remove the comment topic if it is disabled.
  4. if (variable_get ( 'comment_subject_field_' . $ vars [ 'node' ] -> type, 1 ) == 0 ) {
  5. $ vars [ 'title' ] = '' ;
  6. }
  7. // Styles
  8. if ( $ vars [ 'comment' ] -> new ) {
  9. $ vars [ 'classes_array' ] [] = 'comment-new' ;
  10. }
  11. if ( $ vars [ 'comment' ] -> status == COMMENT_NOT_PUBLISHED) {
  12. $ vars [ 'unpublished' ] = TRUE;
  13. }
  14. else {
  15. $ vars [ 'unpublished' ] = FALSE;
  16. $ vars [ 'classes_array' ] [] = $ vars [ 'status' ];
  17. }
  18. // zebra
  19. if ( $ vars [ 'id' ] == 1 ) {
  20. $ vars [ 'classes_array' ] [] = 'first' ;
  21. }
  22. if ( $ vars [ 'id' ] == $ vars [ 'node' ] -> comment_count) {
  23. $ vars [ 'classes_array' ] [] = 'last' ;
  24. }
  25. $ vars [ 'classes_array' ] [] = $ vars [ 'zebra' ];
  26. if ( $ vars [ 'comment' ] -> uid == 0 ) {
  27. // Anonymous user comment
  28. $ vars [ 'classes_array' ] [] = 'comment-by-anonymous' ;
  29. }
  30. else {
  31. if ( $ vars [ 'comment' ] -> uid == $ vars [ 'node' ] -> uid) {
  32. // Author's comment node
  33. $ vars [ 'classes_array' ] [] = 'comment-by-node-author' ;
  34. }
  35. if ( $ vars [ 'comment' ] -> uid == $ GLOBALS [ 'user' ] -> uid) {
  36. // Comment of the current user
  37. $ vars [ 'classes_array' ] [] = 'comment-by-viewer' ;
  38. }
  39. }


Part 3

Source: https://habr.com/ru/post/86460/


All Articles