]> _ Git - physioassist-wordpress.git/commitdiff
Repeater code updates, Slick Carousel fixes and improve file selection control. Done...
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 27 Apr 2021 11:01:06 +0000 (11:01 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 27 Apr 2021 11:01:06 +0000 (11:01 +0000)
20 files changed:
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/BackgroundImage.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/HeroBlock.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ModalList.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/MultimediaCarousel.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ProfileGrid.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/ResourceGrid.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/TextBlock.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/TextCarousel.php
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/VideoGallery.php
wp-content/plugins/file-select-control-for-elementor/README.md [new file with mode: 0644]
wp-content/plugins/file-select-control-for-elementor/controls/fileselect-control.php [new file with mode: 0644]
wp-content/plugins/file-select-control-for-elementor/controls/js/fileselect-control.js [new file with mode: 0644]
wp-content/plugins/file-select-control-for-elementor/file-select-control-elementor.php [new file with mode: 0644]
wp-content/plugins/file-select-control-for-elementor/languages/file-select-control-for-elementor.pot [new file with mode: 0644]
wp-content/plugins/file-select-control-for-elementor/readme.txt [new file with mode: 0644]
wp-content/plugins/file-select-control-for-elementor/widgets/file-link-widget.php [new file with mode: 0644]
wp-content/themes/physioassist/package.json
wp-content/themes/physioassist/resources/assets/config.json
wp-content/themes/physioassist/resources/assets/scripts/slick.js [new file with mode: 0644]
wp-content/themes/physioassist/yarn.lock

index e0d18e5404cece52bc535edb10a6a535ed846b0d..c7123bfa52d84a8b0f9d88e6aa52ccc2a1c43d16 100644 (file)
@@ -49,7 +49,7 @@ class BackgroundImage extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_image',
index 707fda5f77d33f482274618978c5af412f2d9f02..42058e55bc8cfe863aad5fb9b7c0ae3c0ec2b35d 100644 (file)
@@ -58,7 +58,7 @@ class HeroBlock extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
index 7fa142df361042ae975ce9e210285d9aea63cbff..2149d72ca4f1a524cfb80e40c4662a2d802f7cfd 100644 (file)
@@ -5,6 +5,10 @@ namespace PhysioAssist\Elementor\Widgets;
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
 use Elementor\Scheme_Color;
+use Elementor\Repeater;
+
+use function App\asset_path;
+use function App\template;
 
 
 class ModalList extends Widget_Base {
@@ -41,11 +45,11 @@ class ModalList extends Widget_Base {
      */
     public function get_script_depends() {
 
-        wp_register_script('lity', \App\asset_path('scripts/lity.js'), ['jquery'], null, true);
+        wp_register_script('lity', asset_path('scripts/lity.js'), ['jquery'], null, true);
 
         wp_register_script(
             'cube-modal-list',
-            \App\asset_path('scripts/modal-list.js'),
+            asset_path('scripts/modal-list.js'),
             ['jquery', 'lity'], // Dependencies
             null, // Version
             true // In footer?
@@ -60,7 +64,7 @@ class ModalList extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
@@ -69,26 +73,33 @@ class ModalList extends Widget_Base {
             ]
         );
 
+        $repeater = new Repeater();
+
+        $repeater->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'elementor' ),
+                'type' => Controls_Manager::TEXT,
+                'placeholder' => __( 'Enter your title', 'elementor' ),
+                'default' => '',
+            ]
+        );
+
+        $repeater->add_control(
+            'body',
+            [
+                'label' => __('Body', 'cube'),
+                'type' => Controls_Manager::WYSIWYG,
+                'default' => '',
+            ]
+        );
+
         $this->add_control(
             'items',
             [
                 'label' => __( 'Items', 'cube' ),
                 'type' => Controls_Manager::REPEATER,
-                'fields' => [
-                    [
-                        'name' => 'title',
-                        'label' => __( 'Title', 'elementor' ),
-                        'type' => Controls_Manager::TEXT,
-                        'placeholder' => __( 'Enter your title', 'elementor' ),
-                        'default' => '',
-                    ],
-                    [
-                        'name' => 'body',
-                        'label' => __('Body', 'cube'),
-                        'type' => Controls_Manager::WYSIWYG,
-                        'default' => '',
-                    ],
-                ],
+                'fields' => $repeater->get_controls(),
                 'title_field' => '{{{ title }}}',
             ]
         );
@@ -106,7 +117,7 @@ class ModalList extends Widget_Base {
 
         $items = $this->get_settings('items');
 
-        echo \App\template('widgets/modal-list', compact('items'));
+        echo template('widgets/modal-list', compact('items'));
     }
 
 }
index d645b365e83dc0da174f9955c44f1e63389f4376..992ec12025cd4c677a1a9194fcd2fbd62cbd9227 100644 (file)
@@ -6,6 +6,7 @@ use Elementor\Embed;
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
 use Elementor\Utils as ElementorUtils;
+use Elementor\Repeater;
 
 use PhysioAssist\Elementor\Utils;
 
@@ -46,17 +47,17 @@ class MultimediaCarousel extends Widget_Base {
     public function get_script_depends() {
 
         wp_register_script('lity', asset_path('scripts/lity.js'), ['jquery'], null, true);
+        wp_register_script('slick', asset_path('scripts/slick.js'), ['jquery'], null, true);
 
         wp_register_script(
             'cube-multimedia-carousel',
             asset_path('scripts/multimedia-carousel.js'),
-            ['jquery', 'lity'], // Dependencies
+            ['jquery', 'lity', 'slick'], // Dependencies
             null, // Version
             true // In footer?
         );
 
-        // Use script already registered by Elementor so we don't have to include another copy of Slick
-        return ['jquery-slick', 'cube-multimedia-carousel'];
+        return ['cube-multimedia-carousel'];
     }
     /**
      * Register the widget controls.
@@ -65,7 +66,7 @@ class MultimediaCarousel extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
@@ -74,92 +75,99 @@ class MultimediaCarousel extends Widget_Base {
             ]
         );
 
+        $repeater = new Repeater();
+
+        $repeater->add_control(
+            'type',
+            [
+                'label' => __('Slide Type', 'cube'),
+                'type' => Controls_Manager::SELECT,
+                'default' => '',
+                'options' => [
+                    '' => __('(Select)'),
+                    'video' => __( 'Video', 'cube' ),
+                    'text' => __( 'Text', 'cube' ),
+                ],
+            ]
+        );
+
+        $repeater->add_control(
+            'image',
+            [
+                'label' => __('Image', 'cube'),
+                'label_block' => true,
+                'type' => Controls_Manager::MEDIA,
+                'default' => [
+                    'url' => ElementorUtils::get_placeholder_image_src(),
+                ],
+                'condition' => [
+                    'type' => ['text', 'video']
+                ],
+            ]
+        );
+
+        // Video URL only used for video slides
+        $repeater->add_control(
+            'url',
+            [
+                'label' => __( 'Video URL', 'cube' ),
+                'placeholder' => __( 'Enter YouTube link', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+                'condition' => [
+                    'type' => 'video'
+                ],
+            ]
+        );
+
+        $repeater->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+                'default' => '',
+                'condition' => [
+                    'type' => ['text', 'video']
+                ],
+            ]
+        );
+
+        $repeater->add_control(
+            'subtitle',
+            [
+                'label' => __( 'Subtitle', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+                'condition' => [
+                    'type' => ['text', 'video']
+                ],
+            ]
+        );
+
+        // Body field is only used for "text" slides
+        $repeater->add_control(
+            'body',
+            [
+                'label' => __('Body', 'cube'),
+                'type' => Controls_Manager::WYSIWYG,
+                'default' => '',
+                'dynamic' => [
+                    'active' => false,
+                ],
+                'condition' => [
+                    'type' => 'text'
+                ],
+            ]
+        );
+
 
         $this->add_control(
             'items',
             [
                 'label' => __( 'Items', 'cube' ),
                 'type' => Controls_Manager::REPEATER,
-                'fields' => [
-
-
-                    // TODO: finish video / text fields integration. Think about which fields can be used by both (image?)
-                    // TODO: refactor blade partials so same partial can be used by individual carousels + mixed carousel to output content (switch based on item type)
-
-
-
-                    [
-                        'name' => 'type',
-                        'label' => __('Slide Type', 'cube'),
-                        'type' => Controls_Manager::SELECT,
-                        'default' => '',
-                        'options' => [
-                            '' => __('(Select)'),
-                            'video' => __( 'Video', 'cube' ),
-                            'text' => __( 'Text', 'cube' ),
-                        ],
-                    ],
-
-
-                    [
-                        'name' => 'image',
-                        'label' => __('Image', 'cube'),
-                        'label_block' => true,
-                        'type' => Controls_Manager::MEDIA,
-                        'default' => [
-                            'url' => ElementorUtils::get_placeholder_image_src(),
-                        ],
-                        'condition' => [
-                            'type' => ['text', 'video']
-                        ],
-                    ],
-
-                    // Video URL only used for video slides
-                    [
-                        'name' => 'url',
-                        'label' => __( 'Video URL', 'cube' ),
-                        'placeholder' => __( 'Enter YouTube link', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                        'condition' => [
-                            'type' => 'video'
-                        ],
-                    ],
-
-                    [
-                        'name' => 'title',
-                        'label' => __( 'Title', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                        'default' => '',
-                        'condition' => [
-                            'type' => ['text', 'video']
-                        ],
-                    ],
-                    [
-                        'name' => 'subtitle',
-                        'label' => __( 'Subtitle', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                        'condition' => [
-                            'type' => ['text', 'video']
-                        ],
-                    ],
-
-                    // Body field is only used for "text" slides
-                    [
-                        'name' => 'body',
-                        'label' => __('Body', 'cube'),
-                        'type' => Controls_Manager::WYSIWYG,
-                        'default' => '',
-                        'dynamic' => [
-                            'active' => false,
-                        ],
-                        'condition' => [
-                            'type' => 'text'
-                        ],
-                    ],
-                ],
+                'fields' => $repeater->get_controls(),
                 'title_field' => '{{{ type == "text" ? \'<i class="eicon-text-align-left"></i>\' : "" }}} {{{ type == "video" ? \'<i class="eicon-video-camera"></i>\' : "" }}} {{{ title }}}',
             ]
         );
index 38c0ce9f8f0604e597c40f5a76410d360a6a226b..b6fc7e0f84bf7ce44bb4aa9d4a01777abe464d7f 100644 (file)
@@ -5,7 +5,10 @@ namespace PhysioAssist\Elementor\Widgets;
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
 use Elementor\Utils;
+use Elementor\Repeater;
 
+use function App\asset_path;
+use function App\template;
 
 class ProfileGrid extends Widget_Base {
 
@@ -41,18 +44,18 @@ class ProfileGrid extends Widget_Base {
      */
     public function get_script_depends() {
 
-        wp_register_script('lity', \App\asset_path('scripts/lity.js'), ['jquery'], null, true);
+        wp_register_script('lity', asset_path('scripts/lity.js'), ['jquery'], null, true);
+        wp_register_script('slick', asset_path('scripts/slick.js'), ['jquery'], null, true);
 
         wp_register_script(
             'cube-profile-grid',
-            \App\asset_path('scripts/profile-grid.js'),
-            ['jquery', 'lity'], // Dependencies
+            asset_path('scripts/profile-grid.js'),
+            ['jquery', 'lity', 'slick'], // Dependencies
             null, // Version
             true // In footer?
         );
 
-        // Use script already registered by Elementor so we don't have to include another copy of Slick
-        return ['jquery-slick', 'cube-profile-grid'];
+        return ['cube-profile-grid'];
     }
     /**
      * Register the widget controls.
@@ -61,7 +64,7 @@ class ProfileGrid extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
@@ -85,60 +88,79 @@ class ProfileGrid extends Widget_Base {
             ]
         );
 
+        $repeater = new Repeater();
+
+        $repeater->add_control(
+            'image',
+            [
+                'label' => __('Image', 'cube'),
+                'label_block' => true,
+                'type' => Controls_Manager::MEDIA,
+                'default' => [
+                    'url' => Utils::get_placeholder_image_src(),
+                ],
+            ]
+        );
+
+        $repeater->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+                'default' => '',
+            ]
+        );
+
+        $repeater->add_control(
+            'subtitle',
+            [
+                'label' => __( 'Subtitle', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+            ]
+        );
+
+        $repeater->add_control(
+            'body',
+            [
+                'label' => __('Body', 'cube'),
+                'type' => Controls_Manager::WYSIWYG,
+                'default' => '',
+                'dynamic' => [
+                    'active' => false,
+                ],
+            ]
+        );
+
+        $repeater->add_control(
+            'cta_text',
+            [
+                'label' => __('Call to Action text', 'cube'),
+                'type' => Controls_Manager::TEXT,
+                'default' => ''
+            ]
+        );
+
+        $repeater->add_control(
+            'cta_link',
+            [
+                'label' => __('Call to Action link', 'cube'),
+                'type' => Controls_Manager::URL,
+                'default' => [
+                    'url' => '',
+                    'is_external' => false,
+                ],
+                'show_external' => true
+            ]
+        );
+
         $this->add_control(
             'items',
             [
                 'label' => __( 'Items', 'cube' ),
                 'type' => Controls_Manager::REPEATER,
-                'fields' => [
-                    [
-                        'name' => 'image',
-                        'label' => __('Image', 'cube'),
-                        'label_block' => true,
-                        'type' => Controls_Manager::MEDIA,
-                        'default' => [
-                            'url' => Utils::get_placeholder_image_src(),
-                        ],
-                    ],
-                    [
-                        'name' => 'title',
-                        'label' => __( 'Title', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                        'default' => '',
-                    ],
-                    [
-                        'name' => 'subtitle',
-                        'label' => __( 'Subtitle', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                    ],
-                    [
-                        'name' => 'body',
-                        'label' => __('Body', 'cube'),
-                        'type' => Controls_Manager::WYSIWYG,
-                        'default' => '',
-                        'dynamic' => [
-                            'active' => false,
-                        ],
-                    ],
-                    [
-                        'name' => 'cta_text',
-                        'label' => __('Call to Action text', 'cube'),
-                        'type' => Controls_Manager::TEXT,
-                        'default' => ''
-                    ],
-                    [
-                        'name' => 'cta_link',
-                        'label' => __('Call to Action link', 'cube'),
-                        'type' => Controls_Manager::URL,
-                        'default' => [
-                            'url' => '',
-                            'is_external' => false,
-                        ],
-                        'show_external' => true
-                    ],
-                ],
+                'fields' => $repeater->get_controls(),
                 'title_field' => '{{{ title }}}',
             ]
         );
@@ -189,9 +211,9 @@ class ProfileGrid extends Widget_Base {
         $truncate_lines = $this->get_settings('truncate_lines');
 
         if ($display_type == 'carousel') {
-            echo \App\template('widgets/profile-carousel', compact('items', 'ID'));
+            echo template('widgets/profile-carousel', compact('items', 'ID'));
         } else {
-            echo \App\template('widgets/profile-grid', compact('items', 'truncate_lines'));
+            echo template('widgets/profile-grid', compact('items', 'truncate_lines'));
         }
     }
 
index 8432bda10ebee1b381d2621441f54a893384d1f1..b63407966504bc6bce23a27b05af9e56029a1d0b 100644 (file)
@@ -5,6 +5,10 @@ namespace PhysioAssist\Elementor\Widgets;
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
 use Elementor\Utils;
+use Elementor\Repeater;
+
+use function App\asset_path;
+use function App\template;
 
 
 class ResourceGrid extends Widget_Base {
@@ -41,16 +45,18 @@ class ResourceGrid extends Widget_Base {
      */
     public function get_script_depends() {
 
+        wp_register_script('slick', asset_path('scripts/slick.js'), ['jquery'], null, true);
+
         wp_register_script(
             'cube-resource-carousel',
-            \App\asset_path('scripts/resource-carousel.js'),
-            ['jquery'], // Dependencies
+            asset_path('scripts/resource-carousel.js'),
+            ['jquery', 'slick'], // Dependencies
             null, // Version
             true // In footer?
         );
 
         // Use script already registered by Elementor so we don't have to include another copy of Slick
-        return [ 'jquery-slick', 'cube-resource-carousel' ];
+        return ['cube-resource-carousel'];
 
     }
     /**
@@ -60,7 +66,7 @@ class ResourceGrid extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
@@ -84,50 +90,59 @@ class ResourceGrid extends Widget_Base {
             ]
         );
 
+        $repeater = new Repeater();
+
+        $repeater->add_control(
+            'image',
+            [
+                'label' => __('Preview Image', 'cube'),
+                'label_block' => true,
+                'type' => Controls_Manager::MEDIA,
+                'default' => [
+                    'url' => Utils::get_placeholder_image_src(),
+                ],
+            ]
+        );
+
+        $repeater->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+                'default' => '',
+            ]
+        );
+
+        $repeater->add_control(
+            'interactive_version',
+            [
+                'label' => __( 'Interactive version link', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+            ]
+        );
+
+        $repeater->add_control(
+            'pdf',
+            [
+                'type' => 'file-select', // Using the file-select-control-for-elementor plugin
+                'label' => __( 'PDF link', 'cube' ),
+                'label_block' => true,
+                'placeholder' => __('PDF URL', 'cube'),
+            ]
+        );
+
         $this->add_control(
             'items',
             [
                 'label' => __( 'Items', 'cube' ),
                 'type' => Controls_Manager::REPEATER,
-                'fields' => [
-                    [
-                        'name' => 'image',
-                        'label' => __('Preview Image', 'cube'),
-                        'label_block' => true,
-                        'type' => Controls_Manager::MEDIA,
-                        'default' => [
-                            'url' => Utils::get_placeholder_image_src(),
-                        ],
-                    ],
-                    [
-                        'name' => 'title',
-                        'label' => __( 'Title', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                        'default' => '',
-                    ],
-
-                    // Todo: revisit this to see if we can have a more user-friendly file control
-                    // See: https://github.com/pojome/elementor/issues/4468
-                    // See also: https://github.com/elementor/elementor/issues/1573#issuecomment-561405541
-                    // A searchable URL field might be enough but the text control isn't compatible with the
-                    // data structure of the URL control so that would need to be handled or transitioned
-                    [
-                        'name' => 'interactive_version',
-                        'label' => __( 'Interactive version link', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                    ],
-                    [
-                        'name' => 'pdf',
-                        'label' => __( 'PDF link', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                    ],
-                ],
+                'fields' => $repeater->get_controls(),
                 'title_field' => '{{{ title }}}',
             ]
         );
+
         $this->end_controls_section();
     }
     /**
@@ -143,9 +158,9 @@ class ResourceGrid extends Widget_Base {
         $items = $this->get_settings('items');
 
         if ($display_type == 'carousel') {
-            echo \App\template('widgets/resource-carousel', compact('items'));
+            echo template('widgets/resource-carousel', compact('items'));
         } else {
-            echo \App\template('widgets/resource-grid', compact('items'));
+            echo template('widgets/resource-grid', compact('items'));
         }
     }
 
index 301ec52c1b456cc6c670bd48d24cc5aab99c3852..9f30ba3111718cce7fcf0fc06197c69a72902740 100644 (file)
@@ -59,7 +59,7 @@ class TextBlock extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
index b1187d57fd867f8c717c02c4c701585fd94023a4..f50a23a468e4c2f098e1d5028cb98b0d2e3bf9a6 100644 (file)
@@ -2,10 +2,13 @@
 
 namespace PhysioAssist\Elementor\Widgets;
 
+use Elementor\Repeater;
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
 use Elementor\Scheme_Color;
 
+use function App\asset_path;
+use function App\template;
 
 class TextCarousel extends Widget_Base {
 
@@ -41,16 +44,18 @@ class TextCarousel extends Widget_Base {
      */
     public function get_script_depends() {
 
+        wp_register_script('slick', asset_path('scripts/slick.js'), ['jquery'], null, true);
+
         wp_register_script(
             'cube-text-carousel',
-            \App\asset_path('scripts/text-carousel.js'),
-            ['jquery'], // Dependencies
+            asset_path('scripts/text-carousel.js'),
+            ['jquery', 'slick'], // Dependencies
             null, // Version
             true // In footer?
         );
 
         // Use script already registered by Elementor so we don't have to include another copy of Slick
-        return ['jquery-slick', 'cube-text-carousel'];
+        return ['cube-text-carousel'];
     }
     /**
      * Register the widget controls.
@@ -59,7 +64,7 @@ class TextCarousel extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
@@ -68,48 +73,64 @@ class TextCarousel extends Widget_Base {
             ]
         );
 
+        $repeater = new Repeater();
+
+        $repeater->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'elementor' ),
+                'type' => Controls_Manager::TEXT,
+                'placeholder' => __( 'Enter your title', 'elementor' ),
+                'default' => '',
+            ]
+        );
+
+        $repeater->add_control(
+            'subtitle',
+            [
+                'label' => __( 'Subtitle', 'cube' ),
+                'type' => Controls_Manager::TEXTAREA,
+                'label_block' => true,
+            ]
+        );
+
+        $repeater->add_control(
+            'body',
+            [
+                'label' => __('Body', 'cube'),
+                'type' => Controls_Manager::WYSIWYG,
+                'default' => '',
+            ]
+        );
+
+        $repeater->add_control(
+            'cta_text',
+            [
+                'label' => __('Call to Action text', 'cube'),
+                'type' => Controls_Manager::TEXT,
+                'default' => ''
+            ]
+        );
+
+        $repeater->add_control(
+            'cta_link',
+            [
+                'label' => __('Call to Action link', 'cube'),
+                'type' => Controls_Manager::URL,
+                'default' => [
+                    'url' => '',
+                    'is_external' => false,
+                ],
+                'show_external' => true
+            ]
+        );
+
         $this->add_control(
             'items',
             [
                 'label' => __( 'Items', 'cube' ),
                 'type' => Controls_Manager::REPEATER,
-                'fields' => [
-                    [
-                        'name' => 'title',
-                        'label' => __( 'Title', 'elementor' ),
-                        'type' => Controls_Manager::TEXT,
-                        'placeholder' => __( 'Enter your title', 'elementor' ),
-                        'default' => '',
-                    ],
-                    [
-                        'name' => 'subtitle',
-                        'label' => __( 'Subtitle', 'cube' ),
-                        'type' => Controls_Manager::TEXTAREA,
-                        'label_block' => true,
-                    ],
-                    [
-                        'name' => 'body',
-                        'label' => __('Body', 'cube'),
-                        'type' => Controls_Manager::WYSIWYG,
-                        'default' => '',
-                    ],
-                    [
-                        'name' => 'cta_text',
-                        'label' => __('Call to Action text', 'cube'),
-                        'type' => Controls_Manager::TEXT,
-                        'default' => ''
-                    ],
-                    [
-                        'name' => 'cta_link',
-                        'label' => __('Call to Action link', 'cube'),
-                        'type' => Controls_Manager::URL,
-                        'default' => [
-                            'url' => '',
-                            'is_external' => false,
-                        ],
-                        'show_external' => true
-                    ],
-                ],
+                'fields' => $repeater->get_controls(),
                 'title_field' => '{{{ title }}}',
             ]
         );
@@ -245,7 +266,7 @@ class TextCarousel extends Widget_Base {
 
         $items = $this->get_settings('items');
 
-        echo \App\template('widgets/text-carousel', compact('items'));
+        echo template('widgets/text-carousel', compact('items'));
     }
 
 }
index cbf03895ac5df30b45ef0e9d881549c5611403b5..476471f7785d9a1e8a0f9727cfb9c28fb9e41625 100644 (file)
@@ -4,11 +4,13 @@ namespace PhysioAssist\Elementor\Widgets;
 
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
+use Elementor\Repeater;
 use Elementor\Utils as ElementorUtils;
 use Elementor\Embed;
 
 use PhysioAssist\Elementor\Utils;
 
+use function App\asset_path;
 use function App\template;
 
 class VideoGallery extends Widget_Base {
@@ -43,16 +45,17 @@ class VideoGallery extends Widget_Base {
      */
     public function get_script_depends() {
 
+        wp_register_script('slick', asset_path('scripts/slick.js'), ['jquery'], null, true);
+
         wp_register_script(
             'cube-video-carousel',
-            \App\asset_path('scripts/video-carousel.js'),
-            ['jquery'], // Dependencies
+            asset_path('scripts/video-carousel.js'),
+            ['jquery', 'slick'], // Dependencies
             null, // Version
             true // In footer?
         );
 
-        // Use script already registered by Elementor so we don't have to include another copy of Slick
-        return [ 'jquery-slick', 'cube-video-carousel' ];
+        return ['cube-video-carousel'];
     }
     /**
      * Register the widget controls.
@@ -61,7 +64,7 @@ class VideoGallery extends Widget_Base {
      * @since 1.0.0
      * @access protected
      */
-    protected function _register_controls() {
+    protected function register_controls() {
 
         $this->start_controls_section(
             'section_content',
@@ -85,43 +88,56 @@ class VideoGallery extends Widget_Base {
             ]
         );
 
+        $repeater = new Repeater();
+
+        $repeater->add_control(
+            'url',
+            [
+                'label' => __( 'Video URL', 'cube' ),
+                'placeholder' => __( 'Enter YouTube link', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+            ]
+        );
+
+        $repeater->add_control(
+            'title',
+            [
+                'label' => __( 'Title', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+                'default' => '',
+            ]
+        );
+
+        $repeater->add_control(
+            'details',
+            [
+                'label' => __( 'Additional Details', 'cube' ),
+                'placeholder' => __( 'Extra information for slider view', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'label_block' => true,
+            ]
+        );
+
+        $repeater->add_control(
+            'image',
+            [
+                'label' => __('Preview Image (optional)', 'cube'),
+                'label_block' => true,
+                'type' => Controls_Manager::MEDIA,
+                'default' => [
+                    'url' => ElementorUtils::get_placeholder_image_src(),
+                ],
+            ]
+        );
+
         $this->add_control(
             'videos',
             [
                 'label' => __( 'Videos', 'cube' ),
                 'type' => Controls_Manager::REPEATER,
-                'fields' => [
-                    [
-                        'name' => 'url',
-                        'label' => __( 'Video URL', 'cube' ),
-                        'placeholder' => __( 'Enter YouTube link', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                    ],
-                    [
-                        'name' => 'title',
-                        'label' => __( 'Title', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                        'default' => '',
-                    ],
-                    [
-                        'name' => 'details',
-                        'label' => __( 'Additional Details', 'cube' ),
-                        'placeholder' => __( 'Extra information for slider view', 'cube' ),
-                        'type' => Controls_Manager::TEXT,
-                        'label_block' => true,
-                    ],
-                    [
-                        'name' => 'image',
-                        'label' => __('Preview Image (optional)', 'cube'),
-                        'label_block' => true,
-                        'type' => Controls_Manager::MEDIA,
-                        'default' => [
-                            'url' => ElementorUtils::get_placeholder_image_src(),
-                        ],
-                    ],
-                ],
+                'fields' => $repeater->get_controls(),
                 'title_field' => '{{{ title }}}',
             ]
         );
diff --git a/wp-content/plugins/file-select-control-for-elementor/README.md b/wp-content/plugins/file-select-control-for-elementor/README.md
new file mode 100644 (file)
index 0000000..f4379b7
--- /dev/null
@@ -0,0 +1,13 @@
+# Elementor File Select Control
+Adds a new control for Elementor page builder which allows you to choose any kind of file from WordPress Media Library. Its Created for developers to take the code and use in your own project.
+
+Additionally this plugin comes with an Elementor Widget just to demonstrate how to integrate manily but that let's you create simple links to Media Files.
+
+## How To Use ?
+Please find detailed instructions on the following blog post on my blog: https://abdulawal.com/elementor-file-select-control
+
+## Notes
+As its a standalone plugin itself, you can actually just install this plugin on your site and use the control & widget that comes with this plugin if you're working on a website instead of a Theme or Plugin project. I'll try to put this on WordPress Repository as well, Will update the link here when its uploaded there.
+
+## Need Support ?
+Please feel free to use the comment section of my blog or issues section here on github or Twitter <a href="https://twitter.com/abdulawaluzzal">@abdulawaluzzal</a>
diff --git a/wp-content/plugins/file-select-control-for-elementor/controls/fileselect-control.php b/wp-content/plugins/file-select-control-for-elementor/controls/fileselect-control.php
new file mode 100644 (file)
index 0000000..f4f4a82
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/**
+ * FileSelect control.
+ *
+ * A control for selecting any type of files.
+ *
+ * @since 1.0.0
+ */
+class FileSelect_Control extends \Elementor\Base_Data_Control {
+
+       /**
+        * Get control type.
+        *
+        * Retrieve the control type, in this case `FILESELECT`.
+        *
+        * @since 1.0.0
+        * @access public
+        *
+        * @return string Control type.
+        */
+       public function get_type() {
+               return 'file-select';
+       }
+
+       /**
+        * Enqueue control scripts and styles.
+        *
+        * Used to register and enqueue custom scripts and styles
+        * for this control.
+        *
+        * @since 1.0.0
+        * @access public
+        */
+       public function enqueue() {
+               wp_enqueue_media();
+               wp_enqueue_style('thickbox');
+           wp_enqueue_script('media-upload');
+           wp_enqueue_script('thickbox');
+               // Scripts
+               wp_register_script( 'fileselect-control', plugins_url( '/js/fileselect-control.js', __FILE__ ), [ 'jquery' ], '1.0.0', true );
+               wp_enqueue_script( 'fileselect-control' );
+       }
+
+       /**
+        * Get default settings.
+        *
+        * @since 1.0.0
+        * @access protected
+        *
+        * @return array Control default settings.
+        */
+       protected function get_default_settings() {
+               return [
+                       'label_block' => true,
+               ];
+       }
+
+       /**
+        * Render control output in the editor.
+        *
+        * @since 1.0.0
+        * @access public
+        */
+       public function content_template() {
+               $control_uid = $this->get_control_uid();
+               ?>
+               <div class="elementor-control-field">
+                       <label for="<?php echo esc_attr( $control_uid ); ?>" class="elementor-control-title">{{{ data.label }}}</label>
+                       <div class="elementor-control-input-wrapper">
+                               <a href="#" class="tnc-select-file elementor-button elementor-button-success" style="padding: 10px 15px; display: block;text-align: center;" id="select-file-<?php echo esc_attr( $control_uid ); ?>" ><?php echo esc_html__( "Choose / Upload File", 'file-select-control-for-elementor' ); ?></a> <br />
+
+                               <input type="text" class="tnc-selected-fle-url" id="<?php echo esc_attr( $control_uid ); ?>" data-setting="{{ data.name }}" placeholder="{{ data.placeholder }}">
+                       </div>
+               </div>
+               <# if ( data.description ) { #>
+               <div class="elementor-control-field-description">{{{ data.description }}}</div>
+               <# } #>
+               <?php
+       }
+}
\ No newline at end of file
diff --git a/wp-content/plugins/file-select-control-for-elementor/controls/js/fileselect-control.js b/wp-content/plugins/file-select-control-for-elementor/controls/js/fileselect-control.js
new file mode 100644 (file)
index 0000000..531078e
--- /dev/null
@@ -0,0 +1,25 @@
+var fileselectItemView = elementor.modules.controls.BaseData.extend({
+       
+    onReady: function () {
+
+       var file_input_id = this.$el.find( '.tnc-selected-fle-url' ).attr('id');
+
+       this.$el.find( '.tnc-select-file' ).click( function() {
+                       var tnc_file_uploader = wp.media({
+                   title: 'Upload File',
+                   button: {
+                       text: 'Get Link'
+                   },
+                   multiple: false
+               })
+               .on('select', function() {
+                   var attachment = tnc_file_uploader.state().get('selection').first().toJSON();
+                   jQuery( "#" + file_input_id ).val( attachment.url );
+                   jQuery( "#" + file_input_id ).trigger( "input" );
+               })
+               .open();
+               } );
+       },
+});
+
+elementor.addControlView('file-select', fileselectItemView);
\ No newline at end of file
diff --git a/wp-content/plugins/file-select-control-for-elementor/file-select-control-elementor.php b/wp-content/plugins/file-select-control-for-elementor/file-select-control-elementor.php
new file mode 100644 (file)
index 0000000..6f9d781
--- /dev/null
@@ -0,0 +1,267 @@
+<?php
+/**
+ * Plugin Name: File Select Control for Elementor
+ * Description: This addon adds a new control file-select to use in your widgets. Specially for developers.
+ * Plugin URI:  https://abdulawal.com/elementor-file-select-control/
+ * Version:     1.2
+ * Author:      ThemeNcode
+ * Author URI:  https://themencode.com/
+ * Text Domain: file-select-control-for-elementor
+ * License: GPLv2 (or later)
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+       exit; // Exit if accessed directly.
+}
+
+/**
+ * Main File Select Control for Elementor Class
+ *
+ * The main class that initiates and runs the plugin.
+ *
+ * @since 1.0.0
+ */
+final class Elementor_File_Select_Control_Addon {
+
+       /**
+        * Plugin Version
+        *
+        * @since 1.0.0
+        *
+        * @var string The plugin version.
+        */
+       const VERSION = '1.2';
+
+       /**
+        * Minimum Elementor Version
+        *
+        * @since 1.0.0
+        *
+        * @var string Minimum Elementor version required to run the plugin.
+        */
+       const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
+
+       /**
+        * Minimum PHP Version
+        *
+        * @since 1.0.0
+        *
+        * @var string Minimum PHP version required to run the plugin.
+        */
+       const MINIMUM_PHP_VERSION = '7.0';
+
+       /**
+        * Instance
+        *
+        * @since 1.0.0
+        *
+        * @access private
+        * @static
+        *
+        * @var Elementor_File_Select_Control_Addon The single instance of the class.
+        */
+       private static $_instance = null;
+
+       /**
+        * Instance
+        *
+        * Ensures only one instance of the class is loaded or can be loaded.
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        * @static
+        *
+        * @return Elementor_File_Select_Control_Addon An instance of the class.
+        */
+       public static function instance() {
+
+               if ( is_null( self::$_instance ) ) {
+                       self::$_instance = new self();
+               }
+               return self::$_instance;
+
+       }
+
+       /**
+        * Constructor
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function __construct() {
+
+               add_action( 'init', [ $this, 'i18n' ] );
+               add_action( 'plugins_loaded', [ $this, 'init' ] );
+
+       }
+
+       /**
+        * Load Textdomain
+        *
+        * Load plugin localization files.
+        *
+        * Fired by `init` action hook.
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function i18n() {
+
+               load_plugin_textdomain( 'file-select-control-for-elementor' );
+
+       }
+
+       /**
+        * Initialize the plugin
+        *
+        * Load the plugin only after Elementor (and other plugins) are loaded.
+        * Checks for basic plugin requirements, if one check fail don't continue,
+        * if all check have passed load the files required to run the plugin.
+        *
+        * Fired by `plugins_loaded` action hook.
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function init() {
+
+               // Check if Elementor installed and activated
+               if ( ! did_action( 'elementor/loaded' ) ) {
+                       add_action( 'admin_notices', [ $this, 'admin_notice_missing_main_plugin' ] );
+                       return;
+               }
+
+               // Check for required Elementor version
+               if ( ! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=' ) ) {
+                       add_action( 'admin_notices', [ $this, 'admin_notice_minimum_elementor_version' ] );
+                       return;
+               }
+
+               // Check for required PHP version
+               if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) {
+                       add_action( 'admin_notices', [ $this, 'admin_notice_minimum_php_version' ] );
+                       return;
+               }
+
+               // Add Plugin actions
+               add_action( 'elementor/controls/controls_registered', [ $this, 'init_controls' ] );
+               add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
+       }
+
+       /**
+        * Admin notice
+        *
+        * Warning when the site doesn't have Elementor installed or activated.
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function admin_notice_missing_main_plugin() {
+
+               if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
+
+               $message = sprintf(
+                       /* translators: 1: Plugin name 2: Elementor */
+                       esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'file-select-control-for-elementor' ),
+                       '<strong>' . esc_html__( 'File Select Control for Elementor', 'file-select-control-for-elementor' ) . '</strong>',
+                       '<strong>' . esc_html__( 'Elementor', 'file-select-control-for-elementor' ) . '</strong>'
+               );
+
+               printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
+
+       }
+
+       /**
+        * Admin notice
+        *
+        * Warning when the site doesn't have a minimum required Elementor version.
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function admin_notice_minimum_elementor_version() {
+
+               if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
+
+               $message = sprintf(
+                       /* translators: 1: Plugin name 2: Elementor 3: Required Elementor version */
+                       esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'file-select-control-for-elementor' ),
+                       '<strong>' . esc_html__( 'File Select Control for Elementor', 'file-select-control-for-elementor' ) . '</strong>',
+                       '<strong>' . esc_html__( 'Elementor', 'file-select-control-for-elementor' ) . '</strong>',
+                        self::MINIMUM_ELEMENTOR_VERSION
+               );
+
+               printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
+
+       }
+
+       /**
+        * Admin notice
+        *
+        * Warning when the site doesn't have a minimum required PHP version.
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function admin_notice_minimum_php_version() {
+
+               if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
+
+               $message = sprintf(
+                       /* translators: 1: Plugin name 2: PHP 3: Required PHP version */
+                       esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'file-select-control-for-elementor' ),
+                       '<strong>' . esc_html__( 'File Select Control for Elementor', 'file-select-control-for-elementor' ) . '</strong>',
+                       '<strong>' . esc_html__( 'PHP', 'file-select-control-for-elementor' ) . '</strong>',
+                        self::MINIMUM_PHP_VERSION
+               );
+
+               printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
+
+       }
+
+       /**
+        * Init Widgets
+        *
+        * Include widgets files and register them
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function init_widgets() {
+
+               // Include Widget files
+               require_once( __DIR__ . '/widgets/file-link-widget.php' );
+
+               // Register widget
+                \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor_File_Link_Widget() );
+       }
+
+       /**
+        * Init Controls
+        *
+        * Include control files and register them
+        *
+        * @since 1.0.0
+        *
+        * @access public
+        */
+       public function init_controls() {
+
+               // Include Widget files
+               require_once( __DIR__ . '/controls/fileselect-control.php' );
+
+               // Register controls
+               \Elementor\Plugin::$instance->controls_manager->register_control( 'file-select', new \FileSelect_Control() );
+       }
+
+}
+
+Elementor_File_Select_Control_Addon::instance();
\ No newline at end of file
diff --git a/wp-content/plugins/file-select-control-for-elementor/languages/file-select-control-for-elementor.pot b/wp-content/plugins/file-select-control-for-elementor/languages/file-select-control-for-elementor.pot
new file mode 100644 (file)
index 0000000..5c54065
--- /dev/null
@@ -0,0 +1,120 @@
+# Copyright (C) 2020 ThemeNcode
+# This file is distributed under the same license as the File Select Control for Elementor plugin.
+msgid ""
+msgstr ""
+"Project-Id-Version: File Select Control for Elementor 1.0\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/trunk\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"POT-Creation-Date: 2020-07-10T05:16:40+00:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"X-Generator: WP-CLI 2.4.0\n"
+"X-Domain: file-select-control-for-elementor\n"
+
+#. Plugin Name of the plugin
+#: file-select-control-for-elementor.php:171
+#: file-select-control-for-elementor.php:195
+#: file-select-control-for-elementor.php:220
+msgid "File Select Control for Elementor"
+msgstr ""
+
+#. Plugin URI of the plugin
+msgid "https://abdulawal.com/elementor-file-select-control/"
+msgstr ""
+
+#. Description of the plugin
+msgid "This addon adds a new control file-select to use in your widgets. Specially for developers."
+msgstr ""
+
+#. Author of the plugin
+msgid "ThemeNcode"
+msgstr ""
+
+#. Author URI of the plugin
+msgid "https://themencode.com/"
+msgstr ""
+
+#: controls/fileselect-control.php:70
+msgid "Choose / Upload File"
+msgstr ""
+
+#. translators: 1: Plugin name 2: Elementor
+#: file-select-control-for-elementor.php:170
+msgid "\"%1$s\" requires \"%2$s\" to be installed and activated."
+msgstr ""
+
+#: file-select-control-for-elementor.php:172
+#: file-select-control-for-elementor.php:196
+msgid "Elementor"
+msgstr ""
+
+#. translators: 1: Plugin name 2: Elementor 3: Required Elementor version
+#. translators: 1: Plugin name 2: PHP 3: Required PHP version
+#: file-select-control-for-elementor.php:194
+#: file-select-control-for-elementor.php:219
+msgid "\"%1$s\" requires \"%2$s\" version %3$s or greater."
+msgstr ""
+
+#: file-select-control-for-elementor.php:221
+msgid "PHP"
+msgstr ""
+
+#: widgets/file-link-widget.php:36
+msgid "File Link"
+msgstr ""
+
+#: widgets/file-link-widget.php:80
+msgid "Settings"
+msgstr ""
+
+#: widgets/file-link-widget.php:88
+msgid "Select File"
+msgstr ""
+
+#: widgets/file-link-widget.php:90
+msgid "URL to File"
+msgstr ""
+
+#: widgets/file-link-widget.php:91
+msgid "Select file from media library or upload"
+msgstr ""
+
+#: widgets/file-link-widget.php:98
+msgid "Link Text"
+msgstr ""
+
+#: widgets/file-link-widget.php:100
+msgid "Ex. Open File"
+msgstr ""
+
+#: widgets/file-link-widget.php:101
+msgid "Text that should be displayed as a link"
+msgstr ""
+
+#: widgets/file-link-widget.php:109
+msgid "Link Target"
+msgstr ""
+
+#: widgets/file-link-widget.php:112
+msgid "Same Tab"
+msgstr ""
+
+#: widgets/file-link-widget.php:113
+msgid "New Tab"
+msgstr ""
+
+#: widgets/file-link-widget.php:116
+#: widgets/file-link-widget.php:127
+msgid "CSS class to add to the link"
+msgstr ""
+
+#: widgets/file-link-widget.php:123
+msgid "Link CSS Class"
+msgstr ""
+
+#: widgets/file-link-widget.php:126
+msgid "Ex. file-link"
+msgstr ""
diff --git a/wp-content/plugins/file-select-control-for-elementor/readme.txt b/wp-content/plugins/file-select-control-for-elementor/readme.txt
new file mode 100644 (file)
index 0000000..862e18b
--- /dev/null
@@ -0,0 +1,78 @@
+=== File Select Control For Elementor ===
+Contributors: abdulawal39, ThemeNcode
+Donate link: http://go.abdulawal.com/donate
+Tags: elementor, media, file select, elementor control, elementor file link, elementor media extended
+Requires at least: 4.0
+Tested up to: 5.4.2
+Stable tag: 1.2
+Requires PHP: 7.0
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+A custom control to Allow choosing any type of files from WordPress Media Library. An extended version of MEDIA control.
+
+== Description ==
+
+This addon comes with a small widget that allows you to create a link to any media file of your media library as well as a new elementor control for to select any type of file from your media library.
+
+The main part of this plugin is the new file select control, you can use this in combination of this plugin for just integrate with your project by taking code from this plugin.
+
+This addon comes with a new elementor control called file-select which you can use in your widgets. Simply put file-select in the type parameter of add_control() while creating the widget.
+
+Please find more details on how to use and integrate this control here: <a href="https://abdulawal.com/elementor-file-select-control/">https://abdulawal.com/elementor-file-select-control/</a>
+
+<h3>Features :</h3>
+
+* Work with any type of file
+* Easy to use
+* Very Lightweight Plugin
+
+Please Don't Forget to leave a review if you find this plugin useful. <br />
+Thanks<br />
+
+== Installation ==
+
+Installing this plugin is pretty simple like all other wordpress plugins. Here are 2 ways to install :
+
+1. Manual Install
+
+* Download the zipped plugin from wordpress repository
+* Extract the zipped folder 
+* Upload `file-select-control-for-elementor.zip` to the `/wp-content/plugins/` directory
+* Activate the plugin through the 'Plugins' menu in WordPress
+* Go to any page or post editor and you'll see the new widget called File Link or.
+
+2. Automatic Install
+
+* Go to Plugins-> Add New from your wordpress Dashboard
+* Search File Select Control for Elementor 
+* From the results click on 'install now'
+* Activate the plugin through the 'Plugins' menu in WordPress
+* Go to any page or post editor and you'll see the new widget called File Link or.
+
+
+== Frequently Asked Questions ==
+
+** How Do I use the control ? **
+
+Please find more details of integration here: https://abdulawal.com/elementor-file-select-control/
+
+== Screenshots ==
+
+1. Editor View
+1. Adding control to widget
+
+== Changelog ==
+= 1.2 =
+* Updated Name of language pot file
+* Updated Text Domain
+
+= 1.1 =
+* Added Language file
+
+= 1.0 =
+* First Release.
+
+== Upgrade Notice ==
+
+none
\ No newline at end of file
diff --git a/wp-content/plugins/file-select-control-for-elementor/widgets/file-link-widget.php b/wp-content/plugins/file-select-control-for-elementor/widgets/file-link-widget.php
new file mode 100644 (file)
index 0000000..c737c5e
--- /dev/null
@@ -0,0 +1,149 @@
+<?php
+/**
+ * Elementor Elementor_File_Link_Widget Widget.
+ *
+ * Elementor widget that inserts an embbedable content into the page, from any given URL.
+ *
+ * @since 1.0.0
+ */
+class Elementor_File_Link_Widget extends \Elementor\Widget_Base {
+
+       /**
+        * Get widget name.
+        *
+        * Retrieve Elementor_File_Link_Widget widget name.
+        *
+        * @since 1.0.0
+        * @access public
+        *
+        * @return string Widget name.
+        */
+       public function get_name() {
+               return 'file_link_shortcode';
+       }
+
+       /**
+        * Get widget title.
+        *
+        * Retrieve Elementor_File_Link_Widget widget title.
+        *
+        * @since 1.0.0
+        * @access public
+        *
+        * @return string Widget title.
+        */
+       public function get_title() {
+               return esc_html__( 'File Link', 'file-select-control-for-elementor' );
+       }
+
+       /**
+        * Get widget icon.
+        *
+        * Retrieve Elementor_File_Link_Widget widget icon.
+        *
+        * @since 1.0.0
+        * @access public
+        *
+        * @return string Widget icon.
+        */
+       public function get_icon() {
+               return 'fa fa-link';
+       }
+
+       /**
+        * Get widget categories.
+        *
+        * Retrieve the list of categories the Elementor_File_Link_Widget widget belongs to.
+        *
+        * @since 1.0.0
+        * @access public
+        *
+        * @return array Widget categories.
+        */
+       public function get_categories() {
+               return [ 'media' ];
+       }
+
+       /**
+        * Register Elementor_File_Link_Widget widget controls.
+        *
+        * Adds different input fields to allow the user to change and customize the widget settings.
+        *
+        * @since 1.0.0
+        * @access protected
+        */
+       protected function _register_controls() {
+
+               $this->start_controls_section(
+                       'settings_section',
+                       [
+                               'label' => esc_html__( 'Settings', 'file-select-control-for-elementor' ),
+                               'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
+                       ]
+               );
+
+               $this->add_control(
+                       'file_link',
+                       [
+                               'label' => esc_html__( 'Select File', 'file-select-control-for-elementor' ),
+                               'type'  => 'file-select',
+                               'placeholder' => esc_html__( 'URL to File', 'file-select-control-for-elementor' ),
+                               'description' => esc_html__( 'Select file from media library or upload', 'file-select-control-for-elementor' ),
+                       ]
+               );
+
+               $this->add_control(
+                       'link_text',
+                       [
+                               'label' => esc_html__( 'Link Text', 'file-select-control-for-elementor' ),
+                               'type' => \Elementor\Controls_Manager::TEXT,
+                               'placeholder' => esc_html__( 'Ex. Open File', 'file-select-control-for-elementor' ),
+                               'description' => esc_html__( 'Text that should be displayed as a link', 'file-select-control-for-elementor' ),
+                               'default'       => 'Open File',
+                       ]
+               );
+
+               $this->add_control(
+                       'link_target',
+                       [
+                               'label' => esc_html__( 'Link Target', 'file-select-control-for-elementor' ),
+                               'type' => \Elementor\Controls_Manager::SELECT,
+                               'options' => [
+                                       '_parent' => esc_html__( 'Same Tab', 'file-select-control-for-elementor' ),
+                                       '_blank' => esc_html__( 'New Tab', 'file-select-control-for-elementor' ),
+                               ],
+                               'default' => '_parent',
+                               'description' => esc_html__( 'CSS class to add to the link', 'file-select-control-for-elementor' ),
+                       ]
+               );
+
+               $this->add_control(
+                       'link_css_class',
+                       [
+                               'label' => esc_html__( 'Link CSS Class', 'file-select-control-for-elementor' ),
+                               'type' => \Elementor\Controls_Manager::TEXT,
+                               'input_type' => 'text',
+                               'placeholder' => esc_html__( 'Ex. file-link', 'file-select-control-for-elementor' ),
+                               'description' => esc_html__( 'CSS class to add to the link', 'file-select-control-for-elementor' ),
+                       ]
+               );
+
+               $this->end_controls_section();
+
+       }
+       
+       /**
+        * Render Elementor_File_Link_Widget widget output on the frontend.
+        *
+        * Written in PHP and used to generate the final HTML.
+        *
+        * @since 1.0.0
+        * @access protected
+        */
+       protected function render() {
+
+               $settings = $this->get_settings_for_display();
+
+               echo '<a href="' . $settings['file_link'] . '" target="' . $settings['link_target'] . '" class="' . $settings['link_css_class'] . '" >' . $settings['link_text'] . '</a>';
+       }
+} 
\ No newline at end of file
index bc758e135b5acc0e36e3c1da899862fb33eb7a0e..cbfa9c76960a3556d3c56c8369885c8f57420909 100644 (file)
@@ -96,6 +96,7 @@
     "rimraf": "~2.6",
     "rupture": "^0.7.1",
     "sass-loader": "~6.0",
+    "slick-carousel": "^1.8.1",
     "style-loader": "^0.20.1",
     "stylelint": "^8.4.0",
     "stylelint-config-standard": "~18.0.0",
index 1d89771562b3f35546feee4c7c07e37743a93c28..2f2c60b3878fbf35991c6cd0559131b858a30659 100644 (file)
@@ -31,6 +31,9 @@
     "lity": [
       "./scripts/lity.js"
     ],
+    "slick": [
+      "./scripts/slick.js"
+    ],
     "cookie-notice": [
       "./scripts/cookie-notice.js"
     ],
diff --git a/wp-content/themes/physioassist/resources/assets/scripts/slick.js b/wp-content/themes/physioassist/resources/assets/scripts/slick.js
new file mode 100644 (file)
index 0000000..fa3bf10
--- /dev/null
@@ -0,0 +1,2 @@
+// Create a local copy of Slick Carousel. Maybe this could be copied directly to /dist/scripts on build instead?
+import slick from 'slick-carousel'; // eslint-disable-line
index 308566e74b38f7783c8c4adfc16a664653d9e102..b6c1aa456562263703b85c0ed874c3c376d185fe 100644 (file)
@@ -8409,6 +8409,11 @@ slice-ansi@1.0.0:
   dependencies:
     is-fullwidth-code-point "^2.0.0"
 
+slick-carousel@^1.8.1:
+  version "1.8.1"
+  resolved "https://registry.yarnpkg.com/slick-carousel/-/slick-carousel-1.8.1.tgz#a4bfb29014887bb66ce528b90bd0cda262cc8f8d"
+  integrity sha512-XB9Ftrf2EEKfzoQXt3Nitrt/IPbT+f1fgqBdoxO3W/+JYvtEOW6EgxnWfr9GH6nmULv7Y2tPmEX3koxThVmebA==
+
 snapdragon-node@^2.0.1:
   version "2.1.1"
   resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"