Browse Source

init

master
heavenK 3 years ago
parent
commit
b60748bcd0
  1. 7
      includes/cls_template.php

7
includes/cls_template.php

@ -1102,9 +1102,12 @@ class cls_template
if ($file_type == '.dwt') if ($file_type == '.dwt')
{ {
/* 将模板中所有library替换为链接 */ /* 将模板中所有library替换为链接 */
$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se'; /*$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se';
$replacement = "'{include file='.strtolower('\\1'). '}'"; $replacement = "'{include file='.strtolower('\\1'). '}'";
$source = preg_replace($pattern, $replacement, $source); $source = preg_replace($pattern, $replacement, $source);*/
$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s';
$replacement = function($r){return '{include file='.strtolower($r[1]). '}';};
$source = preg_replace_callback($pattern, $replacement, $source);
/* 检查有无动态库文件,如果有为其赋值 */ /* 检查有无动态库文件,如果有为其赋值 */
$dyna_libs = get_dyna_libs($GLOBALS['_CFG']['template'], $this->_current_file); $dyna_libs = get_dyna_libs($GLOBALS['_CFG']['template'], $this->_current_file);

Loading…
Cancel
Save