function tips($category = null) { OutputModes('xhtml', FeedOutputModes()); if (!CheckPermissions('public')) { return; } if (null === $category) { $data = array('Categories' => $this->crosswords_model->GetTipCategories(null, true), 'SelfUri' => $this->uri->uri_string()); $this->main_frame->SetFeedTitle('The Yorker Crossword Tips'); if (FeedOutputMode()) { $this->main_frame->Channel()->SetDescription('All crossword tips.'); $this->_fillTipsFeed(); } else { $this->main_frame->setContentSimple('crosswords/tips', $data); /// @todo Use pages interface $this->main_frame->SetTitle('Crossword Tips'); } } else { $category_info = null; if (is_numeric($category)) { $category_info = $this->crosswords_model->GetTipCategories((int) $category, true); if (empty($category_info)) { $category_info = null; } else { $category_info = $category_info[0]; } } if (null === $category_info) { show_404(); } $this->main_frame->SetFeedTitle('The Yorker Crossword Tips - ' . $category_info['name']); if (FeedOutputMode()) { $this->main_frame->Channel()->SetDescription('All crossword tips in category "' . $category_info['name'] . '".'); $this->_fillTipsFeed($category_info['id']); } else { $data = array('Category' => $category_info, 'Tips' => new CrosswordTipsList($category_info['id'], null), 'PostAction' => $this->uri->uri_string()); $this->main_frame->setContentSimple('crosswords/tip_cat_view', $data); /// @todo Use pages interface $this->main_frame->SetTitle('Crossword Tips - ' . $category_info['name']); } } $this->main_frame->Load(); }
function FeedOutputMode() { return in_array(OutputMode(), FeedOutputModes()); }