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