Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tooltips for warnings in staffcp compatibility box #3510

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions custom/panel_templates/Default/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,22 @@
{$NAMELESS_VERSION}
<hr />
{foreach from=$COMPAT_SUCCESS item=item}
<i class="fas fa-check-circle text-success"></i> {$item}
<br />
<i class="fas fa-check-circle text-success"></i> {$item}
<br />
{/foreach}
{if count($COMPAT_WARNINGS)}
<hr />
{foreach from=$COMPAT_WARNINGS item=item}
<i class="fas fa-check-circle text-warning"></i> {$item}
<br />
{/foreach}
<hr />
{foreach from=$COMPAT_WARNINGS item=item key=index}
<i class="fas fa-check-circle text-warning"></i> {$item}
{if isset($COMPAT_WARNINGS_INFO[$index])}
<span class="badge badge-info">
<i class="fas fa-question-circle" data-container="body" data-toggle="popover"
data-placement="top" title="{$INFO}"
data-content="{$COMPAT_WARNINGS_INFO[$index]}"></i>
</span>
{/if}
<br />
{/foreach}
{/if}
{if count($COMPAT_ERRORS)}
<hr />
Expand Down
2 changes: 2 additions & 0 deletions modules/Core/language/en_UK.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
"admin/clone_group": "Clone group",
"admin/closable": "Closable",
"admin/communications": "Communications",
"admin/compat_pdo_version_info": "Either MySQL version {{mysql}} or MariaDB version {{mariadb}} is recommended.",
"admin/compat_php_version_info": "PHP version {{php}} is recommended.",
"admin/config_not_writable": "Your core\/config.php file is not writable. Please check file permissions.",
"admin/configuration": "Configuration",
"admin/confirm_api_regen": "Are you sure you want to regenerate your API key?",
Expand Down
12 changes: 12 additions & 0 deletions modules/Core/pages/panel/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@
if ($user->hasPermission('admincp.core.debugging')) {
$compat_success = [];
$compat_warnings = [];
$compat_warnings_help = [];
$compat_errors = [];

if (PHP_VERSION_ID < 80200) {
$compat_warnings[] = 'PHP ' . PHP_VERSION;
$compat_warnings_help[] = $language->get('admin', 'compat_php_version_info', ['php' => '8.0+']);
} else {
$compat_success[] = 'PHP ' . PHP_VERSION;
}
Expand Down Expand Up @@ -179,9 +181,16 @@
if (($pdo_driver === 'MySQL' && version_compare($pdo_server_version, '8.0', '>=')) ||
($pdo_driver === 'MariaDB' && version_compare($pdo_server_version, '10.5', '>='))) {
$compat_success[] = $pdo_driver . ' Server ' . $pdo_server_version;

} else if (($pdo_driver === 'MySQL' && version_compare($pdo_server_version, '5.7', '>=')) ||
($pdo_driver === 'MariaDB' && version_compare($pdo_server_version, '10.3', '>='))) {
$compat_warnings[] = $pdo_driver . ' Server ' . $pdo_server_version;
$compat_warnings_help[] = $language->get(
'admin',
'compat_pdo_version_info',
['mysql' => '8.0+', 'mariadb' => '10.5+']
);

} else {
$compat_errors[] = $pdo_driver . ' Server ' . $pdo_server_version;
}
Expand All @@ -207,12 +216,14 @@
$compat_warnings[] = $language->get('admin', 'panel_template_third_party', [
'name' => Text::bold($template->getName()),
]);
$compat_warnings_help[] = null;
}

$smarty->assign([
'SERVER_COMPATIBILITY' => $language->get('admin', 'server_compatibility'),
'COMPAT_SUCCESS' => $compat_success,
'COMPAT_WARNINGS' => $compat_warnings,
'COMPAT_WARNINGS_INFO' => $compat_warnings_help,
'COMPAT_ERRORS' => $compat_errors,
]);
}
Expand Down Expand Up @@ -248,6 +259,7 @@
'NAMELESS_VERSION' => $language->get('admin', 'running_nameless_version', [
'version' => Text::bold(NAMELESS_VERSION)
]),
'INFO' => $language->get('general', 'info'),
]);

$template->onPageLoad();
Expand Down
Loading