/** * Gets the detail view of a module * @param Module $module Module to display in the view * @return zibo\repository\view\ModuleView */ private function getModuleView(Module $module) { $namespace = $module->getNamespace(); $name = $module->getName(); $basePath = $this->request->getBasePath() . '/'; $repositoryUrl = $basePath . self::ACTION_NAMESPACE . '/' . $namespace; $moduleUrl = $basePath . self::ACTION_MODULE . '/'; $downloadUrl = $basePath . self::ACTION_DOWNLOAD . '/' . $namespace . '/' . $name . '/'; $table = new ModuleVersionTable($module->getVersions(), $downloadUrl, $moduleUrl . $namespace . '/' . $name); $this->breadcrumbs->addBreadcrumb($repositoryUrl, $namespace); $this->breadcrumbs->addBreadcrumb($moduleUrl . '/' . $namespace . '/' . $name, $name); return new ModuleView($module, $table, $repositoryUrl, $moduleUrl, self::TRANSLATION_DOWNLOAD, $downloadUrl . $module->getVersion()); }
/** * Creates a table for the version of the provided module * @param Module $module * @return zibo\repository\table\ModuleVersionTable */ private function getModuleTable(Module $module) { $basePath = $this->request->getBasePath() . '/'; $installAction = $basePath . self::ACTION_INSTALL . '/'; $upgradeAction = $basePath . self::ACTION_UPGRADE . '/'; $decorator = new ModuleInstallUpgradeActionDecorator($this->installer, $installAction, $upgradeAction); $table = new ModuleVersionTable($module->getVersions()); $table->addDecorator($decorator); return $table; }