本文整理汇总了PHP中PluginRegistry类的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistry类的具体用法?PHP PluginRegistry怎么用?PHP PluginRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginRegistry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$this->validate();
PluginRegistry::loadCategory('oaiMetadataFormats', true);
$oai = new JournalOAI(new OAIConfig(Request::getRequestUrl(), Config::getVar('oai', 'repository_id')));
$oai->execute();
}
开发者ID:ramonsodoma,项目名称:ojs,代码行数:7,代码来源:OAIHandler.inc.php
示例2: CustomLocaleHandler
/**
* Constructor
**/
function CustomLocaleHandler($parentPluginName)
{
parent::Handler();
$this->addCheck(new HandlerValidatorJournal($this));
$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_MANAGER)));
$this->plugin = PluginRegistry::getPlugin('generic', $parentPluginName);
}
开发者ID:jalperin,项目名称:ojs,代码行数:10,代码来源:CustomLocaleHandler.inc.php
示例3: MedraSettingsForm
/**
* Constructor
* @param $plugin MedraExportPlugin
* @param $contextId integer
*/
function MedraSettingsForm($plugin, $contextId)
{
$this->_contextId = $contextId;
$this->_plugin = $plugin;
parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl');
// DOI plugin settings action link
$pubIdPlugins = PluginRegistry::loadCategory('pubIds', true);
if (isset($pubIdPlugins['doipubidplugin'])) {
$application = PKPApplication::getApplication();
$request = $application->getRequest();
$dispatcher = $application->getDispatcher();
import('lib.pkp.classes.linkAction.request.AjaxModal');
$doiPluginSettingsLinkAction = new LinkAction('settings', new AjaxModal($dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.settings.plugins.SettingsPluginGridHandler', 'manage', null, array('plugin' => 'doipubidplugin', 'category' => 'pubIds')), __('plugins.importexport.common.settings.DOIPluginSettings')), __('plugins.importexport.common.settings.DOIPluginSettings'), null);
$this->setData('doiPluginSettingsLinkAction', $doiPluginSettingsLinkAction);
}
// Add form validation checks.
$this->addCheck(new FormValidator($this, 'registrantName', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.registrantNameRequired'));
$this->addCheck(new FormValidator($this, 'fromCompany', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.fromCompanyRequired'));
$this->addCheck(new FormValidator($this, 'fromName', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.fromNameRequired'));
$this->addCheck(new FormValidatorEmail($this, 'fromEmail', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.fromEmailRequired'));
$this->addCheck(new FormValidatorInSet($this, 'exportIssuesAs', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.exportIssuesAs', array(O4DOI_ISSUE_AS_WORK, O4DOI_ISSUE_AS_MANIFESTATION)));
$this->addCheck(new FormValidatorInSet($this, 'publicationCountry', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.publicationCountry', array_keys($this->_getCountries())));
// The username is used in HTTP basic authentication and according to RFC2617 it therefore may not contain a colon.
$this->addCheck(new FormValidatorRegExp($this, 'username', FORM_VALIDATOR_OPTIONAL_VALUE, 'plugins.importexport.medra.settings.form.usernameRequired', '/^[^:]+$/'));
$this->addCheck(new FormValidatorPost($this));
}
开发者ID:bkroll,项目名称:ojs,代码行数:31,代码来源:MedraSettingsForm.inc.php
示例4: setMetadata
/**
* Register the article's metadata with the SWORD deposit.
*/
function setMetadata()
{
$this->package->setCustodian($this->journal->getSetting('contactName'));
$this->package->setTitle(html_entity_decode($this->article->getTitle($this->journal->getPrimaryLocale()), ENT_QUOTES, 'UTF-8'));
$this->package->setAbstract(html_entity_decode(strip_tags($this->article->getAbstract($this->journal->getPrimaryLocale())), ENT_QUOTES, 'UTF-8'));
$this->package->setType($this->section->getIdentifyType($this->journal->getPrimaryLocale()));
// The article can be published or not. Support either.
if (is_a($this->article, 'PublishedArticle')) {
$doi = $this->article->getPubId('doi');
if ($doi !== null) {
$this->package->setIdentifier($doi);
}
}
foreach ($this->article->getAuthors() as $author) {
$creator = $author->getFullName(true);
$affiliation = $author->getAffiliation($this->journal->getPrimaryLocale());
if (!empty($affiliation)) {
$creator .= "; {$affiliation}";
}
$this->package->addCreator($creator);
}
// The article can be published or not. Support either.
if (is_a($this->article, 'PublishedArticle')) {
$plugin =& PluginRegistry::loadPlugin('citationFormats', 'bibtex');
$this->package->setCitation(html_entity_decode(strip_tags($plugin->fetchCitation($this->article, $this->issue, $this->journal)), ENT_QUOTES, 'UTF-8'));
}
}
开发者ID:EreminDm,项目名称:water-cao,代码行数:30,代码来源:OJSSwordDeposit.inc.php
示例5: OAIDAO
/**
* Constructor.
*/
function OAIDAO()
{
parent::DAO();
$this->archiveDao =& DAORegistry::getDAO('ArchiveDAO');
$this->recordDao =& DAORegistry::getDAO('RecordDAO');
PluginRegistry::loadCategory('schemas');
}
开发者ID:jalperin,项目名称:harvester,代码行数:10,代码来源:OAIDAO.inc.php
示例6: fetch
/**
* @copydoc Form::fetch()
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$pubIdPlugins = PluginRegistry::loadCategory('pubIds', true, $this->getContextId());
$templateMgr->assign(array('pubIdPlugins' => $pubIdPlugins, 'pubObject' => $this->getPubObject(), 'approval' => $this->getApproval(), 'confirmationText' => $this->getConfirmationText()));
return parent::fetch($request);
}
开发者ID:pkp,项目名称:pkp-lib,代码行数:10,代码来源:PKPAssignPublicIdentifiersForm.inc.php
示例7: getPubId
/**
* Get a public ID for this galley.
* @param $pubIdType string One of the NLM pub-id-type values or
* 'other::something' if not part of the official NLM list
* (see <http://dtd.nlm.nih.gov/publishing/tag-library/n-4zh0.html>).
* @param $preview boolean If true, generate a non-persisted preview only.
*/
function getPubId($pubIdType, $preview = false)
{
// FIXME: Move publisher-id to PID plug-in.
if ($pubIdType === 'publisher-id') {
$pubId = $this->getStoredPubId($pubIdType);
return $pubId ? $pubId : null;
}
// Retrieve the article.
$articleDao = DAORegistry::getDAO('ArticleDAO');
/* @var $articleDao ArticleDAO */
$article = $articleDao->getById($this->getArticleId(), null, true);
if (!$article) {
return null;
}
$pubIdPlugins = PluginRegistry::loadCategory('pubIds', true, $article->getJournalId());
foreach ($pubIdPlugins as $pubIdPlugin) {
if ($pubIdPlugin->getPubIdType() == $pubIdType) {
// If we already have an assigned ID, use it.
$storedId = $this->getStoredPubId($pubIdType);
if (!empty($storedId)) {
return $storedId;
}
return $pubIdPlugin->getPubId($this, $preview);
}
}
return null;
}
开发者ID:jalperin,项目名称:ojs,代码行数:34,代码来源:ArticleFile.inc.php
示例8: plugin
/**
* Perform plugin-specific management functions.
* @param $args array
* @param $request object
*/
function plugin($args, &$request)
{
$category = array_shift($args);
$plugin = array_shift($args);
$verb = array_shift($args);
$this->validate();
$this->setupTemplate(true);
$plugins =& PluginRegistry::loadCategory($category);
$message = $messageParams = null;
$pluginObject = null;
if (isset($plugins[$plugin])) {
$pluginObject = $plugins[$plugin];
}
if (is_null($pluginObject)) {
$request->redirect(null, null, 'plugins', array($category));
}
if (!$pluginObject->manage($verb, $args, $message, $messageParams, $request)) {
HookRegistry::call('PluginHandler::plugin', array($verb, $args, $message, $messageParams, $pluginObject));
if ($message) {
$user =& $request->getUser();
import('classes.notification.NotificationManager');
$notificationManager = new NotificationManager();
$notificationManager->createTrivialNotification($user->getId(), $message, $messageParams);
}
$request->redirect(null, null, 'plugins', array($category));
}
}
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:32,代码来源:PluginHandler.inc.php
示例9: fetch
/**
* Fetch the HTML contents of the form.
* @param $request PKPRequest
* return string
*/
function fetch($request)
{
$monograph = $this->getMonograph();
$press = $request->getPress();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('submissionId', $monograph->getId());
$templateMgr->assign('representationId', (int) $this->getPublicationFormatId());
$templateMgr->assign('isPhysicalFormat', (bool) $this->getPhysicalFormat());
// included to load format-specific template
$templateMgr->assign('stageId', $this->getStageId());
$templateMgr->assign('formParams', $this->getFormParams());
$templateMgr->assign('submissionApproved', $monograph->getDatePublished());
$onixCodelistItemDao = DAORegistry::getDAO('ONIXCodelistItemDAO');
// Check if e-commerce is available
import('classes.payment.omp.OMPPaymentManager');
$ompPaymentManager = new OMPPaymentManager($request);
if ($ompPaymentManager->isConfigured()) {
$templateMgr->assign('paymentConfigured', true);
$templateMgr->assign('currency', $press->getSetting('currency'));
}
// get the lists associated with the select elements on these publication format forms.
$codes = array('productCompositionCodes' => 'List2', 'measurementUnitCodes' => 'List50', 'weightUnitCodes' => 'List95', 'measurementTypeCodes' => 'List48', 'productFormDetailCodes' => 'List175', 'productAvailabilityCodes' => 'List65', 'technicalProtectionCodes' => 'List144', 'returnableIndicatorCodes' => 'List66', 'countriesIncludedCodes' => 'List91');
foreach ($codes as $templateVarName => $list) {
$templateMgr->assign_by_ref($templateVarName, $onixCodelistItemDao->getCodes($list));
}
// consider public identifiers
$pubIdPlugins = PluginRegistry::loadCategory('pubIds', true);
$templateMgr->assign('pubIdPlugins', $pubIdPlugins);
// Notification options.
$notificationRequestOptions = array(NOTIFICATION_LEVEL_NORMAL => array(NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD => array(ASSOC_TYPE_PRESS, $press->getId()), NOTIFICATION_TYPE_FORMAT_NEEDS_APPROVED_SUBMISSION => array(ASSOC_TYPE_MONOGRAPH, $monograph->getId())), NOTIFICATION_LEVEL_TRIVIAL => array());
$templateMgr->assign('notificationRequestOptions', $notificationRequestOptions);
return parent::fetch($request);
}
开发者ID:josekarvalho,项目名称:omp,代码行数:38,代码来源:CatalogEntryFormatMetadataForm.inc.php
示例10: index
function index($args, $request)
{
$this->validate();
PluginRegistry::loadCategory('oaiMetadataFormats', true);
$oai = new JournalOAI(new OAIConfig($request->url(null, 'oai'), Config::getVar('oai', 'repository_id')));
$oai->execute();
}
开发者ID:relaciones-internacionales-journal,项目名称:ojs,代码行数:7,代码来源:OAIHandler.inc.php
示例11: 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
示例12: 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
示例13: harvest
/**
* Harvest archives.
*
* NB: This handler method is meant to be called by the parallel
* processing framework (see ProcessDAO::spawnProcesses()). Executing
* this handler in parallel will significantly improve harvesting
* performance.
*
* The 'harvesting_checking_max_processes' config parameter limits
* the number of parallel processes that can be started in parallel.
*
* @param $args array
* @param $request PKPRequest
*/
function harvest($args, $request)
{
// This is potentially a long running request. So
// give us unlimited execution time.
ini_set('max_execution_time', 0);
// Get the process id.
$processId = $args['authToken'];
// Run until all archives have been harvested.
$processDao = DAORegistry::getDAO('ProcessDAO');
$archiveDao = DAORegistry::getDAO('ArchiveDAO');
$plugins = PluginRegistry::loadCategory('harvesters');
do {
// Check that the process lease has not expired.
$continue = $processDao->canContinue($processId);
if ($continue) {
$process = $processDao->getObjectById($processId);
$archive = $archiveDao->getNextFlaggedArchive($request, $processId);
if (!$archive) {
$continue = false;
} else {
$plugin = $plugins[$archive->getHarvesterPluginName()];
$plugin->updateIndex($archive, $process->getAdditionalData());
}
}
} while ($continue);
// Free the process slot.
$processDao->deleteObjectById($processId);
// This request returns just a (private) status message.
return 'Done!';
}
开发者ID:Rygbee,项目名称:harvester,代码行数:44,代码来源:HarvesterApiHandler.inc.php
示例14: login
/**
* Logs in to the system
*
* @param $username string The username
* @param $password strint The password
* @return string
*/
public function login($username, $password)
{
@session_destroy();
@session_start();
$password = md5($password);
$msg = "";
$pru = PluginRegistry::getInstance();
$login = $pru->getPlugin("Login Plugin");
$result = $login->SOAPLogin($username, $password);
return session_id();
switch ($result) {
case 200:
$msg = "Logged in successfully";
break;
case 402:
$msg = "There was an error while trying to login; your username is blocked";
break;
case 403:
$msg = "Incorrect username/password combination";
break;
case 500:
$msg = "There was an error on the server, please try later";
break;
default:
$msg = "Incorrect username/password combination";
break;
}
return $msg;
}
开发者ID:andreums,项目名称:framework1.5,代码行数:36,代码来源:FWSoapLogin.class.php
示例15: index
function index()
{
$this->validate();
PluginRegistry::loadCategory('schemas');
$oai = new ArchiveOAI(new OAIConfig(Request::getRequestUrl(), Config::getVar('oai', 'repository_id')));
$oai->execute();
}
开发者ID:Rygbee,项目名称:harvester,代码行数:7,代码来源:OAIHandler.inc.php
示例16: executeMetadataPluginTest
/**
* Executes the metadata plug-in test.
* @param $pluginDir string
* @param $pluginName string
* @param $filterGroups array
* @param $controlledVocabs array
*/
protected function executeMetadataPluginTest($pluginDir, $pluginName, $filterGroups, $controlledVocabs)
{
// Make sure that the vocab xml configuration is valid.
$controlledVocabFile = 'plugins/metadata/' . $pluginDir . '/schema/' . METADATA_PLUGIN_VOCAB_DATAFILE;
$this->validateXmlConfig(array('./' . $controlledVocabFile, './lib/pkp/' . $controlledVocabFile));
// Delete vocab data so that we can re-install it.
$controlledVocabDao = DAORegistry::getDAO('ControlledVocabDAO');
/* @var $controlledVocabDao ControlledVocabDAO */
foreach ($controlledVocabs as $controlledVocabSymbolic) {
$controlledVocab = $controlledVocabDao->getBySymbolic($controlledVocabSymbolic, 0, 0);
if ($controlledVocab) {
$controlledVocabDao->deleteObject($controlledVocab);
}
}
// Reset the plug-in setting indicating that vocabs have already been installed.
$pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO');
/* @var $pluginSettingsDao PluginSettingsDAO */
$pluginSettingsDao->updateSetting(0, $pluginName, METADATA_PLUGIN_VOCAB_INSTALLED_SETTING, false);
// Unregister the plug-in so that we're sure it will be registered again.
$plugins =& PluginRegistry::getPlugins();
unset($plugins['metadata'][$pluginName]);
$this->executePluginTest('metadata', $pluginDir, $pluginName, $filterGroups);
// Test whether the controlled vocabs have been installed.
foreach ($controlledVocabs as $controlledVocab) {
self::assertInstanceOf('ControlledVocab', $controlledVocabDao->getBySymbolic($controlledVocab, 0, 0));
}
}
开发者ID:doana,项目名称:pkp-lib,代码行数:34,代码来源:MetadataPluginTestCase.inc.php
示例17: setListsData
/**
* @copydoc MultipleListsListbuilderHandler::setListsData()
*/
function setListsData($request, $filter)
{
$leftBlockPlugins = $disabledBlockPlugins = $rightBlockPlugins = array();
$plugins =& PluginRegistry::loadCategory('blocks');
foreach ($plugins as $key => $junk) {
if (!$plugins[$key]->getEnabled() || $plugins[$key]->getBlockContext() == '') {
if (count(array_intersect($plugins[$key]->getSupportedContexts(), array(BLOCK_CONTEXT_LEFT_SIDEBAR, BLOCK_CONTEXT_RIGHT_SIDEBAR))) > 0) {
$disabledBlockPlugins[$key] =& $plugins[$key];
}
} else {
switch ($plugins[$key]->getBlockContext()) {
case BLOCK_CONTEXT_LEFT_SIDEBAR:
$leftBlockPlugins[$key] =& $plugins[$key];
break;
case BLOCK_CONTEXT_RIGHT_SIDEBAR:
$rightBlockPlugins[$key] =& $plugins[$key];
break;
}
}
}
$lists =& $this->getLists();
$lists['leftContext']->setData($leftBlockPlugins);
$lists['rightContext']->setData($rightBlockPlugins);
$lists['unselected']->setData($disabledBlockPlugins);
}
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:28,代码来源:BlockPluginsListbuilderHandler.inc.php
示例18: extractMetadataFromDataObject
/**
* @see MetadataDataObjectAdapter::extractMetadataFromDataObject()
* @param $monograph Monograph
* @return MetadataDescription
*/
function extractMetadataFromDataObject($monograph)
{
assert(is_a($monograph, 'Monograph'));
AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON);
// Retrieve data that belongs to the publication format.
$oaiDao = DAORegistry::getDAO('OAIDAO');
/* @var $oaiDao OAIDAO */
$publishedMonographDao = DAORegistry::getDAO('PublishedMonographDAO');
$chapterDao = DAORegistry::getDAO('ChapterDAO');
$monograph = $publishedMonographDao->getById($monograph->getId());
$press = $oaiDao->getPress($monograph->getPressId());
$description = $this->instantiateMetadataDescription();
// Update status
// Is communicated via an attribute, so property value is empty
$description->addStatement('administrative_data/delivery/update_status[@type="urn_new"]', "");
$urn = "";
$scheme = "";
$pubIdPlugins = PluginRegistry::loadCategory('pubIds');
if (isset($pubIdPlugins) && array_key_exists('URNDNBPubIdPlugin', $pubIdPlugins) && $pubIdPlugins['URNDNBPubIdPlugin']->getEnabled() == true) {
$urn = $pubIdPlugins['URNDNBPubIdPlugin']->getPubId($monograph);
$namespaces = explode(':', $urn);
$numberOfNamespaces = min(sizeof($namespaces), 3);
$scheme = implode(":", array_slice($namespaces, 0, $numberOfNamespaces));
}
// URN
$description->addStatement('record/identifier', $urn . ' [@scheme="' . $scheme . '"]');
// URL
$url = Request::url($press->getPath(), 'catalog', 'book', array($monograph->getId()));
$description->addStatement('record/resource/identifier[@scheme="url", @type="frontpage", @role="primary"]', $url);
// URL Mime type
$description->addStatement('record/resource/format[@scheme="imt"]', "text/html");
return $description;
}
开发者ID:kadowa,项目名称:omp-xepicur-metadata-plugin,代码行数:38,代码来源:Epc10SchemaMonographAdapter.inc.php
示例19: setUp
/**
* @see PKPTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
// Instantiate the plug-in for testing.
$this->mockRequest();
PluginRegistry::loadCategory('generic', true, 0);
$this->lucenePlugin = PluginRegistry::getPlugin('generic', 'luceneplugin');
}
开发者ID:utlib,项目名称:ojs,代码行数:11,代码来源:LucenePluginTest.php
示例20: CustomLocaleHandler
/**
* Constructor
*/
function CustomLocaleHandler()
{
parent::Handler();
$this->addCheck(new HandlerValidatorConference($this));
$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_CONFERENCE_MANAGER)));
$plugin =& PluginRegistry::getPlugin('generic', 'CustomLocalePlugin');
$this->plugin =& $plugin;
}
开发者ID:ramonsodoma,项目名称:ocs,代码行数:11,代码来源:CustomLocaleHandler.inc.php
注:本文中的PluginRegistry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论