PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
core
/
elementor
/
widgets
<?php namespace Elementor; class Webnus_Element_Widgets_Food_Menu extends \Elementor\Widget_Base { /** * Retrieve Socials widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'food_menu'; } /** * Retrieve Socials widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'Webnus Food Menu', 'deep' ); } /** * Retrieve Socials widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'li_food'; } /** * Set widget category. * * @since 1.0.0 * @access public * * @return array Widget category. */ public function get_categories() { return [ 'webnus' ]; } /** * Register Socials widget controls. * * * @since 1.0.0 * @access protected */ protected function _register_controls() { // Content Tab $this->start_controls_section( 'content_sectiona', [ 'label' => esc_html__( 'Type Settings', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); // Select Socials Type $this->add_control( 'type', //param_name [ 'label' => esc_html__( 'Type', 'deep' ), //heading 'type' => Controls_Manager::SELECT, //type 'default' => '1', 'options' => [ '1' => esc_html__( 'Type 1', 'deep' ), '2' => esc_html__( 'Type 2', 'deep' ), '3' => esc_html__( 'Type 3', 'deep' ), '4' => esc_html__( 'Type 4', 'deep' ), '5' => esc_html__( 'Type 5', 'deep' ), ], ] ); // Food Menu Image $this->add_control( 'img', [ 'label' => esc_html__( 'Food Menu Image', 'deep' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'condition' => [ 'type' => [ '1', '3', '4', '5' ], ], ] ); // Title $this->add_control( 'title', //param_name [ 'label' => esc_html__( 'Title', 'deep' ), //heading 'type' => Controls_Manager::TEXT, //type 'placeholder' => esc_html__( 'Type your title text here', 'deep' ), 'default' => esc_html__( 'Title', 'deep' ), 'condition' => [ 'type' => [ '1', '3', '4', '5' ], ], ] ); // Price $this->add_control( 'price', //param_name [ 'label' => esc_html__( 'Price', 'deep' ), //heading 'type' => Controls_Manager::TEXT, //type 'placeholder' => esc_html__( 'Ex $ 10', 'deep' ), 'default' => esc_html__( '$30', 'deep' ), 'condition' => [ 'type' => [ '1', '3', '4', '5' ], ], ] ); // Description $this->add_control( 'description', //param_name [ 'label' => esc_html__( 'Description', 'deep' ), //heading 'type' => Controls_Manager::TEXTAREA, //type 'rows' => 10, 'placeholder' => esc_html__( 'Content Goes Here', 'deep' ), 'condition' => [ 'type' => [ '3', '4', '5' ], ], ] ); // Ingredients $this->add_control( 'ingredients', [ 'label' => esc_html__( 'Ingredients', 'deep' ), 'type' => Controls_Manager::REPEATER, 'fields' => [ [ 'name' => 'ingredient', 'label' => esc_html__( 'Ingredients', 'deep' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, ], ], 'condition' => [ 'type' => [ '1' ], ], 'default' => [ [ 'ingredient' => __( 'Item 1', 'deep' ), ], [ 'ingredient' => __( 'Item 2', 'deep' ), ], [ 'ingredient' => __( 'Item 3', 'deep' ), ], ], ] ); // Food Items $this->add_control( 'food_menu2', [ 'label' => esc_html__( 'Food Items', 'deep' ), 'type' => Controls_Manager::REPEATER, 'fields' => [ [ 'name' => 'title', 'label' => esc_html__( 'Title', 'deep' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, ], [ 'name' => 'price', 'label' => esc_html__( 'Price', 'deep' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, ], [ 'name' => 'tp_color', 'label' => esc_html__( 'Price and Title Background color', 'deep' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_1, ], 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .fm-w2-item .fm-w2-name, {{WRAPPER}} .fm-w2-item .fm-w2-price' => 'background: {{VALUE}}', ], ], [ 'name' => 'description', 'label' => esc_html__( 'Description', 'deep' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, ], [ 'name' => 'food_style', 'label' => esc_html__( 'Food Item Style', 'deep' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => esc_html__( 'Default Food Item', 'deep' ), 'featured-w2' => esc_html__( 'Featured Food Item', 'deep' ), ], ], [ 'name' => 'featured_text', 'label' => esc_html__( 'Featured Text', 'deep' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'condition' => [ 'food_style' => [ 'featured-w2' ], ], ], ], 'condition' => [ 'type' => [ '2' ], ], ] ); $this->end_controls_section(); // Class & ID Tab $this->start_controls_section( 'classid_section', [ 'label' => __( 'Class & ID', 'deep' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'shortcodeclass', [ 'label' => esc_html__( 'Extra Class', 'deep' ), 'type' => Controls_Manager::TEXT, ] ); $this->add_control( 'shortcodeid', [ 'label' => esc_html__( 'ID', 'deep' ), 'type' => Controls_Manager::TEXT, ] ); $this->end_controls_section(); // Style $this->start_controls_section( 'section_box_style', [ 'label' => __( 'Box Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'box_bg', 'label' => __( 'Background', 'deep' ), 'types' => [ 'classic' , 'gradient' ], 'selector' => '#wrap {{WRAPPER}} .wn-food-menu-sh', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'box_border', 'label' => __( 'Border', 'deep' ), 'selector' => '#wrap {{WRAPPER}} .wn-food-menu-sh', ] ); $this->add_control( 'box_border_radius', //param_name [ 'label' => __( 'Border Radius', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .wn-food-menu-sh' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => __( 'Box Shadow', 'deep' ), 'selector' => '#wrap {{WRAPPER}} .wn-food-menu-sh', ] ); $this->add_control( 'box_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .wn-food-menu-sh' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'box_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .wn-food-menu-sh' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Custom css tab $this->start_controls_section( 'custom_css_section', [ 'label' => __( 'Custom CSS', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'custom_css', [ 'label' => __( 'Custom CSS', 'deep' ), 'type' => \Elementor\Controls_Manager::CODE, 'language' => 'css', 'rows' => 20, 'show_label' => true, ] ); $this->end_controls_section(); } /** * Render Socials widget output on the frontend. * * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings(); wp_enqueue_style( 'wn-deep-food-menu', DEEP_ASSETS_URL . 'css/frontend/food-menu/food-menu.css' ); $type = $settings['type']; $img = $settings['img']['url']; $title = $settings['title']; $price = $settings['price']; $description = $settings['description']; $ingredients = $settings['ingredients']; $food_menu2 = $settings['food_menu2']; $price_color = ' '; $shortcodeclass = $settings['shortcodeclass']; $shortcodeid = $settings['shortcodeid']; // Class & ID $shortcodeclass = $settings['shortcodeclass'] ? $settings['shortcodeclass'] : ''; $shortcodeid = $settings['shortcodeid'] ? ' id="' . $settings['shortcodeid'] . '"' : ''; $food_menu2_data = array(); static $uniqid = 0; $uniqid++; if( is_numeric( $img ) ) $img = wp_get_attachment_url( $img ); $out = ''; switch ( $type ) : // type 1 or 3 or 4 or 5 case '1': $menu_class = 'menu-dts-'.$type; $out .= ' <div class="wn-food-menu-sh food-menu-w' . $type . ' ' . $shortcodeclass . '" ' . $shortcodeid . ' > <img src="' . esc_url( $img ) . '" alt="' . esc_html( $title ) . '"> <div class="' . $menu_class . ' space"> <h3>' . esc_html( $title ) . '</h3> <h5>' . esc_html( $price ) . '</h5> <p>'; foreach ( $ingredients as $line ) : $ingredients_data = isset( $line['ingredient'] ) ? $line['ingredient'] . '<br>' : ''; $out .= $ingredients_data; endforeach; $out .= '</p> </div> ' . $description . ' </div>'; break; case '3': case '4': $ingredients_data = ''; $description = $description ? '<div class="w' . $type . '-menu-dts">' . $description . '</div>' : ''; $menu_class = 'w' . $type . '-menu-top'; $out .= ' <div class="wn-food-menu-sh food-menu-w' . $type . ' ' . $shortcodeclass . '" ' . $shortcodeid . ' > <img src="' . esc_url( $img ) . '" alt="' . esc_html( $title ) . '"> <div class="' . $menu_class . ' space"> <h3>' . esc_html( $title ) . '</h3> <h5>' . esc_html( $price ) . '</h5> ' . $ingredients_data . ' </div> ' . $description . ' </div>'; break; case '5': $menu_class = 'menu-dts-'.$type ; $out .= ' <div class="wn-food-menu-sh food-menu-w' . $type . ' colorb ' . $shortcodeclass . '" ' . $shortcodeid . ' > <div class="' . $menu_class . '"> <h3>' . esc_html( $title ) . '</h3> <h5>' . esc_html( $price ) . '</h5> </div> <div class="border-' . $type . ' "> <img src="' . esc_url( $img ) . '" alt="' . esc_html( $title ) . '" class="fmt-5"> </div> <div class="background-5"> <p><strong>' . esc_html( $title ) . ' ingredients: </strong>' . $description . '</p> </div> </div>'; break; // type 2 case '2': $out .= '<div class="wn-food-menu-sh food-menu-w2 ' . $shortcodeclass . '" ' . $shortcodeid . ' >'; foreach ( $food_menu2 as $line ) : $title = isset( $line['title'] ) ? $line['title'] : ''; $price = isset( $line['price'] ) ? $line['price'] : ''; $description = isset( $line['description'] ) ? $line['description'] : ''; $featured_text = isset( $line['featured_text'] ) ? $line['featured_text'] : ''; $food_style = isset( $line['food_style'] ) && $line['food_style'] == 'featured-w2' ? ' colorr ' . $line['food_style'] : ''; $featured_text = $food_style ? '<span class="fm-w2-featured colorb">' . $featured_text . '</span>' : ''; $out .= ' <div class="fm-w2-item' . $food_style . '"> <div class="fm-w2-top space"> <span class="fm-w2-name">' . $title . '</span> <span class="fm-w2-price" >' . $price . '</span> </div> <div class="fm-w2-des">' . $description . '</div> ' . $featured_text . ' </div>'; endforeach; $out .= '</div>'; break; endswitch; $custom_css = $settings['custom_css']; if ( $custom_css != '' ) { echo '<style>'. $custom_css .'</style>'; } echo $out; } }
[+]
..
[-] our-client.php
[edit]
[-] icons.php
[edit]
[-] collection.php
[edit]
[-] testimonial-tab.php
[edit]
[-] teaserbox.php
[edit]
[-] instagram.php
[edit]
[-] our-team.php
[edit]
[-] content-carousel.php
[edit]
[-] videoteaser.php
[edit]
[-] like-view-share.php
[edit]
[-] courses-instructors.php
[edit]
[-] widget-flickr.php
[edit]
[-] reservation.php
[edit]
[-] list.php
[edit]
[-] road-map.php
[edit]
[-] max-counter.php
[edit]
[-] magazine.php
[edit]
[-] prayer-wall-items.php
[edit]
[-] facebook-button.php
[edit]
[-] icon-divider.php
[edit]
[-] featured-products.php
[edit]
[-] review-items.php
[edit]
[-] iconbox.php
[edit]
[-] widget-googleplus.php
[edit]
[-] content-slider.php
[edit]
[-] service-carousel.php
[edit]
[-] contact-form.php
[edit]
[-] twitter-feed.php
[edit]
[-] blog.php
[edit]
[-] process-carousel.php
[edit]
[-] course-category.php
[edit]
[-] virtual-coins.php
[edit]
[-] speakers.php
[edit]
[-] the-grid.php
[edit]
[-] custom-menu.php
[edit]
[-] widget-youtube.php
[edit]
[-] testimonial.php
[edit]
[-] callout.php
[edit]
[-] testimonial-slider.php
[edit]
[-] category-tab.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] button.php
[edit]
[-] facebook-comments.php
[edit]
[-] widget-login.php
[edit]
[-] subscribe.php
[edit]
[-] googlemap.php
[edit]
[-] widget-social-icon.php
[edit]
[-] postslider.php
[edit]
[-] alert.php
[edit]
[-] video-play-button.php
[edit]
[-] quote.php
[edit]
[-] donate.php
[edit]
[-] dropcap.php
[edit]
[-] before-after-image.php
[edit]
[-] pricing-tables.php
[edit]
[-] facebook-page.php
[edit]
[-] shop-products.php
[edit]
[-] single-goal.php
[edit]
[-] info-box.php
[edit]
[-] latestfromblog.php
[edit]
[-] goals.php
[edit]
[-] revolution-slider.php
[edit]
[-] widget-subscribe.php
[edit]
[-] tablepress.php
[edit]
[-] tab-content.php
[edit]
[-] schedule.php
[edit]
[-] sermon-category.php
[edit]
[-] pricing-plan.php
[edit]
[-] tabs.php
[edit]
[-] widget-latest-posts.php
[edit]
[-] distance.php
[edit]
[-] widget-popular-posts.php
[edit]
[-] recipes.php
[edit]
[-] causes.php
[edit]
[-] widget-testimonial.php
[edit]
[-] widget-about.php
[edit]
[-] special-offers.php
[edit]
[-] tooltip.php
[edit]
[-] food-menu.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] widget-tab.php
[edit]
[-] courses.php
[edit]
[-] login.php
[edit]
[-] post-from-blog.php
[edit]
[-] socials.php
[edit]
[-] line.php
[edit]
[-] gallery.php
[edit]
[-] faq.php
[edit]
[-] piecharts.php
[edit]
[-] image-hotspot.php
[edit]
[-] link.php
[edit]
[-] prayer-wall-form.php
[edit]
[-] rooms.php
[edit]
[-] countdown.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] facebook-embed.php
[edit]
[-] single-cause.php
[edit]
[-] review-form.php
[edit]
[-] buy-process.php
[edit]
[-] sermons.php
[edit]
[-] widget-facebook.php
[edit]
[-] single-sermon.php
[edit]
[-] single-course.php
[edit]
[-] image-carousel.php
[edit]
[-] toggle-box.php
[edit]
[-] our-process.php
[edit]
[-] svg.php
[edit]
[-] w-title.php
[edit]
[-] block-quote.php
[edit]