hfkfhkfhgjkuhgfkjfghkj

This commit is contained in:
Local Dev
2025-02-03 12:03:51 -05:00
commit fd36f0f4bf
302 changed files with 22625 additions and 0 deletions

View File

@ -0,0 +1,48 @@
<?php
/**
* app/controllers/admin/settings.php
*
* This is the configuration and settings controller.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Controllers\Admin;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Houdini\Classes\Components;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Houdini\Classes\Issues;
use TheTempusProject\Houdini\Classes\Forms;
use TheTempusProject\Classes\AdminController;
use TheTempusProject\Models\Group;
use TheTempusProject\Classes\Config;
use TheTempusProject\TheTempusProject as App;
class Settings extends AdminController {
public static $group;
public function __construct() {
parent::__construct();
self::$title = 'Admin - Settings';
self::$group = new Group;
}
public function index() {
if ( Input::exists( 'submit' ) ) {
if ( !App::$activeConfig->updateFromForm( true ) ) {
Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
} else {
Issues::add( 'success', 'Settings Updated' );
}
}
Components::set( 'configForm', Config::getEditHtml() );
Components::set(
'group-defaultGroup-options',
Forms::getOptionsHtml( self::$group->listGroupsSimple(), Config::getValue( 'group/defaultGroup' ) )
);
Views::view( 'admin.settings' );
}
}