Skip to content

Commit

Permalink
Update to release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jan 12, 2015
1 parent cc7555e commit 355a710
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
42 changes: 25 additions & 17 deletions views/_columns.php
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 &copy; Kartik Visweswaran, Krajee.com, 2014
* @version 1.2.0
*/

use yii\helpers\Html;
use yii\helpers\ArrayHelper;

Expand All @@ -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)) {
Expand All @@ -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');
Expand Down
11 changes: 7 additions & 4 deletions views/_form.php
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 &copy; Kartik Visweswaran, Krajee.com, 2014
* @version 1.2.0
* @version 1.2.0
*
* Export Submission Form
*
Expand All @@ -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();
Expand Down

0 comments on commit 355a710

Please sign in to comment.