/** * @param RokSprocket_Item $item * @param bool $per_item_field * * @return bool|null|RokSprocket_Item_Image */ protected function setupTags(RokSprocket_Item &$item, $per_item_field = false) { if (!$per_item_field) { $tags = implode(',', $item->getTags()); } else { switch (trim($item->getParam($per_item_field, '-article-'))) { case '-none-': $tags = array(); break; case '-article-': $tags = $item->getTags(); break; default: $custom_tags = $item->getParam($per_item_field, false); $tags = !empty($custom_tags) && $custom_tags !== false ? explode(',', $custom_tags) : array(); } } return $this->cleanupTags($tags); }