Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
35b7be92a6 | |||
d4751696f3 | |||
fa12dd20ba | |||
41a6aed209 | |||
509a10bc36 | |||
5e99213601 |
@ -35,7 +35,7 @@ class Config extends BedrockConfig {
|
|||||||
case 'radio':
|
case 'radio':
|
||||||
case 'bool':
|
case 'bool':
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
$fieldHtml = Forms::getSwitchHtml( $fieldname, [ 'true', 'false' ], $node['value'] );
|
$fieldHtml = Forms::getSwitchHtml( $fieldname, $node['value'] );
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
$fieldHtml = Forms::getSelectHtml( $fieldname, $options, $node['value'] );
|
$fieldHtml = Forms::getSelectHtml( $fieldname, $options, $node['value'] );
|
||||||
|
@ -19,6 +19,7 @@ use TheTempusProject\Bedrock\Functions\Check;
|
|||||||
use TheTempusProject\Bedrock\Functions\Upload;
|
use TheTempusProject\Bedrock\Functions\Upload;
|
||||||
use TheTempusProject\Bedrock\Functions\Input;
|
use TheTempusProject\Bedrock\Functions\Input;
|
||||||
use TheTempusProject\TheTempusProject as App;
|
use TheTempusProject\TheTempusProject as App;
|
||||||
|
use TheTempusProject\Bedrock\Classes\Config;
|
||||||
|
|
||||||
class Preferences {
|
class Preferences {
|
||||||
public static $preferences = false;
|
public static $preferences = false;
|
||||||
@ -208,6 +209,15 @@ class Preferences {
|
|||||||
if ( $tempPrefsArray['type'] == 'checkbox' ) {
|
if ( $tempPrefsArray['type'] == 'checkbox' ) {
|
||||||
$tempPrefsArray['type'] = 'switch';
|
$tempPrefsArray['type'] = 'switch';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( 'file' === $tempPrefsArray['type'] ) {
|
||||||
|
// dv( Config::getValue( 'uploads/images' ) );
|
||||||
|
if ( ! Config::getValue( 'uploads/images' ) ) {
|
||||||
|
Debug::info( 'Preference hidden because uploads are disabled.' );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$inputTypes[ $tempPrefsArray['type'] ][] = self::getFormFieldHtml( $name, $tempPrefsArray['pretty'], $tempPrefsArray['type'], $tempPrefsArray['value'], $tempPrefsArray['options'] );
|
$inputTypes[ $tempPrefsArray['type'] ][] = self::getFormFieldHtml( $name, $tempPrefsArray['pretty'], $tempPrefsArray['type'], $tempPrefsArray['value'], $tempPrefsArray['options'] );
|
||||||
}
|
}
|
||||||
foreach ( $inputTypes as $skip => $items ) {
|
foreach ( $inputTypes as $skip => $items ) {
|
||||||
@ -295,6 +305,7 @@ class Preferences {
|
|||||||
$prefsArray[$name] = $route . Upload::last();
|
$prefsArray[$name] = $route . Upload::last();
|
||||||
} else {
|
} else {
|
||||||
Issues::add( 'error', [ 'There was an error with your upload.' => Check::userErrors() ] );
|
Issues::add( 'error', [ 'There was an error with your upload.' => Check::userErrors() ] );
|
||||||
|
unset( $prefsArray[$name] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class Routes extends AdminController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function create() {
|
public function create() {
|
||||||
if ( Input::exists( 'redirect_type' ) ) {
|
if ( ! Input::exists( 'redirect_type' ) ) {
|
||||||
return Views::view( 'admin.routes.create' );
|
return Views::view( 'admin.routes.create' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ use TheTempusProject\Houdini\Classes\Issues;
|
|||||||
use TheTempusProject\Houdini\Classes\Views;
|
use TheTempusProject\Houdini\Classes\Views;
|
||||||
use TheTempusProject\Models\User;
|
use TheTempusProject\Models\User;
|
||||||
use TheTempusProject\Models\Subscribe;
|
use TheTempusProject\Models\Subscribe;
|
||||||
|
use TheTempusProject\Plugins\Subscribe as Plugin;
|
||||||
|
|
||||||
class SendMail extends AdminController {
|
class SendMail extends AdminController {
|
||||||
public static $user;
|
public static $user;
|
||||||
@ -27,10 +28,24 @@ class SendMail extends AdminController {
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
self::$title = 'Admin - Send Mail';
|
self::$title = 'Admin - Send Mail';
|
||||||
self::$user = new User;
|
self::$user = new User;
|
||||||
self::$subscribe = new Subscribe;
|
|
||||||
|
if ( class_exists( 'TheTempusProject\Plugins\Subscribe' ) ) {
|
||||||
|
$plugin = new Plugin;
|
||||||
|
if ( ! $plugin->checkEnabled() ) {
|
||||||
|
Issues::add( 'notice', 'Subscriptions are disabled so those feature will be unavailable.' );
|
||||||
|
} else {
|
||||||
|
self::$subscribe = new Subscribe;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Issues::add( 'notice', 'Subscriptions plugin is not installed so those feature will be unavailable.' );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function emailSubscribers( $params ) {
|
private function emailSubscribers( $params ) {
|
||||||
|
if ( empty( self::$subscribe ) ) {
|
||||||
|
Issues::add( 'error', 'Subscriptions plugin is unavailable' );
|
||||||
|
return;
|
||||||
|
}
|
||||||
$list = self::$subscribe->list();
|
$list = self::$subscribe->list();
|
||||||
if ( empty( $list ) ) {
|
if ( empty( $list ) ) {
|
||||||
Issues::add( 'error', 'No subscribers found' );
|
Issues::add( 'error', 'No subscribers found' );
|
||||||
|
@ -24,6 +24,7 @@ use TheTempusProject\Houdini\Classes\Views;
|
|||||||
use TheTempusProject\TheTempusProject as App;
|
use TheTempusProject\TheTempusProject as App;
|
||||||
use TheTempusProject\Classes\Controller;
|
use TheTempusProject\Classes\Controller;
|
||||||
use TheTempusProject\Classes\Forms;
|
use TheTempusProject\Classes\Forms;
|
||||||
|
use TheTempusProject\Bedrock\Classes\Config;
|
||||||
|
|
||||||
class Register extends Controller {
|
class Register extends Controller {
|
||||||
public function confirm( $code = null ) {
|
public function confirm( $code = null ) {
|
||||||
@ -46,6 +47,11 @@ class Register extends Controller {
|
|||||||
public function index() {
|
public function index() {
|
||||||
self::$title = '{SITENAME} Sign Up';
|
self::$title = '{SITENAME} Sign Up';
|
||||||
self::$pageDescription = 'Many features of {SITENAME} are disabled or hidden from unregistered users. On this page you can sign up for an account to access all the app has to offer.';
|
self::$pageDescription = 'Many features of {SITENAME} are disabled or hidden from unregistered users. On this page you can sign up for an account to access all the app has to offer.';
|
||||||
|
|
||||||
|
if ( ! Config::getValue( 'main/registrationEnabled' ) ) {
|
||||||
|
return Issues::add( 'notice', 'The site administrator has disable the ability to register a new account.' );
|
||||||
|
}
|
||||||
|
|
||||||
Components::set( 'TERMS', Views::simpleView( 'terms' ) );
|
Components::set( 'TERMS', Views::simpleView( 'terms' ) );
|
||||||
if ( App::$isLoggedIn ) {
|
if ( App::$isLoggedIn ) {
|
||||||
return Issues::add( 'notice', 'You are currently logged in.' );
|
return Issues::add( 'notice', 'You are currently logged in.' );
|
||||||
|
@ -101,15 +101,17 @@ class Usercp extends Controller {
|
|||||||
$menu = Views::simpleView( 'nav.usercp', App::$userCPlinks );
|
$menu = Views::simpleView( 'nav.usercp', App::$userCPlinks );
|
||||||
Navigation::activePageSelect( $menu, null, true, true );
|
Navigation::activePageSelect( $menu, null, true, true );
|
||||||
$prefs = new Preferences;
|
$prefs = new Preferences;
|
||||||
$fields = App::$activePrefs;
|
$userPrefs = App::$activePrefs;
|
||||||
if ( Input::exists( 'submit' ) ) {
|
if ( Input::exists( 'submit' ) ) {
|
||||||
$fields = $prefs->convertFormToArray( true, false );
|
$fields = $prefs->convertFormToArray( true, false );
|
||||||
// @TODO now i may need to rework the form checker to work with this....
|
|
||||||
// if (!Forms::check('userPrefs')) {
|
|
||||||
// Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
|
|
||||||
// }
|
|
||||||
self::$user->updatePrefs( $fields, App::$activeUser->ID );
|
self::$user->updatePrefs( $fields, App::$activeUser->ID );
|
||||||
Issues::add( 'success', 'Your preferences have been updated.' );
|
Issues::add( 'success', 'Your preferences have been updated.' );
|
||||||
|
// if the image upload fails, need to fall back on original
|
||||||
|
if ( empty( $fields['avatar'] ) ) {
|
||||||
|
$fields['avatar'] = $userPrefs['avatar'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$fields = $userPrefs;
|
||||||
}
|
}
|
||||||
Components::set( 'AVATAR_SETTINGS', $fields['avatar'] );
|
Components::set( 'AVATAR_SETTINGS', $fields['avatar'] );
|
||||||
Components::set( 'PREFERENCES_FORM', $prefs->getFormHtml( $fields ) );
|
Components::set( 'PREFERENCES_FORM', $prefs->getFormHtml( $fields ) );
|
||||||
|
@ -95,25 +95,45 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const ttpDarkmode = document.getElementById('dark-mode-pref');
|
||||||
const toggleButton = document.getElementById('dark-mode-toggle');
|
const toggleButton = document.getElementById('dark-mode-toggle');
|
||||||
const enableButton = document.getElementById('dark-mode-toggle-button');
|
const enableButton = document.getElementById('dark-mode-toggle-button');
|
||||||
const darkModeStylesheet = document.getElementById('dark-mode-stylesheet');
|
const darkModeStylesheet = document.getElementById('dark-mode-stylesheet');
|
||||||
|
let currentState = '';
|
||||||
|
|
||||||
// Check if dark mode is saved in localStorage
|
// Check if dark mode is set by ttp
|
||||||
if (localStorage.getItem('darkMode') === 'enabled') {
|
if ( ttpDarkmode ) {
|
||||||
|
if ( 'true' == ttpDarkmode.value ) {
|
||||||
|
currentState = 'enabled';
|
||||||
|
}
|
||||||
|
if ( 'false' == ttpDarkmode.value ) {
|
||||||
|
currentState = 'disabled';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if dark mode is set in localStorage
|
||||||
|
if ( '' == currentState ) {
|
||||||
|
if ( localStorage.getItem('darkMode') === 'enabled' ) {
|
||||||
|
currentState = 'enabled';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update current button states
|
||||||
|
if ( 'enabled' == currentState ) {
|
||||||
darkModeStylesheet.disabled = false;
|
darkModeStylesheet.disabled = false;
|
||||||
|
|
||||||
if ( toggleButton ) {
|
if ( toggleButton ) {
|
||||||
toggleButton.checked = true;
|
toggleButton.checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( enableButton ) {
|
if ( enableButton ) {
|
||||||
enableButton.innerText = 'Disable Now';
|
enableButton.innerText = 'Disable Now';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Style striped table elements
|
||||||
document.querySelectorAll('.table-striped').forEach((table) => {
|
document.querySelectorAll('.table-striped').forEach((table) => {
|
||||||
if (localStorage.getItem('darkMode') === 'enabled') {
|
if ( 'enabled' == currentState ) {
|
||||||
table.classList.add('table-dark');
|
table.classList.add('table-dark');
|
||||||
} else {
|
} else {
|
||||||
table.classList.add('table-light')
|
table.classList.add('table-light')
|
||||||
@ -122,7 +142,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
if ( enableButton ) {
|
if ( enableButton ) {
|
||||||
enableButton.addEventListener('click', function () {
|
enableButton.addEventListener('click', function () {
|
||||||
if (darkModeStylesheet.disabled) {
|
if ( darkModeStylesheet.disabled ) {
|
||||||
darkModeStylesheet.disabled = false;
|
darkModeStylesheet.disabled = false;
|
||||||
localStorage.setItem('darkMode', 'enabled');
|
localStorage.setItem('darkMode', 'enabled');
|
||||||
enableButton.innerText = 'Disable Now';
|
enableButton.innerText = 'Disable Now';
|
||||||
@ -138,21 +158,21 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
toggleButton.addEventListener('click', function () {
|
toggleButton.addEventListener('click', function () {
|
||||||
if (darkModeStylesheet.disabled) {
|
if (darkModeStylesheet.disabled) {
|
||||||
toggleDarkModePref( true );
|
toggleDarkModePref( true );
|
||||||
darkModeStylesheet.disabled = false;
|
darkModeStylesheet.disabled = false;
|
||||||
localStorage.setItem('darkMode', 'enabled');
|
localStorage.setItem('darkMode', 'enabled');
|
||||||
|
} else {
|
||||||
|
toggleDarkModePref( false );
|
||||||
|
darkModeStylesheet.disabled = true;
|
||||||
|
localStorage.setItem('darkMode', 'disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
document.querySelectorAll('.table-striped').forEach((table) => {
|
||||||
|
if (localStorage.getItem('darkMode') === 'enabled') {
|
||||||
|
table.classList.add('table-dark');
|
||||||
|
table.classList.remove('table-light');
|
||||||
} else {
|
} else {
|
||||||
toggleDarkModePref( false );
|
table.classList.add('table-light');
|
||||||
darkModeStylesheet.disabled = true;
|
table.classList.remove('table-dark');
|
||||||
localStorage.setItem('darkMode', 'disabled');
|
|
||||||
}
|
|
||||||
|
|
||||||
document.querySelectorAll('.table-striped').forEach((table) => {
|
|
||||||
if (localStorage.getItem('darkMode') === 'enabled') {
|
|
||||||
table.classList.add('table-dark');
|
|
||||||
table.classList.remove('table-light');
|
|
||||||
} else {
|
|
||||||
table.classList.add('table-light');
|
|
||||||
table.classList.remove('table-dark');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -31,7 +31,7 @@ class Group extends DatabaseModel {
|
|||||||
'defaultGroup' => [
|
'defaultGroup' => [
|
||||||
'type' => 'customSelect',
|
'type' => 'customSelect',
|
||||||
'pretty' => 'The Default Group for new registrations.',
|
'pretty' => 'The Default Group for new registrations.',
|
||||||
'default' => 5,
|
'default' => 4,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
public $databaseMatrix = [
|
public $databaseMatrix = [
|
||||||
|
@ -19,6 +19,9 @@ use TheTempusProject\Houdini\Classes\Views;
|
|||||||
use TheTempusProject\Houdini\Classes\Issues;
|
use TheTempusProject\Houdini\Classes\Issues;
|
||||||
use TheTempusProject\Bedrock\Functions\Check;
|
use TheTempusProject\Bedrock\Functions\Check;
|
||||||
use TheTempusProject\Bedrock\Functions\Input;
|
use TheTempusProject\Bedrock\Functions\Input;
|
||||||
|
use TheTempusProject\TheTempusProject as App;
|
||||||
|
use TheTempusProject\Hermes\Functions\Redirect;
|
||||||
|
use TheTempusProject\Bedrock\Functions\Session;
|
||||||
|
|
||||||
class Messages extends Controller {
|
class Messages extends Controller {
|
||||||
private static $message;
|
private static $message;
|
||||||
@ -27,6 +30,10 @@ class Messages extends Controller {
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
self::$title = 'Messages';
|
self::$title = 'Messages';
|
||||||
self::$message = new Message;
|
self::$message = new Message;
|
||||||
|
if ( ! App::$isLoggedIn ) {
|
||||||
|
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||||
|
return Redirect::home();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create() {
|
public function create() {
|
||||||
@ -71,8 +78,9 @@ class Messages extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
Views::view( 'messages.inbox', self::$message->getInbox() );
|
Components::set( 'message_inbox', Views::simpleView( 'messages.inbox', self::$message->getInbox() ) );
|
||||||
Views::view( 'messages.outbox', self::$message->getOutbox() );
|
Components::set( 'message_outbox', Views::simpleView( 'messages.outbox', self::$message->getOutbox() ) );
|
||||||
|
Views::view( 'messages.index' );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function read( $id = '' ) {
|
public function read( $id = '' ) {
|
||||||
|
@ -1 +1 @@
|
|||||||
<span class="label label-danger">{MESSAGE_COUNT}</span>
|
<span class="badge bg-danger rounded-pill">{MESSAGE_COUNT}</span>
|
@ -1,7 +1,6 @@
|
|||||||
<h2>Inbox</h2>
|
<h2>Inbox</h2>
|
||||||
{PAGINATION}
|
|
||||||
<form action="{ROOT_URL}messages/delete" method="post">
|
<form action="{ROOT_URL}messages/delete" method="post">
|
||||||
<table class="table table-hover">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 20%">From</th>
|
<th style="width: 20%">From</th>
|
||||||
|
8
app/plugins/messages/views/index.html
Normal file
8
app/plugins/messages/views/index.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div class="context-main context-main-bg col-10 offset-1 my-3 p-3">
|
||||||
|
<div class="my-3 p-3">
|
||||||
|
{message_inbox}
|
||||||
|
</div>
|
||||||
|
<div class="my-3 p-3">
|
||||||
|
{message_outbox}
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -1,43 +1,37 @@
|
|||||||
<div class="container">
|
<div class="context-main context-main-bg col-8 offset-2 my-3 p-3">
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12 col-md-6 col-lg-6 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
<div class="col-sm-12 col-md-6 col-lg-6 col-sm-offset-0 col-md-offset-3 col-lg-offset-3 top-pad" >
|
||||||
<div class="card panel-primary">
|
<div class="card panel-primary">
|
||||||
{LOOP}
|
{LOOP}
|
||||||
{SINGLE}
|
{SINGLE}
|
||||||
<div class="card-header">
|
<div class="card-header context-main-bg">
|
||||||
<h3 class="card-title">{subject}</h3>
|
<h5 class="card-title context-main">{subject}</h5>
|
||||||
</div>
|
|
||||||
{/SINGLE}
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3 col-lg-3 " align="center">
|
|
||||||
<a href="{ROOT_URL}home/profile/{userFrom}">{userFrom}</a><br>
|
|
||||||
<img alt="User Pic" src="{ROOT_URL}{fromAvatar}" class="img-circle img-responsive">
|
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-md-9 col-lg-9 ">
|
{/SINGLE}
|
||||||
<table class="table table-user-information">
|
<div class="card-body context-second-bg">
|
||||||
<tbody>
|
<div class="row">
|
||||||
<td>{message}</td>
|
<div class="col-md-3 col-lg-3 text-center">
|
||||||
</tbody>
|
<a href="{ROOT_URL}home/profile/{userFrom}">{userFrom}</a><br>
|
||||||
</table>
|
<img alt="User Pic" src="{ROOT_URL}{fromAvatar}" class="img-circle img-fluid">
|
||||||
|
</div>
|
||||||
|
<div class=" col-md-9 col-lg-9 context-main">
|
||||||
|
{message}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="card-footer context-main-bg">
|
||||||
<div class="card-footer">
|
{ADMIN}
|
||||||
{ADMIN}
|
{ID}
|
||||||
{ID}
|
<span class="float-right">
|
||||||
<span class="float-right">
|
{DTC}{sent}{/DTC}
|
||||||
{DTC}{sent}{/DTC}
|
</span>
|
||||||
</span>
|
{/ADMIN}
|
||||||
{/ADMIN}
|
</div>
|
||||||
</div>
|
|
||||||
{/LOOP}
|
{/LOOP}
|
||||||
</div>
|
</div>
|
||||||
<form action="{ROOT_URL}messages/reply" method="post">
|
<form action="{ROOT_URL}messages/reply" method="post">
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
<input type="hidden" name="token" value="{TOKEN}">
|
||||||
<input type="hidden" name="messageID" value="{PID}">
|
<input type="hidden" name="messageID" value="{PID}">
|
||||||
<button name="submit" value="reply" type="submit" class="btn btn-sm btn-primary">Reply</button>
|
<button name="submit" value="reply" type="submit" class="btn btn-md btn-primary my-4">Reply</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
@ -1,49 +1,46 @@
|
|||||||
<div class="dropdown nav-item mx-2">
|
<div class="dropdown nav-item mx-2">
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="d-block dropdown-toggle nav-link"
|
class="d-flex align-items-center text-white text-decoration-none dropdown-toggle"
|
||||||
id="messagesDropdown"
|
id="messagesDropdown"
|
||||||
data-bs-toggle="dropdown"
|
data-bs-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
<i class="fa fa-fw fa-envelope"></i><span class="ml-3">{MBADGE}</span>
|
<i class="fa fa-fw fa-envelope"></i><span class="">{MBADGE}</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu text-small" aria-labelledby="messagesDropdown">
|
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="messagesDropdown">
|
||||||
<li class="message-header">
|
|
||||||
<div class="media">
|
|
||||||
<div class="media-body text-center" style="padding-bottom: 10px; padding-top: 10px">
|
|
||||||
{MESSAGE_COUNT} unread message(s) total
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{LOOP}
|
{LOOP}
|
||||||
<li class="message-preview">
|
<!-- Message Item -->
|
||||||
<a href="{ROOT_URL}messages/view/{ID}">
|
<li>
|
||||||
<div class="media">
|
<a href="{ROOT_URL}messages/view/{ID}" class="dropdown-item">
|
||||||
<span class="float-left">
|
<div class="d-flex">
|
||||||
<img class="media-object avatar-round-40" src="{ROOT_URL}{fromAvatar}" alt="">
|
<h5 class="media-heading text-start">
|
||||||
</span>
|
<img class="" style="width: 40px;" src="{ROOT_URL}{fromAvatar}" alt="">
|
||||||
<div class="media-body">
|
<strong>{userFrom}</strong>
|
||||||
<h5 class="media-heading"><strong>{userFrom}</strong>
|
</h5>
|
||||||
</h5>
|
<div class="text-end">
|
||||||
<p class="small text-muted"><i class="fa fa-clock-o"></i> {DTC}{lastReply}{/DTC}</p>
|
<div class="media-body">
|
||||||
{summary}
|
<p class="small text-muted mb-1"><i class="fa fa-clock-o me-1"></i> {DTC}{lastReply}{/DTC}</p>
|
||||||
|
<span>{summary}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/LOOP}
|
{/LOOP}
|
||||||
{ALT}
|
{ALT}
|
||||||
<li class="message-preview">
|
<li class="px-3 text-center">
|
||||||
<div class="media">
|
<strong>No Messages</strong>
|
||||||
<div class="media-body text-center" style="padding-bottom: 10px; padding-top: 10px">
|
|
||||||
<h5 class="media-heading"><strong>No Messages</strong></h5>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
{/ALT}
|
{/ALT}
|
||||||
<li class="message-footer text-center">
|
<!-- Footer -->
|
||||||
<a href="{ROOT_URL}messages" class="dropdown-item">Read All New Messages</a>
|
<li>
|
||||||
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/messages" class="dropdown-item text-center">
|
||||||
|
Read All New Messages
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
@ -1,7 +1,6 @@
|
|||||||
<h2>Outbox</h2>
|
<h2>Outbox</h2>
|
||||||
{PAGINATION}
|
|
||||||
<form action="{ROOT_URL}messages/delete" method="post">
|
<form action="{ROOT_URL}messages/delete" method="post">
|
||||||
<table class="table table-hover">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 20%">To</th>
|
<th style="width: 20%">To</th>
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
<form action="" method="post" class="form-horizontal">
|
<div class="context-main context-main-bg col-8 offset-2 my-3 p-3">
|
||||||
<legend>Reply</legend>
|
<form action="" method="post" class="form-horizontal">
|
||||||
<fieldset>
|
<legend class="text-center">Reply</legend>
|
||||||
<div class="form-group">
|
<fieldset>
|
||||||
<label for="message" class="col-lg-3 control-label">Message:</label>
|
<div class="form-group">
|
||||||
<div class="col-lg-6">
|
<div class="col-6 offset-3">
|
||||||
<textarea class="form-control" name="message" maxlength="2000" rows="10" cols="50" id="message"></textarea>
|
<label for="message" class="control-label">Message:</label>
|
||||||
|
<textarea class="form-control" name="message" maxlength="2000" rows="10" cols="50" id="message"></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<input type="hidden" name="messageID" value="{messageID}">
|
||||||
|
<input type="hidden" name="token" value="{TOKEN}">
|
||||||
|
<div class="text-center">
|
||||||
|
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block my-3">Send</button>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</form>
|
||||||
<input type="hidden" name="messageID" value="{messageID}">
|
</div>
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Send</button><br>
|
|
||||||
</form>
|
|
@ -17,6 +17,8 @@ use TheTempusProject\Houdini\Classes\Issues;
|
|||||||
use TheTempusProject\Classes\Controller;
|
use TheTempusProject\Classes\Controller;
|
||||||
use TheTempusProject\Models\Notification as NotificationsModel;
|
use TheTempusProject\Models\Notification as NotificationsModel;
|
||||||
use TheTempusProject\TheTempusProject as App;
|
use TheTempusProject\TheTempusProject as App;
|
||||||
|
use TheTempusProject\Hermes\Functions\Redirect;
|
||||||
|
use TheTempusProject\Bedrock\Functions\Session;
|
||||||
|
|
||||||
class Notifications extends Controller {
|
class Notifications extends Controller {
|
||||||
protected static $notifications;
|
protected static $notifications;
|
||||||
@ -26,6 +28,10 @@ class Notifications extends Controller {
|
|||||||
self::$notifications = new NotificationsModel;
|
self::$notifications = new NotificationsModel;
|
||||||
self::$title = 'Notifications - {SITENAME}';
|
self::$title = 'Notifications - {SITENAME}';
|
||||||
self::$pageDescription = 'Your recent notifications';
|
self::$pageDescription = 'Your recent notifications';
|
||||||
|
if ( ! App::$isLoggedIn ) {
|
||||||
|
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||||
|
return Redirect::home();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
data-bs-toggle="dropdown"
|
data-bs-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
<i class="fa fa-fw fa-bell"></i><span class="ms-2">{NBADGE}</span>
|
<i class="fa fa-fw fa-bell"></i><span class="">{NBADGE}</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="notificationsDropdown">
|
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="notificationsDropdown">
|
||||||
{LOOP}
|
{LOOP}
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* app/plugins/redirects/plugin.php
|
|
||||||
*
|
|
||||||
* This houses all of the main plugin info and functionality.
|
|
||||||
*
|
|
||||||
* @package TP Redirects
|
|
||||||
* @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 ReflectionClass;
|
|
||||||
use TheTempusProject\Classes\Installer;
|
|
||||||
use TheTempusProject\Houdini\Classes\Navigation;
|
|
||||||
use TheTempusProject\Classes\Plugin;
|
|
||||||
use TheTempusProject\TheTempusProject as App;
|
|
||||||
|
|
||||||
class Redirects extends Plugin {
|
|
||||||
public $pluginName = 'TP Redirects';
|
|
||||||
public $pluginAuthor = 'JoeyK';
|
|
||||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
|
||||||
public $modelVersion = '1.0';
|
|
||||||
public $pluginVersion = '3.0';
|
|
||||||
public $pluginDescription = 'A simple plugin which adds redirects.';
|
|
||||||
public $permissionMatrix = [
|
|
||||||
'redirects' => [
|
|
||||||
'pretty' => 'Can modify redirects',
|
|
||||||
'default' => false,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
public $admin_links = [
|
|
||||||
[
|
|
||||||
'text' => '<i class="fa fa-fw fa-external-link"></i> Redirects',
|
|
||||||
'url' => '{ROOT_URL}admin/routes',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
@ -38,7 +38,9 @@ class Subscribe extends Plugin {
|
|||||||
public function __construct( $load = false ) {
|
public function __construct( $load = false ) {
|
||||||
parent::__construct( $load );
|
parent::__construct( $load );
|
||||||
if ( ! self::$loaded ) {
|
if ( ! self::$loaded ) {
|
||||||
Components::append( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
|
if ( $this->checkEnabled() ) {
|
||||||
|
Components::append( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
|
||||||
|
}
|
||||||
self::$loaded = true;
|
self::$loaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ class DefaultLoader extends Loader {
|
|||||||
if ( self::$loaded ) {
|
if ( self::$loaded ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Components::set( 'DARK_MODE_SETTING', '' );
|
||||||
Components::set( 'TEMPLATE_URL', Template::parse( '{ROOT_URL}app/templates/default/' ) );
|
Components::set( 'TEMPLATE_URL', Template::parse( '{ROOT_URL}app/templates/default/' ) );
|
||||||
if ( VENDOR_AUTOLOADED === true ) {
|
if ( VENDOR_AUTOLOADED === true ) {
|
||||||
Components::set( 'FONT_AWESOME_URL', '/vendor/fortawesome/font-awesome/css/' );
|
Components::set( 'FONT_AWESOME_URL', '/vendor/fortawesome/font-awesome/css/' );
|
||||||
@ -54,9 +55,11 @@ class DefaultLoader extends Loader {
|
|||||||
*/
|
*/
|
||||||
if ( App::$isLoggedIn ) {
|
if ( App::$isLoggedIn ) {
|
||||||
if ( ! empty( App::$activePrefs['darkMode'] ) ) {
|
if ( ! empty( App::$activePrefs['darkMode'] ) ) {
|
||||||
|
Components::set( 'DARK_MODE_SETTING', 'true' );
|
||||||
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
|
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
|
||||||
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet">' );
|
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet">' );
|
||||||
} else {
|
} else {
|
||||||
|
Components::set( 'DARK_MODE_SETTING', 'false' );
|
||||||
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
|
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
|
||||||
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' );
|
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' );
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="d-flex flex-column min-vh-100">
|
<div class="d-flex flex-column min-vh-100">
|
||||||
<div class="flex-container flex-grow-1">
|
<div class="flex-container flex-grow-1">
|
||||||
|
<!-- Issues -->
|
||||||
{ISSUES}
|
{ISSUES}
|
||||||
<div class="container pt-4">
|
<div class="container pt-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -65,10 +66,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/ISSUES}
|
{/ISSUES}
|
||||||
|
<!-- Main Page Content -->
|
||||||
{CONTENT}
|
{CONTENT}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Footer -->
|
||||||
{FOOT}
|
{FOOT}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- User Pref to control Dark mode across frontend and backend -->
|
||||||
|
<input type="hidden" name="dark-mode-pref" id="dark-mode-pref" value="{DARK_MODE_SETTING}">
|
||||||
<!-- Bootstrap core JavaScript and jquery -->
|
<!-- Bootstrap core JavaScript and jquery -->
|
||||||
<script crossorigin="anonymous" src="{JQUERY_CDN}jquery.min.js"></script>
|
<script crossorigin="anonymous" src="{JQUERY_CDN}jquery.min.js"></script>
|
||||||
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||||
@ -76,4 +81,4 @@
|
|||||||
<!-- Custom javascript for this template -->
|
<!-- Custom javascript for this template -->
|
||||||
{TEMPLATE_JS_INCLUDES}
|
{TEMPLATE_JS_INCLUDES}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -20,11 +20,11 @@
|
|||||||
</p>
|
</p>
|
||||||
<!-- Call-to-Action Buttons -->
|
<!-- Call-to-Action Buttons -->
|
||||||
<div class="d-flex justify-content-center gap-3 mt-4">
|
<div class="d-flex justify-content-center gap-3 mt-4">
|
||||||
<a href="/login" class="btn btn-success btn-lg">
|
<a href="/home/login" class="btn btn-success btn-lg">
|
||||||
<i class="fa fa-sign-in-alt me-2"></i> Log In
|
<i class="fa fa-sign-in-alt me-2"></i> Log In
|
||||||
</a>
|
</a>
|
||||||
<a href="/dashboard" class="btn btn-outline-success btn-lg">
|
<a href="/home/index" class="btn btn-outline-success btn-lg">
|
||||||
<i class="fa fa-cogs me-2"></i> Go to Dashboard
|
<i class="fa fa-cogs me-2"></i> Go to Homepage
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<form action="" method="post" class="">
|
<form action="" method="post" class="" enctype="multipart/form-data">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
{PREFERENCES_FORM}
|
{PREFERENCES_FORM}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -134,6 +134,10 @@ class TheTempusProject extends Bedrock {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'text' => '<i class="fa fa-fw fa-external-link"></i> Redirects',
|
||||||
|
'url' => '{ROOT_URL}admin/routes',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
public $main_links = [
|
public $main_links = [
|
||||||
[
|
[
|
||||||
@ -287,6 +291,11 @@ class TheTempusProject extends Bedrock {
|
|||||||
"pretty" => "Enable CSRF Token for all forms.",
|
"pretty" => "Enable CSRF Token for all forms.",
|
||||||
"default" => true
|
"default" => true
|
||||||
],
|
],
|
||||||
|
"registrationEnabled" => [
|
||||||
|
"type" => "radio",
|
||||||
|
"pretty" => "Allow new users to register an account.",
|
||||||
|
"default" => true
|
||||||
|
],
|
||||||
"loginLimit" => [
|
"loginLimit" => [
|
||||||
"type" => "text",
|
"type" => "text",
|
||||||
"pretty" => "Maximum Login Attempts per hour",
|
"pretty" => "Maximum Login Attempts per hour",
|
||||||
@ -300,17 +309,15 @@ class TheTempusProject extends Bedrock {
|
|||||||
],
|
],
|
||||||
"uploads" => [
|
"uploads" => [
|
||||||
"images" => [
|
"images" => [
|
||||||
"type"=> "radio",
|
"type" => "radio",
|
||||||
"pretty"=> "Upload Images Enabled",
|
"pretty" => "Upload Images Enabled",
|
||||||
"default"=> true,
|
"default" => true,
|
||||||
"protected"=> true,
|
"value" => true,
|
||||||
"value"=> true,
|
|
||||||
],
|
],
|
||||||
"maxImageSize"=> [
|
"maxImageSize"=> [
|
||||||
"type" => "text",
|
"type" => "text",
|
||||||
"pretty" => "Maximum size for image uploads",
|
"pretty" => "Maximum size for image uploads",
|
||||||
"default" => 500000,
|
"default" => 500000,
|
||||||
"protected" => true,
|
|
||||||
"value" => 500000,
|
"value" => 500000,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
@ -195,16 +195,22 @@ class Install extends Controller {
|
|||||||
public function configure() {
|
public function configure() {
|
||||||
if ( Forms::Check( 'installConfigure' ) ) {
|
if ( Forms::Check( 'installConfigure' ) ) {
|
||||||
$logo = 'images/logo.png';
|
$logo = 'images/logo.png';
|
||||||
|
$logoLarge = 'images/logoLarge.png';
|
||||||
if ( Input::exists( 'logo' ) && Upload::image( 'logo', 'System' ) ) {
|
if ( Input::exists( 'logo' ) && Upload::image( 'logo', 'System' ) ) {
|
||||||
$logo = 'Uploads/Images/System/' . Upload::last();
|
$logo = 'Uploads/Images/System/' . Upload::last();
|
||||||
}
|
}
|
||||||
TheTempusProject::$activeConfig->load( BEDROCK_CONFIG_JSON );
|
TheTempusProject::$activeConfig->load( BEDROCK_CONFIG_JSON );
|
||||||
$baseConfig = TheTempusProject::$configMatrix;
|
$baseConfig = TheTempusProject::$configMatrix;
|
||||||
$baseConfig['main']['logo']['value'] = $logo;
|
$baseConfig['main']['logo']['value'] = $logo;
|
||||||
|
$baseConfig['main']['logoLarge']['value'] = $logoLarge;
|
||||||
$baseConfig['main']['name']['value'] = Input::postNull( 'siteName' );
|
$baseConfig['main']['name']['value'] = Input::postNull( 'siteName' );
|
||||||
$baseConfig['main']['template']['value'] = $baseConfig['main']['template']['default'];
|
$baseConfig['main']['template']['value'] = $baseConfig['main']['template']['default'];
|
||||||
$baseConfig['main']['tokenEnabled']['value'] = $baseConfig['main']['tokenEnabled']['default'];
|
$baseConfig['main']['tokenEnabled']['value'] = $baseConfig['main']['tokenEnabled']['default'];
|
||||||
|
$baseConfig['main']['registrationEnabled']['value'] = $baseConfig['main']['registrationEnabled']['default'];
|
||||||
$baseConfig['main']['loginLimit']['value'] = $baseConfig['main']['loginLimit']['default'];
|
$baseConfig['main']['loginLimit']['value'] = $baseConfig['main']['loginLimit']['default'];
|
||||||
|
$baseConfig['main']['loginTimer']['value'] = $baseConfig['main']['loginTimer']['default'];
|
||||||
|
$baseConfig['uploads']['images']['value'] = $baseConfig['uploads']['images']['default'];
|
||||||
|
$baseConfig['uploads']['maxImageSize']['value'] = $baseConfig['uploads']['maxImageSize']['default'];
|
||||||
$baseConfig['database']['dbEnabled']['value'] = $baseConfig['database']['dbEnabled']['default'];
|
$baseConfig['database']['dbEnabled']['value'] = $baseConfig['database']['dbEnabled']['default'];
|
||||||
$baseConfig['database']['dbHost']['value'] = Input::postNull( 'dbHost' );
|
$baseConfig['database']['dbHost']['value'] = Input::postNull( 'dbHost' );
|
||||||
$baseConfig['database']['dbMaxQuery']['value'] = $baseConfig['database']['dbMaxQuery']['default'];
|
$baseConfig['database']['dbMaxQuery']['value'] = $baseConfig['database']['dbMaxQuery']['default'];
|
||||||
|
Reference in New Issue
Block a user