Changeset 2578578
- Timestamp:
- 08/05/2021 09:02:07 AM (5 years ago)
- Location:
- miqid-elementor/trunk
- Files:
-
- 24 added
- 12 edited
-
assets/css/miqid-elementor.css (added)
-
assets/css/miqid-elementor.scss (added)
-
assets/css/verified.css (added)
-
assets/css/verified.scss (added)
-
assets/images (added)
-
assets/images/display_widget.svg (added)
-
assets/images/dynamic_images.svg (added)
-
assets/images/dynamic_text.svg (added)
-
assets/images/iconlist.svg (added)
-
assets/images/login.svg (added)
-
assets/images/text_visibility.svg (added)
-
assets/js/GroupControlFilter.js (added)
-
core/widget_miqid.php (modified) (8 diffs)
-
languages (added)
-
miqid-elementor.php (modified) (8 diffs)
-
readme.md (modified) (1 diff)
-
src/Ajax (added)
-
src/Ajax/Ajax.php (added)
-
src/Control (added)
-
src/Control/Group (added)
-
src/Control/Group/Filter.php (added)
-
src/Util.php (modified) (1 diff)
-
src/Widget/Base.php (modified) (1 diff)
-
src/Widget/Conditional_Image.php (added)
-
src/Widget/Display_Widget.php (added)
-
src/Widget/Dynamic_Images.php (added)
-
src/Widget/Dynamic_Text.php (added)
-
src/Widget/IconList.php (added)
-
src/Widget/Login.php (modified) (4 diffs)
-
src/Widget/Text_Visibility.php (added)
-
widget/display_text.php (modified) (2 diffs)
-
widget/dynamic_images.php (modified) (2 diffs)
-
widget/dynamic_text.php (modified) (1 diff)
-
widget/iconlist.php (modified) (1 diff)
-
widget/input.php (modified) (3 diffs)
-
widget/text_hide_if.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
miqid-elementor/trunk/core/widget_miqid.php
r2513387 r2578578 4 4 5 5 use 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 }; 6 use 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}; 7 use MyCLabs\Enum\Enum; 15 8 use MIQID\Elementor\Handler\{Passport, Address, MyBody, Profile}; 16 9 use ReflectionClass; 10 use ReflectionException; 11 use ReflectionProperty; 17 12 18 13 abstract class Widget_MIQID extends Widget_Base { … … 73 68 74 69 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};97 70 } 98 71 … … 160 133 } 161 134 135 /** 136 * @return ReflectionClass[] 137 * @throws ReflectionException 138 */ 162 139 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( [ 170 143 business_Profile::class, 171 144 business_UserAddress::class, … … 173 146 business_Passport::class, 174 147 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 */ 181 158 function get_properties( $class ) { 182 159 $properties = []; … … 184 161 do { 185 162 foreach ( $reflectionClass->getProperties() as $property ) { 186 $properties[] = $property ->getName();163 $properties[] = $property; 187 164 } 188 165 } while ( $reflectionClass = $reflectionClass->getParentClass() ); … … 191 168 } 192 169 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 193 221 function get_classes_options() { 194 $Options = [ 195 '' => __( 'Choose' ), 196 ]; 222 $Options = []; 197 223 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' ); 203 225 } 204 226 … … 208 230 209 231 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 } 241 254 } 242 255 … … 245 258 246 259 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, [ '\\' => '-' ] ) ] ?? ''; 248 261 if ( empty( $miqid_category_field ) ) { 249 262 $miqid_category_field = $settings['miqid'] ?? ''; -
miqid-elementor/trunk/miqid-elementor.php
r2513387 r2578578 4 4 * Plugin Name: MIQID-Elementor 5 5 * Description: MIQID-Elementor extend Elementor with MIQID data. 6 * Version: 1. 7.46 * Version: 1.9.0 7 7 * Requires at least: 5.2 8 8 * Requires PHP: 7.2 … … 11 11 * License: GPL v3 or later 12 12 * 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 13 16 */ 14 17 … … 18 21 19 22 use 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}; 23 use MIQID\Elementor\Widget\{Display_Text, Dynamic_Images, Dynamic_Text, IconList, Input, Text_Hide_If}; 24 use 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}; 25 use MIQID\Plugin\Elementor\Ajax\Ajax; 26 use MIQID\Plugin\Elementor\Control\Group\Filter; 23 27 24 28 if ( ! defined( 'WPINC' ) ) { … … 27 31 28 32 class 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"; 31 35 const MINIMUM_PHP_VERSION = "7.2"; 32 36 … … 54 58 } ); 55 59 60 add_action( 'plugins_loaded', [ $this, '_language' ] ); 61 56 62 add_action( 'plugins_loaded', [ $this, 'init' ] ); 63 } 64 65 66 function _language() { 67 load_plugin_textdomain( 'miqid-elementor', false, basename( dirname( __FILE__ ) ) . '/languages/' ); 57 68 } 58 69 … … 71 82 $this->_deactivate_plugin( [ $this, '_notice_elementor_version' ] ); 72 83 } else { 73 $this->_table_visitor_counter();84 add_action( 'elementor/controls/controls_registered', [ $this, 'register_controls' ] ); 74 85 75 86 add_action( 'elementor/elements/categories_registered', [ $this, 'miqid_elementor_categories' ] ); … … 77 88 add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] ); 78 89 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(); 80 99 } 81 100 } 82 101 83 102 function miqid_elementor_categories( $elements_manager ) { 84 85 103 $elements_manager->add_category( 'miqid', [ 86 104 'title' => "MIQID", … … 89 107 } 90 108 109 function register_controls() { 110 Plugin::instance()->controls_manager->add_group_control( Filter::get_type(), new Filter() ); 111 } 112 91 113 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() ); 94 116 Plugin::instance()->widgets_manager->register_widget_type( new Display_Text() ); 95 117 Plugin::instance()->widgets_manager->register_widget_type( new Dynamic_Images() ); 96 118 Plugin::instance()->widgets_manager->register_widget_type( new Dynamic_Text() ); 97 Plugin::instance()->widgets_manager->register_widget_type( new FormSave() );98 119 Plugin::instance()->widgets_manager->register_widget_type( new IconList() ); 99 120 Plugin::instance()->widgets_manager->register_widget_type( new Input() ); 100 121 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() ); 101 129 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() ); 128 131 } 129 132 -
miqid-elementor/trunk/readme.md
r2513387 r2578578 2 2 Contributors: karlogit,miqid 3 3 Tags: MIQID,MIQID-Core,Elementor 4 Tested up to: 5. 74 Tested up to: 5.8 5 5 Requires PHP: 7.2 6 Stable tag: 1. 7.46 Stable tag: 1.9.0 7 7 License: GPL v3 or later 8 8 -
miqid-elementor/trunk/src/Util.php
r2513208 r2578578 3 3 namespace MIQID\Plugin\Elementor; 4 4 5 use MIQID\Plugin\Core\Classes\DTO\Business\{DriversLicense, HealthInsuranceCard, MyBody, Passport, Profile, UserAddress}; 6 use MyCLabs\Enum\Enum; 7 use ReflectionClass; 8 use ReflectionProperty; 9 5 10 class Util extends \MIQID\Plugin\Core\Util { 6 11 static function id( ...$id ): string { 12 if ( is_array( current( $id ) ) ) { 13 $id = current( $id ); 14 } 15 7 16 return mb_strtolower( implode( '_', $id ) ); 8 17 } 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 9 113 } -
miqid-elementor/trunk/src/Widget/Base.php
r2513208 r2578578 4 4 5 5 use MIQID\Elementor\Core\Widget_MIQID; 6 use MIQID\Plugin\Core\Classes\DTO\{Business\DriversLicense, Business\HealthInsuranceCard, Business\MyBody, Business\Passport, Business\Profile, Business\UserAddress, Enum\FileContentResultType, FileContentResult, HttpResponse}; 7 use 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}; 8 use MIQID\Plugin\Elementor\Util; 6 9 7 10 abstract 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 } 8 17 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 } 9 77 } -
miqid-elementor/trunk/src/Widget/Login.php
r2513208 r2578578 9 9 use MIQID\Plugin\Elementor\Util; 10 10 11 class Login extends Base {11 final class Login extends Base { 12 12 private $CSS = []; 13 13 … … 23 23 24 24 public function get_title() { 25 return __( 'MIQID - Login' );25 return __( 'MIQID login', 'miqid-elementor' ); 26 26 } 27 27 … … 519 519 } 520 520 521 if ( ! empty( $_GET['redirect_to'] ) ) { 522 $content_redirect_to['url'] = $_GET['redirect_to']; 523 $content_redirect_always = true; 524 } 525 521 526 $this->add_render_attribute( 'username_label', 'for', 'username' ); 522 527 $this->add_render_attribute( 'username_input', 'id', 'username' ); … … 534 539 535 540 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 ) { 539 544 if ( $content_redirect_always ) { 540 545 if ( $content_redirect_to['url'] !== get_permalink() ) { -
miqid-elementor/trunk/widget/display_text.php
r2513208 r2578578 4 4 5 5 use Elementor\Controls_Manager; 6 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;7 use Elementor\Group_Control_Typography;8 6 use MIQID\Elementor\Core\Widget_MIQID; 7 use MIQID\Plugin\Elementor\Util; 9 8 10 9 final class Display_Text extends Widget_MIQID { 11 public function get_title() {12 return __( 'MIQID - Display Widget' );13 }14 10 15 11 protected function _register_controls() { … … 17 13 'label' => 'Content', 18 14 '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', 19 21 ] ); 20 22 -
miqid-elementor/trunk/widget/dynamic_images.php
r2513208 r2578578 20 20 'label' => 'Content', 21 21 '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', 22 28 ] ); 23 29 … … 155 161 $settings = $this->get_settings_for_display(); 156 162 $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 ); 158 164 $default_image = $settings['default_image']; 159 165 $clickAction = $settings['clickAction']; -
miqid-elementor/trunk/widget/dynamic_text.php
r2513208 r2578578 15 15 'label' => __( 'Content', 'miqid-elementor' ), 16 16 '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', 17 23 ] ); 18 24 -
miqid-elementor/trunk/widget/iconlist.php
r2480511 r2578578 14 14 'label' => 'Content', 15 15 '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', 16 22 ] ); 17 23 -
miqid-elementor/trunk/widget/input.php
r2513208 r2578578 5 5 use Elementor\{Controls_Manager, Core\Kits\Documents\Tabs\Global_Typography, Group_Control_Typography}; 6 6 use MIQID\Elementor\Core\Widget_MIQID; 7 use MIQID\Plugin\Core\Classes\API\Business\Profile; 8 use MIQID\Plugin\Core\Classes\DTO\DriversLicense; 9 use MIQID\Plugin\Core\Classes\DTO\HealthInsuranceCard; 10 use MIQID\Plugin\Core\Classes\DTO\HttpResponse; 11 use MIQID\Plugin\Core\Classes\DTO\Passport; 12 use MIQID\Plugin\Elementor\Util; 7 13 8 14 final class Input extends Widget_MIQID { 15 private $CSS; 16 private $JS; 9 17 10 18 public function __construct( $data = [], $args = null ) { 11 19 parent::__construct( $data, $args ); 12 20 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' ); 19 23 20 24 } 21 25 22 26 public function get_style_depends() { 23 return [ $this->get_name() ];27 return $this->CSS; 24 28 } 25 29 … … 28 32 'label' => 'Content', 29 33 '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', 30 40 ] ); 31 41 … … 296 306 $this->add_render_attribute( 'wrapper', 'class', $direction ); 297 307 } 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 } 298 319 299 320 $this->add_render_attribute( 'input', 'type', $type ); -
miqid-elementor/trunk/widget/text_hide_if.php
r2499300 r2578578 14 14 'label' => 'Content', 15 15 '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', 16 22 ] ); 17 23
Note: See TracChangeset
for help on using the changeset viewer.