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


PHP Gdn_ApplicationManager::checkRequirements方法代码示例

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


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

示例1: applications

 /**
  * Application management screen.
  *
  * @since 2.0.0
  * @access public
  * @param string $Filter 'enabled', 'disabled', or 'all' (default)
  * @param string $ApplicationName Unique ID of app to be modified.
  * @param string $TransientKey Security token.
  */
 public function applications($Filter = '', $ApplicationName = '', $TransientKey = '')
 {
     $this->permission('Garden.Settings.Manage');
     // Page setup
     $this->addJsFile('addons.js');
     $this->addJsFile('applications.js');
     $this->title(t('Applications'));
     $this->addSideMenu('dashboard/settings/applications');
     // Validate & set parameters
     $Session = Gdn::session();
     if ($ApplicationName && !$Session->validateTransientKey($TransientKey)) {
         $ApplicationName = '';
     }
     if (!in_array($Filter, array('enabled', 'disabled'))) {
         $Filter = 'all';
     }
     $this->Filter = $Filter;
     $ApplicationManager = new Gdn_ApplicationManager();
     $this->AvailableApplications = $ApplicationManager->availableVisibleApplications();
     $this->EnabledApplications = $ApplicationManager->enabledVisibleApplications();
     if ($ApplicationName != '') {
         $this->EventArguments['ApplicationName'] = $ApplicationName;
         if (array_key_exists($ApplicationName, $this->EnabledApplications) === true) {
             try {
                 $ApplicationManager->disableApplication($ApplicationName);
                 Gdn_LibraryMap::clearCache();
                 $this->fireEvent('AfterDisableApplication');
             } catch (Exception $e) {
                 $this->Form->addError(strip_tags($e->getMessage()));
             }
         } else {
             try {
                 $ApplicationManager->checkRequirements($ApplicationName);
             } catch (Exception $e) {
                 $this->Form->addError(strip_tags($e->getMessage()));
             }
             if ($this->Form->errorCount() == 0) {
                 $Validation = new Gdn_Validation();
                 $ApplicationManager->registerPermissions($ApplicationName, $Validation);
                 $ApplicationManager->enableApplication($ApplicationName, $Validation);
                 Gdn_LibraryMap::clearCache();
                 $this->Form->setValidationResults($Validation->results());
                 $this->EventArguments['Validation'] = $Validation;
                 $this->fireEvent('AfterEnableApplication');
             }
         }
         if ($this->Form->errorCount() == 0) {
             redirect('settings/applications/' . $this->Filter);
         }
     }
     $this->render();
 }
开发者ID:mcnasby,项目名称:datto-vanilla,代码行数:61,代码来源:class.settingscontroller.php


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