This commit is contained in:
Joey Kimsey
2025-02-06 03:18:45 -05:00
parent a893698a13
commit 825d422d93
189 changed files with 2628 additions and 5839 deletions

View File

@ -0,0 +1,79 @@
<?php
/**
* app/plugins/portfolio/forms.php
*
* This houses all of the form checking functions for this plugin.
*
* @package TP Portfolio
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Plugins\Portfolio;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Classes\Forms;
class PortfolioForms extends Forms {
/**
* Adds these functions to the form list.
*/
public function __construct() {
self::addHandler( 'newLink', __CLASS__, 'newLink' );
self::addHandler( 'editLink', __CLASS__, 'editLink' );
}
/**
* Validates the new position post form.
*
* @return {bool}
*/
public static function newLink() {
if ( !Input::exists( 'section' ) ) {
self::addUserError( 'You must specify section' );
return false;
}
if ( !Input::exists( 'title' ) ) {
self::addUserError( 'You must specify title' );
return false;
}
if ( !Input::exists( 'url' ) ) {
self::addUserError( 'You must specify url' );
return false;
}
if ( !Input::exists( 'description' ) ) {
self::addUserError( 'You must specify description' );
return false;
}
return true;
}
/**
* Validates the edit position post form.
*
* @return {bool}
*/
public static function editLink() {
if ( !Input::exists( 'section' ) ) {
self::addUserError( 'You must specify section' );
return false;
}
if ( !Input::exists( 'title' ) ) {
self::addUserError( 'You must specify title' );
return false;
}
if ( !Input::exists( 'url' ) ) {
self::addUserError( 'You must specify url' );
return false;
}
if ( !Input::exists( 'description' ) ) {
self::addUserError( 'You must specify description' );
return false;
}
return true;
}
}
new PortfolioForms;