mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 09:05:46 +00:00
FIX: Links Widget
This commit is contained in:
parent
7c9fa8530d
commit
fab6c5f8e9
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace A2nt\CMSNiceties\Widgets;
|
namespace A2nt\CMSNiceties\Widgets;
|
||||||
|
|
||||||
use gorriecoe\Link\Models\Link;
|
use gorriecoe\Link\Models\Link;
|
||||||
@ -33,12 +32,19 @@ class LinksWidget extends Widget
|
|||||||
'Links' => Link::class,
|
'Links' => Link::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
private static $many_many_extraFields = [
|
||||||
|
'Links' => [
|
||||||
|
'Sort' => 'Int',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
private static $owns = [
|
private static $owns = [
|
||||||
'Links',
|
'Links',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getCMSFields()
|
public function getCMSFields()
|
||||||
{
|
{
|
||||||
|
//die('aaa');
|
||||||
$fields = parent::getCMSFields();
|
$fields = parent::getCMSFields();
|
||||||
|
|
||||||
if($this->ID) {
|
if($this->ID) {
|
||||||
@ -47,11 +53,13 @@ class LinksWidget extends Widget
|
|||||||
'Links',
|
'Links',
|
||||||
$this
|
$this
|
||||||
));
|
));
|
||||||
}else{
|
} else {
|
||||||
$fields->push(LiteralField::create(
|
$fields->push(
|
||||||
|
LiteralField::create(
|
||||||
'Note',
|
'Note',
|
||||||
'<p class="alert alert-warning"><b>Note:</b> The widget needs to be saved before adding a link.'
|
'<p class="alert alert-warning"><b>Note:</b> The widget needs to be saved before adding a link.'
|
||||||
.' Enter the Title and click "+ Create" button at the bottom left corner of the screen</p>')
|
.' Enter the Title and click "+ Create" button at the bottom left corner of the screen</p>'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user