Initial commit

This commit is contained in:
Joey Kimsey
2024-08-04 21:15:59 -04:00
parent c9d1fb983f
commit 0d469501ee
695 changed files with 70184 additions and 71 deletions

View File

@ -0,0 +1,50 @@
<?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\Models\Members as MemberModel;
class Member extends AdminController {
public static $memberships;
public function __construct() {
parent::__construct();
self::$title = 'Admin - Memberships';
self::$memberships = new MemberModel;
$view = Navigation::activePageSelect( 'nav.admin', '/admin/member' );
Components::set( 'ADMINNAV', $view );
}
public function index( $data = null ) {
Views::view( 'members.admin.list', self::$memberships->list() );
}
public function create( $data = null ) {
}
public function edit( $data = null ) {
}
public function view( $data = null ) {
}
public function delete( $data = null ) {
}
public function preview( $data = null ) {
}
}

View File

@ -0,0 +1,36 @@
<?php
/**
* app/controllers/member.php
*
* This is the members 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;
use TheTempusProject\Houdini\Classes\Template;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Houdini\Classes\Issues;
use TheTempusProject\Classes\Controller;
use TheTempusProject\TheTempusProject as App;
use TheTempusProject\Hermes\Functions\Redirect;
use TheTempusProject\Bedrock\Functions\Session;
class Member extends Controller {
public function __construct() {
parent::__construct();
Template::noIndex();
if ( !App::$isMember ) {
Session::flash( 'error', 'You do not have permission to view this page.' );
return Redirect::home();
}
}
public function index() {
self::$title = 'Members Area';
Views::view( 'members.members' );
}
}

View File

@ -0,0 +1,36 @@
<?php
/**
* app/plugins/blog/models/blog.php
*
* This class is used for the manipulation of the blog database table.
*
* @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\Models;
use TheTempusProject\Canary\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Sanitize;
use TheTempusProject\Classes\DatabaseModel;
use TheTempusProject\TheTempusProject as App;
class Members extends DatabaseModel {
public $tableName = 'memberships';
public $databaseMatrix = [
[ 'name', 'string', '155' ],
// renews?
// does this renew periodically?
// renewal period?
// if periodic, how frequent?
// renewal type?
// automatic, manual review, paid
];
public function __construct() {
parent::__construct();
}
}

View File

@ -0,0 +1,33 @@
<?php
/**
* app/plugins/members/models/membershipAssociations.php
*
* This class is used for the manipulation of the membership associations database table.
*
* @package TP Members
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Models;
use TheTempusProject\Canary\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Sanitize;
use TheTempusProject\Classes\DatabaseModel;
use TheTempusProject\TheTempusProject as App;
class MembershipAssociations extends DatabaseModel {
public $tableName = 'membership_associations';
public $databaseMatrix = [
[ 'model_type', 'string', '' ],
[ 'model_id', 'int', '10' ],
[ 'membership_id', 'int', '10' ],
];
public function __construct() {
parent::__construct();
}
}

View File

@ -0,0 +1,32 @@
<?php
/**
* app/plugins/members/models/members.php
*
* This class is used for the manipulation of the members database table.
*
* @package TP Members
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Models;
use TheTempusProject\Canary\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Sanitize;
use TheTempusProject\Classes\DatabaseModel;
use TheTempusProject\TheTempusProject as App;
class MembershipRecords extends DatabaseModel {
public $tableName = 'membership_records';
public $databaseMatrix = [
[ 'membership_id', 'int', '10' ],
[ 'recorded_at', 'int', '10' ],
[ 'record_type', 'string', '' ],
];
public function __construct() {
parent::__construct();
}
}

View File

@ -0,0 +1,75 @@
<?php
/**
* app/plugins/chat/plugin.php
*
* This houses all of the main plugin info and functionality.
*
* @package TP Chat
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Plugins;
use TheTempusProject\TheTempusProject as App;
use TheTempusProject\Classes\Plugin;
class Members extends Plugin {
public $pluginName = 'TP Membership';
public $configName = 'membership';
public $pluginAuthor = 'JoeyK';
public $pluginWebsite = 'https://TheTempusProject.com';
public $modelVersion = '1.0';
public $pluginVersion = '3.0';
public $pluginDescription = 'A simple plugin which adds a site wide membership system.';
public $permissionMatrix = [
'memberAccess' => [
'pretty' => 'Access Member Areas',
'default' => false,
],
'controlMemberships' => [
'pretty' => 'User can Access and Control user memberships.',
'default' => false,
],
];
public $admin_links = [
[
'text' => '<i class="fa fa-fw fa-lock"></i> Memberships',
'url' => '{ROOT_URL}admin/member',
],
];
public $main_links = [
[
'text' => 'Members',
'url' => '{ROOT_URL}member/index',
'filter' => 'member',
],
];
public $resourceMatrix = [
'groups' => [
[
'name' => 'Member',
'permissions' => '{"adminAccess":false}',
]
],
];
public function __construct( $load = false ) {
if ( App::$isLoggedIn ) {
App::$isMember = $this->hasMemberAccess( App::$activeGroup );
if ( empty( App::$isMember ) ) {
App::$isMember = $this->hasMemberAccess( App::$activeUser );
}
}
$this->filters[] = [
'name' => 'member',
'find' => '#{MEMBER}(.*?){/MEMBER}#is',
'replace' => ( App::$isMember ? '$1' : '' ),
'enabled' => true,
];
parent::__construct( $load );
}
public function hasMemberAccess( $input ) {
return true;
}
}

View File

@ -0,0 +1 @@
list here

View File

@ -0,0 +1,6 @@
<h1>Members' Area</h1>
<div class="jumbotron">
<h1>Welcome!</h1>
<p>This is the members section. You can give some groups permission to access these areas. the menu is hidden for normal users and if they get a link to a member's area, the authentication system will stop them from accessing any content protected this way.</p>
<p>You can even use this feature in-line with your views, hiding certain components from non-members</p>
</div>