Removed @deprecated from CSS inline/PHP output
authorRoland Häder <roland@mxchange.org>
Wed, 12 Jun 2013 03:20:59 +0000 (03:20 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 12 Jun 2013 03:20:59 +0000 (03:20 +0000)
inc/stylesheet.php
inc/template-functions.php
templates/de/html/css_inline.tpl

index baaee6d..3c16a13 100644 (file)
@@ -86,7 +86,7 @@ if ((isCssOutputMode()) || (getCssPhp() == 'DIRECT')) {
                                        break;
 
                                case 'FILE': // Output contents
-                                       $GLOBALS['__page_header'] .= readFromFile($FQFN);
+                                       $GLOBALS['__page_header'] .= removeDeprecatedComment(readFromFile($FQFN));
                                        break;
 
                                default: // Invalid mode!
@@ -116,7 +116,7 @@ if ((isCssOutputMode()) || (getCssPhp() == 'DIRECT')) {
        } // END - foreach
 
        // Load template
-       $GLOBALS['__page_header'] .= loadTemplate('css_inline', TRUE, $OUT);
+       $GLOBALS['__page_header'] .= loadTemplate('css_inline', TRUE, removeDeprecatedComment($OUT));
 } else {
        // Now we load all CSS files from css.php!
        $OUT = '<link rel="stylesheet" type="text/css" href="{%url=css.php';
index 139759e..9d84125 100644 (file)
@@ -2399,5 +2399,27 @@ function getTemplateBasePath ($part) {
        return $GLOBALS[__FUNCTION__][$part];
 }
 
+// Removes comments with @DEPRECATED
+function removeDeprecatedComment ($output) {
+       // Explode it into pieces ... ;)
+       $lines = explode(chr(10), $output);
+
+       // Walk through all
+       $return = '';
+       foreach ($lines as $line) {
+               // Is there a @DEPRECATED?
+               if (isInString('@DEPRECATED', $line)) {
+                       // Ignore this line
+                       continue;
+               } // END - if
+
+               // Add it
+               $return .= $line . chr(13);
+       } // END - foreach
+
+       // Returned cleaned content
+       return $return;
+}
+
 // [EOF]
 ?>
index 0841fd7..73260d1 100644 (file)
@@ -1,5 +1,3 @@
 <style type="text/css">
-<!--
 $content
-//-->
 </style>