mirror of
https://github.com/a2nt/silverstripe-elemental-basics.git
synced 2024-10-22 17:05:54 +02:00
IMPR: Hide ClassName for Live
This commit is contained in:
parent
370b2c0764
commit
0af694e61e
@ -15,6 +15,7 @@ use SilverStripe\ORM\DataExtension;
|
|||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
use SilverStripe\Forms\LiteralField;
|
use SilverStripe\Forms\LiteralField;
|
||||||
use DNADesign\Elemental\Models\ElementalArea;
|
use DNADesign\Elemental\Models\ElementalArea;
|
||||||
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,14 +42,14 @@ class BaseElementEx extends DataExtension
|
|||||||
$tab = $fields->findOrMakeTab('Root.Settings');
|
$tab = $fields->findOrMakeTab('Root.Settings');
|
||||||
|
|
||||||
$tab->push(LiteralField::create(
|
$tab->push(LiteralField::create(
|
||||||
'ClassName',
|
'Type',
|
||||||
'<div class="form-group field text">'
|
'<div class="form-group field text">'
|
||||||
.'<div class="form__field-label">Class</div>'
|
.'<div class="form__field-label">Type</div>'
|
||||||
.'<div class="form__field-holder">'.$obj->getField('ClassName').'</div>'
|
.'<div class="form__field-holder">'.(!Director::isLive() ? $obj->getField('ClassName') : $obj->i18n_singular_name()).'</div>'
|
||||||
.'</div>'
|
.'</div>'
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($this->owner->ID) {
|
if ($obj->ID) {
|
||||||
$tab->push(TreeDropdownField::create(
|
$tab->push(TreeDropdownField::create(
|
||||||
'MoveElementIDToPage',
|
'MoveElementIDToPage',
|
||||||
'Move an element to page',
|
'Move an element to page',
|
||||||
|
Loading…
Reference in New Issue
Block a user