Changeset 109 for donation/optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/event/listener/DonationAddFormGoogleCheckoutListener.class.php
- Timestamp:
- 11/25/07 21:34:08 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
donation/optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/event/listener/DonationAddFormGoogleCheckoutListener.class.php
r108 r109 1 1 <?php 2 // WCF includes 3 require_once(WCF_DIR.'lib/system/event/EventListener.class.php'); 2 require_once(WCF_DIR.'lib/system/event/listener/DonationAddFormAbstractListener.class.php'); 4 3 5 4 /** 6 * Adds google checkout information for donation5 * googlecheckout 7 6 * 8 7 * @author Torben Brodt … … 10 9 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 10 */ 12 class DonationAddFormGoogleCheckoutListener implements EventListener { 11 class DonationAddFormGoogleCheckoutListener extends DonationAddFormAbstractListener { 12 protected $icon = 'googlecheckout48.png'; 13 protected $templateName = 'donationGoogleCheckout'; 13 14 protected $system = 'googlecheckout'; 14 protected $prefix = 'donation_googlecheckout_';15 protected $eventObj;16 15 17 16 //data 18 protected $amount, $message; 19 20 /** 21 * @see EventListener::execute() 22 */ 23 public function execute($eventObj, $className, $eventName) { 24 $this->eventObj = $eventObj; 25 26 if($this->eventObj->system != '' && $this->eventObj->system != $this->system) { 27 return; 28 } 29 30 switch($eventName) { 31 case 'assignVariables': 32 $this->assignVariables(); 33 break; 34 } 35 } 36 37 /** 38 * @see Page::assignVariables() 39 */ 40 protected function assignVariables() { 41 switch($this->eventObj->step) { 42 case 0: 43 WCF::getTPL()->assign(array( 44 'donation_system' => $this->system, 45 'donation_icon' => RELATIVE_WCF_DIR.'icon/googlecheckout96.png', 46 'donation_title' => WCF::getLanguage()->get('wcf.donation.category.donation.plugins.googlecheckout'), 47 'donation_description' => WCF::getLanguage()->get('wcf.donation.category.donation.plugins.googlecheckout.description') 48 )); 49 50 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 51 break; 52 case 1: 53 WCF::getTPL()->append('donationSystemContainer', WCF::getTPL()->fetch('donationGoogleCheckout')); 54 break; 55 } 56 } 17 protected $arr = array('googlecheckout_enable','googlecheckout_code'); 57 18 } 58 19 ?>
