Add donate and memberships
This commit is contained in:
43
app/plugins/donate/forms.php
Normal file
43
app/plugins/donate/forms.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/donate/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP Donate
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins\Donate;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
|
||||
class DonateForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'donate', __CLASS__, 'donate' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the bug report form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function donate() {
|
||||
if ( !Input::exists( 'amount' ) ) {
|
||||
self::addUserError( 'You must specify an amount' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new DonateForms;
|
Reference in New Issue
Block a user