<?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_output_array;
if(defined("JOOCART_USE_OC_TEMPLATE") && (JOOCART_USE_OC_TEMPLATE == "1" || JOOCART_USE_OC_TEMPLATE == "2" || JOOCART_USE_OC_TEMPLATE == "4")) {
global $joocart_replace_output_array1;
$joocart_replace_output_array1=array(
			'&page='=>'&pages=',
			'&amp;page='=>'&amp;pages=',
			'?page='=>'?pages=',
			'pages=joocart'=>'page=joocart',
			'index.php?route='=>'index.php?'.JOOCART_PAGE_ID_PARAM.'route=',
			'index.php?'.JOOCART_PAGE_ID_PARAM.'route=module/manufacturer/css'=>'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&route=module/manufacturer/css',
			'"catalog/'=>'"'.JOOCART_OPENCART_URL.'catalog/',
			'=\"catalog'=>'=\"'.JOOCART_OPENCART_URL.'catalog',
			'src="image/'=>'src="'.JOOCART_OPENCART_URL.'image/',
			JOOCART_SITE_URL.'image/'=>JOOCART_OPENCART_URL.'image/',
			JOOCART_SITE_HTTPS_URL.'image/'=>JOOCART_OPENCART_URL.'image/',
			'\'catalog/'=>'\''.JOOCART_OPENCART_URL.'catalog/',
			'$.'=>'jQuery.',
			'$('=>'jQuery(',
			'load(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'load(\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'load(\\\'index.php?'.JOOCART_PAGE_ID_PARAM=>'load(\\\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'index.php?'.JOOCART_PAGE_ID_PARAM.'route=common/filemanager&user_token='=>'index.php?'.JOOCART_PAGE_ID_PARAM.'route=common/filemanager&tmpl=component&user_token=',
			': \'index.php?'.JOOCART_PAGE_ID_PARAM=>': \'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'.post(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'.post(\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'.get(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'.get(\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&'=>'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			' type="text/css" href="index.php?'.JOOCART_PAGE_ID_PARAM=>' type="text/css" href="index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'<a class="colorbox" href="index.php?'.JOOCART_PAGE_ID_PARAM=>'<a class="colorbox" href="index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'<a class="colorbox" href="'.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM=>'<a class="colorbox" href="'.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL).'index.php?'.JOOCART_PAGE_ID_PARAM=>'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL).'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'url: \'index.php?'.JOOCART_PAGE_ID_PARAM=>'url: \''.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM,
			'load(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'load(\''.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM,
			'<a class="colorbox" href="'.JOOCART_SITE_URL.JOOCART_SHOP_SEO_KEY.'/information/information/info?'=>'<a class="colorbox" href="'.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&route=information/information/info&',
			'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL.JOOCART_SHOP_SEO_KEY.'/information/information/info?')=>'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&route=information/information/info&'),
			'page=joocart'=>'page_id='.JOOCART_SHOP_PAGE_ID,
			'json[\'redirect\'];'=>'json[\'redirect\'].replace(/&amp;/g,"&");',
			'name="name"'=>'name="name_oc"',
			'name=\\\'name\\\''=>'name=\\\'name_oc\\\'',
			'\'name=\''=>'\'name_oc=\'',
			'})($);'=>'})(jQuery);',
			'"admin/'=>'"'.JOOCART_OPENCART_URL.'admin/',
			'src="../' . JOOCART_RELATIVE_URL=>'src="' . JOOCART_RELATIVE_URL,
			''.JOOCART_RELATIVE_URL.JOOCART_RELATIVE_URL.''=>''.JOOCART_RELATIVE_URL.'',
			JOOCART_SITE_URL.'tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
			JOOCART_SITE_URL.'/tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
);
} 
$joocart_replace_output_array=array(
			'&page='=>'&pages=',
			'&amp;page='=>'&amp;pages=',
			'?page='=>'?pages=',
			'pages=joocart'=>'page=joocart',
			'index.php?route='=>'index.php?'.JOOCART_PAGE_ID_PARAM.'route=',
			'index.php?'.JOOCART_PAGE_ID_PARAM.'route=module/manufacturer/css'=>'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&route=module/manufacturer/css',
			'"catalog/'=>'"'.JOOCART_OPENCART_URL.'catalog/',
			'=\"catalog'=>'=\"'.JOOCART_OPENCART_URL.'catalog',
			'src="image/'=>'src="'.JOOCART_OPENCART_URL.'image/',
			JOOCART_SITE_URL.'image/'=>JOOCART_OPENCART_URL.'image/',
			JOOCART_SITE_HTTPS_URL.'image/'=>JOOCART_OPENCART_URL.'image/',
			'\'catalog/'=>'\''.JOOCART_OPENCART_URL.'catalog/',
			'$.'=>'jQuery.',
			'$('=>'jQuery(',
			'class="button"'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="button"':'class="button-oc"',
			'class=\"button\"'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"button\"':'class=\"button-oc\"',
			'id="button"'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'id="button"':'id="button-oc"',
			'id=\"button\"'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'id=\"button\"':'id=\"button-oc\"',
			'class="btn btn-primary'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="button':'class="btn btn-primary btn-primary-oc',
			'class=\"btn btn-primary'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"button':'class=\"btn btn-primary btn-primary-oc',
			'class="btn btn-default'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="button':'class="btn btn-default btn-default-oc',
			'class=\"btn btn-default'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"button':'class=\"btn btn-default btn-default-oc',
			'class="btn btn-warning'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="btn btn-warning':'class="btn btn-warning btn-warning-oc',
			'class=\"btn btn-warning'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"btn btn-warning':'class=\"btn btn-warning btn-warning-oc',
			'class="btn btn-danger'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="btn btn-danger':'class="btn btn-danger btn-danger-oc',
			'class=\"btn btn-danger'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"btn btn-danger':'class=\"btn btn-danger btn-danger-oc',
			'class="btn btn-success'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="btn btn-success':'class="btn btn-success btn-success-oc',
			'class=\"btn btn-success'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"btn btn-success':'class=\"btn btn-success btn-success-oc',
			'class="btn btn-info'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class="btn btn-info':'class="btn btn-info btn-info-oc',
			'class=\"btn btn-info'=>(JOOCART_USE_WORDPRESS_BUTTON=="1")?'class=\"btn btn-info':'class=\"btn btn-info btn-info-oc',
			'data-toggle="tooltip"' => (JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "1" || JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "3")?'':'data-toggle="tooltip"',
			'data-toggle=\"tooltip\"' => (JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "1" || JOOCART_DISABLE_BOOTSTRAP_TOOLTIP == "3")?'':'data-toggle=\"tooltip\"',
			'class="btn btn-inverse'=>'class="btn btn-inverse btn-inverse-oc',
			'class=\"btn btn-inverse'=>'class=\"btn btn-inverse btn-inverse-oc',
			'load(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'load(\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'load(\\\'index.php?'.JOOCART_PAGE_ID_PARAM=>'load(\\\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'index.php?'.JOOCART_PAGE_ID_PARAM.'route=common/filemanager&user_token='=>'index.php?'.JOOCART_PAGE_ID_PARAM.'route=common/filemanager&tmpl=component&user_token=',
			': \'index.php?'.JOOCART_PAGE_ID_PARAM=>': \'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'.post(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'.post(\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'.get(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'.get(\'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&'=>'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			' type="text/css" href="index.php?'.JOOCART_PAGE_ID_PARAM=>' type="text/css" href="index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'-x.jpg"'=>'-80x80.jpg"',
			'jQuery(\'#cart_total\').html(json[\'total\']);'=>'jQuery(\'#cart_total\').html(json[\'total\']);
			jQuery(\'#module-cart .content-oc\').html(json[\'output\']);
			',
			'<a class="colorbox" href="index.php?'.JOOCART_PAGE_ID_PARAM=>'<a class="colorbox" href="index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'<a class="colorbox" href="'.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM=>'<a class="colorbox" href="'.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL).'index.php?'.JOOCART_PAGE_ID_PARAM=>'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL).'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&',
			'url: \'index.php?'.JOOCART_PAGE_ID_PARAM=>'url: \''.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM,
			'load(\'index.php?'.JOOCART_PAGE_ID_PARAM=>'load(\''.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM,
			'<a class="colorbox" href="'.JOOCART_SITE_URL.JOOCART_SHOP_SEO_KEY.'/information/information/info?'=>'<a class="colorbox" href="'.JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&route=information/information/info&',
			'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL.JOOCART_SHOP_SEO_KEY.'/information/information/info?')=>'<a class=\"colorbox\" href=\"'.str_replace("/","\\/",JOOCART_SITE_URL.'index.php?'.JOOCART_PAGE_ID_PARAM.'tmpl=component&route=information/information/info&'),
			'page=joocart'=>'page_id='.JOOCART_SHOP_PAGE_ID,
			'json[\'redirect\'];'=>'json[\'redirect\'].replace(/&amp;/g,"&");',
			'name="name"'=>'name="name_oc"',
			'name=\\\'name\\\''=>'name=\\\'name_oc\\\'',
			'\'name=\''=>'\'name_oc=\'',
			'})($);'=>'})(jQuery);',
			'"admin/'=>'"'.JOOCART_OPENCART_URL.'admin/',
			'<nav>' => '<nav class=\'nav-oc\'>',
			'<header>' => '<div class=\'header-oc\'>',
			'<footer>' => '<div class=\'footer-oc\'>',
			'</header>'=>'</div>',
			'</footer>'=>'</div>',
			'src="../' . JOOCART_RELATIVE_URL=>'src="' . JOOCART_RELATIVE_URL,
			''.JOOCART_RELATIVE_URL.JOOCART_RELATIVE_URL.''=>''.JOOCART_RELATIVE_URL.'',
			'(\'body\').append(html);'=>'(\'.body-oc:first\').append(html);',
			'<body>' => '<body class=\'body-oc\'>',
			'class="dropdown-toggle"'=>'',
			' dropdown-toggle" '=>'" ',
			' dropdown-toggle">'=>'">',
			JOOCART_SITE_URL.'tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
			JOOCART_SITE_URL.'/tshirtecommerce/'=>JOOCART_OPENCART_URL.'tshirtecommerce/',
			'(\'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',
			'<!--<head>-->' => '',
			'<!--</head> -->' => '',
			'<!--<body>-->' => '',
			'<!--</body></html>-->' => '',
			JOOCART_OPENCART_URL.'catalog/view/javascript/common.'=>JOOCART_PLUGIN_URL.'catalog/view/javascript/custom/common.',
			JOOCART_OPENCART_URL.'catalog/view/view/theme/default/stylesheet/stylesheet.'=>JOOCART_PLUGIN_URL.'catalog/view/theme/default/stylesheet/custom/stylesheet.',
			);
			
$stylesheet_class_replace_array=array('container','content','header','left','right','center','search','menu','box','list','filter','banner','footer','logo','nav','top','breadcrumb','modal','modal-backdrop');
foreach($stylesheet_class_replace_array as $key){
		$joocart_replace_output_array['class="'.$key.'"']='class="'.$key.'-oc"';
		$joocart_replace_output_array['class=\"'.$key.'\"']='class=\"'.$key.'-oc\"';
		$joocart_replace_output_array['class="'.$key.' ']='class="'.$key.'-oc ';
		$joocart_replace_output_array['class=\"'.$key.' ']='class=\"'.$key.'-oc ';
		$joocart_replace_output_array['id="'.$key.'"']='id="'.$key.'-oc"';
		$joocart_replace_output_array['id=\"'.$key.'\"']='id=\"'.$key.'-oc\"';
		// some extra changes for css
		$joocart_replace_output_array['#'.$key.' ']='#'.$key.'-oc ';
		$joocart_replace_output_array['\#'.$key.' ']='\#'.$key.'-oc ';
		$joocart_replace_output_array['\'#'.$key.'\'']='\'#'.$key.'-oc\'';
		$joocart_replace_output_array['#'.$key.'{']='#'.$key.'-oc{';
		$joocart_replace_output_array['#'.$key.',']='#'.$key.'-oc,';
		$joocart_replace_output_array['#'.$key.':']='#'.$key.'-oc:';
		$joocart_replace_output_array['\'.'.$key.'\'']='\'.'.$key.'-oc\'';
		$joocart_replace_output_array['\'.'.$key.' ']='\'.'.$key.'-oc ';
		$joocart_replace_output_array['.'.$key.'{']='.'.$key.'-oc{';

		/* 
		// for css changes(enable them if needed)
		$joocart_replace_output_array['.'.$key.' ']='.'.$key.'-oc ';
		$joocart_replace_output_array['.'.$key.',']='.'.$key.'-oc,';
		$joocart_replace_output_array['.'.$key.':']='.'.$key.'-oc:';
		*/

}

$joocart_replace_output_array['class="nav-oc"']='class="nav nav-oc"';
$joocart_replace_output_array['class=\"nav-oc\"']='class=\"nav nav-oc\"';
$joocart_replace_output_array['class="nav-oc ']='class="nav nav-oc ';

