PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.0.7
Easy Elements for Elementor – Addons & Website Templates v1.0.7
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
← All changes | widgets/icon-box/icon.php +118 -286 1.3.01.0.7 View file →
@@ -1,6 +1,5 @@
1 1 <?php
2 -namespace Easyel\EasyElements\Widgets;
3 2 use Elementor\Utils;
4 3 use Elementor\Controls_Manager;
5 4 use Elementor\Responsive_Control;
6 5 use Elementor\Group_Control_Image_Size;
@@ -7,8 +6,18 @@
7 6
8 7 defined( 'ABSPATH' ) || die();
9 8 class Easyel_Icon_Box__Widget extends \Elementor\Widget_Base {
10 9
10 + public function get_style_depends() {
11 + $handle = 'eel-icon-box-style';
12 + $css_path = plugin_dir_path( __FILE__ ) . 'css/icon-box.css';
13 +
14 + if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
15 + wp_register_style( $handle, plugins_url( 'css/icon-box.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : '1.0.0' );
16 + }
17 + return [ $handle ];
18 + }
19 +
11 20 public function get_name() {
12 21 return 'eel-icon-box';
13 22 }
14 23
@@ -27,36 +36,17 @@
27 36 public function get_keywords() {
28 37 return [ 'box', 'sevice', 'icon', 'icon-box', 'text' ];
29 38 }
30 39
31 - public function get_style_depends() {
32 - return [
33 - 'eel-icon-box',
34 - ];
35 - }
36 -
37 -
38 40 protected function register_controls() {
39 41 $this->start_controls_section(
40 42 '_section_logo',
41 43 [
42 - 'label' => esc_html__( 'Settings', 'easy-elements' ),
44 + 'label' => esc_html__( 'Icon Box Settings', 'easy-elements' ),
43 45 'tab' => Controls_Manager::TAB_CONTENT,
44 46 ]
45 47 );
46 48
47 - $this->add_control(
48 - 'info_skin',
49 - [
50 - 'label' => esc_html__( 'Skin', 'easy-elements' ),
51 - 'type' => \Elementor\Controls_Manager::SELECT,
52 - 'options' => [
53 - 'default' => esc_html__( 'Skin 01', 'easy-elements' ),
54 - 'skin-2' => esc_html__( 'Skin 02', 'easy-elements' ),
55 - ],
56 - 'default' => 'default',
57 - ]
58 - );
59 49
60 50 $this->add_control(
61 51 'icon_type',
62 52 [
@@ -151,63 +141,8 @@
151 141 'default' => esc_html__( 'Optimizing production and supply chain operations and generational transitions', 'easy-elements' ),
152 142 ]
153 143 );
154 144
155 - $repeater = new \Elementor\Repeater();
156 -
157 -$repeater->add_control(
158 - '_feature_icon',
159 - [
160 - 'label' => esc_html__( 'Icon', 'easy-elements' ),
161 - 'type' => \Elementor\Controls_Manager::ICONS,
162 - 'fa4compatibility' => 'icon',
163 - 'default' => [
164 - 'value' => 'fas fa-check',
165 - 'library' => 'fa-solid',
166 - ],
167 - ]
168 -);
169 -
170 -$repeater->add_control(
171 - '_feature',
172 - [
173 - 'label' => esc_html__( 'Feature', 'easy-elements' ),
174 - 'type' => \Elementor\Controls_Manager::TEXT,
175 - 'default' => esc_html__( 'Manufacturing Industrial', 'easy-elements' ),
176 - 'label_block' => true,
177 - ]
178 -);
179 -
180 -$this->add_control(
181 - '_features',
182 - [
183 - 'label' => esc_html__( 'Features', 'easy-elements' ),
184 - 'type' => \Elementor\Controls_Manager::REPEATER,
185 - 'fields' => $repeater->get_controls(),
186 - 'condition' => [
187 - 'info_skin' => 'skin-2'
188 - ],
189 - 'default' => [
190 - [
191 - '_feature_icon' => [
192 - 'value' => 'fas fa-check',
193 - 'library' => 'fa-solid'
194 - ],
195 - '_feature' => esc_html__( 'Manufacturing Industrial', 'easy-elements' ),
196 - ],
197 - [
198 - '_feature_icon' => [
199 - 'value' => 'fas fa-check',
200 - 'library' => 'fa-solid'
201 - ],
202 - '_feature' => esc_html__( 'Supply Chain', 'easy-elements' ),
203 - ],
204 - ],
205 - 'title_field' => '<i class="{{ _feature_icon.value }}"></i> {{{ _feature }}}',
206 - ]
207 -);
208 -
209 -
210 145 $this->add_control(
211 146 'link',
212 147 [
213 148 'label' => esc_html__('Link', 'easy-elements'),
@@ -379,9 +314,8 @@
379 314 '{{WRAPPER}} .ee--icon-box.right, {{WRAPPER}} .ee--icon-box.left' => 'align-items: {{VALUE}};',
380 315 ],
381 316 'condition' => [
382 317 'icon_direction' => ['left', 'right'],
383 - 'info_skin!' => 'skin-2',
384 318 ],
385 319 ]
386 320 );
387 321
@@ -699,8 +633,9 @@
699 633 'icon_color',
700 634 [
701 635 'label' => esc_html__( 'Color', 'easy-elements' ),
702 636 'type' => Controls_Manager::COLOR,
637 + 'default' => '#fff',
703 638 'selectors' => [
704 639 '{{WRAPPER}} .ee--icon-box .eel-icon' => 'color: {{VALUE}}; fill-opacity: 1;',
705 640 '{{WRAPPER}} .ee--icon-box .eel-icon svg' => 'fill: {{VALUE}}; fill-opacity: 1;',
706 641 '{{WRAPPER}} .ee--icon-box .eel-icon svg path' => 'fill: {{VALUE}}; fill-opacity: 1;',
@@ -712,8 +647,9 @@
712 647 'icon_bg_color',
713 648 [
714 649 'label' => esc_html__( 'Background', 'easy-elements' ),
715 650 'type' => Controls_Manager::COLOR,
651 + 'default' => '#5933FF',
716 652 'selectors' => [
717 653 '{{WRAPPER}} .ee--icon-box .eel-icon' => 'background-color: {{VALUE}};',
718 654 ],
719 655 ]
@@ -1127,157 +1063,14 @@
1127 1063 '{{WRAPPER}} .ee--icon-box:hover .icon-box-description' => 'color: {{VALUE}};',
1128 1064 ],
1129 1065 ]
1130 1066 );
1131 - $this->end_controls_tab();
1132 1067
1133 1068 $this->end_controls_tabs();
1134 1069
1135 1070 $this->end_controls_section();
1136 1071
1137 -
1138 -
1139 1072 $this->start_controls_section(
1140 - 'section_feature_style',
1141 - [
1142 - 'label' => esc_html__( 'Features', 'easy-elements' ),
1143 - 'tab' => Controls_Manager::TAB_STYLE,
1144 - ]
1145 - );
1146 -
1147 - $this->start_controls_tabs( 'feature_style_tabs' );
1148 -
1149 - $this->start_controls_tab(
1150 - 'feature_style_normal',
1151 - [
1152 - 'label' => esc_html__( 'Normal', 'easy-elements' ),
1153 - ]
1154 - );
1155 -
1156 - $this->add_control(
1157 - 'feature_style_color',
1158 - [
1159 - 'label' => esc_html__( 'Text Color', 'easy-elements' ),
1160 - 'type' => Controls_Manager::COLOR,
1161 - 'selectors' => [
1162 - '{{WRAPPER}} .ee--icon-box .feature-item span' => 'color: {{VALUE}};',
1163 - ],
1164 - ]
1165 - );
1166 -
1167 - $this->add_control(
1168 - 'feature_icon_color',
1169 - [
1170 - 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
1171 - 'type' => Controls_Manager::COLOR,
1172 - 'selectors' => [
1173 - '{{WRAPPER}} .ee--icon-box .feature-item i' => 'color: {{VALUE}};',
1174 - '{{WRAPPER}} .ee--icon-box .feature-item svg' => 'fill: {{VALUE}};',
1175 - '{{WRAPPER}} .ee--icon-box .feature-item svg path' => 'fill: {{VALUE}};',
1176 - ],
1177 - ]
1178 - );
1179 -
1180 - $this->end_controls_tab();
1181 -
1182 - $this->start_controls_tab(
1183 - 'feature_style_hover',
1184 - [
1185 - 'label' => esc_html__( 'Hover', 'easy-elements' ),
1186 - ]
1187 - );
1188 -
1189 - $this->add_control(
1190 - 'feature_style_color_hover',
1191 - [
1192 - 'label' => esc_html__( 'Text Color', 'easy-elements' ),
1193 - 'type' => Controls_Manager::COLOR,
1194 - 'selectors' => [
1195 - '{{WRAPPER}} .ee--icon-box:hover .feature-item span' => 'color: {{VALUE}};',
1196 - ],
1197 - ]
1198 - );
1199 -
1200 - $this->add_control(
1201 - 'feature_icon_color_hover',
1202 - [
1203 - 'label' => esc_html__( 'Icon Color', 'easy-elements' ),
1204 - 'type' => Controls_Manager::COLOR,
1205 - 'selectors' => [
1206 - '{{WRAPPER}} .ee--icon-box:hover .feature-item i' => 'color: {{VALUE}};',
1207 - '{{WRAPPER}} .ee--icon-box:hover .feature-item svg' => 'fill: {{VALUE}};',
1208 - '{{WRAPPER}} .ee--icon-box:hover .feature-item svg path' => 'fill: {{VALUE}};',
1209 - ],
1210 - ]
1211 - );
1212 - $this->end_controls_tab();
1213 -
1214 - $this->end_controls_tabs();
1215 -
1216 - $this->add_group_control(
1217 - \Elementor\Group_Control_Typography::get_type(),
1218 - [
1219 - 'name' => 'feature_style_typography',
1220 - 'selector' => '{{WRAPPER}} .ee--icon-box .feature-item span',
1221 - ]
1222 - );
1223 -
1224 - $this->add_responsive_control(
1225 - 'feature_style_margin',
1226 - [
1227 - 'label' => esc_html__( 'Margin', 'easy-elements' ),
1228 - 'type' => Controls_Manager::DIMENSIONS,
1229 - 'size_units' => [ 'px', '%', 'em', 'rem' ],
1230 - 'selectors' => [
1231 - '{{WRAPPER}} .ee--icon-box .feature-item' =>
1232 - 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1233 - ],
1234 - ]
1235 - );
1236 -
1237 - $this->add_responsive_control(
1238 - 'feature_icon_gap',
1239 - [
1240 - 'label' => esc_html__( 'Icon Gap', 'easy-elements' ),
1241 - 'type' => Controls_Manager::SLIDER,
1242 - 'range' => [
1243 - 'px' => [
1244 - 'min' => 0,
1245 - 'max' => 100,
1246 - ],
1247 - ],
1248 - 'selectors' => [
1249 - '{{WRAPPER}} .feature-item .eel-info-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
1250 - '{{WRAPPER}} .feature-item svg' => 'margin-right: {{SIZE}}{{UNIT}};',
1251 - ],
1252 - ]
1253 - );
1254 - $this->add_responsive_control(
1255 - 'feature_icon_size',
1256 - [
1257 - 'label' => esc_html__( 'Icon Size', 'easy-elements' ),
1258 - 'type' => Controls_Manager::SLIDER,
1259 - 'range' => [
1260 - 'px' => [
1261 - 'min' => 10,
1262 - 'max' => 100,
1263 - ],
1264 - ],
1265 - 'selectors' => [
1266 - '{{WRAPPER}} .feature-item .eel-info-icon' => 'font-size: {{SIZE}}{{UNIT}};',
1267 - '{{WRAPPER}} .feature-item svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1268 - ],
1269 - ]
1270 - );
1271 -
1272 - $this->end_controls_section();
1273 -
1274 -
1275 -
1276 -
1277 -
1278 -
1279 - $this->start_controls_section(
1280 1073 'section_button_style',
1281 1074 [
1282 1075 'label' => esc_html__( 'Button', 'easy-elements' ),
1283 1076 'tab' => Controls_Manager::TAB_STYLE,
@@ -1544,58 +1337,9 @@
1544 1337 'read_more_type' => ['read_text','read_icon_to_text'],
1545 1338 ],
1546 1339 ]
1547 1340 );
1548 - $this->add_responsive_control(
1549 - 'read_more_icon_margin',
1550 - [
1551 - 'label' => esc_html__('Margin', 'easy-elements'),
1552 - 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1553 - 'size_units' => [ 'px', 'em', '%' ],
1554 - 'selectors' => [
1555 - '{{WRAPPER}} .ee--icon-box .eel-read-more' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1556 - ]
1557 - ]
1558 - );
1559 1341
1560 -
1561 -
1562 - $this->add_responsive_control(
1563 - 'button_text_align',
1564 - [
1565 - 'label' => esc_html__( 'Alignment', 'easy-elements' ),
1566 - 'type' => \Elementor\Controls_Manager::CHOOSE,
1567 - 'options' => [
1568 - 'flex-start' => [
1569 - 'title' => esc_html__( 'Left', 'easy-elements' ),
1570 - 'icon' => 'eicon-text-align-left',
1571 - ],
1572 - 'center' => [
1573 - 'title' => esc_html__( 'Center', 'easy-elements' ),
1574 - 'icon' => 'eicon-text-align-center',
1575 - ],
1576 - 'end' => [
1577 - 'title' => esc_html__( 'Right', 'easy-elements' ),
1578 - 'icon' => 'eicon-text-align-right',
1579 - ],
1580 - 'stretch' => [
1581 - 'title' => esc_html__( 'Justified', 'easy-elements' ),
1582 - 'icon' => 'eicon-text-align-justify',
1583 - ],
1584 - ],
1585 - 'default' => 'left',
1586 - 'condition' => [
1587 - 'info_skin' => 'skin-2',
1588 - ],
1589 - 'selectors' => [
1590 - '{{WRAPPER}} .eel-info-skin-2 .eel-read-more' => 'justify-content: {{VALUE}};',
1591 -
1592 - ],
1593 - ]
1594 - );
1595 -
1596 -
1597 -
1598 1342 $this->end_controls_tab();
1599 1343
1600 1344 $this->start_controls_tab( 'button_hover_tab_style', [
1601 1345 'label' => __('Hover', 'easy-elements'),
@@ -1688,9 +1432,8 @@
1688 1432
1689 1433 protected function render() {
1690 1434 $settings = $this->get_settings_for_display();
1691 1435 $gradient_border = ( isset( $settings['gradient_border'] ) && $settings['gradient_border'] === 'yes' ) ? 'ee--gradient-border' : '';
1692 - $info_skin = isset($settings['info_skin']) ? esc_attr($settings['info_skin']) : '';
1693 1436
1694 1437 ?>
1695 1438 <div class="eel-icon-box-wraps">
1696 1439 <?php
@@ -1700,24 +1443,113 @@
1700 1443 $nofollow = ! empty( $settings['link']['nofollow'] ) ? ' rel="nofollow"' : '';
1701 1444 $item_hover_styles = !empty( $settings['item_bg_hover_styles'] ) ? $settings['item_bg_hover_styles'] : '';
1702 1445
1703 1446 ?>
1447 + <?php if ( $link ) : ?>
1448 + <a href="<?php echo esc_url($link); ?>"<?php echo esc_attr($target) . esc_attr($nofollow); ?>>
1449 + <?php endif; ?>
1450 + <div class="ee--icon-box <?php echo esc_attr($icon_direction); ?> eel-bf-<?php echo esc_attr( $item_hover_styles ); ?>">
1451 + <?php if ( isset( $settings['icon']['value'] ) && $settings['icon']['value'] ) : ?>
1452 + <span class="eel-icon">
1453 + <?php
1454 + \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] );
1455 + ?>
1456 + </span>
1457 + <?php elseif ( 'image' === $settings['icon_type'] && ! empty( $settings['icon_image']['url'] ) ) : ?>
1458 + <span class="eel-icon eel-icon-image">
1459 + <?php
1460 + if ( ! empty( $settings['icon_image']['id'] ) ) {
1461 + echo wp_get_attachment_image(
1462 + $settings['icon_image']['id'],
1463 + 'full',
1464 + false,
1465 + ['alt' => $settings['icon_image']['alt'] ?? '']
1466 + );
1467 + } elseif ( ! empty( $settings['icon_image']['url'] ) ) {
1468 + echo '<img src="' . esc_url( $settings['icon_image']['url'] ) . '" alt="">';
1469 + }
1470 + ?>
1471 + </span>
1472 + <?php endif; ?>
1704 1473
1705 - <?php
1706 - $skin_file = plugin_dir_path(__FILE__) . 'skin/';
1707 - switch ($info_skin) {
1708 - case 'default':
1709 - include $skin_file . 'default.php';
1710 - break;
1711 - case 'skin-2':
1712 - include $skin_file . 'skin-2.php';
1713 - break;
1714 - default:
1715 - include $skin_file . 'default.php';
1716 - break;
1717 - }
1718 - ?>
1719 -
1474 + <?php if ( ! empty( $settings['number_title'] ) ) : ?>
1475 + <div class="eel-pro-number easyel-gradeint-<?php echo esc_attr($settings['number_gradeint']) ?>"><?php echo esc_html( $settings['number_title'] ); ?></div>
1476 + <?php endif; ?>
1477 +
1478 + <?php if ( $settings['icon_direction'] === 'left' || $settings['icon_direction'] === 'right' ) : ?>
1479 + <div class="eel-title-content-wrap">
1480 + <?php endif; ?>
1481 +
1482 + <?php if ( ! empty( $settings['procs_title'] ) ) :
1483 + $title_tag = isset( $settings['title_tag'] ) ? esc_attr( $settings['title_tag'] ) : 'h3'; ?>
1484 + <<?php echo tag_escape($title_tag); ?> class="icon-box-title">
1485 + <?php echo wp_kses_post( $settings['procs_title'] ); ?>
1486 + </<?php echo tag_escape($title_tag); ?>>
1487 + <?php endif; ?>
1488 +
1489 + <?php if ( ! empty( $settings['_description'] ) ) : ?>
1490 + <div class="icon-box-description"><?php echo wp_kses_post( $settings['_description'] ); ?></div>
1491 + <?php endif; ?>
1492 +
1493 + <?php if ( !empty($settings['show_read_more']) && $settings['show_read_more'] === 'yes' ) : ?>
1494 + <div class="eel-read-more">
1495 + <?php if ( $settings['read_more_type'] === 'read_icon' ) : ?>
1496 + <span class="eel-read-more-icon">
1497 + <?php
1498 + if ( !empty($settings['read_more_icon']['value']) ) {
1499 + \Elementor\Icons_Manager::render_icon( $settings['read_more_icon'], [ 'aria-hidden' => 'true' ] );
1500 + } else {
1501 + echo '<i class="unicon-arrow-up-right"></i>';
1502 + }
1503 + ?>
1504 + </span>
1505 + <?php elseif ( $settings['read_more_type'] === 'read_text' && !empty($settings['read_more_text']) ) : ?>
1506 + <span class="eel-read-more-text">
1507 + <?php echo esc_html( $settings['read_more_text'] ); ?>
1508 + <?php
1509 + if (
1510 + !empty($settings['read_more_text_icon_show']) &&
1511 + $settings['read_more_text_icon_show'] === 'yes'
1512 + ) {
1513 + echo '<span class="eel-read-more-text-icon">';
1514 + if (!empty($settings['read_more_text_icon']['value'])) {
1515 + \Elementor\Icons_Manager::render_icon( $settings['read_more_text_icon'], [ 'aria-hidden' => 'true' ] );
1516 + } else {
1517 + echo '<i class="unicon-arrow-up-right"></i>';
1518 + }
1519 + echo '</span>';
1520 + }
1521 + ?>
1522 + </span>
1523 + <?php elseif ( $settings['read_more_type'] === 'read_icon_to_text' && !empty($settings['read_more_text']) ) : ?>
1524 + <span class="eel-read-more-text eel-icon-to-text">
1525 + <span class="eel-text"><?php echo esc_html( $settings['read_more_text'] ); ?></span>
1526 + <?php
1527 + if (
1528 + !empty($settings['read_more_text_icon_show']) &&
1529 + $settings['read_more_text_icon_show'] === 'yes'
1530 + ) {
1531 + echo '<span class="eel-read-more-text-icon">';
1532 + if (!empty($settings['read_more_text_icon']['value'])) {
1533 + \Elementor\Icons_Manager::render_icon( $settings['read_more_text_icon'], [ 'aria-hidden' => 'true' ] );
1534 + } else {
1535 + echo '<i class="unicon-add"></i>';
1536 + }
1537 + echo '</span>';
1538 + }
1539 + ?>
1540 + </span>
1541 + <?php endif; ?>
1542 + </div>
1543 + <?php endif; ?>
1544 +
1545 + <?php if ( $settings['icon_direction'] === 'left' || $settings['icon_direction'] === 'right' ) : ?>
1546 + </div>
1547 + <?php endif; ?>
1548 + </div>
1549 + <?php if ( $link ) : ?>
1550 + </a>
1551 + <?php endif; ?>
1720 1552 </div>
1721 1553 <?php
1722 1554 }
1723 -}
1555 +} ?>