comparison models/extractapp.php @ 104:e542b161d907 extractapp

bug fixed: for only lowercase accepted in html tag.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Fri, 05 Aug 2016 13:34:55 +0200
parents 6ba742b712b0
children 025530e37dcd
comparison
equal deleted inserted replaced
103:2cc65ff46174 104:e542b161d907
406 file_put_contents("data/parsing_files/".$postdata['filename'].".txt", $require); 406 file_put_contents("data/parsing_files/".$postdata['filename'].".txt", $require);
407 } 407 }
408 408
409 } 409 }
410 410
411
411 public function UpdateInfoResponsedFromLGService($response) { 412 public function UpdateInfoResponsedFromLGService($response) {
412 /** 413 /**
413 * 414 *
414 */ 415 */
415 416
429 } else if ($status == "error") { 430 } else if ($status == "error") {
430 // saving not success 431 // saving not success
431 $this->messages['error'] .= "[Error] Saving Failed! ".(string)$response["message"]."<br>"; 432 $this->messages['error'] .= "[Error] Saving Failed! ".(string)$response["message"]."<br>";
432 $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version."; 433 $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version.";
433 434
435 // TODO shouldnt reload latest file from the LGService...
436 // pass the orignal text?
437
434 $response_currentFile = $response["currentFile"]; 438 $response_currentFile = $response["currentFile"];
435 $this->current_fileId = (string)$response_currentFile["id"]; 439 $this->current_fileId = (string)$response_currentFile["id"];
436
437 } 440 }
438 441
439 442
440 } 443 }
441 444
1293 1296
1294 private function GetTopicTag($topic_id) { 1297 private function GetTopicTag($topic_id) {
1295 $result = $this->GetTopicById($topic_id); 1298 $result = $this->GetTopicById($topic_id);
1296 $row = mysql_fetch_assoc($result); 1299 $row = mysql_fetch_assoc($result);
1297 $tag = $row['tag']; 1300 $tag = $row['tag'];
1298 return $tag; 1301
1302 // TODO need to reconstruct the structure for topic tag considering user may use Uppercase but only lowercase accpetable in html tag that why we store only lowercase in Taglist.tag field in database table.
1303 // Temporate solution is we replace " " with "_" and .lowercase(), which are as the same as we do in LGServices when create a topic and also create the correpsonding topic tag
1304
1305 $tag = str_replace(' ', '_', $tag);
1306 return strtolower($tag);
1307
1308 //return $tag;
1299 } 1309 }
1300 private function GetTopicName($topic_id) { 1310 private function GetTopicName($topic_id) {
1301 $result = $this->GetTopicById($topic_id); 1311 $result = $this->GetTopicById($topic_id);
1302 $row = mysql_fetch_assoc($result); 1312 $row = mysql_fetch_assoc($result);
1303 //$name = $row['name']; 1313 //$name = $row['name'];