Changeset 104 for donation/optionals/de.easy-coding.wcf.donation.phone/files/lib/system/event/listener/DonationAddFormPhoneListener.class.php
- Timestamp:
- 11/21/07 21:53:19 (5 years ago)
- 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 10 10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 class DonationFormPhoneListener implements EventListener { 12 class DonationAddFormPhoneListener implements EventListener { 13 protected $system = 'phone'; 14 protected $prefix = 'donation_phone_'; 15 protected $eventObj; 13 16 14 17 /** … … 16 19 */ 17 20 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; 21 22 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; 28 25 } 29 26 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, 33 42 'donation_icon' => '', 34 'donation_title' => WCF::getLanguage()->get('wcf. acp.option.category.donation.plugins.phone'),35 'donation_ fields' => $arr36 ) ;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 )); 37 46 38 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 47 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 48 break; 39 49 } 40 50 }
