-
Notifications
You must be signed in to change notification settings - Fork 0
/
UKMresources.php
66 lines (50 loc) · 3.12 KB
/
UKMresources.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
Plugin Name: UKM Resources
Plugin URI: http://www.ukm-norge.no
Description: Resources loaded to admin (javascript, jquery, googlescripts+++)
Author: UKM Norge / M Mandal
Version: 1.0
Author URI: http://www.ukm-norge.no
*/
add_action( 'admin_enqueue_scripts', 'UKMresources', -1000 );
add_action( 'admin_print_scripts', 'UKMconstants' );
function UKMresources() {
wp_enqueue_style( 'jquery-ui-style', PLUGIN_PATH . 'UKMresources/css/jquery-ui-1.7.3.custom.css');
wp_enqueue_style('UKMresources_wp-admin', PLUGIN_PATH . 'UKMresources/css/UKMresources_wp-admin.css');
wp_register_style('UKMresources_tabs', PLUGIN_PATH . 'UKMresources/css/UKMresources_tabs.css');
wp_enqueue_style('UKMresources_tabs');
wp_enqueue_script('jquery');
wp_enqueue_script('jqueryGoogleUI', '//code.jquery.com/ui/1.11.4/jquery-ui.min.js');
wp_enqueue_script('wp-admin_smslink', PLUGIN_PATH . 'UKMresources/js/wp-admin.smslink.js');
wp_enqueue_script('UKMresources_wp-admin', PLUGIN_PATH . 'UKMresources/js/UKMresources_wp-admin.js?v2020-09-28');
wp_enqueue_script('UKMresources', PLUGIN_PATH . 'UKMresources/js/UKMresources.js');
wp_register_script('handlebars_js', PLUGIN_PATH . 'UKMresources/js/handlebars.js');
wp_register_script('jQuery-fastlivefilter', PLUGIN_PATH . 'UKMresources/js/jquery.fastLiveFilter.js');
wp_register_script('jQuery_autogrow', PLUGIN_PATH . 'UKMresources/js/autogrow.jquery.js');
// wp_register_script('bootstrap_js', PLUGIN_PATH . 'UKMresources/js/bootstrap.min.js');
// wp_register_style('bootstrap_css', PLUGIN_PATH . 'UKMresources/css/bootstrap.min.css');
wp_register_script('WPbootstrap_js', PLUGIN_PATH . 'UKMresources/js/bootstrap.min.js');
wp_register_style('WPbootstrap_css', PLUGIN_PATH . 'UKMresources/css/bootstrap.min.css');
wp_register_script('WPbootstrap3_js', PLUGIN_PATH . 'UKMresources/js/bootstrap3.js');
wp_register_style('WPbootstrap3_css', PLUGIN_PATH . 'UKMresources/css/bootstrap3.css');
wp_register_style('WPbootstrap3_outlinebtn', PLUGIN_PATH . 'UKMresources/css/bootstrap3.btn-outline.css');
wp_register_script('WPbootstrap4_js', PLUGIN_PATH . 'UKMresources/js/bootstrap4-alpha2.min.js');
wp_register_style('WPbootstrap4_css', PLUGIN_PATH . 'UKMresources/css/bootstrap4-alpha2.min.css');
wp_register_style('UKMArrSysStyle', '//assets.' . UKM_HOSTNAME . '//css/arr-sys.css');
wp_enqueue_style('WPgallery_css', PLUGIN_PATH . 'UKMresources/css/gallery.css');
wp_register_script( 'TwigJS', PLUGIN_PATH . 'UKMresources/js/twig.js');
wp_register_script( 'dropzone', PLUGIN_PATH . 'UKMresources/js/dropzone.js');
wp_register_script( 'VUEjs', 'https://unpkg.com/vue@3/dist/vue.global.js');
}
function UKMconstants() {
$isMainSite = is_main_site() ? 'true' : 'false';
$blogName = is_main_site() ? 'arrangørsystemet' : get_bloginfo('name');
echo '<script type="text/javascript">'.
'var SEASON = '. get_site_option('season') .';'.
'var GOOGLE_API_KEY = "'. (defined('GOOGLE_API_KEY') ? GOOGLE_API_KEY : '') .'";' .
'var UKM_HOSTNAME = "' . UKM_HOSTNAME . '";' .
'var isMainSite = "' . $isMainSite . '";' .
'var blogName = "' . $blogName . '";' .
'</script>';
}