mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #912 from chillu/pulls/7980
BUG Remove .ss-tabset class from CMS tabs to prevent rogue ajax load (#7...
This commit is contained in:
commit
7d095a12e9
@ -1091,7 +1091,9 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
|
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
|
||||||
|
|
||||||
// Set this if you want to split up tabs into a separate header row
|
// Set this if you want to split up tabs into a separate header row
|
||||||
// if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
// if($form->Fields()->hasTabset()) {
|
||||||
|
// $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||||
|
// }
|
||||||
|
|
||||||
// Add a default or custom validator.
|
// Add a default or custom validator.
|
||||||
// @todo Currently the default Validator.js implementation
|
// @todo Currently the default Validator.js implementation
|
||||||
|
@ -127,7 +127,8 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
// necessary for tree node selection in LeftAndMain.EditForm.js
|
// necessary for tree node selection in LeftAndMain.EditForm.js
|
||||||
new HiddenField('ID', false, 0)
|
new HiddenField('ID', false, 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Tab nav in CMS is rendered through separate template
|
||||||
$root->setTemplate('CMSTabSet');
|
$root->setTemplate('CMSTabSet');
|
||||||
|
|
||||||
// Add roles editing interface
|
// Add roles editing interface
|
||||||
@ -161,7 +162,10 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
);
|
);
|
||||||
$form->addExtraClass('cms-edit-form');
|
$form->addExtraClass('cms-edit-form');
|
||||||
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
||||||
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
// Tab nav in CMS is rendered through separate template
|
||||||
|
if($form->Fields()->hasTabset()) {
|
||||||
|
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||||
|
}
|
||||||
$form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
|
$form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
|
||||||
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
|
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<div $AttributesHTML>
|
<%-- Exclude ".ss-tabset" class to avoid inheriting behaviour --%>
|
||||||
<%-- Tab nav is rendered in CMSEditForm.ss --%>
|
<%-- The ".cms-tabset" class needs to be manually applied to a container elment, --%>
|
||||||
|
<%-- above the level where the tab navigation is placed. --%>
|
||||||
|
<%-- Tab navigation is rendered through various templates, --%>
|
||||||
|
<%-- e.g. through LeftAndMain_EditForm.ss. --%>
|
||||||
|
|
||||||
|
<div $AttributesHTML>
|
||||||
<% loop Tabs %>
|
<% loop Tabs %>
|
||||||
<div $AttributesHTML>
|
<div $AttributesHTML>
|
||||||
<% if Tabs %>
|
<% if Tabs %>
|
||||||
|
@ -108,7 +108,7 @@ class TabSet extends CompositeField {
|
|||||||
$this->attributes,
|
$this->attributes,
|
||||||
array(
|
array(
|
||||||
'id' => $this->id(),
|
'id' => $this->id(),
|
||||||
'class' => 'ss-tabset ' . $this->extraClass()
|
'class' => $this->extraClass()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
|
|||||||
$form->setAttribute('data-pjax-fragment', 'CurrentForm Content');
|
$form->setAttribute('data-pjax-fragment', 'CurrentForm Content');
|
||||||
if($form->Fields()->hasTabset()) {
|
if($form->Fields()->hasTabset()) {
|
||||||
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||||
$form->addExtraClass('ss-tabset cms-tabset');
|
$form->addExtraClass('cms-tabset');
|
||||||
}
|
}
|
||||||
|
|
||||||
$form->Backlink = $this->getBackLink();
|
$form->Backlink = $this->getBackLink();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div $AttributesHTML>
|
<div $getAttributesHTML("class") class="ss-tabset $extraClass">
|
||||||
<ul>
|
<ul>
|
||||||
<% loop Tabs %>
|
<% loop Tabs %>
|
||||||
<li class="$FirstLast $MiddleString $extraClass"><a href="#$id" id="tab-$id">$Title</a></li>
|
<li class="$FirstLast $MiddleString $extraClass"><a href="#$id" id="tab-$id">$Title</a></li>
|
||||||
|
@ -64,7 +64,7 @@ class FormFieldTest extends SapphireTest {
|
|||||||
$this->assertNotContains('two="2"', $field->getAttributesHTML('one', 'two'));
|
$this->assertNotContains('two="2"', $field->getAttributesHTML('one', 'two'));
|
||||||
$this->assertContains('three="3"', $field->getAttributesHTML('one', 'two'));
|
$this->assertContains('three="3"', $field->getAttributesHTML('one', 'two'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEveryFieldTransformsReadonlyAsClone() {
|
public function testEveryFieldTransformsReadonlyAsClone() {
|
||||||
$fieldClasses = ClassInfo::subclassesFor('FormField');
|
$fieldClasses = ClassInfo::subclassesFor('FormField');
|
||||||
foreach($fieldClasses as $fieldClass) {
|
foreach($fieldClasses as $fieldClass) {
|
||||||
|
Loading…
Reference in New Issue
Block a user