Back to PhocaGalleryRoute class

Method getFeedRoute

public static
getFeedRoute
(mixed $view = 'categories', mixed $catid = 0, mixed $catidAlias = '')

Method getFeedRoute - Source code

public static function getFeedRoute($view = 'categories', $catid = 0, $catidAlias = '')
{
    if ($view == 'categories') {
        $needles = array('categories' => '');
        $link = 'index.php?option=com_phocagallery&view=categories&format=feed';
    } else {
        if ($view == 'category') {
            if ($catid > 0) {
                $needles = array('category' => (int) $catid, 'categories' => '');
                if ($catidAlias != '') {
                    $catid = (int) $catid . ':' . $catidAlias;
                }
                $link = 'index.php?option=com_phocagallery&view=category&format=feed&id=' . $catid;
            } else {
                $needles = array('categories' => '');
                $link = 'index.php?option=com_phocagallery&view=categories&format=feed';
            }
        } else {
            $needles = array('categories' => '');
            $link = 'index.php?option=com_phocagallery&view=feed&format=feed';
        }
    }
    if ($item = PhocaGalleryRoute::_findItem($needles, 1)) {
        if (isset($item->query['layout'])) {
            $link .= '&layout=' . $item->query['layout'];
        }
        if (isset($item->id) && (int) $item->id > 0) {
            $link .= '&Itemid=' . $item->id;
        }
    }
    return $link;
}