-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
<?php | ||
/** | ||
* @package yii2-export | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 | ||
* @version 1.2.0 | ||
*/ | ||
|
||
use yii\helpers\Html; | ||
use yii\helpers\ArrayHelper; | ||
|
||
|
@@ -8,12 +15,13 @@ | |
if (!empty($icon)) { | ||
$label = $icon . ' ' . $label; | ||
} | ||
echo Html::beginTag('div', ['class'=>'btn-group', 'role'=>'group']); | ||
echo Html::beginTag('div', ['class' => 'btn-group', 'role' => 'group']); | ||
echo Html::button($label . ' <span class="caret"></span>', $options); | ||
foreach($columnSelector as $value => $label) { | ||
foreach ($columnSelector as $value => $label) { | ||
if (in_array($value, $hiddenColumns)) { | ||
$checked = in_array($value, $selectedColumns); | ||
echo Html::checkbox('export_columns_selector[]', $checked, ['data-key'=>$value, 'style'=>'display:none']) . "\n"; | ||
echo Html::checkbox('export_columns_selector[]', $checked, | ||
['data-key' => $value, 'style' => 'display:none']) . "\n"; | ||
unset($columnSelector[$value]); | ||
} | ||
if (in_array($value, $noExportColumns)) { | ||
|
@@ -24,29 +32,29 @@ | |
?> | ||
|
||
<?php if ($showToggle): ?> | ||
<?php | ||
<?php | ||
$toggleOptions = ArrayHelper::remove($batchToggle, 'options', []); | ||
$toggleLabel = ArrayHelper::remove($batchToggle, 'label', Yii::t('kvexport', 'Toggle All')); | ||
Html::addCssClass($toggleOptions, 'kv-toggle-all'); | ||
?> | ||
<li> | ||
<div class="checkbox"> | ||
<label> | ||
<?= Html::checkbox('export_columns_toggle', true) ?> | ||
<?= Html::tag('span', $toggleLabel , $toggleOptions) ?> | ||
</label> | ||
</div> | ||
</li> | ||
<li class="divider"></li> | ||
<?php endif;?> | ||
?> | ||
<li> | ||
<div class="checkbox"> | ||
<label> | ||
<?= Html::checkbox('export_columns_toggle', true) ?> | ||
<?= Html::tag('span', $toggleLabel, $toggleOptions) ?> | ||
</label> | ||
</div> | ||
</li> | ||
<li class="divider"></li> | ||
<?php endif; ?> | ||
|
||
<?php | ||
foreach($columnSelector as $value => $label) { | ||
foreach ($columnSelector as $value => $label) { | ||
$checked = in_array($value, $selectedColumns); | ||
$disabled = in_array($value, $disabledColumns); | ||
$labelTag = $disabled ? '<label class="disabled">' : '<label>'; | ||
echo '<li><div class="checkbox">' . $labelTag . | ||
Html::checkbox('export_columns_selector[]', $checked, ['data-key'=>$value, 'disabled'=>$disabled]) . | ||
Html::checkbox('export_columns_selector[]', $checked, ['data-key' => $value, 'disabled' => $disabled]) . | ||
"\n" . $label . '</label></div></li>'; | ||
} | ||
echo Html::endTag('ul'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<?php | ||
/*! | ||
/** | ||
* @package yii2-export | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 | ||
* @version 1.2.0 | ||
* @version 1.2.0 | ||
* | ||
* Export Submission Form | ||
* | ||
|
@@ -10,10 +12,11 @@ | |
* For more JQuery plugins visit http://plugins.krajee.com | ||
* For more Yii related demos visit http://demos.krajee.com | ||
*/ | ||
use yii\helpers\Html; | ||
use yii\helpers\Html; | ||
|
||
echo Html::beginForm('', 'post', $options); | ||
echo Html::hiddenInput($exportTypeParam, $exportType); | ||
echo Html::hiddenInput($exportRequestParam, 1); | ||
echo Html::hiddenInput($exportRequestParam, 1); | ||
echo Html::hiddenInput($exportColsParam, ''); | ||
echo Html::hiddenInput($colselFlagParam, $columnSelectorEnabled); | ||
echo Html::endForm(); | ||
|