Show
Ignore:
Timestamp:
11/21/07 21:53:19 (6 years ago)
Author:
d0nut
Message:

donation system changed

Files:
1 moved

Legend:

Unmodified
Added
Removed
  • donation/files/lib/system/event/listener/DonationAddFormBankListener.class.php

    r86 r104  
    88 * @author      Torben Brodt 
    99 * @package     de.easy-coding.wcf.donation 
    10  * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html> 
     10 * @license     GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 
    1111 */ 
    12 class DonationFormBankListener implements EventListener { 
     12class DonationAddFormBankListener implements EventListener { 
     13        protected $system = 'bank'; 
     14        protected $prefix = 'donation_bank_'; 
     15        protected $eventObj; 
    1316 
    1417        /** 
     
    1619         */ 
    1720        public function execute($eventObj, $className, $eventName) { 
    18                 $arr = array(); 
    19                 $keys = array( 
    20                                 'donation_bank_accountholder', 
    21                                 'donation_bank_accountnr', 
    22                                 'donation_bank_bankcode', 
    23                                 'donation_bank_financialinstitution', 
    24                                 'donation_bank_iban', 
    25                                 'donation_bank_swift' 
    26                         ); 
    27                          
    28                 foreach($keys as $key) { 
    29                         $lang = WCF::getLanguage()->get('wcf.acp.option.'.$key); 
    30                         $val = strtoupper($key); 
    31                         $val = constant($val); 
    32                         if(!empty($val)) { 
    33                                 $arr[$lang] = $val; 
    34                         } 
     21                $this->eventObj = $eventObj; 
     22                 
     23                if($this->eventObj->system != $this->system) { 
     24                        return; 
    3525                } 
    3626 
    37                 $var = DONATION_BANK_ENABLE; 
    38                 if(!empty($var)) { 
    39                         WCF::getTPL()->assign(array( 
     27                switch($eventName) { 
     28                        case 'assignVariables': 
     29                                $this->assignVariables(); 
     30                        break; 
     31                } 
     32        } 
     33 
     34        /** 
     35         * @see Page::assignVariables() 
     36         */ 
     37        protected function assignVariables() { 
     38                switch($this->eventObj->step) { 
     39                        case 1: 
     40                                WCF::getTPL()->assign(array( 
     41                                        'donation_system' => $this->system, 
    4042                                        'donation_icon' => '', 
    41                                         'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank'), 
    42                                         'donation_fields' => $arr 
     43                                        'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank') 
     44                                        'donation_description' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank.description') 
    4345                                )); 
    4446 
    45                         WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 
     47                                WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 
     48                        break; 
    4649                } 
    4750        }