Improve flexible output filter(widget)

// This is markdown format? 

@INCLUDE - No return strings. PHP file include only.  
@FILE - file_get_contents(filename)  
@CHUNK - Parse chunk. Value's place holder is [+value+]. And [(settings)] [\*tv\*] [[snippet]] {{chunk}}.  
@EVAL - eval php. Value's place holder is [+value+] and $value. And [+value+]. And [(settings)] [\*tv*\] [[snippet]]   {{chunk}}.  

other - Value's place holder is [+value+]. And [(settings)] [\*tv*\] [[snippet]] {{chunk}}.  

When the value doesn't exist, nothing is output.  

example.  

@CHUNK phpthumb_image_widget  
 [chunk name : phpthumb_image_widget]  

 &lt;img src=&quot;phpThumb.php?src=[+value+]&amp;w=250&quot; width=&quot;250&quot; /&gt;  

@CHUNK title_chunk  
 [chunk name : title_chunk]  

  &lt;h2&gt;[[title_snippet]]&lt;/h2&gt;  

  
  [snippet name : title_snippet]  

  if($modx->documentObject['longtitle']) return $modx->documentObject['longtitle'];  
  else return $modx->documentObject['pagetitle'];