mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-06-28 14:49:21 +02:00
Compare commits
No commits in common. "34a0f71edccce6040c9052580e3e0cc9a5da6cf4" and "69d2ccc0235fcfe08790115e1405333f6f7d811b" have entirely different histories.
34a0f71edc
...
69d2ccc023
|
@ -58,7 +58,3 @@ Page:
|
||||||
- A2nt\CMSNiceties\Models\TeamMember
|
- A2nt\CMSNiceties\Models\TeamMember
|
||||||
extensions:
|
extensions:
|
||||||
- DNADesign\Elemental\Extensions\ElementalPageExtension
|
- DNADesign\Elemental\Extensions\ElementalPageExtension
|
||||||
|
|
||||||
SilverStripe\CMS\Model\RedirectorPage:
|
|
||||||
extensions:
|
|
||||||
- A2nt\CMSNiceties\Extensions\RedirectorPageEx
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace A2nt\CMSNiceties\Extensions;
|
|
||||||
|
|
||||||
use SilverStripe\Forms\CheckboxField;
|
|
||||||
use SilverStripe\Forms\FieldList;
|
|
||||||
use SilverStripe\ORM\DataExtension;
|
|
||||||
|
|
||||||
class RedirectorPageEx extends DataExtension
|
|
||||||
{
|
|
||||||
private static $db = [
|
|
||||||
'OpenInNewTab' => 'Boolean(0)',
|
|
||||||
];
|
|
||||||
private static $defaults = [
|
|
||||||
'OpenInNewTab' => 0,
|
|
||||||
];
|
|
||||||
|
|
||||||
public function updateCMSFields(FieldList $fields)
|
|
||||||
{
|
|
||||||
$MainTab = $fields->findOrMakeTab('Root.Main');
|
|
||||||
$MainTab->push(
|
|
||||||
CheckboxField::create(
|
|
||||||
'OpenInNewTab',
|
|
||||||
_t('RedirectorPage.OpenInNewTab', 'Open in new tab')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace A2nt\CMSNiceties\GraphQL;
|
namespace A2nt\CMSNiceties\GraphQL;
|
||||||
|
|
||||||
use SilverStripe\CMS\Model\RedirectorPage;
|
use A2nt\CMSNiceties\Templates\DeferredRequirements;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\GraphQL\Controller as GraphQLController;
|
use SilverStripe\GraphQL\Controller as GraphQLController;
|
||||||
use SilverStripe\Core\Extension;
|
use SilverStripe\Core\Extension;
|
||||||
use SilverStripe\ErrorPage\ErrorPage;
|
use SilverStripe\View\Requirements;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class \A2nt\CMSNiceties\GraphQL\ObjectGraphQlEx
|
* Class \A2nt\CMSNiceties\GraphQL\ObjectGraphQlEx
|
||||||
|
@ -65,17 +65,4 @@ class ObjectGraphQlEx extends Extension
|
||||||
// TODO: GraphQL form response /element/*id*/action
|
// TODO: GraphQL form response /element/*id*/action
|
||||||
return $req->requestVar('SecurityID') || $req->httpMethod() === 'POST' || preg_match('!element/([0-9]+)/([A-z]+)!', $req->getURL());
|
return $req->requestVar('SecurityID') || $req->httpMethod() === 'POST' || preg_match('!element/([0-9]+)/([A-z]+)!', $req->getURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isLegacy()
|
|
||||||
{
|
|
||||||
$object = $this->owner;
|
|
||||||
|
|
||||||
return $object->config()->get('legacy') || in_array(
|
|
||||||
$object->ClassName,
|
|
||||||
[
|
|
||||||
RedirectorPage::class,
|
|
||||||
ErrorPage::class,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,21 +6,21 @@
|
||||||
$ExtraClass
|
$ExtraClass
|
||||||
{$LinkClass}
|
{$LinkClass}
|
||||||
<% if $RedirectionType = 'External' || $ExternalURL || $OpenInNewWindow %>
|
<% if $RedirectionType = 'External' || $ExternalURL || $OpenInNewWindow %>
|
||||||
legacy
|
external
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
<% if $isCurrent || $isSection %>active<% end_if %>
|
<% if $isCurrent || $isSection %>active <% end_if %>
|
||||||
<% if $isSection %>section<% end_if %>
|
<% if $isSection %>section<% end_if %>
|
||||||
"
|
"
|
||||||
<% if $OpenInNewWindow %>
|
<% if $RedirectionType = 'External' || $OpenInNewWindow %>
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
|
|
||||||
data-text="{$MenuTitle.XML}"
|
data-text="{$MenuTitle.XML}"
|
||||||
>
|
>
|
||||||
<% if $BlockIcon %>
|
<% if $BlockIcon %>
|
||||||
<i class="fa-icon $BlockIcon"></i>
|
<i class="fa-icon $BlockIcon"></i>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
$MenuTitle.XML
|
$MenuTitle.XML
|
||||||
<% if $isCurrent || $isSection %><i class="visually-hidden">(current)</i><% end_if %>
|
<% if $isCurrent || $isSection %><i class="visually-hidden">(current)</i><% end_if %>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user