Exemplo n.º 1
0
 /**
  * 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')) {
         return false;
     }
     $this->addLocaleData();
     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('authordao::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;
 }
Exemplo n.º 2
0
 function manage($verb, $args, &$message)
 {
     if (!parent::manage($verb, $args, $message)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $journal =& Request::getJournal();
             $this->import('ReferralPluginSettingsForm');
             $form = new ReferralPluginSettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin');
                     return false;
                 } else {
                     $this->setBreadCrumbs(true);
                     $form->display();
                 }
             } else {
                 $this->setBreadCrumbs(true);
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
     }
 }
Exemplo n.º 3
0
 /**
  * @see GenericPlugin::manage()
  */
 function manage($verb, $args, &$message, &$messageParams)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     $message = NOTIFICATION_TYPE_SUCCESS;
                     $messageParams = array('contents' => __('plugins.generic.alm.settings.saved'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
Exemplo n.º 4
0
 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);
             $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('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;
 }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
0
 function manage($verb, $args)
 {
     if (!parent::manage($verb, $args, $message)) {
         return false;
     }
     $this->import('CustomLocaleHandler');
     $customLocaleHandler = new CustomLocaleHandler();
     switch ($verb) {
         case 'edit':
             $customLocaleHandler->edit($args);
             return true;
         case 'saveLocaleChanges':
             $customLocaleHandler->saveLocaleChanges($args);
             return true;
         case 'editLocaleFile':
             $customLocaleHandler->editLocaleFile($args);
             return true;
         case 'saveLocaleFile':
             $customLocaleHandler->saveLocaleFile($args);
             return true;
         default:
             $customLocaleHandler->index();
             return true;
     }
 }
Exemplo n.º 7
0
 /**
  * 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;
 }
 /**
  * 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;
 }
Exemplo n.º 10
0
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         HookRegistry::register('TemplateManager::display', array(&$this, 'addmeta'));
         return true;
     }
     return false;
 }
Exemplo n.º 11
0
 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)) {
         if ($this->getEnabled()) {
             HookRegistry::register('ArticleFileManager::handleUpload', array(&$this, 'callback'));
         }
         return true;
     }
     return false;
 }
Exemplo n.º 13
0
 /**
  * @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;
 }
Exemplo n.º 14
0
 /**
  * @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;
 }
Exemplo n.º 15
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;
 }
Exemplo n.º 16
0
 /**
  * @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;
 }
Exemplo n.º 17
0
 /**
  * @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;
 }
Exemplo n.º 18
0
 /**
  * @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;
 }
Exemplo n.º 19
0
 /**
  * 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()) {
         HookRegistry::register('Templates::Article::Footer::PageFooter', array($this, 'insertFooter'));
     }
     return $success;
 }
Exemplo n.º 20
0
 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;
 }
Exemplo n.º 21
0
 /**
  * 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)) {
         $this->addLocaleData();
         if ($this->isMCEInstalled() && $this->getEnabled()) {
             HookRegistry::register('TemplateManager::display', 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;
 }
 /**
  * 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;
 }
Exemplo n.º 24
0
 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'));
         }
         $this->addLocaleData();
         return true;
     }
     return false;
 }
Exemplo n.º 25
0
 function register($category, $path)
 {
     if (!Config::getVar('general', 'installed')) {
         return false;
     }
     if (parent::register($category, $path)) {
         $this->addLocaleData();
         HookRegistry::register('Plugins::CmsHandler', array(&$this, 'callbackAddRssFeeds'));
         return true;
     }
     return false;
 }
Exemplo n.º 26
0
 /**
  * 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()) {
             HookRegistry::register('Templates::About::Index::Other', array(&$this, 'callback'));
             HookRegistry::register('LoadHandler', array(&$this, 'handleRequest'));
         }
         $this->addLocaleData();
         return true;
     }
     return false;
 }
Exemplo n.º 27
0
 /**
  * Register the plugin, if enabled; note that this plugin
  * runs under both Conference and Site contexts.
  * @param $category string
  * @param $path string
  * @return boolean
  */
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         $this->addLocaleData();
         if ($this->getEnabled() && Validation::isSiteAdmin()) {
             HookRegistry::register('Templates::Admin::Index::AdminFunctions', array($this, 'addLink'));
             HookRegistry::register('LoadHandler', array($this, 'handleRequest'));
         }
         return true;
     }
     return false;
 }
Exemplo n.º 28
0
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         $this->addLocaleData();
         if ($this->getSetting(0, 0, 'enabled')) {
             $this->addHelpData();
             HookRegistry::register('LoadHandler', array(&$this, 'handleRequest'));
         }
         return true;
     }
     return false;
 }
Exemplo n.º 29
0
 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         $journal =& Request::getJournal();
         $journalId = $journal ? $journal->getJournalId() : 0;
         $isEnabled = $this->getSetting($journalId, 'enabled');
         $this->addLocaleData();
         HookRegistry::register('TemplateManager::display', array(&$this, 'displayTemplateCallback'));
         return true;
     }
     return false;
 }
Exemplo n.º 30
0
 /**
  * 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')) {
         return false;
     }
     $this->addLocaleData();
     if ($success) {
         HookRegistry::register('Templates::Article::Footer::PageFooter', array($this, 'insertFooter'));
     }
     return $success;
 }