left_delimiter; $dr = $smarty->right_delimiter; // This first regex just remove the template's comments $pattern = "/{$dl}\*[\s\S]*?\*{$dr}/"; // This second one search by the smarty plugin {wf_default_template} $pattern2 = "/{$dl}\s*wf_default_template\s*{$dr}/"; // Remove the comments $subject = preg_replace($pattern, "", $tpl); // Search by the plugin and adds the header and footer if it was found if (preg_match($pattern2, $subject) > 0) { /* get the header and footer location */ $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); $header = $templateServer->getSystemFile('processes/header.tpl'); $footer = $templateServer->getSystemFile('processes/footer.tpl'); $tpl = "{include file='{$header}'}" . $tpl . "{include file='{$footer}'}"; } return $tpl; } ?>