You are here

function img_assist_filter in Image Assist 5.3

Same name and namespace in other branches
  1. 5 img_assist.module \img_assist_filter()
  2. 5.2 img_assist.module \img_assist_filter()
  3. 6.2 img_assist.module \img_assist_filter()
  4. 6 img_assist.module \img_assist_filter()

Implementation of hook_filter().

File

./img_assist.module, line 460
Image Assist module

Code

function img_assist_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(
        0 => t('Inline images'),
      );
    case 'description':
      return t('Add images to your posts with Image assist.');

    //    case 'no cache':
    //      return TRUE;
    case 'process':
      $processed = FALSE;
      foreach (img_assist_get_macros($text) as $unexpanded_macro => $macro) {
        $expanded_macro = img_assist_render_image($macro);
        $text = str_replace($unexpanded_macro, $expanded_macro, $text);
        $processed = TRUE;
      }
      return $processed ? theme('img_assist_filter', $text) : $text;
    default:
      return $text;
  }
}