コード例 #1
0
ファイル: manage.php プロジェクト: JacoRuit/orongocms
         $commentText = strlen($obj->getContent()) > 20 ? substr($obj->getContent(), 0, 20) . "..." : $obj->getContent();
         $manager->addItem("Comments", array($obj->getID(), '<a href="' . orongoURL('orongo-admin/view.php?comment.' . $obj->getID()) . '">' . $commentText . '</a>', '<a href="' . orongoURL("orongo-admin/view.php?user." . $obj->getAuthorID()) . '">' . $obj->getAuthorName() . '</a>', date("Y-m-d H:i:s", $obj->getTimestamp()), $obj->getArticleID(), '<a href="' . orongoURL('orongo-admin/view.php?article.' . $obj->getArticleID()) . '">' . $articleName . '</a>'), orongoURL("orongo-admin/delete.php?comment." . $obj->getID()), "");
     }
     if (getUser()->getRank() < RANK_ADMIN) {
         $manager->hideTrashButton();
     }
     $manage->addObject($manager);
     $manage->render();
     break;
 case "plugins":
     if (getUser()->getRank() < RANK_ADMIN) {
         header("Location: " . orongoURL("orongo-admin/index.php?msg=0"));
         exit;
     }
     $manage->setTitle("Manage Plugins");
     $manager = new AdminFrontendContentManager(100, "Plugins");
     $manager->hideTrashButton();
     $manager->hideEditButton();
     $manager->createTab("Installed Plugins", array("Plugin Name", "Plugin Description", "Author", "Author Website", "Version"));
     foreach (getPlugins() as $plugin) {
         if ($plugin instanceof OrongoPluggableObject == false) {
             continue;
         }
         $manager->addItem("Installed Plugins", array($plugin->getName(), $plugin->getDescription(), $plugin->getAuthorInfo('name'), '<a href="' . $plugin->getAuthorInfo('website') . '">' . $plugin->getAuthorInfo('website') . '</a>', $plugin->getVersionString(), "override_actions" => array("<a href='" . orongoURL("orongo-admin/plugin-uninstall.php?xml_path=" . urlencode(str_replace(ADMIN . '/plugins', "", $plugin->getInfoPath()))) . "'>" . l("Uninstall") . "</a>", "<a href='" . orongoURL("orongo-admin/plugin-settings.php?xml_path=" . urlencode(str_replace(ADMIN . '/plugins', "", $plugin->getInfoPath()))) . "'>" . l("Settings") . "</a>")), "", "");
     }
     $manager->createTab("Not installed plugins", array("Plugin Name", "Plugin Description", "Author", "Author Website"));
     $files = @scandir(ADMIN . '/plugins');
     if (is_array($files)) {
         foreach ($files as $file) {
             if (is_dir(ADMIN . '/plugins/' . $file)) {
                 $xmlFile = ADMIN . '/plugins/' . $file . '/info.xml';
コード例 #2
0
ファイル: view.php プロジェクト: JacoRuit/orongocms
             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();
     }
     $view->render();
     break;
 case "comment":
     if (getUser()->getRank() < RANK_WRITER) {