<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'phonesettings-notifications',
    'enableAjaxValidation' => false,
    'action' => array('update'),
    ));
?>
<?php
$this->widget('ext.PlNavbar', array(
    'brand' => __('PHONESETTINGS_NOTIFICATIONS_NAVBAR_TITLE'),
    'htmlOptions' => array(
        'data-translation-id' => 'PHONESETTINGS_NOTIFICATIONS_NAVBAR_TITLE',
    ),
));
?>
<div class="form">
	<?php
$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'phonesettings-notifications-grid',
    'type' => 'striped bordered condensed',
    'itemsCssClass' => 'plTable',
    'dataProvider' => $this->phonesettingsNotificationsSearch(),
    'summaryText' => false,
    'hideHeader' => true,
    'columns' => array(
        array(
            'name' => 'short',
            'type' => 'raw',
            'header' => $model->getAttributeLabel('short'),
            'headerHtmlOptions' => array('data-translation-id' => 'PHONESETTINGS_USER_MODEL_SHORT'),
        ),
        array(
            'name' => 'value',
            'type' => 'raw',
            'value' => array($this, 'renderValue'),
            'header' => $model->getAttributeLabel('value'),
            'headerHtmlOptions' => array('data-translation-id' => 'PHONESETTINGS_USER_MODEL_VALUE')
        ),
        array(
            'name' => 'descr',
            'type' => 'raw',
            'header' => $model->getAttributeLabel('descr'),
            'headerHtmlOptions' => array('data-translation-id' => 'PHONESETTINGS_USER_MODEL_DESCRIPTION')
        ),
    ),
));
echo CHtml::submitButton('save', array('id' => 'phonesettingsNotificationsAction', 'style' => 'display:none'));

$this->widget('bootstrap.widgets.TbButton', array(
    'buttonType' => 'button',
    'type' => 'primary',
    'label' => __('GLOBAL_SAVE_BUTTON'),
    'loadingText' => 'loading...',
    'htmlOptions' => array(
        'id' => 'savePhonesettingsNotificationsButton',
        'data-translation-id' => 'GLOBAL_SAVE_BUTTON',
    ),
));
?>

<script>
$('#savePhonesettingsNotificationsButton').click(function() {
        var btn = $(this);
        btn.button('loading'); // call the loading function
        $("#phonesettingsNotificationsAction").click();
});
</script>


<?php echo CHtml::endForm(); ?>

<?php
$this->endWidget();
?>
</div>
