Changeset 104
- Timestamp:
- 11/21/07 21:53:19 (5 years ago)
- Location:
- donation
- Files:
-
- 1 added
- 11 modified
- 1 copied
- 6 moved
-
LICENSE (copied) (copied from taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/LICENSE)
-
eventlistener.xml (modified) (1 diff)
-
files/lib/acp/form/DonationAddForm.php (modified) (1 diff)
-
files/lib/form/DonationAddForm.class.php (added)
-
files/lib/form/DonationForm.class.php (modified) (1 diff)
-
files/lib/system/event/listener/DonationAddFormBankListener.class.php (moved) (moved from donation/files/lib/system/event/listener/DonationFormBankListener.class.php) (2 diffs)
-
files/lib/system/event/listener/DonationOptionFormListener.class.php (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.code/eventlistener.xml (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.code/files/lib/system/event/listener/DonationAddFormCodeListener.class.php (moved) (moved from donation/optionals/de.easy-coding.wcf.donation.code/files/lib/system/event/listener/DonationFormCodeListener.class.php) (2 diffs)
-
optionals/de.easy-coding.wcf.donation.googlecheckout/eventlistener.xml (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/cronjob/DonationGoogleCheckoutCronjob.class.php (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/event/listener/DonationAddFormGoogleCheckoutListener.class.php (moved) (moved from donation/optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/event/listener/DonationFormGoogleCheckoutListener.class.php) (2 diffs)
-
optionals/de.easy-coding.wcf.donation.paypal/eventlistener.xml (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/cronjob/DonationPayPalCronjob.class.php (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/event/listener/DonationAddFormPayPalListener.class.php (moved) (moved from donation/optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/event/listener/DonationFormPayPalListener.class.php) (2 diffs)
-
optionals/de.easy-coding.wcf.donation.phone/eventlistener.xml (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.phone/files/lib/system/event/listener/DonationAddFormPhoneListener.class.php (moved) (moved from donation/optionals/de.easy-coding.wcf.donation.phone/files/lib/system/event/listener/DonationFormPhoneListener.class.php) (2 diffs)
-
optionals/de.easy-coding.wcf.donation.wishlist/eventlistener.xml (modified) (1 diff)
-
optionals/de.easy-coding.wcf.donation.wishlist/files/lib/system/event/listener/DonationAddFormWishlistListener.class.php (moved) (moved from donation/optionals/de.easy-coding.wcf.donation.wishlist/files/lib/system/event/listener/DonationFormCodeListener.class.php) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
donation/eventlistener.xml
r81 r104 4 4 <import> 5 5 <eventlistener> 6 <eventclassname>Donation Form</eventclassname>6 <eventclassname>DonationAddForm</eventclassname> 7 7 <eventname>assignVariables</eventname> 8 <listenerclassfile>lib/system/event/listener/Donation FormBankListener.class.php</listenerclassfile>8 <listenerclassfile>lib/system/event/listener/DonationAddFormBankListener.class.php</listenerclassfile> 9 9 </eventlistener> 10 10 <!-- admin --> -
donation/files/lib/acp/form/DonationAddForm.php
r88 r104 108 108 FROM wcf".WCF_N."_donation 109 109 WHERE donationID = ".$this->donationID; 110 110 111 $row = WCF::getDB()->getFirstRow($sql); 111 112 $this->system = $row['system']; -
donation/files/lib/form/DonationForm.class.php
r84 r104 7 7 * @author Torben Brodt 8 8 * @package de.easy-coding.wcf.donation 9 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>9 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 10 10 */ 11 11 class DonationForm extends AbstractForm { -
donation/files/lib/system/event/listener/DonationAddFormBankListener.class.php
r86 r104 8 8 * @author Torben Brodt 9 9 * @package de.easy-coding.wcf.donation 10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 class DonationFormBankListener implements EventListener { 12 class DonationAddFormBankListener implements EventListener { 13 protected $system = 'bank'; 14 protected $prefix = 'donation_bank_'; 15 protected $eventObj; 13 16 14 17 /** … … 16 19 */ 17 20 public function execute($eventObj, $className, $eventName) { 18 $arr = array(); 19 $keys = array( 20 'donation_bank_accountholder', 21 'donation_bank_accountnr', 22 'donation_bank_bankcode', 23 'donation_bank_financialinstitution', 24 'donation_bank_iban', 25 'donation_bank_swift' 26 ); 27 28 foreach($keys as $key) { 29 $lang = WCF::getLanguage()->get('wcf.acp.option.'.$key); 30 $val = strtoupper($key); 31 $val = constant($val); 32 if(!empty($val)) { 33 $arr[$lang] = $val; 34 } 21 $this->eventObj = $eventObj; 22 23 if($this->eventObj->system != $this->system) { 24 return; 35 25 } 36 26 37 $var = DONATION_BANK_ENABLE; 38 if(!empty($var)) { 39 WCF::getTPL()->assign(array( 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, 40 42 'donation_icon' => '', 41 'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank') ,42 'donation_ fields' => $arr43 'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank') 44 'donation_description' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.bank.description') 43 45 )); 44 46 45 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 47 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 48 break; 46 49 } 47 50 } -
donation/files/lib/system/event/listener/DonationOptionFormListener.class.php
r78 r104 8 8 * @author Torben Brodt 9 9 * @package de.easy-coding.wcf.donation 10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 12 class DonationOptionFormListener implements EventListener { -
donation/optionals/de.easy-coding.wcf.donation.code/eventlistener.xml
r91 r104 4 4 <import> 5 5 <eventlistener> 6 <eventclassname>Donation Form</eventclassname>6 <eventclassname>DonationAddForm</eventclassname> 7 7 <eventname>assignVariables</eventname> 8 <listenerclassfile>lib/system/event/listener/DonationFormCodeListener.class.php</listenerclassfile> 8 <listenerclassfile>lib/system/event/listener/DonationAddFormCodeListener.class.php</listenerclassfile> 9 </eventlistener> 10 <eventlistener> 11 <eventclassname>DonationAddForm</eventclassname> 12 <eventname>validate</eventname> 13 <listenerclassfile>lib/system/event/listener/DonationAddFormCodeListener.class.php</listenerclassfile> 14 </eventlistener> 15 <eventlistener> 16 <eventclassname>DonationAddForm</eventclassname> 17 <eventname>readFormParameters</eventname> 18 <listenerclassfile>lib/system/event/listener/DonationAddFormCodeListener.class.php</listenerclassfile> 19 </eventlistener> 20 <eventlistener> 21 <eventclassname>DonationAddForm</eventclassname> 22 <eventname>save</eventname> 23 <listenerclassfile>lib/system/event/listener/DonationAddFormCodeListener.class.php</listenerclassfile> 9 24 </eventlistener> 10 25 </import> -
donation/optionals/de.easy-coding.wcf.donation.code/files/lib/system/event/listener/DonationAddFormCodeListener.class.php
r91 r104 7 7 * 8 8 * @author Torben Brodt 9 * @package de.easy-coding.wcf. donation.code9 * @package de.easy-coding.wcf.code 10 10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 class DonationFormCodeListener implements EventListener { 12 class DonationAddFormBankCode implements EventListener { 13 protected $system = 'code'; 14 protected $prefix = 'donation_code_'; 15 protected $eventObj; 16 17 //data 18 protected $code, $message; 13 19 14 20 /** … … 16 22 */ 17 23 public function execute($eventObj, $className, $eventName) { 18 $var = DONATION_GOOGLECHECKOUT_HTML; 19 if(!empty($var)) { 20 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donationCode')); 24 $this->eventObj = $eventObj; 25 26 if($this->eventObj->system != $this->system) { 27 return; 28 } 29 30 switch($eventName) { 31 case 'readFormParameters': 32 $this->readFormParameters(); 33 break; 34 case 'assignVariables': 35 $this->assignVariables(); 36 break; 37 case 'validate': 38 $this->validate(); 39 break; 40 case 'save': 41 $this->save(); 42 break; 43 } 44 } 45 46 /** 47 * validates code 48 * @param code 49 */ 50 protected function validateCode($code) { 51 $sql = "SELECT COUNT(*) AS c 52 FROM wcf".WCF_N."_donation_code 53 WHERE code = ".escapeString($this->code)." 54 AND userID = 0; "; 55 56 $row = WCF::getDB()->getFirstRow($sql); 57 return empty($row['c']) ? false : true; 58 } 59 60 /** 61 * @see Form::readFormParameters() 62 */ 63 protected function readFormParameters() { 64 switch($this->eventObj->step) { 65 case 1: 66 if(isset($_POST[$this->prefix.'code'])) $this->code = $_POST[$this->prefix.'code']; 67 break; 68 case 2: 69 if(isset($_POST[$this->prefix.'message'])) $this->message = $_POST[$this->prefix.'message']; 70 break; 71 } 72 } 73 74 /** 75 * @see Form::validate() 76 */ 77 protected function validate() { 78 switch($this->eventObj->step) { 79 case 1: 80 if(!$this->validateCode($this->code)) { 81 // TODO: exception 82 } 83 84 break; 85 case 2: 86 if(!$this->validateCode($this->code)) { 87 // TODO: exception 88 } 89 90 91 //EventListener::fireEvent($this->eventObj, 'save'); TODO: EventListener 92 break; 93 } 94 } 95 96 /** 97 * @see Form::save() 98 */ 99 protected function save() { 100 $sql = "UPDATE wcf".WCF_N."_donation 101 SET 102 userID = ".WCF::getUser()->userID." 103 WHERE userID = 0 104 AND code = '".escapeString($this->message)."'; "; 105 WCF::getDB()->sendQuery($sql); 106 107 $sql = "INSERT INTO wcf".WCF_N."_donation 108 ( 109 system, 110 timestamp, 111 userID, 112 username, 113 amount, 114 message 115 ) VALUES ( 116 'code', 117 ".time()." 118 ".WCF::getUser()->userID.", 119 '".WCF::getUser()->username."', 120 0.0, 121 '".escapeString($this->message)."' 122 );"; 123 124 WCF::getDB()->sendQuery($sql); 125 } 126 127 /** 128 * @see Page::assignVariables() 129 */ 130 protected function assignVariables() { 131 switch($this->eventObj->step) { 132 case 0: 133 WCF::getTPL()->assign(array( 134 'donation_system' => $this->system, 135 'donation_icon' => RELATIVE_WCF_DIR.'icon/donation_code.png', 136 'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.code'), 137 'donation_desrciption' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.code.description') 138 )); 139 140 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 141 break; 142 case 1: 143 case 2: 144 WCF::getTPL()->append('donationSystemContainer', WCF::getTPL()->fetch('donationCode')); 145 break; 21 146 } 22 147 } -
donation/optionals/de.easy-coding.wcf.donation.googlecheckout/eventlistener.xml
r61 r104 4 4 <import> 5 5 <eventlistener> 6 <eventclassname>Donation Form</eventclassname>6 <eventclassname>DonationAddForm</eventclassname> 7 7 <eventname>assignVariables</eventname> 8 <listenerclassfile>lib/system/event/listener/Donation FormGoogleCheckoutListener.class.php</listenerclassfile>8 <listenerclassfile>lib/system/event/listener/DonationAddFormGoogleCheckoutListener.class.php</listenerclassfile> 9 9 </eventlistener> 10 10 </import> -
donation/optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/cronjob/DonationGoogleCheckoutCronjob.class.php
r78 r104 10 10 * @author Torben Brodt 11 11 * @package de.easy-coding.wcf.donation.googlecheckout 12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>12 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 13 13 */ 14 14 class DonationGoogleCheckoutCronjob implements Cronjob { -
donation/optionals/de.easy-coding.wcf.donation.googlecheckout/files/lib/system/event/listener/DonationAddFormGoogleCheckoutListener.class.php
r78 r104 4 4 5 5 /** 6 * Adds google checkout for donation6 * Adds google checkout information for donation 7 7 * 8 8 * @author Torben Brodt 9 9 * @package de.easy-coding.wcf.donation.googlecheckout 10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 class DonationFormGoogleCheckoutListener implements EventListener { 12 class DonationAddFormGoogleCheckoutListener implements EventListener { 13 protected $system = 'googlecheckout'; 14 protected $prefix = 'donation_googlecheckout_'; 15 protected $eventObj; 16 17 //data 18 protected $amount, $message; 13 19 14 20 /** … … 16 22 */ 17 23 public function execute($eventObj, $className, $eventName) { 18 $var = DONATION_GOOGLECHECKOUT_HTML; 19 if(!empty($var)) { 20 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donationGoogleCheckout')); 24 $this->eventObj = $eventObj; 25 26 if($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/donation_googlecheckout.png', 46 'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.googlecheckout'), 47 'donation_description' => WCF::getLanguage()->get('wcf.acp.option.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; 21 55 } 22 56 } -
donation/optionals/de.easy-coding.wcf.donation.paypal/eventlistener.xml
r61 r104 4 4 <import> 5 5 <eventlistener> 6 <eventclassname>Donation Form</eventclassname>6 <eventclassname>DonationAddForm</eventclassname> 7 7 <eventname>assignVariables</eventname> 8 <listenerclassfile>lib/system/event/listener/DonationFormPayPalListener.class.php</listenerclassfile> 8 <listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile> 9 </eventlistener> 10 <eventlistener> 11 <eventclassname>DonationAddForm</eventclassname> 12 <eventname>validate</eventname> 13 <listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile> 14 </eventlistener> 15 <eventlistener> 16 <eventclassname>DonationAddForm</eventclassname> 17 <eventname>readFormParameters</eventname> 18 <listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile> 19 </eventlistener> 20 <eventlistener> 21 <eventclassname>DonationAddForm</eventclassname> 22 <eventname>save</eventname> 23 <listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile> 9 24 </eventlistener> 10 25 </import> -
donation/optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/cronjob/DonationPayPalCronjob.class.php
r78 r104 10 10 * @author Torben Brodt 11 11 * @package de.easy-coding.wcf.donation.paypal 12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>12 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 13 13 */ 14 14 class DonationPayPalCronjob implements Cronjob { -
donation/optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/event/listener/DonationAddFormPayPalListener.class.php
r78 r104 4 4 5 5 /** 6 * Adds paypal formfor donation6 * Adds paypal information for donation 7 7 * 8 8 * @author Torben Brodt 9 9 * @package de.easy-coding.wcf.donation.paypal 10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-3.0.html>10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 class DonationFormPayPalListener implements EventListener { 12 class DonationAddFormPayPalListener implements EventListener { 13 protected $system = 'paypal'; 14 protected $prefix = 'donation_paypal_'; 15 protected $eventObj; 16 17 //data 18 protected $amount, $message; 13 19 14 20 /** … … 16 22 */ 17 23 public function execute($eventObj, $className, $eventName) { 18 $var = DONATION_PAYPAL_HTML; 19 if(!empty($var)) { 20 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donationPayPal')); 24 $this->eventObj = $eventObj; 25 26 if($this->eventObj->system != $this->system) { 27 return; 28 } 29 30 switch($eventName) { 31 case 'readFormParameters': 32 $this->readFormParameters(); 33 break; 34 case 'assignVariables': 35 $this->assignVariables(); 36 break; 37 case 'validate': 38 $this->validate(); 39 break; 40 case 'save': 41 $this->save(); 42 break; 43 } 44 } 45 46 /** 47 * @see Form::readFormParameters() 48 */ 49 protected function readFormParameters() { 50 //TODO: get information from paypal 51 } 52 53 /** 54 * @see Form::validate() 55 */ 56 protected function validate() { 57 //TODO: did we get an answer from paypal? submission finished? 58 } 59 60 /** 61 * @see Form::save() 62 */ 63 protected function save() { 64 $sql = "INSERT INTO wcf".WCF_N."_donation 65 ( 66 system, 67 timestamp, 68 userID, 69 username, 70 amount, 71 message 72 ) VALUES ( 73 'paypal', 74 ".time()." 75 ".WCF::getUser()->userID.", 76 '".WCF::getUser()->username."', 77 ".floatval($this->amount).", 78 '".escapeString($this->message)."' 79 );"; 80 81 WCF::getDB()->sendQuery($sql); 82 } 83 84 /** 85 * @see Page::assignVariables() 86 */ 87 protected function assignVariables() { 88 switch($this->eventObj->step) { 89 case 0: 90 WCF::getTPL()->assign(array( 91 'donation_system' => $this->system, 92 'donation_icon' => RELATIVE_WCF_DIR.'icon/donation_paypal.png', 93 'donation_title' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.paypal'), 94 'donation_description' => WCF::getLanguage()->get('wcf.acp.option.category.donation.plugins.paypal.description') 95 )); 96 97 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 98 break; 99 case 1: 100 WCF::getTPL()->append('donationSystemContainer', WCF::getTPL()->fetch('donationPayPal')); 101 break; 21 102 } 22 103 } -
donation/optionals/de.easy-coding.wcf.donation.phone/eventlistener.xml
r90 r104 4 4 <import> 5 5 <eventlistener> 6 <eventclassname>Donation Form</eventclassname>6 <eventclassname>DonationAddForm</eventclassname> 7 7 <eventname>assignVariables</eventname> 8 <listenerclassfile>lib/system/event/listener/Donation FormPhoneListener.class.php</listenerclassfile>8 <listenerclassfile>lib/system/event/listener/DonationAddFormPhoneListener.class.php</listenerclassfile> 9 9 </eventlistener> 10 10 </import> -
donation/optionals/de.easy-coding.wcf.donation.phone/files/lib/system/event/listener/DonationAddFormPhoneListener.class.php
r82 r104 10 10 * @license GNU General Public License <http://opensource.org/licenses/gpl-3.0.html> 11 11 */ 12 class DonationFormPhoneListener implements EventListener { 12 class DonationAddFormPhoneListener implements EventListener { 13 protected $system = 'phone'; 14 protected $prefix = 'donation_phone_'; 15 protected $eventObj; 13 16 14 17 /** … … 16 19 */ 17 20 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 $this->eventObj = $eventObj; 21 22 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; 23 if($this->eventObj->system != $this->system) { 24 return; 28 25 } 29 26 30 $var = DONATION_PHONE_ENABLE; 31 if(!empty($var)) { 32 WCF::getTPL()->assign( 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, 33 42 'donation_icon' => '', 34 'donation_title' => WCF::getLanguage()->get('wcf. acp.option.category.donation.plugins.phone'),35 'donation_ fields' => $arr36 ) ;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 )); 37 46 38 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 47 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 48 break; 39 49 } 40 50 } -
donation/optionals/de.easy-coding.wcf.donation.wishlist/eventlistener.xml
r91 r104 4 4 <import> 5 5 <eventlistener> 6 <eventclassname>Donation Form</eventclassname>6 <eventclassname>DonationAddForm</eventclassname> 7 7 <eventname>assignVariables</eventname> 8 <listenerclassfile>lib/system/event/listener/Donation FormCodeListener.class.php</listenerclassfile>8 <listenerclassfile>lib/system/event/listener/DonationAddFormWishlistListener.class.php</listenerclassfile> 9 9 </eventlistener> 10 10 </import> -
donation/optionals/de.easy-coding.wcf.donation.wishlist/files/lib/system/event/listener/DonationAddFormWishlistListener.class.php
r91 r104 11 11 */ 12 12 class DonationFormWishlistListener implements EventListener { 13 protected $system = 'wishlist'; 14 protected $prefix = 'donation_wishlist_'; 15 protected $eventObj; 13 16 14 17 /** … … 16 19 */ 17 20 public function execute($eventObj, $className, $eventName) { 18 $var = DONATION_GOOGLECHECKOUT_HTML; 19 if(!empty($var)) { 20 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donationWishlist')); 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.wishlist'), 44 'donation_description' => WCF::getLanguage()->get('wcf.donation.category.donation.plugins.wishlist.description') 45 )); 46 47 WCF::getTPL()->append('additionalDonationSystems', WCF::getTPL()->fetch('donation_container')); 48 break; 21 49 } 22 50 }
