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


PHP HSetting::SetText方法代码示例

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


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

示例1: testTextSettings

 public function testTextSettings()
 {
     $longText = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
     HSetting::SetText('longText', $longText);
     HSetting::SetText('longText', $longText . "2", 'testModule');
     $this->assertEquals(HSetting::GetText('longText'), $longText);
     $this->assertEquals(HSetting::GetText('longText', 'testModule'), $longText . "2");
     $this->assertEquals(HSetting::Get('longText'), "");
 }
开发者ID:alefernie,项目名称:intranet,代码行数:9,代码来源:HSettingTest.php

示例2: up

 public function up()
 {
     $allowedExtensions = HSetting::Get('allowedExtensions', 'file');
     if ($allowedExtensions != "") {
         HSetting::Set('allowedExtensions', '', 'file');
         HSetting::SetText('allowedExtensions', $allowedExtensions, 'file');
     }
     $showFilesWidgetBlacklist = HSetting::Get('showFilesWidgetBlacklist', 'file');
     if ($showFilesWidgetBlacklist != "") {
         HSetting::Set('showFilesWidgetBlacklist', '', 'file');
         HSetting::SetText('showFilesWidgetBlacklist', $showFilesWidgetBlacklist, 'file');
     }
 }
开发者ID:skapl,项目名称:design,代码行数:13,代码来源:m150322_195619_allowedExt2Text.php

示例3: actionIndex

 /**
  * Configuration Action for Super Admins
  */
 public function actionIndex()
 {
     $form = new AnonAccountsForm();
     if (isset($_POST['AnonAccountsForm'])) {
         $form->attributes = $_POST['AnonAccountsForm'];
         if ($form->validate()) {
             $form->anonAccountsFirstNameOptions = HSetting::SetText('anonAccountsFirstNameOptions', $form->anonAccountsFirstNameOptions);
             $form->anonAccountsLastNameOptions = HSetting::SetText('anonAccountsLastNameOptions', $form->anonAccountsLastNameOptions);
             // set flash message
             Yii::app()->user->setFlash('data-saved', Yii::t('AdminModule.controllers_SettingController', 'Saved'));
             $this->redirect(Yii::app()->createUrl('//anon_accounts/admin/index'));
         }
     } else {
         $form->anonAccountsFirstNameOptions = HSetting::GetText('anonAccountsFirstNameOptions');
         $form->anonAccountsLastNameOptions = HSetting::GetText('anonAccountsLastNameOptions');
     }
     $this->render('index', array('model' => $form));
 }
开发者ID:nsystem1,项目名称:humhub-modules-anon_accounts,代码行数:21,代码来源:AdminController.php

示例4: actionIndex

 /**
  * Configuration Action for Super Admins
  */
 public function actionIndex()
 {
     $form = new ExtendSearchSettingsForm();
     if (isset($_POST['ExtendSearchSettingsForm'])) {
         $form->attributes = $_POST['ExtendSearchSettingsForm'];
         if ($form->validate()) {
             // Validate JSON by running it through json_decode
             if (empty(json_decode($form->extendSearchJSON))) {
                 $form->addError('extendSearchJSON', 'JSON is invalid or empty.');
             } else {
                 $form->extendSearchJSON = HSetting::SetText('extendSearchJSON', $form->extendSearchJSON);
                 Yii::app()->user->setFlash('data-saved', Yii::t('AdminModule.controllers_SettingController', 'Saved'));
                 $this->redirect(Yii::app()->createUrl('//extend_search/admin/index'));
             }
         }
     } else {
         $form->extendSearchJSON = HSetting::GetText('extendSearchJSON');
     }
     $this->render('index', array('model' => $form));
 }
开发者ID:ConnectedCommunities,项目名称:humhub-modules-extend_search,代码行数:23,代码来源:AdminController.php

示例5: actionStatistic

 /**
  * Statistic Settings
  */
 public function actionStatistic()
 {
     Yii::import('admin.forms.*');
     $form = new StatisticSettingsForm();
     // uncomment the following code to enable ajax-based validation
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'statistic-settings-form') {
         echo CActiveForm::validate($form);
         Yii::app()->end();
     }
     if (isset($_POST['StatisticSettingsForm'])) {
         #$_POST['StatisticSettingsForm'] = Yii::app()->input->stripClean($_POST['StatisticSettingsForm']);
         $form->attributes = $_POST['StatisticSettingsForm'];
         if ($form->validate()) {
             $form->trackingHtmlCode = HSetting::SetText('trackingHtmlCode', $form->trackingHtmlCode);
             // set flash message
             Yii::app()->user->setFlash('data-saved', Yii::t('AdminModule.controllers_SettingController', 'Saved'));
             $this->redirect(Yii::app()->createUrl('//admin/setting/statistic'));
         }
     } else {
         $form->trackingHtmlCode = HSetting::GetText('trackingHtmlCode');
     }
     $this->render('statistic', array('model' => $form));
 }
开发者ID:luizreginaldo,项目名称:humhub,代码行数:26,代码来源:SettingController.php

示例6: actionFile

 /**
  * File Settings
  */
 public function actionFile()
 {
     Yii::import('admin.forms.*');
     $form = new FileSettingsForm();
     $form->imageMagickPath = HSetting::Get('imageMagickPath', 'file');
     $form->maxFileSize = HSetting::Get('maxFileSize', 'file') / 1024 / 1024;
     $form->maxPreviewImageWidth = HSetting::Get('maxPreviewImageWidth', 'file');
     $form->maxPreviewImageHeight = HSetting::Get('maxPreviewImageHeight', 'file');
     $form->hideImageFileInfo = HSetting::Get('hideImageFileInfo', 'file');
     $form->useXSendfile = HSetting::Get('useXSendfile', 'file');
     $form->allowedExtensions = HSetting::GetText('allowedExtensions', 'file');
     $form->showFilesWidgetBlacklist = HSetting::GetText('showFilesWidgetBlacklist', 'file');
     // Ajax Validation
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'file-settings-form') {
         echo CActiveForm::validate($form);
         Yii::app()->end();
     }
     if (isset($_POST['FileSettingsForm'])) {
         $form->attributes = $_POST['FileSettingsForm'];
         if ($form->validate()) {
             $form->imageMagickPath = HSetting::Set('imageMagickPath', $form->imageMagickPath, 'file');
             $form->maxFileSize = HSetting::Set('maxFileSize', $form->maxFileSize * 1024 * 1024, 'file');
             $form->maxPreviewImageWidth = HSetting::Set('maxPreviewImageWidth', $form->maxPreviewImageWidth, 'file');
             $form->maxPreviewImageHeight = HSetting::Set('maxPreviewImageHeight', $form->maxPreviewImageHeight, 'file');
             $form->hideImageFileInfo = HSetting::Set('hideImageFileInfo', $form->hideImageFileInfo, 'file');
             $form->useXSendfile = HSetting::Set('useXSendfile', $form->useXSendfile, 'file');
             $form->allowedExtensions = HSetting::SetText('allowedExtensions', strtolower($form->allowedExtensions), 'file');
             $form->showFilesWidgetBlacklist = HSetting::SetText('showFilesWidgetBlacklist', $form->showFilesWidgetBlacklist, 'file');
             // set flash message
             Yii::app()->user->setFlash('data-saved', Yii::t('AdminModule.controllers_SettingController', 'Saved'));
             $this->redirect(Yii::app()->createUrl('//admin/setting/file'));
         }
     }
     // Determine PHP Upload Max FileSize
     $maxUploadSize = Helpers::GetBytesOfPHPIniValue(ini_get('upload_max_filesize'));
     if ($maxUploadSize > Helpers::GetBytesOfPHPIniValue(ini_get('post_max_size'))) {
         $maxUploadSize = Helpers::GetBytesOfPHPIniValue(ini_get('post_max_size'));
     }
     $maxUploadSize = floor($maxUploadSize / 1024 / 1024);
     // Determine currently used ImageLibary
     $currentImageLibary = 'GD';
     if (HSetting::Get('imageMagickPath', 'file')) {
         $currentImageLibary = 'ImageMagick';
     }
     $this->render('file', array('model' => $form, 'maxUploadSize' => $maxUploadSize, 'currentImageLibary' => $currentImageLibary));
 }
开发者ID:skapl,项目名称:design,代码行数:49,代码来源:SettingController.php

示例7: setProviders

 /**
  * Saves an array of available OEmbed providers
  * 
  * @param array $providers
  */
 public static function setProviders($providers)
 {
     HSetting::SetText('oembedProviders', CJSON::encode($providers));
 }
开发者ID:alefernie,项目名称:intranet,代码行数:9,代码来源:UrlOembed.php

示例8: generateQueryStr

 /**
  * Generates a query string based on the provided 
  * JSON of Models and Attributes
  */
 private function generateQueryStr($keyword)
 {
     // First, if there's no extendSearchJSON HSetting, add it
     $form = new ExtendSearchSettingsForm();
     if (empty(HSetting::GetText('extendSearchJSON'))) {
         HSetting::SetText('extendSearchJSON', $form->default_extendSearchJSON);
     }
     // Generate Query String
     $str = "{$keyword}* AND ";
     $extendSearchJSON = json_decode(HSetting::GetText('extendSearchJSON'));
     $extendSearchArray = (array) $extendSearchJSON;
     $numberOfItems = count($extendSearchArray) - 1;
     $itemCount = 0;
     foreach ($extendSearchJSON as $key => $extendSearchItem) {
         $str .= "(model:{$key} ";
         if (count($extendSearchItem) > 0) {
             $numberOfAttributes = count($extendSearchItem) - 1;
             $attributeCount = 0;
             $str .= "AND (";
             foreach ($extendSearchItem as $attribute) {
                 $str .= "{$attribute}: {$keyword}* ";
                 if ($attributeCount < $numberOfAttributes) {
                     $str .= " OR ";
                 }
                 $attributeCount++;
             }
             $str .= ")) ";
         } else {
             $str .= ") ";
         }
         if ($itemCount < $numberOfItems) {
             $str .= " OR ";
         }
         $itemCount++;
     }
     return $str;
 }
开发者ID:ConnectedCommunities,项目名称:humhub-modules-extend_search,代码行数:41,代码来源:SearchController.php


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