linccce

View file

Aug 7th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.30 KB | None | 0 0
  1. <?php
  2. $this->widget('TbButton', array(
  3.     'buttonType' => 'link',
  4.     'icon' => 'floppy-save',
  5.     'url' => $this->createUrl('addnewad'),
  6.     'label' => Yii::t('user_profile', 'Add new ad'),
  7.     'htmlOptions' => array('class' => 'adnewad-button', 'style' => 'text-transform: uppercase; border-radius: 0;margin-top:10px;')
  8. ));
  9.  
  10. $activation_script = 'js:function($el, status, e){
  11.    $.ajax({type: \"POST\",
  12.        url: \"' . $this->createUrl('user/ActivateDeactivate') . '\",
  13.        dataType: \"json\",
  14.        data: {\"value\": status },
  15.        success: function(data){$(\"div.print-area\").html(JSON.stringify(data)); }
  16.        });
  17.    }';
  18.  
  19. ?>
  20. <div class="print-area"></div>
  21.  
  22. <h4><?php echo Yii::t('user_profile', 'My ads') ?></h4>
  23. <?php
  24. $this->widget('TbGridView', array(
  25.     'type'=>'striped bordered condensed',
  26.     'dataProvider' => $dataProvider,
  27.     'enablePagination' => true,
  28.     //'filter' => $model->search(),
  29.     'columns' => array(
  30.         'id',
  31.         array(
  32.             'name' => 'category_id',
  33.             'value' => 'Categoriestree::model()->findByPk($data->category_id)->attributes["name"]',
  34.         ),
  35.         'city',
  36.         'title',
  37.         array(
  38.             'name' => 'description',
  39.             'value' => 'User::fixDescriptionOutput(75, $data->description)'
  40.         ),
  41.         'expired_date',
  42.         'deactivated_date',
  43.         array(
  44.             'name' => 'inactive',
  45.             '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)); } }); }")))'
  46.         ),
  47.         array(
  48.             'class' => 'TbButtonColumn',
  49.             'template' => '{activation}{update}{delete}',
  50.             'buttons' => array(
  51.                 'update' => array('url' => 'Yii::app()->controller->createUrl("updatead",array("id"=>$data->id, "page"=>1))'),
  52.                 'delete' => array('url' => 'Yii::app()->controller->createUrl("addelete",array("id"=>$data->id))'),
  53.             ),
  54.         ),
  55.     ),
  56.     'htmlOptions' => array(
  57.     //'class' => 'col-xs-12 col-sm-6 col-md-8'
  58.     )
  59. ));
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment