| 1 |
<?php |
| 2 |
namespace QuadLayers\QuadMenu\Frontend\Walker; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
die( '-1' ); |
| 6 |
} |
| 7 |
use QuadLayers\QuadMenu\Frontend\Walker\QuadMenu_Item; |
| 8 |
|
| 9 |
/** |
| 10 |
* QuadMenuItemMega Class |
| 11 |
*/ |
| 12 |
class QuadMenu_Item_Mega extends QuadMenu_Item { |
| 13 |
|
| 14 |
protected $type = 'mega'; |
| 15 |
|
| 16 |
function init() { |
| 17 |
$this->args->has_background = ( 0 === $this->depth && isset( $this->item->background['thumbnail-id'] ) && is_array( wp_get_attachment_image_src( $this->item->background['thumbnail-id'], 'full' ) ) ); |
| 18 |
} |
| 19 |
|
| 20 |
function get_start_el() { |
| 21 |
|
| 22 |
$item_output = ''; |
| 23 |
|
| 24 |
$this->add_item_classes(); |
| 25 |
|
| 26 |
$this->add_item_classes_prefix(); |
| 27 |
|
| 28 |
$this->add_item_classes_quadmenu(); |
| 29 |
|
| 30 |
$this->add_item_classes_maxheight(); |
| 31 |
|
| 32 |
$this->add_item_dropdown_width(); |
| 33 |
|
| 34 |
$id = $this->get_item_id(); |
| 35 |
|
| 36 |
$class = $this->get_item_classes(); |
| 37 |
|
| 38 |
$item_output .= '<li' . $id . $class . '>'; |
| 39 |
|
| 40 |
$this->add_link_atts(); |
| 41 |
|
| 42 |
$this->add_link_atts_toggle(); |
| 43 |
|
| 44 |
$item_output .= $this->get_link(); |
| 45 |
|
| 46 |
// $this->add_dropdown_background(); |
| 47 |
|
| 48 |
return $item_output; |
| 49 |
} |
| 50 |
|
| 51 |
function add_item_dropdown_width() { |
| 52 |
|
| 53 |
if ( ! empty( $this->item->stretch ) ) { |
| 54 |
$this->dropdown_classes[] = 'quadmenu-dropdown-stretch-' . $this->item->stretch; |
| 55 |
} |
| 56 |
|
| 57 |
if ( empty( $this->item->stretch ) && ! empty( $this->item->columns ) ) { |
| 58 |
$this->dropdown_classes = array_merge( $this->dropdown_classes, $this->item->columns ); |
| 59 |
} |
| 60 |
|
| 61 |
if ( empty( $this->item->stretch ) && empty( $this->item->columns ) ) { |
| 62 |
$this->dropdown_classes[] = 'quadmenu-dropdown-stretch-boxed'; |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
function add_item_dropdown_ul_classes() { |
| 67 |
$this->dropdown_ul_classes[] = 'quadmenu-row'; |
| 68 |
} |
| 69 |
} |
| 70 |
|