Commits

christiansalazar committed afd07f7

FIXED ISSUE #5 - doesnt works with nice urls (Urlmanager)

  • Participants
  • Parent commits af68870

Comments (0)

Files changed (2)

File CocoWidget.php

 		$id=$this->id;
 		$upid = $id.'uploader';
 		$logid = $id.'logger';
-		$action = CHtml::normalizeUrl(array($this->defaultControllerName.'/'.$this->defaultActionName));
+		$action = array($this->defaultControllerName.'/'.$this->defaultActionName);
+		$action['action']='upload';
+		$action['data']=""; // see later after $vars
+
 
 		$htopts = '';
 		if(empty($this->htmlOptions)){
 			'userdata'=>$this->userdata,
 		);
 
+		$action['data'] = serialize($vars);
+
 		$options = CJavaScript::encode(
 			array(
 				'id'=>$id,
 				'loggerid'=>$logid,
-				'action'=>$action,
+				'action'=>CHtml::normalizeUrl($action),
 				'onCompleted'=>$this->onCompleted,
 				'onCancelled'=>$this->onCancelled,
 				'onMessage'=>$this->onMessage,
 				'buttonText'=>$this->buttonText,
 				'dropFilesText'=>$this->dropFilesText,
 				'uploaderContainer'=>$upid,
-				'data'=>serialize($vars),
+				//'data'=>serialize($vars),
 			)
 		);
 

File assets/cocowidget.js

 			buttonText: options.buttonText,
 			dropFilesText: options.dropFilesText,
 			element: document.getElementById(options.uploaderContainer),
-			action: options.action + '&action=upload' + _this.nocache() + '&data='+options.data,
+			//action: options.action + '&action=upload' + _this.nocache() + '&data='+options.data,
+			action: options.action,
 			onComplete: _this.onComplete,
 			onCancel: _this.onCancel,
 			showMessage: _this.showMessage