- Timestamp:
- 11/21/07 21:53:19 (6 years ago)
- Files:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
donation/files/lib/system/event/listener/DonationAddFormBankListener.class.php
r86 r104 8 8 * @author Torben Brodt 9 9 * @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> 11 11 */ 12 class DonationFormBankListener implements EventListener { 12 class DonationAddFormBankListener implements EventListener { 13 protected $system = 'bank'; 14 protected $prefix = 'donation_bank_'; 15 protected $eventObj; 13 16 14 17 /** … … 16 19 */ 17 20 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; 35 25 } 36 26 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, 40 42 'donation_icon' => '', 41 'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank') ,42 'donation_ fields' => $arr43 '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') 43 45 )); 44 46 45 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 47 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 48 break; 46 49 } 47 50 }
