Plugin Directory

Changeset 2578578


Ignore:
Timestamp:
08/05/2021 09:02:07 AM (5 years ago)
Author:
karlogitlea
Message:

Prepared for release of 1.9.0

Location:
miqid-elementor/trunk
Files:
24 added
12 edited

Legend:

Unmodified
Added
Removed
  • miqid-elementor/trunk/core/widget_miqid.php

    r2513387 r2578578  
    44
    55use Elementor\Widget_Base;
    6 use MIQID\Plugin\Core\Classes\DTO\{
    7     Business\DriversLicense as business_DriversLicense,
    8     Business\HealthInsuranceCard as business_HealthInsuranceCard,
    9     Business\MyBody as business_MyBody,
    10     Business\Passport as business_Passport,
    11     Business\Profile as business_Profile,
    12     Business\UserAddress as business_UserAddress,
    13     DriversLicense
    14 };
     6use MIQID\Plugin\Core\Classes\DTO\{Business\DriversLicense as business_DriversLicense, Business\HealthInsuranceCard as business_HealthInsuranceCard, Business\MyBody as business_MyBody, Business\Passport as business_Passport, Business\Profile as business_Profile, Business\UserAddress as business_UserAddress, DriversLicense, FileContentResult};
     7use MyCLabs\Enum\Enum;
    158use MIQID\Elementor\Handler\{Passport, Address, MyBody, Profile};
    169use ReflectionClass;
     10use ReflectionException;
     11use ReflectionProperty;
    1712
    1813abstract class Widget_MIQID extends Widget_Base {
     
    7368
    7469        return $options;
    75     }
    76 
    77     function get_miqid_data( $miqid ) {
    78         $miqid = explode( '.', $miqid ?? '' );
    79         $class = array_shift( $miqid );
    80         $field = array_shift( $miqid );
    81 
    82         if ( ! class_exists( $class ) ) {
    83             return null;
    84         }
    85 
    86         $class = $class::Instance();
    87         if ( ! method_exists( $class, 'Get' ) ) {
    88             return null;
    89         }
    90 
    91         $object = $class->Get();
    92         if ( ! $object || ! property_exists( $object, $field ) ) {
    93             return null;
    94         }
    95 
    96         return $object->{$field};
    9770    }
    9871
     
    160133    }
    161134
     135    /**
     136     * @return ReflectionClass[]
     137     * @throws ReflectionException
     138     */
    162139    function get_classes() {
    163         return [
    164             \MIQID\Plugin\Core\Classes\DTO\Profile::class,
    165             \MIQID\Plugin\Core\Classes\DTO\Address::class,
    166             \MIQID\Plugin\Core\Classes\DTO\MyBody::class,
    167             \MIQID\Plugin\Core\Classes\DTO\Passport::class,
    168             DriversLicense::class,
    169 
     140        return array_map( function ( $class ) {
     141            return new ReflectionClass( $class );
     142        }, array_filter( [
    170143            business_Profile::class,
    171144            business_UserAddress::class,
     
    173146            business_Passport::class,
    174147            business_DriversLicense::class,
    175             business_HealthInsuranceCard::class
    176 
    177             //'Custom',
    178         ];
    179     }
    180 
     148            business_HealthInsuranceCard::class,
     149            FileContentResult::class,
     150        ] ) );
     151    }
     152
     153    /**
     154     * @param $class
     155     *
     156     * @return ReflectionProperty[]
     157     */
    181158    function get_properties( $class ) {
    182159        $properties      = [];
     
    184161        do {
    185162            foreach ( $reflectionClass->getProperties() as $property ) {
    186                 $properties[] = $property->getName();
     163                $properties[] = $property;
    187164            }
    188165        } while ( $reflectionClass = $reflectionClass->getParentClass() );
     
    191168    }
    192169
     170    /**
     171     * @param $class
     172     * @param $func
     173     *
     174     * @return ReflectionClass|null
     175     * @throws ReflectionException
     176     */
     177    function get_enum_class( $class, $func ) {
     178        if ( is_object( $class ) ) {
     179            $class = get_class( $class );
     180        }
     181        if ( class_exists( $class )
     182             && ( $class = new $class() )
     183             && method_exists( $class, $func )
     184             && ( $enum = $class->$func() )
     185             && $enum instanceof Enum ) {
     186            return new ReflectionClass( get_class( $enum ) );
     187        }
     188
     189        return null;
     190    }
     191
     192    /**
     193     * @param ReflectionClass $enum_class
     194     *
     195     * @return array
     196     */
     197    function get_enum_values( $enum_class ) {
     198        $obj = [];
     199        if ( method_exists( $enum_class->getName(), 'values' ) ) {
     200            /** @var Enum $value */
     201            foreach ( $enum_class->getName()::values() as $value ) {
     202                $obj[ $value->getValue() ] = _x( $value->getKey(), $enum_class->getShortName(), 'miqid-core' );
     203            }
     204        }
     205
     206        return $obj;
     207    }
     208
     209    function get_enum_values_based_on_text( $enum_class ) {
     210        $obj = [];
     211        if ( method_exists( $enum_class->getName(), 'values' ) ) {
     212            /** @var Enum $value */
     213            foreach ( $enum_class->getName()::values() as $value ) {
     214                $obj[ $value->getValue() ] = _x( $value->getKey(), $enum_class->getShortName(), 'miqid-core' );
     215            }
     216        }
     217
     218        return $obj;
     219    }
     220
    193221    function get_classes_options() {
    194         $Options = [
    195             '' => __( 'Choose' ),
    196         ];
     222        $Options = [];
    197223        foreach ( $this->get_classes() as $class ) {
    198             $text              = strtr( $class, [
    199                 "MIQID\\Plugin\\Core\\Classes\\DTO\\" => '',
    200                 '\\'                                  => '-',
    201             ] );
    202             $Options[ $class ] = __( $text, 'miqid-elementor' );
     224            $Options[ $class->getName() ] = __( $class->getShortName(), 'miqid-elementor' );
    203225        }
    204226
     
    208230
    209231    function get_properties_options( $class ) {
    210         $Options = [
    211             '' => __( 'Choose' ),
    212         ];
    213         if ( class_exists( $class ) ) {
    214             foreach ( $this->get_properties( $class ) as $property ) {
    215                 $key = sprintf( '%1$s.%2$s',
    216                     strtr( $class, [
    217                         "MIQID\\Plugin\\Core\\Classes\\DTO\\" => '',
    218                     ] ),
    219                     $property );
    220 
    221                 $Options[ $key ] = __( $property, 'miqid-core' );
    222             }
    223             switch ( $class ) {
    224                 case \MIQID\Plugin\Core\Classes\DTO\Profile::class:
    225                     $Options['profilepassportfaceimage'] = __( 'Passport Face image', 'miqid-elementor' );
    226                     break;
    227                 case \MIQID\Plugin\Core\Classes\DTO\Business\Profile::class:
    228                     $Options['business-passportfaceimage'] = __( 'Passport Face image', 'miqid-elementor' );
    229                     $Options['business-passportimage']     = __( 'Passport image', 'miqid-elementor' );
    230                     break;
    231                 case business_DriversLicense::class:
    232                     $Options['business-driverslicensefaceimage'] = __( 'DriversLicense Face Image', 'miqid-elementor' );
    233                     $Options['business-driverslicenseimage']     = __( 'DriversLicense Image', 'miqid-elementor' );
    234                     break;
    235                 case business_HealthInsuranceCard::class:
    236                     $Options['business-healthinsurancecardimage'] = __( 'HealthInsuranceCard Image', 'miqid-elementor' );
    237                     break;
    238             }
    239         } else if ( $class === 'Custom' ) {
    240 
     232        $Options = [ '' => __( 'Choose' ), ];
     233        if ( is_string( $class ) ) {
     234            if ( class_exists( $class ) ) {
     235                foreach ( $this->get_properties( $class ) as $reflection_property ) {
     236                    $Options[ $reflection_property->getName() ] = __( $reflection_property->getName(), 'miqid-core' );
     237                }
     238                switch ( $class ) {
     239                    case business_Passport::class:
     240                        $Options['passportfaceimage'] = __( 'Passport Face image', 'miqid-elementor' );
     241                        $Options['passportimage']     = __( 'Passport image', 'miqid-elementor' );
     242                        break;
     243                    case business_DriversLicense::class:
     244                        $Options['driverslicensefaceimage'] = __( 'DriversLicense Face Image', 'miqid-elementor' );
     245                        $Options['driverslicenseimage']     = __( 'DriversLicense Image', 'miqid-elementor' );
     246                        break;
     247                    case business_HealthInsuranceCard::class:
     248                        $Options['healthinsurancecardimage'] = __( 'HealthInsuranceCard Image', 'miqid-elementor' );
     249                        break;
     250                }
     251            } else if ( $class === 'Custom' ) {
     252
     253            }
    241254        }
    242255
     
    245258
    246259    function get_miqid_category_field( ?string $miqid_category, ?array $settings ): string {
    247         $miqid_category_field = $settings[ strtr( $miqid_category, [ '\\' => '-' ] ) ];
     260        $miqid_category_field = $settings[ strtr( $miqid_category, [ '\\' => '-' ] ) ] ?? '';
    248261        if ( empty( $miqid_category_field ) ) {
    249262            $miqid_category_field = $settings['miqid'] ?? '';
  • miqid-elementor/trunk/miqid-elementor.php

    r2513387 r2578578  
    44 * Plugin Name:       MIQID-Elementor
    55 * Description:       MIQID-Elementor extend Elementor with MIQID data.
    6  * Version:           1.7.4
     6 * Version:           1.9.0
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.2
     
    1111 * License:           GPL v3 or later
    1212 * License URI:       http://www.gnu.org/licenses/gpl-3.0.txt
     13 * Text Domain:       miqid-elementor
     14 * Elementor tested up to: 3.3.1
     15 * Elementor Pro tested up to: 3.3.5
    1316 */
    1417
     
    1821
    1922use Elementor\Plugin;
    20 use MIQID\Elementor\Widget\{Data_Window, Display_Text, Dynamic_Images, Dynamic_Text, FormSave, IconList, Input, Text_Hide_If};
    21 use MIQID\Elementor\Handler\{FormSave as hFormSave};
    22 use MIQID\Plugin\Elementor\Widget\{Login};
     23use MIQID\Elementor\Widget\{Display_Text, Dynamic_Images, Dynamic_Text, IconList, Input, Text_Hide_If};
     24use MIQID\Plugin\Elementor\Widget\{Conditional_Image, Demo, Display_Widget, Dynamic_Images as Dynamic_Images_V2, Dynamic_Text as Dynamic_Text_V2, IconList as IconList_V2, Login, Text_Visibility};
     25use MIQID\Plugin\Elementor\Ajax\Ajax;
     26use MIQID\Plugin\Elementor\Control\Group\Filter;
    2327
    2428if ( ! defined( 'WPINC' ) ) {
     
    2731
    2832class Elementor {
    29     const VERSION                   = "1.6.3";
    30     const MINIMUM_ELEMENTOR_VERSION = "2.0.0";
     33    const VERSION                   = "1.8.0";
     34    const MINIMUM_ELEMENTOR_VERSION = "3.0.0";
    3135    const MINIMUM_PHP_VERSION       = "7.2";
    3236
     
    5458        } );
    5559
     60        add_action( 'plugins_loaded', [ $this, '_language' ] );
     61
    5662        add_action( 'plugins_loaded', [ $this, 'init' ] );
     63    }
     64
     65
     66    function _language() {
     67        load_plugin_textdomain( 'miqid-elementor', false, basename( dirname( __FILE__ ) ) . '/languages/' );
    5768    }
    5869
     
    7182            $this->_deactivate_plugin( [ $this, '_notice_elementor_version' ] );
    7283        } else {
    73             $this->_table_visitor_counter();
     84            add_action( 'elementor/controls/controls_registered', [ $this, 'register_controls' ] );
    7485
    7586            add_action( 'elementor/elements/categories_registered', [ $this, 'miqid_elementor_categories' ] );
     
    7788            add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] );
    7889
    79             hFormSave::Instance();
     90            add_action( 'elementor/editor/before_enqueue_scripts', function () {
     91                wp_enqueue_style(
     92                    'miqid-elementor',
     93                    sprintf( '%s/assets/css/miqid-elementor.css', plugin_dir_url( __FILE__ ) ),
     94                    [],
     95                    date( 'Ymd-His', filemtime( sprintf( '%s/assets/css/miqid-elementor.css', plugin_dir_path( __FILE__ ) ) ) ) );
     96            } );
     97
     98            Ajax::Instance();
    8099        }
    81100    }
    82101
    83102    function miqid_elementor_categories( $elements_manager ) {
    84 
    85103        $elements_manager->add_category( 'miqid', [
    86104            'title' => "MIQID",
     
    89107    }
    90108
     109    function register_controls() {
     110        Plugin::instance()->controls_manager->add_group_control( Filter::get_type(), new Filter() );
     111    }
     112
    91113    public function register_widgets() {
    92 
    93         Plugin::instance()->widgets_manager->register_widget_type( new Data_Window() );
     114        //ToDo: Nanna skriver, mangler polering
     115        //Plugin::instance()->widgets_manager->register_widget_type( new Data_Window() );
    94116        Plugin::instance()->widgets_manager->register_widget_type( new Display_Text() );
    95117        Plugin::instance()->widgets_manager->register_widget_type( new Dynamic_Images() );
    96118        Plugin::instance()->widgets_manager->register_widget_type( new Dynamic_Text() );
    97         Plugin::instance()->widgets_manager->register_widget_type( new FormSave() );
    98119        Plugin::instance()->widgets_manager->register_widget_type( new IconList() );
    99120        Plugin::instance()->widgets_manager->register_widget_type( new Input() );
    100121        Plugin::instance()->widgets_manager->register_widget_type( new Text_Hide_If() );
     122
     123        /* Restructured Widget */
     124        Plugin::instance()->widgets_manager->register_widget_type( new Conditional_Image() );
     125        Plugin::instance()->widgets_manager->register_widget_type( new Display_Widget() );
     126        Plugin::instance()->widgets_manager->register_widget_type( new Dynamic_Images_V2() );
     127        Plugin::instance()->widgets_manager->register_widget_type( new Dynamic_Text_V2() );
     128        Plugin::instance()->widgets_manager->register_widget_type( new IconList_V2() );
    101129        Plugin::instance()->widgets_manager->register_widget_type( new Login() );
    102 
    103     }
    104 
    105     function _table_visitor_counter() {
    106         global $wpdb;
    107         $dbVersion = get_option( '_miqid_table_visitor_counter', "1.0.0" );
    108 
    109         if ( version_compare( $dbVersion, self::VERSION, '<' ) ) {
    110 
    111             $query = "CREATE TABLE {$wpdb->prefix}visitor_counter (
    112     ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    113     Store VARCHAR(50) NOT NULL,
    114     Department VARCHAR(50) NOT NULL,
    115     VisitorDate DATE NOT NULL,
    116     User VARCHAR(50) NOT NULL DEFAULT '',
    117     State ENUM ('CheckIn', 'CheckOut') NOT NULL DEFAULT 'CheckOut',
    118     CreatedDatetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    119     ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    120     UNIQUE KEY store_visitor (Store,Department,VisitorDate,User)
    121 ) {$wpdb->get_charset_collate()}";
    122 
    123             require_once ABSPATH . '/wp-admin/includes/upgrade.php';
    124             dbDelta( $query );
    125 
    126             update_option( '_miqid_table_visitor_counter', self::VERSION );
    127         }
     130        Plugin::instance()->widgets_manager->register_widget_type( new Text_Visibility() );
    128131    }
    129132
  • miqid-elementor/trunk/readme.md

    r2513387 r2578578  
    22Contributors: karlogit,miqid 
    33Tags: MIQID,MIQID-Core,Elementor 
    4 Tested up to: 5.7 
     4Tested up to: 5.8 
    55Requires PHP: 7.2 
    6 Stable tag: 1.7.4 
     6Stable tag: 1.9.0 
    77License: GPL v3 or later 
    88
  • miqid-elementor/trunk/src/Util.php

    r2513208 r2578578  
    33namespace MIQID\Plugin\Elementor;
    44
     5use MIQID\Plugin\Core\Classes\DTO\Business\{DriversLicense, HealthInsuranceCard, MyBody, Passport, Profile, UserAddress};
     6use MyCLabs\Enum\Enum;
     7use ReflectionClass;
     8use ReflectionProperty;
     9
    510class Util extends \MIQID\Plugin\Core\Util {
    611    static function id( ...$id ): string {
     12        if ( is_array( current( $id ) ) ) {
     13            $id = current( $id );
     14        }
     15
    716        return mb_strtolower( implode( '_', $id ) );
    817    }
     18
     19    /**
     20     * @return ReflectionClass[]
     21     * @throws \ReflectionException
     22     */
     23    static function get_classes() {
     24        return array_map( function ( $class ) {
     25            return new ReflectionClass( $class );
     26        }, array_filter( [
     27            Profile::class,
     28            UserAddress::class,
     29            MyBody::class,
     30            Passport::class,
     31            DriversLicense::class,
     32            HealthInsuranceCard::class,
     33        ] ) );
     34    }
     35
     36    /**
     37     * @param $class
     38     *
     39     * @return ReflectionProperty[]
     40     */
     41    static function get_properties( $class ) {
     42        $properties      = [];
     43        $reflectionClass = new \ReflectionClass( $class );
     44        do {
     45            foreach ( $reflectionClass->getProperties() as $property ) {
     46                $properties[] = $property;
     47            }
     48        } while ( $reflectionClass = $reflectionClass->getParentClass() );
     49
     50        return $properties;
     51    }
     52
     53    static function get_enum_class( $class, $func ) {
     54        if ( is_object( $class ) ) {
     55            $class = get_class( $class );
     56        }
     57        if ( class_exists( $class )
     58             && ( $class = new $class() )
     59             && method_exists( $class, $func )
     60             && ( $enum = $class->$func() )
     61             && $enum instanceof Enum ) {
     62            return new ReflectionClass( get_class( $enum ) );
     63        }
     64
     65        return null;
     66    }
     67
     68    static function get_enum_values( $enum_class ) {
     69        $obj = [];
     70        if ( method_exists( $enum_class->getName(), 'values' ) ) {
     71            /** @var Enum $value */
     72            foreach ( $enum_class->getName()::values() as $value ) {
     73                $obj[ $value->getValue() ] = _x( $value->getKey(), $enum_class->getShortName(), 'miqid-core' );
     74            }
     75        }
     76
     77        return $obj;
     78    }
     79
     80    static function get_classes_options() {
     81        $Options = [];
     82        foreach ( self::get_classes() as $class ) {
     83            $Options[ $class->getName() ] = __( $class->getShortName(), 'miqid-core' );
     84        }
     85
     86        return $Options;
     87    }
     88
     89    static function get_properties_options( $class ) {
     90        $Options = [ '' => __( 'Choose' ) ];
     91        if ( is_string( $class ) && class_exists( $class ) ) {
     92            foreach ( self::get_properties( $class ) as $reflection_property ) {
     93                $Options[ $reflection_property->getName() ] = __( $reflection_property->getName(), 'miqid-core' );
     94            }
     95            switch ( $class ) {
     96                case Passport::class:
     97                    $Options['passportfaceimage'] = __( 'Passport Face image', 'miqid-elementor' );
     98                    $Options['passportimage']     = __( 'Passport image', 'miqid-elementor' );
     99                    break;
     100                case DriversLicense::class:
     101                    $Options['driverslicensefaceimage'] = __( 'DriversLicense Face Image', 'miqid-elementor' );
     102                    $Options['driverslicenseimage']     = __( 'DriversLicense Image', 'miqid-elementor' );
     103                    break;
     104                case HealthInsuranceCard::class:
     105                    $Options['healthinsurancecardimage'] = __( 'HealthInsuranceCard Image', 'miqid-elementor' );
     106                    break;
     107            }
     108        }
     109
     110        return $Options;
     111    }
     112
    9113}
  • miqid-elementor/trunk/src/Widget/Base.php

    r2513208 r2578578  
    44
    55use MIQID\Elementor\Core\Widget_MIQID;
     6use MIQID\Plugin\Core\Classes\DTO\{Business\DriversLicense, Business\HealthInsuranceCard, Business\MyBody, Business\Passport, Business\Profile, Business\UserAddress, Enum\FileContentResultType, FileContentResult, HttpResponse};
     7use MIQID\Plugin\Core\Classes\API\{Business\Certificate as api_Certificate, Business\MyBody as api_MyBody, Business\Profile as api_Profile, Business\UserAddress as api_UserAddress};
     8use MIQID\Plugin\Elementor\Util;
    69
    710abstract class Base extends Widget_MIQID {
     11    function get_title() {
     12        return sprintf( 'MIQID - %s', strtr( $this->_title ?? get_class( $this ), [
     13            'MIQID\\Plugin\\Elementor\\Widget\\' => '',
     14            '_'                                  => ' ',
     15        ] ) );
     16    }
    817
     18    public function get_icon() {
     19        return mb_strtolower(
     20            sprintf( 'miqid-icon %s',
     21                strtr( $this->_title ?? get_class( $this ), [
     22                    'MIQID\\Plugin\\Elementor\\Widget\\' => '',
     23                ] )
     24            )
     25        );
     26    }
     27
     28    /**
     29     * @param string $class
     30     *
     31     * @return Profile|UserAddress|MyBody|Passport|DriversLicense|HealthInsuranceCard|FileContentResult|HttpResponse|null
     32     */
     33    function get_miqid_data( string $class ) {
     34        switch ( $class ) {
     35            case Profile::class:
     36                return api_Profile::Instance()->GetProfile( Util::get_profileId() );
     37            case UserAddress::class:
     38                return api_UserAddress::Instance()->GetUserAddress( Util::get_profileId() );
     39            case MyBody::class:
     40                return api_MyBody::Instance()->GetMyBody( Util::get_profileId() );
     41            case Passport::class:
     42                return api_Certificate::Instance()->GetPassportCertificateInformation( Util::get_profileId() );
     43            case DriversLicense::class:
     44                return api_Certificate::Instance()->GetDriversLicenseCertificateInformation( Util::get_profileId() );
     45            case HealthInsuranceCard::class:
     46                return api_Certificate::Instance()->GetHealthInsuranceCardCertificateInformation( Util::get_profileId() );
     47            case FileContentResult::class:
     48                /** @var FileContentResult $class */
     49                switch ( $class->get_file_content_result_type() ) {
     50                    case FileContentResultType::PassportImage:
     51                        return api_Certificate::Instance()->GetProfilePassportImage( Util::get_profileId() );
     52                    case FileContentResultType::PassportFaceImage:
     53                        return api_Certificate::Instance()->GetProfilePassportFaceImage( Util::get_profileId() );
     54                    case FileContentResultType::DriversLicenseImage:
     55                        return api_Certificate::Instance()->GetProfileDriversLicenseImage( Util::get_profileId() );
     56                    case FileContentResultType::DriversLicenseFaceImage:
     57                        return api_Certificate::Instance()->GetDriversLicenseFaceImage( Util::get_profileId() );
     58                    case FileContentResultType::HealthInsuranceCardImage:
     59                        return api_Certificate::Instance()->GetHealthInsuranceCardImage( Util::get_profileId() );
     60                }
     61        }
     62
     63        return null;
     64    }
     65
     66    function get_miqid_property_data( $data, $property ) {
     67        if ( ! $data instanceof HttpResponse ) {
     68            if ( ( $method = sprintf( 'get_%s', Util::snake_case( $property ) ) ) && method_exists( $data, $method ) ) {
     69                return $data->$method();
     70            } else if ( ( $method = sprintf( 'is_%s', Util::snake_case( $property ) ) ) && method_exists( $data, $method ) ) {
     71                return $data->$method();
     72            }
     73        }
     74
     75        return null;
     76    }
    977}
  • miqid-elementor/trunk/src/Widget/Login.php

    r2513208 r2578578  
    99use MIQID\Plugin\Elementor\Util;
    1010
    11 class Login extends Base {
     11final class Login extends Base {
    1212    private $CSS = [];
    1313
     
    2323
    2424    public function get_title() {
    25         return __( 'MIQID - Login' );
     25        return __( 'MIQID login', 'miqid-elementor' );
    2626    }
    2727
     
    519519        }
    520520
     521        if ( ! empty( $_GET['redirect_to'] ) ) {
     522            $content_redirect_to['url'] = $_GET['redirect_to'];
     523            $content_redirect_always    = true;
     524        }
     525
    521526        $this->add_render_attribute( 'username_label', 'for', 'username' );
    522527        $this->add_render_attribute( 'username_input', 'id', 'username' );
     
    534539
    535540        if ( ! Plugin::$instance->editor->is_edit_mode()
    536             && ( $profileId = Util::get_user_jwt()->get_jwt_payload()->get_profile_id() )
    537             && ( $profile = Profile::Instance()->GetProfile( $profileId ) )
    538             && ! $profile instanceof HttpResponse ) {
     541            && ( $profileId = Util::get_user_jwt()->get_jwt_payload()->get_profile_id() )
     542            && ( $profile = Profile::Instance()->GetProfile( $profileId ) )
     543            && ! $profile instanceof HttpResponse ) {
    539544            if ( $content_redirect_always ) {
    540545                if ( $content_redirect_to['url'] !== get_permalink() ) {
  • miqid-elementor/trunk/widget/display_text.php

    r2513208 r2578578  
    44
    55use Elementor\Controls_Manager;
    6 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
    7 use Elementor\Group_Control_Typography;
    86use MIQID\Elementor\Core\Widget_MIQID;
     7use MIQID\Plugin\Elementor\Util;
    98
    109final class Display_Text extends Widget_MIQID {
    11     public function get_title() {
    12         return __( 'MIQID - Display Widget' );
    13     }
    1410
    1511    protected function _register_controls() {
     
    1713            'label' => 'Content',
    1814            'tab'   => Controls_Manager::TAB_CONTENT,
     15        ] );
     16
     17        $this->add_control( Util::id( 'Deprecated' ), [
     18            'label'     => __( 'Deprecated use MIQID - Display Widget instead' ),
     19            'type'      => Controls_Manager::HEADING,
     20            'separator' => 'before',
    1921        ] );
    2022
  • miqid-elementor/trunk/widget/dynamic_images.php

    r2513208 r2578578  
    2020            'label' => 'Content',
    2121            'tab'   => Controls_Manager::TAB_CONTENT,
     22        ] );
     23
     24        $this->add_control( Util::id( 'Deprecated' ), [
     25            'label'     => __( 'Deprecated, replaced by MIQID - Dynamic Images - V2' ),
     26            'type'      => Controls_Manager::HEADING,
     27            'separator' => 'before',
    2228        ] );
    2329
     
    155161        $settings             = $this->get_settings_for_display();
    156162        $miqid_category       = (string) $settings['miqid-category'] ?? '';
    157         $miqid_category_field = $this->get_miqid_category_field($miqid_category, $settings);
     163        $miqid_category_field = $this->get_miqid_category_field( $miqid_category, $settings );
    158164        $default_image        = $settings['default_image'];
    159165        $clickAction          = $settings['clickAction'];
  • miqid-elementor/trunk/widget/dynamic_text.php

    r2513208 r2578578  
    1515            'label' => __( 'Content', 'miqid-elementor' ),
    1616            'tab'   => Controls_Manager::TAB_CONTENT,
     17        ] );
     18
     19        $this->add_control( Util::id( 'Deprecated' ), [
     20            'label'     => __( 'Deprecated, replaced by MIQID - Dynamic Text - V2' ),
     21            'type'      => Controls_Manager::HEADING,
     22            'separator' => 'before',
    1723        ] );
    1824
  • miqid-elementor/trunk/widget/iconlist.php

    r2480511 r2578578  
    1414            'label' => 'Content',
    1515            'tab'   => Controls_Manager::TAB_CONTENT,
     16        ] );
     17
     18        $this->add_control( Util::id( 'Deprecated' ), [
     19            'label'     => __( 'Deprecated, replaced by MIQID - Display Widget' ),
     20            'type'      => Controls_Manager::HEADING,
     21            'separator' => 'before',
    1622        ] );
    1723
  • miqid-elementor/trunk/widget/input.php

    r2513208 r2578578  
    55use Elementor\{Controls_Manager, Core\Kits\Documents\Tabs\Global_Typography, Group_Control_Typography};
    66use MIQID\Elementor\Core\Widget_MIQID;
     7use MIQID\Plugin\Core\Classes\API\Business\Profile;
     8use MIQID\Plugin\Core\Classes\DTO\DriversLicense;
     9use MIQID\Plugin\Core\Classes\DTO\HealthInsuranceCard;
     10use MIQID\Plugin\Core\Classes\DTO\HttpResponse;
     11use MIQID\Plugin\Core\Classes\DTO\Passport;
     12use MIQID\Plugin\Elementor\Util;
    713
    814final class Input extends Widget_MIQID {
     15    private $CSS;
     16    private $JS;
    917
    1018    public function __construct( $data = [], $args = null ) {
    1119        parent::__construct( $data, $args );
    1220
    13         wp_register_style(
    14             $this->get_name(),
    15             plugin_dir_url( __DIR__ ) . 'assets/css/input.css',
    16             null,
    17             date( 'Ymd-His', filemtime( plugin_dir_path( __DIR__ ) . '/assets/css/input.css' ) )
    18         );
     21        $this->CSS = $this->_register_css(
     22            'verified.css' );
    1923
    2024    }
    2125
    2226    public function get_style_depends() {
    23         return [ $this->get_name() ];
     27        return $this->CSS;
    2428    }
    2529
     
    2832            'label' => 'Content',
    2933            'tab'   => Controls_Manager::TAB_CONTENT,
     34        ] );
     35
     36        $this->add_control( Util::id( 'Deprecated' ), [
     37            'label'     => __( 'Deprecated use MIQID - Display Widget instead' ),
     38            'type'      => Controls_Manager::HEADING,
     39            'separator' => 'before',
    3040        ] );
    3141
     
    296306            $this->add_render_attribute( 'wrapper', 'class', $direction );
    297307        }
     308        if ( ! empty( $shortcode_value ) )
     309            switch ( $miqid_category ) {
     310                case DriversLicense::class:
     311                case \MIQID\Plugin\Core\Classes\DTO\Business\DriversLicense::class:
     312                case Passport::class:
     313                case \MIQID\Plugin\Core\Classes\DTO\Business\Passport::class:
     314                case HealthInsuranceCard::class:
     315                case \MIQID\Plugin\Core\Classes\DTO\Business\HealthInsuranceCard::class:
     316                    $this->add_render_attribute( 'wrapper', 'class', 'miqid-verified' );
     317                    break;
     318            }
    298319
    299320        $this->add_render_attribute( 'input', 'type', $type );
  • miqid-elementor/trunk/widget/text_hide_if.php

    r2499300 r2578578  
    1414            'label' => 'Content',
    1515            'tab'   => Controls_Manager::TAB_CONTENT,
     16        ] );
     17
     18        $this->add_control( Util::id( 'Deprecated' ), [
     19            'label'     => __( 'Deprecated, replaced by MIQID - Text Visibility' ),
     20            'type'      => Controls_Manager::HEADING,
     21            'separator' => 'before',
    1622        ] );
    1723
Note: See TracChangeset for help on using the changeset viewer.