Skip to content

Commit

Permalink
Merge branch 'release/2.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed May 1, 2020
2 parents d6b61e3 + 233faa8 commit 9e4cf11
Show file tree
Hide file tree
Showing 16 changed files with 388 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.4.1

* Add Redirect Extensions promo page

# 2.4.0

* Skip requests with header "X-Requested-With: XMLHttpRequest"
Expand Down
9 changes: 9 additions & 0 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ public function registerNavigation(): array
'vdlp.redirect.access_redirects',
],
],
'extensions' => [
'label' => 'vdlp.redirect::lang.buttons.extensions',
'url' => Backend::url('vdlp/redirect/extensions'),
'icon' => 'icon-cubes',
'order' => 100,
'permissions' => [
'vdlp.redirect.access_redirects',
],
]
],
],
];
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# Vdlp.Redirect
<p align="center">
<img height="60px" width="60px" src="https://plugins.vdlp.nl/octobercms/icons/Vdlp.Redirect.svg" >
<h1 align="center">Vdlp.Redirect</h1>
</p>

<p align="center">
<em>Manage all your HTTP redirects with an easy to use GUI. This is an essential SEO plugin.</em>
</p>

<p align="center">
<img src="https://badgen.net/packagist/php/vdlp/oc-redirect-plugin">
<img src="https://badgen.net/packagist/license/vdlp/oc-redirect-plugin">
<img src="https://badgen.net/packagist/v/vdlp/oc-redirect-plugin/latest">
<img src="https://badgen.net/badge/cms/October%20CMS">
<img src="https://badgen.net/badge/type/plugin">
<img src="https://plugins.vdlp.nl/octobercms/badge/installations.php?plugin=vdlp-redirect">
</p>

> **IMPORTANT**: As of version 2.0 PHP 7.0 support is dropped.
Expand Down
15 changes: 15 additions & 0 deletions assets/images/extensions/Vdlp.RedirectConditions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/javascript/redirect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$(document).ready(function () {
var $element = $('[data-menu-id="redirect/extensions"]');
$element.html('new');
$element.removeClass('empty');
});
1 change: 1 addition & 0 deletions controllers/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function __construct()
parent::__construct();

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/redirect.js');

BackendMenu::setContext('Vdlp.Redirect', 'redirect', 'categories');
}
Expand Down
43 changes: 43 additions & 0 deletions controllers/Extensions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

namespace Vdlp\Redirect\Controllers;

use Backend\Classes\Controller;
use Backend\Facades\BackendMenu;
use System\Classes\PluginManager;

final class Extensions extends Controller
{
/** @var string[] */
private static $extensions = [
'Vdlp.RedirectConditions',
'Vdlp.RedirectConditionsDomain',
'Vdlp.RedirectConditionsExample',
'Vdlp.RedirectConditionsHeader',
'Vdlp.RedirectConditionsUserAgent',
];

public function __construct()
{
parent::__construct();

BackendMenu::setContext('Vdlp.Redirect', 'redirect', 'extensions');

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/redirect.js');

$this->pageTitle = 'Redirect Extensions (new)';
}

public function index(): void
{
$this->vars['extensions'] = [];

foreach (self::$extensions as $extension) {
$this->vars['extensions'][$extension] = PluginManager::instance()->hasPlugin($extension)
&& !PluginManager::instance()->isDisabled($extension);
}
}
}
1 change: 1 addition & 0 deletions controllers/Logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function __construct(Request $request, Translator $translator, LoggerInte
BackendMenu::setContext('Vdlp.Redirect', 'redirect', 'logs');

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/redirect.js');

$this->request = $request;
$this->translator = $translator;
Expand Down
1 change: 1 addition & 0 deletions controllers/Redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function __construct(
BackendMenu::setContext('Vdlp.Redirect', 'redirect', $sideMenuItemCode);

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/redirect.js');

$this->vars['match'] = null;
$this->vars['statisticsHelper'] = new StatisticsHelper();
Expand Down
1 change: 1 addition & 0 deletions controllers/Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct()
$this->addCss('https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/statistics.js');
$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/redirect.js');
$this->addCss('/plugins/vdlp/redirect/assets/css/statistics.css');

$this->helper = new StatisticsHelper();
Expand Down
1 change: 1 addition & 0 deletions controllers/TestLab.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function index(): void
$this->pageTitle = 'vdlp.redirect::lang.title.test_lab';

$this->addCss('/plugins/vdlp/redirect/assets/css/redirect.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/redirect.js');
$this->addCss('/plugins/vdlp/redirect/assets/css/test-lab.css');
$this->addJs('/plugins/vdlp/redirect/assets/javascript/test-lab.js');

Expand Down
7 changes: 7 additions & 0 deletions controllers/extensions/_installed.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="pull-right">
<?php if ($installed): ?>
<span class="pill success"><i class="icon icon-check"></i> installed</span>
<?php else: ?>
<span class="pill default">not installed</span>
<?php endif; ?>
</div>
Loading

0 comments on commit 9e4cf11

Please sign in to comment.