D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
case-studies
/
Filename :
class.php
back
Copy
<?php /** * This file can be overridden by copying it to yourtheme/elementor-custom/title/class.php * * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Background; if ( ! defined( 'ABSPATH' ) ) exit; class Case_Studies extends Custom_Widget_Base { public function __construct( $data = [], $args = null ){ $this->rt_name = __( 'RT Case Studies', 'aeen-core' ); $this->rt_base = 'case-studies'; $this->rt_translate = array( 'cols' => array( '12' => esc_html__( '1 Col', 'aeen-core' ), '6' => esc_html__( '2 Col', 'aeen-core' ), '4' => esc_html__( '3 Col', 'aeen-core' ), '3' => esc_html__( '4 Col', 'aeen-core' ), '2' => esc_html__( '6 Col', 'aeen-core' ), ), ); parent::__construct( $data, $args ); } public function rt_fields(){ $cpt = AEEN_CORE_CPT; $terms = get_terms( array( 'taxonomy' => "{$cpt}_case_study_category", 'fields' => 'id=>name' ) ); $category_dropdown = array( '0' => esc_html__( 'All Categories', 'aeen-core' ) ); foreach ( $terms as $id => $name ) { $category_dropdown[$id] = $name; } $fields = array( array( 'id' => 'sec_rt_team', 'mode' => 'section_start', 'label' => esc_html__( 'Case Study', 'aeen-core' ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'style', 'label' => esc_html__( 'Layout', 'aeen-core' ), 'options' => array( 'style1' => esc_html__( 'Style 1', 'aeen-core' ), 'style2' => esc_html__( 'Style 2', 'aeen-core' ), 'style3' => esc_html__( 'Style 3', 'aeen-core' ), 'style4' => esc_html__( 'Style 4', 'aeen-core' ), 'style5' => esc_html__( 'Style 5', 'aeen-core' ), 'style6' => esc_html__( 'Style 6', 'aeen-core' ), ), 'default' => 'style1', ), array( 'type' => Controls_Manager::NUMBER, 'id' => 'number', 'label' => esc_html__( 'Total number of items', 'aeen-core' ), 'default' => 4, 'description' => esc_html__( 'Write -1 to show all', 'aeen-core' ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'cat', 'label' => esc_html__( 'Categories', 'aeen-core' ), 'options' => $category_dropdown, 'default' => '0', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'orderby', 'label' => esc_html__( 'Order By', 'aeen-core' ), 'options' => array( 'date' => esc_html__( 'Date (Recents comes first)', 'aeen-core' ), 'title' => esc_html__( 'Title', 'aeen-core' ), 'menu_order' => esc_html__( 'Custom Order (Available via Order field inside Page Attributes box)', 'aeen-core' ), ), 'default' => 'date', ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'designation_display', 'label' => esc_html__( 'Designation Display', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'default' => 'yes', 'description' => esc_html__( 'Show or Hide Designation. Default: On', 'aeen-core' ), 'condition' => array( 'style' => array( 'style1')), ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'category_display', 'label' => esc_html__( 'Category Display', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'default' => 'yes', 'description' => esc_html__( 'Categorys. Default: On', 'aeen-core' ), 'condition' => array( 'style' => array( 'style2', 'style6' )), ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'item_social', 'label' => esc_html__( 'Item Social', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'default' => 'yes', 'description' => esc_html__( 'Show or Hide Social link. Default: On', 'aeen-core' ), 'condition' => array( 'style' => array( 'style1')), ), array( 'type' => Controls_Manager::NUMBER, 'id' => 'count', 'label' => esc_html__( 'Word count', 'aeen-core' ), 'default' => 20, 'description' => esc_html__( 'Maximum number of words', 'aeen-core' ), 'condition' => array( 'style' => array( 'style6')), ), array( 'mode' => 'section_end', ), // Responsive Columns array( 'mode' => 'section_start', 'id' => 'sec_responsive', 'label' => esc_html__( 'Number of Responsive Columns', 'aeen-core' ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_lg', 'label' => esc_html__( 'Desktops: > 1199px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '4', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_md', 'label' => esc_html__( 'Desktops: > 991px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '4', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_sm', 'label' => esc_html__( 'Tablets: > 767px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '6', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_xs', 'label' => esc_html__( 'Phones: < 768px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '12', ), array( 'mode' => 'section_end', ), // Style array( 'mode' => 'section_start', 'id' => 'sec_cat_style', 'label' => esc_html__( 'Style', 'aeen-core' ), 'tab' => Controls_Manager::TAB_STYLE, ), array( 'id' => 'title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Title Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout2 .item-content .item-title a' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-style7 .item-heading h2' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-layout5 .item-content h2' => 'color: {{VALUE}} !important', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'cat_typo', 'label' => esc_html__( 'Title Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .case-study-box-layout2 .item-content .item-title a, {{WRAPPER}} .case-study-box-style7 .item-heading h2, {{WRAPPER}} .case-study-box-layout5 .item-content h2', ), array( 'id' => 'title_hover_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Title Hover', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout2 .item-content .item-title a:hover' => 'color: {{VALUE}} !important' ), ), array( 'id' => 'cat_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Category Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout2 .item-content .item-sub-title' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-layout2 .item-sub-title a' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-style7 .item-heading span a' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-layout5 .item-content span' => 'color: {{VALUE}} !important', ), ), array( 'id' => 'cat_hover_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Category Hover Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout2 .item-content .item-sub-title' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-layout2 .item-sub-title a:hover' => 'color: {{VALUE}} !important', '{{WRAPPER}} .case-study-box-style7 .item-heading span a:hover' => 'color: {{VALUE}} !important', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'designation_typo', 'label' => esc_html__( 'Category Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .case-study-box-layout2 .item-content .item-sub-title, {{WRAPPER}} .case-study-box-style7 .item-heading span a, {{WRAPPER}} .case-study-box-layout5 .item-content span', ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'short_typo', 'label' => esc_html__( 'Short Content Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .short-content', 'condition' => array( 'style' => array( 'style3'),'designation_content' => array( 'yes')), ), array( 'id' => 'desc_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Description Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout5 .item-content p' => 'color: {{VALUE}} !important', ), 'condition' => array( 'style' => array( 'style6') ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'desc_typo', 'label' => esc_html__( 'Description Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .case-study-box-layout5 .item-content p', 'condition' => array( 'style' => array( 'style6') ), ), array( 'mode' => 'section_end', ), // Box Case Study Style 7 array( 'mode' => 'section_start', 'id' => 'sec_box_style', 'label' => esc_html__( 'Box Style', 'aeen-core' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'style' => array( 'style5')), ), array( 'id' => 'box_bg_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Background Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-style7 .item-heading' => 'background-color: {{VALUE}} !important', ), ), array( 'id' => 'box_overlay_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Overlay Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-style7 .case-study-box-layout3:hover:before' => 'background-color: {{VALUE}} !important', ), ), array( 'id' => 'box_icon_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Icon Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout7 .item-content .item-link' => 'color: {{VALUE}} !important', ), ), array( 'id' => 'box_iconh_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Icon Hover Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .case-study-box-layout7 .item-content .item-link:hover' => 'color: {{VALUE}} !important', ), ), array( 'mode' => 'section_end', ), array( 'mode' => 'section_start', 'id' => 'readmore_style', 'label' => esc_html__( 'Read More', 'aeen-core' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'style' => array( 'style6')), ), array( 'id' => 'readmore_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .case-study-box-layout5 .item-content a.color-primary-text' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'readmore_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .case-study-box-layout5 .item-content a.color-primary-text', ), array( 'id' => 'readmore_h_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Hover Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .case-study-box-layout5 .item-content a.color-primary-text:hover' => 'color: {{VALUE}}', ), ), array( 'mode' => 'section_end', ), ); return $fields; } protected function render() { $data = $this->get_settings(); switch ($data['style']) { case 'style6': $template = 'view-6'; break; case 'style5': $template = 'view-5'; break; case 'style4': $template = 'view-4'; break; case 'style3': $template = 'view-3'; break; case 'style2': $template = 'view-2'; break; default: $template = 'view-1'; break; } return $this->rt_template( $template, $data ); } }