mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Merge remote-tracking branch 'origin/support/3.2' into develop
This commit is contained in:
@@ -46,6 +46,34 @@ class WebResourcesHelper
|
||||
];
|
||||
}
|
||||
|
||||
//---------------------------------
|
||||
// CKEditor
|
||||
//---------------------------------
|
||||
|
||||
/**
|
||||
* Add necessary files (JS) to be able to use CKEditor in the page
|
||||
*
|
||||
* @param WebPage $oPage
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function EnableCKEditorToWebPage(WebPage &$oPage): void
|
||||
{
|
||||
//when ckeditor is loaded in ajax, CKEDITOR_BASEPATH is not well defined (this constant is used to load additional js)
|
||||
$oPage->add_script("if (! window.CKEDITOR_BASEPATH) { var CKEDITOR_BASEPATH = '".utils::GetAbsoluteUrlAppRoot()."js/ckeditor/';}");
|
||||
foreach (CKEditorHelper::GetJSFilesRelPathsForCKEditor() as $sFile) {
|
||||
$oPage->LinkScriptFromAppRoot($sFile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[] Relative URLs to the JS files necessary for CKEditor
|
||||
*/
|
||||
public static function GetJSFilesRelPathsForCKEditor(): array
|
||||
{
|
||||
return CKEditorHelper::GetJSFilesRelPathsForCKEditor();
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------
|
||||
// D3/C3.js
|
||||
|
||||
Reference in New Issue
Block a user