|
Revision 104, 1.3 kB
(checked in by d0nut, 5 years ago)
|
|
donation system changed
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | // WCF includes |
|---|
| 3 | require_once(WCF_DIR.'lib/system/event/EventListener.class.php'); |
|---|
| 4 | |
|---|
| 5 | /** |
|---|
| 6 | * Adds phone form for donation |
|---|
| 7 | * |
|---|
| 8 | * @author Torben Brodt |
|---|
| 9 | * @package de.easy-coding.wcf.donation.phone |
|---|
| 10 | * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> |
|---|
| 11 | */ |
|---|
| 12 | class DonationAddFormPhoneListener implements EventListener { |
|---|
| 13 | protected $system = 'phone'; |
|---|
| 14 | protected $prefix = 'donation_phone_'; |
|---|
| 15 | protected $eventObj; |
|---|
| 16 | |
|---|
| 17 | /** |
|---|
| 18 | * @see EventListener::execute() |
|---|
| 19 | */ |
|---|
| 20 | public function execute($eventObj, $className, $eventName) { |
|---|
| 21 | $this->eventObj = $eventObj; |
|---|
| 22 | |
|---|
| 23 | if($this->eventObj->system != $this->system) { |
|---|
| 24 | return; |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 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, |
|---|
| 42 | 'donation_icon' => '', |
|---|
| 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 | )); |
|---|
| 46 | |
|---|
| 47 | WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); |
|---|
| 48 | break; |
|---|
| 49 | } |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | ?> |
|---|