various updates

remove dependence on jQuery
add image delete
Admin ui fix for mobile
image updates to new style
update comments
This commit is contained in:
Joey Kimsey
2025-02-05 05:34:25 -05:00
parent ea120e09bc
commit d7e8b586d7
104 changed files with 343 additions and 229 deletions

View File

@ -4,7 +4,7 @@
*
* This is the admin log controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the composer controller. Its only very effective when using composer for autoloading.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the error logs controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the groups admin controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the admin dashboard controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the admin app/user tokens controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
@ -36,6 +36,8 @@ class Images extends AdminController {
APP_ROOT_DIRECTORY . 'app/plugins'
];
private $spacer = [];
private $excludedDirectories = [
'.',
'..',
@ -97,12 +99,13 @@ class Images extends AdminController {
$names = explode( DIRECTORY_SEPARATOR, $folder );
$folderName = array_pop( $names );
$out = [
'spacer' => implode( '', $this->spacer ),
'folderName' => $folderName,
'location' => $folder,
'subdirs' => $subdirs,
];
if ( ! empty( $subdirs ) ) {
$out['folderexpand'] = '<i class="fa-solid fa-caret-down justify-content-end"></i>';
$out['folderexpand'] = '<i class="fa fa-caret-down"></i>';
} else {
$out['folderexpand'] = '';
}
@ -116,7 +119,9 @@ class Images extends AdminController {
if ( $top == $sub ) {
$html = '';
} else {
$this->spacer[] = '-> ';
$children = $this->generateFolderHtml( $sub );
array_pop( $this->spacer );
Components::set( 'parentfolderName', $object->folderName );
$html = Views::simpleView( 'forms.folderSelectParent', $children );
Components::set( 'parentfolderName', '' );
@ -223,10 +228,36 @@ class Images extends AdminController {
}
public function delete() {
if ( self::$token->delete( [ $id ] ) ) {
Session::flash( 'success', 'Token deleted.' );
if ( ! Input::exists( 'fileLocation' ) ) {
Session::flash( 'warning', 'Unknown image.' );
Redirect::to( 'admin/images' );
}
Redirect::to( 'admin/images' );
$fileLocation = Input::get('fileLocation');
// Ensure the file exists
if ( ! file_exists( $fileLocation ) ) {
Session::flash('error', 'File does not exist.');
Redirect::to('admin/images');
}
// Check if the file is an image
$validMimeTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'];
$fileMimeType = mime_content_type( $fileLocation );
if ( ! in_array( $fileMimeType, $validMimeTypes ) ) {
Session::flash('error', 'Invalid file type. Only images can be deleted.');
Redirect::to('admin/images');
}
// Attempt to delete the file
if (@unlink($fileLocation)) {
Session::flash('success', 'Image deleted.');
} else {
Session::flash('error', 'Failed to delete the image.');
}
Redirect::to('admin/images');
}
public function rename() {

View File

@ -4,7 +4,7 @@
*
* This is the login logs controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the generic logs controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the installed plugins controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the admin routes/redirects controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the admin email controller. The only real use is to send out emails to the various lists.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the configuration and settings controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the admin app/user tokens controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]

View File

@ -4,7 +4,7 @@
*
* This is the users admin controller.
*
* @version 3.0
* @version 5.0.1
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]