setLabel(\Yii::t('' , '')); $this->setDescription(Yii::t('', '')); $this->setIcon(''); $this->setIconFramework(''); $this->setUrl(Yii::$app->urlManager->createUrl([''])); $this->setModuleName(''); $this->setNamespace(__CLASS__); $this->setClassSpan(ArrayHelper::merge($this->getClassSpan(), [ 'bk-backgroundIcon', '' ])); } public function getOptions() { $options = parent::getOptions(); //aggiunge all'oggetto container tutti i widgets recuperati dal controller del modulo return ArrayHelper::merge($options, ["children" => $this->getWidgetsIcon()]); } /** * Recupera i widget figli da far visualizzare nella dashboard secondaria * @return [open20\amos\core\widget\WidgetIcon] Array con i widget della dashboard */ public function getWidgetsIcon() { $widgets = []; $widget = \open20\amos\dashboard\models\AmosWidgets::find()->andWhere(['module' => ''])->andWhere(['type' => 'ICON'])->andWhere(['!=', 'child_of', NULL])->all(); foreach ($widget as $Widget) { $className = (strpos($Widget['classname'], '\\') === 0)? $Widget['classname'] : '\\' . $Widget['classname']; $widgetChild = new $className; if($widgetChild->isVisible()){ $widgets[] = $widgetChild->getOptions(); } } return $widgets; } }