public function getInstance($wIId, $type = 'controller') { $class = $this->getFullClassName($wIId, $type); if (class_exists($class)) { if (strtolower($type) === strtolower('controller')) { $widgetControllerObject = new $class(Helper::wNo($wIId), $this->widgetSettingsService, $this->user, $this->l10n); if ($widgetControllerObject) { return $widgetControllerObject; } } elseif (strtolower($type) === strtolower('template')) { $widgetTemplateObject = new $class($this->l10n, $this->widgetSettingsService); if ($widgetTemplateObject) { return $widgetTemplateObject; } } } }
public function removeWidgetInstance($wIId) { return $this->widgetConfigDAO->removeWidgetConfigs(Helper::wId($wIId), Helper::wNo($wIId), $this->user); }
/** * * is only called once to create the wId controller object * * @param $wIId */ private function x_createWidgetControllerObject($wIId) { $controllerClass = 'OCA\\Dashboard\\Widgets\\' . ucwords(Helper::wId($wIId)) . '\\' . ucwords(Helper::wId($wIId)) . 'Controller'; if (class_exists($controllerClass)) { $this->widgetControllerObjects[$wIId] = new $controllerClass(Helper::wNo($wIId), $this->widgetConfigDAO, $this->widgetHashDAO, $this->user, $this->l10n); if (!$this->widgetControllerObjects[$wIId]) { Util::writeLog('dashboard', 'Could not create widget controller object (wIId = ' . $wIId . ')', 1); } } }