diff --git a/app/controllers/admin/home.php b/app/controllers/admin/home.php index 4ee8a79..dedddb1 100644 --- a/app/controllers/admin/home.php +++ b/app/controllers/admin/home.php @@ -22,7 +22,7 @@ use TheTempusProject\Plugins\Comments as CommentPlugin; use TheTempusProject\Plugins\Blog as BlogPlugin; use TheTempusProject\Plugins\Contact as ContactPlugin; use TheTempusProject\Canary\Bin\Canary as Debug; -use TheTempusProject\Houdini\Classes\Navigation; +use TheTempusProject\Bedrock\Functions\Input; class Home extends AdminController { public static $user; @@ -78,6 +78,11 @@ class Home extends AdminController { $users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) ); Components::set( 'userDash', $users ); + if ( Input::exists( 'submit' ) ) { + $results = Views::simpleView( 'admin.dashboard.users', self::$user->search( Input::post('searchTerm') ) ); + Components::set( 'searchResults', $results ); + } + Views::view( 'admin.dashboard.dash' ); } } diff --git a/app/controllers/alpha.php b/app/controllers/alpha.php deleted file mode 100644 index 1f6c806..0000000 --- a/app/controllers/alpha.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Controllers; - -use TheTempusProject\Classes\Controller; -use TheTempusProject\Houdini\Classes\Views; - -class Alpha extends Controller { - public function index() { - self::$title = 'Friends and Family Alpha'; - self::$pageDescription = 'The Tempus Project friends and family alpha has begun. Please join me and take part in bringing a dream to reality.'; - Views::view( 'alpha.index' ); - } - - public function crashcourse() { - self::$title = 'Friends and Family Crash-Course'; - self::$pageDescription = 'The Tempus Project runs not only this site, but it can be used and deployed for any number of sites. This crash course is intended to give you all the knowledge you will need to start building your own applications powered by The Tempus Project.'; - Views::view( 'alpha.crashcourse' ); - } - - public function certification() { - self::$title = 'Friends and Family Certification'; - self::$pageDescription = 'The Tempus Project runs not only this site, but it can be used and deployed for any number of sites. This certification course is intended to give experienced users all the information they will need to start building your own applications powered by The Tempus Project.'; - Views::view( 'alpha.certification' ); - } -} diff --git a/app/controllers/usercp.php b/app/controllers/usercp.php index c35ad0d..12b162d 100644 --- a/app/controllers/usercp.php +++ b/app/controllers/usercp.php @@ -104,6 +104,10 @@ class Usercp extends Controller { $userPrefs = App::$activePrefs; if ( Input::exists( 'submit' ) ) { $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 ); Issues::add( 'success', 'Your preferences have been updated.' ); // if the image upload fails, need to fall back on original diff --git a/app/css/main.css b/app/css/main.css index 4153e56..e984dd3 100644 --- a/app/css/main.css +++ b/app/css/main.css @@ -8,8 +8,7 @@ * @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ - - .context-other-bg { +.context-other-bg { background-color: #eaeaea; } @@ -77,14 +76,6 @@ hr { transform: translateX(25px); /* Adjust based on switch width */ } - - - - - - - - .context-main { color: #000; } diff --git a/app/css/wysiwyg.css b/app/css/wysiwyg.css deleted file mode 100644 index eeb25b2..0000000 --- a/app/css/wysiwyg.css +++ /dev/null @@ -1,218 +0,0 @@ -/** - * app/css/wysiwyg.css - * - * This file is for the wysiwyg editor's css. - * - * @version 3.0 - * @author Joey Kimsey - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -body { - margin: 0; - height: 100vh; - display: flex; - justify-content: center; - align-items: center; - font-family: 'Helvetica Neue', 'Helvetica', arial, sans-serif; -} - -/* WYSIWYG Editor */ -.wp-webdeasy-comment-editor { - width: 40rem; - min-height: 18rem; - box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.3); - border-top: 6px solid #4a4a4a; - border-radius: 3px; - margin: 2rem 0; - - .toolbar { - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); - - .line { - display: flex; - border-bottom: 1px solid #e2e2e2; - - &:last-child { - border-bottom: none; - } - - .box { - display: flex; - border-left: 1px solid #e2e2e2; - - .editor-btn { - display: block; - display: flex; - align-items: center; - justify-content: center; - position: relative; - transition: .2s ease all; - - &:hover, &.active { - background-color: #e1e1e1; - cursor: pointer; - } - - &.icon img { - width: 15px; - padding: 9px; - box-sizing: content-box; - } - - &.icon.smaller img { - width: 16px; - } - - &.has-submenu { - width: 20px; - padding: 0 10px; - - &::after { - content: ''; - width: 6px; - height: 6px; - position: absolute; - background-image: url(https://img.icons8.com/ios-glyphs/30/000000/chevron-down.png); - background-repeat: no-repeat; - background-size: cover; - background-position: center; - right: 4px; - } - - .submenu { - display: none; - position: absolute; - top: 34px; - left: -1px; - z-index: 10; - background-color: #FFF; - border: 1px solid #b5b5b5; - border-top: none; - - .btn { - width: 39px; - } - - &:hover { - display: block; - } - } - - &:hover .submenu { - display: block; - } - } - } - } - } - } - - .content-area { - padding: 15px 12px; - line-height: 1.5; - - .visuell-view { - outline: none; - min-height: 12rem; - - p { - margin: 12px 0; - } - } - - .html-view { - outline: none; - display: none; - width: 100%; - height: 200px; - border: none; - resize: none; - } - } -} - - -/* Modal */ -.modal { - z-index: 40; - display: none; - - .modal-wrapper { - background-color: #FFF; - padding: 1rem; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 20rem; - min-height: 10rem; - z-index: 41; - - .close { - position: absolute; - top: 1rem; - right: 1rem; - cursor: pointer; - } - - .modal-content { - flex-direction: column; - - h3 { - margin-top: 0; - } - - input { - margin: 1rem 0; - padding: .5rem; - } - - input[type="text"] { - width: calc(100% - 1rem); - } - - .row { - - label { - margin-left: .5rem; - } - } - - button { - background-color: #D2434F; - border: 0; - color: #FFF; - padding: .5rem 1.2rem; - cursor: pointer; - } - } - } - - .modal-bg { - position: fixed; - background-color: rgba(0, 0, 0, .3); - width: 100vw; - height: 100vh; - top: 0; - left: 0; - } -} - -/* Codepen Footer */ -footer { - position: fixed; - bottom: 0; - display: flex; - - p { - margin: 0.5rem 1rem; - font-size: 12px; - } - - a { - text-decoration: none; - font-weight: bold; - color: #000; - } -} \ No newline at end of file diff --git a/app/js/wysiwyg.js b/app/js/wysiwyg.js deleted file mode 100644 index 2d29989..0000000 --- a/app/js/wysiwyg.js +++ /dev/null @@ -1,233 +0,0 @@ -/** - * app/js/wysiwyg.js - * - * This is css used in the debuging console. - * - * @version 3.0 - * @author Joey Kimsey - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -// define vars -const editor = document.getElementsByClassName('wp-webdeasy-comment-editor')[0]; -const toolbar = editor.getElementsByClassName('toolbar')[0]; -const buttons = toolbar.querySelectorAll('.editor-btn:not(.has-submenu)'); -const contentArea = editor.getElementsByClassName('content-area')[0]; -const visuellView = contentArea.getElementsByClassName('visuell-view')[0]; -const htmlView = contentArea.getElementsByClassName('html-view')[0]; -const modal = document.getElementsByClassName('modal')[0]; - -// add active tag event -document.addEventListener('selectionchange', selectionChange); - -// add paste event -visuellView.addEventListener('paste', pasteEvent); - -// add paragraph tag on new line -contentArea.addEventListener('keypress', addParagraphTag); - -// add toolbar button actions -for(let i = 0; i < buttons.length; i++) { - let button = buttons[i]; - - button.addEventListener('click', function(e) { - let action = this.dataset.action; - - switch(action) { - case 'toggle-view': - execCodeAction(this, editor); - break; - case 'createLink': - execLinkAction(); - break; - default: - execDefaultAction(action); - } - - }); -} - -/** - * This function toggles between visual and html view - */ -function execCodeAction(button, editor) { - - if(button.classList.contains('active')) { // show visuell view - visuellView.innerHTML = htmlView.value; - htmlView.style.display = 'none'; - visuellView.style.display = 'block'; - - button.classList.remove('active'); - } else { // show html view - htmlView.innerText = visuellView.innerHTML; - visuellView.style.display = 'none'; - htmlView.style.display = 'block'; - - button.classList.add('active'); - } -} - -/** - * This function adds a link to the current selection - */ -function execLinkAction() { - modal.style.display = 'block'; - let selection = saveSelection(); - - let submit = modal.querySelectorAll('button.done')[0]; - let close = modal.querySelectorAll('.close')[0]; - - // done button active => add link - submit.addEventListener('click', function(e) { - e.preventDefault(); - let newTabCheckbox = modal.querySelectorAll('#new-tab')[0]; - let linkInput = modal.querySelectorAll('#linkValue')[0]; - let linkValue = linkInput.value; - let newTab = newTabCheckbox.checked; - - restoreSelection(selection); - - if(window.getSelection().toString()) { - let a = document.createElement('a'); - a.href = linkValue; - if(newTab) a.target = '_blank'; - window.getSelection().getRangeAt(0).surroundContents(a); - } - - modal.style.display = 'none'; - linkInput.value = ''; - - // deregister modal events - submit.removeEventListener('click', arguments.callee); - close.removeEventListener('click', arguments.callee); - }); - - // close modal on X click - close.addEventListener('click', function(e) { - e.preventDefault(); - let linkInput = modal.querySelectorAll('#linkValue')[0]; - - modal.style.display = 'none'; - linkInput.value = ''; - - // deregister modal events - submit.removeEventListener('click', arguments.callee); - close.removeEventListener('click', arguments.callee); - }); -} - -/** - * This function executes all 'normal' actions - */ -function execDefaultAction(action) { - document.execCommand(action, false); -} - -/** - * Saves the current selection - */ -function saveSelection() { - if(window.getSelection) { - sel = window.getSelection(); - if(sel.getRangeAt && sel.rangeCount) { - let ranges = []; - for(var i = 0, len = sel.rangeCount; i < len; ++i) { - ranges.push(sel.getRangeAt(i)); - } - return ranges; - } - } else if (document.selection && document.selection.createRange) { - return document.selection.createRange(); - } - return null; -} - -/** - * Loads a saved selection - */ -function restoreSelection(savedSel) { - if(savedSel) { - if(window.getSelection) { - sel = window.getSelection(); - sel.removeAllRanges(); - for(var i = 0, len = savedSel.length; i < len; ++i) { - sel.addRange(savedSel[i]); - } - } else if(document.selection && savedSel.select) { - savedSel.select(); - } - } -} - -/** - * Sets the current selected format buttons active/inactive - */ -function selectionChange(e) { - - for(let i = 0; i < buttons.length; i++) { - let button = buttons[i]; - - // don't remove active class on code toggle button - if(button.dataset.action === 'toggle-view') continue; - - button.classList.remove('active'); - } - - if(!childOf(window.getSelection().anchorNode.parentNode, editor)) return false; - - parentTagActive(window.getSelection().anchorNode.parentNode); -} - -/** - * Checks if the passed child has the passed parent - */ -function childOf(child, parent) { - return parent.contains(child); -} - -/** - * Sets the tag active that is responsible for the current element - */ -function parentTagActive(elem) { - if(!elem ||!elem.classList || elem.classList.contains('visuell-view')) return false; - - let toolbarButton; - - // active by tag names - let tagName = elem.tagName.toLowerCase(); - toolbarButton = document.querySelectorAll(`.toolbar .editor-btn[data-tag-name="${tagName}"]`)[0]; - if(toolbarButton) { - toolbarButton.classList.add('active'); - } - - // active by text-align - let textAlign = elem.style.textAlign; - toolbarButton = document.querySelectorAll(`.toolbar .editor-btn[data-style="textAlign:${textAlign}"]`)[0]; - if(toolbarButton) { - toolbarButton.classList.add('active'); - } - - return parentTagActive(elem.parentNode); -} - -/** - * Handles the paste event and removes all HTML tags - */ -function pasteEvent(e) { - e.preventDefault(); - - let text = (e.originalEvent || e).clipboardData.getData('text/plain'); - document.execCommand('insertHTML', false, text); -} - -/** - * This functions adds a paragraph tag when the enter key is pressed - */ -function addParagraphTag(evt) { - if (evt.keyCode == '13') { - - // don't add a p tag on list item - if(window.getSelection().anchorNode.parentNode.tagName === 'LI') return; - document.execCommand('formatBlock', false, 'p'); - } -} \ No newline at end of file diff --git a/app/models/group.php b/app/models/group.php index 759dae7..f5331a3 100644 --- a/app/models/group.php +++ b/app/models/group.php @@ -38,6 +38,9 @@ class Group extends DatabaseModel { [ 'name', 'varchar', '32' ], [ 'permissions', 'text', '' ], ]; + public $searchFields = [ + 'name', + ]; public $permissionMatrix = [ 'adminAccess' => [ 'pretty' => 'Access Administrator Areas', diff --git a/app/models/log.php b/app/models/log.php index efd7b4a..135758b 100644 --- a/app/models/log.php +++ b/app/models/log.php @@ -46,6 +46,9 @@ class Log extends DatabaseModel { [ 'source', 'varchar', '64' ], [ 'action', 'text', '' ], ]; + public $searchFields = [ + 'source', + ]; /** * The model constructor. diff --git a/app/models/routes.php b/app/models/routes.php index 8333692..a48b834 100644 --- a/app/models/routes.php +++ b/app/models/routes.php @@ -24,6 +24,9 @@ class Routes extends DatabaseModel { [ 'original_url', 'varchar', '32' ], [ 'forwarded_url', 'text', '' ], ]; + public $searchFields = [ + 'nickname', + ]; public $resourceMatrix = [ [ 'original_url' => 'fb', diff --git a/app/models/sessions.php b/app/models/sessions.php index 9edde85..427d573 100644 --- a/app/models/sessions.php +++ b/app/models/sessions.php @@ -36,6 +36,9 @@ class Sessions extends DatabaseModel { [ 'username', 'varchar', '20' ], [ 'token', 'varchar', '120' ], ]; + public $searchFields = [ + 'username', + ]; public static $activeSession = false; /** diff --git a/app/models/token.php b/app/models/token.php index fe9198a..59cb422 100644 --- a/app/models/token.php +++ b/app/models/token.php @@ -31,6 +31,10 @@ class Token extends DatabaseModel { [ 'createdBy', 'int', '10' ], [ 'expiresAt', 'int', '10' ], ]; + public $searchFields = [ + 'name', + 'token', + ]; public $permissionMatrix = [ 'addAppToken' => [ 'pretty' => 'Add Application Tokens', diff --git a/app/models/user.php b/app/models/user.php index 62012fa..0c520d6 100644 --- a/app/models/user.php +++ b/app/models/user.php @@ -44,6 +44,9 @@ class User extends DatabaseModel { [ 'confirmationCode', 'varchar', '80' ], [ 'prefs', 'text', '' ], ]; + public $searchFields = [ + 'username', + ]; public $permissionMatrix = [ 'uploadImages' => [ 'pretty' => 'Upload images (such as avatars)', diff --git a/app/views/admin/dashboard/dash.html b/app/views/admin/dashboard/dash.html index 240d46a..7f0d4c0 100644 --- a/app/views/admin/dashboard/dash.html +++ b/app/views/admin/dashboard/dash.html @@ -18,4 +18,28 @@ {blogDash} + + +Results +
+
+ +
+ +
+ +
+
+ + + + + +
+ +
+
+
+
+ {searchResults}
\ No newline at end of file diff --git a/app/views/alpha/certification.html b/app/views/alpha/certification.html deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/alpha/crashcourse.html b/app/views/alpha/crashcourse.html deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/alpha/index.html b/app/views/alpha/index.html deleted file mode 100644 index a56d78b..0000000 --- a/app/views/alpha/index.html +++ /dev/null @@ -1,30 +0,0 @@ -
-
-
-
-
-

Welcome to The Tempus-Project Friends and Family Alpha.

-
-

This project is now entering its third official version and nearly its tenth year of development. What a long journey it has been to get here.

-

With that being said, I won't waste your time with a journey down memory road. If you have been sent this page, clearly I trust you, or one of our mutual friends is an asshole. Both equally possible... The main purpose of inviting you was to ask for your help.

-

What I need

-

With any application, there are bugs. The best developers I have had the pleasure of working with make mundane every day mistakes just like everyone else. This obviously includes myself. With any project you spend years working on, you will develop blind spots, or places where even if something was broken, you would skip right past it and never notice.

-

I would like your help in identifying these such blind spots.

-

What you can do to help.

-

Currently there is a bug-report form at the bottom, usable by anyone with a registered account. I have also built an administrator system that allows me to track progress of these bugs and ensure they get fixed. In addition to tracking bugs, there is a public suggestions system and a publicly viewable to-do list.

-

I will need some users to help test very specific things like permissions for various groups. I will need some trusted users to act as administrators and test features. I will also just need some people to use and interact with the site to ensure they aren't encountering any bugs.

-

There are a ton of things you can do to help!

-
    -
  • Report any bugs!!! ( there is a bug-report link at the bottom of every page )
  • -
  • Register an account
  • -
  • Subscribe to the mailing list
  • -
  • Browse blog posts
  • -
  • Make suggestions for improvements or new features
  • -
  • Leave comments on the blog and other features.
  • -
  • Keep an eye out for email or messages requesting specific help.
  • -
-
-
-
-
-
diff --git a/app/views/debug.html b/app/views/debug.html deleted file mode 100644 index 0e3739c..0000000 --- a/app/views/debug.html +++ /dev/null @@ -1,16 +0,0 @@ - -
-
-

Debug Log:

- -
-
- {DEBUGGING_LOG} -
-
- \ No newline at end of file diff --git a/app/views/dump.html b/app/views/dump.html deleted file mode 100644 index ca16e83..0000000 --- a/app/views/dump.html +++ /dev/null @@ -1,9 +0,0 @@ - -
- -
-
{DUMP}
-
-
\ No newline at end of file diff --git a/app/views/hashtags.html b/app/views/hashtags.html deleted file mode 100644 index 412bab0..0000000 --- a/app/views/hashtags.html +++ /dev/null @@ -1 +0,0 @@ -

Hey there, it looks like you found our hastags! Unfortunately I haven't finished building them out just yet. Check back soon!

\ No newline at end of file diff --git a/bin/tempus_project.php b/bin/tempus_project.php index ac1f5f7..d1d46be 100644 --- a/bin/tempus_project.php +++ b/bin/tempus_project.php @@ -84,6 +84,10 @@ class TheTempusProject extends Bedrock { 'text' => ' Tokens', 'url' => '{ROOT_URL}admin/tokens', ], + [ + 'text' => ' Images', + 'url' => '{ROOT_URL}admin/images', + ], [ 'text' => ' Modules', 'url' => [ @@ -127,6 +131,7 @@ class TheTempusProject extends Bedrock { [ 'text' => 'Home', 'url' => '{ROOT_URL}home/index', + 'filter' => 'notloggedin', ], [ 'text' => 'About Me', diff --git a/composer.json b/composer.json index f98d8a2..6315553 100644 --- a/composer.json +++ b/composer.json @@ -22,9 +22,9 @@ { "components/jquery": "1.9.*", "fortawesome/font-awesome": "4.7", - "thetempusproject/bedrock": "1.1", + "thetempusproject/bedrock": "1.1.1", "thetempusproject/canary": "1.0.6", - "thetempusproject/houdini": "2.0.1", + "thetempusproject/houdini": "2.0.2", "twbs/bootstrap": "5.2.3" }, "autoload": diff --git a/composer.lock b/composer.lock index b5bb9db..4f37afa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7b53f62bdce4655bce03a69a5e6ae57a", + "content-hash": "b54d2da34f833481cff28144a669b2aa", "packages": [ { "name": "components/jquery", @@ -303,17 +303,17 @@ }, { "name": "thetempusproject/bedrock", - "version": "1.1", + "version": "1.1.1", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/bedrock", - "reference": "3b8e0994912eef8c203c8d47258754d6c78d4b19" + "reference": "bcd73d58f9d7df41b5ec0f12871ff15cfcc215ae" }, "require": { "php": ">=8.1.0", "thetempusproject/canary": "1.0.6", "thetempusproject/hermes": "1.0.3", - "thetempusproject/houdini": "2.0.1" + "thetempusproject/houdini": "2.0.2" }, "type": "library", "autoload": { @@ -344,7 +344,7 @@ "framework", "mvc" ], - "time": "2025-01-22T02:02:57+00:00" + "time": "2025-01-27T05:07:05+00:00" }, { "name": "thetempusproject/canary", @@ -434,11 +434,11 @@ }, { "name": "thetempusproject/houdini", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/houdini", - "reference": "b03fc3b7ddcdd0213f8f927a9bf1c0c68c62138f" + "reference": "fb027a4ebc327e709ad3da29a4cf112894c2b7e6" }, "require": { "php": ">=8.1.0", @@ -474,7 +474,7 @@ "thetempusproject", "tools" ], - "time": "2025-01-22T01:59:01+00:00" + "time": "2025-01-27T05:02:14+00:00" }, { "name": "twbs/bootstrap",