diff --git a/app/resources/config/config.example.json b/app/resources/config/config.example.json deleted file mode 100755 index f8dcbc2..0000000 --- a/app/resources/config/config.example.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "main": { - "name": { - "type": "text", - "pretty": "Site Name", - "default": "TTP Example", - "value": "TTP Example" - }, - "loginLimit": { - "type": "text", - "pretty": "Maximum Login Attempts per hour", - "default": 5, - "value": 5 - }, - "logo": { - "type": "file", - "pretty": "Site Logo (Used mostly in emails)", - "default": "images/logo.png", - "value": "images/logo.png" - }, - "template": { - "type": "text", - "pretty": "Default Site Template", - "default": "default", - "value": "default" - }, - "tokenEnabled": { - "type": "radio", - "pretty": "Enable CSRF Token for all forms.", - "default": true, - "value": true - } - }, - "uploads": { - "files": { - "type": "radio", - "pretty": "Enable File Uploads", - "default": true, - "value": true - }, - "images": { - "type": "radio", - "pretty": "Enable Image Uploads", - "default": true, - "value": true - }, - "maxFileSize": { - "type": "text", - "pretty": "Maximum File Size", - "default": 5000000, - "value": 5000000 - }, - "maxImageSize": { - "type": "text", - "pretty": "Maximum Image Size", - "default": 500000, - "value": 500000 - } - }, - "database": { - "dbHost": { - "type": "text", - "pretty": "Database Host (IE: http://localhost:3306)", - "default": "127.0.0.1", - "protected": true, - "value": "127.0.0.1" - }, - "dbUsername": { - "type": "text", - "pretty": "Database Username", - "default": "root", - "protected": true, - "value": "root" - }, - "dbPrefix": { - "type": "text", - "pretty": "Database table Prefix", - "default": "TTP_", - "protected": true, - "value": "TTP_" - }, - "dbPassword": { - "type": "text", - "pretty": "Database Password", - "default": "", - "protected": true, - "value": "" - }, - "dbName": { - "type": "text", - "pretty": "Database Name", - "default": "ttp-example", - "protected": true, - "value": "ttp-example" - }, - "dbEnabled": { - "type": "radio", - "pretty": "Database Enabled", - "default": true, - "protected": true, - "value": true - }, - "dbMaxQuery": { - "type": "text", - "pretty": "Maximum results per query", - "default": 100, - "protected": true, - "value": 100 - } - }, - "group": { - "defaultGroup": { - "type": "customSelect", - "pretty": "The Default Group for new registrations.", - "default": 5, - "value": 5 - } - }, - "logging": { - "admin": { - "type": "radio", - "pretty": "Enable Admin Action Logging.", - "default": true, - "value": true - }, - "errors": { - "type": "radio", - "pretty": "Enable Error Logging", - "default": true, - "value": true - }, - "logins": { - "type": "radio", - "pretty": "Enable Login Logging", - "default": true, - "value": true - } - }, - "bugReports": { - "enabled": { - "type": "radio", - "pretty": "Enable Bug reporting.", - "default": true, - "value": true - }, - "sendEmail": { - "type": "radio", - "pretty": "Email the user after submiting.", - "default": true, - "value": true - }, - "emailTemplate": { - "type": "text", - "pretty": "Email Template", - "default": "BugReportEmail", - "value": "BugReportEmail" - } - }, - "feedback": { - "enabled": { - "type": "radio", - "pretty": "Enable User Feedback.", - "default": true, - "value": true - }, - "sendEmail": { - "type": "radio", - "pretty": "Email the user after submiting.", - "default": false, - "value": false - }, - "emailTemplate": { - "type": "text", - "pretty": "Email Template", - "default": "feedbackEmail", - "value": "feedbackEmail" - } - } -} \ No newline at end of file diff --git a/app/resources/config/install.example.json b/app/resources/config/install.example.json deleted file mode 100755 index 8f1b143..0000000 --- a/app/resources/config/install.example.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "installHash": "014c857a650bcb0e4b08b14e1924287c", - "installStep": "complete", - "modules": { - "Group": { - "name": "Group", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/models/", - "installTable": "Success", - "installPermissions": "Success", - "installConfigs": "Success", - "installResources": "Success", - "installPreferences": "Not Required", - "installedResources": ["1", "2", "3", "4", "5", "6"] - }, - "Log": { - "name": "Log", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/models/", - "installTable": "Success", - "installPermissions": "Not Required", - "installConfigs": "Success", - "installResources": "Not Required", - "installPreferences": "Not Required" - }, - "Message": { - "name": "Message", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/models/", - "installTable": "Success", - "installPermissions": "Success", - "installConfigs": "Not Required", - "installResources": "Not Required", - "installPreferences": "Not Required" - }, - "Routes": { - "name": "Routes", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/models/", - "installTable": "Success", - "installPermissions": "Success", - "installConfigs": "Not Required", - "installResources": "Success", - "installPreferences": "Not Required", - "installedResources": ["1", "2", "3", "4", "5"] - }, - "Sessions": { - "name": "Sessions", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/models/", - "installTable": "Success", - "installPermissions": "Not Required", - "installConfigs": "Not Required", - "installResources": "Not Required", - "installPreferences": "Not Required" - }, - "User": { - "name": "User", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/models/", - "installTable": "Success", - "installPermissions": "Success", - "installConfigs": "Not Required", - "installResources": "Not Required", - "installPreferences": "Success" - }, - "Blog": { - "name": "Blog", - "enabled": true, - "enabled_txt": "yes", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/plugins/", - "installTable": "Success", - "installPermissions": "Not Required", - "installConfigs": "Not Required", - "installResources": "Success", - "installPreferences": "Not Required", - "installedResources": ["1"] - }, - "Bugreport": { - "name": "Bugreport", - "enabled": true, - "enabled_txt": "yes", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/plugins/", - "installTable": "Success", - "installPermissions": "Success", - "installConfigs": "Success", - "installResources": "Not Required", - "installPreferences": "Not Required" - }, - "Comments": { - "name": "Comments", - "enabled": true, - "enabled_txt": "yes", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/plugins/", - "installTable": "Success", - "installPermissions": "Not Required", - "installConfigs": "Not Required", - "installResources": "Not Required", - "installPreferences": "Not Required" - }, - "Feedback": { - "name": "Feedback", - "enabled": true, - "enabled_txt": "yes", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/plugins/", - "installTable": "Success", - "installPermissions": "Success", - "installConfigs": "Success", - "installResources": "Not Required", - "installPreferences": "Not Required" - }, - "Subscribe": { - "name": "Subscribe", - "enabled": true, - "enabled_txt": "yes", - "installDate": 1670000000, - "lastUpdate": 1670000000, - "installStatus": "Installed", - "installedVersion": "3.0", - "folder": "/var/www/app/plugins/", - "installTable": "Success", - "installPermissions": "Not Required", - "installConfigs": "Not Required", - "installResources": "Not Required", - "installPreferences": "Not Required" - } - } -} diff --git a/app/resources/config/permissions.example.json b/app/resources/config/permissions.example.json deleted file mode 100755 index 319f727..0000000 --- a/app/resources/config/permissions.example.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "adminAccess": { - "pretty": "Access Administrator Areas", - "default": false - }, - "modAccess": { - "pretty": "Access Moderator Areas", - "default": false - }, - "memberAccess": { - "pretty": "Access Member Areas", - "default": false - }, - "sendMessages": { - "pretty": "Send messages to other users", - "default": false - }, - "addRoute": { - "pretty": "Add Custom Routes", - "default": false - }, - "uploadImages": { - "pretty": "Upload images (such as avatars)", - "default": false - }, - "bugReport": { - "pretty": "Can Submit Bug Reports", - "default": false - }, - "feedback": { - "pretty": "Can Submit Feedback", - "default": false - } -} \ No newline at end of file diff --git a/app/resources/config/prefrences.example.json b/app/resources/config/prefrences.example.json deleted file mode 100755 index 2b10ade..0000000 --- a/app/resources/config/prefrences.example.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "gender": { - "pretty": "Gender", - "type": "select", - "default": "unspecified", - "options": ["male", "female", "other", "unspecified"], - "avatar": "/var/www/apache/images/defaultAvatar.png" - }, - "email": { - "pretty": "IDK what this is for", - "type": "checkbox", - "default": "true", - "avatar": "/var/www/apache/images/defaultAvatar.png", - "options": null - }, - "newsletter": { - "pretty": "Receive our Newsletter?", - "type": "checkbox", - "default": "true", - "avatar": "/var/www/apache/images/defaultAvatar.png", - "options": null - }, - "avatar": { - "pretty": "Avatar", - "type": "file", - "default": "images/defaultAvatar.png", - "avatar": "/var/www/apache/images/defaultAvatar.png", - "options": null - }, - "timezone": { - "pretty": "Timezone", - "type": "timezone", - "default": "America/New_York", - "avatar": "/var/www/apache/images/defaultAvatar.png", - "options": null - }, - "dateFormat": { - "pretty": "Date Format", - "type": "select", - "default": "F j, Y", - "options": { - "1-8-1991": "n-j-Y", - "8-1-1991": "j-n-Y", - "01-08-1991": "m-d-Y", - "08-01-1991": "d-m-Y", - "January 8, 1991": "F-j-Y", - "8 January, 1991": "j-F-Y", - "January 08, 1991": "F-d-Y", - "08 January, 1991": "d-F-Y", - "Jan 8, 1991": "M-j-Y", - "8 Jan 1991": "j-M-Y", - "Jan 08, 1991": "M-d-Y", - "08 Jan 1991": "d-M-Y" - }, - "avatar": "/var/www/apache/images/defaultAvatar.png" - }, - "timeFormat": { - "pretty": "Time Format", - "type": "select", - "default": "g:i:s A", - "options": { - "3:33:33 AM": "g:i:s A", - "03:33:33 AM": "h:i:s A", - "3:33:33 am": "g:i:s a", - "03:33:33 am": "h:i:s a", - "3:33:33 (military)": "G:i:s", - "03:33:33 (military)": "H:i:s" - }, - "avatar": "/var/www/apache/images/defaultAvatar.png" - }, - "pageLimit": { - "pretty": "Items Displayed Per Page", - "type": "select", - "default": "10", - "options": ["10", "15", "20", "25", "50"], - "avatar": "/var/www/apache/images/defaultAvatar.png" - } -} diff --git a/app/resources/controllers/example.php b/app/resources/controllers/example.php deleted file mode 100755 index a990612..0000000 --- a/app/resources/controllers/example.php +++ /dev/null @@ -1,54 +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\Template; -use TheTempusProject\Houdini\Classes\Views; -use TheTempusProject\Canary\Bin\Canary as Debug; - -// The new controller must extend the default controller class or some functionality will be lost. -class Example extends Controller { - /** - * A constructor does not have to be defined. - * If a constructor is used, it must call the parent constructor first. - */ - public function __construct() { - parent::__construct(); - Template::noFollow(); - Template::noIndex(); - Template::setTemplate( 'example' ); - } - - /** - * A destructor does not have to be defined. - * If a destructor is used, it must call the parent destructor last. - */ - public function __destruct() { - Debug::log( 'Something to log before the app ends execution.' ); - parent::__destruct(); - } - - public function index() { - self::$title = 'Example Controller'; - Issues::add( 'error', [ 'This is an error with multiple parts.' => [ 'Error 1', 'Error 2' ] ] ); - Issues::add( 'error', 'This is a single error.' ); - Issues::add( 'success', [ 'This is a success with multiple parts.' => [ 'Success 1', 'Success 2' ] ] ); - Issues::add( 'success', 'This is a single success.' ); - Issues::add( 'notice', 'This is a single notice.' ); - Issues::add( 'info', 'This is a single info.' ); - Components::set( 'simple', Views::simpleView( 'simple' ) ); - Components::set( 'complex', Views::simpleView( 'complex' ) ); - Views::view( 'example' ); - $example = Views::simpleView( 'example' ); - } -} diff --git a/app/resources/nginx-main.conf b/app/resources/nginx-main.conf deleted file mode 100755 index db9385d..0000000 --- a/app/resources/nginx-main.conf +++ /dev/null @@ -1,44 +0,0 @@ -server { - listen 8080 default_server; - listen [::]:8080 default_server; - listen 8081 ssl default_server; - listen [::]:8081 ssl default_server; - - ssl_prefer_server_ciphers on; - - include snippets/common.conf; - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - location ~* \.(?:js|css|png|jpg|gif|ico)$ { - access_log off; - log_not_found off; - } - - location /js/ { - access_log off; - log_not_found off; - try_files $uri /index.php?error=js404&file=$uri; - } - - location /css/ { - access_log off; - log_not_found off; - try_files $uri /index.php?error=css404&file=$uri; - } - - location / { - if (!-e $request_filename){ - rewrite ^/images/(.*)$ /index.php?error=image404&url=$1 break; - rewrite ^/uploads/(.*)$ /index.php?error=upload404&url=$1 break; - } - rewrite ^/errors/(.*)$ /index.php?error=$1 break; - rewrite ^/(.+)$ /index.php?url=$1&$args; - } - - location ~ \.php$ { - fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; - include snippets/fastcgi-php.conf; - } -} \ No newline at end of file diff --git a/app/resources/nodels/example.php b/app/resources/nodels/example.php deleted file mode 100755 index eaf01a3..0000000 --- a/app/resources/nodels/example.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Models; - -use TheTempusProject\Bedrock\Classes\Model; - -class Example extends Model { - public function __construct() { - parent::__construct(); - } -} diff --git a/app/resources/plugin.php b/app/resources/plugin.php deleted file mode 100755 index 72bd393..0000000 --- a/app/resources/plugin.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Plugins; - -use ReflectionClass; -use TheTempusProject\Classes\Installer; -use TheTempusProject\Houdini\Navigation; -use TheTempusProject\Models\forealthough as forealthoughModel; -use TheTempusProject\TheTempusProject as App; - -class notrealplugin extends forealthoughModel { - public static $initialized; - public $pluginName = 'TP XXXXXXXXXX'; - public $pluginAuthor = 'JoeyK'; - public $pluginWebsite = 'https://TheTempusProject.com'; - public $modelVersion = '1.0'; - public $pluginVersion = '1.0'; - public $pluginDescription = 'A simple plugin which adds a site wide XXXXXXXXXX system.'; - public $configName = 'XXXXXXXXXX'; - public $databaseMatrix = [ - [ 'title', 'varchar', '86' ], - [ 'suggestion', 'text', '' ], - [ 'suggestedOn', 'int', '10' ], - [ 'approved', 'varchar', '5' ], - [ 'approvedOn', 'int', '10' ], - [ 'approvedBy', 'int', '11' ], - [ 'author', 'int', '11' ], - ]; - public $configMatrix = [ - 'enabled' => [ - 'type' => 'radio', - 'pretty' => 'Enable XXXXXXXXXX.', - 'default' => true, - ], - ]; - public $permissionMatrix = [ - 'XXXXXXXXXX' => [ - 'pretty' => 'Can create XXXXXXXXXX', - 'default' => false, - ], - ]; - public $admin_links = [ - [ - 'text' => ' Suggestions', - 'url' => '{ROOT_URL}admin/suggestions', - ], - ]; - public $main_links = [ - [ - 'text' => 'Suggestions', - 'url' => '{ROOT_URL}suggestions/index', - ], - ]; - public $resourceMatrix = [ - [ - 'title' => 'Welcome', - 'content' => '
This is just a simple message to say thank you for installing The Tempus Project. If you have any questions you can find everything through our website here.
', - 'author' => 1, - 'created{time}' => 0, - 'edited{time}' => 0, - 'draft' => 0, - ], - ]; - public $contact_footer_links = [ - [ - 'text' => 'Bug Report', - 'url' => '{ROOT_URL}bugreport', - ], - ]; - public function __construct() { - $reflect = new ReflectionClass( $this ); - if ( true === self::$initialized || !Installer::pluginEnabled( $reflect->getShortName() ) ) { - return; - } - foreach ( $this->contact_footer_links as $key => $link ) { - Navigation::addLink( App::CONTACT_FOOTER_MENU_NAME, $link ); - } - foreach ( $this->info_footer_links as $key => $link ) { - Navigation::addLink( App::INFO_MENU_NAME, $link ); - } - foreach ( $this->main_links as $key => $link ) { - Navigation::addLink( App::MAIN_MENU_NAME, $link ); - } - foreach ( $this->admin_links as $key => $link ) { - Navigation::addLink( App::ADMIN_MENU_NAME, $link ); - } - self::$initialized = true; - } -} diff --git a/app/resources/templates/example.tpl b/app/resources/templates/example.tpl deleted file mode 100755 index 6cbab20..0000000 --- a/app/resources/templates/example.tpl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - -This is a more complex component that includes another component...
-{simple} -...right in the middle!
\ No newline at end of file diff --git a/app/resources/views/example.html b/app/resources/views/example.html deleted file mode 100755 index e546b1e..0000000 --- a/app/resources/views/example.html +++ /dev/null @@ -1,141 +0,0 @@ - -It is comprised entirely of free form HTML
-If you are feeling extra bold you can use the templating engine to set variables to be replaced at runtime such as {variable} or even {variable2}, or maybe even just look through some data:
-{loop} -{value1} is the first value.The Tempus-Project template-processor works with the backend to render html for the end user. This process has several steps and components that can get pretty complex. For the moment let's just review a few that can be used to generate web pages.
- -Views are the most basic interaction between the front-end and back-end. Inside of a controler, you can call a view in two ways:
-You can think of components as a sort of front-end variable that can be filled in by the back-end before being send to the end-user. You can include components in all template parsing with a simple command:
- -Adding this to a controler will give access to that component's value in the rendering engine. For example: - - -In some cases, you may want to hide or show text on a page conditionally. For example, you may have administrator controls on a commonly used page. Obviously you would like to hide those controls from regular users; even if you have safeguards to prevent them from performing any restricted actions.
-This is where filters come in. They do exactly that, conditionally hide or show part of a page based on back-end logic. The admin example is so common, its already built in. If a user has the isAdmin permission on thier group, they will be able to see anything within the "ADMIN" tag:
-- Filters::add('member', '#{MEMBER}(.*?){/MEMBER}#is', (self::$isMember ? '$1' : ''), true); - Filters::add('mod', '#{MOD}(.*?){/MOD}#is', (self::$isMod ? '$1' : ''), true); - Filters::add('admin', '#{ADMIN}(.*?){/ADMIN}#is', (self::$isAdmin ? '$1' : ''), true); -- - - - - - - - '#\[b\](.*?)\[/b\]#is' => '$1', - '#\[p\](.*?)\[/p\]#is' => '
$1
', - '#\[i\](.*?)\[/i\]#is' => '$1', - '#\[u\](.*?)\[/u\]#is' => '$1', - '#\[s\](.*?)\[/s\]#is' => '$1
',
- '#\[color=(.*?)\](.*?)\[/color\]#is' => "$2",
- '#\[img\](.*?)\[/img\]#is' => "$2", - '#\(c\)#is' => '✔', - '#\(x\)#is' => '✖', - '#\(!\)#is' => '❕', - '#\(\?\)#is' => '❔', - '#\[list\](.*?)\[/list\]#is' => '
One of the pre-existing filters happens to be Issues. In the controller for this file, you should see a block that includes several examples of Issues. These issues are automatically added as individual components and hidden with the issues filter.
-
- Issues::add( 'error', [ 'This is an error with multiple parts.' => [ 'Error 1', 'Error 2' ] ] ); - Issues::add( 'error', 'This is a single error.' ); - Issues::add( 'success', [ 'This is a success with multiple parts.' => [ 'Success 1', 'Success 2' ] ] ); - Issues::add( 'success', 'This is a single success.' ); - Issues::add( 'notice', 'This is a single notice.' ); - Issues::add( 'info', 'This is a single info.' ); - Filters::add('issues', '#{ISSUES}(.*?){/ISSUES}#is', (Issues::hasIssues() ? '$1' : ''), true); - Components::set( 'NOTICE', $test ); - Components::set( 'SUCCESS', $test ); - Components::set( 'ERROR', $test ); - Components::set( 'INFO', $test ); -- - - - - - - - - - - - - - - -