mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°4693 - Restore API to add saas entries in the backoffice pages
This commit is contained in:
@@ -1457,6 +1457,23 @@ interface iBackofficeStyleExtension
|
||||
public function GetStyle(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement this interface to add saas file (SCSS) to the backoffice pages.
|
||||
* example: return "css/setup.scss"
|
||||
*
|
||||
* @api
|
||||
* @package BackofficeUIExtensibilityAPI
|
||||
* @since 3.3.0
|
||||
*/
|
||||
interface iBackofficeSaasExtension
|
||||
{
|
||||
/**
|
||||
* @api
|
||||
* @see \iTopWebPage::$a_styles
|
||||
* @return string
|
||||
*/
|
||||
public function GetSaas(): string;
|
||||
}
|
||||
/**
|
||||
* Implement this interface to add Dict entries
|
||||
*
|
||||
|
||||
@@ -7674,6 +7674,7 @@ abstract class MetaModel
|
||||
'iBackofficeReadyScriptExtension',
|
||||
'iBackofficeLinkedStylesheetsExtension',
|
||||
'iBackofficeStyleExtension',
|
||||
'iBackofficeSaasExtension',
|
||||
'iBackofficeDictEntriesExtension',
|
||||
'iBackofficeDictEntriesPrefixesExtension',
|
||||
'iPortalUIExtension',
|
||||
|
||||
@@ -904,6 +904,11 @@ HTML;
|
||||
$this->add_style($oExtensionInstance->GetStyle());
|
||||
}
|
||||
|
||||
/** @var \iBackofficeStyleExtension $oExtensionInstance */
|
||||
foreach (MetaModel::EnumPlugins('iBackofficeSaasExtension') as $oExtensionInstance) {
|
||||
$this->add_saas($oExtensionInstance->GetSaas());
|
||||
}
|
||||
|
||||
// TODO 3.0.0 not displayed ?
|
||||
$this->GetContentLayout()->SetExtraHtmlContent(utils::FilterXSS($this->s_content));
|
||||
|
||||
|
||||
@@ -123,6 +123,10 @@ class ApplicationExtensionTest extends ItopCustomDatamodelTestCase
|
||||
\iBackofficeStyleExtension::class,
|
||||
static::ENUM_API_CALL_METHOD_ENUMPLUGINS,
|
||||
],
|
||||
\iBackofficeSaasExtension::class => [
|
||||
\iBackofficeSaasExtension::class,
|
||||
static::ENUM_API_CALL_METHOD_ENUMPLUGINS,
|
||||
],
|
||||
\iBackofficeDictEntriesExtension::class => [
|
||||
\iBackofficeDictEntriesExtension::class,
|
||||
static::ENUM_API_CALL_METHOD_ENUMPLUGINS,
|
||||
|
||||
@@ -233,6 +233,19 @@ class ExampleFor_iBackofficeStyleExtension implements \iBackofficeStyleExtension
|
||||
}
|
||||
CSS;
|
||||
}
|
||||
}
|
||||
]]></content>
|
||||
</snippet>
|
||||
<snippet id="ExampleFor_iBackofficeSaasExtension" _delta="define">
|
||||
<placement>core</placement>
|
||||
<rank>0</rank>
|
||||
<content><![CDATA[
|
||||
class ExampleFor_iBackofficeSaasExtension implements \iBackofficeSaasExtension
|
||||
{
|
||||
public function GetSaas(): string
|
||||
{
|
||||
return "css/setup.scss";
|
||||
}
|
||||
}
|
||||
]]></content>
|
||||
</snippet>
|
||||
|
||||
Reference in New Issue
Block a user