css
1 day ago
fonts
1 day ago
images
1 day ago
js
1 day ago
partials
1 day ago
class-mo-firebase-authentication-admin.php
1 day ago
class-mo-firebase-customer.php
1 day ago
class-mo-firebase-authentication-admin.php
99 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Firebase Authentication Admin Functions |
| 4 | * |
| 5 | * @package firebase-authentication |
| 6 | */ |
| 7 | |
| 8 | if( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; // Exit if accessed directly. |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * Files included |
| 14 | */ |
| 15 | require_once 'partials' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-display.php'; |
| 16 | |
| 17 | |
| 18 | /** |
| 19 | * Firebase Authentication Admin account handler |
| 20 | */ |
| 21 | class MO_Firebase_Authentication_Admin { |
| 22 | |
| 23 | /** |
| 24 | * The ID of this plugin. |
| 25 | * |
| 26 | * @since 1.0.0 |
| 27 | * @access private |
| 28 | * @var string $plugin_name The ID of this plugin. |
| 29 | */ |
| 30 | private $plugin_name; |
| 31 | |
| 32 | /** |
| 33 | * The version of this plugin. |
| 34 | * |
| 35 | * @since 1.0.0 |
| 36 | * @access private |
| 37 | * @var string $version The current version of this plugin. |
| 38 | */ |
| 39 | private $version; |
| 40 | |
| 41 | /** |
| 42 | * Initialize the class and set its properties. |
| 43 | * |
| 44 | * @since 1.0.0 |
| 45 | * @param string $plugin_name The name of this plugin. |
| 46 | * @param string $version The version of this plugin. |
| 47 | */ |
| 48 | public function __construct( $plugin_name, $version ) { |
| 49 | $this->plugin_name = $plugin_name; |
| 50 | $this->version = $version; |
| 51 | } |
| 52 | |
| 53 | |
| 54 | /** |
| 55 | * Enqueue styles for admin dashboard |
| 56 | * |
| 57 | * @param mixed $hook default parameter for enqueue styles. |
| 58 | * |
| 59 | * @return [type] |
| 60 | * @since 1.0.0 |
| 61 | */ |
| 62 | public function enqueue_styles( $hook ) { |
| 63 | if ( 'toplevel_page_mo_firebase_authentication' !== $hook ) { |
| 64 | return; |
| 65 | } |
| 66 | wp_enqueue_style( 'mo_firebase_auth_admin_bootstrap_style', plugins_url( 'css' . DIRECTORY_SEPARATOR . 'bootstrap.min.css', __FILE__ ), array(), $this->version, false ); |
| 67 | wp_enqueue_style( 'mo_firebase_auth_firebase_phone_style', plugins_url( 'css' . DIRECTORY_SEPARATOR . 'phone.min.css', __FILE__ ), array(), $this->version, false ); |
| 68 | wp_enqueue_style( 'mo_firebase_auth_settings_style', plugins_url( 'css' . DIRECTORY_SEPARATOR . 'style.min.css', __FILE__ ), array(), $this->version, false ); |
| 69 | wp_enqueue_style( 'mo_firebase_auth_fontawesome', plugins_url( 'css' . DIRECTORY_SEPARATOR . 'font-awesome.min.css', __FILE__ ), array(), $this->version, false ); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Register the JavaScript for the admin area. |
| 74 | * |
| 75 | * @param mixed $hook default parameter for enqueue scripts. |
| 76 | * @since 1.0.0 |
| 77 | */ |
| 78 | public function enqueue_scripts( $hook ) { |
| 79 | if ( 'toplevel_page_mo_firebase_authentication' !== $hook ) { |
| 80 | return; |
| 81 | } |
| 82 | wp_enqueue_script( 'mo_firebase_auth_bootstrap_script', plugins_url( 'js' . DIRECTORY_SEPARATOR . 'bootstrap.min.js', __FILE__ ), array(), $this->version, false ); |
| 83 | wp_enqueue_script( 'mo_firebase_auth_custom_settings_script', plugins_url( 'js' . DIRECTORY_SEPARATOR . 'custom.min.js', __FILE__ ), array(), $this->version, false ); |
| 84 | wp_enqueue_script( 'mo_firebase_auth_firebase_phone_script', plugins_url( 'js' . DIRECTORY_SEPARATOR . 'phone.min.js', __FILE__ ), array(), $this->version, false ); |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Initial render for firebase admin dashboardF |
| 89 | * |
| 90 | * @return void |
| 91 | */ |
| 92 | public function mo_firebase_auth_page() { |
| 93 | global $wpdb; |
| 94 | update_option( 'mo_fb_host_name', 'https://login.xecurify.com' ); |
| 95 | mo_firebase_authentication_main_menu(); |
| 96 | } |
| 97 | |
| 98 | } |
| 99 |