/** * Returns an array of all active plugins * * @return array */ public function getAllActive() { $dto = new DTO(); $dto->setParameter("Status", "enabled"); $dto->setParameter("Installed", "1"); $dto->setOrderBy("Priority"); $dto = $this->findAll($dto); return $dto->getResults(); }
/** * Returns all elements that have the specified aspect * * @param string $aspectName The name of the desired aspect * * @return array An array of the results */ public function findAllWithAspect($aspectName, $restrictSiteSlug = null) { // if (!$this->AspectService->getBySlug($aspectName)) // throw new Exception('Cannot find Elements with Aspect ['.$aspectName.'], Aspect does not exist'); $dto = new DTO(); $dto->setParameter("IncludesAspect", ltrim($aspectName, '@')); if (!is_null($restrictSiteSlug)) { $dto->setParameter("AnchoredSiteSlug", $restrictSiteSlug); } $dto = $this->findAll($dto); return $dto->getResults(); }
protected function single() { $this->checkPermission('plugins-list'); $slug = $this->Request->getParameter('Slug'); $id = $this->Request->getParameter('PluginID'); if (empty($id)) { $id = $this->Request->getParameter('id'); } $plugin = null; if (!empty($slug) && $this->PluginService->slugExists($slug)) { $plugin = $this->PluginService->getBySlug($slug); } else { if (!empty($id)) { $plugin = $this->PluginService->getByID($id); } } if (!empty($plugin)) { if ($this->getTemplateVariable('IncludeAspects') == 'true') { $dto = new DTO(); $dto->setParameter('PluginID', $plugin->PluginID); $plugin['Aspects'] = $this->AspectService->findAll($dto)->getResults(); } return array($plugin); } return array(); }