我正在为opencart创建一个模块,在ocmod中我想添加多行搜索和替换。如何在ocmod.xml中执行多行搜索和替换?
<file path="catalog/view/theme/fastor/template/common/footer.tpl">
<operation>
<search ><![CDATA[
<?php
$store_id = $config->get('config_store_id');
if ($store_id == '1') {
?>
<div id="craftysyntax_1" style="float: right;"><script type="text/javascript" src="https://livehelp.clipboards.com/livehelp_js.php?eo=0&department=1&serversession=1&pingtimes=10&dynamic=Y&creditline=W"></script></div>
<?php } elseif($store_id == '0') { ?>
<div id="craftysyntax_2" style="float: right;"><script type="text/javascript" src="https://livehelp.clipboards.com/livehelp_js.php?eo=0&department=2&serversession=1&pingtimes=10&dynamic=Y&creditline=W"></script></div>
<?php } ?>
]]></search>
<add position="replace"><![CDATA[
<?php
if( $moduleData['Enabled']=='yes'){
$var = htmlspecialchars_decode($moduleData['WidgetTitle'][$language_id]);
echo $var;
}
?>
]]></add>
</operation>
</file>
答案 0 :(得分:1)
normaly你不能,但有修复允许这种功能
http://www.opencartjazz.com/en/oc2011-bugfix-extension-installer