@@ -12,15 +12,15 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Prevent direct file access |
| 15 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
| 15 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Prevent loading the library more than once |
| 19 | 19 | */ |
| 20 | -if( defined( 'AMARKAL_UI' ) ) return false; |
|
| 21 | -define( 'AMARKAL_UI', true ); |
|
| 20 | +if (defined('AMARKAL_UI')) return false; |
|
| 21 | +define('AMARKAL_UI', true); |
|
| 22 | 22 | |
| 23 | -if(!function_exists('amarkal_ui_render')) |
|
| 23 | +if (!function_exists('amarkal_ui_render')) |
|
| 24 | 24 | { |
| 25 | 25 | /** |
| 26 | 26 | * Render a UI component. |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | * @param array $props The component's properties |
| 31 | 31 | * @return string The rendered HTML |
| 32 | 32 | */ |
| 33 | - function amarkal_ui_render( $type, array $props = array() ) |
|
| 33 | + function amarkal_ui_render($type, array $props = array()) |
|
| 34 | 34 | { |
| 35 | - $component = Amarkal\UI\ComponentFactory::create( $type, $props ); |
|
| 35 | + $component = Amarkal\UI\ComponentFactory::create($type, $props); |
|
| 36 | 36 | return $component->render(); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -if(!function_exists('amarkal_ui_register_component')) |
|
| 40 | +if (!function_exists('amarkal_ui_register_component')) |
|
| 41 | 41 | { |
| 42 | 42 | /** |
| 43 | 43 | * Register a custom UI component. The registered component's class should |
@@ -47,13 +47,13 @@ discard block |
||
| 47 | 47 | * to one of the core component's type, it will override the core component. |
| 48 | 48 | * @param string $class_name The component's class name. |
| 49 | 49 | */ |
| 50 | - function amarkal_ui_register_component( $type, $class_name ) |
|
| 50 | + function amarkal_ui_register_component($type, $class_name) |
|
| 51 | 51 | { |
| 52 | - Amarkal\UI\ComponentFactory::register( $type, $class_name ); |
|
| 52 | + Amarkal\UI\ComponentFactory::register($type, $class_name); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -if(!function_exists('amarkal_ui_register_scripts')) |
|
| 56 | +if (!function_exists('amarkal_ui_register_scripts')) |
|
| 57 | 57 | { |
| 58 | 58 | /** |
| 59 | 59 | * Register Amarkal UI styles & scripts. These scripts are later enqueued by |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function amarkal_ui_register_scripts() |
| 63 | 63 | { |
| 64 | - \wp_register_script('amarkal-ui',Amarkal\Core\Utility::path_to_url(__DIR__.'/assets/js/dist/amarkal-ui.min.js'),array('jquery','amarkal-core'),false,true); |
|
| 65 | - \wp_register_script('ace-editor','https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js',array('jquery'),false,true); |
|
| 66 | - \wp_register_style('amarkal-ui',Amarkal\Core\Utility::path_to_url(__DIR__.'/assets/css/dist/amarkal-ui.min.css'),array()); |
|
| 64 | + \wp_register_script('amarkal-ui', Amarkal\Core\Utility::path_to_url(__DIR__.'/assets/js/dist/amarkal-ui.min.js'), array('jquery', 'amarkal-core'), false, true); |
|
| 65 | + \wp_register_script('ace-editor', 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js', array('jquery'), false, true); |
|
| 66 | + \wp_register_style('amarkal-ui', Amarkal\Core\Utility::path_to_url(__DIR__.'/assets/css/dist/amarkal-ui.min.css'), array()); |
|
| 67 | 67 | } |
| 68 | - \add_action('admin_init','amarkal_ui_register_scripts'); |
|
| 68 | + \add_action('admin_init', 'amarkal_ui_register_scripts'); |
|
| 69 | 69 | } |
| 70 | 70 | \ No newline at end of file |