Initial commit
This commit is contained in:
47
app/plugins/fileshare/forms.php
Normal file
47
app/plugins/fileshare/forms.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/fileshare/forms.php
|
||||
*
|
||||
* This houses all of the form checking functions for this plugin.
|
||||
*
|
||||
* @package TP FileShare
|
||||
* @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 FileShareForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'newUpload', __CLASS__, 'newUpload' );
|
||||
self::addHandler( 'editUpload', __CLASS__, 'editUpload' );
|
||||
}
|
||||
public static function newUpload() {
|
||||
if ( ! Input::exists( 'name' ) ) {
|
||||
Check::addUserError( 'You must provide a name.' );
|
||||
return false;
|
||||
}
|
||||
if ( ! Input::exists( 'file' ) ) {
|
||||
Check::addUserError( 'You must provide a file.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static function editUpload() {
|
||||
if ( ! Input::exists( 'name' ) ) {
|
||||
Check::addUserError( 'You must provide a name.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new FileShareForms;
|
Reference in New Issue
Block a user