You are here

function flickr_filter in Flickr 5

Same name and namespace in other branches
  1. 6 filter/flickr_filter.module \flickr_filter()
  2. 7 filter/flickr_filter.module \flickr_filter()

File

filter/flickr_filter.module, line 22

Code

function flickr_filter($op, $delta = 0, $format = -1, $text = '') {
  if ($op == 'list') {
    return array(
      0 => t('Flickr linker'),
    );
  }
  switch ($delta) {
    case 0:
      switch ($op) {
        case 'description':
          return t('Insert photos or photosets from Flickr without <img> tags: [flickr-photo:id=230452326]');
        case 'no cache':

          // TODO: only return true when testing the filter
          // return TRUE;
          return FALSE;
        case 'prepare':
          return $text;
        case 'process':
          $text = preg_replace_callback('/\\[flickr-photo:(.+?)\\]/', 'flickr_filter_callback_photo', $text);
          $text = preg_replace_callback('/\\[flickr-photoset:(.+?)\\]/', 'flickr_filter_callback_photoset', $text);
          return $text;
      }
      break;
  }
}