mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-09-28 20:29:31 +02:00
41 lines
842 B
PHP
41 lines
842 B
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: tony
|
|
* Date: 6/24/18
|
|
* Time: 2:35 PM
|
|
*/
|
|
|
|
namespace Site\Extensions;
|
|
|
|
|
|
use Sheadawson\Linkable\Forms\LinkField;
|
|
use Sheadawson\Linkable\Models\Link;
|
|
use SilverStripe\FontAwesome\FontAwesomeField;
|
|
use SilverStripe\Forms\FieldList;
|
|
use SilverStripe\ORM\DataExtension;
|
|
|
|
class ElementContentWidget extends DataExtension
|
|
{
|
|
private static $db = [
|
|
'BlockIcon' => 'Varchar(255)',
|
|
];
|
|
|
|
private static $has_one = [
|
|
'BlockLink' => Link::class,
|
|
];
|
|
|
|
public function updateCMSFields(FieldList $fields)
|
|
{
|
|
parent::updateCMSFields($fields);
|
|
|
|
$tab = $fields->findOrMakeTab('Root.Main');
|
|
$tab->push(
|
|
FontAwesomeField::create('BlockIcon')
|
|
);
|
|
|
|
$tab->push(
|
|
LinkField::create('BlockLinkID', 'Link')
|
|
);
|
|
}
|
|
} |