Beispiel #1
0
 /**
  * Constructor
  */
 function __construct()
 {
     parent::__construct();
     if ($this->getEnabled()) {
         HookRegistry::register('TemplateManager::display', array($this, 'loadJavaScript'));
     }
 }
Beispiel #2
0
 /**
  * Constructor
  */
 function CitationPlugin()
 {
     parent::Plugin();
     if ($this->getEnabled()) {
         HookRegistry::register('TemplateManager::display', array($this, 'loadJavaScript'));
     }
 }
 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;
 }
 /**
  * Return an HTML-formatted citation. Default implementation displays
  * an HTML-based citation using the citation.tpl template in the plugin
  * path.
  * @param $article object
  * @param $issue object
  */
 function cite(&$article, &$issue)
 {
     HookRegistry::register('Template::RT::CaptureCite', array(&$this, 'displayCitation'));
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('citationPlugin', $this);
     $templateMgr->display('rt/captureCite.tpl');
 }
 /**
  * @covers PKPRequest::redirectUrl
  */
 public function testRedirectUrl()
 {
     HookRegistry::register('Request::redirect', array($this, 'redirectUrlHook'));
     $this->request->redirectUrl('http://some.url/');
     self::assertEquals(array(array('Request::redirect', array('http://some.url/'))), HookRegistry::getCalledHooks());
     HookRegistry::clear('Request::redirect');
 }
 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 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;
 }
 /**
  * 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;
 }
Beispiel #10
0
 /**
  * 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;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
Beispiel #13
0
 /**
  * Called as a plugin is registered to the registry. Subclasses over-
  * riding this method should call the parent method first.
  * @param $category String Name of category plugin was registered to
  * @param $path String The path the plugin was found in
  * @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) {
         HookRegistry::register('Template::Manager::Payment::displayPaymentSettingsForm', array(&$this, '_smartyDisplayPaymentSettingsForm'));
     }
     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;
 }
 /**
  * Register the plugin.
  * @see Plugin::register
  */
 function register($category, $path)
 {
     $result = parent::register($category, $path);
     if ($result && $this->isEnabled()) {
         HookRegistry::register('Harvester::preprocessRecord', array(&$this, '_preprocessRecord'));
     }
     return $result;
 }
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         error_log('OJS - UHBP: der Haken wird registriert.');
         Registry::set('UserHomeBlockPlugin', $this);
         HookRegistry::register('Templates::User::Index::MyAccount', array(&$this, 'callback'));
     }
 }
 function register($category, $path)
 {
     $result = parent::register($category, $path);
     if ($result) {
         HookRegistry::register('Harvester::postprocessRecord', array(&$this, '_postprocessRecord'));
     }
     return $result;
 }
 /**
  * Called as a plugin is registered to the registry. Subclasses over-
  * riding this method should call the parent method first.
  * @param $category String Name of category plugin was registered to
  * @param $path String The path the plugin was found in
  * @return boolean True iff plugin initialized successfully; if false,
  * 	the plugin will not be registered.
  */
 function register($category, $path)
 {
     if (!parent::register($category, $path)) {
         return false;
     }
     HookRegistry::register('Template::Manager::Payment::displayPaymentSettingsForm', array($this, '_smartyDisplayPaymentSettingsForm'));
     return true;
 }
Beispiel #19
0
 /**
  * @copydoc Plugin::register()
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     if ($success) {
         HookRegistry::register('AcronPlugin::parseCronTab', array($this, 'callbackParseCronTab'));
     }
     return $success;
 }
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         HookRegistry::register('TemplateManager::display', array(&$this, 'addmeta'));
         return true;
     }
     return false;
 }
 /**
  * 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;
 }
Beispiel #22
0
 /**
  * Called as a plugin is registered to the registry. Subclasses over-
  * riding this method should call the parent method first.
  * @param $category String Name of category plugin was registered to
  * @param $path String The path the plugin was found in
  * @return boolean True iff plugin initialized successfully; if false,
  * 	the plugin will not be registered.
  */
 function register($category, $path)
 {
     $returner = parent::register($category, $path);
     if ($this->getNewConferencePluginSettingsFile()) {
         HookRegistry::register('ConferenceSiteSettingsForm::execute', array(&$this, 'installConferenceSettings'));
     }
     return $returner;
 }
 function register($category, $path)
 {
     $result = parent::register($category, $path);
     if ($result) {
         HookRegistry::register('Harvester::insertEntry', array(&$this, '_preprocessEntry'));
     }
     return $result;
 }
 function register($category, $path)
 {
     $result = parent::register($category, $path);
     if ($result) {
         HookRegistry::register('SchemaPlugin::indexRecord', array(&$this, '_postprocessEntry'));
     }
     return $result;
 }
Beispiel #25
0
 /**
  * Register this plugin for all the appropriate hooks.
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     if ($success) {
         HookRegistry::register('OAI::metadataFormats', array(&$this, 'callback_formatRequest'));
     }
     return $success;
 }
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         //HookRegistry::register('Templates::Manager::Index::ManagementPages', array(&$this, 'callback'));
         HookRegistry::register('Templates::Manager::Index::TemaPortal', array(&$this, 'callback'));
         return true;
     }
     return false;
 }
 /**
  * Register the plugin.
  */
 function register($category, $path)
 {
     $success = parent::register($category, $path);
     if ($success) {
         HookRegistry::register('TinyMCEPlugin::getEnableFields', array(&$this, 'addDescriptionField'));
     }
     $this->addLocaleData();
     return $success;
 }
 /**
  * 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)
 {
     if (parent::register($category, $path)) {
         $this->addLocaleData();
         HookRegistry::register('OAI::metadataFormats', array(&$this, 'callback_formatRequest'));
         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;
 }
Beispiel #30
0
 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;
 }