API Install GridFieldExtensions to vendor folder, remove get_module_dir

This commit is contained in:
Robbie Averill 2017-10-11 09:31:30 +13:00
parent c120dc23ce
commit efdf9dcc13
2 changed files with 8 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{
"name": "symbiote/silverstripe-gridfieldextensions",
"description": "A collection of useful grid field components",
"type": "silverstripe-module",
"type": "silverstripe-vendormodule",
"homepage": "http://github.com/symbiote/silverstripe-gridfieldextensions",
"keywords": ["silverstripe", "gridfield"],
"license": "BSD-3-Clause",
@ -19,6 +19,7 @@
"issues": "http://github.com/symbiote/silverstripe-gridfieldextensions/issues"
},
"require": {
"silverstripe/vendor-plugin": "^1.0",
"silverstripe/framework": "~4.0"
},
"require-dev": {
@ -34,6 +35,10 @@
"screenshots": [
"docs/en/_images/editable-rows.png",
"docs/en/_images/add-existing-search.png"
],
"expose": [
"css",
"javascript"
]
},
"replace": {

View File

@ -9,16 +9,9 @@ use SilverStripe\View\Requirements;
*/
class GridFieldExtensions
{
public static function include_requirements()
{
$moduleDir = self::get_module_dir();
Requirements::css($moduleDir.'/css/GridFieldExtensions.css');
Requirements::javascript($moduleDir.'/javascript/GridFieldExtensions.js');
}
public static function get_module_dir()
{
return basename(dirname(__DIR__));
Requirements::css('symbiote/silverstripe-gridfieldextensions:css/GridFieldExtensions.css');
Requirements::javascript('symbiote/silverstripe-gridfieldextensions:javascript/GridFieldExtensions.js');
}
}