/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); if (!Config::getVar('general', 'installed') || defined('RUNNING_UPGRADE')) { return true; } if ($success && $this->getEnabled()) { // Insert field into author submission page and metadata form HookRegistry::register('Templates::Author::Submit::Authors', array($this, 'metadataField')); HookRegistry::register('Templates::Submission::MetadataEdit::Authors', array($this, 'metadataField')); // Hook for initData in two forms HookRegistry::register('metadataform::initdata', array($this, 'metadataInitData')); HookRegistry::register('authorsubmitstep3form::initdata', array($this, 'metadataInitData')); // Hook for execute in two forms HookRegistry::register('authorsubmitstep3form::execute', array($this, 'metadataExecute')); HookRegistry::register('metadataform::execute', array($this, 'metadataExecute')); // Add element for AuthorDAO for storage HookRegistry::register('pkpauthordao::getAdditionalFieldNames', array($this, 'authorSubmitGetFieldNames')); // Insert Google Analytics page tag to common footer HookRegistry::register('Templates::Common::Footer::PageFooter', array($this, 'insertFooter')); // Insert Google Analytics page tag to article footer HookRegistry::register('Templates::Article::Footer::PageFooter', array($this, 'insertFooter')); // Insert Google Analytics page tag to article interstitial footer HookRegistry::register('Templates::Article::Interstitial::PageFooter', array($this, 'insertFooter')); // Insert Google Analytics page tag to article pdf interstitial footer HookRegistry::register('Templates::Article::PdfInterstitial::PageFooter', array($this, 'insertFooter')); // Insert Google Analytics page tag to reading tools footer HookRegistry::register('Templates::Rt::Footer::PageFooter', array($this, 'insertFooter')); // Insert Google Analytics page tag to help footer HookRegistry::register('Templates::Help::Footer::PageFooter', array($this, 'insertFooter')); } return $success; }
function register($category, $path) { if (parent::register($category, $path)) { $this->addLocaleData(); if ($this->getEnabled()) { // Add custom locale data for already registered locale files. $locale = Locale::getLocale(); $localeFiles = Locale::getLocaleFiles($locale); $conference = Request::getConference(); $conferenceId = $conference->getId(); $publicFilesDir = Config::getVar('files', 'public_files_dir'); $customLocalePathBase = $publicFilesDir . DIRECTORY_SEPARATOR . 'conferences' . DIRECTORY_SEPARATOR . $conferenceId . DIRECTORY_SEPARATOR . CUSTOM_LOCALE_DIR . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR; import('file.FileManager'); foreach ($localeFiles as $localeFile) { $customLocalePath = $customLocalePathBase . $localeFile->getFilename(); if (FileManager::fileExists($customLocalePath)) { Locale::registerLocaleFile($locale, $customLocalePath, true); } } // Add custom locale data for all locale files registered after this plugin HookRegistry::register('PKPLocale::registerLocaleFile', array(&$this, 'addCustomLocale')); } return true; } return false; }
function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { // Add custom locale data for already registered locale files. $locale = AppLocale::getLocale(); $localeFiles = AppLocale::getLocaleFiles($locale); $journal = Request::getJournal(); $journalId = $journal->getId(); $publicFilesDir = Config::getVar('files', 'public_files_dir'); $customLocalePathBase = $publicFilesDir . DIRECTORY_SEPARATOR . 'journals' . DIRECTORY_SEPARATOR . $journalId . DIRECTORY_SEPARATOR . CUSTOM_LOCALE_DIR . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR; import('lib.pkp.classes.file.FileManager'); $fileManager = new FileManager(); foreach ($localeFiles as $localeFile) { $customLocalePath = $customLocalePathBase . $localeFile->getFilename(); if ($fileManager->fileExists($customLocalePath)) { AppLocale::registerLocaleFile($locale, $customLocalePath, true); } } // Add custom locale data for all locale files registered after this plugin HookRegistry::register('PKPLocale::registerLocaleFile', array(&$this, 'addCustomLocale')); } return true; } return false; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True if plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); $this->addLocaleData(); $this->import('pidResourceDAO'); $this->import('pidHandler'); $pidResourceDao = new pidResourceDao(); DAORegistry::registerDAO('pidResourceDAO', $pidResourceDao); $this->journal =& Request::getJournal(); $isEnabled = $this->getEnabled(); if ($success) { if ($isEnabled === true) { HookRegistry::register('Template::Author::Submission::Status', array(&$this, 'submissionStatus')); HookRegistry::register('Template::sectionEditor::Submission::Status', array(&$this, 'submissionStatus')); HookRegistry::register('Template::Article::PID', array(&$this, 'articleTemplate')); HookRegistry::register('ArticleDAO::_updateArticle', array(&$this, 'publishedArticlePidHandler')); //Older OJS Versions HookRegistry::register('articledao::_updatearticle', array(&$this, 'publishedArticlePidHandler')); //Newer OJS Versions } HookRegistry::register('OAIDAOinc::_getRecord', array(&$this, 'OAIRecordsHandler')); HookRegistry::register('OAIDAOinc::_listRecords', array(&$this, 'OAIRecordsHandler')); } return $success; }
/** * Register the plugin, if enabled * @param $category string * @param $path string * @return boolean */ function register($category, $path) { if (parent::register($category, $path)) { // HookRegistry::register('Installer::postInstall',array(&$this, 'postInstallCallback')); if ($this->getEnabled()) { $this->addHelpData(); // Add DAOs $this->import('CrosswalkDAO'); $this->import('Crosswalk'); $this->import('Search'); $this->import('SearchIndex'); $this->import('SearchDAO'); $crosswalkDao = new CrosswalkDAO(); DAORegistry::registerDAO('CrosswalkDAO', $crosswalkDao); $searchDao = new SearchDAO(); DAORegistry::registerDAO('SearchDAO', $searchDao); /** * Set hooks */ // Record handling & harvesting HookRegistry::register('Harvester::insertRecord', array(&$this, 'insertRecordCallback')); HookRegistry::register('Harvester::updateRecord', array(&$this, 'updateRecordCallback')); HookRegistry::register('Harvester::deleteRecord', array(&$this, 'deleteRecordCallback')); // User interface HookRegistry::register('Templates::Common::Header::Navbar', array(&$this, 'navBarCallback')); HookRegistry::register('Template::Admin::Index::SiteManagement', array(&$this, 'siteManagementCallback')); HookRegistry::register('LoadHandler', array(&$this, 'loadHandlerCallback')); HookRegistry::register('PluginRegistry::loadCategory', array(&$this, 'callbackLoadCategory')); // Rebuild index HookRegistry::register('rebuildSearchIndex::flush', array(&$this, 'callbackFlush')); } return true; } return false; }
/** * @see LazyLoadPlugin::register() */ function register($category, $path) { $success = parent::register($category, $path); HookRegistry::register('AcronPlugin::parseCronTab', array($this, 'callbackParseCronTab')); if ($this->getEnabled() && $success) { // Register callbacks. HookRegistry::register('PluginRegistry::loadCategory', array($this, 'callbackLoadCategory')); HookRegistry::register('LoadHandler', array($this, 'callbackLoadHandler')); // If the plugin will provide the access logs, // register to the usage event hook provider. if ($this->getSetting(CONTEXT_ID_NONE, 'createLogFiles')) { HookRegistry::register('UsageEventPlugin::getUsageEvent', array(&$this, 'logUsageEvent')); } $this->_dataPrivacyOn = $this->getSetting(CONTEXT_ID_NONE, 'dataPrivacyOption'); $this->_saltpath = $this->getSetting(CONTEXT_ID_NONE, 'saltFilepath'); // Check config for backward compatibility. if (!$this->_saltpath) { $this->_saltpath = Config::getVar('usageStats', 'salt_filepath'); } $application = Application::getApplication(); $request = $application->getRequest(); $this->_optedOut = $request->getCookieVar('usageStats-opt-out'); if ($this->_optedOut) { // Renew the Opt-Out cookie if present. $request->setCookieVar('usageStats-opt-out', true, time() + 60 * 60 * 24 * 365); } } return $success; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); if ($success && $this->getEnabled()) { HookRegistry::register('OAIDAO::_getRecords', array($this, 'filterEruditOAI')); } return $success; }
function register($category, $path) { if (parent::register($category, $path)) { HookRegistry::register('TemplateManager::display', array(&$this, 'addmeta')); return true; } return false; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); if ($success && $this->getEnabled()) { HookRegistry::register('metadataform::validate', array($this, 'callbackSaveMetadata')); } return $success; }
/** * Register the plugin, if enabled; note that this plugin * runs under both Journal and Site contexts. * @param $category string * @param $path string * @return boolean */ function register($category, $path) { if (parent::register($category, $path)) { HookRegistry::register('ArticleHandler::download', array(&$this, 'callback')); return true; } return false; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); if ($success && $this->getEnabled()) { HookRegistry::register('TemplateManager::display', array($this, 'redirectRequest')); } return $success; }
/** * @see LazyLoadPlugin::register() */ function register($category, $path) { $success = parent::register($category, $path); if ($success && $this->getEnabled()) { // Dataverse Study objects $this->import('classes.DataverseStudyDAO'); $dataverseStudyDao = new DataverseStudyDAO($this->getName()); $returner =& DAORegistry::registerDAO('DataverseStudyDAO', $dataverseStudyDao); // Files associated with Dataverse studies $this->import('classes.DataverseFileDAO'); $dataverseFileDao = new DataverseFileDAO($this->getName()); $returner =& DAORegistry::registerDAO('DataverseFileDAO', $dataverseFileDao); // Handler for public (?) access to Dataverse-related information (i.e., terms of Use) HookRegistry::register('LoadHandler', array(&$this, 'setupPublicHandler')); // Add data citation to submissions & reading tools HookRegistry::register('TemplateManager::display', array(&$this, 'handleTemplateDisplay')); // Add data citation to article landing page HookRegistry::register('Templates::Article::MoreInfo', array(&$this, 'addDataCitationArticle')); // Enable TinyMCEditor in textarea fields HookRegistry::register('TinyMCEPlugin::getEnableFields', array(&$this, 'getTinyMCEEnabledFields')); // Include data policy in About page HookRegistry::register('Templates::About::Index::Policies', array(&$this, 'addPolicyLinks')); // Add data publication options to author submission suppfile form: HookRegistry::register('Templates::Author::Submit::SuppFile::AdditionalMetadata', array(&$this, 'suppFileAdditionalMetadata')); HookRegistry::register('authorsubmitsuppfileform::initdata', array(&$this, 'suppFileFormInitData')); HookRegistry::register('authorsubmitsuppfileform::readuservars', array(&$this, 'suppFileFormReadUserVars')); HookRegistry::register('authorsubmitsuppfileform::execute', array(&$this, 'authorSubmitSuppFileFormExecute')); // Add Dataverse deposit options to suppfile form for completed submissions HookRegistry::register('Templates::Submission::SuppFile::AdditionalMetadata', array(&$this, 'suppFileAdditionalMetadata')); HookRegistry::register('suppfileform::initdata', array(&$this, 'suppFileFormInitData')); HookRegistry::register('suppfileform::readuservars', array(&$this, 'suppFileFormReadUserVars')); HookRegistry::register('suppfileform::execute', array(&$this, 'suppFileFormExecute')); // Notify ArticleDAO of additional metadata fields in suppfile form HookRegistry::register('articledao::getAdditionalFieldNames', array(&$this, 'articleMetadataFormFieldNames')); // Validate suppfile forms: warn if Dataverse deposit selected but no file uploaded HookRegistry::register('authorsubmitsuppfileform::Constructor', array(&$this, 'suppFileFormConstructor')); HookRegistry::register('suppfileform::Constructor', array(&$this, 'suppFileFormConstructor')); // Metadata form: update cataloguing information. Prevent update if study locked. HookRegistry::register('metadataform::Constructor', array(&$this, 'metadataFormConstructor')); HookRegistry::register('metadataform::execute', array(&$this, 'metadataFormExecute')); // Handle suppfile insertion: prevent duplicate insertion of a suppfile HookRegistry::register('suppfiledao::_insertsuppfile', array(&$this, 'handleSuppFileInsertion')); // Handle suppfile deletion: only necessary for completed submissions HookRegistry::register('suppfiledao::_deletesuppfilebyid', array(&$this, 'handleSuppFileDeletion')); // Add form validator to check whether submission includes data files HookRegistry::register('authorsubmitstep4form::Constructor', array(&$this, 'addAuthorSubmitFormValidator')); // Create study for author submissions HookRegistry::register('Author::SubmitHandler::saveSubmit', array(&$this, 'handleAuthorSubmission')); // Release or delete studies according to editor decision HookRegistry::register('SectionEditorAction::unsuitableSubmission', array(&$this, 'handleUnsuitableSubmission')); HookRegistry::register('SectionEditorAction::recordDecision', array(&$this, 'handleEditorDecision')); // Release studies on article publication HookRegistry::register('articledao::_updatearticle', array(&$this, 'handleArticleUpdate')); // Get content for plugin notifications HookRegistry::register('NotificationManager::getNotificationContents', array(&$this, 'getNotificationContents')); } return $success; }
/** * Register the plugin. * @param $category string * @param $path string */ function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('Templates::Catalog::Book::BookInfo::Sharing', array(&$this, 'callbackSharingDisplay')); } return true; } return false; }
/** * @see Plugin::register() */ function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('ArticleHandler::view::galley', array($this, 'articleCallback')); } return true; } return false; }
function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('LoadHandler', array($this, 'handleRequest')); } return true; } return false; }
/** * @see PKPPlugin::register() */ function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('Templates::Galley::displayGalley', array($this, 'callback')); } return true; } return false; }
function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('TemplateManager::include', array(&$this, '_callback')); } return true; } return false; }
function register($category, $path) { if (parent::register($category, $path)) { $journal =& Request::getJournal(); $journalId = $journal ? $journal->getId() : 0; HookRegistry::register('TemplateManager::display', array(&$this, 'displayTemplateCallback')); return true; } return false; }
/** * Register the plugin, if enabled * @param $category string * @param $path string * @return boolean */ function register($category, $path) { if (parent::register($category, $path)) { if ($this->isMCEInstalled() && $this->getEnabled()) { HookRegistry::register('TemplateManager::display', array(&$this, 'callback')); } return true; } return false; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); $this->addLocaleData(); if ($success && $this->getEnabled()) { // Handler for templates callbacks HookRegistry::register('TemplateManager::display', array(&$this, 'templateManagerCallback')); } return $success; }
function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('ArticleFileManager::handleUpload', array(&$this, 'callback')); } return true; } return false; }
/** * @see Plugin::register() */ function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('CatalogBookHandler::view', array($this, 'viewCallback')); HookRegistry::register('CatalogBookHandler::download', array($this, 'downloadCallback')); } return true; } return false; }
/** * @copydoc LazyLoadPlugin::register() */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { if ($this->getEnabled()) { HookRegistry::register('Mail::send', array($this, 'mailSendCallback')); HookRegistry::register('PKPNotificationOperationManager::sendNotificationEmail', array($this, 'recordNotificationDetails')); } } return $success; }
function register($category, $path) { if (parent::register($category, $path)) { HookRegistry::register('PluginRegistry::loadCategory', array(&$this, 'callbackLoadCategory')); if ($this->getEnabled()) { } $this->addLocaleData(); return true; } return false; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { $this->addLocaleData(); HookRegistry::register('LoadHandler', array(&$this, 'callbackHandlePluginForm')); } return true; } return false; }
function register($category, $path) { if (parent::register($category, $path)) { if ($this->getEnabled()) { HookRegistry::register('TemplateManager::display', array($this, 'callbackAddLinks')); HookRegistry::register('PluginRegistry::loadCategory', array($this, 'callbackLoadCategory')); } return true; } return false; }
/** * @see LazyLoadPlugin::register() */ function register($category, $path) { $success = parent::register($category, $path); if ($success) { $eventHooks = $this->getEventHooks(); foreach ($eventHooks as $hook) { HookRegistry::register($hook, array($this, 'getUsageEvent')); } } return $success; }
/** * Called as a plugin is registered to the registry * @param $category String Name of category plugin was registered to * @return boolean True iff plugin initialized successfully; if false, * the plugin will not be registered. */ function register($category, $path) { $success = parent::register($category, $path); $this->addLocaleData(); if ($success && $this->getEnabled()) { $this->import('classes.BookForReviewDAO'); $this->import('classes.BookForReviewAuthorDAO'); $bfrAuthorDao = new BookForReviewAuthorDAO($this->getName()); DAORegistry::registerDAO('BookForReviewAuthorDAO', $bfrAuthorDao); $bfrDao = new BookForReviewDAO($this->getName()); DAORegistry::registerDAO('BookForReviewDAO', $bfrDao); $request = $this->getRequest(); $journal = $request->getJournal(); if ($journal) { $mode = $this->getSetting($journal->getId(), 'mode'); $coverPageIssue = $this->getSetting($journal->getId(), 'coverPageIssue'); $coverPageAbstract = $this->getSetting($journal->getId(), 'coverPageAbstract'); } // Handler for editor books for review pages HookRegistry::register('LoadHandler', array($this, 'setupEditorHandler')); // Editor link to books for review pages HookRegistry::register('Templates::Editor::Index::AdditionalItems', array($this, 'displayEditorHomeLink')); // Editor link to book for review metadata in submission view HookRegistry::register('Templates::Submission::Metadata::Metadata::AdditionalEditItems', array($this, 'displayEditorMetadataLink')); // Append book metadata to book review article HookRegistry::register('Templates::Article::Header::Metadata', array($this, 'displayBookMetadata')); // Ensure book for review user assignments are transferred when merging users HookRegistry::register('UserAction::mergeUsers', array($this, 'mergeBooksForReviewAuthors')); // If using book for review cover page as article cover page // then include cover page handlers for issue toc and article abstract views if ($coverPageIssue) { HookRegistry::register('Templates::Issue::Issue::ArticleCoverImage', array($this, 'displayArticleCoverPageIssue')); } if ($coverPageAbstract) { HookRegistry::register('Templates::Article::Article::ArticleCoverImage', array($this, 'displayArticleCoverPageAbstract')); } // If publishing books available for review and managing book reviewers // then include additional links, pages, and handlers if ($mode == BFR_MODE_FULL) { // Handler for public books for review pages HookRegistry::register('LoadHandler', array($this, 'setupPublicHandler')); // Navigation bar link to books for review page HookRegistry::register('Templates::Common::Header::Navbar::CurrentJournal', array($this, 'displayHeaderLink')); // Handler for author books for review pages HookRegistry::register('LoadHandler', array($this, 'setupAuthorHandler')); // Display author's books for review during submission HookRegistry::register('Author::SubmitHandler::saveSubmit', array($this, 'saveSubmitHandler')); HookRegistry::register('Templates::Author::Submit::Step5::AdditionalItems', array($this, 'displayAuthorBooksForReview')); // Author link to books for review pages HookRegistry::register('Templates::Author::Index::AdditionalItems', array($this, 'displayAuthorHomeLink')); } } return $success; }
/** * @see Plugin::register() */ function register($category, $path) { $success = parent::register($category, $path); if (!Config::getVar('general', 'installed') || defined('RUNNING_UPGRADE')) { return $success; } if ($success && $this->getEnabled()) { HookRegistry::register('Templates::Article::Footer::PageFooter', array($this, 'callbackTemplateArticlePageFooter')); } return $success; }
/** * @see PKPPlugin::register() */ function register($category, $path) { if (!Config::getVar('general', 'installed')) { return false; } $success = parent::register($category, $path); if ($success) { HookRegistry::register('LoadHandler', array(&$this, '_loadHandlerCallback')); } return $success; }