本文整理汇总了PHP中PluginRegistry::loadCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistry::loadCategory方法的具体用法?PHP PluginRegistry::loadCategory怎么用?PHP PluginRegistry::loadCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginRegistry
的用法示例。
在下文中一共展示了PluginRegistry::loadCategory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OAIDAO
/**
* Constructor.
*/
function OAIDAO()
{
parent::DAO();
$this->archiveDao =& DAORegistry::getDAO('ArchiveDAO');
$this->recordDao =& DAORegistry::getDAO('RecordDAO');
PluginRegistry::loadCategory('schemas');
}
示例2: 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);
}
示例3: ArchiveForm
/**
* Constructor.
* @param $archiveId omit for a new archive
*/
function ArchiveForm($archiveId = null, $allowManagement = false)
{
parent::Form('admin/archiveForm.tpl');
$this->archiveId = isset($archiveId) ? (int) $archiveId : null;
$this->allowManagement = $allowManagement;
// Validation checks for this form
$this->addCheck(new FormValidator($this, 'title', 'required', 'admin.archives.form.titleRequired'));
$this->addCheck(new FormValidator($this, 'url', 'required', 'admin.archives.form.urlRequired'));
$this->addCheck(new FormValidatorPost($this));
$this->captchaEnabled = Config::getVar('captcha', 'captcha_on_submit') && Config::getVar('captcha', 'recaptcha');
if ($this->captchaEnabled && !Validation::isSiteAdmin()) {
$this->addCheck(new FormValidatorReCaptcha($this, 'recaptcha_challenge_field', 'recaptcha_response_field', Request::getRemoteAddr(), 'common.captchaField.badCaptcha'));
}
$this->harvesterPluginName = Request::getUserVar('harvesterPluginName');
if ($archiveId) {
$archiveDao = DAORegistry::getDAO('ArchiveDAO');
$this->archive =& $archiveDao->getArchive($this->archiveId, false);
if (empty($this->harvesterPluginName) && $this->archive) {
$this->harvesterPluginName = $this->archive->getHarvesterPluginName();
}
}
if (empty($this->harvesterPluginName)) {
$site =& Request::getSite();
$this->harvesterPluginName = $site->getSetting('defaultHarvesterPlugin');
}
$this->harvesters =& PluginRegistry::loadCategory('harvesters');
HookRegistry::call('ArchiveForm::ArchiveForm', array(&$this, $this->harvesterPluginName));
}
示例4: 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;
}
示例5: 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));
}
示例6: 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;
}
示例7: 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);
}
}
}
示例8: 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!';
}
示例9: index
function index()
{
$this->validate();
PluginRegistry::loadCategory('schemas');
$oai = new ArchiveOAI(new OAIConfig(Request::getRequestUrl(), Config::getVar('oai', 'repository_id')));
$oai->execute();
}
示例10: 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);
}
示例11: 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));
}
}
示例12: 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);
}
}
}
}
示例13: ArchiveForm
/**
* Constructor.
* @param $archiveId omit for a new archive
*/
function ArchiveForm($archiveId = null, $allowManagement = false)
{
parent::Form('admin/archiveForm.tpl');
$this->archiveId = isset($archiveId) ? (int) $archiveId : null;
$this->allowManagement = $allowManagement;
// Validation checks for this form
$this->addCheck(new FormValidator($this, 'title', 'required', 'admin.archives.form.titleRequired'));
$this->addCheck(new FormValidator($this, 'url', 'required', 'admin.archives.form.urlRequired'));
$this->addCheck(new FormValidatorPost($this));
import('lib.pkp.classes.captcha.CaptchaManager');
$captchaManager = new CaptchaManager();
$this->captchaEnabled = $captchaManager->isEnabled();
if ($this->captchaEnabled && !Validation::isSiteAdmin()) {
$this->addCheck(new FormValidatorCaptcha($this, 'captcha', 'captchaId', 'common.captchaField.badCaptcha'));
}
$this->harvesterPluginName = Request::getUserVar('harvesterPluginName');
if ($archiveId) {
$archiveDao =& DAORegistry::getDAO('ArchiveDAO');
$this->archive =& $archiveDao->getArchive($this->archiveId, false);
if (empty($this->harvesterPluginName) && $this->archive) {
$this->harvesterPluginName = $this->archive->getHarvesterPluginName();
}
}
if (empty($this->harvesterPluginName)) {
$site =& Request::getSite();
$this->harvesterPluginName = $site->getSetting('defaultHarvesterPlugin');
}
$this->harvesters =& PluginRegistry::loadCategory('harvesters');
HookRegistry::call('ArchiveForm::ArchiveForm', array(&$this, $this->harvesterPluginName));
}
示例14: 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
示例15: index
function index()
{
$this->validate();
PluginRegistry::loadCategory('oaiMetadataFormats', true);
$oai = new JournalOAI(new OAIConfig(Request::getRequestUrl(), Config::getVar('oai', 'repository_id')));
$oai->execute();
}