]> git.mxchange.org Git - mailer.git/commitdiff
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 baaee6da2c3ff5de98744b6f37393a5ed2d9fdb0..3c16a1335914e3a281c4d35e8b2e5e21ef807308 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 139759e5b0016c80bfe55cbcaaafbb557bb184fc..9d8412562c1ec72d02d08e28957a32ab5531a8ae 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 0841fd704f23a22800477f18033620c9d7056819..73260d17ef162b3e3b972275c3e08d975869f2bd 100644 (file)
@@ -1,5 +1,3 @@
 <style type="text/css">
-<!--
 $content
-//-->
 </style>