root/donation/files/lib/form/DonationForm.class.php @ 84

Revision 84, 1.4 kB (checked in by d0nut, 6 years ago)

bugfixes to make it run

Line 
1<?php
2require_once(WCF_DIR.'lib/form/AbstractForm.class.php');
3
4/**
5 * donation form
6 *
7 * @author      Torben Brodt
8 * @package     de.easy-coding.wcf.donation
9 * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>
10 */
11class DonationForm extends AbstractForm {
12        public $templateName = 'donation'; 
13        protected $donationList = array();
14        protected $eventHandler;
15
16        /**
17         * @see Page::readData()
18         */
19        public function readData() {
20                parent::readData();
21
22                $sql = "SELECT          system,
23                                        timestamp,
24                                        userID,
25                                        username,
26                                        amount,
27                                        message
28                        FROM            wcf".WCF_N."_donation
29                        ORDER BY        timestamp DESC ";
30
31                // query
32                $result = WCF::getDB()->sendQuery($sql);
33                while ($row = WCF::getDB()->fetchArray($result)) {
34                        $this->donationList[] = $row;
35                }
36        }
37       
38        /**
39         * @see Page::assignVariables()
40         */
41        public function assignVariables() {
42                parent::assignVariables();
43
44                WCF::getTPL()->assign('donationList', $this->donationList);
45        }
46       
47        /**
48         * @see Form::save()
49         */
50        public function save() {
51                parent::save();
52               
53                // was the eventlistener already there
54                if($this->eventHandler !== null) {
55                        $this->eventHandler->save();
56                }
57        }
58       
59        /**
60         * @see Page::show()
61         */
62        public function show() {
63                // set active header menu item
64                require_once(WCF_DIR.'lib/page/util/menu/HeaderMenu.class.php');
65                HeaderMenu::setActiveMenuItem('wcf.header.menu.donation');
66
67                parent::show();
68        }
69}
70?>
Note: See TracBrowser for help on using the browser.