Changeset 873492
- Timestamp:
- 03/11/2014 04:21:13 PM (12 years ago)
- Location:
- akismet/trunk
- Files:
-
- 7 edited
-
_inc/akismet.css (modified) (1 diff)
-
class.akismet-admin.php (modified) (4 diffs)
-
views/config.php (modified) (4 diffs)
-
views/get.php (modified) (1 diff)
-
views/notice.php (modified) (2 diffs)
-
views/start.php (modified) (5 diffs)
-
views/stats.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
akismet/trunk/_inc/akismet.css
r873047 r873492 337 337 } 338 338 339 .akismet-settings span.note{ 340 float: left; 341 padding-left: 23px; 342 font-size: 75%; 343 } 344 339 345 .clearfix { 340 346 clear:both; -
akismet/trunk/class.akismet-admin.php
r873435 r873492 40 40 // Redirect any links that might have been bookmarked or in browser history. 41 41 if ( isset( $_GET['page'] ) && 'akismet-stats-display' == $_GET['page'] ) { 42 wp_safe_redirect( admin_url( 'admin.php?page=akismet-key-config&view=stats' ), 301 );42 wp_safe_redirect( Akismet_Admin::get_page_url( 'stats', 'raw' ), 301 ); 43 43 die; 44 44 } … … 530 530 public function plugin_action_links( $links, $file ) { 531 531 if ( $file == plugin_basename( AKISMET__PLUGIN_URL . '/akismet.php' ) ) { 532 $links[] = '<a href="' . Akismet::get_ configuration_page_url() . '">'.__( 'Settings' ).'</a>';532 $links[] = '<a href="' . Akismet::get_page_url() . '">'.__( 'Settings' ).'</a>'; 533 533 } 534 534 … … 723 723 } 724 724 725 public static function get_configuration_page_url() { 726 return esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) ) ); 727 } 728 729 public static function get_stats_page_url() { 730 return esc_url( add_query_arg( array( 'page' => 'akismet-key-config', 'view' => 'stats' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) ) ); 731 } 732 733 public static function get_delete_key_url() { 734 return esc_url( add_query_arg( array( 'page' => 'akismet-key-config', 'view' => 'start', 'action' => 'delete-key', '_wpnonce' => wp_create_nonce( self::NONCE ) ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) ) ); 725 public static function get_page_url( $page = 'config', $escape = '' ) { 726 727 $args = array( 'page' => 'akismet-key-config' ); 728 729 if ( $page == 'stats' ) 730 $args = array( 'page' => 'akismet-key-config', 'view' => 'stats' ); 731 elseif ( $page == 'delete_key' ) 732 $args = array( 'page' => 'akismet-key-config', 'view' => 'start', 'action' => 'delete-key', '_wpnonce' => wp_create_nonce( self::NONCE ) ); 733 734 $url = add_query_arg( $args, class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) ); 735 736 return $escape == 'raw' ? esc_url_raw( $url ) : esc_url( $url ); 735 737 } 736 738 … … 759 761 760 762 public function display_page() { 761 if ( !Akismet::get_api_key() ) 762 $this->display_start_page(); 763 elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) 763 if ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) ) 764 764 $this->display_start_page(); 765 765 elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' ) -
akismet/trunk/views/config.php
r873032 r873492 10 10 11 11 <span style="float:right;margin:10px 15px -5px 0px"> 12 <a href="<?php echo Akismet_Admin::get_ stats_page_url();?>" class=""><?php _e( 'Summaries' );?></a>12 <a href="<?php echo Akismet_Admin::get_page_url( 'stats' );?>" class=""><?php _e( 'Summaries' );?></a> 13 13 </span> 14 14 … … 53 53 <div class="handlediv" title="Click to toggle"><br></div> 54 54 <h3 class="hndle"><span><?php _e( 'Settings' );?></span></h3> 55 <form name="akismet_conf" id="akismet-conf" action="<?php echo Akismet_Admin::get_ configuration_page_url();?>" method="POST">55 <form name="akismet_conf" id="akismet-conf" action="<?php echo Akismet_Admin::get_page_url();?>" method="POST"> 56 56 <div class="inside"> 57 <table cellspacing="0" >57 <table cellspacing="0" class="akismet-settings"> 58 58 <tbody> 59 59 <?php if ( !defined( 'WPCOM_API_KEY' ) ):?> … … 71 71 <td> 72 72 <p> 73 <label for="akismet_ discard_month" title="<?php esc_attr_e( 'Auto-detete old spam' ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <?php _e('Delete spam on posts more than a month old'); ?></label>73 <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <?php _e('Show the number of approved comments beside each comment author'); ?></label> 74 74 </p> 75 75 <p> 76 <label for="akismet_ show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <?php _e('Show the number of approved comments beside each comment author'); ?></label>76 <label for="akismet_discard_month" title="<?php esc_attr_e( 'Auto-detete spam from old posts' ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <?php _e('Automatically delete spam from posts older than 30 days'); ?></label><span class="note"><strong><?php _e('Note:');?></strong> <?php printf( __( 'Spam in the <a href="%s">spam folder</a> older than 15 days is automatically deleted.' ), admin_url( 'edit-comments.php?type=spam' ) );?></span><div class="clear"></div> 77 77 </p> 78 78 </td> … … 84 84 <?php if ( !defined( 'WPCOM_API_KEY' ) ):?> 85 85 <div id="delete-action"> 86 <a class="submitdelete deletion" href="<?php echo Akismet_Admin::get_ delete_key_url();?>"><?php _e('Disconnect this account'); ?></a>86 <a class="submitdelete deletion" href="<?php echo Akismet_Admin::get_page_url( 'delete_key' );?>"><?php _e('Disconnect this account'); ?></a> 87 87 </div> 88 88 <?php endif; ?> -
akismet/trunk/views/get.php
r873032 r873492 1 1 <form name="akismet_activate" action="https://akismet.com/get/" method="POST"> 2 <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_ configuration_page_url() ); ?>"/>2 <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/> 3 3 <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/> 4 4 <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/> -
akismet/trunk/views/notice.php
r873032 r873492 4 4 .akismet_activate{min-width:825px;border:1px solid #4F800D;padding:5px;margin:15px 0;background:#83AF24;background-image:-webkit-gradient(linear,0% 0,80% 100%,from(#83AF24),to(#4F800D));background-image:-moz-linear-gradient(80% 100% 120deg,#4F800D,#83AF24);-moz-border-radius:3px;border-radius:3px;-webkit-border-radius:3px;position:relative;overflow:hidden}.akismet_activate .aa_a{position:absolute;top:-5px;right:10px;font-size:140px;color:#769F33;font-family:Georgia, "Times New Roman", Times, serif;z-index:1}.akismet_activate .aa_button{font-weight:bold;border:1px solid #029DD6;border-top:1px solid #06B9FD;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#FFF;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button:hover{text-decoration:none !important;border:1px solid #029DD6;border-bottom:1px solid #00A8EF;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#F0F8FB;background:#0079B1;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#0079B1),to(#0092BF));background-image:-moz-linear-gradient(0% 100% 90deg,#0092BF,#0079B1);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button_border{border:1px solid #006699;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6)}.akismet_activate .aa_button_container{cursor:pointer;display:inline-block;background:#DEF1B8;padding:5px;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;width:266px}.akismet_activate .aa_description{position:absolute;top:22px;left:285px;margin-left:25px;color:#E5F2B1;font-size:15px;z-index:1000}.akismet_activate .aa_description strong{color:#FFF;font-weight:normal} 5 5 </style> 6 <form name="akismet_activate" action="<?php echo Akismet_Admin::get_ configuration_page_url();?>" method="POST">6 <form name="akismet_activate" action="<?php echo Akismet_Admin::get_page_url();?>" method="POST"> 7 7 <div class="akismet_activate"> 8 8 <div class="aa_a">A</div> … … 17 17 </div> 18 18 <?php elseif ( $type == 'spam-check' ) :?> 19 <div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet has detected a problem.');?></strong> <?php printf( __('Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation. Please check your <a href="%s">Akismet configuration</a> and contact your web host if problems persist.'), Akismet::get_ configuration_page_url() );?></p></div>19 <div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet has detected a problem.');?></strong> <?php printf( __('Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation. Please check your <a href="%s">Akismet configuration</a> and contact your web host if problems persist.'), Akismet::get_page_url() );?></p></div> 20 20 <?php elseif ( $type == 'version' ) :?> 21 21 <div id="akismet-warning" class="updated fade"><p><strong><?php printf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION);?></strong> <?php printf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');?></p></div> -
akismet/trunk/views/start.php
r873032 r873492 8 8 <?php echo esc_attr( $akismet_user->user_email ); ?> 9 9 </div> 10 <form name="akismet_use_wpcom_key" action="<?php echo Akismet_Admin::get_ configuration_page_url();?>" method="post" id="akismet-activate" class="right">10 <form name="akismet_use_wpcom_key" action="<?php echo Akismet_Admin::get_page_url();?>" method="post" id="akismet-activate" class="right"> 11 11 <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/> 12 12 <input type="hidden" name="action" value="enter-key"> … … 27 27 <p><?php _e('If you have another API key you want to use.'); ?></p> 28 28 </div> 29 <form action="<?php echo Akismet_Admin::get_ configuration_page_url();?>" method="post" id="akismet-enter-api-key" class="right">29 <form action="<?php echo Akismet_Admin::get_page_url();?>" method="post" id="akismet-enter-api-key" class="right"> 30 30 <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code"> 31 31 <input type="hidden" name="action" value="enter-key"> … … 42 42 </div> 43 43 <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right"> 44 <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_ configuration_page_url() ); ?>"/>44 <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/> 45 45 <input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/> 46 46 <input type="hidden" name="redirect" value="plugin-signup"/> … … 60 60 <p><?php _e('If you have another API key you want to use.'); ?></p> 61 61 </div> 62 <form action="<?php echo Akismet_Admin::get_ configuration_page_url();?>" method="post" id="akismet-enter-api-key" class="right">62 <form action="<?php echo Akismet_Admin::get_page_url();?>" method="post" id="akismet-enter-api-key" class="right"> 63 63 <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code"> 64 64 <input type="hidden" name="action" value="enter-key"> … … 91 91 <p><?php _e('If you have another API key you want to use.'); ?></p> 92 92 </div> 93 <form action="<?php echo Akismet_Admin::get_ configuration_page_url();?>" method="post" id="akismet-enter-api-key" class="right">93 <form action="<?php echo Akismet_Admin::get_page_url();?>" method="post" id="akismet-enter-api-key" class="right"> 94 94 <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code"> 95 95 <input type="hidden" name="action" value="enter-key"> -
akismet/trunk/views/stats.php
r873032 r873492 1 1 <div class="wrap"> 2 <h2><?php _e( 'Akismet Stats' );?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_attr( Akismet_Admin::get_ configuration_page_url() );?>" class="add-new-h2"><?php _e( 'Settings' );?></a><?php endif;?></h2>2 <h2><?php _e( 'Akismet Stats' );?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_attr( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php _e( 'Settings' );?></a><?php endif;?></h2> 3 3 <iframe src="<?php echo esc_url( sprintf( '%s://akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', is_ssl()?'https':'http', urlencode( get_bloginfo('url') ), Akismet::get_api_key() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe> 4 4 </div>
Note: See TracChangeset
for help on using the changeset viewer.