Skip to content

Commit

Permalink
FIX: Show Documentation URL if KB v1.2.25+ Installed
Browse files Browse the repository at this point in the history
 - fixes #16
  • Loading branch information
aljawaid committed Aug 18, 2023
1 parent c97779a commit 200be52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
14 changes: 4 additions & 10 deletions Helper/ApplicationBrandingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,17 @@
class ApplicationBrandingHelper extends Base
{
/**
* Get Help Docs
* Get Help Docs - Helper to generate a link to the documentation
*
* @see about.php
* @see UrlHelper.php
* @access public
* @return string
*/
public function getDocs($label, $file)
public function getDocs($label, $file = '')
{
$version = 'latest';
$url = sprintf(DOCUMENTATION_URL_PATTERN, $file);

if (substr(APP_VERSION, 0, 1) === 'v') {
$version = substr(APP_VERSION, 1);
} elseif (ctype_digit(substr(APP_VERSION, 0, 1))) {
$version = APP_VERSION;
}

$url = sprintf(DOCUMENTATION_URL_PATTERN, $version, $file);
return sprintf('
<a href="%s" class="channels-link" title="' . t('Opens in a new window') . '" rel="noopener noreferrer" target="_blank">
<div class="icon-wrapper wrapper-docs">
Expand Down
8 changes: 5 additions & 3 deletions Template/config/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@
<span class="channels-name"><?= t('Website') ?></span>
</a>
</div>
<div class="channels-wrapper">
<?= $this->helper->applicationBrandingHelper->getDocs(t('Documentation'), 'index') ?>
</div>
<?php if (APP_VERSION > '1.2.25'): ?>
<div class="channels-wrapper">
<?= $this->helper->applicationBrandingHelper->getDocs(t('Documentation')) ?>
</div>
<?php endif ?>
<div class="channels-wrapper">
<a href="https://kanboard.org/plugins.html" class="channels-link" title="<?= t('Opens in a new window') ?>" rel="noopener noreferrer" target="_blank">
<div class="icon-wrapper wrapper-plugins">
Expand Down

0 comments on commit 200be52

Please sign in to comment.