Skip to content

Commit

Permalink
Hoang anh Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iConcept authored and iConcept committed Mar 6, 2017
1 parent f9f8737 commit b2d3cf3
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 36 deletions.
11 changes: 9 additions & 2 deletions src/views/form/bscheckbox.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<div class="checkbox">
<label>
<input name="{{ $name }}" type="checkbox" value="1" {{ $value == 1 ? "checked" : ""}}>
<?php
$attrs = [];
if (isset($attribute))
{
$attrs = array_merge($attrs, $attribute);
}
?>
{{ Form::checkbox($name, 1, ($value == 1 ? true : false), $attrs) }}
{{ $title }}
</label>
</div>
</div>
2 changes: 1 addition & 1 deletion src/views/form/bsckeditor.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group">
{{ Form::label($title, null, ['class' => 'control-label']) }}
{{ Form::label($name, $title, ['class' => 'control-label']) }}
<textarea class="ckeditor" id="editor1" rows="10" cols="80" name="{{ $name }}">
{{ @$value }}
</textarea>
Expand Down
2 changes: 1 addition & 1 deletion src/views/form/bsdatepicker.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
if (isset($validation))
{
$attrs = array_merge_recursive($attrs, $validation);
$attrs = array_merge($attrs, $validation);
}
?>
{{ Form::text($name, $value, $attrs) }}
Expand Down
22 changes: 16 additions & 6 deletions src/views/form/bsselect.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<div class="form-group">
<?php
$attrs = array('class' => 'form-control', 'style' => 'width:100%');
if (isset($attribute))
{
$attrs = array_merge($attrs, $attribute);
}
$options= [];
foreach ($items as $item)
{
$options+= [$item['value'] => $item['name']];
}
?>

@if (isset($title))
<label class="control-label">{{ $title }}</label>
{{ Form::label($name, $title, array('class' => 'control-label')) }}
@endif
<select style="width:100%" class="form-control" name="{{ $name }}">
@foreach ($items as $item)
<option value="{{ $item['value'] }}" {{ ($item['value'] == $value) ? "selected" : "" }}>{{ $item['name'] }}</option>
@endforeach
</select>
{{ Form::select($name, $options, $value, $attrs) }}
</div>
22 changes: 16 additions & 6 deletions src/views/form/bsselect2.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<div class="form-group">
<?php
$attrs = array('class' => 'form-control select2', 'style' => 'width:100%');
if (isset($attribute))
{
$attrs = array_merge($attrs, $attribute);
}
$options= [];
foreach ($items as $item)
{
$options+= [$item['value'] => $item['name']];
}
?>

@if (isset($title))
<label class="control-label">{{ $title }}</label>
{{ Form::label($name, $title, array('class' => 'control-label')) }}
@endif
<select style="width:100%" class="form-control select2" name="{{ $name }}">
@foreach ($items as $item)
<option value="{{ $item['value'] }}" {{ ($item['value'] == $value) ? "selected" : "" }}>{{ $item['name'] }}</option>
@endforeach
</select>
{{ Form::select($name, $options, $value, $attrs) }}
</div>
4 changes: 2 additions & 2 deletions src/views/form/bsselect2multi.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="form-group">
@if (isset($title) && strlen($title) > 0)
{{ Form::label($title, null, ['class' => 'control-label']) }}
{{ Form::label($name, $title, ['class' => 'control-label']) }}
@endif
<select class="form-control select2" name="{{ $name }}" multiple="multiple">
<select class="form-control select2" name="{{ $name }}" multiple="multiple">
@foreach ($items as $item)
<option value="{{ $item['value'] }}"
@if (is_array($value))
Expand Down
17 changes: 10 additions & 7 deletions src/views/form/bstext.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<div class="form-group">
@if (isset($title) && (strlen($title) > 0))
<label class="control-label">{{ $title }}</label>
@endif

<?php
<div class="form-group @if (isset($errors) && $errors->has($name)) has-error @endif">
<?php
$attrs = array('class' => 'form-control input');
if (isset($place_holder))
{
$attrs['placeholder'] = $place_holder;
}
if (isset($validation))
{
$attrs = array_merge_recursive($attrs, $validation);
$attrs = array_merge($attrs, $validation);
}
if (isset($attribute))
{
$attrs = array_merge($attrs, $attribute);
}
?>
@if (isset($title) && (strlen($title) > 0))
{{ Form::label($name, $title, array('class' => 'control-label')) }}
@endif
{{ Form::text($name, $value, $attrs) }}

@if (isset($hin) && (strlen($hin) > 0))
Expand Down
19 changes: 11 additions & 8 deletions src/views/form/bstextarea.blade.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<div class="form-group">
@if (isset($title))
<label class="control-label">{{ $title }}</label>
@endif

<?php
<div class="form-group @if (isset($errors) && $errors->has($name)) has-error @endif">
<?php
$attrs = array('class' => 'form-control');
if (isset($placeholder))
{
$attrs['placeholder'] = $placeholder;
}
if (isset($validation))
{
$attrs = array_merge_recursive($attrs, $validation);
$attrs = array_merge($attrs, $validation);
}
if (isset($attribute))
{
$attrs = array_merge($attrs, $attribute);
}
?>
{{ Form::textarea($name, $value, $attrs) }}
@if (isset($title))
{{ Form::label($name, $title, array('class' => 'control-label')) }}
@endif
{{ Form::textarea($name, $value, $attrs) }}

@if (isset($hin))
<div class="note">
Expand Down
11 changes: 8 additions & 3 deletions src/views/form/lbsubmit.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<button class="btn btn-primary" onclick="this.disabled = true; this.form.submit();">
Submit
</button>
<?php
$attrs = array('class' => 'btn btn-primary', 'onclick' => 'this.disabled = true;this.form.submit();');
if (isset($attribute))
{
$attrs = array_merge($attrs, $attribute);
}
?>
{{ Form::submit((isset($title) ? $title : 'Submit'), $attrs) }}

0 comments on commit b2d3cf3

Please sign in to comment.