You are here

function asset_filter in Asset 5

Same name and namespace in other branches
  1. 5.2 asset.module \asset_filter()
  2. 6 inc/asset.node.inc \asset_filter()

Implementation of hook_filter().

File

./asset.module, line 407

Code

function asset_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(
        0 => t('Inline file assets'),
      );
    case 'description':
      return t('Add formatted file assets to your posts.');
    case 'process':
      foreach (asset_get_macros($text) as $unexpanded_macro => $macro) {
        $expanded_macro = asset_render_macro($macro);
        $text = str_replace($unexpanded_macro, $expanded_macro, $text);
      }
      return $text;
    default:
      return $text;
  }
}