root/donation/optionals/de.easy-coding.wcf.donation.phone/files/lib/system/event/listener/DonationFormPhoneListener.class.php @ 82

Revision 82, 1.2 kB (checked in by d0nut, 6 years ago)

initial release of phone plugin for donations

Line 
1<?php
2// WCF includes
3require_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 */
12class DonationFormPhoneListener implements EventListener {
13
14        /**
15         * @see EventListener::execute()
16         */
17        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               
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;
28                }
29
30                $var = DONATION_PHONE_ENABLE;
31                if(!empty($var)) {
32                        WCF::getTPL()->assign(
33                                        'donation_icon' => '',
34                                        'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.phone'),
35                                        'donation_fields' => $arr
36                                );
37
38                        WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container'));
39                }
40        }
41}
42?>
Note: See TracBrowser for help on using the browser.