2024-01-16 20:55:27 +01:00
|
|
|
<?php
|
2024-04-28 22:37:23 +02:00
|
|
|
/**
|
|
|
|
* Loads and returns the configuration settings for the router.
|
|
|
|
*
|
|
|
|
* This configuration includes various paths, default settings, security levels, SEO settings,
|
|
|
|
* and other parameters essential for the operation of the router and the website's page management.
|
|
|
|
* The configuration array is structured to provide easy access to paths, protocols, permissions,
|
|
|
|
* and other critical settings that define how the router handles requests and serves content.
|
|
|
|
*
|
|
|
|
* @return array Returns an associative array containing all router configuration settings, such as:
|
|
|
|
* - 'inlining': Boolean value determining if CSS/JS should be inlined.
|
|
|
|
* - 'domain': The primary domain name of the website.
|
|
|
|
* - 'tld': Top-level domain for the website.
|
|
|
|
* - 'default_page': Default page to load if no specific page is requested.
|
|
|
|
* - 'default_site': Default site to load if no specific site is requested.
|
|
|
|
* - 'template_dir': Directory path where templates are stored.
|
|
|
|
* - 'endpoint_dir': Directory path for endpoint scripts.
|
|
|
|
* - 'page_dir': Directory path where site pages are stored.
|
|
|
|
* - 'protocol': Protocol to be used (e.g., 'https://').
|
|
|
|
* - 'site_prefix': Prefix for the site title.
|
|
|
|
* - 'permissions': Associative array of user permissions by role.
|
|
|
|
* - 'page': Default settings for pages including secret status and permissions.
|
|
|
|
* - 'newsarticle': Default permissions for news articles.
|
|
|
|
* - 'seo': Search engine optimization settings like author, description, and keywords.
|
|
|
|
*/
|
2024-04-27 11:48:58 +02:00
|
|
|
function loadRouterConfig(): array
|
2024-01-31 22:05:23 +01:00
|
|
|
{
|
2024-01-16 20:55:27 +01:00
|
|
|
|
2024-02-06 16:24:57 +01:00
|
|
|
return [
|
|
|
|
'inlining' => false,
|
|
|
|
'domain' => 'adlerka',
|
2024-11-18 19:59:19 +01:00
|
|
|
'tld' => 'space',
|
2024-02-06 16:24:57 +01:00
|
|
|
'default_page' => 'index',
|
|
|
|
'default_site' => 'home',
|
|
|
|
'template_dir' => 'templates/',
|
|
|
|
'endpoint_dir' => 'endpoints/',
|
|
|
|
'page_dir' => 'pages/',
|
|
|
|
'protocol' => 'https://',
|
2024-02-24 09:23:09 +01:00
|
|
|
'site_prefix' => 'Adlerka',
|
2024-02-06 16:24:57 +01:00
|
|
|
'permissions' => [
|
|
|
|
'logged_out' => 1,
|
|
|
|
'logged_in_default' => 2,
|
|
|
|
'verified' => 3,
|
|
|
|
'trustworthy' => 4,
|
|
|
|
'moderator' => 5,
|
|
|
|
'user_admin' => 254,
|
|
|
|
'admin' => 255,
|
|
|
|
],
|
|
|
|
'page' => [
|
|
|
|
'default_secret' => 1,
|
|
|
|
'default_permissions' => 255,
|
|
|
|
|
2024-02-15 10:09:01 +01:00
|
|
|
],
|
2024-02-24 09:01:13 +01:00
|
|
|
'newsarticle' => [
|
|
|
|
'default_permissions' => 255,
|
|
|
|
],
|
2024-05-01 17:23:57 +02:00
|
|
|
'meme' => [
|
|
|
|
'per_page' => 10
|
|
|
|
],
|
2024-02-15 10:09:01 +01:00
|
|
|
'seo' => [
|
2024-11-18 19:59:19 +01:00
|
|
|
'author' => 'Tím Adlerka space',
|
|
|
|
'description' => 'Toto je oficiálna stránka pre Adlerácky vesmírny program, kde môžete nájsť plno zaujímavostí o ňom.',
|
|
|
|
'keywords' => 'adlerka, alderka, studenti, vesmir, space, project, projekt, web, dev, webdev, web dev, skola, zabava',
|
2024-02-15 10:09:01 +01:00
|
|
|
'generator' => 'TurboRoute',
|
|
|
|
'robots' => 'follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large'
|
2024-02-06 16:24:57 +01:00
|
|
|
]
|
|
|
|
];
|
2024-01-16 20:55:27 +01:00
|
|
|
}
|