dashboard
1 year ago
extension
1 year ago
Assets.php
1 year ago
Dashboard.php
1 year ago
Module_Settings.php
1 year ago
Plugin_Installer.php
1 year ago
Assets.php
83 lines
| 1 | <?php |
| 2 | namespace SPEL\includes\Admin; |
| 3 | |
| 4 | // Exit if accessed directly |
| 5 | if (!defined('ABSPATH')) { |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | /** |
| 10 | * Class Assets |
| 11 | * @package SPEL\Admin |
| 12 | */ |
| 13 | class Assets { |
| 14 | |
| 15 | /** |
| 16 | * Assets constructor. |
| 17 | */ |
| 18 | public function __construct() { |
| 19 | |
| 20 | // Register Admin Panel Scripts |
| 21 | add_action( 'admin_enqueue_scripts', [ $this, 'admin_scripts' ] ); |
| 22 | |
| 23 | //add_action('fonts_url', [$this, 'fonts_url']); |
| 24 | } |
| 25 | |
| 26 | public function fonts_url(): string |
| 27 | { |
| 28 | |
| 29 | $fonts_url = ''; |
| 30 | $fonts = array(); |
| 31 | $subsets = ''; |
| 32 | |
| 33 | /* Body font */ |
| 34 | if ( 'off' !== 'on' ) { |
| 35 | $fonts[] = "Inter:400,500,600,700"; |
| 36 | } |
| 37 | if ( 'off' !== 'on' ) { |
| 38 | $fonts[] = "Roboto:400,500,600"; |
| 39 | } |
| 40 | |
| 41 | $is_ssl = is_ssl() ? 'https' : 'http'; |
| 42 | |
| 43 | if ( $fonts ) { |
| 44 | $fonts_url = add_query_arg( array( |
| 45 | 'family' => urlencode( implode( '|', $fonts ) ), |
| 46 | 'subset' => urlencode( $subsets ), |
| 47 | ), "$is_ssl://fonts.googleapis.com/css" ); |
| 48 | } |
| 49 | |
| 50 | return $fonts_url; |
| 51 | |
| 52 | } |
| 53 | |
| 54 | |
| 55 | /** |
| 56 | * Register Admin Panel Scripts |
| 57 | * |
| 58 | * Register custom scripts required to run Spider Elements. |
| 59 | * |
| 60 | * @access public |
| 61 | */ |
| 62 | public function admin_scripts(): void |
| 63 | { |
| 64 | |
| 65 | // Register Admin Panel Styles |
| 66 | //wp_enqueue_style( 'spel-fonts', self::fonts_url(), [], SPEL_VERSION ); |
| 67 | wp_enqueue_style( 'icomoon', SPEL_VEND . '/icomoon/style.css', [], SPEL_VERSION ); |
| 68 | wp_enqueue_style( 'spel-circle', SPEL_VEND . '/circle-progressbar/circularprogress.css', [], SPEL_VERSION ); |
| 69 | wp_enqueue_style( 'spel-fancy', SPEL_VEND . '/fancybox/css/jquery.fancybox.min.css', [], SPEL_VERSION ); |
| 70 | wp_enqueue_style( 'spel-admin', SPEL_CSS . '/admin.css', [], SPEL_VERSION); |
| 71 | |
| 72 | |
| 73 | // Register Admin Panel Scripts |
| 74 | wp_enqueue_script( 'spel-waypoint', SPEL_VEND . '/circle-progressbar/jquery.waypoints.min.js', ['jquery'], SPEL_VERSION, true ); |
| 75 | wp_enqueue_script( 'spel-counterup', SPEL_VEND . '/circle-progressbar/jquery.counterup.min.js', ['jquery'], SPEL_VERSION, true ); |
| 76 | wp_enqueue_script( 'spel-imageloaded', SPEL_VEND . '/imagesloaded/imagesloaded.pkgd.min.js', ['jquery'], SPEL_VERSION, true ); |
| 77 | wp_enqueue_script( 'spel-isotope', SPEL_VEND . '/isotope/isotope.min.js', ['jquery'], SPEL_VERSION, true ); |
| 78 | wp_enqueue_script( 'spel-fancy', SPEL_VEND . '/fancybox/js/jquery.fancybox.min.js', ['jquery'], SPEL_VERSION, true ); |
| 79 | wp_enqueue_script( 'spel-circle', SPEL_VEND . '/circle-progressbar/circle-progress.js', ['jquery'], SPEL_VERSION, true ); |
| 80 | wp_enqueue_script( 'spel-admin', SPEL_JS . '/admin.js', ['jquery'], SPEL_VERSION, true ); |
| 81 | } |
| 82 | |
| 83 | } |