switch tabs to spaces, editorconfig

This commit is contained in:
Little Fluffy Clouds 2025-07-11 15:45:27 +03:00
parent 468f454cab
commit a45eaca11f
28 changed files with 5277 additions and 5347 deletions

7
.editorconfig Normal file
View File

@ -0,0 +1,7 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4

View File

@ -7,4 +7,3 @@ fi
if [ -d author ]; then if [ -d author ]; then
mv author mirzaev mv author mirzaev
fi fi

View File

@ -45,7 +45,7 @@ return [
// Repository // Repository
'repository_title' => 'Repository', 'repository_title' => 'Repository',
'repository_text' => <<<TXT 'repository_text' => <<<TXT
Svoboder is written in [PHP](https://www.php.net/) using [Zanzara](https://github.com/badfarm/zanzara) for Telegram, Deeproots is written in [PHP](https://www.php.net/) using [Zanzara](https://github.com/badfarm/zanzara) for Telegram,
my [MINIMAL](https://git.svoboda.works/mirzaev/minimal) framework for PHP and my [Baza](https://git.svoboda.works/mirzaev/baza) database my [MINIMAL](https://git.svoboda.works/mirzaev/minimal) framework for PHP and my [Baza](https://git.svoboda.works/mirzaev/baza) database
The code is under the [WTFPL](https://en.wikipedia.org/wiki/WTFPL) license The code is under the [WTFPL](https://en.wikipedia.org/wiki/WTFPL) license

View File

@ -202,15 +202,15 @@ final class account extends core
$identifier, $identifier,
$name, $name,
$language->name, $language->name,
ACCOUNT_ACCESS_SYSTEM, 1, // ACCOUNT_ACCESS_SYSTEM
ACCOUNT_ACCESS_GAME_PLAY, 1, // ACCOUNT_ACCESS_GAME_PLAY
ACCOUNT_ACCESS_RATING_DISPLAY, 1, // ACCOUNT_ACCESS_RATING_DISPLAY
ACCOUNT_ACCESS_BALANCE_DEPOSIT, 1, // ACCOUNT_ACCESS_BALANCE_DEPOSIT
ACCOUNT_ACCESS_BALANCE_WITHDRAW, 1, // ACCOUNT_ACCESS_BALANCE_WITHDRAW
ACCOUNT_ACCESS_SETTINGS, 1, // ACCOUNT_ACCESS_SETTINGS
ACCOUNT_ACCESS_SYSTEM_ACCOUNTS, 0, // ACCOUNT_ACCESS_SYSTEM_ACCOUNTS
ACCOUNT_ACCESS_SYSTEM_QUESTIONS, 0, // ACCOUNT_ACCESS_SYSTEM_QUESTIONS
ACCOUNT_ACCESS_SYSTEM_SETTINGS, 0, // ACCOUNT_ACCESS_SYSTEM_SETTINGS
svoboda::timestamp(), svoboda::timestamp(),
svoboda::timestamp() svoboda::timestamp()
); );

View File

@ -41,4 +41,3 @@ class core extends model
{ {
} }
} }

View File

@ -59,7 +59,7 @@ final class question extends core
$this->database = new database() $this->database = new database()
->encoding(encoding::ascii) ->encoding(encoding::ascii)
->columns( ->columns(
new column('identifier', type::long_long_unsigned), new column('identifier', type::integer_unsigned),
new column('active', type::char), new column('active', type::char),
new column('updated', type::integer_unsigned), new column('updated', type::integer_unsigned),
new column('created', type::integer_unsigned) new column('created', type::integer_unsigned)

View File

@ -412,79 +412,6 @@ final class middlewares extends core
} }
} }
/**
* Join (middleware)
*
* Check the account for access to join to distributions
*
* @param context $context
* @param node $next
*
* @return void
*/
public static function join(context $context, node $next): void
{
// Is the process stopped?
if ($context->get('stop')) return;
// Initializing the account
$account = $context->get('account');
if ($account instanceof record) {
// Initialized the account
// Initializing localization
$localization = $context->get('localization');
if ($localization) {
// Initialized localization
if ($account->authorized_joins) {
// Authorized the account to joint to distributions
// Continuation of the process
$next($context);
} else {
// Not authorized the account to joint to distributions
// Sending the message
$context->sendMessage('⛔ *' . $localization['not_authorized_joins'] . '*')
->then(function (message $message) use ($context) {
// Sended the message
// Ending the conversation process
$context->endConversation();
});
// Stopping the process
$context->set('stop', true);
}
} else {
// Not initialized localization
// Sending the message
$context->sendMessage('⚠️ *Failed to initialize localization*')
->then(function (message $message) use ($context) {
// Sended the message
// Ending the conversation process
$context->endConversation();
});
}
} else {
// Not initialized the account
// Sending the message
$context->sendMessage('⚠️ *Failed to initialize the account*')
->then(function (message $message) use ($context) {
// Sended the message
// Ending the conversation process
$context->endConversation();
});
}
}
/** /**
* Settings (middleware) * Settings (middleware)
* *

View File

@ -78,7 +78,7 @@ $robot->onCommand('repository', [commands::class, 'repository']);
/* $robot->onCommand('projects', [commands::class, 'projects']); */ /* $robot->onCommand('projects', [commands::class, 'projects']); */
$robot->onCommand('author', [commands::class, 'author']); $robot->onCommand('author', [commands::class, 'author']);
$robot->onCommand('society', [commands::class, 'society']); $robot->onCommand('society', [commands::class, 'society']);
/* $robot->onCommand('system_settings', [commands::class, 'system_settings'])->middleware([middlewares::class, 'system_settings']); */ // $robot->onCommand('system_settings', [commands::class, 'system_settings'])->middleware([middlewares::class, 'system']);
// Initializing the robot settings language buttons handlers // Initializing the robot settings language buttons handlers
foreach (language::cases() as $language) { foreach (language::cases() as $language) {

View File

@ -208,4 +208,3 @@ final class templater extends controller implements array_access
return isset($this->variables[$name]); return isset($this->variables[$name]);
} }
} }

View File

@ -2,7 +2,7 @@
<html lang="ru"> <html lang="ru">
<head> <head>
{% use '/themes/default/head.html' with title as head_title, meta as head_meta, css as head_css %} {% use '/themes/default/head.html' with title as head_title, meta as head_meta, css as head_css %}
{% block title %} {% block title %}
@ -16,16 +16,15 @@
{{ block('head_css') }} {{ block('head_css') }}
{% block css %} {% block css %}
{% endblock %} {% endblock %}
</head> </head>
<body> <body>
{% block body %} {% block body %}
{% endblock %} {% endblock %}
{% include '/themes/default/js.html' %} {% include '/themes/default/js.html' %}
{% block js %} {% block js %}
{% endblock %} {% endblock %}
</body> </body>
</html> </html>