Changeset 58
- Timestamp:
- 02/24/05 19:45:33
- Files:
-
- trunk/plugins/spamlookup/mt-spamlookup.cgi (modified) (4 diffs)
- trunk/plugins/spamlookup/tmpl/comments.tmpl (modified) (4 diffs)
- trunk/plugins/spamlookup/tmpl/despam.tmpl (modified) (3 diffs)
- trunk/plugins/spamlookup/tmpl/pings.tmpl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugins/spamlookup/mt-spamlookup.cgi
r57 r58 90 90 } 91 91 92 my @ids = $query->param('is_spam'); 93 if (my $action = $query->param('action')) { 94 if ($action =~ m/Delete/) { 95 $app->delete_these($type, \@ids); 96 } elsif ($action =~ m/Approve/) { 97 $app->approve_these($type, \@ids); 98 } elsif ($action =~ m/Moderate/) { 99 $app->moderate_these($type, \@ids); 92 my $method = $app->request_method; 93 94 if ($method eq 'POST') { 95 my @ids = $query->param('id'); 96 if (my $action = $query->param('action')) { 97 if ($action eq 'delete') { 98 $app->delete_these($type, \@ids); 99 } elsif ($action eq 'approve') { 100 $app->approve_these($type, \@ids); 101 } elsif ($action eq 'moderate') { 102 $app->moderate_these($type, \@ids); 103 } 100 104 } 101 105 } … … 127 131 128 132 my %to_rebuild; 129 my @ids = $query->param('i s_spam');133 my @ids = $query->param('id'); 130 134 my $action = $query->param('action'); 131 135 $app->select_objects(\%param); … … 743 747 $param{"commentpass_entryfield_".$param{"commentpass_entryfield"}} = 1; 744 748 } 745 if (defined $MT::Plugin::Moderate::VERSION) {746 $param{can_moderate_pings} = 1;747 }748 749 749 750 $app->build_page('config.tmpl', \%param); … … 788 789 $param->{top_blog_loop} = \@data; 789 790 } 791 if (defined $MT::Plugin::Moderate::VERSION) { 792 $param->{can_moderate_pings} = 1; 793 } 790 794 $app->SUPER::build_page($file, $param); 791 795 } trunk/plugins/spamlookup/tmpl/comments.tmpl
r57 r58 26 26 el = getByID(sel.name+"_"+id+"_prefs"); 27 27 if (el) el.style.display = ''; 28 } 29 function confirmAction(action,fld) { 30 var flds = document.getElementsByName(fld); 31 var frm = flds[0].form; 32 var count = 0; 33 for (i = 0; i < flds.length; i++) 34 if (flds[i].checked) count++; 35 if (count == 0) { 36 alert("You must select one or more comments to continue."); 37 } else { 38 if (confirm("Are you sure you want to "+action+" the "+count+" comment" + (count > 1 ? "s" : "") +" you have selected?")) { 39 frm['action'].value = action; 40 frm.submit(); 41 } 42 } 43 return false; 28 44 } 29 45 // --> … … 102 118 <th width="15%"><MT_TRANS phrase="Entry"></th> 103 119 <th width="12%"><MT_TRANS phrase="Date"></th> 104 <th width="5%"><a href="#" onclick="toggle('i s_spam')"><MT_TRANS phrase="Mark"></a></th>120 <th width="5%"><a href="#" onclick="toggle('id')"><MT_TRANS phrase="Mark"></a></th> 105 121 </tr> 106 122 … … 141 157 <td><a href="<TMPL_VAR NAME=MT_URL>?__mode=view&_type=entry&blog_id=<TMPL_VAR NAME=BLOG_ID>&id=<TMPL_VAR NAME=ENTRY_ID>"><TMPL_VAR NAME=ENTRY_TITLE ESCAPE=HTML></a> (Weblog: <TMPL_VAR NAME=BLOG_NAME>)</td> 142 158 <td><TMPL_VAR NAME=CREATED_ON_RELATIVE_DATE></td> 143 <td><input type="checkbox" name="i s_spam" value="<TMPL_VAR NAME=ID>" /></td>159 <td><input type="checkbox" name="id" value="<TMPL_VAR NAME=ID>" /></td> 144 160 </tr> 145 161 </TMPL_LOOP> … … 152 168 <input type="hidden" name="_type" value="<TMPL_VAR NAME=TYPE>" /> 153 169 <input type="hidden" name="limit" value="<TMPL_VAR NAME=LIMIT>" /> 154 <input type="hidden" name="offset" value="<TMPL_VAR NAME=OFFSET>" /> 155 <input type="button" onclick="checkAll('is_spam',true)" name="check_all" value="<MT_TRANS phrase="Check All">" /> 156 <input type="button" onclick="checkAll('is_spam',false)" name="uncheck_all" value="<MT_TRANS phrase="Uncheck All">" /> 157 <input type="button" onclick="doRemoveItems(this.form, 'comment', 'comments', 'is_spam')" name="delete_comments" value="<MT_TRANS phrase="Delete">" /> 158 <input type="submit" name="action" value="Approve" /> 159 <input type="submit" name="action" value="Moderate" /> 170 <input type="hidden" name="action" value="" /> 171 <input type="hidden" name="offset" value="<TMPL_VAR NAME=OFFSET_VAL>" /> 172 <input type="button" onclick="checkAll('id',true)" name="check_all" value="<MT_TRANS phrase="Check All">" /> 173 <input type="button" onclick="checkAll('id',false)" name="uncheck_all" value="<MT_TRANS phrase="Uncheck All">" /> 174 <input type="button" onclick="confirmAction('delete', 'id')" name="btn_delete" value="<MT_TRANS phrase="Delete">" /> 175 <input type="button" name="btn_approve" value="Approve" onclick="confirmAction('approve', 'id')" /> 176 <input type="button" name="btn_moderate" value="Moderate" onclick="confirmAction('moderate', 'id')" /> 160 177 </div> 161 178 trunk/plugins/spamlookup/tmpl/despam.tmpl
r54 r58 59 59 <th width="20%"><MT_TRANS phrase="Source"></th> 60 60 </TMPL_IF> 61 <th width="5%"><a href="#" onclick="toggle('i s_spam')"><MT_TRANS phrase="Mark"></a></th>61 <th width="5%"><a href="#" onclick="toggle('id')"><MT_TRANS phrase="Mark"></a></th> 62 62 </tr> 63 63 … … 83 83 <td><TMPL_VAR NAME=CREATED_ON_RELATIVE_DATE></td> 84 84 <td><TMPL_VAR NAME=IP></td> 85 <td><input type="checkbox" name="i s_spam" value="<TMPL_VAR NAME=ID>" /></td>85 <td><input type="checkbox" name="id" value="<TMPL_VAR NAME=ID>" /></td> 86 86 </tr> 87 87 <tr class="<TMPL_IF NAME=IS_ODD>odd<TMPL_ELSE>even</TMPL_IF>"> … … 112 112 <a href="<TMPL_VAR NAME=MT_URL>?__mode=list_pings&blog_id=<TMPL_VAR NAME=BLOG_ID>&filter=blog_name&filter_val=<TMPL_VAR NAME=TB_BLOG_NAME ESCAPE=URL>"><img border=0 src="<TMPL_VAR NAME="STATIC_URI">images/filter.gif"><TMPL_VAR NAME=TB_BLOG_NAME ESCAPE=HTML></a> (<a href="<TMPL_VAR NAME="MT_URL">?__mode=list_pings&blog_id=<TMPL_VAR NAME="BLOG_ID">&filter=ip&filter_val=<TMPL_VAR NAME=IP ESCAPE=URL>"><TMPL_VAR NAME=IP ESCAPE=HTML></a>) 113 113 </td> 114 <td><input type="checkbox" name="i s_spam" value="<TMPL_VAR NAME=ID>" /></td>114 <td><input type="checkbox" name="id" value="<TMPL_VAR NAME=ID>" /></td> 115 115 </tr> 116 116 <tr class="<TMPL_IF NAME=IS_ODD>odd<TMPL_ELSE>even</TMPL_IF>"> trunk/plugins/spamlookup/tmpl/pings.tmpl
r57 r58 24 24 el = getByID(sel.name+"_"+id+"_prefs"); 25 25 if (el) el.style.display = ''; 26 } 27 function confirmAction(action,fld) { 28 var flds = document.getElementsByName(fld); 29 var frm = flds[0].form; 30 var count = 0; 31 for (i = 0; i < flds.length; i++) 32 if (flds[i].checked) count++; 33 if (count == 0) { 34 alert("You must select one or more TrackBack pings to continue."); 35 } else { 36 if (confirm("Are you sure you want to "+action+" the "+count+" TrackBack ping" + (count > 1 ? "s" : "") +" you have selected?")) { 37 frm['action'].value = action; 38 frm.submit(); 39 } 40 } 41 return false; 26 42 } 27 43 // --> … … 51 67 <input type="hidden" name="_type" value="pings" /> 52 68 69 <TMPL_IF NAME=CAN_MODERATE_PINGS> 53 70 <MT_TRANS phrase="Show pings where"> 54 71 <select name="filter" onchange="selectPrefs(this)"><option value="message"><MT_TRANS phrase="Message"></option> … … 56 73 </select> 57 74 <span id="filter_message_prefs"> 58 <MT_TRANS phrase="contains"> <input name="filter_val" value="" /> 75 <MT_TRANS phrase="contains"> 76 <input name="filter_val" value="" /> 59 77 </span> 60 78 <span id="filter_status_prefs" style="display: none"> … … 65 83 </select> 66 84 </span> 85 <TMPL_ELSE> 86 <MT_TRANS phrase="Show pings where"> 87 <MT_TRANS phrase="Message"> 88 <MT_TRANS phrase="contains"> <input name="filter_val" value="" /> 89 </TMPL_IF> 67 90 <input type="submit" value="<MT_TRANS phrase="Filter">" /> 68 91 … … 92 115 93 116 <tr> 117 <TMPL_IF NAME=CAN_MODERATE_PINGS> 94 118 <th width="5%">Status</th> 95 119 <th width="20%"><MT_TRANS phrase="Title"></th> 96 120 <th width="20%"><MT_TRANS phrase="Excerpt"></th> 121 <TMPL_ELSE> 122 <th width="20%"><MT_TRANS phrase="Title"></th> 123 <th width="25%"><MT_TRANS phrase="Excerpt"></th> 124 </TMPL_IF> 97 125 <th width="15%"><MT_TRANS phrase="Entry/Category"></th> 98 126 <th width="15%"><MT_TRANS phrase="Date"></th> 99 127 <th width="20%"><MT_TRANS phrase="Source"></th> 100 <th width="5%"><a href="#" onclick="toggle('i s_spam')"><MT_TRANS phrase="Mark"></a></th>128 <th width="5%"><a href="#" onclick="toggle('id')"><MT_TRANS phrase="Mark"></a></th> 101 129 </tr> 102 130 … … 104 132 105 133 <tr class="<TMPL_IF NAME=IS_ODD>odd<TMPL_ELSE>even</TMPL_IF>"> 106 <td><!-- status --></td> 134 <TMPL_IF NAME=CAN_MODERATE_PINGS> 135 <td style="font-size: 10px; text-align: center; vertical-align: top;"> 136 <TMPL_IF NAME=CREATED_BY> 137 <img src="<TMPL_VAR NAME=STATIC_URI>images/author-pending.gif" alt="<MT_TRANS phrase="Pending">" width="8" height="8" /><br /><span class="pending"><MT_TRANS phrase="Pending"></span> 138 <TMPL_ELSE> 139 <img src="<TMPL_VAR NAME=STATIC_URI>images/author-approved.gif" alt="<MT_TRANS phrase="Approved">" width="8" height="8" /><br /><span class="approved"><MT_TRANS phrase="Approved"></span> 140 </TMPL_IF> 141 </td> 142 </TMPL_IF> 107 143 <td><TMPL_VAR NAME=TITLE ESCAPE=HTML></td> 108 144 <td><TMPL_VAR NAME=EXCERPT ESCAPE=HTML></td> … … 120 156 <a href="<TMPL_VAR NAME=MT_URL>?__mode=list_pings&blog_id=<TMPL_VAR NAME=BLOG_ID>&filter=blog_name&filter_val=<TMPL_VAR NAME=TB_BLOG_NAME ESCAPE=URL>"><img border=0 src="<TMPL_VAR NAME="STATIC_URI">images/filter.gif"><TMPL_VAR NAME=TB_BLOG_NAME ESCAPE=HTML></a> (<a href="<TMPL_VAR NAME="MT_URL">?__mode=list_pings&blog_id=<TMPL_VAR NAME="BLOG_ID">&filter=ip&filter_val=<TMPL_VAR NAME=IP ESCAPE=URL>"><TMPL_VAR NAME=IP ESCAPE=HTML></a>) 121 157 </td> 122 <td><input type="checkbox" name="i s_spam" value="<TMPL_VAR NAME=ID>" /></td>158 <td><input type="checkbox" name="id" value="<TMPL_VAR NAME=ID>" /></td> 123 159 </tr> 124 160 </TMPL_LOOP> … … 127 163 128 164 <div align="right"> 129 <input type="hidden" name="__mode" value=" despam" />165 <input type="hidden" name="__mode" value="view" /> 130 166 <input type="hidden" name="_type" value="<TMPL_VAR NAME=TYPE>" /> 131 167 <input type="hidden" name="limit" value="<TMPL_VAR NAME=LIMIT>" /> 132 <input type="hidden" name="offset" value="<TMPL_VAR NAME=OFFSET>" /> 133 <input type="button" onclick="checkAll('is_spam',true)" name="check_all" value="<MT_TRANS phrase="Check All">" /> 134 <input type="button" onclick="checkAll('is_spam',false)" name="uncheck_all" value="<MT_TRANS phrase="Uncheck All">" /> 135 <input type="button" onclick="doRemoveItems('is_spam', 'ping', 'pings')" name="delete_pings" value="<MT_TRANS phrase="Delete">" /> 136 <input type="submit" name="action" value="Approve" /> 137 <input type="submit" name="action" value="Moderate" /> 168 <input type="hidden" name="offset" value="<TMPL_VAR NAME=OFFSET_VAL>" /> 169 <input type="hidden" name="action" value="" /> 170 <input type="button" onclick="checkAll('id',true)" name="check_all" value="<MT_TRANS phrase="Check All">" /> 171 <input type="button" onclick="checkAll('id',false)" name="uncheck_all" value="<MT_TRANS phrase="Uncheck All">" /> 172 <input type="button" onclick="confirmAction('delete', 'id')" name="delete" value="<MT_TRANS phrase="Delete">" /> 173 <TMPL_IF NAME=CAN_MODERATE_PINGS> 174 <input type="button" name="approve" value="Approve" onclick="confirmAction('approve', 'id')" /> 175 <input type="button" name="moderate" value="Moderate" onclick="confirmAction('moderate', 'id')" /> 176 </TMPL_IF> 138 177 </div> 139 178
