本文整理汇总了PHP中ZurmoConfigurationUtil::getByModuleName方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoConfigurationUtil::getByModuleName方法的具体用法?PHP ZurmoConfigurationUtil::getByModuleName怎么用?PHP ZurmoConfigurationUtil::getByModuleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoConfigurationUtil
的用法示例。
在下文中一共展示了ZurmoConfigurationUtil::getByModuleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preFilter
protected function preFilter($filterChain)
{
$sendGridPluginEnabled = (bool) ZurmoConfigurationUtil::getByModuleName('SendGridModule', 'enableSendgrid');
try {
if ($sendGridPluginEnabled) {
SendGridEmailAccount::getByUserAndName(Yii::app()->user->userModel, null);
} else {
EmailAccount::getByUserAndName(Yii::app()->user->userModel);
}
} catch (NotFoundException $e) {
$redirectUrl = Yii::app()->request->getParam('redirectUrl');
if ($sendGridPluginEnabled) {
try {
EmailAccount::getByUserAndName(Yii::app()->user->userModel);
} catch (NotFoundException $ex) {
$messageView = new NoUserEmailConfigurationYetView($redirectUrl);
$view = new ModalView($this->controller, $messageView);
Yii::app()->getClientScript()->setToAjaxMode();
echo $view->render();
return false;
}
} else {
$messageView = new NoUserEmailConfigurationYetView($redirectUrl);
$view = new ModalView($this->controller, $messageView);
Yii::app()->getClientScript()->setToAjaxMode();
echo $view->render();
return false;
}
}
return true;
}
示例2: renderContent
protected function renderContent()
{
$homeUrl = Yii::app()->createUrl('home/default');
$content = '<div class="clearfix">';
$content .= '<a href="#" id="nav-trigger" title="Toggle Navigation">›</a>';
$content .= '<div id="corp-logo">';
if ($logoFileModelId = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'logoFileModelId')) {
$logoFileModel = FileModel::getById($logoFileModelId);
$logoFileSrc = Yii::app()->getAssetManager()->getPublishedUrl(Yii::getPathOfAlias('application.runtime.uploads') . DIRECTORY_SEPARATOR . $logoFileModel->name);
} else {
$logoFileSrc = Yii::app()->themeManager->baseUrl . '/default/images/Zurmo_logo.png';
}
$logoHeight = ZurmoConfigurationFormAdapter::resolveLogoHeight();
$logoWidth = ZurmoConfigurationFormAdapter::resolveLogoWidth();
if (Yii::app()->userInterface->isMobile()) {
$content .= '<a href="' . $homeUrl . '"><img src="' . $logoFileSrc . '" alt="Zurmo Logo" /></a>';
//make sure width and height are NEVER defined
} else {
$content .= '<a href="' . $homeUrl . '"><img src="' . $logoFileSrc . '" alt="Zurmo Logo" height="' . $logoHeight . '" width="' . $logoWidth . '" /></a>';
}
if ($this->applicationName != null) {
$content .= ZurmoHtml::tag('span', array(), $this->applicationName);
}
$content .= '</div>';
if (!empty($this->userMenuItems) && !empty($this->settingsMenuItems)) {
$content .= '<div id="user-toolbar" class="clearfix">';
$content .= static::renderHeaderMenus($this->userMenuItems, $this->settingsMenuItems);
$content .= '</div>';
}
$content .= '</div>';
return $content;
}
示例3: getConfigForKey
protected static function getConfigForKey($key)
{
$value = ZurmoConfigurationUtil::getByModuleName(static::CONFIG_MODULE_NAME, $key);
if ($key == 'bounceImapPassword') {
$value = ZurmoPasswordSecurityUtil::decrypt($value);
}
return $value;
}
示例4: getTitle
public function getTitle()
{
$applicationName = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'applicationName');
if ($applicationName != null) {
$applicationName = ' - ' . $applicationName;
}
return Zurmo::t('MarketingListsModule', 'My Subscriptions') . $applicationName;
}
示例5: getMaxCount
/**
* @return int
*/
public static function getMaxCount()
{
$maxCount = ZurmoConfigurationUtil::getByModuleName(static::CONFIG_MODULE_NAME, static::CONFIG_KEY);
if ($maxCount == null) {
$maxCount = static::$maxCount;
}
return (int) $maxCount;
}
示例6: getTitle
/**
* Get the global page title value.
* @return string - page title.
*/
public function getTitle()
{
if (null != ($pageTitle = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'pageTitle'))) {
return $pageTitle;
} else {
return Zurmo::t('ZurmoModule', 'ZurmoCRM');
}
}
示例7: testResolveApplicationName
/**
* @depends testResolveBaseUrl
*/
public function testResolveApplicationName()
{
ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'applicationName', 'Demo App');
$resolvedApplicationName = SpecialMergeTagsAdapter::resolve('applicationName', null);
$expectedApplicationName = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'applicationName');
$this->assertNotNull($resolvedApplicationName);
$this->assertEquals($expectedApplicationName, $resolvedApplicationName);
}
示例8: makeFormFromMarketingConfiguration
/**
* Creates a form populated with the marketing configuration global stored values.
* @return MarketingConfigurationForm
*/
public static function makeFormFromMarketingConfiguration()
{
$form = new MarketingConfigurationForm();
$form->autoresponderOrCampaignFooterPlainText = GlobalMarketingFooterUtil::getContentByType(false);
$form->autoresponderOrCampaignFooterRichText = GlobalMarketingFooterUtil::getContentByType(true);
$form->useAutoresponderOrCampaignOwnerMailSettings = ZurmoConfigurationUtil::getByModuleName('MarketingModule', 'UseAutoresponderOrCampaignOwnerMailSettings');
return $form;
}
示例9: getGeoCodeApiKey
/**
* Gets the geocode api key from the cofig table.
* @return string $apiKey or null - geocode Api Key.
*/
public static function getGeoCodeApiKey()
{
if (null != ($apiKey = ZurmoConfigurationUtil::getByModuleName('MapsModule', 'googleMapApiKey'))) {
return $apiKey;
} else {
return null;
}
}
示例10: isSetCaptchaKeys
protected function isSetCaptchaKeys()
{
$reCaptchaPrivateKey = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'reCaptchaPrivateKey');
$reCaptchaPublicKey = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'reCaptchaPublicKey');
if ($reCaptchaPrivateKey === null || empty($reCaptchaPrivateKey) || $reCaptchaPublicKey === null || empty($reCaptchaPublicKey)) {
return false;
}
return true;
}
示例11: getContentByType
public static function getContentByType($isHtmlContent, $returnDefault = true)
{
$key = static::resolveConfigKeyByContentType($isHtmlContent);
$content = ZurmoConfigurationUtil::getByModuleName(static::CONFIG_MODULE_NAME, $key);
if (empty($content) && $returnDefault) {
$content = static::resolveDefaultValue();
}
return $content;
}
示例12: __construct
public function __construct(CController $controller, SplashView $splashView)
{
$applicationName = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'applicationName');
$header = new HeaderLinksView(array(), array());
$gridView = new GridView(3, 1);
$gridView->setView($header, 0, 0);
$gridView->setView($splashView, 1, 0);
$gridView->setView(new FooterView(), 2, 0);
parent::__construct($gridView);
}
示例13: testGetUserToRunAsWithSetOnMissingReturnsDefault
/**
* @depends testGetUserToRunAsWithoutSetOnMissingReturnsDefault
*/
public function testGetUserToRunAsWithSetOnMissingReturnsDefault()
{
$util = static::resolveConfigUtilClassName();
$user = $util::getUserToRunAs();
$this->assertEquals(Yii::app()->user->userModel, $user);
$configModuleName = $util::CONFIG_MODULE_NAME;
$configKey = $util::CONFIG_KEY;
$userIdInConfig = ZurmoConfigurationUtil::getByModuleName($configModuleName, $configKey);
$this->assertNotNull($userIdInConfig);
$this->assertEquals($user->id, $userIdInConfig);
}
示例14: getBatchSize
/**
* @param bool $returnDefaultIfMissing
* @param bool $setDefaultIfMissing
* @return configuration|int $size
*/
public static function getBatchSize($returnDefaultIfMissing = true, $setDefaultIfMissing = false)
{
$size = ZurmoConfigurationUtil::getByModuleName(static::CONFIG_MODULE_NAME, static::CONFIG_KEY);
if (empty($size) && $returnDefaultIfMissing) {
$size = static::CONFIG_DEFAULT_VALUE;
if ($setDefaultIfMissing) {
static::setBatchSize($size);
}
}
return $size;
}
示例15: load
/**
* Loads state data from persistent storage(database).
* @return mixed state data. Null if no state data available.
*/
public function load()
{
if (RedBeanDatabase::isSetup()) {
$content = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'globalState');
$content = unserialize($content);
if ($content) {
return $content;
}
}
return null;
}