all atb changes

This commit is contained in:
Joey Kimsey
2025-02-05 23:57:17 -05:00
parent 2ac64e5c49
commit ffb82b1192
328 changed files with 12384 additions and 2477 deletions

View File

@ -0,0 +1,75 @@
<?php
/**
* app/plugins/blog/controllers/admin/blog.php
*
* This is the Blog admin controller.
*
* @package TP Blog
* @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\Houdini\Classes\Views;
use TheTempusProject\Houdini\Classes\Navigation;
use TheTempusProject\Houdini\Classes\Components;
use TheTempusProject\Classes\AdminController;
use TheTempusProject\Plugins\Members as MemberModel;
use TheTempusProject\Houdini\Classes\Issues;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Hermes\Functions\Route as Routes;
use TheTempusProject\Hermes\Functions\Redirect;
class Members extends AdminController {
public function __construct() {
parent::__construct();
$view = Navigation::activePageSelect( 'nav.admin', '/admin/member' );
Components::set( 'ADMINNAV', $view );
}
public function index( $data = null ) {
self::$title = 'Admin - Membership Scripts';
Views::view( 'members.admin.scripts' );
}
public function orphans( $data = null, $id = null ) {
self::$title = 'Admin - Orphaned PRoducts';
if ( $data = 'abandon' && ! empty( $id ) ) {
MemberModel::orphanAbandon( $id );
Redirect::to('admin/members/orphans');
}
$orphans = MemberModel::findOrphans();
Views::view( 'members.admin.orphans', $orphans );
}
public function webhooks( $data = null, $id = null ) {
self::$title = 'Admin - Membership Webhooks';
if ( $data = 'delete' && ! empty( $id ) ) {
MemberModel::webhookRemove( $id );
Redirect::to('admin/members/webhooks');
}
$data = [];
$webhooks = MemberModel::webhookList();
foreach ($webhooks->data as $key => $webhook) {
$hook = new \stdClass;
$hook->id = $webhook->id;
$hook->enabled_events = implode( ', <br>', $webhook->enabled_events );
$hook->status = $webhook->status;
$hook->url = $webhook->url;
$data[] = $hook;
}
Components::set( 'urltouse', Routes::getAddress() );
if ( !Input::exists( 'submit' ) ) {
return Views::view( 'members.admin.webhooks', $data );
}
MemberModel::webhookSetup();
Issues::add( 'success', 'Webhooks Generated' );
Issues::add( 'error', 'Now, LEAVE!' );
Redirect::to('admin/members/webhooks');
}
}