Expose as vendor module

This commit is contained in:
Ingo Schommer 2017-10-01 22:12:37 +13:00
parent f37b78ef61
commit 6e5836680b
2 changed files with 12 additions and 17 deletions

View File

@ -7,28 +7,18 @@ use SilverStripe\CMS\Controllers\CMSPageEditController;
use SilverStripe\CMS\Controllers\CMSPageHistoryController; use SilverStripe\CMS\Controllers\CMSPageHistoryController;
use SilverStripe\CMS\Controllers\CMSPageSettingsController; use SilverStripe\CMS\Controllers\CMSPageSettingsController;
use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig; use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
use SilverStripe\View\Parsers\ShortcodeParser; use SilverStripe\View\Parsers\ShortcodeParser;
/**
* Define constants
*
* - CMS_DIR: Path relative to webroot, e.g. "cms"
* - CMS_PATH: Absolute filepath, e.g. "/var/www/my-webroot/cms"
*/
call_user_func(function () { call_user_func(function () {
// Check if CMS is root dir, or subdir $module = ModuleLoader::inst()->getManifest()->getModule('silverstripe/cms');
if (strcasecmp(__DIR__, BASE_PATH) === 0) {
$clientPath = 'client';
} else {
$clientPath = basename(__DIR__) . '/client';
}
// Enable insert-link to internal pages // Enable insert-link to internal pages
TinyMCEConfig::get('cms') TinyMCEConfig::get('cms')
->enablePlugins(array( ->enablePlugins(array(
'sslinkinternal' => "{$clientPath}/dist/js/TinyMCE_sslink-internal.js", 'sslinkinternal' => $module->getResource('client/dist/js/TinyMCE_sslink-internal.js')->getURL(),
'sslinkanchor' => "{$clientPath}/dist/js/TinyMCE_sslink-anchor.js", 'sslinkanchor' => $module->getResource('client/dist/js/TinyMCE_sslink-anchor.js')->getURL()
)); ));
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "silverstripe/cms", "name": "silverstripe/cms",
"type": "silverstripe-module", "type": "silverstripe-vendormodule",
"description": "The SilverStripe Content Management System", "description": "The SilverStripe Content Management System",
"homepage": "http://silverstripe.org", "homepage": "http://silverstripe.org",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
@ -25,7 +25,8 @@
"silverstripe/framework": "^4@dev", "silverstripe/framework": "^4@dev",
"silverstripe/reports": "^4@dev", "silverstripe/reports": "^4@dev",
"silverstripe/siteconfig": "^4@dev", "silverstripe/siteconfig": "^4@dev",
"silverstripe/versioned": "^1@dev" "silverstripe/versioned": "^1@dev",
"silverstripe/vendor-plugin": "^1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7", "phpunit/phpunit": "^5.7",
@ -37,7 +38,11 @@
"branch-alias": { "branch-alias": {
"4.x-dev": "4.0.x-dev", "4.x-dev": "4.0.x-dev",
"dev-master": "5.x-dev" "dev-master": "5.x-dev"
} },
"expose": [
"client/dist",
"client/lang"
]
}, },
"scripts": { "scripts": {
"lint": "phpcs -s code/ tests/php/ tests/behat/src/", "lint": "phpcs -s code/ tests/php/ tests/behat/src/",