| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage core |
| 5 |
* @author E4J s.r.l. |
| 6 |
* @copyright Copyright (C) 2018 E4J s.r.l. All Rights Reserved. |
| 7 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 |
* @link https://vikwp.com |
| 9 |
*/ |
| 10 |
|
| 11 |
// No direct access |
| 12 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 13 |
|
| 14 |
// Software version |
| 15 |
define('VIKBOOKING_SOFTWARE_VERSION', '1.8.14'); |
| 16 |
|
| 17 |
// Base path |
| 18 |
define('VIKBOOKING_BASE', dirname(__FILE__)); |
| 19 |
|
| 20 |
// Libraries path |
| 21 |
define('VIKBOOKING_LIBRARIES', VIKBOOKING_BASE . DIRECTORY_SEPARATOR . 'libraries'); |
| 22 |
|
| 23 |
// Languages path |
| 24 |
defined('VIKBOOKING_LANG') or define('VIKBOOKING_LANG', basename(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'languages'); |
| 25 |
/** |
| 26 |
* The admin and site languages are no more used by the plugin. |
| 27 |
* |
| 28 |
* @deprecated 1.0.2 |
| 29 |
* @see these constants won't be removed as some classes of VCM may need them. |
| 30 |
*/ |
| 31 |
defined('VIKBOOKING_SITE_LANG') or define('VIKBOOKING_SITE_LANG', basename(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'site' . DIRECTORY_SEPARATOR . 'language'); |
| 32 |
defined('VIKBOOKING_ADMIN_LANG') or define('VIKBOOKING_ADMIN_LANG', basename(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'language'); |
| 33 |
|
| 34 |
// Assets URI |
| 35 |
define('VIKBOOKING_SITE_ASSETS_URI', plugin_dir_url(__FILE__) . 'site/resources/'); |
| 36 |
define('VIKBOOKING_ADMIN_ASSETS_URI', plugin_dir_url(__FILE__) . 'admin/resources/'); |
| 37 |
|
| 38 |
// Debug flag |
| 39 |
define('VIKBOOKING_DEBUG', false); |
| 40 |
|
| 41 |
// URI Constants for admin and site sections (with trailing slash) |
| 42 |
defined('VBO_ADMIN_URI') or define('VBO_ADMIN_URI', plugin_dir_url(__FILE__).'admin/'); |
| 43 |
defined('VBO_SITE_URI') or define('VBO_SITE_URI', plugin_dir_url(__FILE__).'site/'); |
| 44 |
defined('VBO_BASE_URI') or define('VBO_BASE_URI', plugin_dir_url(__FILE__)); |
| 45 |
defined('VBO_MODULES_URI') or define('VBO_MODULES_URI', plugin_dir_url(__FILE__)); |
| 46 |
defined('VBO_ADMIN_URI_REL') or define('VBO_ADMIN_URI_REL', plugin_dir_url(__FILE__).'admin/'); |
| 47 |
defined('VBO_SITE_URI_REL') or define('VBO_SITE_URI_REL', plugin_dir_url(__FILE__).'site/'); |
| 48 |
defined('VCM_ADMIN_URI') or define('VCM_ADMIN_URI', str_replace('vikbooking/admin', 'vikchannelmanager/admin', VBO_ADMIN_URI)); |
| 49 |
defined('VCM_SITE_URI') or define('VCM_SITE_URI', str_replace('vikbooking/site', 'vikchannelmanager/site', VBO_SITE_URI)); |
| 50 |
|
| 51 |
// Path Constants for admin and site sections (with NO trailing directory separator) |
| 52 |
defined('VBO_ADMIN_PATH') or define('VBO_ADMIN_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'admin'); |
| 53 |
defined('VBO_SITE_PATH') or define('VBO_SITE_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'site'); |
| 54 |
defined('VCM_ADMIN_PATH') or define('VCM_ADMIN_PATH', str_replace('vikbooking' . DIRECTORY_SEPARATOR . 'admin', 'vikchannelmanager' . DIRECTORY_SEPARATOR . 'admin', VBO_ADMIN_PATH)); |
| 55 |
defined('VCM_SITE_PATH') or define('VCM_SITE_PATH', str_replace('vikbooking' . DIRECTORY_SEPARATOR . 'site', 'vikchannelmanager' . DIRECTORY_SEPARATOR . 'site', VBO_SITE_PATH)); |
| 56 |
|
| 57 |
/** |
| 58 |
* Minimum version required for VCM to detect outdated/stucked versions. |
| 59 |
* |
| 60 |
* @since 1.8.13 |
| 61 |
*/ |
| 62 |
define('VIKCHANNELMANAGER_MINIMUM_VERSION', '1.9.21'); |
| 63 |
|
| 64 |
// Other Constants that may not be available in the framework |
| 65 |
defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
| 66 |
|
| 67 |
// default paths and URIs |
| 68 |
$customer_upload_base_path = VBO_ADMIN_PATH . DIRECTORY_SEPARATOR . 'resources'; |
| 69 |
$customer_upload_base_uri = VBO_ADMIN_URI . 'resources/'; |
| 70 |
$media_upload_base_path = $customer_upload_base_path; |
| 71 |
$media_upload_base_uri = $customer_upload_base_uri; |
| 72 |
$media_assets_base_path = $customer_upload_base_path; |
| 73 |
$media_assets_base_uri = $customer_upload_base_uri; |
| 74 |
|
| 75 |
$upload_dir = wp_upload_dir(); |
| 76 |
if (is_array($upload_dir) && !empty($upload_dir['basedir']) && !empty($upload_dir['baseurl'])) { |
| 77 |
// define proper values for the customer documents |
| 78 |
$customer_upload_base_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'vikbooking' . DIRECTORY_SEPARATOR . 'customerdocs'; |
| 79 |
$customer_upload_base_uri = rtrim($upload_dir['baseurl'], '/') . '/' . 'vikbooking' . '/' . 'customerdocs' . '/'; |
| 80 |
|
| 81 |
// define proper values for the media directory |
| 82 |
$media_upload_base_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'vikbooking' . DIRECTORY_SEPARATOR . 'media'; |
| 83 |
$media_upload_base_uri = rtrim($upload_dir['baseurl'], '/') . '/' . 'vikbooking' . '/' . 'media' . '/'; |
| 84 |
|
| 85 |
// define proper values for the media assets (i.e. Web App Manifest) |
| 86 |
$media_assets_base_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'vikbooking'; |
| 87 |
$media_assets_base_uri = rtrim($upload_dir['baseurl'], '/') . '/' . 'vikbooking' . '/'; |
| 88 |
} |
| 89 |
|
| 90 |
/** |
| 91 |
* We define the base path constant for the upload dir |
| 92 |
* used to upload the customer documents onto the sub-dirs. |
| 93 |
* |
| 94 |
* @since 1.3.0 |
| 95 |
*/ |
| 96 |
defined('VBO_CUSTOMERS_PATH') or define('VBO_CUSTOMERS_PATH', $customer_upload_base_path); |
| 97 |
defined('VBO_CUSTOMERS_URI') or define('VBO_CUSTOMERS_URI', $customer_upload_base_uri); |
| 98 |
|
| 99 |
/** |
| 100 |
* We define the base path and URI for the media dir. |
| 101 |
* |
| 102 |
* @since 1.5.0 |
| 103 |
*/ |
| 104 |
defined('VBO_MEDIA_PATH') or define('VBO_MEDIA_PATH', $media_upload_base_path); |
| 105 |
defined('VBO_MEDIA_URI') or define('VBO_MEDIA_URI', $media_upload_base_uri); |
| 106 |
|
| 107 |
/** |
| 108 |
* We define the base path and URI for the media assets. |
| 109 |
* |
| 110 |
* @since 1.6.5 |
| 111 |
*/ |
| 112 |
defined('VBO_MEDIA_ASSETS_PATH') or define('VBO_MEDIA_ASSETS_PATH', $media_assets_base_path); |
| 113 |
defined('VBO_MEDIA_ASSETS_URI') or define('VBO_MEDIA_ASSETS_URI', $media_assets_base_uri); |
| 114 |
|
| 115 |
/** |
| 116 |
* Site pre-process flag. |
| 117 |
* When this flag is enabled, the plugin will try to dispatch the |
| 118 |
* site controller within the "init" action. This is made by |
| 119 |
* fetching the shortcode assigned to the current URI. |
| 120 |
* |
| 121 |
* By disabling this flag, the site controller will be dispatched |
| 122 |
* with the headers already sent. |
| 123 |
*/ |
| 124 |
define('VIKBOOKING_SITE_PREPROCESS', true); |
| 125 |
|