includes/plugins.php
changeset 519 94214ec0871c
parent 507 586fd7d3202d
child 527 21e11f564463
--- a/includes/plugins.php	Sun Apr 06 14:02:20 2008 -0400
+++ b/includes/plugins.php	Sun Apr 06 15:30:39 2008 -0400
@@ -224,9 +224,22 @@
       if ( is_string($type) && $blocks[1][$i] !== $type )
         continue;
       
+      $value =& $blocks[4][$i];
+      // parse includes
+      preg_match_all('/^!include [\'"]?(.+?)[\'"]?$/m', $value, $includes);
+      foreach ( $includes[0] as $i => $replace )
+      {
+        $filename = ENANO_ROOT . '/' . $includes[1][$i];
+        if ( @file_exists( $filename ) && @is_readable( $filename ) )
+        {
+          $contents = @file_get_contents($filename);
+          $value = str_replace_once($replace, $contents, $value);
+        }
+      }
+      
       $el = self::parse_vars($blocks[2][$i]);
       $el['block'] = $blocks[1][$i];
-      $el['value'] = $blocks[4][$i];
+      $el['value'] = $value;
       $return[] = $el;
     }