Disable mail setting when imap support is disabled

This commit is contained in:
Michael 2021-08-30 21:17:03 +00:00
parent 221c6c4f2a
commit 3944e5d38e
3 changed files with 22 additions and 4 deletions

View file

@ -560,7 +560,9 @@ class Site extends BaseAdmin
'$no_regfullname' => ['no_regfullname', DI::l10n()->t('No Fullname check'), DI::config()->get('system', 'no_regfullname'), DI::l10n()->t('Allow users to register without a space between the first name and the last name in their full name.')],
'$community_page_style' => ['community_page_style', DI::l10n()->t('Community pages for visitors'), DI::config()->get('system', 'community_page_style'), DI::l10n()->t('Which community pages should be available for visitors. Local users always see both pages.'), $community_page_style_choices],
'$max_author_posts_community_page' => ['max_author_posts_community_page', DI::l10n()->t('Posts per user on community page'), DI::config()->get('system', 'max_author_posts_community_page'), DI::l10n()->t('The maximum number of posts per user on the community page. (Not valid for "Global Community")')],
'$mail_able' => function_exists('imap_open'),
'$mail_enabled' => ['mail_enabled', DI::l10n()->t('Enable Mail support'), !DI::config()->get('system', 'imap_disabled', !function_exists('imap_open')), DI::l10n()->t('Enable built-in mail support to poll IMAP folders and to reply via mail.')],
'$mail_not_able' => DI::l10n()->t('Mail support can\'t be enabled because the PHP IMAP module is not installed.'),
'$ostatus_enabled' => ['ostatus_enabled', DI::l10n()->t('Enable OStatus support'), !DI::config()->get('system', 'ostatus_disabled'), DI::l10n()->t('Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All communications in OStatus are public.')],
'$diaspora_able' => $diaspora_able,
'$diaspora_not_able' => DI::l10n()->t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'),

View file

@ -56,7 +56,15 @@
{{include file="field_select.tpl" field=$community_page_style}}
{{include file="field_input.tpl" field=$max_author_posts_community_page}}
{{include file="field_checkbox.tpl" field=$mail_enabled}}
{{if $mail_able}}
{{include file="field_checkbox.tpl" field=$mail_enabled}}
{{else}}
<div class='field checkbox' id='div_id_{{$mail_enabled.0}}'>
<label for='id_{{$mail_enabled.0}}'>{{$mail_enabled.1}}</label>
<span class="field_help" role="tooltip" id="id_{{$mail_enabled.0}}">{{$mail_not_able}}</span>
</div>
{{/if}}
{{include file="field_checkbox.tpl" field=$ostatus_enabled}}
{{if $diaspora_able}}
@ -64,7 +72,7 @@
{{else}}
<div class='field checkbox' id='div_id_{{$diaspora_enabled.0}}'>
<label for='id_{{$diaspora_enabled.0}}'>{{$diaspora_enabled.1}}</label>
<span id='id_{{$diaspora_enabled.0}}'>{{$diaspora_not_able}}</span>
<span class="field_help" role="tooltip" id="id_{{diaspora_enabled.0}}">{{$diaspora_not_able}}</span>
</div>
{{/if}}
{{include file="field_input.tpl" field=$global_directory}}

View file

@ -135,7 +135,15 @@
{{include file="field_select.tpl" field=$community_page_style}}
{{include file="field_input.tpl" field=$max_author_posts_community_page}}
{{include file="field_checkbox.tpl" field=$mail_enabled}}
{{if $mail_able}}
{{include file="field_checkbox.tpl" field=$mail_enabled}}
{{else}}
<div class="field checkbox" id="div_id_{{$mail_enabled.0}}">
<label for="id_{{$mail_enabled.0}}">{{$mail_enabled.1}}</label>
<span class="help-block" id="id_{{$mail_enabled.0}}" role="tooltip">{{$mail_not_able}}</span>
</div>
{{/if}}
{{include file="field_checkbox.tpl" field=$ostatus_enabled}}
{{if $diaspora_able}}
@ -143,7 +151,7 @@
{{else}}
<div class="field checkbox" id="div_id_{{$diaspora_enabled.0}}">
<label for="id_{{$diaspora_enabled.0}}">{{$diaspora_enabled.1}}</label>
<span id="id_{{$diaspora_enabled.0}}">{{$diaspora_not_able}}</span>
<span class="help-block" id="id_{{$diaspora_enabled.0}}" role="tooltip">{{$diaspora_not_able}}</span>
</div>
{{/if}}
{{include file="field_input.tpl" field=$global_directory}}