| @@ -15,17 +15,17 @@ | ||
| 15 | 15 | return 'ama_forum_tab'; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | public function get_title() { |
| 19 | - return esc_html__( 'BBPC Forum Tabs', 'bbp-core' ); | |
| 19 | + return esc_html__( 'Forum Tabs (Forumax)', 'forumax' ); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function get_icon() { |
| 23 | - return 'bbpc_icon_ama_forum_tab'; | |
| 23 | + return 'bbpc_icon_ama_forum_tab eicon-tabs'; | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function get_categories() { |
| 27 | - return [ 'bbp-core' ]; | |
| 27 | + return [ 'forumax' ]; | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function get_style_depends() { |
| 31 | 31 | return['bbpc-el-widgets']; |
| @@ -32,34 +32,36 @@ | ||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // scripts dependencies |
| 35 | 35 | public function get_script_depends() { |
| 36 | - return [ 'bbpc_js' ]; | |
| 36 | + return [ 'bbpc-forumTab' ]; | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | - protected function register_controls() { | |
| 41 | - // --- Forum Filter Options | |
| 40 | + protected function register_controls(): void | |
| 41 | + { | |
| 42 | + | |
| 43 | + | |
| 44 | + //======================= Forum Filter Options ================== | |
| 42 | 45 | $this->start_controls_section( |
| 43 | 46 | 'forum_filter', [ |
| 44 | - 'label' => __( 'Forum Filter Options', 'bbp-core' ), | |
| 47 | + 'label' => __( 'Forum Filter Options', 'forumax' ), | |
| 45 | 48 | ] |
| 46 | 49 | ); |
| 47 | 50 | |
| 48 | 51 | $this->add_control( |
| 49 | - 'forum_tab_title', | |
| 50 | - [ | |
| 51 | - 'label' => __( 'Forum Tab Title', 'bbp-core' ), | |
| 52 | + 'forum_tab_title', [ | |
| 53 | + 'label' => __( 'Forum Tab Title', 'forumax' ), | |
| 52 | 54 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 53 | - 'default' => __( 'Show Forums', 'bbp-core' ), | |
| 54 | - 'placeholder' => __( 'Enter the tab title', 'bbp-core' ), | |
| 55 | + 'default' => __( 'Show Forums', 'forumax' ), | |
| 56 | + 'placeholder' => __( 'Enter the tab title', 'forumax' ), | |
| 55 | 57 | ] |
| 56 | 58 | ); |
| 57 | 59 | |
| 58 | 60 | $this->add_control( |
| 59 | 61 | 'ppp', [ |
| 60 | - 'label' => esc_html__( 'Show Forums', 'bbp-core' ), | |
| 61 | - 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'bbp-core' ), | |
| 62 | + 'label' => esc_html__( 'Show Forums', 'forumax' ), | |
| 63 | + 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'forumax' ), | |
| 62 | 64 | 'default' => 9 |
| 63 | 65 | ] |
| 64 | 66 | ); |
| 65 | 67 | |
| @@ -64,9 +66,9 @@ | ||
| 64 | 66 | ); |
| 65 | 67 | |
| 66 | 68 | $this->add_control( |
| 67 | 69 | 'order', [ |
| 68 | - 'label' => esc_html__( 'Order', 'bbp-core' ), | |
| 70 | + 'label' => esc_html__( 'Order', 'forumax' ), | |
| 69 | 71 | 'type' => Controls_Manager::SELECT, |
| 70 | 72 | 'options' => [ |
| 71 | 73 | 'ASC' => 'ASC', |
| 72 | 74 | 'DESC' => 'DESC' |
| @@ -74,56 +76,78 @@ | ||
| 74 | 76 | 'default' => 'ASC' |
| 75 | 77 | ] |
| 76 | 78 | ); |
| 77 | 79 | |
| 80 | + //==== View More Button | |
| 81 | + $this->add_control( | |
| 82 | + 'more_txt_heading', [ | |
| 83 | + 'label' => esc_html__( 'View More Button', 'forumax' ), | |
| 84 | + 'type' => Controls_Manager::HEADING, | |
| 85 | + 'separator' => 'before', | |
| 86 | + ] | |
| 87 | + ); | |
| 88 | + | |
| 89 | + $this->add_control( | |
| 90 | + 'is_forum_tab_btn', [ | |
| 91 | + 'label' => esc_html__( 'Button (Show/Hide)', 'forumax' ), | |
| 92 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 93 | + 'label_on' => esc_html__( 'Show', 'forumax' ), | |
| 94 | + 'label_off' => esc_html__( 'Hide', 'forumax' ), | |
| 95 | + 'return_value' => 'yes', | |
| 96 | + 'default' => 'yes', | |
| 97 | + ] | |
| 98 | + ); | |
| 99 | + | |
| 78 | 100 | $this->add_control( |
| 79 | 101 | 'more_txt', [ |
| 80 | - 'label' => esc_html__( 'More button text', 'bbp-core' ), | |
| 102 | + 'label' => esc_html__( 'Button Label', 'forumax' ), | |
| 81 | 103 | 'type' => Controls_Manager::TEXT, |
| 82 | 104 | 'label_block' => true, |
| 83 | - 'separator' => 'before', | |
| 84 | - 'default' => 'Show more' | |
| 105 | + 'default' => esc_html__('View More', 'forumax'), | |
| 106 | + 'condition' => [ | |
| 107 | + 'is_forum_tab_btn' => 'yes' | |
| 108 | + ] | |
| 85 | 109 | ] |
| 86 | 110 | ); |
| 87 | 111 | |
| 88 | 112 | $this->add_control( |
| 89 | - 'more_url', | |
| 90 | - [ | |
| 91 | - 'label' => esc_html__( 'More button link', 'bbp-core' ), | |
| 113 | + 'more_url', [ | |
| 114 | + 'label' => esc_html__( 'Button URL', 'forumax' ), | |
| 92 | 115 | 'type' => \Elementor\Controls_Manager::URL, |
| 93 | - 'placeholder' => __( 'https://your-link.com', 'bbp-core' ), | |
| 94 | 116 | 'default' => [ |
| 95 | - 'url' => get_post_type_archive_link( 'forum' ), | |
| 117 | + 'url' => '#', | |
| 96 | 118 | 'is_external' => true, |
| 97 | 119 | 'nofollow' => true, |
| 98 | 120 | ], |
| 121 | + 'condition' => [ | |
| 122 | + 'is_forum_tab_btn' => 'yes' | |
| 123 | + ] | |
| 99 | 124 | ] |
| 100 | - ); | |
| 125 | + ); //End View More Button | |
| 101 | 126 | |
| 127 | + $this->end_controls_section(); // End Forum Filter Options | |
| 102 | 128 | |
| 103 | - $this->end_controls_section(); | |
| 104 | 129 | |
| 105 | - //-------- Topic Filter Options | |
| 130 | + //======================== Topic Filter Options =========================// | |
| 106 | 131 | $this->start_controls_section( |
| 107 | 132 | 'topic_filter', [ |
| 108 | - 'label' => __( 'Topic Filter Options', 'bbp-core' ), | |
| 133 | + 'label' => __( 'Topic Filter Options', 'forumax' ), | |
| 109 | 134 | ] |
| 110 | 135 | ); |
| 111 | 136 | |
| 112 | 137 | $this->add_control( |
| 113 | - 'topics_tab_title', | |
| 114 | - [ | |
| 115 | - 'label' => __( 'Topics Tab Title', 'bbp-core' ), | |
| 138 | + 'topics_tab_title', [ | |
| 139 | + 'label' => __( 'Topics Tab Title', 'forumax' ), | |
| 116 | 140 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 117 | - 'default' => __( 'Show Topics', 'bbp-core' ), | |
| 118 | - 'placeholder' => __( 'Enter the tab title', 'bbp-core' ), | |
| 141 | + 'default' => __( 'Show Topics', 'forumax' ), | |
| 142 | + 'placeholder' => __( 'Enter the tab title', 'forumax' ), | |
| 119 | 143 | ] |
| 120 | 144 | ); |
| 121 | 145 | |
| 122 | 146 | $this->add_control( |
| 123 | 147 | 'ppp2', [ |
| 124 | - 'label' => esc_html__( 'Show Forums', 'bbp-core' ), | |
| 125 | - 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'bbp-core' ), | |
| 148 | + 'label' => esc_html__( 'Show Forums', 'forumax' ), | |
| 149 | + 'description' => esc_html__( 'Show the forums count at the initial view. Default is 9 forums in a row.', 'forumax' ), | |
| 126 | 150 | 'label_block' => true, |
| 127 | 151 | 'default' => 6 |
| 128 | 152 | ] |
| 129 | 153 | ); |
| @@ -129,9 +153,9 @@ | ||
| 129 | 153 | ); |
| 130 | 154 | |
| 131 | 155 | $this->add_control( |
| 132 | 156 | 'order2', [ |
| 133 | - 'label' => esc_html__( 'Order', 'bbp-core' ), | |
| 157 | + 'label' => esc_html__( 'Order', 'forumax' ), | |
| 134 | 158 | 'type' => Controls_Manager::SELECT, |
| 135 | 159 | 'options' => [ |
| 136 | 160 | 'ASC' => 'ASC', |
| 137 | 161 | 'DESC' => 'DESC' |
| @@ -139,44 +163,73 @@ | ||
| 139 | 163 | 'default' => 'ASC' |
| 140 | 164 | ] |
| 141 | 165 | ); |
| 142 | 166 | |
| 167 | + //==== View More Button | |
| 168 | + $this->add_control( | |
| 169 | + 'more_txt2_heading', [ | |
| 170 | + 'label' => esc_html__( 'View More Button', 'forumax' ), | |
| 171 | + 'type' => Controls_Manager::HEADING, | |
| 172 | + 'separator' => 'before', | |
| 173 | + ] | |
| 174 | + ); | |
| 175 | + | |
| 176 | + $this->add_control( | |
| 177 | + 'is_topic_tab_btn', [ | |
| 178 | + 'label' => esc_html__( 'Button (Show/Hide)', 'forumax' ), | |
| 179 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 180 | + 'label_on' => esc_html__( 'Show', 'forumax' ), | |
| 181 | + 'label_off' => esc_html__( 'Hide', 'forumax' ), | |
| 182 | + 'return_value' => 'yes', | |
| 183 | + 'default' => 'yes', | |
| 184 | + ] | |
| 185 | + ); | |
| 186 | + | |
| 187 | + | |
| 143 | 188 | $this->add_control( |
| 144 | 189 | 'more_txt2', [ |
| 145 | - 'label' => esc_html__( 'More button text', 'bbp-core' ), | |
| 190 | + 'label' => esc_html__( 'Button Label', 'forumax' ), | |
| 146 | 191 | 'type' => Controls_Manager::TEXT, |
| 147 | 192 | 'label_block' => true, |
| 148 | - 'default' => 'Show more' | |
| 193 | + 'default' => esc_html__('View More', 'forumax'), | |
| 194 | + 'condition' => [ | |
| 195 | + 'is_topic_tab_btn' => 'yes' | |
| 196 | + ] | |
| 149 | 197 | ] |
| 150 | 198 | ); |
| 151 | 199 | |
| 152 | 200 | $this->add_control( |
| 153 | 201 | 'more_url2', [ |
| 154 | - 'label' => esc_html__( 'More button link', 'bbp-core' ), | |
| 202 | + 'label' => esc_html__( 'Button URL', 'forumax' ), | |
| 155 | 203 | 'type' => \Elementor\Controls_Manager::URL, |
| 156 | - 'placeholder' => __( 'https://your-link.com', 'bbp-core' ), | |
| 157 | 204 | 'default' => [ |
| 158 | - 'url' => get_post_type_archive_link( 'topic' ), | |
| 205 | + 'url' => '#', | |
| 159 | 206 | 'is_external' => true, |
| 160 | 207 | 'nofollow' => true, |
| 161 | 208 | ], |
| 209 | + 'condition' => [ | |
| 210 | + 'is_topic_tab_btn' => 'yes' | |
| 211 | + ] | |
| 162 | 212 | ] |
| 163 | 213 | ); |
| 164 | 214 | |
| 165 | - $this->end_controls_section(); | |
| 215 | + $this->end_controls_section(); //End Topic Filter Options | |
| 166 | 216 | |
| 217 | + | |
| 218 | + //===================== Forum Tab Title ======================// | |
| 167 | 219 | $this->start_controls_section( |
| 168 | 220 | 'forum_tab_style', [ |
| 169 | - 'label' => __( 'Forum Tab Title', 'bbp-core' ), | |
| 221 | + 'label' => __( 'Forum Tab Title', 'forumax' ), | |
| 170 | 222 | 'tab' => Controls_Manager::TAB_STYLE, |
| 171 | 223 | ] |
| 172 | 224 | ); |
| 173 | 225 | |
| 226 | + | |
| 174 | 227 | $this->add_group_control( |
| 175 | 228 | \Elementor\Group_Control_Typography::get_type(), |
| 176 | 229 | [ |
| 177 | 230 | 'name' => 'forum_tab_title', |
| 178 | - 'label' => __( 'Tab Label Typography', 'bbp-core' ), | |
| 231 | + 'label' => __( 'Tab Label Typography', 'forumax' ), | |
| 179 | 232 | 'selector' => '{{WRAPPER}} .community-area .nav-tabs .nav-item button', |
| 180 | 233 | ] |
| 181 | 234 | ); |
| 182 | 235 | |
| @@ -182,9 +235,9 @@ | ||
| 182 | 235 | |
| 183 | 236 | $this->add_control( |
| 184 | 237 | 'forum_tab_title_color', |
| 185 | 238 | [ |
| 186 | - 'label' => __( 'Tab Label Color', 'bbp-core' ), | |
| 239 | + 'label' => __( 'Tab Label Color', 'forumax' ), | |
| 187 | 240 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 188 | 241 | 'selectors' => [ |
| 189 | 242 | '{{WRAPPER}} .community-area .nav-tabs .nav-item button' => 'color: {{VALUE}}', |
| 190 | 243 | ], |
| @@ -192,11 +245,12 @@ | ||
| 192 | 245 | ); |
| 193 | 246 | |
| 194 | 247 | $this->end_controls_section(); |
| 195 | 248 | |
| 249 | + | |
| 196 | 250 | $this->start_controls_section( |
| 197 | 251 | 'forum_tab_button', [ |
| 198 | - 'label' => esc_html__( 'Forum Tab Button', 'bbp-core' ), | |
| 252 | + 'label' => esc_html__( 'Forum Tab Button', 'forumax' ), | |
| 199 | 253 | 'tab' => Controls_Manager::TAB_STYLE, |
| 200 | 254 | ] |
| 201 | 255 | ); |
| 202 | 256 | |
| @@ -201,9 +255,9 @@ | ||
| 201 | 255 | ); |
| 202 | 256 | |
| 203 | 257 | $this->add_responsive_control( |
| 204 | 258 | 'tab_btn_margin', [ |
| 205 | - 'label' => esc_html__( 'Margin', 'bbp-core' ), | |
| 259 | + 'label' => esc_html__( 'Margin', 'forumax' ), | |
| 206 | 260 | 'type' => Controls_Manager::DIMENSIONS, |
| 207 | 261 | 'size_units' => [ 'px', '%', 'em' ], |
| 208 | 262 | 'selectors' => [ |
| 209 | 263 | '{{WRAPPER}} .tab-content .show-more-btn.show-more-round' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| @@ -212,9 +266,9 @@ | ||
| 212 | 266 | ); |
| 213 | 267 | |
| 214 | 268 | $this->add_responsive_control( |
| 215 | 269 | 'tab_btn_padding', [ |
| 216 | - 'label' => esc_html__( 'Tab button padding', 'bbp-core' ), | |
| 270 | + 'label' => esc_html__( 'Tab button padding', 'forumax' ), | |
| 217 | 271 | 'type' => Controls_Manager::DIMENSIONS, |
| 218 | 272 | 'size_units' => [ 'px', '%', 'em' ], |
| 219 | 273 | 'selectors' => [ |
| 220 | 274 | '{{WRAPPER}} .tab-content .show-more-btn.show-more-round' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |