示例#1
0
 function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0)
 {
     $this->skipping_item = wptouch_menu_is_disabled($item->ID);
     if (!$this->skipping_item) {
         $output .= '<li class="' . wptouch_menu_walker_get_classes($item, $this->show_menu_icons) . '">';
         $settings = wptouch_get_settings();
         if ($this->show_menu_icons && $settings->enable_menu_icons) {
             $output .= '<img src="' . wptouch_get_menu_icon($item->ID) . '" alt="menu-icon" />';
         }
         $this->last_item = $item;
     }
 }
 function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0)
 {
     $output .= '<li class="' . wptouch_menu_walker_get_classes($item) . '">';
     $output .= '<div class="drop-target" data-object-id="' . $item->ID . '">';
     $output .= '<img src="' . wptouch_get_menu_icon($item->ID) . '" alt="menu-icon" />';
     $output .= '</div>';
     $output .= '<div class="menu-enable">';
     $output .= '<input class="checkbox" type="checkbox" data-object-id="' . $item->ID . '"';
     if (!wptouch_menu_is_disabled($item->ID)) {
         $output .= " checked ";
     }
     $output .= '/></div>';
     $this->last_item = $item;
 }
示例#3
0
function wptouch_get_menu_item_classes()
{
    global $wptouch_menu_item;
    global $wptouch_pro;
    $settings = $wptouch_pro->get_settings();
    $menu_classes = array();
    $menu_classes[] = 'depth-' . $wptouch_menu_item->depth;
    if ((int) $wptouch_menu_item->page_id < 0) {
        $menu_classes[] = 'id-custom-' . -$wptouch_menu_item->page_id;
    } else {
        $menu_classes[] = 'id-' . $wptouch_menu_item->page_id;
    }
    if ($wptouch_menu_item->has_children) {
        $menu_classes[] = 'has_children';
        if ($wptouch_menu_item->depth > 1) {
            $menu_classes[] = 'submenu';
        }
    }
    if (isset($wptouch_menu_item->post_parent) && $wptouch_menu_item->post_parent) {
        $menu_classes[] = 'parent-' . $wptouch_menu_item->post_parent;
    }
    if (!isset($settings->menu_icons[$wptouch_menu_item->page_id])) {
        $menu_classes[] = 'default';
    }
    $icon_location = wptouch_get_menu_icon();
    $set_info = $wptouch_pro->get_set_with_icon(str_replace(bnc_wptouch_sslize(WP_CONTENT_URL), WP_CONTENT_DIR, $icon_location));
    if ($set_info && $set_info->dark_background) {
        $menu_classes[] = 'dark';
    }
    if (isset($wptouch_menu_item->item_class) && $wptouch_menu_item->item_class) {
        $menu_classes[] = $wptouch_menu_item->item_class;
    }
    return apply_filters('wptouch_menu_item_classes', $menu_classes);
}