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

Commit

Permalink
switched page and site method
Browse files Browse the repository at this point in the history
getkirby/kirby#600
Signed-off-by: Bruno Meilick <b@bnomei.com>
  • Loading branch information
bnomei committed Aug 27, 2017
1 parent db9ee5f commit d353c28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions kirby-opener.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ public function version() {
METHODS
***************************************/

$kirby->set('site::method', 'openerSecret',
function($site) {
return sha1(KirbyOpener::getSalt().date('Ymd'));
});

$kirby->set('pages::method', 'openerSecret',
function($pages) {
return sha1(KirbyOpener::getSalt().date('Ymd'));
});

$kirby->set('pages::method', 'openerDiruriEncodedGetPage',
function($pages, $diruriencoded) {
return page(str_replace('__DS__', DS, urldecode($diruriencoded)));
});

$kirby->set('page::method', 'openerSecret',
function($page) {
return sha1(KirbyOpener::getSalt().$page->url().date('Ymd'));
Expand All @@ -64,6 +49,21 @@ function($page, $diruriencoded) {
return $page->openerDiruriEncoded() == $diruriencoded;
});

$kirby->set('pages::method', 'openerSecret',
function($pages) {
return sha1(KirbyOpener::getSalt().date('Ymd'));
});

$kirby->set('pages::method', 'openerDiruriEncodedGetPage',
function($pages, $diruriencoded) {
return page(str_replace('__DS__', DS, urldecode($diruriencoded)));
});

$kirby->set('site::method', 'openerSecret',
function($site) {
return sha1(KirbyOpener::getSalt().date('Ymd'));
});

/****************************************
FIELDS
***************************************/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kirby-opener",
"description": "Kirby Opener is a Kirby CMS Panel Field button that allows you to use placeholders to create dynamic urls which are called with and without ajax response or start downloads.",
"version": "0.9.2",
"version": "0.9.3",
"author": "Bruno Meilick",
"type": "kirby-plugin",
"license": "Commercial"
Expand Down

0 comments on commit d353c28

Please sign in to comment.