Skip to content
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
2 changes: 1 addition & 1 deletion app/helpers/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static function completeUrl($path)
// returns the piwik versions that can be chosen via the selector
public static function getAvailablePiwikVersions()
{
return range(2, LATEST_PIWIK_DOCS_VERSION);
return range(3, LATEST_PIWIK_DOCS_VERSION);
}

public static function getPiwikVersion()
Expand Down
Binary file modified app/public/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions app/routes/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ function initView($app)
{
$app->hook('slim.before.dispatch', function () use ($app) {
$app->view->setData('urlIfAvailableInNewerVersion', false);
$availableVersions = Environment::getAvailablePiwikVersions();

if (!Environment::isLatestPiwikVersion()) {
$app->view->setData('urlIfAvailableInNewerVersion', getUrlIfDocumentIsAvailableInPiwikVersion($app, LATEST_PIWIK_DOCS_VERSION));
$matomoVersion = Environment::getPiwikVersion();
$alternativeUrl = getUrlIfDocumentIsAvailableInPiwikVersion($app, LATEST_PIWIK_DOCS_VERSION);

if (in_array($matomoVersion, $availableVersions)) {
$app->view->setData('urlIfAvailableInNewerVersion', $alternativeUrl);
} else {
// redirect to newest version
//$app->response->redirect($alternativeUrl, 301);
// exit;
$app->view->setData('urlIfAvailableInNewerVersion', $alternativeUrl);
}
}

$app->view->setData('availablePiwikVersions', Environment::getAvailablePiwikVersions());
$app->view->setData('availablePiwikVersions', $availableVersions);
$app->view->setData('selectedPiwikVersion', Environment::getPiwikVersion());
$app->view->setData('latestPiwikDocsVersion', LATEST_PIWIK_DOCS_VERSION);
$app->view->setData('revision', Git::getCurrentShortRevision());
Expand Down
4 changes: 3 additions & 1 deletion app/templates/base.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand hidden-sm" href="{{ '/'|completeUrl }}"><img height="20" width="109" src="/img/logo.png"/></a>
<a class="navbar-brand hidden-sm" href="{{ '/'|completeUrl }}"><img height="20" width="124" src="/img/logo.png"/></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
Expand All @@ -50,6 +50,7 @@
<a href="{{ '/support'|completeUrl }}">Support</a>
</li>
</ul>
{% if availablePiwikVersions|length > 1 %}
<ul class="nav navbar-nav pull-right">
<li>
<div id="quick-search-typeahead">
Expand All @@ -70,6 +71,7 @@
</div>
</li>
</ul>
{% endif %}
</div>
</div>
</div>
Expand Down