|
ob_get_clean(), 'script' => $javascript];
}
#[\ReturnTypeWillChange]
diff --git a/system/settings.php b/system/settings.php
index 4c0c410f..b40fd1fe 100644
--- a/system/settings.php
+++ b/system/settings.php
@@ -116,7 +116,10 @@ return [
'name' => 'Visitors Counter TTL',
'type' => 'number',
'desc' => 'Time To Live for Visitors Counter. In other words - how long user will be marked as online. In Minutes',
- 'default' => 10
+ 'default' => 10,
+ 'only_if' => [
+ 'visitors_counter'=> '=', 'true'
+ ]
],
'views_counter' => [
'name' => 'Views Counter',
@@ -190,12 +193,39 @@ return [
'type' => 'boolean',
'desc' => 'Is AAC configured to send e-mails?',
'default' => false,
+ /*'script' => <<<'SCRIPT'
+
+SCRIPT,*/
],
'mail_address' => [
'name' => 'Mail Address',
'type' => 'email',
'desc' => 'Server e-mail address (from:)',
'default' => 'no-reply@your-server.org',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ],
],
/*'mail_admin' => [
'name' => 'Mail Admin Address',
@@ -210,6 +240,9 @@ return [
'default' => '--
Sent by MyAAC,
https://my-aac.org',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'mail_signature_html' => [
'name' => 'Mail Signature (HTML)',
@@ -218,10 +251,16 @@ https://my-aac.org',
'default' => escapeHtml('
Sent by MyAAC,
my-aac.org'),
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
- [
+ 'section_smtp' => [
'type' => 'section',
- 'title' => 'SMTP (Mail Server)'
+ 'title' => 'SMTP (Mail Server)',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'mail_option' => [
'name' => 'Mail Option',
@@ -229,36 +268,54 @@ Sent by MyAAC,
'options' => [0 => 'Mail (PHP Built-in)', 1 => 'SMTP (Gmail or Microsoft Outlook)'],
'desc' => 'Mail sender. Set to SMTP if using Gmail or Microsoft Outlook, or any other provider',
'default' => 0,
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_host' => [
'name' => 'SMTP Host',
'type' => 'text',
'desc' => 'SMTP mail host. smtp.gmail.com for GMail / smtp-mail.outlook.com for Microsoft Outlook',
'default' => '',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_port' => [
'name' => 'SMTP Host',
'type' => 'number',
'desc' => '25 (default) / 465 (ssl, GMail) / 587 (tls, Microsoft Outlook)',
'default' => 25,
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_auth' => [
'name' => 'SMTP Auth',
'type' => 'boolean',
'desc' => 'Need authorization for Server? In normal situation, almost always Yes.',
'default' => true,
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_user' => [
'name' => 'SMTP Username',
'type' => 'text',
'desc' => 'Here your email username to authenticate with SMTP',
'default' => 'admin@example.org',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_pass' => [
'name' => 'SMTP Password',
'type' => 'password',
'desc' => 'Here your email password to authenticate with SMTP',
'default' => '',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_security' => [
'name' => 'SMTP Security',
@@ -266,12 +323,18 @@ Sent by MyAAC,
'options' => ['None', 'SSL', 'TLS'],
'desc' => 'What kind of encryption to use on the SMTP connection',
'default' => '',
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
'smtp_debug' => [
'name' => 'SMTP Debug',
'type' => 'boolean',
'desc' => 'Activate to see more logs about mailing errors in error.log',
'default' => false,
+ 'show_if' => [
+ 'mail_enabled', '=', 'true'
+ ]
],
[
'type' => 'category',
diff --git a/system/templates/admin.settings.html.twig b/system/templates/admin.settings.html.twig
index 4e268ffd..0cc39f50 100644
--- a/system/templates/admin.settings.html.twig
+++ b/system/templates/admin.settings.html.twig
@@ -11,10 +11,50 @@
- {{ settings|raw }}
+ {{ settingsParsed|raw }}
+
|