Example #1
0
 } catch (Exception $e) {
     if ($e->getCode() == ARTICLE_NOT_EXIST) {
         header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=articles"));
         exit;
     } else {
         header("Location: " . orongoURL("orongo-admin/index.php?msg=2"));
         exit;
     }
 }
 $form = new AdminFrontendForm(100, l("Article") . ": " . $article->getTitle(), "GET", "", false);
 $form->addInput("ID", "id", "text", $article->getID(), false, true);
 $form->addInput("Date", "date", "text", $article->getDate(), false, true);
 $form->addInput("Author", "author", "text", $article->getAuthorName(), false, true);
 $form->addInput("Article Title", "title", "text", $article->getTitle(), false, true);
 $form->addInput("Article Content", "content", "ckeditor", $article->getContent(), false, true);
 $form->addInput("Keywords", "keywords", "text", $article->getTagsString(), false, true);
 $form->addButton("Delete", false, orongoURL("orongo-admin/delete.php?article." . $id));
 $form->addButton("Edit", false, orongoURL("orongo-admin/edit.php?article." . $id));
 $view->addObject($form);
 if ($article->getCommentCount() > 0) {
     $comments = new AdminFrontendContentManager(100, "Comments");
     $comments->createTab("Comments", array("ID", "Comment", "Commenter", "Date"));
     $comments->hideEditButton();
     foreach ($article->getComments() as $comment) {
         $commentText = strlen($comment->getContent()) > 20 ? substr($comment->getContent(), 0, 20) . "..." : $comment->getContent();
         $comments->addItem("Comments", array($comment->getID(), '<a href="' . orongoURL('orongo-admin/view.php?comment.' . $comment->getID()) . '">' . $commentText . '</a>', '<a href="' . orongoURL("orongo-admin/view.php?user." . $comment->getAuthorID()) . '">' . $comment->getAuthorName() . '</a>', date("Y-m-d H:i:s", $comment->getTimestamp())), orongoURL("orongo-admin/delete.php?comment." . $comment->getID()), "");
     }
     $view->addObject($comments);
 }
 if (getUser()->getRank() < RANK_ADMIN) {
     $comments->hideTrashButton();
Example #2
0
     $create->setTitle("Edit Article");
     try {
         $article = new Article($id);
     } catch (Exception $e) {
         if ($e->getCode() == ARTICLE_NOT_EXIST) {
             header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=articles"));
             exit;
         } else {
             header("Location: " . orongoURL("orongo-admin/index.php?msg=2"));
             exit;
         }
     }
     $form = new AdminFrontendForm(100, l("Edit Article") . " (" . $article->getID() . ")", "POST", orongoURL("actions/action_Edit.php?article." . $article->getID()), false);
     $form->addInput("Article Title", "title", "text", $article->getTitle(), true);
     $form->addInput("Article Content", "content", "ckeditor", $article->getContent(), true);
     $form->addInput("Tags", "tags", "text", $article->getTagsString());
     $form->addButton("Save", true);
     $create->addObject($form);
     $create->render();
     break;
 case "user":
     $create->setTitle("Edit User");
     try {
         $user = new User($id);
     } catch (Exception $e) {
         if ($e->getCode() == USER_NOT_EXIST) {
             header("Location: " . orongoURL("orongo-admin/manage.php?msg=0&obj=users"));
             exit;
         } else {
             header("Location: " . orongoURL("orongo-admin/index.php?msg=2"));
             exit;