You are here

function swftools_filter in SWF Tools 6.3

Same name and namespace in other branches
  1. 5 swftools.module \swftools_filter()
  2. 6 swftools.module \swftools_filter()
  3. 6.2 swftools.module \swftools_filter()

Implementation of hook_filter().

File

./swftools.module, line 980
The primary component of SWF Tools that enables comprehensive media handling.

Code

function swftools_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(
        0 => t('SWF Tools filter'),
      );
    case 'no cache':
      return FALSE;
    case 'description':
      return t('Substitutes [swf file="filename.flv"] or [swf files="file1.jpg&&file2.jpg"] with embedding code.');
    case 'prepare':

      // replace <swf > with [swf ] to prevent other filters stripping
      return preg_replace('/\\<(swflist|swf)\\s*(.*)>/sU', '[\\1 \\2]', $text);
    case 'process':
      return _swftools_filter_process_text($text);
  }
}