cvs: pearweb /public_html/notes/admin index.php trans.php
| From: | David Coallier | Date: | Fri, 23 Mar 2007 05:04:31 +0000 |
| Subject: | cvs: pearweb /public_html/notes/admin index.php trans.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-45366@lists.php.net to get a copy of this message | ||
davidc Fri Mar 23 05:04:31 2007 UTC
Modified files:
/pearweb/public_html/notes/admin index.php trans.php
Log:
- Added so we can move approved comments to pending status and so on
http://cvs.php.net/viewvc.cgi/pearweb/public_html/notes/admin/index.php?r1=1.3&r2=1.4&diff_format=u
Index: pearweb/public_html/notes/admin/index.php
diff -u pearweb/public_html/notes/admin/index.php:1.3 pearweb/public_html/notes/admin/index.php:1.4
--- pearweb/public_html/notes/admin/index.php:1.3 Thu Mar 22 18:14:16 2007
+++ pearweb/public_html/notes/admin/index.php Fri Mar 23 05:04:31 2007
@@ -8,10 +8,26 @@
$manualNotes = new Manual_Notes;
+$status = 'pending';
+$action = 'approveMass';
+$title = 'Approve Pending User Notes';
+$button = 'Approve selected comments';
+$caption = 'Approve';
+$name = 'approve';
+
+if (isset($_GET['status']) && $_GET['status'] == 'approved')
{
+ $status = 'yes';
+ $action = 'updateApproved';
+ $title = 'Move Approved Comments to pending';
+ $button = 'Make pending selected notes';
+ $caption = 'Pending';
+ $name = 'pending';
+}
+
if (isset($_GET['url']) && !empty($_GET['url'])) {
- $pendingComments = $manualNotes->getPageComments($_GET['url'],
'pending');
+ $pendingComments = $manualNotes->getPageComments($_GET['url'], $status);
} else {
- $pendingComments = $manualNotes->getPageComments('', 'pending', true);
+ $pendingComments = $manualNotes->getPageComments('', $status, true);
}
$url = isset($_GET['url']) ? strip_tags($_GET['url']) : '';
http://cvs.php.net/viewvc.cgi/pearweb/public_html/notes/admin/trans.php?r1=1.5&r2=1.6&diff_format=u
Index: pearweb/public_html/notes/admin/trans.php
diff -u pearweb/public_html/notes/admin/trans.php:1.5 pearweb/public_html/notes/admin/trans.php:1.6
--- pearweb/public_html/notes/admin/trans.php:1.5 Thu Mar 22 18:14:16 2007
+++ pearweb/public_html/notes/admin/trans.php Fri Mar 23 05:04:31 2007
@@ -12,7 +12,40 @@
}
switch ($action) {
- case 'updatemass':
+ case 'updateapproved':
+
+ if (isset($_POST['noteIds']) && is_array($_POST['noteIds'])) {
+ if (isset($_POST['pending'])) {
+ $notes = $manualNotes->updateCommentList($_POST['noteIds'],
'pending');
+ } elseif (isset($_POST['delete'])) {
+ $notes = $manualNotes->updateCommentList($_POST['noteIds'],
'no');
+ } else {
+ $notes = PEAR::raiseError('Neither delete nor approve was selected');
+ }
+
+ if (PEAR::isError($notes)) {
+ $error = 'Error while making the comments pending, contact webmaster';
+ } else {
+ $message = 'Comment(s) successfully ';
+ $message .= isset($_POST['pending']) ? 'pending' :
'deleted';
+ }
+ $_GET = $_POST;
+
+ include dirname(__FILE__) . '/index.php';
+ exit;
+ }
+
+ if (isset($_POST['url']) && !empty($_POST['url'])) {
+ $pendingComments = $manualNotes->getPageComments($_POST['url'],
'yes');
+ } else {
+ $pendingComments = $manualNotes->getPageComments('', 'yes',
true);
+ }
+
+ $url = isset($_POST['url']) ? strip_tags($_POST['url']) : '';
+ $error = '';
+ require dirname(dirname(dirname(dirname(__FILE__)))) .
'/templates/notes/note-manage-admin.tpl.php';
+ break;
+ case 'approvemass':
if (isset($_POST['noteIds']) && is_array($_POST['noteIds'])) {
if (isset($_POST['approve'])) {
$notes = $manualNotes->updateCommentList($_POST['noteIds'],
'yes');