1
0

3 Commits

Author SHA1 Message Date
7b35015a1a react async 2026-01-16 10:24:01 +05:00
8389137f7c models write() returns record and commented useless account record update 2026-01-11 12:22:36 +05:00
8225969e37 settings and last update line 2026-01-11 01:48:55 +05:00
8 changed files with 21 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ return [
// Main menu // Main menu
'menu_title' => 'Main menu', 'menu_title' => 'Main menu',
'menu_update' => 'Last update',
// Account // Account
'account_title' => 'Account', 'account_title' => 'Account',

View File

@@ -9,7 +9,8 @@ return [
// Главное меню // Главное меню
'menu_title' => 'Главное меню', 'menu_title' => 'Главное меню',
'menu_update' => 'Последнее обновление',
// Аккаунт // Аккаунт
'account_title' => 'Аккаунт', 'account_title' => 'Аккаунт',
'account_authorized_system' => 'Доступ к системе', 'account_authorized_system' => 'Доступ к системе',

View File

@@ -228,11 +228,11 @@ final class account extends core implements record_interface
$$settings->write(account: $$record->identifier); $$settings->write(account: $$record->identifier);
// Writing the record into the database // Writing the record into the database
$$record = $$this->database->read( /* $$record = $$this->database->read(
filter: fn(record $$_record) => $$_record->identifier === $$record->identifier, filter: fn(record $$_record) => $$_record->identifier === $$record->identifier,
update: fn(record &$$_record) => $$_record = $$record, update: fn(record &$$_record) => $$_record = $$record,
amount: 1 amount: 1
)[0] ?? null; )[0] ?? null; */
// Exit (success) // Exit (success)
return $$record; return $$record;

View File

@@ -92,7 +92,7 @@ final class authorizations extends core implements record_interface
* @param bool $$system_settings * @param bool $$system_settings
* @param bool $$active Is the record active? * @param bool $$active Is the record active?
* *
* @return int|false The record identifier, if created * @return record|false The record identifier, if created
*/ */
public function write( public function write(
int $$account, int $$account,
@@ -100,7 +100,7 @@ final class authorizations extends core implements record_interface
bool $$settings = true, bool $$settings = true,
bool $$system_settings = false, bool $$system_settings = false,
bool $$active = true, bool $$active = true,
): int|false ): record|false
{ {
$$record = $$this->database->record( $$record = $$this->database->record(
$$this->database->count() + 1, $$this->database->count() + 1,
@@ -117,7 +117,7 @@ final class authorizations extends core implements record_interface
$$created = $$this->database->write($$record); $$created = $$this->database->write($$record);
// Exit (success) // Exit (success)
return $$created ? $$record->identifier : false; return $$created ? $$record : false;
} }
/** /**

View File

@@ -83,12 +83,12 @@ final class settings extends core implements record_interface
* @param int $$account The account identifier * @param int $$account The account identifier
* @param int $$active Is the record active? * @param int $$active Is the record active?
* *
* @return int|false The record identifier, if created * @return record|false The record, if created
*/ */
public function write( public function write(
int $$account, int $$account,
bool $$active = true, bool $$active = true,
): int|false { ): record|false {
$$record = $$this->database->record( $$record = $$this->database->record(
$$this->database->count() + 1, $$this->database->count() + 1,
$$account, $$account,
@@ -101,7 +101,7 @@ final class settings extends core implements record_interface
$$created = $$this->database->write($$record); $$created = $$this->database->write($$record);
// Exit (success) // Exit (success)
return $$created ? $$record->identifier : false; return $$created ? $$record : false;
} }
/** /**

View File

@@ -74,13 +74,17 @@ final class commands extends core
if ($$localization) { if ($$localization) {
// Initialized localization // Initialized localization
// Initializing the title // Initializing the message title
$$title = '📋 *' . $$localization['menu_title'] . '*'; $$title = '📋 *' . $$localization['menu_title'] . '*';
// Initializing the message last update text
exec(command: 'git log --oneline $$(git describe --tags --abbrev=0 @^ --always)..@ -1 --format="%at" | xargs -I{} date -d @{} "+%Y.%m.%d %H:%M"', output: $$git);
$$update = empty($$git[0]) ? '' : "\n\n🔏 *" . $$localization['menu_update'] . ':* ' . unmarkdown($$git[0]);
// Sending the message // Sending the message
$$context->sendMessage( $$context->sendMessage(
<<<TXT <<<TXT
$$title $$title$$update
TXT, TXT,
[ [
'reply_markup' => [ 'reply_markup' => [

View File

@@ -9,7 +9,7 @@ require ROOT . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
define('PROJECT_NAME', ''); define('PROJECT_NAME', '');
define('PROJECT_DOMAIN', ''); define('PROJECT_DOMAIN', '');
defing('LANGUAGE_DEFAULT', language::en); define('LANGUAGE_DEFAULT', language::en);
// Initializing default theme for the views templater // Initializing default theme for the views templater
define('THEME', 'default'); define('THEME', 'default');

View File

@@ -23,7 +23,7 @@
}, },
"require": { "require": {
"php": "^8.5", "php": "^8.5",
"mirzaev/minimal": "^3.7", "mirzaev/minimal": "^3.8.7",
"mirzaev/baza": "^3.3", "mirzaev/baza": "^3.3",
"mirzaev/record": "^1.0", "mirzaev/record": "^1.0",
"mirzaev/languages": "^1.0", "mirzaev/languages": "^1.0",
@@ -34,7 +34,8 @@
"twig/twig": "^3.2", "twig/twig": "^3.2",
"twig/extra-bundle": "^3.7", "twig/extra-bundle": "^3.7",
"twig/intl-extra": "^3.10", "twig/intl-extra": "^3.10",
"react/filesystem": "^0.1.2" "react/filesystem": "^0.1.2",
"react/async": "^4.3"
}, },
"suggest": { "suggest": {
"mirzaev/files": "Easy working with files", "mirzaev/files": "Easy working with files",