From 5ffe855a7494c1cf1a64254062930e10b5779bf3 Mon Sep 17 00:00:00 2001 From: real_nowhereman Date: Fri, 27 Feb 2009 16:22:38 +0000 Subject: [PATCH] forgot to commit the actual comment editor panel :D --- admin/panels/entry/admin.entry.commedit.php | 52 +++++++++++++++++++++ admin/panels/entry/admin.entry.commedit.tpl | 34 ++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 admin/panels/entry/admin.entry.commedit.php create mode 100644 admin/panels/entry/admin.entry.commedit.tpl diff --git a/admin/panels/entry/admin.entry.commedit.php b/admin/panels/entry/admin.entry.commedit.php new file mode 100644 index 0000000..9c63d35 --- /dev/null +++ b/admin/panels/entry/admin.entry.commedit.php @@ -0,0 +1,52 @@ +nosuchcomment = !comment_exists($_REQUEST['entry'], $_REQUEST['comment']); + $this->smarty->assign('entryid', $_REQUEST['entry']); + $this->smarty->assign('id', $_REQUEST['comment']); + } + + function main() { + if ($this->nosuchcomment) return PANEL_REDIRECT_DEFAULT; + + $e = entry_parse($_REQUEST['entry']); + if ($e) { + $this->smarty->assign('entrysubject', $e['subject']); + } else return PANEL_REDIRECT_DEFAULT; + + $comment = comment_parse($_REQUEST['entry'], $_REQUEST['comment']); + if ($comment) { + $this->smarty->assign('values', $comment); + } else return PANEL_REDIRECT_DEFAULT; + + + + } + + function onsave($content) { + if ($this->nosuchcomment) return PANEL_REDIRECT_DEFAULT; + + $comment = comment_parse($_REQUEST['entry'],$_REQUEST['comment']); + $content['ip-address'] = $comment['ip-address']; + $content['date'] = $comment['date']; + $success = comment_save($_REQUEST['entry'], $content); + $this->smarty->assign('success', $success? 1 : -1); + return PANEL_REDIRECT_CURRENT; + } + +} diff --git a/admin/panels/entry/admin.entry.commedit.tpl b/admin/panels/entry/admin.entry.commedit.tpl new file mode 100644 index 0000000..27031fa --- /dev/null +++ b/admin/panels/entry/admin.entry.commedit.tpl @@ -0,0 +1,34 @@ +

{$plang.head} {$entrysubject}

+

{$plang.descr}

+ + +{html_form} + + {include file='shared:errorlist.tpl'} + + + + +

+
+

+ +


+

+ +


+

+ + + +


+

+ +
+ +
+ +{/html_form} + +