From 9b474dee890ca89b27dc49b04bc0c867dd96d27c Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko <8821877+andpavlenko@users.noreply.github.com> Date: Sat, 9 Apr 2022 11:02:17 +0300 Subject: [PATCH] Bump to Twig 3 (#1264) * Bump to Twig 3 and update templates * Update composer.lock * Fix test Box\Mod\System\ServiceTest::testrenderStringTemplate Co-authored-by: andpavlenko --- src/bb-di.php | 46 +- src/bb-library/Box/Event.php | 300 +++++---- src/bb-library/Box/EventDispatcher.php | 249 ++++---- src/bb-library/Box/EventManager.php | 39 +- src/bb-library/Box/TwigExtensions.php | 179 ++++-- .../html_admin/mod_client_settings.phtml | 106 ++-- .../html_client/mod_client_balance.phtml | 46 +- .../html_client/mod_client_profile.phtml | 105 ++-- .../html_admin/mod_cookieconsent_index.phtml | 35 +- .../Cron/html_admin/mod_cron_settings.phtml | 39 +- .../html_admin/mod_currency_manage.phtml | 36 +- .../html_admin/mod_currency_settings.phtml | 99 +-- .../html_admin/mod_custompages_index.phtml | 47 +- .../html_admin/mod_custompages_page.phtml | 42 +- .../html_client/mod_custompages_content.phtml | 7 +- .../html_client/mod_dashboard_index.phtml | 121 ++-- .../Email/html_admin/mod_email_details.phtml | 30 +- .../Email/html_admin/mod_email_history.phtml | 85 ++- .../Email/html_admin/mod_email_settings.phtml | 114 ++-- .../Email/html_admin/mod_email_template.phtml | 80 +-- .../Email/html_client/mod_email_email.phtml | 52 +- .../Email/html_client/mod_email_index.phtml | 25 +- .../Embed/html_client/mod_embed_contact.phtml | 44 +- .../html_client/mod_embed_domainchecker.phtml | 35 +- .../html_client/mod_embed_loginform.phtml | 22 +- .../html_admin/mod_example_index.phtml | 19 +- .../html_admin/mod_example_settings.phtml | 34 +- .../html_client/mod_example_index.phtml | 27 +- .../html_admin/mod_formbuilder_field.phtml | 76 ++- .../html_admin/mod_formbuilder_manage.phtml | 35 +- .../html_admin/mod_formbuilder_preview.phtml | 11 +- .../html_admin/mod_formbuilder_settings.phtml | 227 +++---- .../html_client/mod_formbuilder_build.phtml | 16 +- .../Forum/html_admin/mod_forum_forum.phtml | 23 +- .../Forum/html_admin/mod_forum_index.phtml | 104 ++- .../Forum/html_admin/mod_forum_profile.phtml | 51 +- .../Forum/html_admin/mod_forum_settings.phtml | 34 +- .../Forum/html_admin/mod_forum_topic.phtml | 68 +- .../Forum/html_client/mod_forum_forum.phtml | 41 +- .../Forum/html_client/mod_forum_index.phtml | 63 +- .../html_client/mod_forum_members_list.phtml | 37 +- .../Forum/html_client/mod_forum_rss.phtml | 14 +- .../Forum/html_client/mod_forum_topic.phtml | 78 +-- .../html_client/mod_index_dashboard.phtml | 277 ++++---- src/bb-modules/Invoice/Service.php | 6 +- .../html_admin/mod_invoice_settings.phtml | 52 +- .../html_client/mod_invoice_banklink.phtml | 22 +- .../html_client/mod_invoice_index.phtml | 166 ++--- .../html_client/mod_invoice_invoice.phtml | 178 +++--- .../html_client/mod_invoice_print.phtml | 59 +- .../html_client/mod_invoice_thankyou.phtml | 25 +- .../mod_invoice_payment_reminder.phtml | 10 +- .../Kb/html_admin/mod_kb_article.phtml | 35 +- .../Kb/html_admin/mod_kb_category.phtml | 20 +- .../Kb/html_admin/mod_kb_index.phtml | 52 +- .../Kb/html_client/mod_kb_article.phtml | 36 +- .../Kb/html_client/mod_kb_category.phtml | 16 +- .../Kb/html_client/mod_kb_index.phtml | 23 +- .../html_admin/mod_massmailer_index.phtml | 46 +- .../html_admin/mod_massmailer_message.phtml | 57 +- .../News/html_admin/mod_news_index.phtml | 51 +- .../News/html_admin/mod_news_post.phtml | 42 +- .../News/html_client/mod_news_index.phtml | 21 +- .../News/html_client/mod_news_post.phtml | 31 +- .../html_admin/mod_notification_index.phtml | 26 +- .../Order/html_admin/mod_order_settings.phtml | 112 ++-- .../Order/html_client/mod_order_index.phtml | 13 +- .../Order/html_client/mod_order_list.phtml | 36 +- .../Order/html_client/mod_order_manage.phtml | 346 +++++----- .../Order/html_client/mod_order_product.phtml | 21 +- .../html_admin/mod_orderbutton_settings.phtml | 164 ++--- .../html_client/mod_orderbutton_addons.phtml | 6 +- .../mod_orderbutton_checkout.phtml | 60 +- .../mod_orderbutton_choose_product.phtml | 8 +- .../html_client/mod_orderbutton_client.phtml | 57 +- .../mod_orderbutton_currency.phtml | 3 +- .../html_client/mod_orderbutton_index.phtml | 48 +- ...od_orderbutton_product_configuration.phtml | 8 +- .../Page/html_client/mod_page_about-us.phtml | 13 +- .../Page/html_client/mod_page_login.phtml | 36 +- .../html_client/mod_page_password-reset.phtml | 21 +- .../html_client/mod_page_privacy-policy.phtml | 12 +- .../Page/html_client/mod_page_signup.phtml | 49 +- .../Page/html_client/mod_page_tos.phtml | 11 +- .../html_admin/mod_paidsupport_settings.phtml | 39 +- .../Queue/html_admin/mod_queue_settings.phtml | 34 +- .../html_admin/mod_redirect_settings.phtml | 41 +- .../Seo/html_admin/mod_seo_settings.phtml | 65 +- .../mod_servicecentovacast_config.phtml | 20 +- .../mod_servicecentovacast_manage.phtml | 96 +-- .../mod_servicecentovacast_order.phtml | 6 +- .../mod_servicecentovacast_settings.phtml | 62 +- .../mod_servicecentovacast_manage.phtml | 34 +- .../html_admin/mod_servicecustom_order.phtml | 4 +- .../html_admin/mod_servicedomain_order.phtml | 24 +- .../mod_servicedomain_manage.phtml | 117 ++-- .../mod_servicedomain_order_form.phtml | 55 +- .../mod_servicedownloadable_manage.phtml | 6 +- .../mod_servicedownloadable_activated.phtml | 2 +- .../html_admin/mod_servicehosting_order.phtml | 12 +- .../mod_servicehosting_manage.phtml | 69 +- .../mod_servicehosting_order_form.phtml | 31 +- .../mod_servicelicense_manage.phtml | 37 +- .../mod_servicesolusvm_config.phtml | 60 +- .../mod_servicesolusvm_import_clients.phtml | 29 +- .../mod_servicesolusvm_import_servers.phtml | 36 +- .../mod_servicesolusvm_manage.phtml | 139 ++-- .../html_admin/mod_servicesolusvm_order.phtml | 4 +- .../mod_servicesolusvm_settings.phtml | 74 +-- .../mod_servicesolusvm_listing.phtml | 74 +-- .../mod_servicesolusvm_manage.phtml | 137 ++-- .../mod_servicesolusvm_order_form.phtml | 21 +- .../html_admin/mod_spamchecker_settings.phtml | 80 +-- .../Staff/html_admin/mod_staff_settings.phtml | 94 +-- .../html_email/mod_staff_client_order.phtml | 3 +- .../mod_support_canned_selector.phtml | 7 +- .../html_admin/mod_support_helpdesk.phtml | 35 +- .../html_admin/mod_support_settings.phtml | 90 ++- .../html_client/mod_support_contact_us.phtml | 26 +- .../mod_support_contact_us_conversation.phtml | 63 +- .../html_client/mod_support_ticket.phtml | 102 +-- .../html_client/mod_support_tickets.phtml | 65 +- .../html_admin/mod_system_settings.phtml | 126 ++-- .../html_client/mod_system_maintenance.phtml | 13 +- .../Theme/html_admin/mod_theme_preset.phtml | 77 +-- .../Theme/html_admin/mod_theme_settings.phtml | 118 ++-- .../html_admin/mod_wysiwyg_settings.phtml | 55 +- src/bb-themes/admin_default/html/404.phtml | 13 +- .../admin_default/html/layout_default.phtml | 39 +- .../admin_default/html/layout_login.phtml | 12 +- .../admin_default/html/macro_functions.phtml | 22 +- .../html/mod_activity_index.phtml | 14 +- .../admin_default/html/mod_client_group.phtml | 17 +- .../admin_default/html/mod_client_index.phtml | 106 ++-- .../html/mod_client_login_history.phtml | 19 +- .../html/mod_client_manage.phtml | 198 +++--- .../html/mod_extension_index.phtml | 64 +- .../html/mod_extension_languages.phtml | 38 +- .../html/mod_index_dashboard.phtml | 139 ++-- .../html/mod_invoice_gateway.phtml | 43 +- .../html/mod_invoice_gateways.phtml | 44 +- .../html/mod_invoice_index.phtml | 141 +++-- .../html/mod_invoice_invoice.phtml | 200 +++--- .../html/mod_invoice_subscription.phtml | 42 +- .../html/mod_invoice_subscriptions.phtml | 119 ++-- .../admin_default/html/mod_invoice_tax.phtml | 57 +- .../html/mod_invoice_taxupdate.phtml | 16 +- .../html/mod_invoice_transaction.phtml | 111 ++-- .../html/mod_invoice_transactions.phtml | 68 +- .../admin_default/html/mod_order_index.phtml | 143 +++-- .../admin_default/html/mod_order_manage.phtml | 236 ++++--- .../admin_default/html/mod_order_new.phtml | 46 +- .../html/mod_product_addon_manage.phtml | 20 +- .../html/mod_product_addons.phtml | 43 +- .../html/mod_product_category.phtml | 38 +- .../html/mod_product_index.phtml | 139 ++-- .../html/mod_product_manage.phtml | 140 +++-- .../html/mod_product_promo.phtml | 42 +- .../html/mod_product_promos.phtml | 79 ++- .../html/mod_servicecustom_config.phtml | 20 +- .../html/mod_servicecustom_manage.phtml | 6 +- .../html/mod_servicedomain_config.phtml | 8 +- .../html/mod_servicedomain_index.phtml | 115 ++-- .../html/mod_servicedomain_manage.phtml | 122 ++-- .../html/mod_servicedomain_registrar.phtml | 17 +- .../html/mod_servicedomain_tld.phtml | 24 +- .../html/mod_servicedownloadable_config.phtml | 27 +- .../html/mod_servicedownloadable_manage.phtml | 17 +- .../html/mod_servicehosting_config.phtml | 31 +- .../html/mod_servicehosting_hp.phtml | 53 +- .../html/mod_servicehosting_index.phtml | 106 ++-- .../html/mod_servicehosting_manage.phtml | 84 +-- .../html/mod_servicehosting_server.phtml | 61 +- .../html/mod_servicelicense_config.phtml | 35 +- .../html/mod_servicelicense_manage.phtml | 36 +- .../html/mod_servicemembership_config.phtml | 6 +- .../html/mod_servicemembership_manage.phtml | 4 +- .../admin_default/html/mod_staff_group.phtml | 26 +- .../admin_default/html/mod_staff_index.phtml | 45 +- .../admin_default/html/mod_staff_login.phtml | 31 +- .../html/mod_staff_login_history.phtml | 75 ++- .../admin_default/html/mod_staff_manage.phtml | 94 ++- .../html/mod_staff_profile.phtml | 54 +- .../html/mod_support_canned_category.phtml | 19 +- .../html/mod_support_canned_response.phtml | 33 +- .../html/mod_support_canned_responses.phtml | 44 +- .../html/mod_support_public_ticket.phtml | 60 +- .../html/mod_support_public_tickets.phtml | 35 +- .../html/mod_support_ticket.phtml | 127 ++-- .../html/mod_support_tickets.phtml | 159 ++--- .../admin_default/html/mod_system_index.phtml | 26 +- .../html/partial_batch_delete.phtml | 12 +- .../html/partial_extensions.phtml | 15 +- .../admin_default/html/partial_footer.phtml | 10 +- .../admin_default/html/partial_menu.phtml | 2 +- .../admin_default/html/partial_menu_top.phtml | 16 +- .../html/partial_pagination.phtml | 2 +- .../admin_default/html/partial_pricing.phtml | 94 ++- src/bb-themes/bootstrap/html/404.phtml | 29 +- .../bootstrap/html/layout_default.phtml | 66 +- .../bootstrap/html/mod_cart_index.phtml | 591 +++++++++--------- .../bootstrap/html/mod_client_balance.phtml | 35 +- .../bootstrap/html/mod_client_profile.phtml | 336 +++++----- .../bootstrap/html/mod_email_email.phtml | 75 +-- .../bootstrap/html/mod_email_index.phtml | 75 ++- .../bootstrap/html/mod_forum_forum.phtml | 47 +- .../bootstrap/html/mod_forum_index.phtml | 146 +++-- .../bootstrap/html/mod_forum_topic.phtml | 16 +- .../bootstrap/html/mod_index_dashboard.phtml | 74 +-- .../bootstrap/html/mod_invoice_banklink.phtml | 6 +- .../bootstrap/html/mod_invoice_index.phtml | 108 ++-- .../bootstrap/html/mod_invoice_invoice.phtml | 268 ++++---- .../bootstrap/html/mod_invoice_print.phtml | 62 +- .../bootstrap/html/mod_invoice_thankyou.phtml | 14 +- .../bootstrap/html/mod_kb_article.phtml | 48 +- .../bootstrap/html/mod_kb_category.phtml | 10 +- .../bootstrap/html/mod_kb_index.phtml | 34 +- .../bootstrap/html/mod_news_index.phtml | 37 +- .../bootstrap/html/mod_news_post.phtml | 73 +-- .../bootstrap/html/mod_order_index.phtml | 59 +- .../bootstrap/html/mod_order_list.phtml | 10 +- .../bootstrap/html/mod_order_manage.phtml | 123 ++-- .../bootstrap/html/mod_order_product.phtml | 114 ++-- .../bootstrap/html/mod_page_about-us.phtml | 8 +- .../bootstrap/html/mod_page_login.phtml | 56 +- .../html/mod_page_privacy-policy.phtml | 8 +- .../html/mod_page_reset-password.phtml | 67 +- .../bootstrap/html/mod_page_tos.phtml | 8 +- .../html/mod_servicedomain_manage.phtml | 92 +-- .../html/mod_servicedomain_order.phtml | 89 +-- .../html/mod_servicedownloadable_manage.phtml | 2 +- .../html/mod_servicehosting_order.phtml | 93 +-- .../html/mod_servicelicense_manage.phtml | 28 +- .../html/mod_support_contact_us.phtml | 18 +- .../mod_support_contact_us_conversation.phtml | 134 ++-- .../bootstrap/html/mod_support_ticket.phtml | 135 ++-- .../bootstrap/html/mod_support_tickets.phtml | 49 +- .../bootstrap/html/partial_addons.phtml | 4 +- .../bootstrap/html/partial_currency.phtml | 2 +- .../bootstrap/html/partial_menu.phtml | 55 +- .../bootstrap/html/partial_pricing.phtml | 107 ++-- .../bootstrap/html/partial_steps.phtml | 24 +- src/bb-themes/boxbilling/html/404.phtml | 6 +- .../boxbilling/html/layout_default.phtml | 42 +- .../boxbilling/html/macro_functions.phtml | 5 +- .../boxbilling/html/mod_cart_index.phtml | 106 ++-- .../boxbilling/html/mod_client_balance.phtml | 34 +- .../boxbilling/html/mod_client_profile.phtml | 95 ++- .../boxbilling/html/mod_dashboard_index.phtml | 104 ++- .../boxbilling/html/mod_email_email.phtml | 29 +- .../boxbilling/html/mod_email_index.phtml | 16 +- .../html/mod_formbuilder_build.phtml | 18 +- .../boxbilling/html/mod_forum_forum.phtml | 30 +- .../boxbilling/html/mod_forum_index.phtml | 36 +- .../boxbilling/html/mod_forum_topic.phtml | 37 +- .../boxbilling/html/mod_index_dashboard.phtml | 58 +- .../html/mod_invoice_banklink.phtml | 18 +- .../boxbilling/html/mod_invoice_index.phtml | 42 +- .../boxbilling/html/mod_invoice_invoice.phtml | 110 ++-- .../html/mod_invoice_thankyou.phtml | 19 +- .../boxbilling/html/mod_kb_article.phtml | 24 +- .../boxbilling/html/mod_kb_category.phtml | 13 +- .../boxbilling/html/mod_kb_index.phtml | 15 +- .../boxbilling/html/mod_news_index.phtml | 21 +- .../boxbilling/html/mod_news_post.phtml | 15 +- .../boxbilling/html/mod_order_index.phtml | 159 ++--- .../boxbilling/html/mod_order_list.phtml | 68 +- .../boxbilling/html/mod_order_manage.phtml | 114 ++-- .../boxbilling/html/mod_order_product.phtml | 96 +-- .../boxbilling/html/mod_page_about-us.phtml | 9 +- .../boxbilling/html/mod_page_login.phtml | 83 ++- .../html/mod_page_privacy-policy.phtml | 9 +- .../html/mod_page_reset-password.phtml | 20 +- .../boxbilling/html/mod_page_tos.phtml | 9 +- .../html/mod_servicedomain_manage.phtml | 140 ++--- .../html/mod_servicedomain_order.phtml | 86 +-- .../html/mod_servicedownloadable_manage.phtml | 5 +- .../html/mod_servicehosting_manage.phtml | 95 +-- .../html/mod_servicehosting_order.phtml | 74 ++- .../html/mod_servicelicense_manage.phtml | 31 +- .../html/mod_servicesolusvm_order.phtml | 30 +- .../html/mod_support_contact_us.phtml | 63 +- .../mod_support_contact_us_conversation.phtml | 63 +- .../boxbilling/html/mod_support_ticket.phtml | 61 +- .../boxbilling/html/mod_support_tickets.phtml | 93 +-- .../boxbilling/html/partial_addons.phtml | 6 +- .../boxbilling/html/partial_currency.phtml | 5 +- .../boxbilling/html/partial_menu.phtml | 28 +- .../boxbilling/html/partial_message.phtml | 4 +- .../boxbilling/html/partial_pagination.phtml | 2 +- .../html/partial_pending_messages.phtml | 2 +- .../boxbilling/html/partial_pricing.phtml | 55 +- .../boxbilling/html/partial_steps.phtml | 8 +- src/bb-themes/huraga/html/404.phtml | 4 +- .../huraga/html/layout_default.phtml | 36 +- src/bb-themes/huraga/html/partial_menu.phtml | 20 +- .../huraga/html/partial_pricing.phtml | 20 +- src/composer.json | 9 +- src/composer.lock | 367 +++++++---- tests/bb-modules/System/ServiceTest.php | 19 +- tests/includes/FakeTemplateWrapper.php | 46 +- 301 files changed, 9158 insertions(+), 8806 deletions(-) diff --git a/src/bb-di.php b/src/bb-di.php index 06bc541cf..9e666263e 100644 --- a/src/bb-di.php +++ b/src/bb-di.php @@ -1,4 +1,5 @@ setDi($di); $log_to_db = isset($di['config']['log_to_db']) && $di['config']['log_to_db']; + if ($log_to_db) { $activity_service = $di['mod_service']('activity'); $writer2 = new Box_LogDb($activity_service); + if ($di['auth']->isAdminLoggedIn()) { $admin = $di['loggedin_admin']; $log->setEventItem('admin_id', $admin->id); @@ -30,6 +38,7 @@ $di['logger'] = function () use ($di) { $client = $di['loggedin_client']; $log->setEventItem('client_id', $client->id); } + $log->addWriter($writer2); } else { $logFile = $di['config']['path_logs']; @@ -39,12 +48,14 @@ $di['logger'] = function () use ($di) { return $log; }; + $di['crypt'] = function () use ($di) { $crypt = new Box_Crypt(); $crypt->setDi($di); return $crypt; }; + $di['pdo'] = function () use ($di) { $c = $di['config']['db']; @@ -74,6 +85,7 @@ $di['pdo'] = function () use ($di) { return $pdo; }; + $di['db'] = function () use ($di) { require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'rb.php'; R::setup($di['pdo']); @@ -93,12 +105,14 @@ $di['db'] = function () use ($di) { return $db; }; + $di['pager'] = function () use ($di) { $service = new Box_Pagination(); $service->setDi($di); return $service; }; + $di['url'] = function () use ($di) { $url = new Box_Url(); $url->setDi($di); @@ -106,43 +120,53 @@ $di['url'] = function () use ($di) { return $url; }; + $di['mod'] = $di->protect(function ($name) use ($di) { $mod = new Box_Mod($name); $mod->setDi($di); return $mod; }); + $di['mod_service'] = $di->protect(function ($mod, $sub = '') use ($di) { return $di['mod']($mod)->getService($sub); }); + $di['mod_config'] = $di->protect(function ($name) use ($di) { return $di['mod']($name)->getConfig(); }); + $di['events_manager'] = function () use ($di) { $service = new Box_EventManager(); $service->setDi($di); return $service; }; + $di['session'] = function () use ($di) { $handler = new PdoSessionHandler($di['pdo']); return new Box_Session($handler); }; + $di['cookie'] = function () use ($di) { $service = new Box_Cookie(); $service->setDi($di); return $service; }; + $di['request'] = function () use ($di) { $service = new Box_Request(); $service->setDi($di); return $service; }; + $di['cache'] = function () { return new FileCache(); }; + $di['auth'] = function () use ($di) { return new Box_Authorization($di); }; + $di['twig'] = $di->factory(function () use ($di) { $config = $di['config']; $options = $config['twig']; @@ -156,10 +180,12 @@ $di['twig'] = $di->factory(function () use ($di) { // $twig->addExtension(new Twig\Extension\OptimizerExtension()); $twig->addExtension(new \Twig\Extension\StringLoaderExtension()); $twig->addExtension(new Twig\Extension\DebugExtension()); - $twig->addExtension(new Twig\Extensions\I18nExtension()); + $twig->addExtension(new Symfony\Bridge\Twig\Extension\TranslationExtension()); $twig->addExtension($box_extensions); - $twig->getExtension(Twig\Extension\CoreExtension::class)->setDateFormat($config['locale_date_format']); - $twig->getExtension(Twig\Extension\CoreExtension::class)->setTimezone($config['timezone']); + $twig->getExtension(Twig\Extension\CoreExtension::class) + ->setDateFormat($config['locale_date_format']); + $twig->getExtension(Twig\Extension\CoreExtension::class) + ->setTimezone($config['timezone']); // add globals if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 'XMLHttpRequest' == $_SERVER['HTTP_X_REQUESTED_WITH']) { @@ -176,6 +202,7 @@ $di['is_client_logged'] = function () use ($di) { if (!$di['auth']->isClientLoggedIn()) { $api_str = '/api/'; $url = $di['request']->getQuery('_url'); + if (0 === strncasecmp($url, $api_str, strlen($api_str))) { // Throw Exception if api request throw new Exception('Client is not logged in'); @@ -212,6 +239,7 @@ $di['loggedin_client'] = function () use ($di) { return $di['db']->getExistingModelById('Client', $client_id); }; + $di['loggedin_admin'] = function () use ($di) { if ('cli' == php_sapi_name() || 'cgi' == substr(php_sapi_name(), 0, 3)) { return $di['mod_service']('staff')->getCronAdmin(); @@ -244,11 +272,13 @@ $di['api'] = $di->protect(function ($role) use ($di) { default: throw new Exception('Unrecognized Handler type: '.$role); } + $api = new Api_Handler($identity); $api->setDi($di); return $api; }); + $di['api_guest'] = function () use ($di) { return $di['api']('guest'); }; $di['api_client'] = function () use ($di) { return $di['api']('client'); }; $di['api_admin'] = function () use ($di) { return $di['api']('admin'); }; @@ -267,6 +297,7 @@ $di['validator'] = function () use ($di) { return $validator; }; + $di['guzzle_client'] = function () use ($di) { return new GuzzleHttp\Client([ 'headers' => [ @@ -276,27 +307,32 @@ $di['guzzle_client'] = function () use ($di) { 'timeout' => $di['config']['guzzle']['timeout'], ]); }; + $di['mail'] = function () { return new Box_Mail(); }; + $di['extension'] = function () use ($di) { $extension = new \Box_Extension(); $extension->setDi($di); return $extension; }; + $di['updater'] = function () use ($di) { $updater = new \Box_Update(); $updater->setDi($di); return $updater; }; + $di['curl'] = function ($url) use ($di) { $curl = new \Box_Curl($url); $curl->setDi($di); return $curl; }; + $di['zip_archive'] = function () {return new ZipArchive(); }; $di['server_package'] = function () {return new Server_Package(); }; @@ -370,11 +406,14 @@ $di['pdf'] = function () use ($di) { $di['geoip'] = function () { return new \GeoIp2\Database\Reader(BB_PATH_LIBRARY.'/GeoLite2-Country.mmdb'); }; $di['password'] = function () { return new Box_Password(); }; + $di['translate'] = $di->protect(function ($textDomain = '') use ($di) { $tr = new Box_Translate(); + if (!empty($textDomain)) { $tr->setDomain($textDomain); } + $cookieBBlang = $di['cookie']->get('BBLANG'); $locale = !empty($cookieBBlang) ? $cookieBBlang : $di['config']['locale']; @@ -384,6 +423,7 @@ $di['translate'] = $di->protect(function ($textDomain = '') use ($di) { return $tr; }); + $di['array_get'] = $di->protect(function (array $array, $key, $default = null) { return array_key_exists($key, $array) ? $array[$key] : $default; }); diff --git a/src/bb-library/Box/Event.php b/src/bb-library/Box/Event.php index 6d9636c06..971197cf1 100644 --- a/src/bb-library/Box/Event.php +++ b/src/bb-library/Box/Event.php @@ -1,6 +1,7 @@ subject = $subject; - $this->name = $name; - - $this->parameters = $parameters; - - $this->api_admin = $api_admin; - $this->api_guest = $api_guest; - } + /** + * Constructs a new sfEvent. + * + * @param mixed $subject The subject + * @param string $name The event name + * @param array $parameters An array of parameters + */ + public function __construct($subject, $name, $parameters = [], $api_admin = null, $api_guest = null) + { + $this->subject = $subject; + $this->name = $name; + + $this->parameters = $parameters; + + $this->api_admin = $api_admin; + $this->api_guest = $api_guest; + } /** * @param Box_Di|null $di @@ -56,133 +55,132 @@ class Box_Event implements ArrayAccess, \Box\InjectionAwareInterface return $this->di; } - /** - * Returns the subject. - * - * @return mixed The subject - */ - public function getSubject() - { - return $this->subject; - } - - public function getApiAdmin() - { - return $this->api_admin; - } - - public function getApiGuest() - { - return $this->api_guest; - } - - /** - * Returns the event name. - * - * @return string The event name - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the return value for this event. - * - * @param mixed $value The return value - */ - public function setReturnValue($value) - { - $this->value = $value; - } - - /** - * Returns the return value. - * - * @return mixed The return value - */ - public function getReturnValue() - { - return $this->value; - } - - /** - * Sets the processed flag. - * - * @param Boolean $processed The processed flag value - */ - public function setProcessed($processed) - { - $this->processed = (boolean) $processed; - } - - /** - * Returns whether the event has been processed by a listener or not. - * - * @return Boolean true if the event has been processed, false otherwise - */ - public function isProcessed() - { - return $this->processed; - } - - /** - * Returns the event parameters. - * - * @return array The event parameters - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * Returns true if the parameter exists (implements the ArrayAccess interface). - * - * @param string $name The parameter name - * - * @return Boolean true if the parameter exists, false otherwise - */ - public function offsetExists($name) - { - return array_key_exists($name, $this->parameters); - } - - /** - * Returns a parameter value (implements the ArrayAccess interface). - * - * @param string $name The parameter name - * - * @return mixed The parameter value - */ - public function offsetGet($name) - { - if (!array_key_exists($name, $this->parameters)) + /** + * Returns the subject. + * + * @return mixed The subject + */ + public function getSubject() { - throw new InvalidArgumentException(sprintf('The event "%s" has no "%s" parameter.', $this->name, $name)); + return $this->subject; } - return $this->parameters[$name]; - } + public function getApiAdmin() + { + return $this->api_admin; + } - /** - * Sets a parameter (implements the ArrayAccess interface). - * - * @param string $name The parameter name - * @param mixed $value The parameter value - */ - public function offsetSet($name, $value) - { - $this->parameters[$name] = $value; - } + public function getApiGuest() + { + return $this->api_guest; + } - /** - * Removes a parameter (implements the ArrayAccess interface). - * - * @param string $name The parameter name - */ - public function offsetUnset($name) - { - unset($this->parameters[$name]); - } + /** + * Returns the event name. + * + * @return string The event name + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the return value for this event. + * + * @param mixed $value The return value + */ + public function setReturnValue($value) + { + $this->value = $value; + } + + /** + * Returns the return value. + * + * @return mixed The return value + */ + public function getReturnValue() + { + return $this->value; + } + + /** + * Sets the processed flag. + * + * @param bool $processed The processed flag value + */ + public function setProcessed($processed) + { + $this->processed = (bool) $processed; + } + + /** + * Returns whether the event has been processed by a listener or not. + * + * @return bool true if the event has been processed, false otherwise + */ + public function isProcessed() + { + return $this->processed; + } + + /** + * Returns the event parameters. + * + * @return array The event parameters + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Returns true if the parameter exists (implements the ArrayAccess interface). + * + * @param string $name The parameter name + * + * @return bool true if the parameter exists, false otherwise + */ + public function offsetExists(mixed $name): bool + { + return array_key_exists($name, $this->parameters); + } + + /** + * Returns a parameter value (implements the ArrayAccess interface). + * + * @param string $name The parameter name + * + * @return mixed The parameter value + */ + public function offsetGet(mixed $name): mixed + { + if (!array_key_exists($name, $this->parameters)) { + throw new InvalidArgumentException(sprintf('The event "%s" has no "%s" parameter.', $this->name, $name)); + } + + return $this->parameters[$name]; + } + + /** + * Sets a parameter (implements the ArrayAccess interface). + * + * @param string $name The parameter name + * @param mixed $value The parameter value + */ + public function offsetSet(mixed $name, $value): void + { + $this->parameters[$name] = $value; + } + + /** + * Removes a parameter (implements the ArrayAccess interface). + * + * @param string $name The parameter name + */ + public function offsetUnset(mixed $name): void + { + unset($this->parameters[$name]); + } } diff --git a/src/bb-library/Box/EventDispatcher.php b/src/bb-library/Box/EventDispatcher.php index 0c69e678a..d0b63d4f9 100644 --- a/src/bb-library/Box/EventDispatcher.php +++ b/src/bb-library/Box/EventDispatcher.php @@ -1,6 +1,7 @@ listeners[$name])) + /** + * Connects a listener to a given event name. + * + * @param string $name An event name + * @param mixed $listener A PHP callable + */ + public function connect($name, $listener) { - $this->listeners[$name] = array(); + if (!isset($this->listeners[$name])) { + $this->listeners[$name] = []; + } + + $this->listeners[$name][] = $listener; } - $this->listeners[$name][] = $listener; - } - - /** - * Disconnects a listener for a given event name. - * - * @param string $name An event name - * @param mixed $listener A PHP callable - * - * @return false|null false if listener does not exist, null otherwise - */ - public function disconnect($name, $listener) - { - if (!isset($this->listeners[$name])) + /** + * Disconnects a listener for a given event name. + * + * @param string $name An event name + * @param mixed $listener A PHP callable + * + * @return false|null false if listener does not exist, null otherwise + */ + public function disconnect($name, $listener) { - return false; + if (!isset($this->listeners[$name])) { + return false; + } + + foreach ($this->listeners[$name] as $i => $callable) { + if ($listener === $callable) { + unset($this->listeners[$name][$i]); + } + } } - foreach ($this->listeners[$name] as $i => $callable) + /** + * Disconnects all listeners for a given event name. + * + * @param string $name An event name + * + * @return false|null false if listener does not exist, null otherwise + */ + public function disconnectAll($name) { - if ($listener === $callable) - { - unset($this->listeners[$name][$i]); - } - } - } + if (!isset($this->listeners[$name])) { + return false; + } - /** - * Disconnects all listeners for a given event name. - * - * @param string $name An event name - * - * @return false|null false if listener does not exist, null otherwise - */ - public function disconnectAll($name) - { - if (!isset($this->listeners[$name])) - { - return false; + foreach ($this->listeners[$name] as $i => $callable) { + unset($this->listeners[$name][$i]); + } } - foreach ($this->listeners[$name] as $i => $callable) + /** + * Notifies all listeners of a given event. + * + * @param Box_Event $event A Box_Event instance + * + * @return Box_Event The Box_Event instance + */ + public function notify(Box_Event $event) { - unset($this->listeners[$name][$i]); - } - } + foreach ($this->getListeners($event->getName()) as $listener) { + call_user_func($listener, $event); + } - /** - * Notifies all listeners of a given event. - * - * @param Box_Event $event A Box_Event instance - * - * @return Box_Event The Box_Event instance - */ - public function notify(Box_Event $event) - { - foreach ($this->getListeners($event->getName()) as $listener) - { - call_user_func($listener, $event); + return $event; } - return $event; - } - - /** - * Notifies all listeners of a given event until one returns a non null value. - * - * @param Box_Event $event A Box_Event instance - * - * @return Box_Event The Box_Event instance - */ - public function notifyUntil(Box_Event $event) - { - foreach ($this->getListeners($event->getName()) as $listener) + /** + * Notifies all listeners of a given event until one returns a non null value. + * + * @param Box_Event $event A Box_Event instance + * + * @return Box_Event The Box_Event instance + */ + public function notifyUntil(Box_Event $event) { - if (call_user_func($listener, $event)) - { - $event->setProcessed(true); - break; - } + foreach ($this->getListeners($event->getName()) as $listener) { + if (call_user_func($listener, $event)) { + $event->setProcessed(true); + break; + } + } + + return $event; } - return $event; - } - - /** - * Filters a value by calling all listeners of a given event. - * - * @param Box_Event $event A Box_Event instance - * @param mixed $value The value to be filtered - * - * @return Box_Event The Box_Event instance - */ - public function filter(Box_Event $event, $value) - { - foreach ($this->getListeners($event->getName()) as $listener) + /** + * Filters a value by calling all listeners of a given event. + * + * @param Box_Event $event A Box_Event instance + * @param mixed $value The value to be filtered + * + * @return Box_Event The Box_Event instance + */ + public function filter(Box_Event $event, $value) { - $value = call_user_func_array($listener, array($event, $value)); + foreach ($this->getListeners($event->getName()) as $listener) { + $value = call_user_func_array($listener, [$event, $value]); + } + + $event->setReturnValue($value); + + return $event; } - $event->setReturnValue($value); - - return $event; - } - - /** - * Returns true if the given event name has some listeners. - * - * @param string $name The event name - * - * @return Boolean true if some listeners are connected, false otherwise - */ - public function hasListeners($name) - { - if (!isset($this->listeners[$name])) + /** + * Returns true if the given event name has some listeners. + * + * @param string $name The event name + * + * @return bool true if some listeners are connected, false otherwise + */ + public function hasListeners($name) { - $this->listeners[$name] = array(); + if (!isset($this->listeners[$name])) { + $this->listeners[$name] = []; + } + + return (bool) count($this->listeners[$name]); } - return (boolean) count($this->listeners[$name]); - } - - /** - * Returns all listeners associated with a given event name. - * - * @param string $name The event name - * - * @return array An array of listeners - */ - public function getListeners($name) - { - if (!isset($this->listeners[$name])) + /** + * Returns all listeners associated with a given event name. + * + * @param string $name The event name + * + * @return array An array of listeners + */ + public function getListeners($name) { - return array(); - } + if (!isset($this->listeners[$name])) { + return []; + } - return $this->listeners[$name]; - } -} \ No newline at end of file + return $this->listeners[$name]; + } +} diff --git a/src/bb-library/Box/EventManager.php b/src/bb-library/Box/EventManager.php index be700c9f9..b2bd856ef 100644 --- a/src/bb-library/Box/EventManager.php +++ b/src/bb-library/Box/EventManager.php @@ -1,6 +1,7 @@ di['logger']->debug($event. ': '. var_export($params, 1)); + if (BB_DEBUG) { + $this->di['logger']->debug($event.': '.var_export($params, 1)); } $e = new Box_Event($subject, $event, $params); @@ -55,38 +55,39 @@ class Box_EventManager implements \Box\InjectionAwareInterface return $e->getReturnValue(); } - /** * @param Box_EventDispatcher $disp - * @param string $event + * @param string $event */ private function _connectDatabaseHooks(&$disp, $event) { - $sql="SELECT id, rel_id, meta_value + $sql = "SELECT id, rel_id, meta_value FROM extension_meta WHERE extension = 'mod_hook' AND rel_type = 'mod' AND meta_key = 'listener' AND meta_value = :event "; - $list = $this->di['db']->getAll($sql, array('event'=>$event)); + $list = $this->di['db']->getAll($sql, ['event' => $event]); // no need to connect listeners - if(empty($list)) { - return ; + if (empty($list)) { + return; } - foreach($list as $listener) { + foreach ($list as $listener) { $mod = $listener['rel_id']; $event = $listener['meta_value']; + try { $s = $this->di['mod_service']($mod); - if(method_exists($s, $event)) { - $disp->connect($event, array(get_class($s), $event)); + + if (method_exists($s, $event)) { + $disp->connect($event, [get_class($s), $event]); } - } catch(Exception $e) { + } catch (Exception $e) { error_log($e->getMessage()); } } } -} \ No newline at end of file +} diff --git a/src/bb-library/Box/TwigExtensions.php b/src/bb-library/Box/TwigExtensions.php index 794241b4b..04bb1880d 100644 --- a/src/bb-library/Box/TwigExtensions.php +++ b/src/bb-library/Box/TwigExtensions.php @@ -1,6 +1,7 @@ new Twig\TwigFilter('alink', array($this, 'twig_bb_admin_link_filter'), array('is_safe' => array('html'))), - 'link' => new Twig\TwigFilter('link', array($this, 'twig_bb_client_link_filter'), array('is_safe' => array('html'))), - 'gravatar' => new Twig\TwigFilter('gravatar','twig_gravatar_filter'), - 'markdown' => new Twig\TwigFilter('markdown','twig_markdown_filter', array('needs_environment' => true, 'is_safe' => array('html'))), - 'truncate' => new Twig\TwigFilter('truncate','twig_truncate_filter', array('needs_environment' => true)), - 'timeago' => new Twig\TwigFilter('timeago','twig_timeago_filter'), - 'daysleft' => new Twig\TwigFilter('daysleft','twig_daysleft_filter'), - 'size' => new Twig\TwigFilter('size', 'twig_size_filter'), - 'ipcountryname' => new Twig\TwigFilter('ipcountryname', array($this, 'twig_ipcountryname_filter')), - 'number' => new Twig\TwigFilter('number', 'twig_number_filter'), - 'period_title' => new Twig\TwigFilter('period_title', 'twig_period_title', array('needs_environment' => true, 'is_safe' => array('html'))), - 'autolink' => new Twig\TwigFilter('autolink', 'twig_autolink_filter'), - 'bbmd' => new Twig\TwigFilter('bbmd', 'twig_bbmd_filter', array('needs_environment' => true, 'is_safe' => array('html'))), + return [ + /** + * 'trans' filter rewrite same filter from Symfony\Bridge\Twig\Extension\TranslationExtension + * for compatible with outdated php-gettext library. + * + * TODO: Use Symfony\Component\Translation\Loader\MoFileLoader and remove php-gettext hardcoded library. + */ + 'trans' => new TwigFilter('trans', 'gettext'), + 'alink' => new TwigFilter('alink', [$this, 'twig_bb_admin_link_filter'], ['is_safe' => ['html']]), + 'link' => new TwigFilter('link', [$this, 'twig_bb_client_link_filter'], ['is_safe' => ['html']]), + 'gravatar' => new TwigFilter('gravatar', 'twig_gravatar_filter'), + 'markdown' => new TwigFilter('markdown', 'twig_markdown_filter', ['needs_environment' => true, 'is_safe' => ['html']]), + 'truncate' => new TwigFilter('truncate', 'twig_truncate_filter', ['needs_environment' => true]), + 'timeago' => new TwigFilter('timeago', 'twig_timeago_filter'), + 'daysleft' => new TwigFilter('daysleft', 'twig_daysleft_filter'), + 'size' => new TwigFilter('size', 'twig_size_filter'), + 'ipcountryname' => new TwigFilter('ipcountryname', [$this, 'twig_ipcountryname_filter']), + 'number' => new TwigFilter('number', 'twig_number_filter'), + 'period_title' => new TwigFilter('period_title', 'twig_period_title', ['needs_environment' => true, 'is_safe' => ['html']]), + 'autolink' => new TwigFilter('autolink', 'twig_autolink_filter'), + 'bbmd' => new TwigFilter('bbmd', 'twig_bbmd_filter', ['needs_environment' => true, 'is_safe' => ['html']]), - 'bb_date' => new Twig\TwigFilter('bb_date', array($this, 'twig_bb_date')), - 'bb_datetime' => new Twig\TwigFilter('bb_datetime', array($this, 'twig_bb_datetime')), + 'bb_date' => new TwigFilter('bb_date', [$this, 'twig_bb_date']), + 'bb_datetime' => new TwigFilter('bb_datetime', [$this, 'twig_bb_datetime']), - 'img_tag' => new Twig\TwigFilter('img_tag', 'twig_img_tag', array('needs_environment' => false, 'is_safe' => array('html'))), - 'script_tag' => new Twig\TwigFilter('script_tag', 'twig_script_tag', array('needs_environment' => false, 'is_safe' => array('html'))), - 'stylesheet_tag' => new Twig\TwigFilter('stylesheet_tag', 'twig_stylesheet_tag', array('needs_environment' => false, 'is_safe' => array('html'))), + 'img_tag' => new TwigFilter('img_tag', 'twig_img_tag', ['needs_environment' => false, 'is_safe' => ['html']]), + 'script_tag' => new TwigFilter('script_tag', 'twig_script_tag', ['needs_environment' => false, 'is_safe' => ['html']]), + 'stylesheet_tag' => new TwigFilter('stylesheet_tag', 'twig_stylesheet_tag', ['needs_environment' => false, 'is_safe' => ['html']]), - 'mod_asset_url' => new Twig\TwigFilter('mod_asset_url', 'twig_mod_asset_url'), - 'asset_url' => new Twig\TwigFilter('asset_url', 'twig_asset_url', array('needs_environment' => true, 'is_safe' => array('html'))), + 'mod_asset_url' => new TwigFilter('mod_asset_url', 'twig_mod_asset_url'), + 'asset_url' => new TwigFilter('asset_url', 'twig_asset_url', ['needs_environment' => true, 'is_safe' => ['html']]), - 'money' => new Twig\TwigFilter('money', 'twig_money', array('needs_environment' => true, 'is_safe' => array('html'))), - 'money_without_currency' => new Twig\TwigFilter('money_without_currency','twig_money_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))), - 'money_convert' => new Twig\TwigFilter('money_convert', 'twig_money_convert', array('needs_environment' => true, 'is_safe' => array('html'))), - 'money_convert_without_currency' => new Twig\TwigFilter('money_convert_without_currency', array('needs_environment' => true, 'is_safe' => array('html'))), - ); + 'money' => new TwigFilter('money', 'twig_money', ['needs_environment' => true, 'is_safe' => ['html']]), + 'money_without_currency' => new TwigFilter('money_without_currency', 'twig_money_without_currency', ['needs_environment' => true, 'is_safe' => ['html']]), + 'money_convert' => new TwigFilter('money_convert', 'twig_money_convert', ['needs_environment' => true, 'is_safe' => ['html']]), + 'money_convert_without_currency' => new TwigFilter('money_convert_without_currency', ['needs_environment' => true, 'is_safe' => ['html']]), + ]; } /** @@ -84,6 +95,7 @@ class Box_TwigExtensions extends Twig\Extension\AbstractExtension implements \Bo { $locale_date_format = $this->di['config']['locale_date_format']; $format = is_null($format) ? $locale_date_format : $format; + return strftime($format, strtotime($time)); } @@ -91,11 +103,12 @@ class Box_TwigExtensions extends Twig\Extension\AbstractExtension implements \Bo { $locale_date_format = $this->di['config']['locale_date_format']; $locale_time_format = $this->di['config']['locale_time_format']; - $format = is_null($format) ? $locale_date_format . $locale_time_format : $format; + $format = is_null($format) ? $locale_date_format.$locale_time_format : $format; + return strftime($format, strtotime($time)); } - function twig_ipcountryname_filter($value) + public function twig_ipcountryname_filter($value) { if (empty($value)) { return ''; @@ -103,84 +116,92 @@ class Box_TwigExtensions extends Twig\Extension\AbstractExtension implements \Bo try { $record = $this->di['geoip']->country($value); + return $record->country->name; } catch (Exception $e) { return ''; } } - function twig_bb_client_link_filter($link, $params = null) + public function twig_bb_client_link_filter($link, $params = null) { - if($this->di['url'] === null) { + if (null === $this->di['url']) { return null; } + return $this->di['url']->link($link, $params); } - function twig_bb_admin_link_filter($link, $params = null) + public function twig_bb_admin_link_filter($link, $params = null) { return $this->di['url']->adminLink($link, $params); } - } function twig_period_title(Twig\Environment $env, $period) { $globals = $env->getGlobals(); $api_guest = $globals['guest']; - return $api_guest->system_period_title(array('code'=>$period)); + + return $api_guest->system_period_title(['code' => $period]); } function twig_money_convert(Twig\Environment $env, $price, $currency = null) { $globals = $env->getGlobals(); $api_guest = $globals['guest']; - if(is_null($currency)) { + if (is_null($currency)) { $c = $api_guest->cart_get_currency(); $currency = $c['code']; } - return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>true)); + + return $api_guest->currency_format(['price' => $price, 'code' => $currency, 'convert' => true]); } function money_convert_without_currency(Twig\Environment $env, $price, $currency = null, $without_currency = false) { $globals = $env->getGlobals(); $api_guest = $globals['guest']; - if(is_null($currency)) { + if (is_null($currency)) { $c = $api_guest->cart_get_currency(); $currency = $c['code']; } - return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>true, 'without_currency'=>true)); + + return $api_guest->currency_format(['price' => $price, 'code' => $currency, 'convert' => true, 'without_currency' => true]); } function twig_money(Twig\Environment $env, $price, $currency = null) { $globals = $env->getGlobals(); $api_guest = $globals['guest']; - return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>false)); + + return $api_guest->currency_format(['price' => $price, 'code' => $currency, 'convert' => false]); } function twig_money_without_currency(Twig\Environment $env, $price, $currency = null) { $globals = $env->getGlobals(); $api_guest = $globals['guest']; - return $api_guest->currency_format(array("price" => $price, 'code'=>$currency, 'convert'=>false, 'without_currency'=>true)); + + return $api_guest->currency_format(['price' => $price, 'code' => $currency, 'convert' => false, 'without_currency' => true]); } function twig_mod_asset_url($asset, $mod) { - return BB_URL . 'bb-modules/'.ucfirst($mod).'/assets/'.$asset; + return BB_URL.'bb-modules/'.ucfirst($mod).'/assets/'.$asset; } function twig_asset_url(Twig\Environment $env, $asset) { $globals = $env->getGlobals(); - return BB_URL . 'bb-themes/'.$globals['current_theme'].'/assets/'.$asset; + + return BB_URL.'bb-themes/'.$globals['current_theme'].'/assets/'.$asset; } function twig_img_tag($path, $alt = null) { $alt = is_null($alt) ? pathinfo($path, PATHINFO_BASENAME) : $alt; + return sprintf('%s', htmlspecialchars($path), htmlspecialchars($alt), htmlspecialchars($alt)); } @@ -196,25 +217,25 @@ function twig_stylesheet_tag($path, $media = 'screen') function twig_gravatar_filter($email, $size = 20) { - return (new Box_Tools)->get_gravatar($email, $size); + return (new Box_Tools())->get_gravatar($email, $size); } function twig_autolink_filter($text) { - $pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#'; + $pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#'; - $callback = function($matches) - { - $url = array_shift($matches); - $url_parts = parse_url($url); - if(!isset($url_parts["scheme"])) { - $url = 'http://' . $url; - } + $callback = function ($matches) { + $url = array_shift($matches); + $url_parts = parse_url($url); - return sprintf('%s', $url, $url); - }; + if (!isset($url_parts['scheme'])) { + $url = 'http://'.$url; + } - return preg_replace_callback($pattern, $callback, $text); + return sprintf('%s', $url, $url); + }; + + return preg_replace_callback($pattern, $callback, $text); } function twig_number_filter($number, $decimals = 2, $dec_point = '.', $thousands_sep = '') @@ -225,24 +246,40 @@ function twig_number_filter($number, $decimals = 2, $dec_point = '.', $thousands function twig_daysleft_filter($iso8601) { $timediff = strtotime($iso8601) - time(); - return intval($timediff/86400); + + return intval($timediff / 86400); } function twig_timeago_filter($iso8601) { - $cur_tm = time(); $dif = $cur_tm-strtotime($iso8601); - $pds = array(__('second'),__('minute'),__('hour'),__('day'),__('week'),__('month'),__('year'),__('decade')); - $lngh = array(1,60,3600,86400,604800,2630880,31570560,315705600); - for($v = sizeof($lngh)-1; ($v >= 0)&&(($no = $dif/$lngh[$v])<=1); $v--); if($v < 0) $v = 0; $_tm = $cur_tm-($dif%$lngh[$v]); + $cur_tm = time(); + $dif = $cur_tm - strtotime($iso8601); + $pds = [__('second'), __('minute'), __('hour'), __('day'), __('week'), __('month'), __('year'), __('decade')]; + $lngh = [1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600]; + + for ($v = sizeof($lngh) - 1; ($v >= 0) && (($no = $dif / $lngh[$v]) <= 1); --$v) { + } + + if ($v < 0) { + $v = 0; + } + + $_tm = $cur_tm - ($dif % $lngh[$v]); + + $no = floor($no); + + if (1 != $no) { + $pds[$v] .= 's'; + } + $x = sprintf('%d %s ', $no, $pds[$v]); - $no = floor($no); if($no <> 1) $pds[$v] .='s'; $x=sprintf("%d %s ",$no,$pds[$v]); return $x; } function twig_size_filter($value) { $precision = 2; - $units = array('B', 'KB', 'MB', 'GB', 'TB'); + $units = ['B', 'KB', 'MB', 'GB', 'TB']; $bytes = max($value, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); @@ -250,27 +287,30 @@ function twig_size_filter($value) $bytes /= pow(1024, $pow); - return round($bytes, $precision) . ' ' . $units[$pow]; + return round($bytes, $precision).' '.$units[$pow]; } function twig_markdown_filter(Twig\Environment $env, $value) { - $markdownParser = new \Michelf\MarkdownExtra; + $markdownParser = new \Michelf\MarkdownExtra(); // Michelf Markdown version 1.7.0 and up $markdownParser->hard_wrap = true; $result = $markdownParser->transform(htmlspecialchars($value, ENT_NOQUOTES)); - $result = preg_replace_callback('/(?<=href=")(.*)(?=")/', function($match) { - if(!filter_var($match[0], FILTER_VALIDATE_URL)) { + $result = preg_replace_callback('/(?<=href=")(.*)(?=")/', function ($match) { + if (!filter_var($match[0], FILTER_VALIDATE_URL)) { $match[0] = '#'; } + return $match[0]; }, $result); + return $result; } function twig_truncate_filter(Twig\Environment $env, $value, $length = 30, $preserve = false, $separator = '...') { - mb_internal_encoding("UTF-8"); + mb_internal_encoding('UTF-8'); + if (mb_strlen($value) > $length) { if ($preserve) { if (false !== ($breakpoint = mb_strpos($value, ' ', $length))) { @@ -278,17 +318,18 @@ function twig_truncate_filter(Twig\Environment $env, $value, $length = 30, $pres } } - return mb_substr($value, 0, $length) . $separator; + return mb_substr($value, 0, $length).$separator; } return $value; } /** - * BoxBilling markdown + * BoxBilling markdown. */ function twig_bbmd_filter(Twig\Environment $env, $value) { $value = twig_markdown_filter($env, $value); + return $value; } diff --git a/src/bb-modules/Client/html_admin/mod_client_settings.phtml b/src/bb-modules/Client/html_admin/mod_client_settings.phtml index 49b8b7c39..6a1372f80 100644 --- a/src/bb-modules/Client/html_admin/mod_client_settings.phtml +++ b/src/bb-modules/Client/html_admin/mod_client_settings.phtml @@ -1,112 +1,108 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% block meta_title %}Client settings{% endblock %} + {% set active_menu = 'system' %} {% block breadcrumbs %} {% endblock %} {% block content %} - -{% set params = admin.extension_config_get({"ext":"mod_client"}) %} -
+ {% set params = admin.extension_config_get({"ext":"mod_client"}) %} +
-
-
- +
- - + +
- +
- - - {% trans 'After enabling this feature, all existing users will have to confirm their emails if it was not done before' %}. + + + {{ 'After enabling this feature, all existing users will have to confirm their emails if it was not done before'|trans }}.
- +
- - + +
- +
- - - - - + + + + - - - - - - - - + + + + + + + - -
- +
-
-
- {% for i in 1..10 %} - {% set field_name = 'custom_' ~ i %} - {% set custom_field = attribute(params.custom_fields, field_name) %} -
- -
- - - -
-
+
+ {% for i in 1..10 %} + {% set field_name = 'custom_' ~ i %} + {% set custom_field = attribute(params.custom_fields, field_name) %} +
+ +
+ + +
-
- {% endfor %} - -
+
+
+
+ {% endfor %} + +
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Client/html_client/mod_client_balance.phtml b/src/bb-modules/Client/html_client/mod_client_balance.phtml index 4518dc9f9..29862e37b 100644 --- a/src/bb-modules/Client/html_client/mod_client_balance.phtml +++ b/src/bb-modules/Client/html_client/mod_client_balance.phtml @@ -1,7 +1,10 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Payments history' %}{% endblock %} -{% block breadcrumb %}
  • {% trans 'Payments history' %}
  • {% endblock %} + +{% block meta_title %}{{ 'Payments history'|trans }}{% endblock %} +{% block breadcrumb %}
  • {{ 'Payments history'|trans }}
  • {% endblock %} + {% set profile = client.client_get %} {% block content %} @@ -10,73 +13,68 @@
    -

    {% trans 'Payments history'%}

    -

    {% trans 'Here you can track what you have been charged for and add more funds to your account' %}

    +

    {{ 'Payments history'|trans }}

    +

    {{ 'Here you can track what you have been charged for and add more funds to your account'|trans }}

    - - - - - + + + + + - {% set transactions = client.client_balance_get_list({"per_page":10, "page":request.page}) %} + {% set transactions = client.client_balance_get_list({ "per_page": 10, "page": request.page }) %} {% for i, tx in transactions.list %} - - - + + + {% else %} - + {% endfor %} - +
    {% trans 'Description' %}{% trans 'Date' %}{% trans 'Amount' %}
    {{ 'Description'|trans }}{{ 'Date'|trans }}{{ 'Amount'|trans }}
    {{tx.description}}{{tx.created_at|bb_date}}{{ tx.amount | money(tx.currency) }}{{ tx.description }}{{ tx.created_at|bb_date }}{{ tx.amount|money(tx.currency) }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    {% trans 'Total:' %}{{ 'Total:'|trans }} {{ profile.balance | money(profile.currency) }}
    - {% include "partial_pagination.phtml" with {'list': transactions} %} + {% include "partial_pagination.phtml" with { 'list': transactions } %}
    -
    - +
    -
    -
    -
    - {% endblock %} {% block js %} - {% endblock %} - diff --git a/src/bb-modules/Client/html_client/mod_client_profile.phtml b/src/bb-modules/Client/html_client/mod_client_profile.phtml index 8e3502712..31832ab2d 100644 --- a/src/bb-modules/Client/html_client/mod_client_profile.phtml +++ b/src/bb-modules/Client/html_client/mod_client_profile.phtml @@ -1,11 +1,10 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Profile details' %}{% endblock %} -{% block page_header %}{% trans 'User profile settings' %}{% endblock %} -{% block breadcrumb %}
  • {% trans 'Profile' %}
  • {% endblock %} +{% block meta_title %}{{ 'Profile details'|trans }}{% endblock %} +{% block page_header %}{{ 'User profile settings'|trans }}{% endblock %} +{% block breadcrumb %}
  • {{ 'Profile'|trans }}
  • {% endblock %} {% block content %} -
    @@ -18,29 +17,29 @@
    -

    {% trans 'Update details' %}

    -

    {% trans 'Keep your personal data up to date.' %}

    +

    {{ 'Update details'|trans }}

    +

    {{ 'Keep your personal data up to date.'|trans }}

    Gravatar
    -
    {% trans 'Please register with'%} {{ profile.email }} {% trans 'at ' %}Gravatar.com {% trans 'to change your profile image. Gravatar image updates may not appear immediately.' %}
    +
    {{ 'Please register with'|trans }} {{ profile.email }} {{ 'at '|trans }}Gravatar.com {{ 'to change your profile image. Gravatar image updates may not appear immediately.'|trans }}
    - +

    @@ -48,7 +47,7 @@
    - +

    @@ -56,7 +55,7 @@
    - +

    @@ -64,7 +63,7 @@
    - +

    @@ -72,7 +71,7 @@
    - +

    @@ -80,7 +79,7 @@
    - +

    @@ -88,7 +87,7 @@
    - +

    @@ -96,7 +95,7 @@
    - +

    @@ -104,7 +103,7 @@
    - +

    @@ -112,7 +111,7 @@
    - +

    @@ -120,7 +119,7 @@
    - +

    @@ -128,7 +127,7 @@
    - +

    @@ -136,10 +135,10 @@
    - +
    @@ -158,7 +157,7 @@
    - +

    @@ -166,7 +165,7 @@
    - +

    @@ -174,20 +173,20 @@
    - +
    -

    {% trans 'New password' %}

    -

    {% trans 'Please enter new password two times in order avoid mistypes' %}

    +

    {{ 'New password'|trans }}

    +

    {{ 'Please enter new password two times in order avoid mistypes'|trans }}

    - +

    @@ -195,46 +194,45 @@
    - +

    - +
    -

    {% trans 'API key' %}

    -

    {% trans 'API key allows integration with external applications. You will need this key for authentication.' %}

    +

    {{ 'API key'|trans }}

    +

    {{ 'API key allows integration with external applications. You will need this key for authentication.'|trans }}

    -

    {% trans 'Warning! Resetting the key will break existing applications using it!' %}

    +

    {{ 'Warning! Resetting the key will break existing applications using it!'|trans }}

    - +
    - +
    -

    {% trans 'Currency' %}

    -

    {% trans 'Your profile currency is defined after your first order. Once your currency is set, all your profile accounting will be managed in that currency and can not be changed.' %}

    +

    {{ 'Currency'|trans }}

    +

    {{ 'Your profile currency is defined after your first order. Once your currency is set, all your profile accounting will be managed in that currency and can not be changed.'|trans }}

    - {% if profile.currency %} -

    {% trans 'Your profile currency is' %} {{ profile.currency }}

    -

    {% trans 'Create new client profile if you want to manage your money in other currency' %}

    - {% endif %} - + {% if profile.currency %} +

    {{ 'Your profile currency is'|trans }} {{ profile.currency }}

    +

    {{ 'Create new client profile if you want to manage your money in other currency'|trans }}

    + {% endif %}
    @@ -246,15 +244,12 @@
    - {% endblock %} - {% block js %} - {% endblock %} \ No newline at end of file diff --git a/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml b/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml index 7c163c51e..c326dcdbe 100644 --- a/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml +++ b/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml @@ -1,32 +1,35 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% block meta_title %}Cookie consent settings{% endblock %} + {% set active_menu = 'extensions' %} {% block content %}
    -
    {% trans 'Edit cookie consent message text' %}
    +
    {{ 'Edit cookie consent message text'|trans }}
    -

    {% trans 'Here you can specify message which will be shown to user. It will be shown until user will click Close × button, however it will not be intrusive and will not disturb to perform any actions.' %}

    -

    {% trans 'If there is a need to change the way notification looks or is being displayed, you can do it by editing' %} src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.phtml

    +

    {{ 'Here you can specify message which will be shown to user. It will be shown until user will click Close × button, however it will not be intrusive and will not disturb to perform any actions.'|trans }}

    +

    {{ 'If there is a need to change the way notification looks or is being displayed, you can do it by editing'|trans }} src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.phtml

    {% set params = admin.extension_config_get({"ext":"mod_cookieconsent"}) %} -
    -
    -
    -
    -
    - -
    -
    +
    + +
    +
    +
    +
    - - -
    - -
    +
    +
    + + +
    + +
    {% endblock %} diff --git a/src/bb-modules/Cron/html_admin/mod_cron_settings.phtml b/src/bb-modules/Cron/html_admin/mod_cron_settings.phtml index 420de561f..14ca3f610 100644 --- a/src/bb-modules/Cron/html_admin/mod_cron_settings.phtml +++ b/src/bb-modules/Cron/html_admin/mod_cron_settings.phtml @@ -1,57 +1,59 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Cron settings' %}{% endblock %} + +{% block meta_title %}{{ 'Cron settings'|trans }}{% endblock %} + {% set active_menu = 'system' %} {% block breadcrumbs %} {% endblock %} {% block content %} -
    -
    {% trans 'Cron settings' %}
    +
    {{ 'Cron settings'|trans }}
    -

    {% trans 'Setup scheduled tasks to be executed once a day' %}

    -

    {% trans 'Scheduled tasks must be enabled immediately after installation. Cron is responsible for sending your clients reminder about payments, domain renewal notices and many more.' %}

    +

    {{ 'Setup scheduled tasks to be executed once a day'|trans }}

    +

    {{ 'Scheduled tasks must be enabled immediately after installation. Cron is responsible for sending your clients reminder about payments, domain renewal notices and many more.'|trans }}

    {% set cron = admin.cron_info %} - + - + - + - + - + @@ -59,12 +61,13 @@
    {% trans 'Timezone' %}{{ 'Timezone'|trans }} {{ "now"|date('e') }}
    {% trans 'Time on server' %}{{ 'Time on server'|trans }} {{ "now"|date('Y-m-d H:i:s') }}
    {% trans 'Last time scheduled tasks were executed' %}{{ 'Last time scheduled tasks were executed'|trans }} {% if cron.last_cron_exec %} {{ cron.last_cron_exec|date('Y-m-d H:i:s') }} - ({{cron.last_cron_exec|timeago }} ago) + ({{ cron.last_cron_exec|timeago }} ago) {% else %} - {% trans 'Scheduled tasks were never executed' %} + {{ 'Scheduled tasks were never executed'|trans }} {% endif %}
    {% trans 'Unix crontab setup:' %}{{ 'Unix crontab setup:'|trans }}
    */5 * * * * php {{ cron.cron_path}}
    {% trans 'Execute scheduled tasks from browser' %}{{ 'Execute scheduled tasks from browser'|trans }}
    {{ cron.cron_url}}
    - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Currency/html_admin/mod_currency_manage.phtml b/src/bb-modules/Currency/html_admin/mod_currency_manage.phtml index fc39c50e1..b6fbdfac6 100644 --- a/src/bb-modules/Currency/html_admin/mod_currency_manage.phtml +++ b/src/bb-modules/Currency/html_admin/mod_currency_manage.phtml @@ -1,50 +1,51 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'system' %} -{% block meta_title %}{% trans 'Currency management' %}{% endblock %} + +{% block meta_title %}{{ 'Currency management'|trans }}{% endblock %} {% block breadcrumbs %} {% endblock %} {% block content %} -
    -
    -
    {% trans 'Edit currency information' %} {{currency.code}}
    +
    {{ 'Edit currency information'|trans }} {{ currency.code }}
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    @@ -54,10 +55,9 @@
    - - + +
    - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Currency/html_admin/mod_currency_settings.phtml b/src/bb-modules/Currency/html_admin/mod_currency_settings.phtml index c3de0dcff..101e40dff 100644 --- a/src/bb-modules/Currency/html_admin/mod_currency_settings.phtml +++ b/src/bb-modules/Currency/html_admin/mod_currency_settings.phtml @@ -1,26 +1,24 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} {% set active_menu = 'system' %} -{% block meta_title %}{% trans 'Currency settings' %}{% endblock %} +{% block meta_title %}{{ 'Currency settings'|trans }}{% endblock %} {% block breadcrumbs %} {% endblock %} - {% block content %} -
    -
    @@ -28,17 +26,17 @@
    -

    {% trans 'Manage currencies' %}

    -

    {% trans 'Default currency is the one you manage all your prices in admin area. If your client in client area chooses other than default currency, prices will be recalculated according to conversion rate. You can have only one default currency. You can not add same currency once again. Changing default currency is not recommended when active orders are available. Nothing is recalculated on default currency change. Your income is calculated in default currency. Changing default currency after you have paid invoices will distort income statistics. Currency rates are taken from European Central Bank and currencylayer.' %}

    +

    {{ 'Manage currencies'|trans }}

    +

    {{ 'Default currency is the one you manage all your prices in admin area. If your client in client area chooses other than default currency, prices will be recalculated according to conversion rate. You can have only one default currency. You can not add same currency once again. Changing default currency is not recommended when active orders are available. Nothing is recalculated on default currency change. Your income is calculated in default currency. Changing default currency after you have paid invoices will distort income statistics. Currency rates are taken from European Central Bank and currencylayer.'|trans }}

    - - - - + + + + @@ -61,7 +59,7 @@ {% else %} {% endfor %} @@ -71,7 +69,7 @@ @@ -84,35 +82,35 @@
    - +
    {{ mf.selectbox('code', admin.currency_get_pairs, 'USD', 1) }}
    - +
    - +
    - +
    - +
    @@ -121,44 +119,47 @@
    -

    {% trans 'Adjust settings for currency rate updater' %}

    +

    {{ 'Adjust settings for currency rate updater'|trans }}

    BoxBilling uses data grabbed from European Central Bank for conversions from Euro to other currencies, and currencylayer for conversations from US Dollar to other currencies.
    If you choose Euro as your default currency, data from European Central Bank will be used, if you choose US Dollar, data from currencylayer will be used.
    While European Central Bank decided to keep it's API free to everyone, you won't need an autorization key to use ECB's data. However, you'll need an API key to use currencylayer.
    You can grab your API key from currencylayer's website. BoxBilling doesn't make any profits from your purchases on currencylayer.com

    BoxBilling does not take any responsibilities for data grabbed from 3rd party sources, including European Central Bank and currencylayer.

    -
    -
    - -
    - +
    +
    + +
    + +
    +
    -
    -
    -
    - -

    If you enable this, conversion rates will be automatically updated whenever the CRON job fires up.

    -
    - - -
    -
    -
    - -
    +
    + +

    If you enable this, conversion rates will be automatically updated whenever the CRON job fires up.

    +
    + + +
    +
    +
    + +
    -
      -
    • +
    • + +
    • {{ guest.currency_get.code }} =
    • -
    • +
    • + +
    • {{ mf.selectbox('to', guest.currency_get_pairs) }}
    @@ -167,11 +168,9 @@
    -
    - {% endblock %} {% block js %} @@ -179,9 +178,11 @@ function doConvert() { var price = $('input[name="amount"]').val(); var code = $('select[name="to"]').val(); - bb.post('guest/currency/format', {price:price, code: code}, function(result){ + + bb.post('guest/currency/format', { price:price, code: code }, function(result) { $('#converted_result').val(result); }); + return false; }; diff --git a/src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml b/src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml index acb1dc80e..12b92b606 100644 --- a/src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml +++ b/src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml @@ -1,14 +1,14 @@ {% import "macro_functions.phtml" as mf %} {% extends "layout_default.phtml" %} {% set active_menu = 'extensions' %} -{% block meta_title %}{% trans 'Custom Pages' %}{% endblock %} +{% block meta_title %}{{ 'Custom Pages'|trans }}{% endblock %} {% block content %} - - - + + + @@ -36,14 +36,14 @@ {% else %} - + {% endfor %} @@ -60,47 +60,42 @@
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - {% endblock %} -{% block js %} +{% block js %}{% endblock %} - - -{% endblock %} - -{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} \ No newline at end of file +{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} diff --git a/src/bb-modules/Custompages/html_admin/mod_custompages_page.phtml b/src/bb-modules/Custompages/html_admin/mod_custompages_page.phtml index 5b9a083cc..5e942d12c 100644 --- a/src/bb-modules/Custompages/html_admin/mod_custompages_page.phtml +++ b/src/bb-modules/Custompages/html_admin/mod_custompages_page.phtml @@ -1,21 +1,23 @@ {% extends "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'extensions' %} -{% block meta_title %} {% trans 'Edit Custom Page' %} {% endblock %} -{% set page = admin.custompages_get_page({page_id}|merge(request)) %} + +{% block meta_title %} {{ 'Edit Custom Page'|trans }} {% endblock %} + +{% set page = admin.custompages_get_page({ page_id }|merge(request)) %} {% block breadcrumbs %} {% endblock %} - {% block content %} -{% if page.id > 0 %} - + {% if page.id > 0 %}
    @@ -23,45 +25,45 @@
    {{ page.title}}
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    - +
    @@ -70,4 +72,4 @@ {% endif %} {% endblock %} -{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} \ No newline at end of file +{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} diff --git a/src/bb-modules/Custompages/html_client/mod_custompages_content.phtml b/src/bb-modules/Custompages/html_client/mod_custompages_content.phtml index 1d535689f..bdfb15a81 100644 --- a/src/bb-modules/Custompages/html_client/mod_custompages_content.phtml +++ b/src/bb-modules/Custompages/html_client/mod_custompages_content.phtml @@ -3,10 +3,11 @@ {% block meta_title %}{{ page.title }}{% endblock %} {% block meta_description %}{{ page.description }}{% endblock %} {% block meta_keywords %}{{ page.keywords }}{% endblock %} -{% block breadcrumb %}
  • {% trans 'Example module' %}
  • {% endblock %} +{% block breadcrumb %}
  • {{ 'Example module'|trans }}
  • {% endblock %} + {% block page_header %} {% endblock%} {% block content %} @@ -22,4 +23,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Dashboard/html_client/mod_dashboard_index.phtml b/src/bb-modules/Dashboard/html_client/mod_dashboard_index.phtml index 85170634c..9b4da67d9 100644 --- a/src/bb-modules/Dashboard/html_client/mod_dashboard_index.phtml +++ b/src/bb-modules/Dashboard/html_client/mod_dashboard_index.phtml @@ -1,13 +1,13 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Client Area' %}{% endblock %} -{% block page_header %}{% trans 'Dashboard' %}{% endblock %} +{% block meta_title %}{{ 'Client Area'|trans }}{% endblock %} +{% block page_header %}{{ 'Dashboard'|trans }}{% endblock %} {% block breadcrumbs %} {% if not settings.hide_dashboard_breadcrumb %} {% endif %} {% endblock %} @@ -26,42 +26,42 @@ {% if client %} -{% set tickets = client.support_ticket_get_list({"status":'on_hold'}) %} +{% set tickets = client.support_ticket_get_list({ "status": 'on_hold' }) %} {% if tickets.total > 0 %}
    -

    {% trans 'Tickets waiting your reply' %}

    +

    {{ 'Tickets waiting your reply'|trans }}

    {% trans 'ISO code' %}{% trans 'Title' %}{% trans 'Conversion rate' %}{% trans 'Example price' %}{{ 'ISO code'|trans }}{{ 'Title'|trans }}{{ 'Conversion rate'|trans }}{{ 'Example price'|trans }}  
    - {% trans 'The list is empty' %} + {{ 'The list is empty'|trans }}
    {% trans 'ID' %}{% trans 'Title' %}{% trans 'Slug' %}{{ 'ID'|trans }}{{ 'Title'|trans }}{{ 'Slug'|trans }}  
    {{ page.title }} {{ page.slug }} - - - + + +
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    - - - - - - + + + + + + {% for i, ticket in tickets.list %} - - - - - - + + + + + + {% else %} - + {% endfor %} @@ -79,20 +79,20 @@
    -

    {% trans 'Profile' %}

    +

    {{ 'Profile'|trans }}

    -
    {% trans 'ID' %}
    +
    {{ 'ID'|trans }}
    #{{ profile.id }}
    -
    {% trans 'Email' %}
    +
    {{ 'Email'|trans }}
    {{ profile.email }}
    -
    {% trans 'Balance' %}
    +
    {{ 'Balance'|trans }}
    {{ profile.balance | money(profile.currency) }}
    @@ -102,21 +102,21 @@
    -

    {% trans 'Invoices' %}

    +

    {{ 'Invoices'|trans }}

    -
    {% trans 'Total' %}
    +
    {{ 'Total'|trans }}
    {{ client.invoice_get_list().total }}
    -
    {% trans 'Paid' %}
    -
    {{ client.invoice_get_list({"status":"paid"}).total }}
    -
    {% trans 'Unpaid' %}
    -
    {{ client.invoice_get_list({"status":"unpaid"}).total }}
    +
    {{ 'Paid'|trans }}
    +
    {{ client.invoice_get_list({ "status": "paid" }).total }}
    +
    {{ 'Unpaid'|trans }}
    +
    {{ client.invoice_get_list({ "status": "unpaid" }).total }}
    @@ -128,22 +128,22 @@
    -

    {% trans 'Orders' %}

    +

    {{ 'Orders'|trans }}

    -
    {% trans 'Total' %}
    -
    {{ client.order_get_list({"hide_addons":1}).total }}
    -
    {% trans 'Active' %}
    -
    {{ client.order_get_list({"hide_addons":1, "status":"active"}).total }}
    -
    {% trans 'Expiring' %}
    -
    {{ client.order_get_list({"expiring":1}).total }}
    +
    {{ 'Total'|trans }}
    +
    {{ client.order_get_list({ "hide_addons": 1 }).total }}
    +
    {{ 'Active'|trans }}
    +
    {{ client.order_get_list({ "hide_addons": 1, "status": "active" }).total }}
    +
    {{ 'Expiring'|trans }}
    +
    {{ client.order_get_list({ "expiring": 1 }).total }}
    @@ -152,22 +152,22 @@
    -

    {% trans 'Tickets' %}

    +

    {{ 'Tickets'|trans }}

    -
    {% trans 'Total' %}
    +
    {{ 'Total'|trans }}
    {{ client.support_ticket_get_list().total }}
    -
    {% trans 'Open' %}
    -
    {{ client.support_ticket_get_list({"status":'open'}).total }}
    -
    {% trans 'On Hold' %}
    -
    {{ client.support_ticket_get_list({"status":'on_hold'}).total }}
    +
    {{ 'Open'|trans }}
    +
    {{ client.support_ticket_get_list({ "status": 'open' }).total }}
    +
    {{ 'On Hold'|trans }}
    +
    {{ client.support_ticket_get_list({ "status": 'on_hold' }).total }}
    @@ -179,19 +179,21 @@
    -

    {% trans 'Recent orders' %}

    +

    {{ 'Recent orders'|trans }}

    {% trans 'Id' %}{% trans 'Subject' %}{% trans 'Help desk' %}{% trans 'Status' %}{% trans 'Submitted' %}{% trans 'Actions' %}{{ 'Id'|trans }}{{ 'Subject'|trans }}{{ 'Help desk'|trans }}{{ 'Status'|trans }}{{ 'Submitted'|trans }}{{ 'Actions'|trans }}
    {{ticket.id}}{{ticket.subject}}{{ticket.helpdesk.name}}{{mf.status_name(ticket.status)}}{{ticket.created_at|bb_date}}{% trans 'Reply' %}{{ ticket.id }}{{ ticket.subject }}{{ ticket.helpdesk.name }}{{ mf.status_name(ticket.status) }}{{ ticket.created_at|bb_date }}{{ 'Reply'|trans }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    - {% for i, order in client.order_get_list({"per_page":5, "page":request.page, "hide_addons":1}).list %} + {% for i, order in client.order_get_list({ "per_page": 5, "page": request.page, "hide_addons": 1 }).list %} - - + + {% else %} - + {% endfor %} @@ -203,19 +205,19 @@
    -

    {% trans 'Recent emails' %}

    +

    {{ 'Recent emails'|trans }}

    {{ order.title|truncate(30) }}{{ mf.status_name(order.status) }}{{ order.title|truncate(30) }} + {{ mf.status_name(order.status) }} +
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    - {% for i, email in client.email_get_list({"per_page":5}).list %} + {% for i, email in client.email_get_list({ "per_page": 5 }).list %} - - + + {% else %} - + {% endfor %} @@ -225,6 +227,5 @@ - {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Email/html_admin/mod_email_details.phtml b/src/bb-modules/Email/html_admin/mod_email_details.phtml index a63eac7f2..021963479 100644 --- a/src/bb-modules/Email/html_admin/mod_email_details.phtml +++ b/src/bb-modules/Email/html_admin/mod_email_details.phtml @@ -1,12 +1,14 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% set active_menu = 'activity' %} -{% block meta_title %}{{email.subject}}{% endblock %} + +{% block meta_title %}{{ email.subject }}{% endblock %} {% block breadcrumbs %} {% endblock %} @@ -19,26 +21,30 @@
    {{email.subject|truncate(30)}}{{ email.created_at|timeago }} {% trans 'ago' %}{{ email.subject|truncate(30) }}{{ email.created_at|timeago }} {{ 'ago'|trans }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    - - + + - - + + - - + + diff --git a/src/bb-modules/Email/html_admin/mod_email_history.phtml b/src/bb-modules/Email/html_admin/mod_email_history.phtml index 6d59cf8f5..aad4613c9 100644 --- a/src/bb-modules/Email/html_admin/mod_email_history.phtml +++ b/src/bb-modules/Email/html_admin/mod_email_history.phtml @@ -1,63 +1,62 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Email history' %}{% endblock %} + +{% block meta_title %}{{ 'Email history'|trans }}{% endblock %} + {% set active_menu = 'activity' %} {% block content %} - -{% set config = admin.extension_config_get({"ext":"mod_email"}) %} +{% set config = admin.extension_config_get({ "ext": "mod_email" }) %} {% if config.log_enabled is not defined or config.log_enabled != 1 %}
    -

    {% trans 'INFORMATION' %}: {% trans 'Email logging is not enabled. If you want to log sent mails to database, enable it in' %} - {% trans 'email settings.' %} +

    {{ 'INFORMATION'|trans }}: {{ 'Email logging is not enabled. If you want to log sent mails to database, enable it in'|trans }} + {{ 'email settings.'|trans }}

    {% endif %}
    -
    {% trans 'Email history' %}
    +
    {{ 'Email history'|trans }}
    -{{ mf.table_search }} -
    {% trans 'From' %}{{email.sender}}{{ 'From'|trans }}{{ email.sender }}
    {% trans 'To' %}{{email.recipients}}{{ 'To'|trans }}{{ email.recipients }}
    {% trans 'Sent' %}{{email.created_at|date('l, d F Y')}}{{ 'Sent'|trans }}{{ email.created_at|date('l, d F Y') }}
    - - - - - - - - - - + {{ mf.table_search }} +
    {% trans 'To' %}{% trans 'From' %}{% trans 'Subject' %}{% trans 'Date' %} 
    + + + + + + + + + + - - {% set emails = admin.email_email_get_list({"per_page":30, "page":request.page}|merge(request)) %} - {% for i, email in emails.list %} - - - - - - - - - {% else %} + + {% set emails = admin.email_email_get_list({ "per_page": 30, "page": request.page }|merge(request)) %} + {% for i, email in emails.list %} - + + + + + - - {% endfor %} - -
    {{ 'To'|trans }}{{ 'From'|trans }}{{ 'Subject'|trans }}{{ 'Date'|trans }} 
    {{ email.recipients }}{{ email.sender }}{{ email.subject|truncate(40) }}{{ email.created_at|date('Y-m-d') }} - - -
    - {% trans 'The list is empty' %} + {{ email.recipients }}{{ email.sender }}{{ email.subject|truncate(40) }}{{ email.created_at|date('Y-m-d') }} + +
    - + {% else %} + + + {{ 'The list is empty'|trans }} + + + {% endfor %} + +
    -{% include "partial_batch_delete.phtml" with {'action' : 'admin/email/batch_delete'} %} -{% include "partial_pagination.phtml" with {'list': emails, 'url':'email/history'} %} - +{% include "partial_batch_delete.phtml" with { 'action': 'admin/email/batch_delete' } %} +{% include "partial_pagination.phtml" with { 'list': emails, 'url': 'email/history' } %} {% endblock %} diff --git a/src/bb-modules/Email/html_admin/mod_email_settings.phtml b/src/bb-modules/Email/html_admin/mod_email_settings.phtml index 9d09c8ba0..083f88970 100644 --- a/src/bb-modules/Email/html_admin/mod_email_settings.phtml +++ b/src/bb-modules/Email/html_admin/mod_email_settings.phtml @@ -1,24 +1,23 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Email' %}{% endblock %} +{% block meta_title %}{{ 'Email'|trans }}{% endblock %} {% block breadcrumbs %} {% endblock %} - {% set active_menu = 'system' %} {% block content %}
    -
    @@ -29,16 +28,16 @@ - - - - + + + + - {% set templates = admin.email_template_get_list({"per_page":100, "page":request.page}|merge(request)) %} + {% set templates = admin.email_template_get_list({ "per_page": 100, "page": request.page }|merge(request)) %} {% for i, template in templates.list %} @@ -46,16 +45,14 @@ - - {% else %} {% endfor %} @@ -64,9 +61,9 @@ @@ -74,11 +71,11 @@
    {% trans 'Title' %}{% trans 'Extension' %}{% trans 'Code' %}{% trans 'Enabled' %}{{ 'Title'|trans }}{{ 'Extension'|trans }}{{ 'Code'|trans }}{{ 'Enabled'|trans }}  
    {{ template.subject }}{{ template.action_code }} {{ mf.q(template.enabled) }} - - + +
    - {% trans 'The list is empty. Depending on modules enabled email templates will be inserted after first event occurrence.' %} + {{ 'The list is empty. Depending on modules enabled email templates will be inserted after first event occurrence.'|trans }}
    - {% set params = admin.extension_config_get({"ext":"mod_email"}) %} + {% set params = admin.extension_config_get({ "ext": "mod_email" }) %}
    -

    {% trans 'Configure email options' %}

    -

    {% trans 'BoxBilling sends emails using sendmail by default or you can configure your own SMTP server' %}

    +

    {{ 'Configure email options'|trans }}

    +

    {{ 'BoxBilling sends emails using sendmail by default or you can configure your own SMTP server'|trans }}

    @@ -87,43 +84,43 @@
    - - - + + +
    - +
    - - + +
    - +
    - - - + + +
    -
    +
    - +
    - +
    - +
    @@ -131,9 +128,9 @@
    -
    +
    - +
    @@ -141,7 +138,7 @@
    - +
    @@ -149,7 +146,7 @@
    - +
    @@ -157,7 +154,7 @@
    - +
    @@ -165,7 +162,7 @@
    - +
    @@ -176,8 +173,8 @@
    - - + +
    @@ -185,50 +182,50 @@
    -

    {% trans 'Where I can use new email template?' %}

    -

    {% trans 'Newly created email templates can be used in custom event hooks.' %}

    +

    {{ 'Where I can use new email template?'|trans }}

    +

    {{ 'Newly created email templates can be used in custom event hooks.'|trans }}

    - +
    - - + +
    - +
    - +
    - +
    - +
    - +
    @@ -243,10 +240,11 @@ $(function() { bb.post('admin/email/send_test', null, function(result){ bb.msg('Email was successfully sent'); }); + return false; }); $("#mailer input").click( function() { - if($(this).val() == 'smtp') { + if ($(this).val() == 'smtp') { $('fieldset.smtp').slideDown(); } else { $('fieldset.smtp').slideUp(); diff --git a/src/bb-modules/Email/html_admin/mod_email_template.phtml b/src/bb-modules/Email/html_admin/mod_email_template.phtml index 2d2af8271..cd7683b69 100644 --- a/src/bb-modules/Email/html_admin/mod_email_template.phtml +++ b/src/bb-modules/Email/html_admin/mod_email_template.phtml @@ -1,41 +1,41 @@ {% extends "layout_default.phtml" %} + {% block meta_title %}Email template{% endblock %} {% set active_menu = 'system' %} {% block breadcrumbs %} {% endblock %} {% block content %} - -{# if template.vars|length == 0 %} +{# {% if template.vars|length == 0 %}
    -

    {% trans 'INFORMATION' %}: {% trans 'This email template is deprecated' %}

    +

    {{ 'INFORMATION'|trans }}: {{ 'This email template is deprecated'|trans }}

    -{% endif #} +{% endif %} #}
    -

    {% trans 'Manage email template' %}

    -

    {% trans 'Most email templates receives parameters from BoxBilling. You can browse them on "Variables" tab. Copy variable name to email template and hit preview to see parsed content. Please note that values will be different when actual email is sent.' %}

    +

    {{ 'Manage email template'|trans }}

    +

    {{ 'Most email templates receives parameters from BoxBilling. You can browse them on "Variables" tab. Copy variable name to email template and hit preview to see parsed content. Please note that values will be different when actual email is sent.'|trans }}

    -
    +
    @@ -44,8 +44,12 @@
    - {% if template.vars %}{% else %}{% trans 'Preview mode is disabled until first event occurrence' %}{% endif %} - + {% if template.vars %} + + {% else %} + {{ 'Preview mode is disabled until first event occurrence'|trans }} + {% endif %} +
    @@ -60,13 +64,13 @@
    -

    {% trans 'Template settings' %}

    -

    {% trans 'Enable or disable this email template.' %}

    +

    {{ 'Template settings'|trans }}

    +

    {{ 'Enable or disable this email template.'|trans }}

    - +
    - +
    @@ -74,13 +78,13 @@
    - +
    - +
    @@ -88,15 +92,15 @@
    -

    {% trans 'List of variables used in this email' %}

    -

    {% trans 'These values will change when real email is sent. You can pass these variables to admin or guest API to get additional information from database.' %}

    +

    {{ 'List of variables used in this email'|trans }}

    +

    {{ 'These values will change when real email is sent. You can pass these variables to admin or guest API to get additional information from database.'|trans }}

    - - + + @@ -134,7 +138,7 @@ {% else %} - + {% endfor %} @@ -143,12 +147,12 @@
    -

    {% trans 'Reset email template to default' %}

    +

    {{ 'Reset email template to default'|trans }}

    - +
    @@ -156,8 +160,8 @@
    -

    {% trans 'Email templates examples' %}

    -

    {% trans 'Email template playground. Use this tool to try rendering email templates.' %}

    +

    {{ 'Email templates examples'|trans }}

    +

    {{ 'Email template playground. Use this tool to try rendering email templates.'|trans }}

    @@ -196,7 +200,7 @@ Accessing Admin API can get information about your BoxBilling, for example how m {% endapply %}{% endautoescape %} - +
    @@ -205,7 +209,6 @@ Accessing Admin API can get information about your BoxBilling, for example how m
    - {% endblock %} {% block js %} @@ -214,26 +217,29 @@ $(function() { $('.epb').click(function(){ var r = $(this).siblings('.example-preview'); var params = {_tpl:$(this).siblings('textarea').val(), id:'{{template.id}}' }; + bb.post('admin/email/template_render', params, function(result){ r.html(result).show(); }); - }); $('#preview-button').click(function(){ var params = {_tpl:$('#email-template').val(), id:'{{template.id}}' }; + bb.post('admin/email/template_render', params, function(result){ $('#preview').show(); $('#preview .econtent').html(result); }); var params = {_tpl:$('#email-subject').val(), id:'{{template.id}}' }; + bb.post('admin/email/template_render', params, function(result){ $('#preview').show(); $('#preview .esubject').html(result); }); + return false; }); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Email/html_client/mod_email_email.phtml b/src/bb-modules/Email/html_client/mod_email_email.phtml index 7264a7e14..37bb785a3 100644 --- a/src/bb-modules/Email/html_client/mod_email_email.phtml +++ b/src/bb-modules/Email/html_client/mod_email_email.phtml @@ -1,10 +1,12 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Email' %}{% endblock %} +{% block meta_title %}{{ 'Email'|trans }}{% endblock %} + {% block breadcrumb %} -
  • {% trans 'Emails' %}/
  • +
  • {{ 'Emails'|trans }}/
  • {{ email.subject }} {% endblock %} + {% block content %}
    @@ -14,61 +16,67 @@
    - -
    -
    -

    {% trans 'From:' %} {{email.sender}}

    -

    {% trans 'To:' %} {{email.recipients}}

    -

    {% trans 'Created at:' %} {{email.created_at|bb_date}}

    -
    -
    -

    {{ email.subject }}

    -

    {{email.content_html | raw}}

    -
    - - -
    +
    +
    +

    {{ 'From:'|trans }} {{email.sender}}

    +

    {{ 'To:'|trans }} {{email.recipients}}

    +

    {{ 'Created at:'|trans }} {{email.created_at|bb_date}}

    +
    +
    +

    {{ email.subject }}

    +

    {{email.content_html | raw}}

    +
    + +
    +
    - {% endblock %} + {% block js %} {% autoescape "js" %} {% endautoescape %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Email/html_client/mod_email_index.phtml b/src/bb-modules/Email/html_client/mod_email_index.phtml index 55bffc4b5..45381112a 100644 --- a/src/bb-modules/Email/html_client/mod_email_index.phtml +++ b/src/bb-modules/Email/html_client/mod_email_index.phtml @@ -1,7 +1,7 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Emails' %}{% endblock %} -{% block breadcrumb %}
  • {% trans 'Emails' %}
  • {% endblock %} +{% block meta_title %}{{ 'Emails'|trans }}{% endblock %} +{% block breadcrumb %}
  • {{ 'Emails'|trans }}
  • {% endblock %} {% set emails = client.email_get_list({"per_page":10, "page":request.page}) %} @@ -10,20 +10,20 @@
    -

    {% trans 'Emails' %}

    -

    {% trans 'Here you can find all the emails we sent you. Please click on email topic in left column and it will be displayed in right side.' %}

    +

    {{ 'Emails'|trans }}

    +

    {{ 'Here you can find all the emails we sent you. Please click on email topic in left column and it will be displayed in right side.'|trans }}

    {% if emails.list is empty %} -
    {% trans 'There are no emails to display' %}
    +
    {{ 'There are no emails to display'|trans }}
    {% else %}
    @@ -49,6 +49,7 @@ {% include "partial_pagination.phtml" with {'list': emails} %} {% endif %}
    +
    diff --git a/src/bb-modules/Embed/html_client/mod_embed_contact.phtml b/src/bb-modules/Embed/html_client/mod_embed_contact.phtml index 2a943d2bd..1d81f26b5 100644 --- a/src/bb-modules/Embed/html_client/mod_embed_contact.phtml +++ b/src/bb-modules/Embed/html_client/mod_embed_contact.phtml @@ -38,26 +38,26 @@

    - - + +

    - - + +

    - - + +

    - - + +

    - {% if guest.extension_is_on({"mod":"spamchecker"}) %} + {% if guest.extension_is_on({ "mod": "spamchecker" }) %} {% set rc = guest.spamchecker_recaptcha %} {% if rc.enabled %} {% if rc.version == 2 %} @@ -75,13 +75,15 @@ @@ -96,31 +98,31 @@ {% endif %} {% endif %} - - +
    - - \ No newline at end of file + diff --git a/src/bb-modules/Embed/html_client/mod_embed_domainchecker.phtml b/src/bb-modules/Embed/html_client/mod_embed_domainchecker.phtml index ad28898be..711a6e07c 100644 --- a/src/bb-modules/Embed/html_client/mod_embed_domainchecker.phtml +++ b/src/bb-modules/Embed/html_client/mod_embed_domainchecker.phtml @@ -63,23 +63,24 @@ - - \ No newline at end of file + diff --git a/src/bb-modules/Embed/html_client/mod_embed_loginform.phtml b/src/bb-modules/Embed/html_client/mod_embed_loginform.phtml index cafb9044f..b52490b41 100644 --- a/src/bb-modules/Embed/html_client/mod_embed_loginform.phtml +++ b/src/bb-modules/Embed/html_client/mod_embed_loginform.phtml @@ -45,16 +45,18 @@ \ No newline at end of file + diff --git a/src/bb-modules/Formbuilder/html_admin/mod_formbuilder_preview.phtml b/src/bb-modules/Formbuilder/html_admin/mod_formbuilder_preview.phtml index c0daaf573..ac2dacfb1 100644 --- a/src/bb-modules/Formbuilder/html_admin/mod_formbuilder_preview.phtml +++ b/src/bb-modules/Formbuilder/html_admin/mod_formbuilder_preview.phtml @@ -1,5 +1,5 @@
    - +
    {% if field.type == "text" %} @@ -17,7 +17,7 @@ {% elseif field.type == "select" %} {% if field.options is empty %}
      -
    • {% trans 'Please click on "Edit" in order to add new select box' %}
    • +
    • {{ 'Please click on "Edit" in order to add new select box'|trans }}
    {% else %}
    {% trans 'Variable' %}{% trans 'Example value' %}{{ 'Variable'|trans }}{{ 'Example value'|trans }}
    {% trans 'This template does not receive any parameters' %}{{ 'This template does not receive any parameters'|trans }}
    - - - - - - + + + + + + - - {% for form in admin.formbuilder_get_forms %} - - - - - - - - {% endfor %} + {% for form in admin.formbuilder_get_forms %} + + + + + + + {% endfor %} - - - + + +
    {% trans 'Form' %}{% trans 'Orders using this form' %}{% trans 'Products using this form' %}{% trans 'Actions' %}
    {{ 'Form'|trans }}{{ 'Orders using this form'|trans }}{{ 'Products using this form'|trans }}{{ 'Actions'|trans }}
    {{ form.name }}{{ form.order_count }}{{ form.product_count }} - - - -
    {{ form.name }}{{ form.order_count }}{{ form.product_count }} + + + +
    - -
    + +
    @@ -102,61 +102,61 @@
    - +
    -
    -{% if request.id %}{% set form = admin.formbuilder_get_form({"id":request.id}) %} +{% if request.id %} + {% set form = admin.formbuilder_get_form({ "id": request.id }) %}
    -
    {% trans 'Form options' %}
    +
    {{ 'Form options'|trans }}
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    - + -
    -
    - -
    -
    -
    -
    -
    +
    +
    + +
    +
    +
    + +
    @@ -168,14 +168,13 @@
    {% endif %}
    - {% endblock %} {% block js %} {% endblock %} - -{% endif %} \ No newline at end of file + +{% endblock %} +{# {% endif %} #} diff --git a/src/bb-modules/Formbuilder/html_client/mod_formbuilder_build.phtml b/src/bb-modules/Formbuilder/html_client/mod_formbuilder_build.phtml index 2b0edb0f9..ca1ab7014 100644 --- a/src/bb-modules/Formbuilder/html_client/mod_formbuilder_build.phtml +++ b/src/bb-modules/Formbuilder/html_client/mod_formbuilder_build.phtml @@ -1,12 +1,12 @@ -{% if guest.extension_is_on({"mod":"formbuilder"}) %} -{% set form = guest.formbuilder_get({"id":product.form_id}) %} - {% if form.style.show_title != "0" %} -
    -
    - {{form.name}} -
    +{% if guest.extension_is_on({ "mod": "formbuilder" }) %} + {% set form = guest.formbuilder_get({ "id": product.form_id }) %} + {% if form.style.show_title != "0" %} +
    +
    + {{ form.name }}
    - {% endif %} +
    + {% endif %}
    {% for field in form.fields %} diff --git a/src/bb-modules/Forum/html_admin/mod_forum_forum.phtml b/src/bb-modules/Forum/html_admin/mod_forum_forum.phtml index 724cbd028..ad0d3a14f 100644 --- a/src/bb-modules/Forum/html_admin/mod_forum_forum.phtml +++ b/src/bb-modules/Forum/html_admin/mod_forum_forum.phtml @@ -1,18 +1,21 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'support' %} + {% block meta_title %}Forum{% endblock %} {% block content %}
    -
    {% trans 'Forum details' %}
    +
    {{ 'Forum details'|trans }}
    - +
    • @@ -24,39 +27,37 @@
    - +
    - +
    - +
    - - + +
    - +
    - +
    - - {% endblock %} diff --git a/src/bb-modules/Forum/html_admin/mod_forum_index.phtml b/src/bb-modules/Forum/html_admin/mod_forum_index.phtml index 4df962436..503cad486 100644 --- a/src/bb-modules/Forum/html_admin/mod_forum_index.phtml +++ b/src/bb-modules/Forum/html_admin/mod_forum_index.phtml @@ -1,60 +1,58 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'support' %} + {% block meta_title %}Forum{% endblock %} {% block content %}
    -
    -
    -
    {{ mf.table_search }} - - + + - {% set posts = admin.forum_message_get_list({"per_page":30, "page":request.page}|merge(request)) %} + {% set posts = admin.forum_message_get_list({ "per_page": 30, "page": request.page }|merge(request)) %} {% for i, post in posts.list %} - + {% else %} - + {% endfor %}
    {% trans 'Message' %}{% trans 'Date' %}{{ 'Message'|trans }}{{ 'Date'|trans }} Actions
    {{post.author.id}}{{post.author.id}} - {{post.forum_title}} + {{post.forum_title}}
    {{ post.message|truncate(80) }}
    {{ post.created_at|timeago }} ago - - + +
    - {% trans 'The list is empty' %} - {{ 'The list is empty'|trans }}
    - {% include "partial_pagination.phtml" with {'list': posts, 'url':'forum'} %} + {% include "partial_pagination.phtml" with { 'list': posts, 'url': 'forum' } %}
    @@ -62,17 +60,17 @@ - - - - - + + + + + - {% set topics = admin.forum_topic_get_list({"per_page":30, "page":request.page}|merge(request)) %} + {% set topics = admin.forum_topic_get_list({ "per_page": 30, "page": request.page }|merge(request)) %} {% for i, topic in topics.list %} @@ -89,13 +87,13 @@ {% else %} {% endfor %}
    {% trans 'Title' %}{% trans 'Replies' %}{% trans 'Views' %}{% trans 'Status' %}{% trans 'Sticky' %}{{ 'Title'|trans }}{{ 'Replies'|trans }}{{ 'Views'|trans }}{{ 'Status'|trans }}{{ 'Sticky'|trans }} Actions
    - {% trans 'The list is empty' %} + {{ 'The list is empty'|trans }}
    - {% include "partial_pagination.phtml" with {'list': topics, 'url':'forum'} %} + {% include "partial_pagination.phtml" with { 'list': topics, 'url': 'forum' } %}
    @@ -103,30 +101,30 @@
    - +
    {{ mf.selectbox('forum_id', admin.forum_get_pairs, request.forum_id, 1) }}
    - +
    - - + +
    - +
    - - + +
    - +
    @@ -134,13 +132,13 @@
    - +
    - +
    @@ -150,35 +148,35 @@
    - +
    - +
    - +
    - +
    - - + +
    - +
    - +
    @@ -190,24 +188,24 @@ - - - + + + {% for category, forums in admin.forum_get_categories %} - + {% for forum in forums %} - + {% endfor %} @@ -220,13 +218,11 @@
    {% trans 'Sorting' %}{% trans 'Title' %}{% trans 'Actions' %}{{ 'Sorting'|trans }}{{ 'Title'|trans }}{{ 'Actions'|trans }}
    {{category}}{{ category }}
    {{forum.title}} - +
    - +
    -
    - {% endblock %} diff --git a/src/bb-modules/Forum/html_admin/mod_forum_profile.phtml b/src/bb-modules/Forum/html_admin/mod_forum_profile.phtml index 5e2a836da..94d546992 100644 --- a/src/bb-modules/Forum/html_admin/mod_forum_profile.phtml +++ b/src/bb-modules/Forum/html_admin/mod_forum_profile.phtml @@ -1,16 +1,18 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% block meta_title %}Forum - Client profile{% endblock %} + {% set active_menu = 'support' %} {% block content %} -{% set params = admin.extension_config_get({"ext":"mod_forum"}) %} -{% set fp = admin.forum_profile_get({"client_id":client_id}) %} -{% set posts = admin.forum_message_get_list({"client_id":client_id,"per_page":30, "page":request.page}|merge(request)) %} +{% set params = admin.extension_config_get({ "ext": "mod_forum" }) %} +{% set fp = admin.forum_profile_get({ "client_id": client_id }) %} +{% set posts = admin.forum_message_get_list({ "client_id": client_id, "per_page": 30, "page": request.page }|merge(request)) %} {% set last_message = posts.list[0] %}
    -
    @@ -121,13 +125,13 @@ - - + + - {% set posts = admin.forum_message_get_list({"per_page":20, "client_id":client_id, "with_points":1}|merge(request)) %} + {% set posts = admin.forum_message_get_list({ "per_page": 20, "client_id": client_id, "with_points": 1 }|merge(request)) %} {% for i, post in posts.list %} {% else %} - + {% endfor %}
    {% trans 'Message' %}{% trans 'Actions' %}{{ 'Message'|trans }}{{ 'Actions'|trans }}
    @@ -141,30 +145,25 @@
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    {% else %}
    -

    {% trans 'Enable forum points feature in extension configuration page' %}

    +

    {{ 'Enable forum points feature in extension configuration page'|trans }}

    Forum settings

    {% endif %} - - {% endblock %} {% block js %} {% endblock %} \ No newline at end of file diff --git a/src/bb-modules/Forum/html_admin/mod_forum_settings.phtml b/src/bb-modules/Forum/html_admin/mod_forum_settings.phtml index 4666369cb..f0927275a 100644 --- a/src/bb-modules/Forum/html_admin/mod_forum_settings.phtml +++ b/src/bb-modules/Forum/html_admin/mod_forum_settings.phtml @@ -1,33 +1,34 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Forum settings' %}{% endblock %} + +{% block meta_title %}{{ 'Forum settings'|trans }}{% endblock %} + {% set active_menu = 'system' %} {% block breadcrumbs %} {% endblock %} - {% block content %} -
    -
    {% trans 'Forum settings' %}
    +
    {{ 'Forum settings'|trans }}
    - {% set params = admin.extension_config_get({"ext":"mod_forum"}) %} + {% set params = admin.extension_config_get({ "ext": "mod_forum" }) %} -
    +
    - +
    - - + +
    @@ -54,7 +55,7 @@ - {% trans 'Give points for posting in selected forums' %} + {{ 'Give points for posting in selected forums'|trans }} @@ -66,7 +67,7 @@ {% for forum in forums %} - + {{forum.title}} @@ -77,17 +78,15 @@
    - + - {% endblock %} {% block js %} {% endblock %} \ No newline at end of file diff --git a/src/bb-modules/Forum/html_admin/mod_forum_topic.phtml b/src/bb-modules/Forum/html_admin/mod_forum_topic.phtml index 62527fa6b..541d12888 100644 --- a/src/bb-modules/Forum/html_admin/mod_forum_topic.phtml +++ b/src/bb-modules/Forum/html_admin/mod_forum_topic.phtml @@ -1,18 +1,20 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'support' %} + {% block meta_title %}Forum topic{% endblock %} {% block content %} -
    -
    {{topic.title}}
    +
    {{ topic.title }}
    @@ -22,44 +24,44 @@ - - + + - + - + - + - + - + - + - + - + @@ -84,35 +86,35 @@
    - +
    {{ mf.selectbox('forum_id', admin.forum_get_pairs, topic.forum.id, 1) }}
    - +
    - +
    - +
    - +
    @@ -120,14 +122,14 @@
    - +
    - +
    @@ -146,9 +148,9 @@
    @@ -157,7 +159,7 @@
    - +
    @@ -172,7 +174,7 @@ {{ profile.signature }} - +
    @@ -185,7 +187,7 @@ {{ profile.signature }} {{ mf.markdown_quote(message.message) }} - + @@ -194,22 +196,22 @@
    {{ topic.forum.title }}{{ topic.forum.title }}
    {{ topic.title }}
    {{ topic.first.author.name }}
    {% trans 'Views' %}{{ 'Views'|trans }} {{ topic.stats.views_count }}
    {% trans 'Messages' %}{{ 'Messages'|trans }} {{ topic.stats.posts_count }}
    {{ mf.status_name(topic.status) }}
    {{ mf.q(topic.sticky) }}
    {{ topic.created_at|date('Y-m-d') }}
    {{ topic.due_at|date('Y-m-d') }}
    - + - + - + - + @@ -230,9 +232,7 @@ {% endfor %} - -{% include "partial_pagination.phtml" with {'list': messages, 'url':'forum/topic/'~topic.id} %} - +{% include "partial_pagination.phtml" with { 'list': messages, 'url': 'forum/topic/'~topic.id } %} {% endblock %} {% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} diff --git a/src/bb-modules/Forum/html_client/mod_forum_forum.phtml b/src/bb-modules/Forum/html_client/mod_forum_forum.phtml index 1e9b7a9a8..8ba154c65 100644 --- a/src/bb-modules/Forum/html_client/mod_forum_forum.phtml +++ b/src/bb-modules/Forum/html_client/mod_forum_forum.phtml @@ -1,9 +1,11 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} {% block meta_title %}{{ forum.title }}{% endblock %} + {% block meta_description %}{{ forum.description }}{% endblock %} + {% block breadcrumb %} -
  • {% trans 'Forum' %}/
  • +
  • {{ 'Forum'|trans }}/
  • {{ forum.title }}
  • {% endblock %} {% block content %} @@ -16,13 +18,13 @@ {{ forum.description }} @@ -33,10 +35,10 @@ - - - - + + + + @@ -57,7 +59,7 @@ @@ -66,7 +68,7 @@ {% else %} - + {% endfor %} @@ -84,19 +86,19 @@
    {{ message.id }}
    {{ message.ip|default('-') }} {{ message.ip|ipcountryname|default('Unknown') }}
    {{ message.created_at|date("l, d F Y") }}
    {{ message.updated_at|date("l, d F Y") }}
       {% trans 'Thread / Thread Starter' %}{% trans 'Last post' %}{% trans 'Replies' %}{% trans 'Views' %}{{ 'Thread / Thread Starter'|trans }}{{ 'Last post'|trans }}{{ 'Replies'|trans }}{{ 'Views'|trans }}
    {{ topic.last.created_at|bb_date }} -

    {% trans 'by' %} {{ topic.last.author.name }} {#{{ topic.last.author.name }}#}

    +

    {{ 'by'|trans }} {{ topic.last.author.name }} {#{{ topic.last.author.name }}#}

    {{ topic.stats.posts_count }} {{ topic.stats.views_count }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    - - - + + + @@ -44,7 +46,9 @@
     {% trans 'Forum' %}{% trans 'Threads' %}{% trans 'Posts' %}{{ 'Forum'|trans }}{{ 'Threads'|trans }}{{ 'Posts'|trans }}
    {% if not client %} -

    +

    + +

    {% endif %}
    @@ -57,62 +61,51 @@
    -

    {% trans 'Favorite topics' %}

    -

    {% trans 'You set this topic as favorite. It can be done by opening any topic and clicking on "Add to favorites" button in "Topic information" block.' %}

    +

    {{ 'Favorite topics'|trans }}

    +

    {{ 'You set this topic as favorite. It can be done by opening any topic and clicking on "Add to favorites" button in "Topic information" block.'|trans }}

    - - - - - - - - + + + + + + + + - {% for i, topic in client.forum_favorites %} - {% else %} - - + - {% endfor %} - -
      {% trans 'Thread / Thread Starter' %}{% trans 'Last post' %}{% trans 'Replies' %}{% trans 'Views' %}
      {{ 'Thread / Thread Starter'|trans }}{{ 'Last post'|trans }}{{ 'Replies'|trans }}{{ 'Views'|trans }}
    - + {{ topic.first.author.name }} - {{topic.title}} + {{ topic.title }}

    {{ topic.first.author.name }}

    {{ topic.last.created_at|bb_date }} -

    {% trans 'by' %} {{ topic.last.author.name }} {#{{ topic.last.author.name }}#}

    +

    {{ 'by'|trans }} {{ topic.last.author.name }} {#{{ topic.last.author.name }}#}

    {{ topic.stats.posts_count }} {{ topic.stats.views_count }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    -
    {% endif %} - - - - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Forum/html_client/mod_forum_members_list.phtml b/src/bb-modules/Forum/html_client/mod_forum_members_list.phtml index 5f236fca2..2db73432c 100644 --- a/src/bb-modules/Forum/html_client/mod_forum_members_list.phtml +++ b/src/bb-modules/Forum/html_client/mod_forum_members_list.phtml @@ -1,25 +1,28 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Forum members' %}{% endblock %} -{% block breadcrumb %}
  • {% trans 'Forum members' %}
  • {% endblock %} + +{% block meta_title %}{{ 'Forum members'|trans }}{% endblock %} + +{% block breadcrumb %}
  • {{ 'Forum members'|trans }}
  • {% endblock %} {% block content %}
    -

    {% trans 'Forum members' %}

    -

    {% trans 'List of all forum members. You can filter the list by clicking on letter above to find usernames which start with this letter.' %}

    +

    {{ 'Forum members'|trans }}

    +

    {{ 'List of all forum members. You can filter the list by clicking on letter above to find usernames which start with this letter.'|trans }}

    - {% endblock %} + {% block js %} -{% endblock%} \ No newline at end of file +{% endblock%} diff --git a/src/bb-modules/Index/html_client/mod_index_dashboard.phtml b/src/bb-modules/Index/html_client/mod_index_dashboard.phtml index 85170634c..a8e4563f5 100644 --- a/src/bb-modules/Index/html_client/mod_index_dashboard.phtml +++ b/src/bb-modules/Index/html_client/mod_index_dashboard.phtml @@ -1,13 +1,13 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Client Area' %}{% endblock %} -{% block page_header %}{% trans 'Dashboard' %}{% endblock %} +{% block meta_title %}{{ 'Client Area'|trans }}{% endblock %} +{% block page_header %}{{ 'Dashboard'|trans }}{% endblock %} {% block breadcrumbs %} {% if not settings.hide_dashboard_breadcrumb %} {% endif %} {% endblock %} @@ -15,57 +15,50 @@ {% import "macro_functions.phtml" as mf %} {% block content %} - -{% if settings.showcase_enabled %} -
    -

    {{ settings.showcase_heading }}

    -

    {{ settings.showcase_text }}

    -

    {{ settings.showcase_button_title }}

    -
    -{% endif %} + {% if settings.showcase_enabled %} +
    +

    {{ settings.showcase_heading }}

    +

    {{ settings.showcase_text }}

    +

    {{ settings.showcase_button_title }}

    +
    + {% endif %} {% if client %} - -{% set tickets = client.support_ticket_get_list({"status":'on_hold'}) %} +{% set tickets = client.support_ticket_get_list({ "status": 'on_hold' }) %} {% if tickets.total > 0 %}
    -

    {% trans 'Tickets waiting your reply' %}

    +

    {{ 'Tickets waiting your reply'|trans }}

    - - - - - - + + + + + + {% for i, ticket in tickets.list %} - - - - - - - + + + + + + - {% else %} - - + - {% endfor %} -
    {% trans 'Id' %}{% trans 'Subject' %}{% trans 'Help desk' %}{% trans 'Status' %}{% trans 'Submitted' %}{% trans 'Actions' %}{{ 'Id'|trans }}{{ 'Subject'|trans }}{{ 'Help desk'|trans }}{{ 'Status'|trans }}{{ 'Submitted'|trans }}{{ 'Actions'|trans }}
    {{ticket.id}}{{ticket.subject}}{{ticket.helpdesk.name}}{{mf.status_name(ticket.status)}}{{ticket.created_at|bb_date}}{% trans 'Reply' %}{{ ticket.id }}{{ ticket.subject }}{{ ticket.helpdesk.name }}{{ mf.status_name(ticket.status) }}{{ ticket.created_at|bb_date }}{{ 'Reply'|trans }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    @@ -79,20 +72,20 @@
    -

    {% trans 'Profile' %}

    +

    {{ 'Profile'|trans }}

    -
    {% trans 'ID' %}
    +
    {{ 'ID'|trans }}
    #{{ profile.id }}
    -
    {% trans 'Email' %}
    +
    {{ 'Email'|trans }}
    {{ profile.email }}
    -
    {% trans 'Balance' %}
    +
    {{ 'Balance'|trans }}
    {{ profile.balance | money(profile.currency) }}
    @@ -102,21 +95,21 @@
    -

    {% trans 'Invoices' %}

    +

    {{ 'Invoices'|trans }}

    -
    {% trans 'Total' %}
    +
    {{ 'Total'|trans }}
    {{ client.invoice_get_list().total }}
    -
    {% trans 'Paid' %}
    -
    {{ client.invoice_get_list({"status":"paid"}).total }}
    -
    {% trans 'Unpaid' %}
    -
    {{ client.invoice_get_list({"status":"unpaid"}).total }}
    +
    {{ 'Paid'|trans }}
    +
    {{ client.invoice_get_list({ "status": "paid" }).total }}
    +
    {{ 'Unpaid'|trans }}
    +
    {{ client.invoice_get_list({ "status": "unpaid" }).total }}
    @@ -124,107 +117,107 @@
    +
    +
    +
    +

    {{ 'Orders'|trans }}

    + +
    +
    +
    +
    {{ 'Total'|trans }}
    +
    {{ client.order_get_list({ "hide_addons": 1}).total }}
    +
    {{ 'Active'|trans }}
    +
    {{ client.order_get_list({ "hide_addons": 1, "status": "active" }).total }}
    +
    {{ 'Expiring'|trans }}
    +
    {{ client.order_get_list({ "expiring": 1 }).total }}
    +
    +
    +
    +
    -
    -
    -
    -

    {% trans 'Orders' %}

    - -
    -
    -
    -
    {% trans 'Total' %}
    -
    {{ client.order_get_list({"hide_addons":1}).total }}
    -
    {% trans 'Active' %}
    -
    {{ client.order_get_list({"hide_addons":1, "status":"active"}).total }}
    -
    {% trans 'Expiring' %}
    -
    {{ client.order_get_list({"expiring":1}).total }}
    -
    -
    -
    -
    - -
    -
    -
    -

    {% trans 'Tickets' %}

    - -
    -
    -
    -
    {% trans 'Total' %}
    -
    {{ client.support_ticket_get_list().total }}
    -
    {% trans 'Open' %}
    -
    {{ client.support_ticket_get_list({"status":'open'}).total }}
    -
    {% trans 'On Hold' %}
    -
    {{ client.support_ticket_get_list({"status":'on_hold'}).total }}
    -
    -
    -
    -
    +
    +
    +
    +

    {{ 'Tickets'|trans }}

    + +
    +
    +
    +
    {{ 'Total'|trans }}
    +
    {{ client.support_ticket_get_list().total }}
    +
    {{ 'Open'|trans }}
    +
    {{ client.support_ticket_get_list({ "status": 'open' }).total }}
    +
    {{ 'On Hold'|trans }}
    +
    {{ client.support_ticket_get_list({ "status": 'on_hold' }).total }}
    +
    +
    +
    +
    +
    +
    +
    +

    {{ 'Recent orders'|trans }}

    +
    +
    + + + {% for i, order in client.order_get_list({ "per_page": 5, "page": request.page, "hide_addons": 1 }).list %} + + + + + {% else %} + + + + {% endfor %} + +
    + {{ order.title|truncate(30) }} + + {{ mf.status_name(order.status) }} +
    {{ 'The list is empty'|trans }}
    +
    +
    +
    -
    -
    -
    -

    {% trans 'Recent orders' %}

    -
    -
    - - - {% for i, order in client.order_get_list({"per_page":5, "page":request.page, "hide_addons":1}).list %} - - - - - {% else %} - - - - {% endfor %} - -
    {{ order.title|truncate(30) }}{{ mf.status_name(order.status) }}
    {% trans 'The list is empty' %}
    -
    -
    -
    - -
    -
    -
    -

    {% trans 'Recent emails' %}

    -
    -
    - - - {% for i, email in client.email_get_list({"per_page":5}).list %} - - - - - {% else %} - - - - {% endfor %} - -
    {{email.subject|truncate(30)}}{{ email.created_at|timeago }} {% trans 'ago' %}
    {% trans 'The list is empty' %}
    -
    -
    -
    - +
    +
    +
    +

    {{ 'Recent emails'|trans }}

    +
    +
    + + + {% for i, email in client.email_get_list({ "per_page": 5 }).list %} + + + + + {% else %} + + + + {% endfor %} + +
    {{ email.subject|truncate(30) }}{{ email.created_at|timeago }} {{ 'ago'|trans }}
    {{ 'The list is empty'|trans }}
    +
    +
    +
    - {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Invoice/Service.php b/src/bb-modules/Invoice/Service.php index e661e0df7..27df0277e 100644 --- a/src/bb-modules/Invoice/Service.php +++ b/src/bb-modules/Invoice/Service.php @@ -1,4 +1,5 @@ status) { return true; } - + $this->di['events_manager']->fire(['event' => 'onBeforeAdminInvoiceSendReminder', 'params' => ['id' => $invoice->id]]); $invoice->reminded_at = date('Y-m-d H:i:s'); @@ -1504,9 +1505,11 @@ class Service implements InjectionAwareInterface $invoices = $this->di['db']->find('Invoice', 'client_id = ?', [$client->id]); foreach ($invoices as $invoice) { $invoiceItems = $this->di['db']->find('InvoiceItem', 'invoice_id = ?', [$invoice->id]); + foreach ($invoiceItems as $invoiceItem) { $this->di['db']->trash($invoiceItem); } + $this->di['db']->trash($invoice); } } @@ -1517,6 +1520,7 @@ class Service implements InjectionAwareInterface public function isInvoiceTypeDeposit(\Model_Invoice $invoice) { $invoiceItems = $this->di['db']->find('InvoiceItem', 'invoice_id = ?', [$invoice->id]); + foreach ($invoiceItems as $item) { if (\Model_InvoiceItem::TYPE_DEPOSIT == $item->type) { return true; diff --git a/src/bb-modules/Invoice/html_admin/mod_invoice_settings.phtml b/src/bb-modules/Invoice/html_admin/mod_invoice_settings.phtml index 94a077bda..f7de2955c 100644 --- a/src/bb-modules/Invoice/html_admin/mod_invoice_settings.phtml +++ b/src/bb-modules/Invoice/html_admin/mod_invoice_settings.phtml @@ -1,13 +1,16 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Invoice settings' %}{% endblock %} + +{% block meta_title %}{{ 'Invoice settings'|trans }}{% endblock %} + {% set active_menu = 'system' %} {% block breadcrumbs %} {% endblock %} @@ -15,14 +18,14 @@
    -
    {% trans 'Invoice settings' %}
    +
    {{ 'Invoice settings'|trans }}
    {% set params = admin.system_get_params %}
    - +
    @@ -30,7 +33,7 @@
    - +
    @@ -38,20 +41,20 @@
    - +
    - - + +
    - {% trans 'Proforma Invoicing / Sequential Invoice Numbering' %} + {{ 'Proforma Invoicing / Sequential Invoice Numbering'|trans }}
    - +
    @@ -59,7 +62,7 @@
    - +
    @@ -67,7 +70,7 @@
    - +
    @@ -75,7 +78,7 @@
    - +
    @@ -84,9 +87,9 @@
    - {% trans 'Refunds settings' %} + {{ 'Refunds settings'|trans }}
    - +
    @@ -99,26 +102,25 @@
    - {% trans 'Add funds settings' %} + {{ 'Add funds settings'|trans }}
    - +
    - +
    - +
    - +
    - +
    - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Invoice/html_client/mod_invoice_banklink.phtml b/src/bb-modules/Invoice/html_client/mod_invoice_banklink.phtml index d1dadeebb..4cb332cab 100644 --- a/src/bb-modules/Invoice/html_client/mod_invoice_banklink.phtml +++ b/src/bb-modules/Invoice/html_client/mod_invoice_banklink.phtml @@ -1,6 +1,6 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Processing payment ...' %}{% endblock %} +{% block meta_title %}{{ 'Processing payment ...'|trans }}{% endblock %} {% block content %} @@ -12,24 +12,24 @@
    -

    {% trans 'Processing payment ...' %}

    -

    {% trans 'Thank you for your patience.' %}

    +

    {{ 'Processing payment ...'|trans }}

    +

    {{ 'Thank you for your patience.'|trans }}

    {% if payment.type == 'html' %} {{ payment.result|raw }} {% endif %} {% if payment.type == 'form' %} -

    {% trans 'Redirecting to payment gateway..' %}

    -
    +

    {{ 'Redirecting to payment gateway..'|trans }}

    + {% for key, value in payment.result %} - + {% endfor %} - +
    -{% endblock%} \ No newline at end of file +{% endblock%} diff --git a/src/bb-modules/Invoice/html_client/mod_invoice_print.phtml b/src/bb-modules/Invoice/html_client/mod_invoice_print.phtml index 5c612a677..57b43b677 100644 --- a/src/bb-modules/Invoice/html_client/mod_invoice_print.phtml +++ b/src/bb-modules/Invoice/html_client/mod_invoice_print.phtml @@ -2,6 +2,7 @@ {% set seller = invoice.seller %} {% set buyer = invoice.buyer %} {% set company = guest.system_company %} + @@ -70,7 +71,7 @@
    -

    {% trans 'Invoice' %} {{nr}}

    +

    {{ 'Invoice'|trans }} {{ nr }}

    @@ -81,26 +82,26 @@ Logo {% endif %}
    -
    {% trans 'Invoice number' %}:
    +
    {{ 'Invoice number'|trans }}:
    {{ nr }}
    -
    {% trans 'Invoice date' %}:
    +
    {{ 'Invoice date'|trans }}:
    {% if invoice.created_at %} {{ invoice.created_at | bb_date }} {% else %} ----- {% endif %}
    -
    {% trans 'Due date' %}:
    +
    {{ 'Due date'|trans }}:
    {% if invoice.due_at %} {{ invoice.due_at | bb_date }} {% else %} ----- {% endif %}
    -
    {% trans 'Invoice status' %}:
    +
    {{ 'Invoice status'|trans }}:
    - - + + {{ invoice.status | capitalize }}
    @@ -109,40 +110,40 @@
    -

    {% trans 'Company' %}

    +

    {{ 'Company'|trans }}

    {% if seller.company %} -
    {% trans 'Name' %}:
    +
    {{ 'Name'|trans }}:
    {{seller.company}}
    {% endif %} {% if seller.company_vat%} -
    {% trans 'VAT' %}:
    +
    {{ 'VAT'|trans }}:
    {{seller.company_vat}}
    {% endif %} {% if seller.address%} -
    {% trans 'Address' %}:
    +
    {{ 'Address'|trans }}:
    {{seller.address}}
    {% endif %} {% if seller.phone %} -
    {% trans 'Phone' %}:
    +
    {{ 'Phone'|trans }}:
    {{seller.phone}}
    {% endif %} {% if seller.email %} -
    {% trans 'Email' %}:
    +
    {{ 'Email'|trans }}:
    {{seller.email}}
    {% endif %} {% if seller.account_number %} -
    {% trans 'Account' %}:
    +
    {{ 'Account'|trans }}:
    {{seller.account_number}}
    {% endif %} {% if seller.note %} -
    {% trans 'Note' %}:
    +
    {{ 'Note'|trans }}:
    {{seller.note}}
    {% endif %}
    @@ -152,37 +153,37 @@
    -

    {% trans 'Billing & Delivery address' %}

    +

    {{ 'Billing & Delivery address'|trans }}

    {% if buyer.first_name or buyer.last_name %} -
    {% trans 'Name' %}:
    +
    {{ 'Name'|trans }}:
    {{buyer.first_name}} {{buyer.last_name}}
    {% endif %} {% if buyer.company %} -
    {% trans 'Company' %}:
    +
    {{ 'Company'|trans }}:
    {{buyer.company}}
    {% endif %} {% if buyer.company_number %} -
    {% trans 'Company number' %}:
    +
    {{ 'Company number'|trans }}:
    {{buyer.company_number}}
    {% endif %} {% if buyer.company_vat %} -
    {% trans 'Company VAT' %}:
    +
    {{ 'Company VAT'|trans }}:
    {{buyer.company_vat}}
    {% endif %} {% if buyer.address %} -
    {% trans 'Address' %}:
    +
    {{ 'Address'|trans }}:
    {{buyer.address}}
    {{buyer.city}}, {{buyer.state}}
    {{buyer.zip}}, {{guest.system_countries[buyer.country]}}
    {% endif %} {% if buyer.phone %} -
    {% trans 'Phone' %}:
    +
    {{ 'Phone'|trans }}:
    {{buyer.phone}}
    {% endif %}
    @@ -199,10 +200,10 @@ - - - - + + + + @@ -241,13 +242,13 @@ {% endif %} {% if invoice.discount > 0 %} - + {% endif %} - +
    {% trans '#' %}{% trans 'Title' %}{% trans 'Price' %}{% trans 'Total' %}{{ '#'|trans }}{{ 'Title'|trans }}{{ 'Price'|trans }}{{ 'Total'|trans }}
    {% trans 'Discount' %}{{ 'Discount'|trans }} {{ invoice.discount | money(invoice.currency) }}
    {% trans 'Total' %}{{ 'Total'|trans }} {{ invoice.total | money(invoice.currency) }}
    @@ -264,4 +265,4 @@
    - \ No newline at end of file + diff --git a/src/bb-modules/Invoice/html_client/mod_invoice_thankyou.phtml b/src/bb-modules/Invoice/html_client/mod_invoice_thankyou.phtml index 1f65a79d4..4280be79f 100644 --- a/src/bb-modules/Invoice/html_client/mod_invoice_thankyou.phtml +++ b/src/bb-modules/Invoice/html_client/mod_invoice_thankyou.phtml @@ -1,30 +1,27 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Thank you' %}{% endblock %} -{% block breadcrumb %}
  • {% trans 'Thank you' %}
  • {% endblock %} + +{% block meta_title %}{{ 'Thank you'|trans }}{% endblock %} +{% block breadcrumb %}
  • {{ 'Thank you'|trans }}
  • {% endblock %} {% block content %} -
    -
    -

    {% trans 'Thank you' %}

    -

    {% trans%}Your payment is being processed right now. It can take up 5 minutes to complete.{% endtrans %}

    +

    {{ 'Thank you'|trans }}

    +

    {{ 'Your payment is being processed right now. It can take up 5 minutes to complete.'|trans }}

    -

    {% trans %}Payment for invoice received{% endtrans %}

    - -

    {% trans%}You will be automatically redirected to invoice page after 5 minutes.{% endtrans %}

    +

    {{ 'Payment for invoice received'|trans }}

    +

    {{ 'You will be automatically redirected to invoice page after 5 minutes.'|trans }}

    - -
    - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Invoice/html_email/mod_invoice_payment_reminder.phtml b/src/bb-modules/Invoice/html_email/mod_invoice_payment_reminder.phtml index d64f37026..2802814ef 100644 --- a/src/bb-modules/Invoice/html_email/mod_invoice_payment_reminder.phtml +++ b/src/bb-modules/Invoice/html_email/mod_invoice_payment_reminder.phtml @@ -1,4 +1,5 @@ {% block subject %}[{{ guest.system_company.name }}] Payment Reminder{% endblock %} + {% block content %} {% apply markdown %} Hello {{ c.first_name }} {{ c.last_name }}, @@ -6,18 +7,17 @@ Hello {{ c.first_name }} {{ c.last_name }}, This is to remind that your proforma invoice **{{ invoice.serie_nr }}** is due in {{ invoice.due_at|daysleft }} days. -Amount due: {{ invoice.total | money(invoice.currency) }} +Amount due: {{ invoice.total|money(invoice.currency) }} Due Date: {{ invoice.due_at|bb_date }} -You can view and pay the invoice at: {{'invoice'|link}}/{{invoice.hash}} +You can view and pay the invoice at: {{ 'invoice'|link }}/{{ invoice.hash }} You may review your invoice history at any time by logging in to your client area. -Login to members area: {{'login'|link({'email' : c.email }) }} -View and manage invoices: {{'invoice'|link}} +Login to members area: {{ 'login'|link({ 'email': c.email }) }} +View and manage invoices: {{ 'invoice'|link }} {{ guest.system_company.signature }} - {% endapply %} {% endblock %} diff --git a/src/bb-modules/Kb/html_admin/mod_kb_article.phtml b/src/bb-modules/Kb/html_admin/mod_kb_article.phtml index 48ff51c20..525de81f7 100644 --- a/src/bb-modules/Kb/html_admin/mod_kb_article.phtml +++ b/src/bb-modules/Kb/html_admin/mod_kb_article.phtml @@ -1,28 +1,29 @@ {% extends "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'kb' %} -{% block meta_title %}{{ post.title}}{% endblock %} + +{% block meta_title %}{{ post.title }}{% endblock %} {% block breadcrumbs %} {% endblock %} {% block content %} -
    -
    {{ post.title}}
    -
    +
    - +
    @@ -31,13 +32,13 @@
    -
    {% trans 'Article details' %}
    +
    {{ 'Article details'|trans }}
    -
    +
    - +
    {{ mf.selectbox('kb_article_category_id', admin.kb_category_get_pairs, post.kb_article_category_id, 1) }}
    @@ -45,7 +46,7 @@
    - +
    @@ -53,7 +54,7 @@
    - +
    @@ -61,7 +62,7 @@
    - +
    @@ -69,7 +70,7 @@
    - +
    @@ -77,7 +78,7 @@
    - +
    @@ -88,4 +89,4 @@
    {% endblock %} -{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} \ No newline at end of file +{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} diff --git a/src/bb-modules/Kb/html_admin/mod_kb_category.phtml b/src/bb-modules/Kb/html_admin/mod_kb_category.phtml index c81e2a5c8..c4b1f4f8c 100644 --- a/src/bb-modules/Kb/html_admin/mod_kb_category.phtml +++ b/src/bb-modules/Kb/html_admin/mod_kb_category.phtml @@ -1,27 +1,27 @@ {% extends "layout_default.phtml" %} + {% set active_menu = 'support' %} -{% block meta_title %}{{ category.title}}{% endblock %} +{% block meta_title %}{{ category.title }}{% endblock %} {% block breadcrumbs %} {% endblock %} {% block content %}
    -
    {{ category.title}}
    -
    +
    - +
    @@ -29,7 +29,7 @@
    - +
    @@ -37,14 +37,14 @@
    - +
    - +
    diff --git a/src/bb-modules/Kb/html_admin/mod_kb_index.phtml b/src/bb-modules/Kb/html_admin/mod_kb_index.phtml index 903253e57..b3f8bf085 100644 --- a/src/bb-modules/Kb/html_admin/mod_kb_index.phtml +++ b/src/bb-modules/Kb/html_admin/mod_kb_index.phtml @@ -1,20 +1,19 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Knowledge Base' %}{% endblock %} +{% block meta_title %}{{ 'Knowledge Base'|trans }}{% endblock %} {% set active_menu = 'kb' %} + {% block content %} -
    -
    -
    @@ -22,10 +21,10 @@ - - - - + + + + @@ -46,7 +45,7 @@ {% else %} @@ -62,7 +61,7 @@
    - +
    {{ mf.selectbox('kb_article_category_id', admin.kb_category_get_pairs, request.kb_article_category_id, 1) }}
    @@ -70,7 +69,7 @@
    - +
    @@ -78,32 +77,32 @@
    - +
    - - + +
    - +
    - +
    -
    +
    - +
    @@ -111,14 +110,14 @@
    - +
    - +
    @@ -136,16 +135,13 @@ {% else %} - + {% endfor %}
    {% trans 'Title' %}{% trans 'Category' %}{% trans 'Status' %}{% trans 'Views' %}{{ 'Title'|trans }}{{ 'Category'|trans }}{{ 'Status'|trans }}{{ 'Views'|trans }}  
    - {% trans 'The list is empty' %} + {{ 'The list is empty'|trans }}
    {% trans 'The list is empty' %}{{ 'The list is empty'|trans }}
    -
    -
    - {% endblock %} diff --git a/src/bb-modules/Kb/html_client/mod_kb_article.phtml b/src/bb-modules/Kb/html_client/mod_kb_article.phtml index ca9ac9979..32f47fca7 100644 --- a/src/bb-modules/Kb/html_client/mod_kb_article.phtml +++ b/src/bb-modules/Kb/html_client/mod_kb_article.phtml @@ -1,28 +1,31 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{{article.title}}{% endblock %} +{% block meta_title %}{{ article.title }}{% endblock %} {% block breadcrumb %} -
  • {% trans 'Knowledge base' %} /
  • -
  • {{article.category.title}}/
  • -
  • {{article.title}}
  • +
  • + {{ 'Knowledge base'|trans }} / +
  • +
  • + {{ article.category.title }}/ +
  • +
  • {{ article.title }}
  • {% endblock %} {% block content %} -
    -

    {{article.title}}

    -
    {{article.created_at|bb_date }}
    -

    {% trans 'Article views' %}: {{ article.views }}

    +

    {{ article.title }}

    +
    {{ article.created_at|bb_date }}
    +

    {{ 'Article views'|trans }}: {{ article.views }}

    - {{article.content|bbmd}} + {{ article.content|bbmd }}
    -

    {% trans 'Back to list' %}

    +

    {{ 'Back to list'|trans }}

    @@ -31,18 +34,17 @@ {% endblock %} {% block content_after %} -
    -

    {%trans 'Similar articles' %}

    +

    {{ 'Similar articles'|trans }}

    @@ -52,12 +54,12 @@
    -

    {%trans 'Knowledge base categories'%}

    +

    {{ 'Knowledge base categories'|trans }}

    diff --git a/src/bb-modules/Kb/html_client/mod_kb_category.phtml b/src/bb-modules/Kb/html_client/mod_kb_category.phtml index 94959e783..b82d000f3 100644 --- a/src/bb-modules/Kb/html_client/mod_kb_category.phtml +++ b/src/bb-modules/Kb/html_client/mod_kb_category.phtml @@ -1,10 +1,10 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{{category.title}}{% endblock %} +{% block meta_title %}{{ category.title }}{% endblock %} {% block breadcrumb %} -
  • {% trans 'Knowledge base' %} /
  • -
  • {{category.title}}
  • +
  • {{ 'Knowledge base'|trans }} /
  • +
  • {{ category.title }}
  • {% endblock %} {% block content %} @@ -13,20 +13,20 @@
    - {% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Kb/html_client/mod_kb_index.phtml b/src/bb-modules/Kb/html_client/mod_kb_index.phtml index a28eb8c8c..5a01ca056 100644 --- a/src/bb-modules/Kb/html_client/mod_kb_index.phtml +++ b/src/bb-modules/Kb/html_client/mod_kb_index.phtml @@ -1,12 +1,11 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{%trans 'Knowledge base'%}{% endblock %} -{% block breadcrumb %}{%trans 'Knowledge base'%}{% endblock %} +{% block meta_title %}{{ 'Knowledge base'|trans }}{% endblock %} +{% block breadcrumb %}{{ 'Knowledge base'|trans }}{% endblock %} {% block content %} - {% if request.q %} - {% set kbcategories = guest.kb_category_get_list({"q": request.q}) %} + {% set kbcategories = guest.kb_category_get_list({ "q": request.q }) %} {% else %} {% set kbcategories = guest.kb_category_get_list %} {% endif %} @@ -16,13 +15,13 @@
    -

    {% trans 'Knowledge base' %}


    - {% trans 'Please try to read related topics in knowledge base before contacting support.' %} +

    {{ 'Knowledge base'|trans }}


    + {{ 'Please try to read related topics in knowledge base before contacting support.'|trans }}
    @@ -33,12 +32,14 @@ {% else %}

    - {% trans 'Try using other keyword. No matches found for keyword:' %} + {{ 'Try using other keyword. No matches found for keyword:'|trans }} {{ request.q }}

    {% endfor %} diff --git a/src/bb-modules/Massmailer/html_admin/mod_massmailer_index.phtml b/src/bb-modules/Massmailer/html_admin/mod_massmailer_index.phtml index 8cdeddf0e..49027386c 100644 --- a/src/bb-modules/Massmailer/html_admin/mod_massmailer_index.phtml +++ b/src/bb-modules/Massmailer/html_admin/mod_massmailer_index.phtml @@ -1,15 +1,17 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% block meta_title %}Mass mailer{% endblock %} + {% set active_menu = 'system' %} {% block content %}
    -
    @@ -21,15 +23,15 @@ - - - + + + - {% set msgs = admin.massmailer_get_list({"per_page":30, "page":request.page}|merge(request)) %} + {% set msgs = admin.massmailer_get_list({ "per_page": 30, "page": request.page }|merge(request)) %} {% for i, msg in msgs.list %} @@ -44,7 +46,7 @@ {% else %} {% endfor %} @@ -58,26 +60,24 @@
    - +
    - +
    - +
    -

    {% trans 'Mass Mail Settings' %}

    +

    {{ 'Mass Mail Settings'|trans }}

    {% set params = admin.extension_config_get({"ext":"mod_massmailer"}) %} - -
    - +
    @@ -93,30 +93,26 @@
    - +
    - +
    -
    - - {% endblock %} {% block js %} {% endblock %} diff --git a/src/bb-modules/Massmailer/html_admin/mod_massmailer_message.phtml b/src/bb-modules/Massmailer/html_admin/mod_massmailer_message.phtml index 2dc4da62d..58aac26c6 100644 --- a/src/bb-modules/Massmailer/html_admin/mod_massmailer_message.phtml +++ b/src/bb-modules/Massmailer/html_admin/mod_massmailer_message.phtml @@ -1,31 +1,32 @@ {% extends "layout_default.phtml" %} -{% block meta_title %}{{ msg.subject}}{% endblock %} + +{% block meta_title %}{{ msg.subject }}{% endblock %} + {% set active_menu = 'system' %} {% block content %}
    -
    -
    {% trans 'Send Email Message' %} - {{ msg.subject}}
    +
    {{ 'Send Email Message'|trans }} - {{ msg.subject }}
    - +
      -
    • +
    • -
    • +
    - +
    @@ -35,15 +36,15 @@
    - {% trans 'Recipients filter. Select none to send message to all clients' %} + {{ 'Recipients filter. Select none to send message to all clients'|trans }}
    - +
    {% for id,label in admin.order_get_status_pairs %} @@ -74,7 +75,7 @@
    - {% trans 'Message content' %} + {{ 'Message content'|trans }}
    @@ -88,33 +89,31 @@
    - - - + + +
    - +
    - {% endblock %} {% block js %} {% autoescape "js" %} {% endautoescape %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/News/html_admin/mod_news_index.phtml b/src/bb-modules/News/html_admin/mod_news_index.phtml index aff48f6a6..3953b2e39 100644 --- a/src/bb-modules/News/html_admin/mod_news_index.phtml +++ b/src/bb-modules/News/html_admin/mod_news_index.phtml @@ -1,18 +1,19 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% set active_menu = 'support' %} -{% block meta_title %}{% trans 'News' %}{% endblock %} + +{% block meta_title %}{{ 'News'|trans }}{% endblock %} {% block content %} - - - + + + - {% set posts = admin.news_get_list({"per_page":30, "page":request.page}|merge(request)) %} + {% set posts = admin.news_get_list({ "per_page": 30, "page": request.page }|merge(request)) %} {% for i, post in posts.list %} @@ -38,46 +39,47 @@ - {% else %} {% endfor %}
    {% trans 'Subject' %}{% trans 'From' %}{% trans 'Status' %}{{ 'Subject'|trans }}{{ 'From'|trans }}{{ 'Status'|trans }}  
    {{ msg.subject }}
    - {% trans 'The list is empty' %} + {{ 'The list is empty'|trans }}
    {% trans 'Title' %}{% trans 'Active' %}{% trans 'Date' %}{{ 'Title'|trans }}{{ 'Active'|trans }}{{ 'Date'|trans }}  
    {{ mf.status_name(post.status) }} {{ post.created_at|bb_datetime }} - - + + + + + +
    - {% trans 'The list is empty' %} + {{ 'The list is empty'|trans }}
    - {% include "partial_pagination.phtml" with {'list': posts, 'url':'news/index'} %} - {% include "partial_batch_delete.phtml" with {'action' : 'admin/news/batch_delete'} %} - + {% include "partial_pagination.phtml" with { 'list': posts, 'url': 'news/index' } %} + {% include "partial_batch_delete.phtml" with { 'action': 'admin/news/batch_delete' } %}
    -
    - +
    - +
    - - + +
    - +

    If the text is very long you can use <!--more--> tag. Inserting this tag within the post will create and excerpt of text (before the tag) to be displayed in posts list. Users will be able to see whole content when they click on "Read more" button.


    @@ -85,14 +87,13 @@
    - +
    - {% endblock %} -{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} \ No newline at end of file +{% block head %}{{ mf.bb_editor('.bb-textarea') }}{% endblock %} diff --git a/src/bb-modules/News/html_admin/mod_news_post.phtml b/src/bb-modules/News/html_admin/mod_news_post.phtml index b2c088649..57585da9b 100644 --- a/src/bb-modules/News/html_admin/mod_news_post.phtml +++ b/src/bb-modules/News/html_admin/mod_news_post.phtml @@ -1,31 +1,33 @@ {% extends "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{{post.title}}{% endblock %} + +{% block meta_title %}{{ post.title }}{% endblock %} + {% set active_menu = 'support' %} {% block breadcrumbs %} {% endblock %} {% block content %}
    -
    -
    {{post.title}}
    +
    {{ post.title }}
    Edit post

    If the text is very long you can use <!--more--> tag. Inserting this tag within the post will create and excerpt of text (before the tag) to be displayed in posts list. Users will be able to see whole content when they click on "Read more" button.

    -
    +
    - +
    @@ -34,13 +36,13 @@
    -
    {{post.title}}
    +
    {{ post.title }}
    -
    +
    - +
    @@ -48,7 +50,7 @@
    - +
    @@ -56,21 +58,21 @@
    - +
    - +
    - +
    - +
    @@ -78,25 +80,25 @@
    - +
    - +
    - +
    {% endblock %} diff --git a/src/bb-modules/News/html_client/mod_news_index.phtml b/src/bb-modules/News/html_client/mod_news_index.phtml index 8abe2d37f..50fa5fa75 100644 --- a/src/bb-modules/News/html_client/mod_news_index.phtml +++ b/src/bb-modules/News/html_client/mod_news_index.phtml @@ -1,7 +1,7 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} -{% block meta_title %}{% trans 'Blog'%}{% endblock %} -{% block breadcrumb %}{% trans 'Blog'%}{% endblock %} +{% block meta_title %}{{ 'Blog'|trans }}{% endblock %} +{% block breadcrumb %}{{ 'Blog'|trans }}{% endblock %} {% block content %}
    @@ -9,16 +9,16 @@
    -

    {% trans 'News & Announcements' %}

    -

    {% trans 'Track our latest information.' %}

    +

    {{ 'News & Announcements'|trans }}

    +

    {{ 'Track our latest information.'|trans }}

    - {% set posts = guest.news_get_list({"page":request.page,"per_page": 5}) %} + {% set posts = guest.news_get_list({ "page": request.page, "per_page": 5 }) %} {% for i, post in posts.list %}
    -

    {{post.title}}

    -
    {{post.updated_at|bb_date}}
    +

    {{ post.title }}

    +
    {{ post.updated_at|bb_date }}
    {% if post.excerpt %} @@ -27,15 +27,14 @@ {{ post.content|bbmd }} {% endif %}
    - {% trans 'Read more ...' %} + {{ 'Read more ...'|trans }}
    {% else %}

    The list is empty

    {% endfor %}
    - {% include "partial_pagination.phtml" with {'list': posts} %} + {% include "partial_pagination.phtml" with { 'list': posts } %}
    - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/News/html_client/mod_news_post.phtml b/src/bb-modules/News/html_client/mod_news_post.phtml index d98e160a0..223dc4cfc 100644 --- a/src/bb-modules/News/html_client/mod_news_post.phtml +++ b/src/bb-modules/News/html_client/mod_news_post.phtml @@ -4,25 +4,23 @@ {% block meta_description %}{{ post.description }}{% endblock %} {% block breadcrumb %} -
  • {% trans 'Blog' %}/
  • +
  • {{ 'Blog'|trans }}/
  • {{post.title}}
  • {% endblock %} {% block opengraph %} - - + - {% if post.published_at %}{% endif %} - {% if post.updated_at %}{% endif %} - {% if post.expires_at %}{% endif %} + {% if post.published_at %}{% endif %} + {% if post.updated_at %}{% endif %} + {% if post.expires_at %}{% endif %} {% if post.section %}{% endif %} {% if post.tags %}{% endif %} - {% endblock %} {% block content %} @@ -31,22 +29,21 @@

    {{post.title}}

    -
    {{post.created_at|bb_date}}
    -

    {% trans 'by '%} {{ post.author.name }}

    +
    {{ post.created_at|bb_date }}
    +

    {{ 'by '|trans }} {{ post.author.name }}

    - {% if post.image %}{{post.title}}{% endif %} + {% if post.image %}{{ post.title }}{% endif %} {{ post.content|bbmd }} {# if post.tags %}Tags: {{ post.tags|join(', ') }}{% endif #} - {% if guest.extension_is_on({"mod":"comment"}) %}{% include "mod_comment_block.phtml" %}{% endif %} + {% if guest.extension_is_on({ "mod": "comment" }) %}{% include "mod_comment_block.phtml" %}{% endif %}
    -

    {% trans 'Back to list' %}

    +

    {{ 'Back to list'|trans }}

    - {% endblock %} {# block sidebar2 %} @@ -54,14 +51,14 @@
    -

    {% trans 'Other recent posts' %}

    +

    {{ 'Other recent posts'|trans }}

    @@ -69,4 +66,4 @@
    -{% endblock #} \ No newline at end of file +{% endblock #} diff --git a/src/bb-modules/Notification/html_admin/mod_notification_index.phtml b/src/bb-modules/Notification/html_admin/mod_notification_index.phtml index 7ed4f5b29..62009f9ab 100644 --- a/src/bb-modules/Notification/html_admin/mod_notification_index.phtml +++ b/src/bb-modules/Notification/html_admin/mod_notification_index.phtml @@ -1,13 +1,16 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} + {% block meta_title %}Notifications center{% endblock %} + {% set active_menu = 'activity' %} {% block content %}
    @@ -19,26 +22,26 @@ - - + + - {% set events = admin.notification_get_list({"per_page":10, "page":request.page}|merge(request)) %} + {% set events = admin.notification_get_list({ "per_page": 10, "page": request.page }|merge(request)) %} {% for i, event in events.list %} - + {% else %} {% endfor %} @@ -48,7 +51,7 @@ {% include "partial_pagination.phtml" with {'list': events, 'url':'notification'} %} @@ -58,16 +61,15 @@
    - +
    - +
    - {% endblock %} diff --git a/src/bb-modules/Order/html_admin/mod_order_settings.phtml b/src/bb-modules/Order/html_admin/mod_order_settings.phtml index 3a2fec5a6..c58be6565 100644 --- a/src/bb-modules/Order/html_admin/mod_order_settings.phtml +++ b/src/bb-modules/Order/html_admin/mod_order_settings.phtml @@ -1,86 +1,86 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Orders settings' %}{% endblock %} + +{% block meta_title %}{{ 'Orders settings'|trans }}{% endblock %} + {% set active_menu = 'system' %} {% block breadcrumbs %} {% endblock %} {% block content %} -
    -
    {% trans 'Orders settings' %}
    +
    {{ 'Orders settings'|trans }}
    {% set params = admin.extension_config_get({"ext":"mod_order"}) %}
    -
    - -
    - -
    - -
    - +
    + +
    + +
    + +
    + +
    +
    -
    -
    - -
    - -
    - - -
    -
    -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
      -
    • - -
    • -
    • -
    • days after order suspension with reason
    • -
    • -
    -
    -
    -
    - + +
    + + +
    +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
      +
    • + +
    • +
    • +
    • days after order suspension with reason
    • +
    • +
    +
    +
    +
    + +
    +
    - - +
    - -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Order/html_client/mod_order_index.phtml b/src/bb-modules/Order/html_client/mod_order_index.phtml index 28810dad9..c57daa279 100644 --- a/src/bb-modules/Order/html_client/mod_order_index.phtml +++ b/src/bb-modules/Order/html_client/mod_order_index.phtml @@ -1,21 +1,21 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Order' %}{% endblock %} + +{% block meta_title %}{{ 'Order'|trans }}{% endblock %} {% set loader_nr = request.loader | default("8")%} {% set loader_url = ('img/assets/loaders/loader'~loader_nr~'.gif') %} -{% block content_before %} -{% endblock %} +{% block content_before %}{% endblock %} {% block content %} -
    -

    {% trans 'Select Product' %}

    -

    {% trans 'Choose products we offer for selling' %}

    +

    {{ 'Select Product'|trans }}

    +

    {{ 'Choose products we offer for selling'|trans }}

    @@ -32,7 +32,6 @@ {% block js %} {% autoescape "js" %} - {% endautoescape %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/bb-modules/Order/html_client/mod_order_product.phtml b/src/bb-modules/Order/html_client/mod_order_product.phtml index dd24bd3f8..308de27e8 100644 --- a/src/bb-modules/Order/html_client/mod_order_product.phtml +++ b/src/bb-modules/Order/html_client/mod_order_product.phtml @@ -1,25 +1,25 @@ {% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %} + {% import "macro_functions.phtml" as mf %} -{% block meta_title %}{% trans 'Order' %}{% endblock %} + +{% block meta_title %}{{ 'Order'|trans }}{% endblock %} {% set loader_nr = request.loader | default("8")%} {% set loader_url = ('img/assets/loaders/loader'~loader_nr~'.gif') %} -{% block content_before %} -{% endblock %} +{% block content_before %}{% endblock %} {% block content %} -
    -

    {% trans 'Select Product' %}

    -

    {% trans 'Choose products we offer for selling' %}

    +

    {{ 'Select Product'|trans }}

    +

    {{ 'Choose products we offer for selling'|trans }}

    - -
    {% trans 'Message' %}{% trans 'Date' %}{{ 'Message'|trans }}{{ 'Date'|trans }}  
    {{ admin.system_string_render({"_tpl": event.meta_value, "_try":true })|raw }}{{ admin.system_string_render({ "_tpl": event.meta_value, "_try": true })|raw }} {{ event.created_at|date('Y-m-d H:i') }} - +
    - {% trans 'The list is empty' %} + {{ 'The list is empty'|trans }}