Files
thetempusproject/app/plugins/donate/forms.php
2024-12-05 15:33:25 -05:00

44 lines
1017 B
PHP

<?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;