Add helper function nl2p
This commit is contained in:
parent
ca8a01aced
commit
79bcff0d26
|
|
@ -631,3 +631,18 @@ if (! function_exists('is_request_secure')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! function_exists('nl2p')) {
|
||||||
|
/**
|
||||||
|
* Wrap blocks of text (delimited by \n) in p tags (similar to nl2br).
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function nl2p($text) {
|
||||||
|
$parts = explode("\n", $text);
|
||||||
|
$result = '<p>'.implode('</p><p>', $parts).'</p>';
|
||||||
|
// Remove empty paragraphs
|
||||||
|
return str_replace('<p></p>', '', $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="key">{{ trans('admin.update.info.change-log.text') }}</td>
|
<td class="key">{{ trans('admin.update.info.change-log.text') }}</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
{!! nl2br($info['release_note']) ?: trans('admin.update.info.change-log.empty') !!}
|
{!! nl2p($info['release_note']) ?: trans('admin.update.info.change-log.empty') !!}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
<h3 class="box-title">{{ trans('admin.update.cautions.title') }}</h3>
|
<h3 class="box-title">{{ trans('admin.update.cautions.title') }}</h3>
|
||||||
</div><!-- /.box-header -->
|
</div><!-- /.box-header -->
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<p>{!! nl2br(trans('admin.update.cautions.text')) !!}</p>
|
{!! nl2p(trans('admin.update.cautions.text')) !!}
|
||||||
</div><!-- /.box-body -->
|
</div><!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
<p>{{ $message }}</p>
|
<p>{{ $message }}</p>
|
||||||
|
|
||||||
<p>{!! nl2br(trans('errors.exception.message')) !!}</p>
|
{!! nl2p(trans('errors.exception.message')) !!}
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
@include('setup.wizard.language')
|
@include('setup.wizard.language')
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p>{!! nl2br(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}</p>
|
{!! nl2p(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}
|
||||||
|
|
||||||
<form method="post" action="" novalidate="novalidate">
|
<form method="post" action="" novalidate="novalidate">
|
||||||
<p class="step">
|
<p class="step">
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<?php list($from, $to) = explode(',', Option::get('sign_score')); ?>
|
<?php list($from, $to) = explode(',', Option::get('sign_score')); ?>
|
||||||
{!! nl2br(trans('user.score-intro.introduction', [
|
{!! nl2p(trans('user.score-intro.introduction', [
|
||||||
'initial_score' => option('user_initial_score'),
|
'initial_score' => option('user_initial_score'),
|
||||||
'score-from' => $from,
|
'score-from' => $from,
|
||||||
'score-to' => $to,
|
'score-to' => $to,
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
<h4 class="modal-title">{{ trans('user.profile.delete.modal-title') }}</h4>
|
<h4 class="modal-title">{{ trans('user.profile.delete.modal-title') }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
{!! nl2br(trans('user.profile.delete.modal-notice')) !!}
|
{!! nl2p(trans('user.profile.delete.modal-notice')) !!}
|
||||||
<br />
|
<br />
|
||||||
<input type="password" class="form-control" id="password" placeholder="{{ trans('user.profile.delete.password') }}">
|
<input type="password" class="form-control" id="password" placeholder="{{ trans('user.profile.delete.password') }}">
|
||||||
<br />
|
<br />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user