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