<?php
/**
 * @package		JooCart
 * @copyright	Copyright (C) 2009 - 2025 softPHP,https://www.soft-php.com
 * @license		GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */
// no direct access
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
JooCartAdminBase::setJooCartConfigFile();
global $joocart_replace_outputs_array;
$joocart_replace_outputs_array=array(
		'&page='=>'&pages=',
		'&amp;page='=>'&amp;pages=',
		'pages=joocart'=>'page=joocart',				
		'index.php?route='=>'index.php?page=joocart&route=',
		'index.php?user_token='=>'index.php?page=joocart&user_token=',
		'="view/'=>'="'.JOOCART_OPENCART_URL.'admin/view/',
		'="./view/' => '="'.JOOCART_OPENCART_URL.'admin/view/',
		'="language/'=>'="'.JOOCART_OPENCART_URL.'admin/language/',
		HTTP_SERVER.'view/'=>JOOCART_OPENCART_URL.'admin/view/',
		HTTP_SERVER.'language/'=>JOOCART_OPENCART_URL.'admin/language/',
		'\'view/image/'=>'\''.JOOCART_OPENCART_URL.'admin/view/image/',
		'"view/image/'=>'"'.JOOCART_OPENCART_URL.'admin/view/image/',
		HTTP_CATALOG.'image/'=>JOOCART_OPENCART_URL.'image/',
		HTTP_CATALOG.'catalog/'=>JOOCART_OPENCART_URL.'catalog/',
		HTTP_CATALOG.'vendors/'=>JOOCART_OPENCART_URL.'vendors/',
		'$.'=>'jQuery.',
		'$('=>'jQuery(',
		'data-toggle="tooltip"' => (JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "1" || JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "2")?'':'data-toggle="tooltip"',
		'data-toggle=\"tooltip\"' => (JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "1" || JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "2")?'':'data-toggle=\"tooltip\"',
		'load(\'index.php?page=joocart&'=>'load(\'index.php?page=joocart&tmpl=component&',
		'load(\\\'index.php?page=joocart&'=>'load(\\\'index.php?page=joocart&tmpl=component&',
		'index.php?page=joocart&route=checkout/manual&user_token='=>'index.php?page_id='.JOOCART_SHOP_PAGE_ID.'&tmpl=component&route=checkout/manual&user_token=',
		'index.php?page=joocart&route=common/filemanager&user_token='=>'index.php?page=joocart&route=common/filemanager&tmpl=component&user_token=',
		': \'index.php?page=joocart&'=>': \'index.php?page=joocart&tmpl=component&',
		HTTP_CATALOG.'index.php?page=joocart&route=feed/'=>HTTP_CATALOG.'index.php?page=joocart&tmpl=component&route=feed/',
		'index.php?page=joocart&amp;route=sale/order/invoice&amp;'=>'index.php?page=joocart&amp;route=sale/order/invoice&amp;tmpl=component&amp;',
		' type="text/css" href="index.php?page=joocart&'=>' type="text/css" href="index.php?page=joocart&tmpl=component&',
		'index.php?page=joocart&amp;route=tool/backup/backup&amp;'=>'index.php?page=joocart&amp;route=tool/backup/backup&amp;tmpl=component&amp;',
		'="../'=>'="'.JOOCART_OPENCART_URL,
		''.JOOCART_RELATIVE_URL.JOOCART_RELATIVE_URL.''=>''.JOOCART_RELATIVE_URL.'',
		HTTP_SERVER.'tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
		HTTP_SERVER.'/tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
		HTTPS_CATALOG.'tshirtecommerce/' => JOOCART_OPENCART_URL . 'tshirtecommerce/',
		HTTPS_CATALOG.'/tshirtecommerce/' => JOOCART_OPENCART_URL . 'tshirtecommerce/',
		HTTP_SERVER.'/view/'=>JOOCART_OPENCART_URL.'admin/view/',
		'="language/'=>'="'.JOOCART_OPENCART_URL.'admin/language/',
		'<body>' => '<body class=\'body-oc\'>',
		'(\'body\').append(html);' => '(\'.body-oc:last\').append(html);',
		'(\'body\').append(\'<div' => '(\'.body-oc:last\').append(\'<div',
		'(\'body\').prepend(html);' => '(\'.body-oc:last\').prepend(html);',
		'(\'body\').prepend(\'<div' => '(\'.body-oc:last\').prepend(\'<div',
		JOOCART_OPENCART_URL.'admin/view/javascript/common.'=>JOOCART_PLUGIN_URL.'admin/view/javascript/custom/common.',
		JOOCART_OPENCART_URL.'admin/view/stylesheet/stylesheet.'=>JOOCART_PLUGIN_URL.'admin/view/stylesheet/custom/stylesheet.',
		JOOCART_OPENCART_URL.'admin/view/javascript/font-awesome/'=>JOOCART_PLUGIN_URL.'admin/view/javascript/custom/font-awesome/',
		HTTP_CATALOG.'index.php?page=joocart&'=>HTTP_CATALOG.'index.php?page_id='.JOOCART_SHOP_PAGE_ID.'&',
		').button('=>').bootstrapBtn(',
		'data-toggle="modal" data-target="' => 'style="cursor: pointer;" onclick="jQuery(jQuery(this).attr(\'data-target\')).modal(\'show\');" data-target="',
		);
global $joocart_replace_outputs_array1;
$joocart_replace_outputs_array1=array(
		'&page='=>'&pages=',
		'&amp;page='=>'&amp;pages=',
		'pages=joocart'=>'page=joocart',				
		'index.php?route='=>'index.php?page=joocart&route=',
		'index.php?user_token='=>'index.php?page=joocart&user_token=',
		'="view/'=>'="'.JOOCART_OPENCART_URL.'admin/view/',
		'="./view/' => '="'.JOOCART_OPENCART_URL.'admin/view/',
		'="language/'=>'="'.JOOCART_OPENCART_URL.'admin/language/',
		HTTP_SERVER.'view/'=>JOOCART_OPENCART_URL.'admin/view/',
		HTTP_SERVER.'language/'=>JOOCART_OPENCART_URL.'admin/language/',
		'\'view/image/'=>'\''.JOOCART_OPENCART_URL.'admin/view/image/',
		'"view/image/'=>'"'.JOOCART_OPENCART_URL.'admin/view/image/',
		HTTP_CATALOG.'image/'=>JOOCART_OPENCART_URL.'image/',
		HTTP_CATALOG.'catalog/'=>JOOCART_OPENCART_URL.'catalog/',
		HTTP_CATALOG.'vendors/'=>JOOCART_OPENCART_URL.'vendors/',
		'$.'=>'jQuery.',
		'$('=>'jQuery(',
		'data-toggle="tooltip"' => (JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "1" || JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "2")?'':'data-toggle="tooltip"',
		'data-toggle=\"tooltip\"' => (JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "1" || JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "2")?'':'data-toggle=\"tooltip\"',
		'load(\'index.php?page=joocart&'=>'load(\'index.php?page=joocart&tmpl=component&',
		'load(\\\'index.php?page=joocart&'=>'load(\\\'index.php?page=joocart&tmpl=component&',
		'index.php?page=joocart&route=checkout/manual&user_token='=>'index.php?page_id='.JOOCART_SHOP_PAGE_ID.'&tmpl=component&route=checkout/manual&user_token=',
		'index.php?page=joocart&route=common/filemanager&user_token='=>'index.php?page=joocart&route=common/filemanager&tmpl=component&user_token=',
		': \'index.php?page=joocart&'=>': \'index.php?page=joocart&tmpl=component&',
		HTTP_CATALOG.'index.php?page=joocart&route=feed/'=>HTTP_CATALOG.'index.php?page=joocart&tmpl=component&route=feed/',
		'index.php?page=joocart&amp;route=sale/order/invoice&amp;'=>'index.php?page=joocart&amp;route=sale/order/invoice&amp;tmpl=component&amp;',
		' type="text/css" href="index.php?page=joocart&'=>' type="text/css" href="index.php?page=joocart&tmpl=component&',
		'index.php?page=joocart&amp;route=tool/backup/backup&amp;'=>'index.php?page=joocart&amp;route=tool/backup/backup&amp;tmpl=component&amp;',
		'="../'=>'="'.JOOCART_OPENCART_URL,
		''.JOOCART_RELATIVE_URL.JOOCART_RELATIVE_URL.''=>''.JOOCART_RELATIVE_URL.'',
		HTTP_SERVER.'tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
		HTTP_SERVER.'/tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
		HTTPS_CATALOG.'tshirtecommerce/' => JOOCART_OPENCART_URL . 'tshirtecommerce/',
		HTTPS_CATALOG.'/tshirtecommerce/' => JOOCART_OPENCART_URL . 'tshirtecommerce/',
		HTTP_SERVER.'/view/'=>JOOCART_OPENCART_URL.'admin/view/',
		'="language/'=>'="'.JOOCART_OPENCART_URL.'admin/language/',
		);
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- 'route' is used for routing, not form processing
if(isset($_REQUEST["route"]) && sanitize_text_field(wp_unslash($_REQUEST["route"]))=="common/home") {
	$_GET["route"] = $_REQUEST["route"] = "common/dashboard";
}
$stylesheet_class_replace_array=array('container','content','header','button','left','right','center','search','menu','breadcrumb','box','list','banner','footer','logo','nav','top','modal','modal-backdrop');
foreach($stylesheet_class_replace_array as $key){
	$joocart_replace_outputs_array['class="'.$key.'"']='class="'.$key.'-oc"';
	$joocart_replace_outputs_array['class=\"'.$key.'\"']='class=\"'.$key.'-oc\"';
	$joocart_replace_outputs_array['class="'.$key.' ']='class="'.$key.'-oc ';
	$joocart_replace_outputs_array['class=\"'.$key.' ']='class=\"'.$key.'-oc ';
	$joocart_replace_outputs_array['id="'.$key.'"']='id="'.$key.'-oc"';
	$joocart_replace_outputs_array['id=\"'.$key.'\"']='id=\"'.$key.'-oc\"';
	// some extra changes for css
	$joocart_replace_outputs_array['#'.$key.' ']='#'.$key.'-oc ';
	$joocart_replace_outputs_array['\#'.$key.' ']='\#'.$key.'-oc ';
	$joocart_replace_outputs_array['\'#'.$key.'\'']='\'#'.$key.'-oc\'';
	$joocart_replace_outputs_array['#'.$key.'{']='#'.$key.'-oc{';
	$joocart_replace_outputs_array['#'.$key.',']='#'.$key.'-oc,';
	$joocart_replace_outputs_array['#'.$key.':']='#'.$key.'-oc:';
	$joocart_replace_outputs_array['\'.'.$key.' ']='\'.'.$key.'-oc ';
	$joocart_replace_outputs_array['.'.$key.'{']='.'.$key.'-oc{';
}
$joocart_replace_outputs_array['class="nav-oc"']='class="nav nav-oc"';
$joocart_replace_outputs_array['class=\"nav-oc\"']='class=\"nav nav-oc\"';
$joocart_replace_outputs_array['class="nav-oc ']='class="nav nav-oc ';

$joocart_replace_outputs_array['class="breadcrumb-oc"']='class="breadcrumb breadcrumb-oc"';
$joocart_replace_outputs_array['class=\"breadcrumb-oc\"']='class=\"breadcrumb breadcrumb-oc\"';
$joocart_replace_outputs_array['class="breadcrumb-oc ']='class="breadcrumb breadcrumb-oc ';