当前位置: 首页>>代码示例>>PHP>>正文


PHP PluginRegistry::getCategories方法代码示例

本文整理汇总了PHP中PluginRegistry::getCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistry::getCategories方法的具体用法?PHP PluginRegistry::getCategories怎么用?PHP PluginRegistry::getCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginRegistry的用法示例。


在下文中一共展示了PluginRegistry::getCategories方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugins

 /**
  * Display a list of plugins along with management options.
  * @param $args array
  * @param $request PKPRequest
  */
 function plugins($args, &$request)
 {
     $category = isset($args[0]) ? $args[0] : null;
     $categories = PluginRegistry::getCategories();
     $templateMgr =& TemplateManager::getManager();
     $this->validate();
     if (isset($category) && in_array($category, $categories)) {
         // The user specified a category of plugins to view;
         // get the plugins in that category only.
         $mainPage = false;
         $plugins =& PluginRegistry::loadCategory($category);
         $this->setupTemplate(false);
         $templateMgr->assign('pageTitle', 'plugins.categories.' . $category);
         $templateMgr->assign('pageHierarchy', $this->setBreadcrumbs($request, true));
     } else {
         // No plugin specified; display all.
         $mainPage = true;
         $plugins = array();
         foreach ($categories as $category) {
             $newPlugins =& PluginRegistry::loadCategory($category);
             if (isset($newPlugins)) {
                 $plugins = array_merge($plugins, PluginRegistry::loadCategory($category));
             }
         }
         $this->setupTemplate(true);
         $templateMgr->assign('pageTitle', 'manager.plugins.pluginManagement');
         $templateMgr->assign('pageHierarchy', $this->setBreadcrumbs($request, false));
     }
     $templateMgr->assign_by_ref('plugins', $plugins);
     $templateMgr->assign_by_ref('categories', $categories);
     $templateMgr->assign('mainPage', $mainPage);
     $templateMgr->assign('isSiteAdmin', Validation::isSiteAdmin());
     $templateMgr->assign('helpTopicId', 'journal.managementPages.plugins');
     $templateMgr->display('manager/plugins/plugins.tpl');
 }
开发者ID:reconciler,项目名称:ojs,代码行数:40,代码来源:PluginHandler.inc.php

示例2: execute

 /**
  * Test locales.
  */
 function execute()
 {
     // Flush the file cache just to be certain we're using
     // the most recent stuff
     import('cache.CacheManager');
     $cacheManager =& CacheManager::getManager();
     $cacheManager->flush('locale');
     // Load plugins so that their locale data is included too
     $plugins = array();
     foreach (PluginRegistry::getCategories() as $category) {
         echo "Loading plugin category \"{$category}\"...\n";
         $morePlugins = PluginRegistry::loadCategory($category);
         if (is_array($morePlugins)) {
             $plugins += $morePlugins;
         }
     }
     foreach (Locale::getAllLocales() as $locale => $name) {
         if (!empty($this->locales) && !in_array($locale, $this->locales)) {
             continue;
         }
         if ($locale != MASTER_LOCALE) {
             echo "Testing locale \"{$name}\" ({$locale}) against reference locale " . MASTER_LOCALE . ".\n";
             $this->testLocale($locale, MASTER_LOCALE, $plugins);
             $this->testEmails($locale, MASTER_LOCALE);
         }
     }
 }
开发者ID:jalperin,项目名称:harvester,代码行数:30,代码来源:localeCheck.php

示例3: plugins

 /**
  * Display a list of plugins along with management options.
  */
 function plugins($args)
 {
     $category = isset($args[0]) ? $args[0] : null;
     parent::validate();
     $categories = PluginRegistry::getCategories();
     if (isset($category)) {
         // The user specified a category of plugins to view;
         // get the plugins in that category only.
         $plugins =& PluginRegistry::loadCategory($category);
     } else {
         // No plugin specified; display all.
         $plugins = array();
         foreach ($categories as $category) {
             $newPlugins =& PluginRegistry::loadCategory($category);
             if (isset($newPlugins)) {
                 $plugins = array_merge($plugins, PluginRegistry::loadCategory($category));
             }
         }
     }
     parent::setupTemplate(true);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('plugins', $plugins);
     $templateMgr->assign_by_ref('categories', $categories);
     $templateMgr->assign('isSiteAdmin', Validation::isSiteAdmin());
     $templateMgr->assign('helpTopicId', 'journal.managementPages.plugins');
     $templateMgr->display('manager/plugins/plugins.tpl');
 }
开发者ID:Jouper,项目名称:jouper,代码行数:30,代码来源:PluginHandler.inc.php

示例4: addPluginVersions

 /**
  * For 2.3 upgrade:  Add initial plugin data to versions table
  * @return boolean
  */
 function addPluginVersions()
 {
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     import('site.VersionCheck');
     $categories = PluginRegistry::getCategories();
     foreach ($categories as $category) {
         PluginRegistry::loadCategory($category, true);
         $plugins = PluginRegistry::getPlugins($category);
         foreach ($plugins as $plugin) {
             $versionFile = $plugin->getPluginPath() . '/version.xml';
             if (FileManager::fileExists($versionFile)) {
                 $versionInfo =& VersionCheck::parseVersionXML($versionFile);
                 $pluginVersion = $versionInfo['version'];
                 $pluginVersion->setCurrent(1);
                 $versionDao->insertVersion($pluginVersion);
             } else {
                 $pluginVersion = new Version();
                 $pluginVersion->setMajor(1);
                 $pluginVersion->setMinor(0);
                 $pluginVersion->setRevision(0);
                 $pluginVersion->setBuild(0);
                 $pluginVersion->setDateInstalled(Core::getCurrentDate());
                 $pluginVersion->setCurrent(1);
                 $pluginVersion->setProductType('plugins.' . $category);
                 $pluginVersion->setProduct(basename($plugin->getPluginPath()));
                 $versionDao->insertVersion($pluginVersion);
             }
         }
     }
 }
开发者ID:jalperin,项目名称:harvester,代码行数:34,代码来源:Upgrade.inc.php

示例5: getEmailFileMap

 function getEmailFileMap($locale)
 {
     $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
     $files = array($emailTemplateDao->getMainEmailTemplatesFilename() => $emailTemplateDao->getMainEmailTemplateDataFilename($locale));
     $categories = PluginRegistry::getCategories();
     foreach ($categories as $category) {
         $plugins =& PluginRegistry::loadCategory($category, true);
         foreach (array_keys($plugins) as $name) {
             $plugin =& $plugins[$name];
             $templatesFile = $plugin->getInstallEmailTemplatesFile();
             if ($templatesFile) {
                 $files[$templatesFile] = str_replace('{$installedLocale}', $locale, $plugin->getInstallEmailTemplateDataFile());
             }
             unset($plugin);
         }
         unset($plugins);
     }
     return $files;
 }
开发者ID:jalperin,项目名称:ocs,代码行数:19,代码来源:TranslatorAction.inc.php

示例6: deletePlugin

 /**
  * Delete a plugin from the system
  * @param $category string
  * @param $plugin string
  */
 function deletePlugin($category, $plugin)
 {
     $this->validate();
     $templateMgr =& TemplateManager::getManager();
     $this->setupTemplate(true);
     $templateMgr->assign('path', 'delete');
     $templateMgr->assign('deleted', false);
     $templateMgr->assign('error', false);
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     /* @var $versionDao VersionDAO */
     $installedPlugin = $versionDao->getCurrentVersion('plugins.' . $category, $plugin, true);
     if ($installedPlugin) {
         $pluginDest = Core::getBaseDir() . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $category . DIRECTORY_SEPARATOR . $plugin;
         $pluginLibDest = Core::getBaseDir() . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'pkp' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $category . DIRECTORY_SEPARATOR . $plugin;
         //make sure plugin type is valid and then delete the files
         if (in_array($category, PluginRegistry::getCategories())) {
             // Delete the plugin from the file system.
             FileManager::rmtree($pluginDest);
             FileManager::rmtree($pluginLibDest);
         }
         if (is_dir($pluginDest) || is_dir($pluginLibDest)) {
             $templateMgr->assign('error', true);
             $templateMgr->assign('message', 'manager.plugins.deleteError');
         } else {
             $versionDao->disableVersion('plugins.' . $category, $plugin);
             $templateMgr->assign('deleted', true);
         }
     } else {
         $templateMgr->assign('error', true);
         $templateMgr->assign('message', 'manager.plugins.doesNotExist');
     }
     $templateMgr->assign('pageHierarchy', $this->setBreadcrumbs(true, $category));
     $templateMgr->display('manager/plugins/managePlugins.tpl');
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:39,代码来源:PluginManagementHandler.inc.php

示例7: installLocale

 /**
  * Install support for a new locale.
  * @param $locale string
  */
 function installLocale($locale)
 {
     // Install default locale-specific data
     import('lib.pkp.classes.db.DBDataXMLParser');
     $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
     $emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale));
     // Load all plugins so they can add locale data if needed
     $categories = PluginRegistry::getCategories();
     foreach ($categories as $category) {
         PluginRegistry::loadCategory($category);
     }
     HookRegistry::call('PKPLocale::installLocale', array(&$locale));
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:17,代码来源:PKPLocale.inc.php

示例8: addPluginVersions

 /**
  * Insert or update plugin data in versions
  * and plugin_settings tables.
  * @return boolean
  */
 function addPluginVersions()
 {
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     import('lib.pkp.classes.site.VersionCheck');
     $fileManager = new FileManager();
     $categories = PluginRegistry::getCategories();
     foreach ($categories as $category) {
         PluginRegistry::loadCategory($category);
         $plugins = PluginRegistry::getPlugins($category);
         if (is_array($plugins)) {
             foreach ($plugins as $plugin) {
                 $versionFile = $plugin->getPluginPath() . '/version.xml';
                 if ($fileManager->fileExists($versionFile)) {
                     $versionInfo =& VersionCheck::parseVersionXML($versionFile);
                     $pluginVersion = $versionInfo['version'];
                 } else {
                     $pluginVersion = new Version(1, 0, 0, 0, Core::getCurrentDate(), 1, 'plugins.' . $category, basename($plugin->getPluginPath()), '', 0, $plugin->isSitePlugin());
                 }
                 $versionDao->insertVersion($pluginVersion, true);
             }
         }
     }
     return true;
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:29,代码来源:Installer.inc.php

示例9: renderFilter

 /**
  * @see GridHandler::renderFilter()
  */
 function renderFilter($request)
 {
     $categoriesSymbolic = $categories = PluginRegistry::getCategories();
     $categories = array('all' => __('grid.plugin.allCategories'));
     foreach ($categoriesSymbolic as $category) {
         $categories[$category] = __("plugins.categories.{$category}");
     }
     $filterData = array('categories' => $categories);
     return parent::renderFilter($request, $filterData);
 }
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:13,代码来源:PluginGalleryGridHandler.inc.php

示例10: createData

 /**
  * Create initial required data.
  * @return boolean
  */
 function createData()
 {
     if ($this->getParam('manualInstall')) {
         // Add insert statements for default data
         // FIXME use ADODB data dictionary?
         $this->executeSQL(sprintf('INSERT INTO site (primary_locale, installed_locales) VALUES (\'%s\', \'%s\')', $this->getParam('locale'), join(':', $this->installedLocales)));
         $this->executeSQL(sprintf('INSERT INTO site_settings (setting_name, setting_type, setting_value, locale) VALUES (\'%s\', \'%s\', \'%s\', \'%s\')', 'title', 'string', addslashes(Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), $this->getParam('locale')));
         $this->executeSQL(sprintf('INSERT INTO site_settings (setting_name, setting_type, setting_value, locale) VALUES (\'%s\', \'%s\', \'%s\', \'%s\')', 'contactName', 'string', addslashes(Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), $this->getParam('locale')));
         $this->executeSQL(sprintf('INSERT INTO site_settings (setting_name, setting_type, setting_value, locale) VALUES (\'%s\', \'%s\', \'%s\', \'%s\')', 'contactEmail', 'string', addslashes($this->getParam('adminEmail')), $this->getParam('locale')));
         $this->executeSQL(sprintf('INSERT INTO users (username, first_name, last_name, password, email, date_registered, date_last_login) VALUES (\'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\')', $this->getParam('adminUsername'), $this->getParam('adminUsername'), $this->getParam('adminUsername'), Validation::encryptCredentials($this->getParam('adminUsername'), $this->getParam('adminPassword'), $this->getParam('encryption')), $this->getParam('adminEmail'), Core::getCurrentDate(), Core::getCurrentDate()));
         $this->executeSQL(sprintf('INSERT INTO roles (conference_id, user_id, role_id) VALUES (%d, (SELECT user_id FROM users WHERE username = \'%s\'), %d)', 0, $this->getParam('adminUsername'), ROLE_ID_SITE_ADMIN));
         // Install email template list and data for each locale
         $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
         foreach ($emailTemplateDao->installEmailTemplates($emailTemplateDao->getMainEmailTemplatesFilename(), true) as $sql) {
             $this->executeSQL($sql);
         }
         foreach ($this->installedLocales as $locale) {
             foreach ($emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale), true) as $sql) {
                 $this->executeSQL($sql);
             }
         }
     } else {
         // Add initial site data
         $locale = $this->getParam('locale');
         $siteDao =& DAORegistry::getDAO('SiteDAO', $this->dbconn);
         $site = new Site();
         $site->setRedirect(0);
         $site->setMinPasswordLength(INSTALLER_DEFAULT_MIN_PASSWORD_LENGTH);
         $site->setPrimaryLocale($locale);
         $site->setInstalledLocales($this->installedLocales);
         $site->setSupportedLocales($this->installedLocales);
         if (!$siteDao->insertSite($site)) {
             $this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
             return false;
         }
         $siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');
         $siteSettingsDao->updateSetting('title', array($locale => Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), null, true);
         $siteSettingsDao->updateSetting('contactName', array($locale => Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), null, true);
         $siteSettingsDao->updateSetting('contactEmail', array($locale => $this->getParam('adminEmail')), null, true);
         // Add initial site administrator user
         $userDao =& DAORegistry::getDAO('UserDAO', $this->dbconn);
         $user = new User();
         $user->setUsername($this->getParam('adminUsername'));
         $user->setPassword(Validation::encryptCredentials($this->getParam('adminUsername'), $this->getParam('adminPassword'), $this->getParam('encryption')));
         $user->setFirstName($user->getUsername());
         $user->setLastName('');
         $user->setEmail($this->getParam('adminEmail'));
         if (!$userDao->insertUser($user)) {
             $this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
             return false;
         }
         $roleDao =& DAORegistry::getDao('RoleDAO', $this->dbconn);
         $role = new Role();
         $role->setConferenceId(0);
         $role->setUserId($user->getId());
         $role->setRoleId(ROLE_ID_SITE_ADMIN);
         if (!$roleDao->insertRole($role)) {
             $this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
             return false;
         }
         // Install email template list and data for each locale
         $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
         $emailTemplateDao->installEmailTemplates($emailTemplateDao->getMainEmailTemplatesFilename());
         foreach ($this->installedLocales as $locale) {
             $emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale));
         }
         // Add initial plugin data to versions table
         $versionDao =& DAORegistry::getDAO('VersionDAO');
         import('site.VersionCheck');
         $categories = PluginRegistry::getCategories();
         foreach ($categories as $category) {
             PluginRegistry::loadCategory($category, true);
             $plugins = PluginRegistry::getPlugins($category);
             foreach ($plugins as $plugin) {
                 $versionFile = $plugin->getPluginPath() . '/version.xml';
                 if (FileManager::fileExists($versionFile)) {
                     $versionInfo =& VersionCheck::parseVersionXML($versionFile);
                     $pluginVersion = $versionInfo['version'];
                     $pluginVersion->setCurrent(1);
                     $versionDao->insertVersion($pluginVersion);
                 } else {
                     $pluginVersion = new Version();
                     $pluginVersion->setMajor(1);
                     $pluginVersion->setMinor(0);
                     $pluginVersion->setRevision(0);
                     $pluginVersion->setBuild(0);
                     $pluginVersion->setDateInstalled(Core::getCurrentDate());
                     $pluginVersion->setCurrent(1);
                     $pluginVersion->setProductType('plugins.' . $category);
                     $pluginVersion->setProduct(basename($plugin->getPluginPath()));
                     $versionDao->insertVersion($pluginVersion);
                 }
             }
         }
     }
     return true;
//.........这里部分代码省略.........
开发者ID:jalperin,项目名称:ocs,代码行数:101,代码来源:Install.inc.php

示例11: foreach

 /**
  * Load all plugins in the system and return them in a single array.
  */
 function &loadAllPlugins()
 {
     foreach (PluginRegistry::getCategories() as $category) {
         PluginRegistry::loadCategory($category);
     }
     $allPlugins =& PluginRegistry::getAllPlugins();
     return $allPlugins;
 }
开发者ID:anorton,项目名称:pkp-lib,代码行数:11,代码来源:PluginRegistry.inc.php

示例12: foreach

 /**
  * Load all plugins in the system and return them in a single array.
  * @param $enabledOnly boolean load only enabled plug-ins
  */
 function &loadAllPlugins($enabledOnly = false)
 {
     foreach (PluginRegistry::getCategories() as $category) {
         PluginRegistry::loadCategory($category, $enabledOnly);
     }
     $allPlugins =& PluginRegistry::getAllPlugins();
     return $allPlugins;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:12,代码来源:PluginRegistry.inc.php

示例13: createData

 /**
  * Create initial required data.
  * @return boolean
  */
 function createData()
 {
     // Add initial site data
     $locale = $this->getParam('locale');
     $siteDao =& DAORegistry::getDAO('SiteDAO', $this->dbconn);
     $site = new Site();
     $site->setRedirect(0);
     $site->setMinPasswordLength(INSTALLER_DEFAULT_MIN_PASSWORD_LENGTH);
     $site->setPrimaryLocale($locale);
     $site->setInstalledLocales($this->installedLocales);
     $site->setSupportedLocales($this->installedLocales);
     if (!$siteDao->insertSite($site)) {
         $this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
         return false;
     }
     $siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');
     $siteSettingsDao->updateSetting('title', array($locale => __(INSTALLER_DEFAULT_SITE_TITLE)), null, true);
     $siteSettingsDao->updateSetting('contactName', array($locale => __(INSTALLER_DEFAULT_SITE_TITLE)), null, true);
     $siteSettingsDao->updateSetting('contactEmail', array($locale => $this->getParam('adminEmail')), null, true);
     // Add initial site administrator user
     $userDao =& DAORegistry::getDAO('UserDAO', $this->dbconn);
     $user = new User();
     $user->setUsername($this->getParam('adminUsername'));
     $user->setPassword(Validation::encryptCredentials($this->getParam('adminUsername'), $this->getParam('adminPassword'), $this->getParam('encryption')));
     $user->setFirstName($user->getUsername());
     $user->setLastName('');
     $user->setEmail($this->getParam('adminEmail'));
     if (!$userDao->insertUser($user)) {
         $this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
         return false;
     }
     $roleDao =& DAORegistry::getDao('RoleDAO', $this->dbconn);
     $role = new Role();
     $role->setConferenceId(0);
     $role->setUserId($user->getId());
     $role->setRoleId(ROLE_ID_SITE_ADMIN);
     if (!$roleDao->insertRole($role)) {
         $this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
         return false;
     }
     // Install email template list and data for each locale
     $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
     $emailTemplateDao->installEmailTemplates($emailTemplateDao->getMainEmailTemplatesFilename());
     foreach ($this->installedLocales as $locale) {
         $emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale));
     }
     // Add initial plugin data to versions table
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     import('site.VersionCheck');
     $categories = PluginRegistry::getCategories();
     foreach ($categories as $category) {
         PluginRegistry::loadCategory($category, true);
         $plugins = PluginRegistry::getPlugins($category);
         foreach ($plugins as $plugin) {
             $versionFile = $plugin->getPluginPath() . '/version.xml';
             if (FileManager::fileExists($versionFile)) {
                 $versionInfo =& VersionCheck::parseVersionXML($versionFile);
                 $pluginVersion = $versionInfo['version'];
                 $pluginVersion->setCurrent(1);
                 $versionDao->insertVersion($pluginVersion);
             } else {
                 $pluginVersion = new Version();
                 $pluginVersion->setMajor(1);
                 $pluginVersion->setMinor(0);
                 $pluginVersion->setRevision(0);
                 $pluginVersion->setBuild(0);
                 $pluginVersion->setDateInstalled(Core::getCurrentDate());
                 $pluginVersion->setCurrent(1);
                 $pluginVersion->setProductType('plugins.' . $category);
                 $pluginVersion->setProduct(basename($plugin->getPluginPath()));
                 $versionDao->insertVersion($pluginVersion);
             }
         }
     }
     return true;
 }
开发者ID:sedici,项目名称:ocs,代码行数:80,代码来源:Install.inc.php

示例14: deletePlugin

 /**
  * Delete plugin.
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function deletePlugin($args, $request)
 {
     $plugin = $this->getAuthorizedContextObject(ASSOC_TYPE_PLUGIN);
     $category = $plugin->getCategory();
     $productName = basename($plugin->getPluginPath());
     $versionDao = DAORegistry::getDAO('VersionDAO');
     /* @var $versionDao VersionDAO */
     $installedPlugin = $versionDao->getCurrentVersion('plugins.' . $category, $productName, true);
     $notificationMgr = new NotificationManager();
     $user = $request->getUser();
     if ($installedPlugin) {
         $pluginDest = Core::getBaseDir() . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $category . DIRECTORY_SEPARATOR . $productName;
         $pluginLibDest = Core::getBaseDir() . DIRECTORY_SEPARATOR . PKP_LIB_PATH . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $category . DIRECTORY_SEPARATOR . $productName;
         // make sure plugin type is valid and then delete the files
         if (in_array($category, PluginRegistry::getCategories())) {
             // Delete the plugin from the file system.
             $fileManager = new FileManager();
             $fileManager->rmtree($pluginDest);
             $fileManager->rmtree($pluginLibDest);
         }
         if (is_dir($pluginDest) || is_dir($pluginLibDest)) {
             $notificationMgr->createTrivialNotification($user->getId(), NOTIFICATION_TYPE_ERROR, array('contents' => __('manager.plugins.deleteError', array('pluginName' => $plugin->getDisplayName()))));
         } else {
             $versionDao->disableVersion('plugins.' . $category, $productName);
             $notificationMgr->createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('manager.plugins.deleteSuccess', array('pluginName' => $plugin->getDisplayName()))));
         }
     } else {
         $notificationMgr->createTrivialNotification($user->getId(), NOTIFICATION_TYPE_ERROR, array('contents' => __('manager.plugins.doesNotExist', array('pluginName' => $plugin->getDisplayName()))));
     }
     return DAO::getDataChangedEvent($plugin->getName());
 }
开发者ID:piero-tasso,项目名称:pkp-lib,代码行数:37,代码来源:PluginGridHandler.inc.php

示例15: deletePlugin

 /**
  * Delete a plugin from the system
  * @param plugin string
  */
 function deletePlugin($plugin)
 {
     $templateMgr =& TemplateManager::getManager();
     $this->setupTemplate(true);
     $templateMgr->assign('path', 'delete');
     $templateMgr->assign('deleted', false);
     $templateMgr->assign('error', false);
     $templateMgr->assign('pageHierarchy', PluginManagementHandler::setBreadcrumbs(true));
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     $installedPlugin = $versionDao->getCurrentVersion($plugin);
     $category = $this->getPluginCategory($plugin);
     if ($installedPlugin) {
         $pluginDest = Core::getBaseDir() . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $category . DIRECTORY_SEPARATOR . $plugin;
         //make sure plugin type is valid and then delete the files
         if (in_array($category, PluginRegistry::getCategories())) {
             FileManager::rmtree($pluginDest);
         }
         if (FileManager::fileExists($pluginDest, 'dir')) {
             $templateMgr->assign('error', true);
             $templateMgr->assign('message', 'manager.plugins.deleteError');
         } else {
             $versionDao->disableVersion($plugin);
             $templateMgr->assign('deleted', true);
         }
     } else {
         $templateMgr->assign('error', true);
         $templateMgr->assign('message', 'manager.plugins.doesNotExist');
     }
     $templateMgr->assign('pageHierarchy', $this->setBreadcrumbs(true, $category));
     $templateMgr->display('manager/plugins/managePlugins.tpl');
 }
开发者ID:jalperin,项目名称:ocs,代码行数:35,代码来源:PluginManagementHandler.inc.php


注:本文中的PluginRegistry::getCategories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。