namespace Combodo\iTop\Application\Dashlet\Core; use Combodo\iTop\Application\UI\Base\Component\Dashlet\DashletContainer; use Dict; use utils; class DashletProxy extends DashletUnknown { /** * @inheritdoc */ public function __construct($oModelReflection, $sId) { parent::__construct($oModelReflection, $sId); // Remove DashletUnknown class if (($key = array_search('dashlet-unknown', $this->aCSSClasses)) !== false) { unset($this->aCSSClasses[$key]); } $this->aCSSClasses[] = 'dashlet-proxy'; } /** * @inheritdoc */ public function Render($oPage, $bEditMode = false, $aExtraParams = []) { // This should never be called. $oDashletContainer = new DashletContainer(null, ['dashlet-content']); $oDashletContainer->AddHtml('
This dashlet is not supposed to be rendered as it is just a proxy for third-party widgets.
'); return $oDashletContainer; } /** * @inheritdoc * * @throws \Exception */ public function RenderNoData($oPage, $bEditMode = false, $aExtraParams = []) { $sIconUrl = utils::HtmlEntities(utils::GetAbsoluteUrlAppRoot().'images/dashlet-proxy.png'); $sExplainText = Dict::Format('UI:DashletProxy:RenderNoDataText:Edit', $this->GetDashletType()); $oDashletContainer = new DashletContainer(null, ['dashlet-content']); $sHtml = ''; $sHtml .= '
'; $sHtml .= '
'.$sExplainText.'
'; $oDashletContainer->AddHtml($sHtml); return $oDashletContainer; } }