mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Fix requirements being inconsistently included.
This commit is contained in:
parent
f62493ffa9
commit
c10810c3f6
@ -17,8 +17,7 @@ class GridFieldAddExistingSearchButton implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getHTMLFragments($grid) {
|
public function getHTMLFragments($grid) {
|
||||||
Requirements::css('gridfieldextensions/css/GridFieldExtensions.css');
|
GridFieldExtensions::include_requirements();
|
||||||
Requirements::javascript('gridfieldextensions/javascript/GridFieldExtensions.js');
|
|
||||||
|
|
||||||
$data = new ArrayData(array(
|
$data = new ArrayData(array(
|
||||||
'Link' => $grid->Link('add-existing-search')
|
'Link' => $grid->Link('add-existing-search')
|
||||||
|
@ -135,6 +135,8 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridFieldExtensions::include_requirements();
|
||||||
|
|
||||||
$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes);
|
$field = new DropdownField(sprintf('%s[ClassName]', __CLASS__), '', $classes);
|
||||||
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
|
$field->setEmptyString(_t('GridFieldExtensions.SELECTTYPETOCREATE', '(Select type to create)'));
|
||||||
$field->addExtraClass('no-change-track');
|
$field->addExtraClass('no-change-track');
|
||||||
|
@ -45,6 +45,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getHTMLFragments($grid) {
|
public function getHTMLFragments($grid) {
|
||||||
|
GridFieldExtensions::include_requirements();
|
||||||
$grid->addExtraClass('ss-gridfield-editable');
|
$grid->addExtraClass('ss-gridfield-editable');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
code/GridFieldExtensions.php
Normal file
12
code/GridFieldExtensions.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Utility functions for the grid fields extension module.
|
||||||
|
*/
|
||||||
|
class GridFieldExtensions {
|
||||||
|
|
||||||
|
public static function include_requirements() {
|
||||||
|
Requirements::css('gridfieldextensions/css/GridFieldExtensions.css');
|
||||||
|
Requirements::javascript('gridfieldextensions/javascript/GridFieldExtensions.js');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -86,9 +86,7 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getHTMLFragments($field) {
|
public function getHTMLFragments($field) {
|
||||||
Requirements::css('gridfieldextensions/css/GridFieldExtensions.css');
|
GridFieldExtensions::include_requirements();
|
||||||
Requirements::javascript('gridfieldextensions/javascript/GridFieldExtensions.js');
|
|
||||||
|
|
||||||
$field->addExtraClass('ss-gridfield-orderable');
|
$field->addExtraClass('ss-gridfield-orderable');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user