public function testProviderConfig() { $objManager = new class_module_packagemanager_manager(); $arrProviders = $objManager->getContentproviders(); $this->assertEquals(3, count($arrProviders)); $this->assertEquals("class_module_packagemanager_contentprovider_local", get_class($arrProviders[2])); }
/** * @permissions edit * @return string */ protected function actionUploadPackage() { $this->setArrModuleEntry("template", "/folderview.tpl"); $objManager = new class_module_packagemanager_manager(); $arrContentProvider = $objManager->getContentproviders(); $strProvider = $this->getParam("provider"); $objProvider = null; foreach ($arrContentProvider as $objOneProvider) { if (get_class($objOneProvider) == $strProvider) { $objProvider = $objOneProvider; } } if ($objProvider == null) { return $this->getLang("commons_error_permissions"); } $strFile = $objProvider->processPackageUpload(); if ($strFile == null) { return $this->renderError("provider_error_transfer", "packagemanager"); } if (!$objManager->validatePackage($strFile)) { $objFilesystem = new class_filesystem(); $objFilesystem->fileDelete($strFile); return $this->getLang("provider_error_package", "packagemanager"); } $this->adminReload(class_link::getLinkAdminHref($this->getArrModule("modul"), "processPackage", "&package=" . $strFile)); return ""; }