本文整理汇总了PHP中ConnectorUtils::eapmEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ConnectorUtils::eapmEnabled方法的具体用法?PHP ConnectorUtils::eapmEnabled怎么用?PHP ConnectorUtils::eapmEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnectorUtils
的用法示例。
在下文中一共展示了ConnectorUtils::eapmEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterAPIList
/**
* Filter the list of APIs, removing disabled ones
* @param array $apiFullList
* @return array Filtered list
*/
public static function filterAPIList($apiFullList)
{
$filteredList = array();
foreach ($apiFullList as $name => $data) {
if (isset($data['connector'])) {
if (ConnectorUtils::eapmEnabled($data['connector'])) {
if (isset($data['authMethod']) && $data['authMethod'] == 'oauth') {
$connector = SourceFactory::getSource($data['connector'], false);
if (!empty($connector) && $connector->propertyExists('oauth_consumer_key') && $connector->isRequiredConfigFieldsSet()) {
$filteredList[$name] = $data;
}
} elseif (isset($data['authMethod']) && $data['authMethod'] == 'oauth2') {
$connector = SourceFactory::getSource($data['connector'], false);
if (!empty($connector) && $connector->isRequiredConfigFieldsSet()) {
$filteredList[$name] = $data;
}
} else {
$filteredList[$name] = $data;
}
}
} else {
$filteredList[$name] = $data;
}
}
return $filteredList;
}
示例2: filterAPIList
/**
* Filter the list of APIs, removing disabled ones
* @param array $apiFullList
* @return array Filtered list
*/
public static function filterAPIList($apiFullList)
{
$filteredList = array();
foreach ($apiFullList as $name => $data) {
if (isset($data['connector'])) {
if (ConnectorUtils::eapmEnabled($data['connector'])) {
if (isset($data['authMethod']) && $data['authMethod'] == 'oauth') {
$connector = SourceFactory::getSource($data['connector'], false);
if (!empty($connector)) {
$key = $connector->getProperty('oauth_consumer_key');
$secret = $connector->getProperty('oauth_consumer_secret');
if (!empty($key) && !empty($secret)) {
$filteredList[$name] = $data;
}
}
} else {
$filteredList[$name] = $data;
}
}
} else {
$filteredList[$name] = $data;
}
}
return $filteredList;
}
示例3: array
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
$lotusLiveUrl = '';
$llNowButton = '';
if (!isset($dynamicDCActions) || !is_array($dynamicDCActions)) {
$dynamicDCActions = array();
}
if (isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version']) && version_compare($_SESSION['current_db_version'], $_SESSION['target_db_version'], '!=')) {
// check if we are in upgrade. If yes, skip EAPM for now, until the DB is upgraded
return;
}
require_once 'include/connectors/utils/ConnectorUtils.php';
require_once 'include/connectors/sources/SourceFactory.php';
$connector = SourceFactory::getSource('ext_eapm_ibmsmartcloud', false);
// Check if IBM SmartCloud (was Lotus Live) is configured and enabled
if (!empty($connector) && $connector->propertyExists('oauth_consumer_key') && $connector->propertyExists('oauth_consumer_secret') && ConnectorUtils::eapmEnabled('ext_eapm_ibmsmartcloud')) {
// All we need is ibm smartcloud url
require_once 'modules/EAPM/EAPM.php';
$eapmBean = EAPM::getLoginInfo('IBMSmartCloud');
if (!empty($eapmBean->api_data)) {
$api_data = json_decode(base64_decode($eapmBean->api_data), true);
if (isset($api_data['hostURL'])) {
$lotusLiveUrl = $api_data['hostURL'];
$lotusLiveMeetNowLabel = translate('LBL_MEET_NOW_BUTTON', 'EAPM');
$llNowButton = '<button onclick=\\\'DCMenu.hostMeeting();\\\'>' . $lotusLiveMeetNowLabel . '</button>';
$dynamicDCActions['LotusLiveMeetings'] = array('module' => 'Meetings', 'label' => translate('LBL_VIEW_LOTUS_LIVE_MEETINGS', 'EAPM'), 'action' => "DCMenu.hostMeetingUrl='" . $lotusLiveUrl . "'; DCMenu.loadView('" . translate('LBL_TITLE_LOTUS_LIVE_MEETINGS', 'EAPM') . "','index.php?module=Meetings&action=listbytype&type=IBMSmartCloud',undefined,undefined,undefined,'" . $llNowButton . "');", 'icon' => 'icon_LotusMeetings_footer_bar.png');
$dynamicDCActions['LotusLiveDocuments'] = array('module' => 'Documents', 'label' => translate('LBL_VIEW_LOTUS_LIVE_DOCUMENTS', 'EAPM'), 'action' => 'DCMenu.loadView(\'' . translate('LBL_TITLE_LOTUS_LIVE_DOCUMENTS', 'EAPM') . '\',\'index.php?module=Documents&action=extdoc&type=IBMSmartCloud\');', 'icon' => 'icon_LotusDocuments_footer_bar.png');
}
}
// Display alert if not connected
$_SESSION['display_lotuslive_alert'] = empty($eapmBean);