Changeset 5381
- Timestamp:
- Mar 26, 2010, 2:37:20 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/comments.php
r5196 r5381 39 39 // +-----------------------------------------------------------------------+ 40 40 41 if ( isset($_POST))41 if (!empty($_POST) and !is_adviser()) 42 42 { 43 $to_validate = array(); 44 $to_reject = array(); 45 46 if (isset($_POST['submit']) and !is_adviser()) 43 if (empty($_POST['comments'])) 47 44 { 48 foreach (explode(',', $_POST['list']) as $comment_id) 45 array_push( 46 $page['errors'], 47 l10n('Select at least one comment') 48 ); 49 } 50 else 51 { 52 check_input_parameter('comments', $_POST, true, PATTERN_ID); 53 54 if (isset($_POST['validate'])) 49 55 { 50 if (isset($_POST['action-'.$comment_id])) 51 { 52 switch ($_POST['action-'.$comment_id]) 53 { 54 case 'reject' : 55 { 56 array_push($to_reject, $comment_id); 57 break; 58 } 59 case 'validate' : 60 { 61 array_push($to_validate, $comment_id); 62 break; 63 } 64 } 65 } 66 } 67 } 68 else if (isset($_POST['validate-all']) and !empty($_POST['list']) and !is_adviser()) 69 { 70 $to_validate = explode(',', $_POST['list']); 71 } 72 else if (isset($_POST['reject-all']) and !empty($_POST['list']) and !is_adviser()) 73 { 74 $to_reject = explode(',', $_POST['list']); 75 } 76 77 if (count($to_validate) > 0) 78 { 79 $query = ' 56 $query = ' 80 57 UPDATE '.COMMENTS_TABLE.' 81 58 SET validated = \'true\' 82 59 , validation_date = NOW() 83 WHERE id IN ('.implode(',', $ to_validate).')60 WHERE id IN ('.implode(',', $_POST['comments']).') 84 61 ;'; 85 62 pwg_query($query); … … 89 66 l10n_dec( 90 67 '%d user comment validated', '%d user comments validated', 91 count($ to_validate)68 count($_POST['comments']) 92 69 ) 93 70 ); 94 }71 } 95 72 96 if (count($to_reject) > 0)97 {98 $query = '73 if (isset($_POST['reject'])) 74 { 75 $query = ' 99 76 DELETE 100 77 FROM '.COMMENTS_TABLE.' 101 WHERE id IN ('.implode(',', $ to_reject).')78 WHERE id IN ('.implode(',', $_POST['comments']).') 102 79 ;'; 103 pwg_query($query);80 pwg_query($query); 104 81 105 array_push( 106 $page['infos'], 107 l10n_dec( 108 '%d user comment rejected', '%d user comments rejected', 109 count($to_reject) 110 ) 111 ); 82 array_push( 83 $page['infos'], 84 l10n_dec( 85 '%d user comment rejected', '%d user comments rejected', 86 count($_POST['comments']) 87 ) 88 ); 89 } 112 90 } 113 91 } -
trunk/admin/themes/default/default-layout.css
r5371 r5381 789 789 790 790 .content .infos li, .content .errors li { list-style-type:square; } 791 792 .checkActions {text-align:left;padding:0;margin:0;} 793 .comment A:hover {border:none;} -
trunk/admin/themes/default/template/comments.tpl
r5123 r5381 1 {literal} 2 <script> 3 $(document).ready(function(){ 4 $(".checkComment").click(function () { 5 var checkbox = $(this).children("input[type=checkbox]"); 6 $(checkbox).attr('checked', !$(checkbox).is(':checked')); 7 }); 8 9 $("#commentSelectAll").click(function () { 10 $(".checkComment input[type=checkbox]").attr('checked', true); 11 return false; 12 }); 13 14 $("#commentSelectNone").click(function () { 15 $(".checkComment input[type=checkbox]").attr('checked', false); 16 return false; 17 }); 18 19 $("#commentSelectInvert").click(function () { 20 $(".checkComment input[type=checkbox]").each(function() { 21 $(this).attr('checked', !$(this).is(':checked')); 22 }); 23 return false; 24 }); 25 26 }); 27 </script> 28 {/literal} 29 1 30 <div class="titrePage"> 2 31 <h2>{'Waiting'|@translate} {$TABSHEET_TITLE}</h2> … … 8 37 <form method="post" action="{$F_ACTION}"> 9 38 10 {foreach from=$comments item=comment} 39 <table width="99%"> 40 {foreach from=$comments item=comment name=comment} 41 <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}"> 42 <td style="width:50px;" class="checkComment"> 43 <input type="checkbox" name="comments[]" value="{$comment.ID}"> 44 </td> 45 <td> 11 46 <div class="comment"> 12 47 <a class="illustration" href="{$comment.U_PICTURE}"><img src="{$comment.TN_SRC}"></a> … … 14 49 <blockquote>{$comment.CONTENT}</blockquote> 15 50 </div> 16 <ul class="actions"> 17 <li><label><input type="radio" name="action-{$comment.ID}" value="reject">{'Reject'|@translate}</label></li> 18 <li><label><input type="radio" name="action-{$comment.ID}" value="validate">{'Validate'|@translate}</label></li> 19 </ul> 51 </td> 52 </tr> 20 53 {/foreach} 54 </table> 55 56 <p class="checkActions"> 57 {'Select:'|@translate} 58 <a href="#" id="commentSelectAll">{'All'|@translate}</a>, 59 <a href="#" id="commentSelectNone">{'None'|@translate}</a>, 60 <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a> 61 </p> 21 62 22 63 <p class="bottomButtons"> 23 <input type="hidden" name="list" value="{$LIST}"> 24 <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED}> 25 <input class="submit" type="submit" name="validate-all" value="{'Validate All'|@translate}" {$TAG_INPUT_ENABLED}> 26 <input class="submit" type="submit" name="reject-all" value="{'Reject All'|@translate}" {$TAG_INPUT_ENABLED}> 27 <input class="submit" type="reset" value="{'Reset'|@translate}"> 64 <input class="submit" type="submit" name="validate" value="{'Validate'|@translate}" {$TAG_INPUT_ENABLED}> 65 <input class="submit" type="submit" name="reject" value="{'Reject'|@translate}" {$TAG_INPUT_ENABLED}> 28 66 </p> 29 67 -
trunk/language/en_UK/admin.lang.php
r5371 r5381 756 756 $lang['Add New Language'] = 'Add New Language'; 757 757 $lang['Language has been successfully installed'] = 'Language has been successfully installed'; 758 $lang['Select:'] = 'Select:'; 759 $lang['None'] = 'None'; 760 $lang['Invert'] = 'Invert'; 758 761 ?> -
trunk/language/fr_FR/admin.lang.php
r5373 r5381 761 761 $lang['Language has been successfully installed'] = 'La langue a été installée avec succès'; 762 762 $lang['Allow user customization'] = "Permettre la personnalisation de l'affichage"; 763 $lang['Select:'] = 'Sélectionner:'; 764 $lang['None'] = 'Rien'; 765 $lang['Invert'] = 'Inverser'; 763 766 ?>
Note: See TracChangeset
for help on using the changeset viewer.