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


PHP CStringHelper::nl2br方法代码示例

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


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

示例1: onDiscussionDisplay

 public function onDiscussionDisplay($row)
 {
     CError::assert($row->message, '', '!empty', __FILE__, __LINE__);
     // @rule: Only nl2br text that doesn't contain html tags
     if (!CStringHelper::isHTML($row->message)) {
         $row->message = CStringHelper::nl2br($row->message);
     }
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:8,代码来源:groups.trigger.php

示例2: check

 public function check()
 {
     //CFactory::load( 'helpers', 'string');
     // Santinise data
     $safeHtmlFilter = CFactory::getInputFilter();
     $this->caption = CStringHelper::nl2br($safeHtmlFilter->clean($this->caption));
     return true;
 }
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:8,代码来源:photo.php

示例3: onMessageDisplay

 public function onMessageDisplay($row)
 {
     CFactory::load('helpers', 'string');
     CError::assert($row->body, '', '!empty', __FILE__, __LINE__);
     // @rule: Only nl2br text that doesn't contain html tags
     if (!CStringHelper::isHTML($row->body)) {
         $row->body = CStringHelper::nl2br($row->body);
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:9,代码来源:inbox.trigger.php

示例4: onWallDisplay

 public function onWallDisplay($row)
 {
     //CFactory::load( 'helpers' , 'string' );
     CError::assert($row->comment, '', '!empty', __FILE__, __LINE__);
     // @rule: Only nl2br text that doesn't contain html tags
     if (!CStringHelper::isHTML($row->comment)) {
         $row->comment = CStringHelper::nl2br($row->comment);
     }
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:9,代码来源:wall.trigger.php

示例5: onWallDisplay

 public function onWallDisplay($row)
 {
     //CFactory::load( 'helpers' , 'string' );
     CError::assert($row->comment, '', '!empty', __FILE__, __LINE__);
     // @rule: Only nl2br text that doesn't contain html tags
     //@since 4.1 new rule added, to ignore newline replace
     if (!CStringHelper::isHTML($row->comment) && !isset($row->newlineReplace)) {
         $row->comment = CStringHelper::nl2br($row->comment);
     }
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:10,代码来源:wall.trigger.php

示例6: json_encode

">
					<?php 
if ($config->get('htmleditor') == 'none' && $config->getBool('allowhtml')) {
    ?>
						<div class="htmlTag"><?php 
    echo JText::_('COM_COMMUNITY_HTML_TAGS_ALLOWED');
    ?>
</div>
					<?php 
}
?>

					<?php 
if (!CStringHelper::isHTML($group->description) && $config->get('htmleditor') != 'none' && $config->getBool('allowhtml')) {
    //$event = new stdClass();
    $group->description = CStringHelper::nl2br($group->description);
}
?>

					<?php 
echo $editor->displayEditor('description', $group->description, '90%', '300', '10', '20', false);
?>
					</span>
				</div>

				<script type="text/javascript">
					joms.jQuery(window).load(function() {

						if(joms.jQuery(this).width() <= 980) {
							joms.jQuery('.wysiwyg-field').empty().append('<textarea name="description">' + <?php 
echo json_encode($group->description);
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:31,代码来源:groups.forms.php

示例7: defined

 * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved!
 * @license		GNU/GPL, see LICENSE.php
 * 
 * @params	isMine		boolean is this group belong to me
 * @params	members		An array of member objects 
 */
defined('_JEXEC') or die;
?>

<form name="jsform-groups-discussionform" action="<?php 
echo CRoute::getURI();
?>
" method="post">
<?php 
if (!CStringHelper::isHTML($discussion->message) && $config->get('htmleditor') != 'none' && $config->getBool('allowhtml')) {
    $discussion->message = CStringHelper::nl2br($discussion->message);
}
?>
<script type="text/javascript">
function saveContent()
{
	<?php 
echo $editor->saveText('message');
?>
	return true;
}
</script>	
<table class="formtable">
	<?php 
echo $beforeFormDisplay;
?>
开发者ID:Simarpreet05,项目名称:joomla,代码行数:31,代码来源:groups.adddiscussion.php

示例8: json_encode

				<div class="form-field wysiwyg-field" style="display: none;">
					<?php 
if ($config->get('htmleditor') == 'none' && $config->getBool('allowhtml')) {
    ?>
						<div class="htmlTag"><?php 
    echo JText::_('COM_COMMUNITY_HTML_TAGS_ALLOWED');
    ?>
</div>
					<?php 
}
?>

					<?php 
if (!CStringHelper::isHTML($event->description) && $config->get('htmleditor') != 'none' && $config->getBool('allowhtml')) {
    $event->description = CStringHelper::nl2br($event->description);
}
?>

					<?php 
echo $editor->displayEditor('description', $event->description, '95%', '150', '10', '20', false);
?>
				</div>

				<script type="text/javascript">
					joms.jQuery(window).load(function() {
						if(joms.jQuery(this).width() <= 980) {
							joms.jQuery('.wysiwyg-field').empty().append('<textarea name="description">'+<?php 
echo json_encode($event->description);
?>
+'</textarea>').show();
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:30,代码来源:events.forms.php

示例9: _exportCSV

 public function _exportCSV($ids)
 {
     header('Content-Description: File Transfer');
     header('Content-Type: application/vnd.ms-excel');
     header('Content-disposition: attachment; filename="users.csv"');
     $model = CFactory::getModel('Profile');
     $lang =& JFactory::getLanguage();
     $lang->load('com_community', JPATH_ROOT);
     CFactory::load('helpers', 'string');
     foreach ($ids as $id) {
         if ($id == '') {
             continue;
         }
         $user = CFactory::getUser($id);
         $profile = $model->getEditableProfile($id, $user->getProfileType());
         $profileType = JTable::getInstance('MultiProfile', 'CTable');
         $profileType->load($user->getProfileType());
         echo $user->id . ',' . $profileType->getName() . ',' . $user->name . ',' . $user->username . ',' . $user->email . ',' . $user->getThumbAvatar() . ',' . $user->getAvatar() . ',' . $user->getKarmaPoint() . ',';
         echo $user->registerDate . ',' . $user->lastvisitDate . ',' . $user->block . ',"' . $user->getStatus() . '",' . $user->getViewCount() . ',' . $user->getAlias() . ',' . $user->getFriendCount();
         foreach ($profile['fields'] as $group => $groupFields) {
             foreach ($groupFields as $field) {
                 $field = JArrayHelper::toObject($field);
                 $field->value = CStringHelper::nl2br($field->value);
                 $field->value = CStringHelper::escape($field->value);
                 echo '"' . $field->value . '",';
             }
         }
         echo "\r\n";
     }
     exit;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:31,代码来源:users.php

示例10: getStatus

 /**
  * Return current user status
  * @return	string	user status
  */
 public function getStatus($rawFormat = false)
 {
     jimport('joomla.filesystem.file');
     // @rule: If user requested for a raw format, we should pass back the raw status.
     $statusmodel = CFactory::getModel('status');
     $statusmodel = $statusmodel->get($this->_userid);
     $status = $statusmodel->status;
     if ($rawFormat) {
         return $status;
     }
     // @rule: We need to escape any unwanted stuffs here before proceeding.
     CFactory::load('helpers', 'string');
     $status = CStringHelper::escape($status);
     if (JFile::Exists(CPluginHelper::getPluginURI('community', 'wordfilter') . DS . 'wordfilter.php') && JPluginHelper::isEnabled('community', 'wordfilter')) {
         require_once CPluginHelper::getPluginURI('community', 'wordfilter') . DS . 'wordfilter.php';
         if (class_exists('plgCommunityWordfilter')) {
             $dispatcher =& JDispatcher::getInstance();
             $plugin =& JPluginHelper::getPlugin('community', 'wordfilter');
             $instance = new plgCommunityWordfilter($dispatcher, (array) $plugin);
         }
         $status = $instance->_censor($status);
     }
     // @rule: Create proper line breaks.
     $status = CStringHelper::nl2br($status);
     // @rule: Auto link statuses
     CFactory::load('helpers', 'linkgenerator');
     $status = CLinkGeneratorHelper::replaceURL($status);
     return $status;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:33,代码来源:user.php

示例11: saveContent

                </div>
                
            <?php 
if ($config->get('htmleditor') == 'none' && $config->getBool('allowhtml')) {
    ?>
				<div class="htmlTag"><?php 
    echo JText::_('CC HTML TAGS ALLOWED');
    ?>
</div>
			<?php 
}
?>
                
            <?php 
if (!CStringHelper::isHTML($editorMessage) && $config->get('htmleditor') != 'none' && $config->getBool('allowhtml')) {
    $editorMessage = CStringHelper::nl2br($editorMessage);
}
if ($config->get('htmleditor')) {
    ?>
            <script type="text/javascript">
            function saveContent()
            {
				<?php 
    echo $editor->save('message');
    ?>
				return true;
			}
            </script>
            <?php 
    echo $editor->display('message', $editorMessage, '95%', '450', '10', '20', false);
    ?>
开发者ID:bizanto,项目名称:Hooked,代码行数:31,代码来源:groups.viewbulletin.php


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