@@ -1,8 +1,8 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | |
| 3 | 3 | /* Check if file is include. No direct access possible with file url */ |
| 4 | -if ( !defined( 'WPSHOP_VERSION' ) ) { |
|
| 5 | - die( __('Access is not allowed by this way', 'wpshop') ); |
|
| 4 | +if (!defined('WPSHOP_VERSION')) { |
|
| 5 | + die(__('Access is not allowed by this way', 'wpshop')); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | /** |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $wpshop_db_content_update = array(); |
| 22 | 22 | $wpshop_db_options_add = array(); |
| 23 | 23 | $wpshop_db_options_update = array(); |
| 24 | -$wpshop_db_delete= array(); |
|
| 24 | +$wpshop_db_delete = array(); |
|
| 25 | 25 | $wpshop_db_version = 0; |
| 26 | 26 | |
| 27 | 27 | {/* Version 0 */ |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | $wpshop_eav_content[$wpshop_db_version]['attributes'][] = WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT; |
| 77 | 77 | |
| 78 | 78 | /* Default attribute group */ |
| 79 | - $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'important_datas', 'name' => __('Product', 'wpshop'), 'details' => array( 'product_attribute_set_id', 'barcode', 'product_price', 'tx_tva', 'manage_stock', 'product_stock', 'product_weight'), 'backend_display_type' => 'movable-tab' ); |
|
| 79 | + $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'important_datas', 'name' => __('Product', 'wpshop'), 'details' => array('product_attribute_set_id', 'barcode', 'product_price', 'tx_tva', 'manage_stock', 'product_stock', 'product_weight'), 'backend_display_type' => 'movable-tab'); |
|
| 80 | 80 | $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'general', 'name' => __('Main information', 'wpshop'), 'details' => array('product_reference', 'cost_of_postage',)); |
| 81 | 81 | $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'feature', 'name' => __('Feature', 'wpshop'), 'details' => array('product_height', 'product_width')); |
| 82 | 82 | $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('code' => 'additionnal_informations', 'name' => __('Additionnal informations', 'wpshop'), 'details' => array()); |
| 83 | 83 | |
| 84 | - $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array( 'name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array( 'price_ht', 'tva', )); |
|
| 84 | + $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['default'][] = array('name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array('price_ht', 'tva',)); |
|
| 85 | 85 | |
| 86 | 86 | /* Update attribute with default unit */ |
| 87 | 87 | $wpshop_db_content_update[$wpshop_db_version][WPSHOP_DBT_ATTRIBUTE][] = array('datas' => array('last_update_date' => current_time('mysql', 0), '_unit_group_id' => 1, '_default_unit' => 2), 'where' => array('code' => 'product_height')); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | /* Add shop type */ |
| 164 | 164 | $current_db_version = get_option('wpshop_db_options', 0); |
| 165 | - if(!empty($current_db_version) && $current_db_version['db_version'] >= $wpshop_db_version){ |
|
| 165 | + if (!empty($current_db_version) && $current_db_version['db_version'] >= $wpshop_db_version) { |
|
| 166 | 166 | $wpshop_db_options_add[$wpshop_db_version]['wpshop_shop_type'] = 'sale'; |
| 167 | 167 | $wpshop_db_options_update[$wpshop_db_version]['wpshop_db_options']['installation_state'] = 'completed'; |
| 168 | 168 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $wpshop_db_content_update[$wpshop_db_version][WPSHOP_DBT_ATTRIBUTE_GROUP][] = array('datas' => array('last_update_date' => current_time('mysql', 0), 'used_in_shop_type' => 'sale'), 'where' => array('code' => 'shipping')); |
| 183 | 183 | |
| 184 | 184 | /* Delete useless option */ |
| 185 | - $wpshop_db_delete[$wpshop_db_version][] = $wpdb->prepare("DELETE FROM ".$wpdb->options." WHERE option_name=%s", 'wpshop_shop_currencies'); |
|
| 185 | + $wpshop_db_delete[$wpshop_db_version][] = $wpdb->prepare("DELETE FROM " . $wpdb->options . " WHERE option_name=%s", 'wpshop_shop_currencies'); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | {/* Version 20 - Version 1.3.1.9 */ |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $wpshop_eav_content[$wpshop_db_version]['attributes'][] = WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS; |
| 228 | 228 | |
| 229 | - $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS][__('Billing address', 'wpshop')][] = array('code' => 'billing_address', 'name' => __('Billing address', 'wpshop'), 'details' => array( 'address_title', 'civility', 'address_last_name', 'address_first_name', 'company', 'tva_intra', 'address_user_email', 'address', 'postcode', 'city', 'country', 'state', 'phone', 'longitude', 'latitude')); |
|
| 229 | + $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS][__('Billing address', 'wpshop')][] = array('code' => 'billing_address', 'name' => __('Billing address', 'wpshop'), 'details' => array('address_title', 'civility', 'address_last_name', 'address_first_name', 'company', 'tva_intra', 'address_user_email', 'address', 'postcode', 'city', 'country', 'state', 'phone', 'longitude', 'latitude')); |
|
| 230 | 230 | $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS][__('Shipping address', 'wpshop')][] = array('code' => 'shipping_address', 'name' => __('Shipping address', 'wpshop'), 'details' => array('address_title', 'civility', 'address_last_name', 'address_first_name', 'company', 'address', 'postcode', 'city', 'country', 'state', 'longitude', 'latitude')); |
| 231 | 231 | |
| 232 | - $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS][__('Account', 'wpshop')][] = array('code' => 'account', 'name' => __('Account', 'wpshop'), 'details' => array( 'user_login', 'user_pass', 'last_name', 'first_name', 'user_email' )); |
|
| 232 | + $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS][__('Account', 'wpshop')][] = array('code' => 'account', 'name' => __('Account', 'wpshop'), 'details' => array('user_login', 'user_pass', 'last_name', 'first_name', 'user_email')); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | {/* Version 40 - Version 1.3.5.4 */ |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | {/* Version 60 - Version 1.3.9.8 */ |
| 252 | 252 | $wpshop_db_version = 60; |
| 253 | 253 | |
| 254 | - $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['free_product'][] = array( 'name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array('price_ht', 'product_price', 'tx_tva', 'tva')); |
|
| 254 | + $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['free_product'][] = array('name' => __('Prices', 'wpshop'), 'code' => 'prices', 'details' => array('price_ht', 'product_price', 'tx_tva', 'tva')); |
|
| 255 | 255 | $wpshop_eav_content[$wpshop_db_version]['attribute_groups'][WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT]['free_product'][] = array('code' => 'general', 'name' => __('Main information', 'wpshop'), 'details' => array('product_reference', 'barcode')); |
| 256 | 256 | } |
| 257 | 257 | |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | /* Check if file is include. No direct access possible with file url */ |
| 4 | 6 | if ( !defined( 'WPSHOP_VERSION' ) ) { |
@@ -301,8 +301,8 @@ |
||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
| 304 | - * Admin javascript "header script" part definition |
|
| 305 | - */ |
|
| 304 | + * Admin javascript "header script" part definition |
|
| 305 | + */ |
|
| 306 | 306 | function admin_css_head() { |
| 307 | 307 | ob_start(); |
| 308 | 308 | include(WPSHOP_CSS_DIR . 'pages/wpshop_product.css'); |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | |
| 3 | 5 | /* Check if file is include. No direct access possible with file url */ |
| 4 | 6 | if ( !defined( 'WPSHOP_VERSION' ) ) { |
@@ -519,7 +521,9 @@ discard block |
||
| 519 | 521 | $to_exclude=unserialize(WPSHOP_INTERNAL_TYPES_TO_EXCLUDE); |
| 520 | 522 | if(!empty($to_exclude)): |
| 521 | 523 | foreach($to_exclude as $excluded_type): |
| 522 | - if(isset($wp_types[$excluded_type]))unset($wp_types[$excluded_type]); |
|
| 524 | + if(isset($wp_types[$excluded_type])) { |
|
| 525 | + unset($wp_types[$excluded_type]); |
|
| 526 | + } |
|
| 523 | 527 | endforeach; |
| 524 | 528 | endif; |
| 525 | 529 | DEFINE('WPSHOP_INTERNAL_TYPES', serialize(array_merge($wp_types, array('users' => __('Users', 'wpshop'))))); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | |
| 3 | 3 | /* Check if file is include. No direct access possible with file url */ |
| 4 | -if ( !defined( 'WPSHOP_VERSION' ) ) { |
|
| 5 | - die( __('Access is not allowed by this way', 'wpshop') ); |
|
| 4 | +if (!defined('WPSHOP_VERSION')) { |
|
| 5 | + die(__('Access is not allowed by this way', 'wpshop')); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | /** |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * @package wpshop |
| 23 | 23 | * @subpackage librairies |
| 24 | 24 | */ |
| 25 | -class wpshop_init{ |
|
| 25 | +class wpshop_init { |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * This is the function loaded when wordpress load the different plugin |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | /* Include head js */ |
| 41 | 41 | add_action('admin_print_scripts', array('wpshop_init', 'admin_print_js')); |
| 42 | 42 | |
| 43 | - $page = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : ''; |
|
| 44 | - $post_type = !empty( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : ''; |
|
| 45 | - $action = !empty( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : ''; |
|
| 46 | - $post = !empty( $_GET['post'] ) ? (array) $_GET['post'] : ''; |
|
| 47 | - $taxonomy = !empty( $_GET['taxonomy'] ) ? sanitize_text_field( $_GET['taxonomy'] ) : ''; |
|
| 48 | - if((isset($page) && substr($page, 0, 7) == 'wpshop_') || (isset($page) && $page == 'wps-installer' ) || (isset($post_type) && substr($post_type, 0, 7) == 'wpshop_') || !empty($post) || (isset($page) && $page==WPSHOP_NEWTYPE_IDENTIFIER_GROUP) || (isset($taxonomy) && ($taxonomy == WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES))){ |
|
| 43 | + $page = !empty($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; |
|
| 44 | + $post_type = !empty($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : ''; |
|
| 45 | + $action = !empty($_GET['action']) ? sanitize_text_field($_GET['action']) : ''; |
|
| 46 | + $post = !empty($_GET['post']) ? (array)$_GET['post'] : ''; |
|
| 47 | + $taxonomy = !empty($_GET['taxonomy']) ? sanitize_text_field($_GET['taxonomy']) : ''; |
|
| 48 | + if ((isset($page) && substr($page, 0, 7) == 'wpshop_') || (isset($page) && $page == 'wps-installer') || (isset($post_type) && substr($post_type, 0, 7) == 'wpshop_') || !empty($post) || (isset($page) && $page == WPSHOP_NEWTYPE_IDENTIFIER_GROUP) || (isset($taxonomy) && ($taxonomy == WPSHOP_NEWTYPE_IDENTIFIER_CATEGORIES))) { |
|
| 49 | 49 | /* Include the different javascript */ |
| 50 | 50 | // add_action('admin_init', array('wpshop_init', 'admin_js')); |
| 51 | - add_action( 'admin_enqueue_scripts', array('wpshop_init', 'admin_js') ); |
|
| 51 | + add_action('admin_enqueue_scripts', array('wpshop_init', 'admin_js')); |
|
| 52 | 52 | add_action('admin_footer', array('wpshop_init', 'admin_js_footer')); |
| 53 | 53 | |
| 54 | 54 | /* Include the different css */ |
@@ -57,27 +57,27 @@ discard block |
||
| 57 | 57 | add_action('admin_init', array('wpshop_init', 'admin_css')); |
| 58 | 58 | |
| 59 | 59 | /* Include the different css */ |
| 60 | - if ( !is_admin() ) { |
|
| 60 | + if (!is_admin()) { |
|
| 61 | 61 | add_action('wp_print_styles', array('wpshop_init', 'frontend_css')); |
| 62 | 62 | add_action('wp_print_scripts', array('wpshop_init', 'frontend_js_instruction')); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if (isset($page,$action) && $page=='wpshop_doc' && $action=='edit') { |
|
| 65 | + if (isset($page, $action) && $page == 'wpshop_doc' && $action == 'edit') { |
|
| 66 | 66 | add_action('admin_init', array('wpshop_doc', 'init_wysiwyg')); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // RICH TEXT EDIT INIT |
| 70 | - add_action('init', array('wpshop_display','wpshop_rich_text_tags'), 9999); |
|
| 71 | - add_action('init', array('wpshop_display','wps_hide_admin_bar_for_customers'), 9999 ); |
|
| 70 | + add_action('init', array('wpshop_display', 'wpshop_rich_text_tags'), 9999); |
|
| 71 | + add_action('init', array('wpshop_display', 'wps_hide_admin_bar_for_customers'), 9999); |
|
| 72 | 72 | |
| 73 | 73 | /** Adda custom class to the admin body */ |
| 74 | - add_filter( 'admin_body_class', array( 'wpshop_init', 'admin_body_class' ) ); |
|
| 74 | + add_filter('admin_body_class', array('wpshop_init', 'admin_body_class')); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Admin menu creation |
| 79 | 79 | */ |
| 80 | - public static function admin_menu(){ |
|
| 80 | + public static function admin_menu() { |
|
| 81 | 81 | global $menu; |
| 82 | 82 | |
| 83 | 83 | /* Get current plugin version */ |
@@ -85,17 +85,17 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $wpshop_catalog_menu_order = 34; |
| 87 | 87 | |
| 88 | - $menu[ $wpshop_catalog_menu_order-1 ] = array( '', 'read', 'separator-wpshop_dashboard', '', 'wp-menu-separator wpshop_dashboard' ); |
|
| 88 | + $menu[$wpshop_catalog_menu_order - 1] = array('', 'read', 'separator-wpshop_dashboard', '', 'wp-menu-separator wpshop_dashboard'); |
|
| 89 | 89 | |
| 90 | 90 | /* Main menu creation */ |
| 91 | 91 | global $wps_dashboard_ctr; |
| 92 | - add_menu_page(__( 'Dashboard', 'wpshop' ), __( 'Shop', 'wpshop' ), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array( $wps_dashboard_ctr, 'display_dashboard' ), 'dashicons-admin-home', $wpshop_catalog_menu_order); |
|
| 93 | - add_submenu_page(WPSHOP_URL_SLUG_DASHBOARD, __('Dashboard', 'wpshop' ), __('Dashboard', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array( $wps_dashboard_ctr, 'display_dashboard' )); |
|
| 92 | + add_menu_page(__('Dashboard', 'wpshop'), __('Shop', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array($wps_dashboard_ctr, 'display_dashboard'), 'dashicons-admin-home', $wpshop_catalog_menu_order); |
|
| 93 | + add_submenu_page(WPSHOP_URL_SLUG_DASHBOARD, __('Dashboard', 'wpshop'), __('Dashboard', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_URL_SLUG_DASHBOARD, array($wps_dashboard_ctr, 'display_dashboard')); |
|
| 94 | 94 | |
| 95 | 95 | /* Add eav model menus */ |
| 96 | - add_menu_page(__( 'Entities', 'wpshop' ), __( 'Entities', 'wpshop' ), 'wpshop_view_dashboard', WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, array('wpshop_display', 'display_page'), 'dashicons-universal-access-alt', $wpshop_catalog_menu_order + 1); |
|
| 97 | - add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __( 'Attributes', 'wpshop' ), __('Attributes', 'wpshop'), 'wpshop_view_attributes', WPSHOP_URL_SLUG_ATTRIBUTE_LISTING, array('wpshop_display','display_page')); |
|
| 98 | - add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __( 'Attributes groups', 'wpshop' ), __('Attributes groups', 'wpshop'), 'wpshop_view_attribute_set', WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING, array('wpshop_display','display_page')); |
|
| 96 | + add_menu_page(__('Entities', 'wpshop'), __('Entities', 'wpshop'), 'wpshop_view_dashboard', WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, array('wpshop_display', 'display_page'), 'dashicons-universal-access-alt', $wpshop_catalog_menu_order + 1); |
|
| 97 | + add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __('Attributes', 'wpshop'), __('Attributes', 'wpshop'), 'wpshop_view_attributes', WPSHOP_URL_SLUG_ATTRIBUTE_LISTING, array('wpshop_display', 'display_page')); |
|
| 98 | + add_submenu_page(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, __('Attributes groups', 'wpshop'), __('Attributes groups', 'wpshop'), 'wpshop_view_attribute_set', WPSHOP_URL_SLUG_ATTRIBUTE_SET_LISTING, array('wpshop_display', 'display_page')); |
|
| 99 | 99 | |
| 100 | 100 | /* Add messages menus */ |
| 101 | 101 | //add_submenu_page(WPSHOP_URL_SLUG_DASHBOARD, __( 'Messages', 'wpshop' ), __( 'Messages', 'wpshop'), 'wpshop_view_messages', 'edit.php?post_type='.WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | /* Add a menu for plugin tools */ |
| 106 | 106 | // if (WPSHOP_DISPLAY_TOOLS_MENU) { |
| 107 | - add_management_page( __('Wpshop - Tools', 'wpshop' ), __('Wpshop - Tools', 'wpshop' ), 'wpshop_view_tools_menu', WPSHOP_URL_SLUG_TOOLS , array('wpshop_tools', 'main_page')); |
|
| 107 | + add_management_page(__('Wpshop - Tools', 'wpshop'), __('Wpshop - Tools', 'wpshop'), 'wpshop_view_tools_menu', WPSHOP_URL_SLUG_TOOLS, array('wpshop_tools', 'main_page')); |
|
| 108 | 108 | // } |
| 109 | 109 | |
| 110 | 110 | /* Add the options menu */ |
@@ -118,29 +118,29 @@ discard block |
||
| 118 | 118 | $wpshop_menu_order = array(); |
| 119 | 119 | |
| 120 | 120 | // Get the index of our custom separator |
| 121 | - $separator = array_search( 'separator-wpshop_dashboard', $menu_order ); |
|
| 122 | - $product = array_search( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, $menu_order ); |
|
| 123 | - $order = array_search( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $menu_order ); |
|
| 124 | - $customers = array_search( 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, $menu_order ); |
|
| 121 | + $separator = array_search('separator-wpshop_dashboard', $menu_order); |
|
| 122 | + $product = array_search('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, $menu_order); |
|
| 123 | + $order = array_search('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $menu_order); |
|
| 124 | + $customers = array_search('edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, $menu_order); |
|
| 125 | 125 | //$entities = array_search( 'admin.php?page=' . WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, $menu_order ); |
| 126 | - $entities = array_search( WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, $menu_order ); |
|
| 126 | + $entities = array_search(WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, $menu_order); |
|
| 127 | 127 | |
| 128 | - unset( $menu_order[$separator] ); |
|
| 129 | - unset( $menu_order[$product] ); |
|
| 130 | - unset( $menu_order[$order] ); |
|
| 131 | - unset( $menu_order[$customers] ); |
|
| 132 | - unset( $menu_order[$entities] ); |
|
| 128 | + unset($menu_order[$separator]); |
|
| 129 | + unset($menu_order[$product]); |
|
| 130 | + unset($menu_order[$order]); |
|
| 131 | + unset($menu_order[$customers]); |
|
| 132 | + unset($menu_order[$entities]); |
|
| 133 | 133 | |
| 134 | 134 | // Loop through menu order and do some rearranging |
| 135 | - foreach ( $menu_order as $index => $item ) : |
|
| 136 | - if ( 'wpshop_dashboard' == $item ) : |
|
| 135 | + foreach ($menu_order as $index => $item) : |
|
| 136 | + if ('wpshop_dashboard' == $item) : |
|
| 137 | 137 | $wpshop_menu_order[] = 'separator-wpshop_dashboard'; |
| 138 | 138 | $wpshop_menu_order[] = $item; |
| 139 | 139 | $wpshop_menu_order[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT; |
| 140 | 140 | $wpshop_menu_order[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER; |
| 141 | 141 | $wpshop_menu_order[] = 'edit.php?post_type=' . WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS; |
| 142 | 142 | $wpshop_menu_order[] = WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES; |
| 143 | - elseif ( !in_array( $item, array( 'separator-wpshop_dashboard' ) ) ) : |
|
| 143 | + elseif (!in_array($item, array('separator-wpshop_dashboard'))) : |
|
| 144 | 144 | $wpshop_menu_order[] = $item; |
| 145 | 145 | endif; |
| 146 | 146 | endforeach; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | public static function admin_custom_menu_order() { |
| 153 | - return current_user_can( 'manage_options' ); |
|
| 153 | + return current_user_can('manage_options'); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -160,18 +160,18 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | /* Désactivation de l'enregistrement automatique pour certains type de post */ |
| 162 | 162 | global $post; |
| 163 | - if ( $post && ( (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ORDER) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE) |
|
| 164 | - || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_COUPON) ) ) { |
|
| 163 | + if ($post && ((get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ORDER) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE) |
|
| 164 | + || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES) || (get_post_type($post->ID) === WPSHOP_NEWTYPE_IDENTIFIER_COUPON))) { |
|
| 165 | 165 | wp_dequeue_script('autosave'); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - $entity_to_search = !empty( $_GET['entity_to_search'] ) ? sanitize_text_field( $_GET['entity_to_search'] ) : ''; |
|
| 168 | + $entity_to_search = !empty($_GET['entity_to_search']) ? sanitize_text_field($_GET['entity_to_search']) : ''; |
|
| 169 | 169 | // var WPSHOP_AJAX_FILE_URL = "'.WPSHOP_AJAX_FILE_URL.'"; |
| 170 | 170 | echo ' |
| 171 | 171 | <script type="text/javascript"> |
| 172 | 172 | |
| 173 | - var WPSHOP_MEDIAS_ICON_URL = "'.WPSHOP_MEDIAS_ICON_URL.'"; |
|
| 174 | - var WPSHOP_PRODUCT_PRICE_PILOT = "'.WPSHOP_PRODUCT_PRICE_PILOT.'"; |
|
| 173 | + var WPSHOP_MEDIAS_ICON_URL = "'.WPSHOP_MEDIAS_ICON_URL . '"; |
|
| 174 | + var WPSHOP_PRODUCT_PRICE_PILOT = "'.WPSHOP_PRODUCT_PRICE_PILOT . '"; |
|
| 175 | 175 | var WPSHOP_PRODUCT_PRICE_HT = "' . WPSHOP_PRODUCT_PRICE_HT . '"; |
| 176 | 176 | var WPSHOP_PRODUCT_PRICE_TAX = "' . WPSHOP_PRODUCT_PRICE_TAX . '"; |
| 177 | 177 | var WPSHOP_PRODUCT_PRICE_TTC = "' . WPSHOP_PRODUCT_PRICE_TTC . '"; |
@@ -187,16 +187,16 @@ discard block |
||
| 187 | 187 | var WPSHOP_JS_VAR_ADD_LOGO = "' . __('Upload your logo', 'wpshop') . '"; |
| 188 | 188 | var WPSHOP_NEWOPTION_CREATION_NONCE = "' . wp_create_nonce("wpshop_new_option_for_attribute_creation") . '"; |
| 189 | 189 | |
| 190 | - var WPSHOP_ADD_TEXT = "'.__('Add', 'wpshop').'"; |
|
| 191 | - var WPSHOP_CREATE_TEXT = "'.__('Create', 'wpshop').'"; |
|
| 192 | - var WPSHOP_SAVE_PRODUCT_OPTIONS_PARAMS = "'.__('Save parameters', 'wpshop').'"; |
|
| 190 | + var WPSHOP_ADD_TEXT = "'.__('Add', 'wpshop') . '"; |
|
| 191 | + var WPSHOP_CREATE_TEXT = "'.__('Create', 'wpshop') . '"; |
|
| 192 | + var WPSHOP_SAVE_PRODUCT_OPTIONS_PARAMS = "'.__('Save parameters', 'wpshop') . '"; |
|
| 193 | 193 | |
| 194 | - var WPSHOP_NEW_OPTION_IN_LIST_EMPTY = "'.__('You don\'t specify all needed file', 'wpshop').'"; |
|
| 195 | - var WPSHOP_IS_NOT_ALLOWED_SHIPPING_COUNTRY = "'.__('Sorry ! You can\'t order on this shop, because we don\'t ship in your country.', 'wpshop').'"; |
|
| 196 | - var WPSHOP_CONFIRM_BEFORE_GENERATE_INVOICE = "'.__('If you generate the invoice, you will cannot modify this order later. Are you sure to do this action ?', 'wpshop').'"; |
|
| 197 | - var WPSHOP_NEW_OPTION_ALREADY_EXIST_IN_LIST = "'.__('The value you entered already exist in list', 'wpshop').'"; |
|
| 198 | - var WPSHOP_SURE_TO_DELETE_ATTR_OPTION_FROM_LIST = "'.__('Are you sure you want to delete this option from list?', 'wpshop').'"; |
|
| 199 | - var WPSHOP_DEFAULT_VALUE = "'.__('Set as default value', 'wpshop').'"; |
|
| 194 | + var WPSHOP_NEW_OPTION_IN_LIST_EMPTY = "'.__('You don\'t specify all needed file', 'wpshop') . '"; |
|
| 195 | + var WPSHOP_IS_NOT_ALLOWED_SHIPPING_COUNTRY = "'.__('Sorry ! You can\'t order on this shop, because we don\'t ship in your country.', 'wpshop') . '"; |
|
| 196 | + var WPSHOP_CONFIRM_BEFORE_GENERATE_INVOICE = "'.__('If you generate the invoice, you will cannot modify this order later. Are you sure to do this action ?', 'wpshop') . '"; |
|
| 197 | + var WPSHOP_NEW_OPTION_ALREADY_EXIST_IN_LIST = "'.__('The value you entered already exist in list', 'wpshop') . '"; |
|
| 198 | + var WPSHOP_SURE_TO_DELETE_ATTR_OPTION_FROM_LIST = "'.__('Are you sure you want to delete this option from list?', 'wpshop') . '"; |
|
| 199 | + var WPSHOP_DEFAULT_VALUE = "'.__('Set as default value', 'wpshop') . '"; |
|
| 200 | 200 | var WPSHOP_MSG_INVOICE_QUOTATION = "' . __('Are you sure you want to charge this order? You\'ll be unable to modify the content after this operation', 'wpshop') . '"; |
| 201 | 201 | var WPSHOP_MSG_IGNORE_CONFIGURATION = "' . __('If you continue without install the plugin. Your products won\'t be purchasable', 'wpshop') . '"; |
| 202 | 202 | var WPSHOP_MSG_CONFIRM_THUMBNAIL_DELETION = "' . __('Are you sure you want to delete this thumbnail?', 'wpshop') . '"; |
@@ -205,55 +205,55 @@ discard block |
||
| 205 | 205 | var WPSHOP_CHOSEN_SELECT_FROM_LIST = "' . __('Select an Option', 'wpshop') . '"; |
| 206 | 206 | var WPSHOP_AJAX_CHOSEN_KEEP_TYPING = "' . __('Keep typing for search launching', 'wpshop') . '"; |
| 207 | 207 | var WPSHOP_AJAX_CHOSEN_SEARCHING = "' . __('Searching in progress for', 'wpshop') . '"; |
| 208 | - var WPSHOP_MSG_CONFIRM_ADDON_DEACTIVATION = "'.__('Are you sure you want to deactivate this addon?', 'wpshop').'"; |
|
| 209 | - var WPS_DELETE_SHOP_LOGO_MSG = "'.__('Are you sure you want to delete this logo?', 'wpshop').'"; |
|
| 208 | + var WPSHOP_MSG_CONFIRM_ADDON_DEACTIVATION = "'.__('Are you sure you want to deactivate this addon?', 'wpshop') . '"; |
|
| 209 | + var WPS_DELETE_SHOP_LOGO_MSG = "'.__('Are you sure you want to delete this logo?', 'wpshop') . '"; |
|
| 210 | 210 | var WPS_DEFAULT_LOGO = "'.WPSHOP_MEDIAS_IMAGES_URL . 'no_picture.png"; |
| 211 | 211 | |
| 212 | - var WPSHOP_NO_ATTRIBUTES_SELECT_FOR_VARIATION = "'.__('You have to select at least one attribute for creating a new variation', 'wpshop').'"; |
|
| 212 | + var WPSHOP_NO_ATTRIBUTES_SELECT_FOR_VARIATION = "'.__('You have to select at least one attribute for creating a new variation', 'wpshop') . '"; |
|
| 213 | 213 | |
| 214 | 214 | var WPSHOP_CHOSEN_ATTRS = {disable_search_threshold: 5, no_results_text: WPSHOP_CHOSEN_NO_RESULT, placeholder_text_single : WPSHOP_CHOSEN_SELECT_FROM_LIST, placeholder_text_multiple : WPSHOP_CHOSEN_SELECT_FROM_MULTI_LIST}; |
| 215 | 215 | |
| 216 | - var WPSHOP_TEMPLATES_URL = "'.WPSHOP_TEMPLATES_URL.'"; |
|
| 217 | - var WPSHOP_BUTTON_DESCRIPTION = "'.__('Insert shortcode into page content', 'wpshop').'"; |
|
| 218 | - var WPSHOP_WYSIWYG_MENU_TITLE_PRODUCT_LISTING = "'.__('Product listing', 'wpshop').'"; |
|
| 219 | - var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_PID_TITLE = "'.__('By product ID', 'wpshop').'"; |
|
| 220 | - var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_ATTRIBUTE_TITLE = "'.__('By attribute value', 'wpshop').'"; |
|
| 221 | - var WPSHOP_WYSIWYG_MENU_TITLE_CATEGORIES = "'.__('WPShop categories', 'wpshop').'"; |
|
| 222 | - var WPSHOP_WYSIWYG_MENU_TITLE_ATTRIBUTE_VALUE = "'.__('Attribute value', 'wpshop').'"; |
|
| 223 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_TITLE = "'.__('Custom message content', 'wpshop').'"; |
|
| 224 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_FIRST_NAME = "'.__('Customer first name', 'wpshop').'"; |
|
| 225 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_LAST_NAME = "'.__('Customer last name', 'wpshop').'"; |
|
| 226 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_EMAIL = "'.__('Customer email', 'wpshop').'"; |
|
| 227 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ID = "'.__('Order identifer', 'wpshop').'"; |
|
| 228 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_PAYPAL_TRANSACTION_ID = "'.__('Paypal transaction ID', 'wpshop').'"; |
|
| 229 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CONTENT = "'.__('Order content', 'wpshop').'"; |
|
| 230 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CUSTOMER_PERSONNAL_INFORMATIONS = "'.__('Customer personnal informations', 'wpshop').'"; |
|
| 231 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ADDRESSES = "'.__('Order addresses', 'wpshop').'"; |
|
| 232 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_BILLING_ORDER_ADDRESS = "'.__('Billing order address', 'wpshop').'"; |
|
| 233 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_ORDER_ADDRESS = "'.__('Shipping order address', 'wpshop').'"; |
|
| 234 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_METHOD = "'.__('Shipping method', 'wpshop').'"; |
|
| 235 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_PAYMENT_METHOD = "'.__('order payment_method', 'wpshop').'"; |
|
| 236 | - var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_COMMENT = "'.__('Order customer comment', 'wpshop').'"; |
|
| 237 | - var WPSHOP_CUSTOM_TAGS_TITLE = "'.__('Wpshop custom tags', 'wpshop').'"; |
|
| 238 | - var WPSHOP_CUSTOM_TAGS_CART = "'.__('Cart', 'wpshop').'"; |
|
| 239 | - var WPSHOP_CUSTOM_TAGS_CART_MINI = "'.__('Cart widget', 'wpshop').'"; |
|
| 240 | - var WPSHOP_CUSTOM_TAGS_CHECKOUT = "'.__('Checkout', 'wpshop').'"; |
|
| 241 | - var WPSHOP_CUSTOM_TAGS_ACCOUNT = "'.__('Customer account', 'wpshop').'"; |
|
| 242 | - var WPSHOP_CUSTOM_TAGS_SHOP = "'.__('Shop', 'wpshop').'"; |
|
| 243 | - var WPSHOP_CUSTOM_TAGS_ADVANCED_SEARCH = "'.__('Advanced search', 'wpshop').'"; |
|
| 244 | - var WPSHOP_CANCEL_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to cancel this order ?', 'wpshop').'"; |
|
| 245 | - var WPSHOP_REFUND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to refund this order ?', 'wpshop').'"; |
|
| 246 | - var WPSHOP_RESEND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to resend this order to customer ?', 'wpshop').'"; |
|
| 247 | - var WPSHOP_SEARCH_IN_ORDER_EXPLAIN_MESSAGE = "'.__('You want to search in orders', 'wpshop').'"; |
|
| 248 | - var WPSHOP_SEARCH_IN_ORDER_CHOICE_CUSTOMER = "'.__('a customer', 'wpshop').'"; |
|
| 249 | - var WPSHOP_SEARCH_IN_ORDER_CHOICE_PRODUCT = "'.__('a product', 'wpshop').'"; |
|
| 250 | - var WPSHOP_SEARCH_IN_ORDER_USER_CHOICE = "'.( (!empty($entity_to_search) ) ? $entity_to_search : 'customer' ).'"; |
|
| 251 | - var WPSHOP_DELETE_ADDRESS_CONFIRMATION = "'.__( 'Do you really want to delete this address', 'wpshop' ).'"; |
|
| 252 | - |
|
| 253 | - var wps_options_shipping_weight_for_custom_fees = "'.__( 'You must enter a weight', 'wpshop' ).'"; |
|
| 254 | - var wps_options_country_choose_for_custom_fees = "'.__( 'You must a country for custom fees saving', 'wpshop' ).'"; |
|
| 255 | - var wps_options_country_postcode_choose_for_custom_fees = "'.__( 'You must choose a country or write a postcode.', 'wpshop' ).'"; |
|
| 256 | - var wps_an_error_occured = "'.__( 'An error occured', 'wpshop' ).'"; |
|
| 216 | + var WPSHOP_TEMPLATES_URL = "'.WPSHOP_TEMPLATES_URL . '"; |
|
| 217 | + var WPSHOP_BUTTON_DESCRIPTION = "'.__('Insert shortcode into page content', 'wpshop') . '"; |
|
| 218 | + var WPSHOP_WYSIWYG_MENU_TITLE_PRODUCT_LISTING = "'.__('Product listing', 'wpshop') . '"; |
|
| 219 | + var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_PID_TITLE = "'.__('By product ID', 'wpshop') . '"; |
|
| 220 | + var WPSHOP_WYSIWYG_PRODUCT_LISTING_BY_ATTRIBUTE_TITLE = "'.__('By attribute value', 'wpshop') . '"; |
|
| 221 | + var WPSHOP_WYSIWYG_MENU_TITLE_CATEGORIES = "'.__('WPShop categories', 'wpshop') . '"; |
|
| 222 | + var WPSHOP_WYSIWYG_MENU_TITLE_ATTRIBUTE_VALUE = "'.__('Attribute value', 'wpshop') . '"; |
|
| 223 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_TITLE = "'.__('Custom message content', 'wpshop') . '"; |
|
| 224 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_FIRST_NAME = "'.__('Customer first name', 'wpshop') . '"; |
|
| 225 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_LAST_NAME = "'.__('Customer last name', 'wpshop') . '"; |
|
| 226 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_EMAIL = "'.__('Customer email', 'wpshop') . '"; |
|
| 227 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ID = "'.__('Order identifer', 'wpshop') . '"; |
|
| 228 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_PAYPAL_TRANSACTION_ID = "'.__('Paypal transaction ID', 'wpshop') . '"; |
|
| 229 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CONTENT = "'.__('Order content', 'wpshop') . '"; |
|
| 230 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_CUSTOMER_PERSONNAL_INFORMATIONS = "'.__('Customer personnal informations', 'wpshop') . '"; |
|
| 231 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_ADDRESSES = "'.__('Order addresses', 'wpshop') . '"; |
|
| 232 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_BILLING_ORDER_ADDRESS = "'.__('Billing order address', 'wpshop') . '"; |
|
| 233 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_ORDER_ADDRESS = "'.__('Shipping order address', 'wpshop') . '"; |
|
| 234 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_SHIPPING_METHOD = "'.__('Shipping method', 'wpshop') . '"; |
|
| 235 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_ORDER_PAYMENT_METHOD = "'.__('order payment_method', 'wpshop') . '"; |
|
| 236 | + var WPSHOP_CUSTOM_MESSAGE_CONTENT_CUSTOMER_COMMENT = "'.__('Order customer comment', 'wpshop') . '"; |
|
| 237 | + var WPSHOP_CUSTOM_TAGS_TITLE = "'.__('Wpshop custom tags', 'wpshop') . '"; |
|
| 238 | + var WPSHOP_CUSTOM_TAGS_CART = "'.__('Cart', 'wpshop') . '"; |
|
| 239 | + var WPSHOP_CUSTOM_TAGS_CART_MINI = "'.__('Cart widget', 'wpshop') . '"; |
|
| 240 | + var WPSHOP_CUSTOM_TAGS_CHECKOUT = "'.__('Checkout', 'wpshop') . '"; |
|
| 241 | + var WPSHOP_CUSTOM_TAGS_ACCOUNT = "'.__('Customer account', 'wpshop') . '"; |
|
| 242 | + var WPSHOP_CUSTOM_TAGS_SHOP = "'.__('Shop', 'wpshop') . '"; |
|
| 243 | + var WPSHOP_CUSTOM_TAGS_ADVANCED_SEARCH = "'.__('Advanced search', 'wpshop') . '"; |
|
| 244 | + var WPSHOP_CANCEL_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to cancel this order ?', 'wpshop') . '"; |
|
| 245 | + var WPSHOP_REFUND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to refund this order ?', 'wpshop') . '"; |
|
| 246 | + var WPSHOP_RESEND_ORDER_CONFIRM_MESSAGE = "'.__('Do you want to resend this order to customer ?', 'wpshop') . '"; |
|
| 247 | + var WPSHOP_SEARCH_IN_ORDER_EXPLAIN_MESSAGE = "'.__('You want to search in orders', 'wpshop') . '"; |
|
| 248 | + var WPSHOP_SEARCH_IN_ORDER_CHOICE_CUSTOMER = "'.__('a customer', 'wpshop') . '"; |
|
| 249 | + var WPSHOP_SEARCH_IN_ORDER_CHOICE_PRODUCT = "'.__('a product', 'wpshop') . '"; |
|
| 250 | + var WPSHOP_SEARCH_IN_ORDER_USER_CHOICE = "'.((!empty($entity_to_search)) ? $entity_to_search : 'customer') . '"; |
|
| 251 | + var WPSHOP_DELETE_ADDRESS_CONFIRMATION = "'.__('Do you really want to delete this address', 'wpshop') . '"; |
|
| 252 | + |
|
| 253 | + var wps_options_shipping_weight_for_custom_fees = "'.__('You must enter a weight', 'wpshop') . '"; |
|
| 254 | + var wps_options_country_choose_for_custom_fees = "'.__('You must a country for custom fees saving', 'wpshop') . '"; |
|
| 255 | + var wps_options_country_postcode_choose_for_custom_fees = "'.__('You must choose a country or write a postcode.', 'wpshop') . '"; |
|
| 256 | + var wps_an_error_occured = "'.__('An error occured', 'wpshop') . '"; |
|
| 257 | 257 | </script>'; |
| 258 | 258 | } |
| 259 | 259 | |
@@ -268,8 +268,8 @@ discard block |
||
| 268 | 268 | ob_end_clean(); |
| 269 | 269 | |
| 270 | 270 | echo '<script type="text/javascript"> |
| 271 | - var wp_version = "'.$wp_version.'"; |
|
| 272 | - '.$wpshop_product_js.' |
|
| 271 | + var wp_version = "'.$wp_version . '"; |
|
| 272 | + '.$wpshop_product_js . ' |
|
| 273 | 273 | </script>'; |
| 274 | 274 | } |
| 275 | 275 | |
@@ -285,21 +285,21 @@ discard block |
||
| 285 | 285 | wp_enqueue_script('jquery-ui-dialog'); |
| 286 | 286 | wp_enqueue_script('jquery-form'); |
| 287 | 287 | wp_enqueue_script('jquery-ui-slider'); |
| 288 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 288 | + wp_enqueue_script('jquery-ui-autocomplete'); |
|
| 289 | 289 | wp_enqueue_script('wpshop_main_function_js', WPSHOP_JS_URL . 'main_function.js', '', WPSHOP_VERSION); |
| 290 | 290 | wp_enqueue_script('wpshop_main_js', WPSHOP_JS_URL . 'main.js', '', WPSHOP_VERSION); |
| 291 | 291 | wp_enqueue_script('wpshop_jq_datatable', WPSHOP_JS_URL . 'jquery-libs/jquery.dataTables.min.js', '', WPSHOP_VERSION); |
| 292 | - wp_enqueue_script('wpshop_jquery_chosen', WPSHOP_JS_URL . 'jquery-libs/chosen.jquery.min.js', '', WPSHOP_VERSION); |
|
| 292 | + wp_enqueue_script('wpshop_jquery_chosen', WPSHOP_JS_URL . 'jquery-libs/chosen.jquery.min.js', '', WPSHOP_VERSION); |
|
| 293 | 293 | wp_enqueue_script('jquery-effects-core'); |
| 294 | 294 | wp_enqueue_script('jquery-effects-highlight'); |
| 295 | 295 | |
| 296 | - $page = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : ''; |
|
| 296 | + $page = !empty($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; |
|
| 297 | 297 | |
| 298 | 298 | /* Include specific js file for the current page if existing */ |
| 299 | - if(isset($page) && is_file(WPSHOP_JS_DIR . 'pages/' . $page . '.js')){ |
|
| 299 | + if (isset($page) && is_file(WPSHOP_JS_DIR . 'pages/' . $page . '.js')) { |
|
| 300 | 300 | wp_enqueue_script($page . '_js', WPSHOP_JS_URL . 'pages/' . $page . '.js', '', WPSHOP_VERSION); |
| 301 | 301 | } |
| 302 | - if((isset($page) && ($page == 'wpshop_dashboard'))) { |
|
| 302 | + if ((isset($page) && ($page == 'wpshop_dashboard'))) { |
|
| 303 | 303 | wp_enqueue_script($page . '_js', WPSHOP_JS_URL . 'pages/' . WPSHOP_URL_SLUG_OPTION . '.js', '', WPSHOP_VERSION); |
| 304 | 304 | wp_register_style($page . '_css', WPSHOP_CSS_URL . 'pages/' . WPSHOP_URL_SLUG_OPTION . '.css', '', WPSHOP_VERSION); |
| 305 | 305 | wp_enqueue_style($page . '_css'); |
@@ -326,12 +326,12 @@ discard block |
||
| 326 | 326 | * @param array $classes |
| 327 | 327 | * @return string |
| 328 | 328 | */ |
| 329 | - public static function admin_body_class( $classes ) { |
|
| 329 | + public static function admin_body_class($classes) { |
|
| 330 | 330 | global $post; |
| 331 | 331 | |
| 332 | - if ( !empty($post->ID) ) { |
|
| 333 | - $post_type = get_post_type( $post->ID ); |
|
| 334 | - if ( is_admin() && in_array( $post_type, array(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION, WPSHOP_NEWTYPE_IDENTIFIER_ORDER, WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE, WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, WPSHOP_NEWTYPE_IDENTIFIER_COUPON, WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS) ) ) { |
|
| 332 | + if (!empty($post->ID)) { |
|
| 333 | + $post_type = get_post_type($post->ID); |
|
| 334 | + if (is_admin() && in_array($post_type, array(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT, WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT_VARIATION, WPSHOP_NEWTYPE_IDENTIFIER_ORDER, WPSHOP_NEWTYPE_IDENTIFIER_MESSAGE, WPSHOP_NEWTYPE_IDENTIFIER_ENTITIES, WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, WPSHOP_NEWTYPE_IDENTIFIER_COUPON, WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS))) { |
|
| 335 | 335 | $classes .= ' wpshop-admin-body wpshop-admin-post-type-' . $post_type; |
| 336 | 336 | } |
| 337 | 337 | } |
@@ -359,8 +359,8 @@ discard block |
||
| 359 | 359 | wp_enqueue_style('wpshop_chosen_css'); |
| 360 | 360 | |
| 361 | 361 | /* Include specific css file for the current page if existing */ |
| 362 | - $page = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : ''; |
|
| 363 | - if(isset($page) && is_file(WPSHOP_CSS_DIR . 'pages/' . $page . '.css')){ |
|
| 362 | + $page = !empty($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; |
|
| 363 | + if (isset($page) && is_file(WPSHOP_CSS_DIR . 'pages/' . $page . '.css')) { |
|
| 364 | 364 | wp_register_style($page . '_css', WPSHOP_CSS_URL . 'pages/' . $page . '.css', '', WPSHOP_VERSION); |
| 365 | 365 | wp_enqueue_style($page . '_css'); |
| 366 | 366 | } |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | wp_register_style('wpshop_default_wps_style_css', WPSHOP_TEMPLATES_URL . 'wpshop/css/wps_style.css', '', WPSHOP_VERSION); |
| 403 | 403 | wp_enqueue_style('wpshop_default_wps_style_css'); |
| 404 | 404 | |
| 405 | - if( file_exists( get_stylesheet_directory().'/wpshop/css/wps_style.css' ) ) { |
|
| 406 | - wp_deregister_style( 'wpshop_default_wps_style_css' ); |
|
| 405 | + if (file_exists(get_stylesheet_directory() . '/wpshop/css/wps_style.css')) { |
|
| 406 | + wp_deregister_style('wpshop_default_wps_style_css'); |
|
| 407 | 407 | wp_register_style('wps_style_css', wpshop_display::get_template_file('wps_style.css', WPSHOP_TEMPLATES_URL, 'wpshop/css', 'output', true), '', WPSHOP_VERSION); |
| 408 | 408 | wp_enqueue_style('wps_style_css', 11); |
| 409 | 409 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | wp_register_style('wps_owl_caroussel_transitions', wpshop_display::get_template_file('owl.transitions.css', WPSHOP_TEMPLATES_URL, 'wpshop/css', 'output'), '', WPSHOP_VERSION); |
| 416 | 416 | wp_enqueue_style('wps_owl_caroussel_transitions'); |
| 417 | 417 | |
| 418 | - wp_enqueue_style( 'dashicons' ); |
|
| 418 | + wp_enqueue_style('dashicons'); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /** |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | wp_enqueue_script('jquery-ui-slider'); |
| 434 | 434 | wp_enqueue_script('wpshop_frontend_main_js', wpshop_display::get_template_file('frontend_main.js', WPSHOP_TEMPLATES_URL, 'wpshop/js', 'output'), '', WPSHOP_VERSION, true); |
| 435 | 435 | // wp_enqueue_script('wpshop_jquery_jqzoom_core_js', wpshop_display::get_template_file('jquery.jqzoom-core.js', WPSHOP_TEMPLATES_URL, 'wpshop/js', 'output'), '', WPSHOP_VERSION, true); |
| 436 | - wp_enqueue_script('fancyboxmousewheel',WPSHOP_JS_URL . 'fancybox/jquery.mousewheel-3.0.4.pack.js', '', WPSHOP_VERSION, true); |
|
| 436 | + wp_enqueue_script('fancyboxmousewheel', WPSHOP_JS_URL . 'fancybox/jquery.mousewheel-3.0.4.pack.js', '', WPSHOP_VERSION, true); |
|
| 437 | 437 | wp_enqueue_script('fancybox', WPSHOP_JS_URL . 'fancybox/jquery.fancybox-1.3.4.pack.js', '', WPSHOP_VERSION, true); |
| 438 | 438 | wp_enqueue_script('jquery_address', WPSHOP_JS_URL . 'jquery-libs/jquery.address-1.5.min.js', '', WPSHOP_VERSION); |
| 439 | 439 | wp_enqueue_script('wps_api', wpshop_display::get_template_file('wps-api.js', WPSHOP_TEMPLATES_URL, 'wpshop/js', 'output'), '', WPSHOP_VERSION, true); |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | var WPSHOP_MUST_CHOOSE_SHIPPING_MODE = "<?php _e('You must to choose a shipping mode', 'wpshop'); ?>"; |
| 457 | 457 | var WPSHOP_NO_SHIPPING_MODE_AVAILABLE = "<?php _e('You can\'t order because no shipping mode is available.', 'wpshop'); ?>"; |
| 458 | 458 | var WPSHOP_LOADER_ICON_JQUERY_ADDRESS = "<img src=\"<?php echo WPSHOP_LOADING_ICON; ?>\" alt=\"Loading...\" />"; |
| 459 | - var WPSHOP_CONFIRM_DELETE_ADDRESS = "<?php _e( 'Do you really want to delete this address ?', 'wpshop' ); ?>"; |
|
| 459 | + var WPSHOP_CONFIRM_DELETE_ADDRESS = "<?php _e('Do you really want to delete this address ?', 'wpshop'); ?>"; |
|
| 460 | 460 | var wps_speed_slideUpDown = 200; |
| 461 | 461 | var MODAL_URL = '<?php echo WPSHOP_TEMPLATES_URL; ?>wpshop/modal.php'; |
| 462 | 462 | </script> |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | $product_class = new wpshop_products(); |
| 494 | 494 | add_action('save_post', array($product_class, 'save_product_custom_informations')); |
| 495 | 495 | /* Modification des paramètres de variation quand ils ne sont pas configurés individuellement */ |
| 496 | - add_filter('pre_update_option_' . 'wpshop_catalog_product_option', array('wpshop_products', 'update_wpshop_catalog_product_option'), 10, 2 ); |
|
| 496 | + add_filter('pre_update_option_' . 'wpshop_catalog_product_option', array('wpshop_products', 'update_wpshop_catalog_product_option'), 10, 2); |
|
| 497 | 497 | |
| 498 | 498 | /* Add wpshop product category term */ |
| 499 | 499 | wpshop_categories::create_product_categories(); |
@@ -501,14 +501,14 @@ discard block |
||
| 501 | 501 | /* Add wpshop message term */ |
| 502 | 502 | |
| 503 | 503 | |
| 504 | - if ( $wpshop_shop_type == 'sale' ) { |
|
| 504 | + if ($wpshop_shop_type == 'sale') { |
|
| 505 | 505 | /* Add wpshop orders term */ |
| 506 | 506 | wpshop_orders::create_orders_type(); |
| 507 | 507 | add_action('add_meta_boxes', array('wpshop_orders', 'add_meta_boxes')); |
| 508 | - add_action('manage_'.WPSHOP_NEWTYPE_IDENTIFIER_ORDER.'_posts_custom_column', array('wpshop_orders', 'orders_custom_columns'), 10, 2); |
|
| 509 | - add_filter('manage_edit-'.WPSHOP_NEWTYPE_IDENTIFIER_ORDER.'_columns', array('wpshop_orders', 'orders_edit_columns')); |
|
| 510 | - add_action('restrict_manage_posts', array('wpshop_orders', 'list_table_filters') ); |
|
| 511 | - add_filter('parse_query', array('wpshop_orders', 'list_table_filter_parse_query') ); |
|
| 508 | + add_action('manage_' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER . '_posts_custom_column', array('wpshop_orders', 'orders_custom_columns'), 10, 2); |
|
| 509 | + add_filter('manage_edit-' . WPSHOP_NEWTYPE_IDENTIFIER_ORDER . '_columns', array('wpshop_orders', 'orders_edit_columns')); |
|
| 510 | + add_action('restrict_manage_posts', array('wpshop_orders', 'list_table_filters')); |
|
| 511 | + add_filter('parse_query', array('wpshop_orders', 'list_table_filter_parse_query')); |
|
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | $args = array( |
@@ -518,14 +518,14 @@ discard block |
||
| 518 | 518 | $output = 'objects'; // names or objects, note names is the default |
| 519 | 519 | $operator = 'or'; // 'and' or 'or' |
| 520 | 520 | |
| 521 | - $wp_types_original=get_post_types($args,$output,$operator); |
|
| 521 | + $wp_types_original = get_post_types($args, $output, $operator); |
|
| 522 | 522 | foreach ($wp_types_original as $type => $type_definition): |
| 523 | 523 | $wp_types[$type] = $type_definition->labels->name; |
| 524 | 524 | endforeach; |
| 525 | - $to_exclude=unserialize(WPSHOP_INTERNAL_TYPES_TO_EXCLUDE); |
|
| 526 | - if(!empty($to_exclude)): |
|
| 527 | - foreach($to_exclude as $excluded_type): |
|
| 528 | - if(isset($wp_types[$excluded_type]))unset($wp_types[$excluded_type]); |
|
| 525 | + $to_exclude = unserialize(WPSHOP_INTERNAL_TYPES_TO_EXCLUDE); |
|
| 526 | + if (!empty($to_exclude)): |
|
| 527 | + foreach ($to_exclude as $excluded_type): |
|
| 528 | + if (isset($wp_types[$excluded_type]))unset($wp_types[$excluded_type]); |
|
| 529 | 529 | endforeach; |
| 530 | 530 | endif; |
| 531 | 531 | DEFINE('WPSHOP_INTERNAL_TYPES', serialize(array_merge($wp_types, array('users' => __('Users', 'wpshop'))))); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : unicode_data.php |
| 4 | 4 | // Begin : 2008-01-01 |
@@ -17855,7 +17855,7 @@ discard block |
||
| 17855 | 17855 | * at http://www.unicode.org/unicode/reports/tr9/ |
| 17856 | 17856 | */ |
| 17857 | 17857 | global $unicode_mirror; |
| 17858 | -$unicode_mirror = array ( |
|
| 17858 | +$unicode_mirror = array( |
|
| 17859 | 17859 | 0x0028=>0x0029, |
| 17860 | 17860 | 0x0029=>0x0028, |
| 17861 | 17861 | 0x003C=>0x003E, |
@@ -18298,7 +18298,7 @@ discard block |
||
| 18298 | 18298 | * char code=>isolated, final, initial, medial |
| 18299 | 18299 | */ |
| 18300 | 18300 | global $laa_array; |
| 18301 | -$laa_array = array ( |
|
| 18301 | +$laa_array = array( |
|
| 18302 | 18302 | 1570 =>array(65269, 65270, 65269, 65270), |
| 18303 | 18303 | 1571 =>array(65271, 65272, 65271, 65272), |
| 18304 | 18304 | 1573 =>array(65273, 65274, 65273, 65274), |
@@ -18312,7 +18312,7 @@ discard block |
||
| 18312 | 18312 | * second NSM char code=>substitution char |
| 18313 | 18313 | */ |
| 18314 | 18314 | global $diacritics; |
| 18315 | -$diacritics = array ( |
|
| 18315 | +$diacritics = array( |
|
| 18316 | 18316 | 1612=>64606, # Shadda + Dammatan |
| 18317 | 18317 | 1613=>64607, # Shadda + Kasratan |
| 18318 | 18318 | 1614=>64608, # Shadda + Fatha |
@@ -18324,23 +18324,23 @@ discard block |
||
| 18324 | 18324 | * Array of character substitutions from UTF-8 unicode to latin1 |
| 18325 | 18325 | */ |
| 18326 | 18326 | global $utf8tolatin; |
| 18327 | -$utf8tolatin = array ( |
|
| 18327 | +$utf8tolatin = array( |
|
| 18328 | 18328 | 8364=>128, # Euro1 |
| 18329 | -338=>140, # OE |
|
| 18330 | -352=>138, # Scaron |
|
| 18331 | -376=>159, # Ydieresis |
|
| 18332 | -381=>142, # Zcaron2 |
|
| 18329 | +338=>140, # OE |
|
| 18330 | +352=>138, # Scaron |
|
| 18331 | +376=>159, # Ydieresis |
|
| 18332 | +381=>142, # Zcaron2 |
|
| 18333 | 18333 | 8226=>149, # bullet3 |
| 18334 | -710=>136, # circumflex |
|
| 18334 | +710=>136, # circumflex |
|
| 18335 | 18335 | 8224=>134, # dagger |
| 18336 | 18336 | 8225=>135, # daggerdbl |
| 18337 | 18337 | 8230=>133, # ellipsis |
| 18338 | 18338 | 8212=>151, # emdash |
| 18339 | 18339 | 8211=>150, # endash |
| 18340 | -402=>131, # florin |
|
| 18340 | +402=>131, # florin |
|
| 18341 | 18341 | 8249=>139, # guilsinglleft |
| 18342 | 18342 | 8250=>155, # guilsinglright |
| 18343 | -339=>156, # oe |
|
| 18343 | +339=>156, # oe |
|
| 18344 | 18344 | 8240=>137, # perthousand |
| 18345 | 18345 | 8222=>132, # quotedblbase |
| 18346 | 18346 | 8220=>147, # quotedblleft |
@@ -18348,8 +18348,8 @@ discard block |
||
| 18348 | 18348 | 8216=>145, # quoteleft |
| 18349 | 18349 | 8217=>146, # quoteright |
| 18350 | 18350 | 8218=>130, # quotesinglbase |
| 18351 | -353=>154, # scaron |
|
| 18352 | -732=>152, # tilde |
|
| 18351 | +353=>154, # scaron |
|
| 18352 | +732=>152, # tilde |
|
| 18353 | 18353 | 8482=>153, # trademark |
| 18354 | 18354 | 382=>158 # zcaron2 |
| 18355 | 18355 | ); |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : unicode_data.php |
| 4 | 6 | // Begin : 2008-01-01 |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : eng.php |
| 4 | 4 | // Begin : 2004-03-03 |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : eng.php |
| 4 | 6 | // Begin : 2004-03-03 |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : ita.php |
| 4 | 4 | // Begin : 2004-03-03 |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : ita.php |
| 4 | 6 | // Begin : 2004-03-03 |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : tcpdf_config.php |
| 4 | 4 | // Begin : 2004-06-11 |
@@ -35,18 +35,18 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | // DOCUMENT_ROOT fix for IIS Webserver |
| 37 | 37 | if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) { |
| 38 | - if(isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 39 | - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); |
|
| 40 | - } elseif(isset($_SERVER['PATH_TRANSLATED'])) { |
|
| 41 | - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); |
|
| 42 | - } else { |
|
| 38 | + if (isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 39 | + $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF']))); |
|
| 40 | + } elseif (isset($_SERVER['PATH_TRANSLATED'])) { |
|
| 41 | + $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF']))); |
|
| 42 | + } else { |
|
| 43 | 43 | // define here your DOCUMENT_ROOT path if the previous fails |
| 44 | 44 | $_SERVER['DOCUMENT_ROOT'] = '/var/www'; |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // Automatic calculation for the following K_PATH_MAIN constant |
| 49 | - $k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config')))); |
|
| 49 | + $k_path_main = str_replace('\\', '/', realpath(substr(dirname(__FILE__), 0, 0 - strlen('config')))); |
|
| 50 | 50 | if (substr($k_path_main, -1) != '/') { |
| 51 | 51 | $k_path_main .= '/'; |
| 52 | 52 | } |
@@ -55,156 +55,156 @@ discard block |
||
| 55 | 55 | * Installation path (/var/www/tcpdf/). |
| 56 | 56 | * By default it is automatically calculated but you can also set it as a fixed string to improve performances. |
| 57 | 57 | */ |
| 58 | - define ('K_PATH_MAIN', $k_path_main); |
|
| 58 | + define('K_PATH_MAIN', $k_path_main); |
|
| 59 | 59 | |
| 60 | 60 | // Automatic calculation for the following K_PATH_URL constant |
| 61 | 61 | $k_path_url = $k_path_main; // default value for console mode |
| 62 | 62 | if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { |
| 63 | - if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') { |
|
| 63 | + if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS']) != 'off') { |
|
| 64 | 64 | $k_path_url = 'https://'; |
| 65 | 65 | } else { |
| 66 | 66 | $k_path_url = 'http://'; |
| 67 | 67 | } |
| 68 | 68 | $k_path_url .= $_SERVER['HTTP_HOST']; |
| 69 | - $k_path_url .= str_replace( '\\', '/', substr($_SERVER['PHP_SELF'], 0, -24)); |
|
| 69 | + $k_path_url .= str_replace('\\', '/', substr($_SERVER['PHP_SELF'], 0, -24)); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * URL path to tcpdf installation folder (http://localhost/tcpdf/). |
| 74 | 74 | * By default it is automatically calculated but you can also set it as a fixed string to improve performances. |
| 75 | 75 | */ |
| 76 | - define ('K_PATH_URL', $k_path_url); |
|
| 76 | + define('K_PATH_URL', $k_path_url); |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * path for PDF fonts |
| 80 | 80 | * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts |
| 81 | 81 | */ |
| 82 | - define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); |
|
| 82 | + define('K_PATH_FONTS', K_PATH_MAIN . 'fonts/'); |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * cache directory for temporary files (full path) |
| 86 | 86 | */ |
| 87 | - define ('K_PATH_CACHE', K_PATH_MAIN.'cache/'); |
|
| 87 | + define('K_PATH_CACHE', K_PATH_MAIN . 'cache/'); |
|
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * cache directory for temporary files (url path) |
| 91 | 91 | */ |
| 92 | - define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/'); |
|
| 92 | + define('K_PATH_URL_CACHE', K_PATH_URL . 'cache/'); |
|
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | *images directory |
| 96 | 96 | */ |
| 97 | - define ('K_PATH_IMAGES', K_PATH_MAIN.'images/'); |
|
| 97 | + define('K_PATH_IMAGES', K_PATH_MAIN . 'images/'); |
|
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * blank image |
| 101 | 101 | */ |
| 102 | - define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png'); |
|
| 102 | + define('K_BLANK_IMAGE', K_PATH_IMAGES . '_blank.png'); |
|
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * page format |
| 106 | 106 | */ |
| 107 | - define ('PDF_PAGE_FORMAT', 'A4'); |
|
| 107 | + define('PDF_PAGE_FORMAT', 'A4'); |
|
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * page orientation (P=portrait, L=landscape) |
| 111 | 111 | */ |
| 112 | - define ('PDF_PAGE_ORIENTATION', 'P'); |
|
| 112 | + define('PDF_PAGE_ORIENTATION', 'P'); |
|
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * document creator |
| 116 | 116 | */ |
| 117 | - define ('PDF_CREATOR', 'TCPDF'); |
|
| 117 | + define('PDF_CREATOR', 'TCPDF'); |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * document author |
| 121 | 121 | */ |
| 122 | - define ('PDF_AUTHOR', 'TCPDF'); |
|
| 122 | + define('PDF_AUTHOR', 'TCPDF'); |
|
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * header title |
| 126 | 126 | */ |
| 127 | - define ('PDF_HEADER_TITLE', 'TCPDF Example'); |
|
| 127 | + define('PDF_HEADER_TITLE', 'TCPDF Example'); |
|
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | 130 | * header description string |
| 131 | 131 | */ |
| 132 | - define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); |
|
| 132 | + define('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * image logo |
| 136 | 136 | */ |
| 137 | - define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); |
|
| 137 | + define('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); |
|
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | 140 | * header logo image width [mm] |
| 141 | 141 | */ |
| 142 | - define ('PDF_HEADER_LOGO_WIDTH', 30); |
|
| 142 | + define('PDF_HEADER_LOGO_WIDTH', 30); |
|
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | 145 | * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch] |
| 146 | 146 | */ |
| 147 | - define ('PDF_UNIT', 'mm'); |
|
| 147 | + define('PDF_UNIT', 'mm'); |
|
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | 150 | * header margin |
| 151 | 151 | */ |
| 152 | - define ('PDF_MARGIN_HEADER', 5); |
|
| 152 | + define('PDF_MARGIN_HEADER', 5); |
|
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * footer margin |
| 156 | 156 | */ |
| 157 | - define ('PDF_MARGIN_FOOTER', 10); |
|
| 157 | + define('PDF_MARGIN_FOOTER', 10); |
|
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * top margin |
| 161 | 161 | */ |
| 162 | - define ('PDF_MARGIN_TOP', 27); |
|
| 162 | + define('PDF_MARGIN_TOP', 27); |
|
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | 165 | * bottom margin |
| 166 | 166 | */ |
| 167 | - define ('PDF_MARGIN_BOTTOM', 25); |
|
| 167 | + define('PDF_MARGIN_BOTTOM', 25); |
|
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | 170 | * left margin |
| 171 | 171 | */ |
| 172 | - define ('PDF_MARGIN_LEFT', 15); |
|
| 172 | + define('PDF_MARGIN_LEFT', 15); |
|
| 173 | 173 | |
| 174 | 174 | /** |
| 175 | 175 | * right margin |
| 176 | 176 | */ |
| 177 | - define ('PDF_MARGIN_RIGHT', 15); |
|
| 177 | + define('PDF_MARGIN_RIGHT', 15); |
|
| 178 | 178 | |
| 179 | 179 | /** |
| 180 | 180 | * default main font name |
| 181 | 181 | */ |
| 182 | - define ('PDF_FONT_NAME_MAIN', 'helvetica'); |
|
| 182 | + define('PDF_FONT_NAME_MAIN', 'helvetica'); |
|
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | 185 | * default main font size |
| 186 | 186 | */ |
| 187 | - define ('PDF_FONT_SIZE_MAIN', 10); |
|
| 187 | + define('PDF_FONT_SIZE_MAIN', 10); |
|
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | 190 | * default data font name |
| 191 | 191 | */ |
| 192 | - define ('PDF_FONT_NAME_DATA', 'helvetica'); |
|
| 192 | + define('PDF_FONT_NAME_DATA', 'helvetica'); |
|
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * default data font size |
| 196 | 196 | */ |
| 197 | - define ('PDF_FONT_SIZE_DATA', 8); |
|
| 197 | + define('PDF_FONT_SIZE_DATA', 8); |
|
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | 200 | * default monospaced font name |
| 201 | 201 | */ |
| 202 | - define ('PDF_FONT_MONOSPACED', 'courier'); |
|
| 202 | + define('PDF_FONT_MONOSPACED', 'courier'); |
|
| 203 | 203 | |
| 204 | 204 | /** |
| 205 | 205 | * ratio used to adjust the conversion of pixels to user units |
| 206 | 206 | */ |
| 207 | - define ('PDF_IMAGE_SCALE_RATIO', 1.25); |
|
| 207 | + define('PDF_IMAGE_SCALE_RATIO', 1.25); |
|
| 208 | 208 | |
| 209 | 209 | /** |
| 210 | 210 | * magnification factor for titles |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | /** |
| 225 | 225 | * reduction factor for small font |
| 226 | 226 | */ |
| 227 | - define('K_SMALL_RATIO', 2/3); |
|
| 227 | + define('K_SMALL_RATIO', 2 / 3); |
|
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | 230 | * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : tcpdf_config.php |
| 4 | 6 | // Begin : 2004-06-11 |
@@ -39,7 +41,7 @@ discard block |
||
| 39 | 41 | $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); |
| 40 | 42 | } elseif(isset($_SERVER['PATH_TRANSLATED'])) { |
| 41 | 43 | $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); |
| 42 | - } else { |
|
| 44 | + } else { |
|
| 43 | 45 | // define here your DOCUMENT_ROOT path if the previous fails |
| 44 | 46 | $_SERVER['DOCUMENT_ROOT'] = '/var/www'; |
| 45 | 47 | } |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : tcpdf_config.php |
| 4 | 4 | // Begin : 2004-06-11 |
@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | // DOCUMENT_ROOT fix for IIS Webserver |
| 33 | 33 | if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) { |
| 34 | - if(isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 35 | - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); |
|
| 36 | - } elseif(isset($_SERVER['PATH_TRANSLATED'])) { |
|
| 37 | - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); |
|
| 38 | - } else { |
|
| 34 | + if (isset($_SERVER['SCRIPT_FILENAME'])) { |
|
| 35 | + $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF']))); |
|
| 36 | + } elseif (isset($_SERVER['PATH_TRANSLATED'])) { |
|
| 37 | + $_SERVER['DOCUMENT_ROOT'] = str_replace('\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF']))); |
|
| 38 | + } else { |
|
| 39 | 39 | // define here your DOCUMENT_ROOT path if the previous fails |
| 40 | 40 | $_SERVER['DOCUMENT_ROOT'] = '/var/www'; |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Automatic calculation for the following K_PATH_MAIN constant |
| 45 | -$k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config')))); |
|
| 45 | +$k_path_main = str_replace('\\', '/', realpath(substr(dirname(__FILE__), 0, 0 - strlen('config')))); |
|
| 46 | 46 | if (substr($k_path_main, -1) != '/') { |
| 47 | 47 | $k_path_main .= '/'; |
| 48 | 48 | } |
@@ -51,155 +51,155 @@ discard block |
||
| 51 | 51 | * Installation path (/var/www/tcpdf/). |
| 52 | 52 | * By default it is automatically calculated but you can also set it as a fixed string to improve performances. |
| 53 | 53 | */ |
| 54 | -define ('K_PATH_MAIN', $k_path_main); |
|
| 54 | +define('K_PATH_MAIN', $k_path_main); |
|
| 55 | 55 | |
| 56 | 56 | // Automatic calculation for the following K_PATH_URL constant |
| 57 | 57 | if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { |
| 58 | - if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') { |
|
| 58 | + if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS']) != 'off') { |
|
| 59 | 59 | $k_path_url = 'https://'; |
| 60 | 60 | } else { |
| 61 | 61 | $k_path_url = 'http://'; |
| 62 | 62 | } |
| 63 | 63 | $k_path_url .= $_SERVER['HTTP_HOST']; |
| 64 | - $k_path_url .= str_replace( '\\', '/', substr($_SERVER['PHP_SELF'], 0, -24)); |
|
| 64 | + $k_path_url .= str_replace('\\', '/', substr($_SERVER['PHP_SELF'], 0, -24)); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * URL path to tcpdf installation folder (http://localhost/tcpdf/). |
| 69 | 69 | * By default it is automatically calculated but you can also set it as a fixed string to improve performances.. |
| 70 | 70 | */ |
| 71 | -define ('K_PATH_URL', $k_path_url); |
|
| 71 | +define('K_PATH_URL', $k_path_url); |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * path for PDF fonts |
| 75 | 75 | * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts |
| 76 | 76 | */ |
| 77 | -define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); |
|
| 77 | +define('K_PATH_FONTS', K_PATH_MAIN . 'fonts/'); |
|
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * cache directory for temporary files (full path) |
| 81 | 81 | */ |
| 82 | -define ('K_PATH_CACHE', K_PATH_MAIN.'cache/'); |
|
| 82 | +define('K_PATH_CACHE', K_PATH_MAIN . 'cache/'); |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * cache directory for temporary files (url path) |
| 86 | 86 | */ |
| 87 | -define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/'); |
|
| 87 | +define('K_PATH_URL_CACHE', K_PATH_URL . 'cache/'); |
|
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | *images directory |
| 91 | 91 | */ |
| 92 | -define ('K_PATH_IMAGES', K_PATH_MAIN.'images/'); |
|
| 92 | +define('K_PATH_IMAGES', K_PATH_MAIN . 'images/'); |
|
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * blank image |
| 96 | 96 | */ |
| 97 | -define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png'); |
|
| 97 | +define('K_BLANK_IMAGE', K_PATH_IMAGES . '_blank.png'); |
|
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * page format |
| 101 | 101 | */ |
| 102 | -define ('PDF_PAGE_FORMAT', 'A4'); |
|
| 102 | +define('PDF_PAGE_FORMAT', 'A4'); |
|
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * page orientation (P=portrait, L=landscape) |
| 106 | 106 | */ |
| 107 | -define ('PDF_PAGE_ORIENTATION', 'P'); |
|
| 107 | +define('PDF_PAGE_ORIENTATION', 'P'); |
|
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | 110 | * document creator |
| 111 | 111 | */ |
| 112 | -define ('PDF_CREATOR', 'TCPDF'); |
|
| 112 | +define('PDF_CREATOR', 'TCPDF'); |
|
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * document author |
| 116 | 116 | */ |
| 117 | -define ('PDF_AUTHOR', 'TCPDF'); |
|
| 117 | +define('PDF_AUTHOR', 'TCPDF'); |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * header title |
| 121 | 121 | */ |
| 122 | -define ('PDF_HEADER_TITLE', 'TCPDF Example'); |
|
| 122 | +define('PDF_HEADER_TITLE', 'TCPDF Example'); |
|
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * header description string |
| 126 | 126 | */ |
| 127 | -define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); |
|
| 127 | +define('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); |
|
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | 130 | * image logo |
| 131 | 131 | */ |
| 132 | -define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); |
|
| 132 | +define('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * header logo image width [mm] |
| 136 | 136 | */ |
| 137 | -define ('PDF_HEADER_LOGO_WIDTH', 30); |
|
| 137 | +define('PDF_HEADER_LOGO_WIDTH', 30); |
|
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | 140 | * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch] |
| 141 | 141 | */ |
| 142 | -define ('PDF_UNIT', 'mm'); |
|
| 142 | +define('PDF_UNIT', 'mm'); |
|
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | 145 | * header margin |
| 146 | 146 | */ |
| 147 | -define ('PDF_MARGIN_HEADER', 5); |
|
| 147 | +define('PDF_MARGIN_HEADER', 5); |
|
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | 150 | * footer margin |
| 151 | 151 | */ |
| 152 | -define ('PDF_MARGIN_FOOTER', 10); |
|
| 152 | +define('PDF_MARGIN_FOOTER', 10); |
|
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * top margin |
| 156 | 156 | */ |
| 157 | -define ('PDF_MARGIN_TOP', 27); |
|
| 157 | +define('PDF_MARGIN_TOP', 27); |
|
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * bottom margin |
| 161 | 161 | */ |
| 162 | -define ('PDF_MARGIN_BOTTOM', 25); |
|
| 162 | +define('PDF_MARGIN_BOTTOM', 25); |
|
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | 165 | * left margin |
| 166 | 166 | */ |
| 167 | -define ('PDF_MARGIN_LEFT', 15); |
|
| 167 | +define('PDF_MARGIN_LEFT', 15); |
|
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | 170 | * right margin |
| 171 | 171 | */ |
| 172 | -define ('PDF_MARGIN_RIGHT', 15); |
|
| 172 | +define('PDF_MARGIN_RIGHT', 15); |
|
| 173 | 173 | |
| 174 | 174 | /** |
| 175 | 175 | * default main font name |
| 176 | 176 | */ |
| 177 | -define ('PDF_FONT_NAME_MAIN', 'helvetica'); |
|
| 177 | +define('PDF_FONT_NAME_MAIN', 'helvetica'); |
|
| 178 | 178 | |
| 179 | 179 | /** |
| 180 | 180 | * default main font size |
| 181 | 181 | */ |
| 182 | -define ('PDF_FONT_SIZE_MAIN', 10); |
|
| 182 | +define('PDF_FONT_SIZE_MAIN', 10); |
|
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | 185 | * default data font name |
| 186 | 186 | */ |
| 187 | -define ('PDF_FONT_NAME_DATA', 'helvetica'); |
|
| 187 | +define('PDF_FONT_NAME_DATA', 'helvetica'); |
|
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | 190 | * default data font size |
| 191 | 191 | */ |
| 192 | -define ('PDF_FONT_SIZE_DATA', 8); |
|
| 192 | +define('PDF_FONT_SIZE_DATA', 8); |
|
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * default monospaced font name |
| 196 | 196 | */ |
| 197 | -define ('PDF_FONT_MONOSPACED', 'courier'); |
|
| 197 | +define('PDF_FONT_MONOSPACED', 'courier'); |
|
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | 200 | * ratio used to adjust the conversion of pixels to user units |
| 201 | 201 | */ |
| 202 | -define ('PDF_IMAGE_SCALE_RATIO', 1.25); |
|
| 202 | +define('PDF_IMAGE_SCALE_RATIO', 1.25); |
|
| 203 | 203 | |
| 204 | 204 | /** |
| 205 | 205 | * magnification factor for titles |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | /** |
| 220 | 220 | * reduction factor for small font |
| 221 | 221 | */ |
| 222 | -define('K_SMALL_RATIO', 2/3); |
|
| 222 | +define('K_SMALL_RATIO', 2 / 3); |
|
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | 225 | * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : tcpdf_config.php |
| 4 | 6 | // Begin : 2004-06-11 |
@@ -35,7 +37,7 @@ discard block |
||
| 35 | 37 | $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); |
| 36 | 38 | } elseif(isset($_SERVER['PATH_TRANSLATED'])) { |
| 37 | 39 | $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); |
| 38 | - } else { |
|
| 40 | + } else { |
|
| 39 | 41 | // define here your DOCUMENT_ROOT path if the previous fails |
| 40 | 42 | $_SERVER['DOCUMENT_ROOT'] = '/var/www'; |
| 41 | 43 | } |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | - * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).<br> |
|
| 55 | - * @name TCPDFBarcode |
|
| 56 | - * @package com.tecnick.tcpdf |
|
| 57 | - * @version 1.0.003 |
|
| 58 | - * @author Nicola Asuni |
|
| 59 | - * @link http://www.tcpdf.org |
|
| 60 | - * @license http://www.gnu.org/copyleft/lesser.html LGPL |
|
| 61 | - */ |
|
| 54 | + * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).<br> |
|
| 55 | + * @name TCPDFBarcode |
|
| 56 | + * @package com.tecnick.tcpdf |
|
| 57 | + * @version 1.0.003 |
|
| 58 | + * @author Nicola Asuni |
|
| 59 | + * @link http://www.tcpdf.org |
|
| 60 | + * @license http://www.gnu.org/copyleft/lesser.html LGPL |
|
| 61 | + */ |
|
| 62 | 62 | class TCPDF2DBarcode { |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * <li>$arrcode['num_cols'] required number of columns</li> |
| 76 | 76 | * <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul> |
| 77 | 77 | * @param string $code code to print |
| 78 | - * @param string $type type of barcode: <ul>li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li></ul> |
|
| 78 | + * @param string $type type of barcode: <ul>li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li></ul> |
|
| 79 | 79 | */ |
| 80 | 80 | public function __construct($code, $type) { |
| 81 | 81 | $this->setBarcode($code, $type); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Return an array representations of barcode. |
| 86 | - * @return array |
|
| 86 | + * @return array |
|
| 87 | 87 | */ |
| 88 | 88 | public function getBarcodeArray() { |
| 89 | 89 | return $this->barcode_array; |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | /** |
| 93 | 93 | * Set the barcode. |
| 94 | 94 | * @param string $code code to print |
| 95 | - * @param string $type type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li></ul> |
|
| 96 | - * @return array |
|
| 95 | + * @param string $type type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li></ul> |
|
| 96 | + * @return array |
|
| 97 | 97 | */ |
| 98 | 98 | public function setBarcode($code, $type) { |
| 99 | 99 | $mode = explode(',', $type); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : 2dbarcodes.php |
| 4 | 4 | // Begin : 2009-04-07 |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | $qrtype = strtoupper($mode[0]); |
| 101 | 101 | switch ($qrtype) { |
| 102 | 102 | case 'QRCODE': { // QR-CODE |
| 103 | - require_once(dirname(__FILE__).'/qrcode.php'); |
|
| 104 | - if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) { |
|
| 103 | + require_once(dirname(__FILE__) . '/qrcode.php'); |
|
| 104 | + if (!isset($mode[1]) OR (!in_array($mode[1], array('L', 'M', 'Q', 'H')))) { |
|
| 105 | 105 | $mode[1] = 'L'; // Ddefault: Low error correction |
| 106 | 106 | } |
| 107 | 107 | $qrcode = new QRcode($code, strtoupper($mode[1])); |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | $this->barcode_array['num_rows'] = 5; |
| 136 | 136 | $this->barcode_array['num_cols'] = 15; |
| 137 | 137 | $this->barcode_array['bcode'] = array( |
| 138 | - array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1), |
|
| 139 | - array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0), |
|
| 140 | - array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0), |
|
| 141 | - array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0), |
|
| 142 | - array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0)); |
|
| 138 | + array(1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1), |
|
| 139 | + array(0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0), |
|
| 140 | + array(0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0), |
|
| 141 | + array(0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0), |
|
| 142 | + array(0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0)); |
|
| 143 | 143 | break; |
| 144 | 144 | } |
| 145 | 145 | default: { |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : 2dbarcodes.php |
| 4 | 6 | // Begin : 2009-04-07 |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if (!defined('ABSPATH')) exit; |
|
| 2 | 2 | //============================================================+ |
| 3 | 3 | // File name : htmlcolors.php |
| 4 | 4 | // Begin : 2002-04-09 |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * Array of WEB safe colors |
| 53 | 53 | */ |
| 54 | 54 | global $webcolor; |
| 55 | -$webcolor = array ( |
|
| 55 | +$webcolor = array( |
|
| 56 | 56 | 'aliceblue' => 'f0f8ff', |
| 57 | 57 | 'antiquewhite' => 'faebd7', |
| 58 | 58 | 'aqua' => '00ffff', |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( !defined( 'ABSPATH' ) ) exit; |
|
| 1 | +<?php if ( !defined( 'ABSPATH' ) ) { |
|
| 2 | + exit; |
|
| 3 | +} |
|
| 2 | 4 | //============================================================+ |
| 3 | 5 | // File name : htmlcolors.php |
| 4 | 6 | // Begin : 2002-04-09 |