Changeset 4606
- Timestamp:
- 10/22/07 22:57:08 (2 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
blog/owner/entry/edit/item.php (modified) (2 diffs)
-
blog/owner/entry/update/item.php (modified) (1 diff)
-
lib/config.php (modified) (1 diff)
-
script/EAF3.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/blog/owner/entry/edit/item.php
r4503 r4606 297 297 if(entryManager.isSaved == true) { 298 298 var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/entry/update/"+entryManager.entryId); 299 <?php 300 if($service['useRewriteEngine'] == false) { 301 ?> 302 request.correcturl = true; 303 <?php 304 } 305 ?> 299 306 } else { 300 307 var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/entry/add/"); … … 350 357 if(entryManager.isSaved == true) { 351 358 var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/entry/update/"+entryManager.entryId); 359 <?php 360 if($service['useRewriteEngine'] == false) { 361 ?> 362 request.correcturl = true; 363 <?php 364 } 365 ?> 352 366 } else { 353 367 var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/entry/add/"); -
trunk/blog/owner/entry/update/item.php
r3845 r4606 43 43 } 44 44 } 45 respondResultPage( 1);45 respondResultPage(-1); 46 46 ?> -
trunk/lib/config.php
r4605 r4606 46 46 include_once (ROOT . "/components/$name.php"); 47 47 } 48 49 48 function requireModel($name) { 50 49 include_once (ROOT . "/lib/model/$name.php"); 51 50 } 52 53 54 51 function requireView($name) { 55 52 include_once (ROOT . "/lib/view/$name.php"); 56 53 } 57 58 59 54 function requireLibrary($name) { 60 55 include_once (ROOT . "/lib/$name.php"); -
trunk/script/EAF3.js
r4603 r4606 315 315 HTTPRequest.prototype.url = null; 316 316 HTTPRequest.prototype.correcturl = false; 317 HTTPRequest.prototype.id = null; 317 318 HTTPRequest.prototype.contentType = "application/x-www-form-urlencoded"; 318 319 HTTPRequest.prototype.content = ""; … … 405 406 }; 406 407 }; 407 408 if(this.correcturl != false) this.url = this.url+'/index.php'; 408 409 if(this.cache) this._request.open(this.method,this.url,this.async); 409 410 else if(this.url.lastIndexOf("?") >= 0) … … 413 414 if(STD.isFirefox) 414 415 this._request.setRequestHeader("Referer",location.href); 415 if(arguments.length>0) this.content=arguments[0]; 416 if(arguments.length>0) { 417 this.content=arguments[0]; 418 if(this.correcturl!=false && this.id!=null) { 419 this.content=arguments[0]+"&id="+this.id; 420 } 421 } 416 422 if(this.content.length>0) this._request.setRequestHeader("Content-Type",this.contentType); 417 423 this._request.send(this.content); … … 461 467 462 468 HTTPRequest.prototype.parseURL = function(url) { 463 if(this.correcturl == true) url = url+'/index.php'; 469 var idIndex = url.lastIndexOf("/"); 470 if(idIndex >= 0) { 471 var idCandidate = url.substring(idIndex+1); 472 if(idCandidate.toString().search(/^-?[0-9]+$/) == 0) { 473 this.id = idCandidate; 474 url = url.substring(0,idIndex); 475 } 476 } 464 477 return url; 465 478 };
