Commits

Juan David Rodriguez Ramirez committed a713006

url error solution in CGridView buttons

Comments (0)

Files changed (1)

views/default/index.php

         ');
         $afterAjax = '$(".download").text(""); $(".restore").html("");';
     }
+	$moduleId = $this->module->id;
     $this->widget($this->gridViewClass, array(
             'id' => 'backup-grid',
             'afterAjaxUpdate' => 'function(id, data){'.$afterAjax.'}',
                     ),
                     array(
                             'class' => $this->CButtonColumnClass,
-                            'deleteButtonUrl' =>'Yii::app()->createUrl("/backup/default/delete", array("file"=>$data["name"]))',
+                            'deleteButtonUrl' =>'Yii::app()->createUrl("/'.$moduleId.'/default/delete", array("file"=>$data["name"]))',
                             'template' => '{download} {restore} {delete}',
                             'htmlOptions'=>array('style'=>'width: 60px;'),
                             'buttons'=>array(
                                     'download' => array(
                                         'label'=>JBackupTranslator::t('backup', 'Download'),
                                         'options'=>array('class'=>$this->module->bootstrap ?'bdownload': 'download'),
-                                        'url'=>'Yii::app()->createUrl("/backup/default/download", array("file"=>$data["name"]))',
-                                        'visible'=>'Yii::app()->getModule("'.$this->module->id.'")->download'
+                                        'url'=>'Yii::app()->createUrl("/'.$moduleId.'/default/download", array("file"=>$data["name"]))',
+                                        'visible'=>'Yii::app()->getModule("'.$moduleId.'")->download'
                                     ),
                                     'restore' => array(
                                         'label'=>JBackupTranslator::t('backup', 'Restore'),
                                         'options'=>array('class'=>$this->module->bootstrap ?'brestore':'restore'),
-                                        'url'=>'Yii::app()->createUrl("/backup/default/restore", array("file"=>$data["name"]))',
-                                        'visible'=>'Yii::app()->getModule("'.$this->module->id.'")->restore'
+                                        'url'=>'Yii::app()->createUrl("/'.$moduleId.'/default/restore", array("file"=>$data["name"]))',
+                                        'visible'=>'Yii::app()->getModule("'.$moduleId.'")->restore'
                                     ),
                              ),		
                     ),