本文整理汇总了PHP中PluginRegistry::getPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistry::getPlugin方法的具体用法?PHP PluginRegistry::getPlugin怎么用?PHP PluginRegistry::getPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginRegistry
的用法示例。
在下文中一共展示了PluginRegistry::getPlugin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: 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');
}
示例4: isTinyMCEInstalled
function isTinyMCEInstalled()
{
$tinyMCEPlugin =& PluginRegistry::getPlugin('generic', 'TinyMCEPlugin');
if ($tinyMCEPlugin) {
return $tinyMCEPlugin->getEnabled();
}
return false;
}
示例5: status
/**
* Display status of deposit(s)
* @param array $args
* @param Request $request
*/
function status($args = array(), &$request)
{
$journal =& $request->getJournal();
$plnPlugin =& PluginRegistry::getPlugin('generic', PLN_PLUGIN_NAME);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageHierarchy', array(array($router->url($request, null, 'about'), 'about.aboutTheJournal')));
$templateMgr->display($plnPlugin->getTemplatePath() . DIRECTORY_SEPARATOR . 'status.tpl');
}
示例6: executeActions
/**
* @see ScheduledTask::executeActions()
*/
function executeActions()
{
$ofrPlugin =& PluginRegistry::getPlugin('generic', 'objectsforreviewplugin');
if ($ofrPlugin) {
$ofrPluginName = $ofrPlugin->getName();
// Get all journals
$journalDao =& DAORegistry::getDAO('JournalDAO');
$journals =& $journalDao->getJournals(true);
// Register the plugin DAOs and get the others
$ofrPlugin->registerDAOs();
$pluginSettingsDao =& DAORegistry::getDAO('PluginSettingsDAO');
$ofrAssignmentDao =& DAORegistry::getDAO('ObjectForReviewAssignmentDAO');
// For all journals
while ($journal =& $journals->next()) {
$journalId = $journal->getId();
// If the plugin is enabled
$pluginEnabled = $pluginSettingsDao->getSetting($journalId, $ofrPluginName, 'enabled');
if ($pluginEnabled) {
// Get plugin reminder settings
$enableDueReminderBefore = $pluginSettingsDao->getSetting($journalId, $ofrPluginName, 'enableDueReminderBefore');
$enableDueReminderAfter = $pluginSettingsDao->getSetting($journalId, $ofrPluginName, 'enableDueReminderAfter');
$beforeDays = $pluginSettingsDao->getSetting($journalId, $ofrPluginName, 'numDaysBeforeDueReminder');
$afterDays = $pluginSettingsDao->getSetting($journalId, $ofrPluginName, 'numDaysAfterDueReminder');
// If a reminder is set
if ($enableDueReminderBefore && $beforeDays > 0 || $enableDueReminderAfter && $afterDays > 0) {
// Retrieve all incomplete object for review assignments
$incompleteAssignments =& $ofrAssignmentDao->getIncompleteAssignmentsByContextId($journalId);
foreach ($incompleteAssignments as $incompleteAssignment) {
if ($incompleteAssignment->getDateDue() != null) {
$dueDate = strtotime($incompleteAssignment->getDateDue());
// Remind before:
// If there hasn't been any such reminder, this option is set and due date is in the future
if ($incompleteAssignment->getDateRemindedBefore() == null && $enableDueReminderBefore == 1 && time() < $dueDate) {
$nowToDueDate = $dueDate - time();
if ($nowToDueDate < 60 * 60 * 24 * $beforeDays) {
$this->sendReminder($incompleteAssignment, $journal, 'OFR_REVIEW_REMINDER');
}
}
// Remind after:
// If there hasn't been any such reminder, this option is set and due date is in the past
if ($incompleteAssignment->getDateRemindedAfter() == null && $enableDueReminderAfter == 1 && time() > $dueDate) {
$dueDateToNow = time() - $dueDate;
if ($dueDateToNow > 60 * 60 * 24 * $afterDays) {
$this->sendReminder($incompleteAssignment, $journal, 'OFR_REVIEW_REMINDER_LATE');
}
}
}
}
}
}
unset($journal);
}
return true;
} else {
return false;
}
}
示例7: CopyAccessLogFileTool
/**
* Constructor.
* @param $argv array command-line arguments
*/
function CopyAccessLogFileTool($argv = array())
{
parent::CommandLineTool($argv);
if (sizeof($this->argv) !== 1) {
$this->usage();
exit(1);
}
$plugin =& PluginRegistry::getPlugin('generic', 'usagestatsplugin');
/* @var $plugin UsageStatsPlugin */
$this->_usageStatsDir = $plugin->getFilesPath();
$this->_tmpDir = $this->_usageStatsDir . DIRECTORY_SEPARATOR . 'tmp';
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_ADMIN);
// This tool needs egrep and gunzip path configured.
$this->_egrepPath = escapeshellarg(Config::getVar('cli', 'egrep'));
if ($this->_egrepPath == "''") {
printf(__('admin.copyAccessLogFileTool.error.noEgrep') . "\n");
exit(1);
}
$this->_gunzipPath = escapeshellarg(Config::getVar('cli', 'gunzip'));
if ($this->_gunzipPath == "''") {
printf(__('admin.copyAccessLogFileTool.error.noGunzip') . "\n");
exit(1);
}
// Get a list of files currently inside the usage stats dir.
$fileLoaderDirs = array(FILE_LOADER_PATH_STAGING, FILE_LOADER_PATH_PROCESSING, FILE_LOADER_PATH_ARCHIVE, FILE_LOADER_PATH_REJECT);
$usageStatsFiles = array();
foreach ($fileLoaderDirs as $dir) {
$dirFiles = glob($this->_usageStatsDir . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . '*');
if (is_array($dirFiles) && count($dirFiles) > 0) {
foreach ($dirFiles as $file) {
if (!is_file($file)) {
continue;
}
$fileBasename = pathinfo($file, PATHINFO_BASENAME);
if (pathinfo($file, PATHINFO_EXTENSION) == 'gz') {
// Always save the filename without compression extension.
$fileBasename = substr($fileBasename, 0, -3);
}
$usageStatsFiles[] = $fileBasename;
}
}
}
$this->_usageStatsFiles = $usageStatsFiles;
// Get a list of context paths.
$contextDao =& Application::getContextDAO();
/* @var $contextDao ContextDAO */
$contextFactory = $contextDao->getAll();
$contextPaths = array();
while ($context =& $contextFactory->next()) {
/* @var $context Context */
$contextPaths[] = escapeshellarg($context->getPath());
}
$contextPaths = implode('/|/', $contextPaths);
$this->_contextPaths = $contextPaths;
}
示例8: DataciteInfoSender
/**
* Constructor.
* @param $argv array task arguments
*/
function DataciteInfoSender($args)
{
PluginRegistry::loadCategory('importexport');
$plugin =& PluginRegistry::getPlugin('importexport', 'DataciteExportPlugin');
/* @var $plugin CrossRefExportPlugin */
$this->_plugin =& $plugin;
if (is_a($plugin, 'DataciteExportPlugin')) {
$plugin->addLocaleData();
}
parent::ScheduledTask($args);
}
示例9: MedraInfoSender
/**
* Constructor.
* @param $argv array task arguments
*/
function MedraInfoSender($args)
{
PluginRegistry::loadCategory('importexport');
$plugin = PluginRegistry::getPlugin('importexport', 'MedraExportPlugin');
/* @var $plugin MedraExportPlugin */
$this->_plugin = $plugin;
if (is_a($plugin, 'MedraExportPlugin')) {
$plugin->addLocaleData();
}
parent::ScheduledTask($args);
}
示例10: StaticPage
function &_returnStaticPageFromRow(&$row)
{
$staticPagesPlugin =& PluginRegistry::getPlugin('generic', 'StaticPagesPlugin');
$staticPagesPlugin->import('StaticPage');
$staticPage = new StaticPage();
$staticPage->setId($row['static_page_id']);
$staticPage->setPath($row['path']);
$staticPage->setConferenceId($row['conference_id']);
$this->getDataObjectSettings('static_page_settings', 'static_page_id', $row['static_page_id'], $staticPage);
return $staticPage;
}
示例11: BlogPage
function &_returnBlogPageFromRow(&$row)
{
$blogPagesPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);
$blogPagesPlugin->import('BlogPage');
$blogPage = new BlogPage();
$blogPage->setId($row['blog_page_id']);
$blogPage->setPath($row['path']);
$blogPage->setJournalId($row['journal_id']);
$this->getDataObjectSettings('blog_page_settings', 'blog_page_id', $row['blog_page_id'], $blogPage);
return $blogPage;
}
示例12: __construct
/**
* Constructor.
* @param $argv array task arguments
*/
function __construct($args)
{
PluginRegistry::loadCategory('importexport');
$plugin = PluginRegistry::getPlugin('importexport', 'MedraExportPlugin');
/* @var $plugin MedraExportPlugin */
$this->_plugin = $plugin;
if (is_a($plugin, 'MedraExportPlugin')) {
$plugin->addLocaleData();
}
parent::__construct($args);
}
示例13: ArticleInfoSender
/**
* Constructor.
* @param $argv array task arguments
*/
function ArticleInfoSender($args)
{
PluginRegistry::loadCategory('generic');
$plugin =& PluginRegistry::getPlugin('generic', 'almplugin');
/* @var $plugin AlmPlugin */
$this->_plugin =& $plugin;
if (is_a($plugin, 'AlmPlugin')) {
$plugin->addLocaleData();
$this->_depositUrl = $plugin->getSetting(CONTEXT_ID_NONE, 'depositUrl');
}
parent::ScheduledTask($args);
}
示例14: setUp
/**
* @see PKPTestCase::setUp()
*/
protected function setUp()
{
$this->markTestSkipped('Needs fixing.');
parent::setUp();
// Instantiate the plug-in for testing.
$this->mockRequest();
PluginRegistry::loadCategory('generic', true, 0);
$this->lucenePlugin = PluginRegistry::getPlugin('generic', 'luceneplugin');
if (!$this->lucenePlugin) {
$this->markTestSkipped('Could not fetch Lucene plugin!');
}
}
示例15: execute
/**
* @see Form::execute()
*/
function execute()
{
$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);
$ofrPlugin->import('classes.ObjectForReviewAssignment');
$journal =& Request::getJournal();
$journalId = $journal->getId();
$ofrAssignemntDao =& DAORegistry::getDAO('ObjectForReviewAssignmentDAO');
$ofrAssignment =& $ofrAssignemntDao->getById($this->assignmentId, $this->objectId);
if (isset($ofrAssignment)) {
$ofrAssignment->setAgreedToTerms(1);
$ofrAssignemntDao->updateObject($ofrAssignment);
}
}
开发者ID:justinshaffner,项目名称:AAAObjectsForReview,代码行数:16,代码来源:ObjectForReviewReviewAgreementForm.inc.php