当前位置: 首页>>代码示例>>PHP>>正文


PHP GenericPlugin类代码示例

本文整理汇总了PHP中GenericPlugin的典型用法代码示例。如果您正苦于以下问题:PHP GenericPlugin类的具体用法?PHP GenericPlugin怎么用?PHP GenericPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GenericPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: manage

 /**
  * @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;
     }
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:36,代码来源:AlmPlugin.inc.php

示例2: register

 /**
  * 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;
 }
开发者ID:philschatz,项目名称:ojs,代码行数:40,代码来源:GoogleAnalyticsPlugin.inc.php

示例3: manage

 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);
     }
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:33,代码来源:ReferralPlugin.inc.php

示例4: register

 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;
 }
开发者ID:philschatz,项目名称:ojs,代码行数:26,代码来源:CustomLocalePlugin.inc.php

示例5: register

 /**
  * 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;
 }
开发者ID:EdwardDavid,项目名称:handle,代码行数:31,代码来源:pidPlugin.inc.php

示例6: manage

 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;
     }
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:25,代码来源:CustomLocalePlugin.inc.php

示例7: register

 /**
  * 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;
 }
开发者ID:asmecher,项目名称:hypothesis,代码行数:15,代码来源:HypothesisPlugin.inc.php

示例8: register

 /**
  * 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;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:14,代码来源:LLTNavigationPlugin.inc.php

示例9: register

 /**
  * 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;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:14,代码来源:EmptyAuthorEmailPlugin.inc.php

示例10: register

 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         HookRegistry::register('TemplateManager::display', array(&$this, 'addmeta'));
         return true;
     }
     return false;
 }
开发者ID:ajnyga,项目名称:addRobotMeta,代码行数:8,代码来源:AddRobotMetaPlugin.inc.php

示例11: register

 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         if ($this->getEnabled()) {
             HookRegistry::register('TemplateManager::include', array(&$this, '_callback'));
         }
         return true;
     }
     return false;
 }
开发者ID:reconciler,项目名称:ojs,代码行数:10,代码来源:GoogleViewerPlugin.inc.php

示例12: register

 /**
  * @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;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:13,代码来源:ArticleGalleyPlugin.inc.php

示例13: register

 /**
  * @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;
 }
开发者ID:jnugent,项目名称:ojs,代码行数:13,代码来源:HtmlArticleGalleyPlugin.inc.php

示例14: register

 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;
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:10,代码来源:SehlPlugin.inc.php

示例15: register

 /**
  * @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;
 }
开发者ID:ramonsodoma,项目名称:harvester,代码行数:14,代码来源:IPBanPlugin.inc.php


注:本文中的GenericPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。