root/donation/optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/event/listener/DonationAddFormGoogleCheckoutListener.class.php @ 108

Revision 108, 1.6 kB (checked in by d0nut, 5 years ago)
  • first effort: all packages are installable
  • second effort: the concept works
  • what follows: the implementation ;)
Line 
1<?php
2// WCF includes
3require_once(WCF_DIR.'lib/system/event/EventListener.class.php');
4
5/**
6 * Adds google checkout information for donation
7 *
8 * @author      Torben Brodt
9 * @package     de.easy-coding.wcf.donation.googlecheckout
10 * @license     GNU General Public License <http://opensource.org/licenses/gpl-3.0.html>
11 */
12class DonationAddFormGoogleCheckoutListener implements EventListener {
13        protected $system = 'googlecheckout';
14        protected $prefix = 'donation_googlecheckout_';
15        protected $eventObj;
16       
17        //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        }
57}
58?>
Note: See TracBrowser for help on using the browser.