You are here

function flashnode_filter in Flash Node 6.3

Same name and namespace in other branches
  1. 5.6 flashnode.module \flashnode_filter()
  2. 5.2 flashnode.module \flashnode_filter()
  3. 5.3 flashnode.module \flashnode_filter()
  4. 6.2 flashnode.module \flashnode_filter()

Implementation of hook_filter()

File

./flashnode.module, line 773

Code

function flashnode_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(
        0 => t('Flash node filter'),
      );
    case 'description':
      return t('Add Flash from a flash node to your posts using a flash node macro.');
    case 'process':
      foreach (flashnode_get_macros($text) as $unexpanded_macro => $macro) {
        $replace = flashnode_content($macro, $format);
        $search = '@(<p>)?' . preg_quote($unexpanded_macro) . '(</p>)?@';
        $text = preg_replace($search, $replace, $text);
      }
      return $text;
    default:
      return $text;
  }
}