Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #44 from Dolphiq/development
Browse files Browse the repository at this point in the history
small changes
  • Loading branch information
johanzandstra authored Apr 18, 2018
2 parents ad1ff62 + 67ac0cb commit df97c04
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Redirect Changelog
## 1.0.16 - 2018-04-18
### Fixed
- Fixed migration scripts to create all tables on first install
- Small text changes

## 1.0.15 - 2018-02-21
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

This plugin requires Craft CMS 3.0.0-RC1 or later.
This plugin requires Craft CMS 3.0.3.1 or later.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ As a new (experimental) feature the redirect also give you the ability to enable
**Note**: This plugin may become a paid add-on when the Craft Plugin store becomes available.

## Requirements
This plugin requires Craft CMS 3.0.0-RC11 or later.
This plugin requires Craft CMS 3.0.3.1 or later.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dolphiq/redirect",
"description": "Craft redirect plugin provides an easy way to enter and maintain 301 and 302 redirects and 404 error pages.",
"type": "craft-plugin",
"version": "1.0.15",
"version": "1.0.16",
"keywords": [
"craft",
"cms",
Expand All @@ -25,7 +25,7 @@
}
],
"require": {
"craftcms/cms": "^3.0.0-RC11"
"craftcms/cms": "^3.0.3.1"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 3 additions & 0 deletions src/RedirectPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public function getSettingsResponse()

public function registerCpUrlRules(RegisterUrlRulesEvent $event)
{
// only register CP URLs if the user is logged in
if (!\Craft::$app->user->identity)
return;
$rules = [
// register routes for the sub nav
'redirect' => 'redirect/settings/',
Expand Down
19 changes: 19 additions & 0 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function safeUp()
public function safeDown()
{
$this->dropTableIfExists('{{%dolphiq_redirects}}');
$this->dropTableIfExists('{{%dolphiq_redirects_catch_all_urls}}');
return true;
}

Expand Down Expand Up @@ -58,6 +59,24 @@ protected function createTables()
'uid' => $this->uid()
]);

if (!$this->db->tableExists('{{%dolphiq_redirects_catch_all_urls}}')) {

$this->createTable(
'{{%dolphiq_redirects_catch_all_urls%}}',
[
'id' => $this->primaryKey(),
'uri' => $this->string(255)->notNull()->defaultValue(''),
// 'firstHitAt' => $this->dateTime()->notNull(),
// 'lastHitAt' => $this->dateTime()->notNull(),
'uid' => $this->uid(),
'siteId' => $this->integer()->unsigned()->notNull()->defaultValue(0),
'dateCreated' => $this->dateTime()->notNull(),
'dateUpdated' => $this->dateTime()->notNull(),
'hitCount' => $this->integer()->unsigned()->notNull()->defaultValue(0),
]
);
}

$this->addForeignKey(null, '{{%dolphiq_redirects}}', ['id'], '{{%elements}}', ['id'], 'CASCADE', null);
}
}
2 changes: 1 addition & 1 deletion src/templates/edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{% if redirect.id %}<input type="hidden" name="redirectId" value="{{ redirect.id }}">{% endif %}
<div class="readable">
<p>{{ "You can use the Redirect plugin to redirect simple routes but also use it for more advanced route matches with parameters"|t('redirect') }}.<br><a target="_blank" href="https://github.com/Dolphiq/craft3-plugin-redirect/blob/master/RULES.md">{{ "See some examples and instrutions here"|t('redirect') }}</a>.</p>
<p>{{ "You can use the Redirect plugin to redirect simple routes but also use it for more advanced route matches with parameters"|t('redirect') }}.<br><a target="_blank" href="https://github.com/Dolphiq/craft3-plugin-redirect/blob/master/RULES.md">{{ "See some examples and instructions here"|t('redirect') }}</a>.</p>
<br>
</div>
<div id="categorygroup-settings">
Expand Down
2 changes: 1 addition & 1 deletion src/translations/nl/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"Couldn’t save the redirect." => "Opslaan van de doorverwijzing mislukt!",
"Redirect saved." => "Doorverwijzing opgeslagen.",
"You can use the Redirect plugin to redirect simple routes but also use it for more advanced route matches with parameters" => "De Redirect plugin kan gebruikt worden voor eenvoudige routes maar ook voor geavanceerdere routes met parameters",
"See some examples and instrutions here" => "Voorbeelden en instructies over het gebruik zijn hier te vinden (engels)"
"See some examples and instructions here" => "Voorbeelden en instructies over het gebruik zijn hier te vinden (engels)"

];

0 comments on commit df97c04

Please sign in to comment.