Show
Ignore:
Timestamp:
06/25/08 02:44:10 (5 months ago)
Author:
michaeltwofish
Message:

Update to use new FormUI.

Files:
1 modified

Legend:

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

    r270 r638  
    1010        return array( 
    1111            'name' => 'Disqus', 
    12             'version' => '0.1', 
     12            'version' => '0.2', 
    1313            'url' => 'http://habariproject.org/', 
    1414            'author' => 'Habari Community', 
     
    3737    public function filter_plugin_config($actions, $plugin_id) 
    3838    { 
    39         if ($plugin_id == $this->plugin_id()) 
    40         { 
     39        if ($plugin_id == $this->plugin_id()) { 
    4140            $actions[] = _t('Configure'); 
    4241        } 
     
    4948            switch ($action) { 
    5049                case _t('Configure'): 
    51                     $ui = new FormUI(strtolower(get_class($this))); 
    52                     $ui->add('text', 'username', 'Disqus Username:'); 
    53                     $ui->on_success(array($this, 'updated_config')); 
    54                     $ui->out(); 
     50                    $form = new FormUI(strtolower(get_class($this))); 
     51                    $form->append('text', 'username', 'disqus__username', _t('Disqus Username:')); 
     52                    $form->append('submit', 'save', 'Save'); 
     53                    $form->out(); 
    5554                break; 
    5655            } 
     
    5857    } 
    5958 
    60     public function updated_config($ui) 
    61     { 
    62         return true; 
    63     } 
    64  
    6559    public function theme_comments( $theme, $post ) 
    6660    { 
    67         $disqus_username= Options::get( strtolower(get_class($this)) . ':username' ); 
     61        $disqus_username= Options::get( 'disqus__username' ); 
    6862        if ( !$post->info->comment_disabled && $post->comments->count == 0 && $disqus_username ) { 
    6963            $theme->disqus_username= $disqus_username;