mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-21 02:17:34 +00:00
make docs url dynamic based on (night/testing) version
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
parent
73182a6909
commit
cda0b3116f
@ -72,7 +72,7 @@ if ($page == 'overview' || $page == 'domains') {
|
||||
}
|
||||
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/domains/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/domains/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
|
@ -77,7 +77,7 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
}
|
||||
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/emails/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/emails/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
@ -139,7 +139,7 @@ if ($page == 'email_domain') {
|
||||
];
|
||||
}
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/emails/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/emails/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
|
@ -75,7 +75,7 @@ if ($page == 'overview' || $page == 'htpasswds') {
|
||||
];
|
||||
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/extras/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/extras/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
@ -200,7 +200,7 @@ if ($page == 'overview' || $page == 'htpasswds') {
|
||||
];
|
||||
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/extras/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/extras/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
@ -349,7 +349,7 @@ if ($page == 'overview' || $page == 'htpasswds') {
|
||||
|
||||
$actions_links = [
|
||||
[
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/extras/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/extras/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
|
@ -65,7 +65,7 @@ if ($page == 'overview' || $page == 'accounts') {
|
||||
];
|
||||
}
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/ftp-accounts/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/ftp-accounts/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
|
@ -89,7 +89,7 @@ if ($page == 'overview' || $page == 'mysqls') {
|
||||
}
|
||||
|
||||
$actions_links[] = [
|
||||
'href' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/databases/',
|
||||
'href' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/databases/',
|
||||
'target' => '_blank',
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'class' => 'btn-outline-secondary'
|
||||
|
@ -39,7 +39,7 @@ final class Froxlor
|
||||
// Distribution branding-tag (used for Debian etc.)
|
||||
const BRANDING = '';
|
||||
|
||||
const DOCS_URL = 'https://docs.froxlor.org/v2.2/';
|
||||
const DOCS_URL = 'https://docs.froxlor.org';
|
||||
|
||||
/**
|
||||
* return path to where froxlor is installed, e.g.
|
||||
@ -52,6 +52,14 @@ final class Froxlor
|
||||
return dirname(__DIR__, 2) . '/';
|
||||
}
|
||||
|
||||
public static function getDocsUrl(): string
|
||||
{
|
||||
if (preg_match('/(.+)-(dev|beta|rc)\d+$/', self::VERSION)) {
|
||||
return self::DOCS_URL . '/dev/';
|
||||
}
|
||||
return self::DOCS_URL . '/v' . self::getShortVersion() . '/';
|
||||
}
|
||||
|
||||
/**
|
||||
* return basic version
|
||||
*
|
||||
@ -62,6 +70,16 @@ final class Froxlor
|
||||
return self::VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* return short basic version
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getShortVersion(): string
|
||||
{
|
||||
return explode(".", self::VERSION)[0] . '.' . explode(".", self::VERSION)[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* return version + branding and database-version
|
||||
*
|
||||
|
@ -161,13 +161,13 @@ return [
|
||||
'show_element' => (!Settings::IsInList('panel.customer_hide_options', 'misc.documentation')),
|
||||
'elements' => [
|
||||
[
|
||||
'url' => \Froxlor\Froxlor::DOCS_URL . 'user-guide/',
|
||||
'url' => \Froxlor\Froxlor::getDocsUrl() . 'user-guide/',
|
||||
'label' => lng('admin.userguide'),
|
||||
'new_window' => true,
|
||||
'is_external' => true,
|
||||
],
|
||||
[
|
||||
'url' => \Froxlor\Froxlor::DOCS_URL . 'api-guide/',
|
||||
'url' => \Froxlor\Froxlor::getDocsUrl() . 'api-guide/',
|
||||
'label' => lng('admin.apiguide'),
|
||||
'new_window' => true,
|
||||
'show_element' => Settings::Get('api.enabled') == 1 && CurrentUser::getField('api_allowed') == 1,
|
||||
@ -348,13 +348,13 @@ return [
|
||||
'icon' => 'fa-solid fa-circle-info',
|
||||
'elements' => [
|
||||
[
|
||||
'url' => \Froxlor\Froxlor::DOCS_URL . 'admin-guide/',
|
||||
'url' => \Froxlor\Froxlor::getDocsUrl() . 'admin-guide/',
|
||||
'label' => lng('admin.adminguide'),
|
||||
'new_window' => true,
|
||||
'is_external' => true,
|
||||
],
|
||||
[
|
||||
'url' => \Froxlor\Froxlor::DOCS_URL . 'api-guide/',
|
||||
'url' => \Froxlor\Froxlor::getDocsUrl() . 'api-guide/',
|
||||
'label' => lng('admin.apiguide'),
|
||||
'new_window' => true,
|
||||
'show_element' => Settings::Get('api.enabled') == 1,
|
||||
|
Loading…
Reference in New Issue
Block a user