aboutsummaryrefslogtreecommitdiffstats
path: root/public/system/modification.xml
blob: 6cfd9f6a47a9c425aca02a2a8e783535f2c07550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Modification Default</name>
  <code>default</code>
  <version>1.0</version>
  <author>OpenCart Ltd</author>
  <link>http://www.opencart.com</link>
  <file path="system/{engine,library}/{action,loader,config,language}*.php|system/library/template/template.php">
	<operation>
      <search regex="true">
        <![CDATA[~(require|include)(_once)?\(([^)]+)~]]>
      </search>
      <add position="replace">
        <![CDATA[$1$2(modification($3)]]>
      </add>
    </operation>
  </file>
  <file path="system/library/template/twig.php">
	<operation>
      <search>
        <![CDATA[$loader = new \Twig_Loader_Filesystem(DIR_TEMPLATE);]]>
      </search>
      <add position="replace">
        <![CDATA[		
		$loader = new \Twig_Loader_Filesystem();
		
		if (defined('DIR_CATALOG') && is_dir(DIR_MODIFICATION . 'admin/view/template/')) {	
			$loader->addPath(DIR_MODIFICATION . 'admin/view/template/');
		} elseif (is_dir(DIR_MODIFICATION . 'catalog/view/theme/')) {
			$loader->addPath(DIR_MODIFICATION . 'catalog/view/theme/');
		}
		
		$loader->addPath(DIR_TEMPLATE);]]>
      </add>
    </operation>
  </file> 
</modification>