Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $this->widget('TbButton', array(
- 'buttonType' => 'link',
- 'icon' => 'floppy-save',
- 'url' => $this->createUrl('addnewad'),
- 'label' => Yii::t('user_profile', 'Add new ad'),
- 'htmlOptions' => array('class' => 'adnewad-button', 'style' => 'text-transform: uppercase; border-radius: 0;margin-top:10px;')
- ));
- $activation_script = 'js:function($el, status, e){
- $.ajax({type: \"POST\",
- url: \"' . $this->createUrl('user/ActivateDeactivate') . '\",
- dataType: \"json\",
- data: {\"value\": status },
- success: function(data){$(\"div.print-area\").html(JSON.stringify(data)); }
- });
- }';
- ?>
- <div class="print-area"></div>
- <h4><?php echo Yii::t('user_profile', 'My ads') ?></h4>
- <?php
- $this->widget('TbGridView', array(
- 'type'=>'striped bordered condensed',
- 'dataProvider' => $dataProvider,
- 'enablePagination' => true,
- //'filter' => $model->search(),
- 'columns' => array(
- 'id',
- array(
- 'name' => 'category_id',
- 'value' => 'Categoriestree::model()->findByPk($data->category_id)->attributes["name"]',
- ),
- 'city',
- 'title',
- array(
- 'name' => 'description',
- 'value' => 'User::fixDescriptionOutput(75, $data->description)'
- ),
- 'expired_date',
- 'deactivated_date',
- array(
- 'name' => 'inactive',
- 'value'=>'$this->grid->controller->widget("TbSwitch", array("name" => "inactive","events" => array("switchChange" => "js:function(this.el, status, e){ $.ajax({type: \"POST\", url: \"'.$this->createUrl('user/ActivateDeactivate').'\", dataType: \"json\", data: {\"value\": status }, success: function(data){ $(\"div.print-area\").html(JSON.stringify(data)); } }); }")))'
- ),
- array(
- 'class' => 'TbButtonColumn',
- 'template' => '{activation}{update}{delete}',
- 'buttons' => array(
- 'update' => array('url' => 'Yii::app()->controller->createUrl("updatead",array("id"=>$data->id, "page"=>1))'),
- 'delete' => array('url' => 'Yii::app()->controller->createUrl("addelete",array("id"=>$data->id))'),
- ),
- ),
- ),
- 'htmlOptions' => array(
- //'class' => 'col-xs-12 col-sm-6 col-md-8'
- )
- ));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment