/** * Renders a blog article. * * @param int $id An article ID. * * @return string (X)HTML. * * @global array The headings of the pages. * @global int The current page index. * @global string The page title. * @global string The value of the page's meta description. */ protected function renderArticle($id) { global $h, $s, $title, $description; $article = Realblog_Article::findById($id); if (isset($article)) { $title .= $h[$s] . " – " . $article->getTitle(); $description = $this->getDescription($article); $view = new Realblog_ArticleView($id, $article, $this->getPage()); return $view->render(); } }
/** * Renders the article form. * * @param string $id An article ID. * @param string $action An action. * * @return string (X)HTML. * * @global string The page title. * @global array The configuration of the plugins. * @global array The localization of the plugins. * @global Realblog_Controller The plugin controller. */ protected function form($id, $action) { global $title, $plugin_cf, $plugin_tx, $_Realblog_controller; if ($action == 'add_realblog') { $article = Realblog_Article::makeFromRecord(array(REALBLOG_ID => 0, REALBLOG_DATE => time(), REALBLOG_STARTDATE => time(), REALBLOG_ENDDATE => 2147483647, REALBLOG_STATUS => 0, REALBLOG_FRONTPAGE => '', REALBLOG_TITLE => '', REALBLOG_HEADLINE => '', REALBLOG_STORY => '', REALBLOG_RSSFEED => '', REALBLOG_COMMENTS => '')); $title = $plugin_tx['realblog']['tooltip_add']; } else { $article = Realblog_Article::findById($id); if ($action == 'modify_realblog') { $title = $plugin_tx['realblog']['tooltip_modify'] . ' [ID: ' . $id . ']'; } elseif ($action == 'delete_realblog') { $title = $plugin_tx['realblog']['tooltip_delete'] . ' [ID: ' . $id . ']'; } } $view = new Realblog_ArticleAdminView($article, $action); return $view->render(); }