• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ZurmoConfigurationUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了ZurmoConfigurationUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:31,代码来源:UserEmailConfigurationCheckControllerFilter.php


示例2: setContentByType

 /**
  * @param string $content
  * @param bool $isHtmlContent
  */
 public static function setContentByType($content, $isHtmlContent)
 {
     assert('is_string($content)');
     assert('is_bool($isHtmlContent)');
     $key = static::resolveConfigKeyByContentType((bool) $isHtmlContent);
     ZurmoConfigurationUtil::setByModuleName(static::CONFIG_MODULE_NAME, $key, $content);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:11,代码来源:GlobalMarketingFooterUtil.php


示例3: testMakeFormAndSetConfigurationFromForm

 public function testMakeFormAndSetConfigurationFromForm()
 {
     $billy = User::getByUsername('billy');
     Yii::app()->timeZoneHelper->setTimeZone('America/New_York');
     Yii::app()->pagination->setGlobalValueByType('listPageSize', 50);
     Yii::app()->pagination->setGlobalValueByType('subListPageSize', 51);
     Yii::app()->pagination->setGlobalValueByType('modalListPageSize', 52);
     Yii::app()->pagination->setGlobalValueByType('dashboardListPageSize', 53);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'applicationName', 'demoCompany');
     $form = ZurmoConfigurationFormAdapter::makeFormFromGlobalConfiguration();
     $this->assertEquals('America/New_York', $form->timeZone);
     $this->assertEquals(50, $form->listPageSize);
     $this->assertEquals(51, $form->subListPageSize);
     $this->assertEquals(52, $form->modalListPageSize);
     $this->assertEquals(53, $form->dashboardListPageSize);
     $this->assertEquals('demoCompany', $form->applicationName);
     $form->timeZone = 'America/Chicago';
     $form->listPageSize = 60;
     $form->subListPageSize = 61;
     $form->modalListPageSize = 62;
     $form->dashboardListPageSize = 63;
     $form->applicationName = 'demoCompany2';
     ZurmoConfigurationFormAdapter::setConfigurationFromForm($form);
     $form = ZurmoConfigurationFormAdapter::makeFormFromGlobalConfiguration();
     $this->assertEquals('America/Chicago', $form->timeZone);
     $this->assertEquals(60, $form->listPageSize);
     $this->assertEquals(61, $form->subListPageSize);
     $this->assertEquals(62, $form->modalListPageSize);
     $this->assertEquals(63, $form->dashboardListPageSize);
     $this->assertEquals('demoCompany2', $form->applicationName);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:31,代码来源:ZurmoConfigurationFormAdapterTest.php


示例4: testListDefault

 public function testListDefault()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     ZurmoConfigurationUtil::setByUserAndModuleName($super, 'ZurmoModule', 'defaultPermissionSetting', null);
     ZurmoConfigurationUtil::setByUserAndModuleName($super, 'ZurmoModule', 'defaultPermissionGroupSetting', null);
     $this->assertNull(UserConfigurationFormAdapter::resolveAndGetValue($super, 'defaultPermissionGroupSetting', false));
     $this->assertEquals(UserConfigurationFormAdapter::resolveAndGetDefaultPermissionSetting($super), UserConfigurationForm::DEFAULT_PERMISSIONS_SETTING_EVERYONE);
     $authenticationData = $this->login();
     $headers = array('Accept: application/json', 'ZURMO_SESSION_ID: ' . $authenticationData['sessionId'], 'ZURMO_TOKEN: ' . $authenticationData['token'], 'ZURMO_API_REQUEST_TYPE: REST');
     $response = $this->listDefaultPermissionsForCurrentUser($headers);
     $response = json_decode($response, true);
     $this->assertEquals(ApiResponse::STATUS_SUCCESS, $response['status']);
     $this->assertArrayHasKey('data', $response);
     $this->assertCount(2, $response['data']);
     $this->assertArrayHasKey('owner', $response['data']);
     $this->assertCount(1, $response['data']['owner']);
     $this->assertArrayHasKey('id', $response['data']['owner']);
     $this->assertEquals($super->id, $response['data']['owner']['id']);
     $this->assertArrayHasKey('explicitReadWriteModelPermissions', $response['data']);
     $this->assertCount(2, $response['data']['explicitReadWriteModelPermissions']);
     $this->assertArrayHasKey('type', $response['data']['explicitReadWriteModelPermissions']);
     $this->assertEquals(1, $response['data']['explicitReadWriteModelPermissions']['type']);
     $this->assertArrayHasKey('nonEveryoneGroup', $response['data']['explicitReadWriteModelPermissions']);
     $this->assertEquals('', $response['data']['explicitReadWriteModelPermissions']['nonEveryoneGroup']);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:26,代码来源:ApiRestPermissionTest.php


示例5: setConfigForKey

 protected static function setConfigForKey($key, $value)
 {
     if ($key == 'bounceImapPassword') {
         $value = ZurmoPasswordSecurityUtil::encrypt($value);
     }
     ZurmoConfigurationUtil::setByModuleName(static::CONFIG_MODULE_NAME, $key, $value);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:7,代码来源:BounceConfigurationFormAdapter.php


示例6: renderContent

 protected function renderContent()
 {
     $homeUrl = Yii::app()->createUrl('home/default');
     $content = '<div class="clearfix">';
     $content .= '<a href="#" id="nav-trigger" title="Toggle Navigation">&rsaquo;</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;
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:32,代码来源:HeaderLinksView.php


示例7: 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;
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:ZurmoMappingHelper.php


示例8: getTitle

 public function getTitle()
 {
     $applicationName = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'applicationName');
     if ($applicationName != null) {
         $applicationName = ' - ' . $applicationName;
     }
     return Zurmo::t('MarketingListsModule', 'My Subscriptions') . $applicationName;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:MarketingListsManageSubscriptionsListView.php


示例9: 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;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:11,代码来源:KanbanBoardExtendedGridView.php


示例10: 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');
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:ZurmoPageView.php


示例11: 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);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:11,代码来源:SpecialMergeTagsAdapterTest.php


示例12: 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;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:9,代码来源:ContactWebFormsEnableCaptchaCheckBoxElement.php


示例13: run

 /**
  * A test job. This test job will update the config table with a datetime stamp.
  * (non-PHPdoc)
  * @see BaseJob::run()
  */
 public function run()
 {
     ZurmoConfigurationUtil::setByModuleName('JobsManagerModule', 'test', $this->testValue);
     if ($this->causeFailure) {
         $this->errorMessage = 'The test job failed';
         return false;
     }
     return true;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:14,代码来源:TestJob.php


示例14: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = SecurityTestHelper::createSuperAdmin();
     if (Yii::app()->params['testGoogleGeoCodeApiKey'] != null) {
         ZurmoConfigurationUtil::setByModuleName('MapsModule', 'googleMapApiKey', Yii::app()->params['testGoogleGeoCodeApiKey']);
     }
     Yii::app()->user->userModel = $super;
     AddressGeoCodeTestHelper::createAndRemoveAccountWithAddress($super);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:AddressGeoCodeTest.php


示例15: __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);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:MarketingListsExternalActionsPageView.php


示例16: 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);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:14,代码来源:BaseControlUserConfigUtilBaseTest.php


示例17: testMakeFormAndSetConfigurationFromForm

 public function testMakeFormAndSetConfigurationFromForm()
 {
     $billy = User::getByUsername('billy');
     Yii::app()->timeZoneHelper->setTimeZone('America/New_York');
     Yii::app()->pagination->setGlobalValueByType('listPageSize', 50);
     Yii::app()->pagination->setGlobalValueByType('subListPageSize', 51);
     Yii::app()->pagination->setGlobalValueByType('modalListPageSize', 52);
     Yii::app()->pagination->setGlobalValueByType('dashboardListPageSize', 53);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'applicationName', 'demoCompany');
     $logoFileName = 'testLogo.png';
     $logoFilePath = Yii::getPathOfAlias('application.modules.zurmo.tests.unit.files') . DIRECTORY_SEPARATOR . $logoFileName;
     ZurmoConfigurationFormAdapter::resizeLogoImageFile($logoFilePath, $logoFilePath, null, ZurmoConfigurationForm::DEFAULT_LOGO_HEIGHT);
     $logoFileId = ZurmoConfigurationFormAdapter::saveLogoFile($logoFileName, $logoFilePath, 'logoFileModelId');
     ZurmoConfigurationFormAdapter::publishLogo($logoFileName, $logoFilePath);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'logoFileModelId', $logoFileId);
     ZurmoConfigurationUtil::setByModuleName('ZurmoModule', 'logoThumbFileModelId', $logoFileId);
     $form = ZurmoConfigurationFormAdapter::makeFormFromGlobalConfiguration();
     $this->assertEquals('America/New_York', $form->timeZone);
     $this->assertEquals(50, $form->listPageSize);
     $this->assertEquals(51, $form->subListPageSize);
     $this->assertEquals(52, $form->modalListPageSize);
     $this->assertEquals(53, $form->dashboardListPageSize);
     $this->assertEquals('demoCompany', $form->applicationName);
     $this->assertEquals(AutoresponderOrCampaignBatchSizeConfigUtil::CONFIG_DEFAULT_VALUE, $form->autoresponderOrCampaignBatchSize);
     $this->assertEquals(UnsubscribeAndManageSubscriptionsPlaceholderUtil::getContentByType(false), $form->autoresponderOrCampaignFooterPlainText);
     $this->assertEquals(UnsubscribeAndManageSubscriptionsPlaceholderUtil::getContentByType(true), $form->autoresponderOrCampaignFooterRichText);
     $this->assertEquals($logoFileName, $form->logoFileData['name']);
     $form->timeZone = 'America/Chicago';
     $form->listPageSize = 60;
     $form->subListPageSize = 61;
     $form->modalListPageSize = 62;
     $form->dashboardListPageSize = 63;
     $form->applicationName = 'demoCompany2';
     $form->autoresponderOrCampaignBatchSize = 20;
     $logoFileName2 = 'testLogo2.png';
     $form->autoresponderOrCampaignFooterPlainText = 'abc';
     $form->autoresponderOrCampaignFooterRichText = 'def';
     $logoFilePath2 = Yii::getPathOfAlias('application.modules.zurmo.tests.unit.files') . DIRECTORY_SEPARATOR . $logoFileName2;
     copy($logoFilePath2, sys_get_temp_dir() . DIRECTORY_SEPARATOR . $logoFileName2);
     copy($logoFilePath2, sys_get_temp_dir() . DIRECTORY_SEPARATOR . ZurmoConfigurationForm::LOGO_THUMB_FILE_NAME_PREFIX . $logoFileName2);
     Yii::app()->user->setState('logoFileName', $logoFileName2);
     ZurmoConfigurationFormAdapter::setConfigurationFromForm($form);
     $form = ZurmoConfigurationFormAdapter::makeFormFromGlobalConfiguration();
     $this->assertEquals('America/Chicago', $form->timeZone);
     $this->assertEquals(60, $form->listPageSize);
     $this->assertEquals(61, $form->subListPageSize);
     $this->assertEquals(62, $form->modalListPageSize);
     $this->assertEquals(63, $form->dashboardListPageSize);
     $this->assertEquals('demoCompany2', $form->applicationName);
     $this->assertEquals(20, $form->autoresponderOrCampaignBatchSize);
     $this->assertEquals('abc', $form->autoresponderOrCampaignFooterPlainText);
     $this->assertEquals('def', $form->autoresponderOrCampaignFooterRichText);
     $this->assertEquals($logoFileName2, $form->logoFileData['name']);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:54,代码来源:ZurmoConfigurationFormAdapterTest.php


示例18: getForCurrentUserByPortletIdAndKey

 /**
  * Get a persistent config value for current user against portletId and keyName.
  * @param $portletId integer Id of the portlet or string representation of the unique id of the portlet to get value against
  * @param $keyName string Name of the key that should be returned
  * @param bool $returnBoolean bool Force return value to be boolean (explicit type casting)
  * @return bool|null|string
  */
 public static function getForCurrentUserByPortletIdAndKey($portletId, $keyName, $returnBoolean = false)
 {
     assert('is_int($portletId) || is_string($portletId)');
     assert('is_string($keyName)');
     $moduleName = static::getModuleName();
     $keyName = static::resolveKeyNameByPortletId($portletId, $keyName);
     $value = ZurmoConfigurationUtil::getForCurrentUserByModuleName($moduleName, $keyName);
     if ($returnBoolean) {
         $value = (bool) $value;
     }
     return $value;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:19,代码来源:PortletPersistentConfigUtil.php


示例19: getModalNotificationsEnabled

 public function getModalNotificationsEnabled()
 {
     if (ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'gamificationModalNotificationsEnabled') !== null) {
         return ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'gamificationModalNotificationsEnabled');
     } else {
         if (isset($this->_modalNotificationsEnabled)) {
             return $this->_modalNotificationsEnabled;
         } else {
             return true;
         }
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:12,代码来源:GameHelper.php


示例20: testSuperUserSendGridDefaultControllerActions

 public function testSuperUserSendGridDefaultControllerActions()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Load configuration list for Maps.
     $this->runControllerWithNoExceptionsAndGetContent('sendGrid/default/configurationView');
     //Save the configuration details.
     $this->setPostArray(array('SendGridConfigurationForm' => array('enableSendgrid' => true), 'save' => 'Save'));
     $content = $this->runControllerWithRedirectExceptionAndGetContent('sendGrid/default/configurationView');
     $this->assertEquals('Sendgrid configuration saved successfully.', Yii::app()->user->getFlash('notification'));
     //Check whether key is set.
     $enableSendGrid = (bool) ZurmoConfigurationUtil::getByModuleName('SendGridModule', 'enableSendgrid');
     $this->assertEquals(true, $enableSendGrid);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:13,代码来源:SendGridConfigurationSuperUserWalkthroughTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ZurmoDatabaseCompatibilityUtil类代码示例发布时间:2022-05-23
下一篇:
PHP ZurmoBaseTest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap