2009-01-07 09:08:53 +00:00
< ? php defined ( " SYSPATH " ) or die ( " No direct script access. " ) ?>
2009-01-08 02:50:23 +00:00
< script type = " text/javascript " >
var set_state_url =
" <?= url::site( " admin / comments / set_state / __ID__ / __STATE__ ? csrf = " . access::csrf_token()) ?> " ;
function set_state ( state , id ) {
2009-01-10 07:55:16 +00:00
$ . get ( set_state_url . replace ( " __STATE__ " , state ) . replace ( " __ID__ " , id ),
{},
function () {
$ ( " #gComment- " + id ) . slideUp ();
update_menu ();
});
2009-01-08 02:50:23 +00:00
}
var delete_url =
" <?= url::site( " admin / comments / delete / __ID__ ? csrf = " . access::csrf_token()) ?> " ;
2009-01-10 07:55:16 +00:00
function del ( id ) {
$ . get ( delete_url . replace ( " __ID__ " , id ),
{},
function () {
$ ( " #gComment- " + id ) . slideUp ();
update_menu ();
});
}
function update_menu () {
$ . get ( " <?= url::site( " admin / comments / menu_labels " ) ?> " , {},
function ( data ) {
for ( var i = 0 ; i < data . length ; i ++ ) {
$ ( " #gAdminCommentsMenu li:eq( " + i + " ) a " ) . html ( data [ i ]);
}
},
" json " );
}
2009-01-08 02:50:23 +00:00
</ script >
2009-01-07 09:08:53 +00:00
< div id = " gAdminComments " >
2009-01-08 17:13:06 +00:00
< h1 > < ? = t ( " Manage Comments " ) ?> </h1>
2009-01-07 09:08:53 +00:00
2009-01-09 08:08:22 +00:00
<!-- @ todo : Highlight active menu option -->
2009-01-07 09:08:53 +00:00
< div id = " gAdminCommentsMenu " >
< ? = $menu ?>
</ div >
2009-01-09 08:08:22 +00:00
<!-- @ todo : Remove after setting active option ? -->
2009-01-08 02:50:23 +00:00
< h2 >
< ? = $title ?>
</ h2 >
< ? if ( $queue == " spam " ) : ?>
< div >
2009-01-10 00:34:23 +00:00
< ? if ( $spam_caught > 0 ) : ?>
2009-01-08 02:50:23 +00:00
< p >
2009-01-08 17:13:06 +00:00
< ? = t ( array ( " one " => " Gallery has caught { { count}} spam for you since you installed spam filtering. " ,
" other " => " Gallery has caught { { count}} spam for you since you installed spam filtering. " ),
array ( " count " => $spam_caught )) ?>
2009-01-08 02:50:23 +00:00
</ p >
2009-01-10 00:34:23 +00:00
< ? endif ?>
2009-01-08 02:50:23 +00:00
< p >
< ? if ( $spam -> count ()) : ?>
2009-01-08 17:13:06 +00:00
< ? = t ( array ( " one " => " There is currently one comment in your spam queue. You can delete it with a single click, but there is no undo operation so you may want to check the message first to make sure that it really is spam. " ,
" other " => " There are currently { { count}} comments in your spam queue. You can delete them all with a single click, but there is no undo operation so you may want to check the messages first to make sure that they really are spam. " ),
array ( " count " => $spam -> count ())) ?>
2009-01-08 02:50:23 +00:00
</ p >
< p >
< a href = " <?= url::site( " admin / comments / delete_all_spam ? csrf = " . access::csrf_token()) ?> " >
2009-01-08 17:13:06 +00:00
< ? = t ( " Delete all spam " ) ?>
2009-01-08 02:50:23 +00:00
</ a >
< ? else : ?>
2009-01-08 17:13:06 +00:00
< ? = t ( " Your spam queue is empty! " ) ?>
2009-01-08 02:50:23 +00:00
< ? endif ?>
</ p >
</ div >
< ? endif ?>
2009-01-10 00:34:23 +00:00
2009-01-09 07:33:22 +00:00
< form id = " gBulkAction " action = " # " method = " post " >
< label for = " bulk_actions " >< ? = t ( " Bulk actions " ) ?> </label>
< select id = " bulk_actions " >
< option ></ option >
< option >< ? = t ( " Unapprove " ) ?> </option>
< option >< ? = t ( " Spam " ) ?> </option>
< option >< ? = t ( " Delete " ) ?> </option>
</ select >
< input type = " submit " value = " Apply " />
2009-01-10 00:34:23 +00:00
2009-01-09 07:33:22 +00:00
< table id = " gAdminCommentsList " >
< tr >
< th >
< input type = " checkbox " />
</ th >
< th >
< ? = t ( " Author " ) ?>
</ th >
< th >
< ? = t ( " Comment " ) ?>
</ th >
< th >
< ? = t ( " Date " ) ?>
</ th >
< th >
< ? = t ( " Actions " ) ?>
</ th >
< th >
< ? = t ( " Subject " ) ?>
</ th >
</ tr >
< ? foreach ( $comments as $comment ) : ?>
< tr id = " gComment-<?= $comment->id ?> " >
< td >
< input type = " checkbox " name = " delete_comments[] " value = " <?= $comment->id ?> " />
</ td >
< td >
2009-01-10 06:18:35 +00:00
< a href = " # " >< img width = " 40 " height = " 40 "
src = " <?= $user->avatar_url (40, $theme->url ( " images / avatar . jpg " )) ?> "
2009-01-10 05:56:11 +00:00
class = " gAvatar " alt = " <?= $comment->author_name () ?> " /></ a >
< br />
2009-01-10 00:34:23 +00:00
< a href = " mailto:<?= $comment->author_email () ?> "
title = " <?= $comment->author_email () ?> " > < ? = $comment -> author_name () ?> </a>
2009-01-09 07:33:22 +00:00
</ td >
< td >
< ? = $comment -> text ?>
</ td >
< td >
< ? = date ( " Y-M-d " , $comment -> created ); ?>
</ td >
< td >
< ul >
< ? if ( $comment -> state != " unpublished " ) : ?>
< li >
< a href = " javascript:set_state('unpublished',<?= $comment->id ?>) " >
< ? = t ( " Unapprove " ) ?>
</ a >
</ li >
< ? endif ?>
2009-01-10 00:34:23 +00:00
2009-01-09 07:33:22 +00:00
< ? if ( $comment -> state != " published " ) : ?>
< li >
< a href = " javascript:set_state('published',<?= $comment->id ?>) " >
< ? = t ( " Approve " ) ?>
</ a >
</ li >
< ? endif ?>
2009-01-10 00:34:23 +00:00
2009-01-09 07:33:22 +00:00
< ? if ( $comment -> state != " spam " ) : ?>
< li >
< a href = " javascript:set_state('spam',<?= $comment->id ?>) " >
< ? = t ( " Spam " ) ?>
</ a >
</ li >
< ? endif ?>
2009-01-10 00:34:23 +00:00
2009-01-09 07:33:22 +00:00
< li >
< a href = " javascript:reply(<?= $comment->id ?>) " >
< ? = t ( " Reply " ) ?>
</ a >
</ li >
2009-01-10 11:11:24 +00:00
2009-01-09 07:33:22 +00:00
< li >
< a href = " javascript:Edit(<?= $comment->id ?>) " >
< ? = t ( " Edit " ) ?>
</ a >
</ li >
2009-01-10 11:11:24 +00:00
2009-01-09 07:33:22 +00:00
< li >
2009-01-10 11:11:24 +00:00
< a href = " javascript:set_state('deleted',<?= $comment->id ?>) " >
2009-01-09 07:33:22 +00:00
< ? = t ( " Delete " ) ?>
</ a >
</ li >
</ ul >
</ td >
< td >
< ? $item = $comment -> item (); ?>
< a href = " <?= $item->url () ?> " >
< img src = " <?= $item->thumb_url () ?> "
alt = " <?= $item->title ?> "
< ? = photo :: img_dimensions ( $item -> thumb_width , $item -> thumb_height , 75 ) ?>
/>
</ a >
< a href = " <?= $item->url () ?> " > < ? = $item -> title ?> </a>
</ td >
</ tr >
< ? endforeach ?>
</ table >
</ form >
2009-01-10 00:34:23 +00:00
2009-01-08 02:50:23 +00:00
< div class = " pager " >
< ? = $pager ?>
</ div >
2009-01-07 09:08:53 +00:00
</ div >