Adjusted log severity
Improved error reporting
Improved token handling
Improved Config Form handling
This commit is contained in:
Joey Kimsey
2025-01-21 20:35:24 -05:00
parent 42ade08306
commit 3152d180c0
7 changed files with 93 additions and 65 deletions

View File

@ -14,6 +14,7 @@ namespace TheTempusProject\Bedrock\Classes;
use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Functions\Upload;
class Config {
public static $config = false;
@ -145,7 +146,19 @@ class Config {
}
$fieldname = str_ireplace( '/', '-', $name );
if ( Input::exists( $fieldname ) ) {
$this->update( $category, $field, Input::post( $fieldname ) );
if ( 'file' == $node['type'] ) {
$upload = Upload::image( $fieldname, IMAGE_DIRECTORY );
if ( $upload ) {
$route = str_replace( APP_ROOT_DIRECTORY, '', IMAGE_DIRECTORY );
$this->update( $category, $field, $route . Upload::last() );
} else {
Debug::error( 'There was an error with your upload.');
}
} else {
$this->update( $category, $field, Input::post( $fieldname ) );
}
} elseif ( 'radio' == $node['type'] ) {
$this->update( $category, $field, false );
}
}
}