Show
Ignore:
Timestamp:
06/30/08 07:39:10 (5 months ago)
Author:
tinyau
Message:

Plugin:preapproved - Show the successful message after saved the configuration. Removed trailing space.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/preapproved/trunk/preapproved.plugin.php

    r655 r659  
    33/* 
    44 * PreApproved Class 
    5  *  
     5 * 
    66 * This class allows us to auto-approve comments 
    77 * 
     
    3535        if ( realpath( $file ) == __FILE__ ) { 
    3636            EventLog::register_type( 'PreApproved' ); 
    37             if( !(Options::get( 'preapproved__approved_count' ) ) ) { 
     37            if ( !( Options::get( 'preapproved__approved_count' ) ) ) { 
    3838                Options::set( 'preapproved__approved_count', 1 ); 
    3939            } 
     
    5353    public function filter_plugin_config($actions, $plugin_id) 
    5454    { 
    55         if ($plugin_id == $this->plugin_id()) { 
    56             $actions[] = _t( 'Configure' ); 
     55        if ( $plugin_id == $this->plugin_id() ) { 
     56            $actions[]= _t( 'Configure' ); 
    5757        } 
    5858        return $actions; 
     
    6262    { 
    6363        if ( $plugin_id == $this->plugin_id() ) { 
    64             switch ($action) { 
     64            switch ( $action ) { 
    6565                case _t( 'Configure' ): 
    6666                    $form= new FormUI( 'preapproved' ); 
     
    6868                    $form->approved_count->add_validator( array( $this, 'validate_integer' ) ); 
    6969                    $form->append( 'submit', 'save', _t( 'Save' ) ); 
     70                    $form->set_option( 'success_message', _t( 'Configuration saved' ) ); 
    7071                    $form->out(); 
    7172                break; 
     
    7879     * This function is executed when the action "comment_insert_before" 
    7980     * is invoked from a Comment object. 
    80      * The parent class, Plugin, handles registering the action  
    81      * and hook name using the name of the function to determine  
     81     * The parent class, Plugin, handles registering the action 
     82     * and hook name using the name of the function to determine 
    8283     * where it will be applied. 
    8384     * You can still register functions as hooks without using 
     
    9091        // This plugin ignores non-comments 
    9192        if( $comment->type == Comment::COMMENT ) { 
    92             if( Comments::get( array( 'email' => $comment->email, 'name' => $comment->name,  
     93            if( Comments::get( array( 'email' => $comment->email, 'name' => $comment->name, 
    9394                                'url' => $comment->url, 'status' => Comment::STATUS_APPROVED ) )->count >= Options::get( 'preapproved__approved_count' ) ) { 
    9495                $comment->status = Comment::STATUS_APPROVED; 
     
    105106 
    106107    /* 
    107     * Add update beacon support  
     108    * Add update beacon support 
    108109    */ 
    109110    function action_update_check() 
    110111    { 
    111         Update::add( 'PreApproved', '0fa22c74-a0d6-11dc-8314-0800200c9a66', $this->info->version );  
     112        Update::add( 'PreApproved', '0fa22c74-a0d6-11dc-8314-0800200c9a66', $this->info->version ); 
    112113    } 
    113114