Index: branches/5.1.x/core/kernel/nparser/ntags.php =================================================================== diff -u -N -r13168 -r13487 --- branches/5.1.x/core/kernel/nparser/ntags.php (.../ntags.php) (revision 13168) +++ branches/5.1.x/core/kernel/nparser/ntags.php (.../ntags.php) (revision 13487) @@ -1,6 +1,6 @@ _requiredParams = Array ('from'); + } + else { + $this->_requiredParams = Array ('files'); + } + } + else { + $this->_requiredParams = Array ('type'); // js/css + } + } + + /** + * When used as non-block tag, then compress given files and return url to result + * + * @param Array $tag + * @return string + */ + function Open($tag) + { + $o = parent::Open($tag); + + if ($o === false) { + // some required params not passed + return $o; + } + + if ($tag['is_closing']) { + $to_pass = $this->Parser->CompileParamsArray($tag['NP']); + $this->AppendCode($o, "echo \$_parser->CompressScript($to_pass, false);"); + } + else { + $this->AppendCode($o, "ob_start();"); + } + + return $o; + } + + /** + * When used as block tag, then compress contents between tags + * + * @param Array $tag + * @return string + */ + function Close($tag) + { + if ($this->Tag['is_closing']) { + return parent::Close($tag); + } + + $o = parent::Close($tag); + + $code = Array (); + $code[] = '$res = ob_get_clean();'; + $code[] = 'echo $_parser->CompressScript($res, true, \'' . $this->Tag['NP']['type'] . '\');'; + + $this->AppendCode($o, $code); + + return $o; + } } \ No newline at end of file