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

donation system changed

Files:
1 moved

Legend:

Unmodified
Added
Removed
  • donation/optionals/de.easy-coding.wcf.donation.phone/files/lib/system/event/listener/DonationAddFormPhoneListener.class.php

    r82 r104  
    1010 * @license     GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 
    1111 */ 
    12 class DonationFormPhoneListener implements EventListener { 
     12class DonationAddFormPhoneListener implements EventListener { 
     13        protected $system = 'phone'; 
     14        protected $prefix = 'donation_phone_'; 
     15        protected $eventObj; 
    1316 
    1417        /** 
     
    1619         */ 
    1720        public function execute($eventObj, $className, $eventName) { 
    18                 $icons = explode("\n", StringUtil::unifyNewlines(DONATION_PHONE_ICON)); 
    19                 $numbers = explode("\n", StringUtil::unifyNewlines(DONATION_PHONE_NUMBER)); 
    20                 $prices = explode("\n", StringUtil::unifyNewlines(DONATION_PHONE_PRICE)); 
     21                $this->eventObj = $eventObj; 
    2122                 
    22                 $count = count($icons);  
    23                 for($i=0; $i<$count; $i++) { 
    24                         $left = $icons[$i]; 
    25                         $right = $numbers[$i].'<br/>'.$price; 
    26  
    27                         $arr[$left] = $right; 
     23                if($this->eventObj->system != $this->system) { 
     24                        return; 
    2825                } 
    2926 
    30                 $var = DONATION_PHONE_ENABLE; 
    31                 if(!empty($var)) { 
    32                         WCF::getTPL()->assign( 
     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, 
    3342                                        'donation_icon' => '', 
    34                                         'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.phone'), 
    35                                         'donation_fields' => $arr 
    36                                 ); 
     43                                        'donation_title' => WCF::getLanguage()->get('wcf.donation.category.donation.plugins.phone'), 
     44                                        'donation_description' => WCF::getLanguage()->get('wcf.donation.category.donation.plugins.phone.description') 
     45                                )); 
    3746 
    38                         WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 
     47                                WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 
     48                        break; 
    3949                } 
    4050        }