comparison models/extractapp.php @ 62:3fb9e3884401 extractapp

New: insert selected wordlist into textarea at cursor position when editing regex
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 31 Mar 2015 14:55:58 +0200
parents c6fa7f83c5bf
children 3395385476d1
comparison
equal deleted inserted replaced
61:c6fa7f83c5bf 62:3fb9e3884401
262 $this->messages['info'] .= ", section id: ". $this->section_id; 262 $this->messages['info'] .= ", section id: ". $this->section_id;
263 $this->messages['info'] .= ", branch id: ".$this->branch_id; 263 $this->messages['info'] .= ", branch id: ".$this->branch_id;
264 $this->messages['info'] .= ", file id: ".$this->file_id; 264 $this->messages['info'] .= ", file id: ".$this->file_id;
265 $this->messages['info'] .= "<br>"; 265 $this->messages['info'] .= "<br>";
266 266
267 /*
268 $this->messages .= "Info: ";
269 $this->messages .= "file_id=".$this->file_id.", section_id=".$this->section_id;
270 $this->messages .= ", user_id=".$this->user_id.", branch_id=".$this->branch_id.", topic_id=".$this->topic;
271 $this->messages .= ", book_id=".$this->book_id.", book_name=".$this->book_name.", section_name=".$this->section_name;
272 $this->messages .= ", current_fileId=".$this->current_fileId."<br>";
273 */
274 267
275 $data['messages'] = $this->messages; 268 $data['messages'] = $this->messages;
276 269
277 return $data; 270 return $data;
278 271
301 } 294 }
302 295
303 } 296 }
304 297
305 public function UpdateInfoByResponseFromLGService($response) { 298 public function UpdateInfoByResponseFromLGService($response) {
306
307 /*
308 $response_file = $response["file"];
309 $response_branch = $response["branch"];
310
311
312 $status = (string)$response["status"];
313
314 if ((string)$response["status"] == "error") {
315 $response_currentFile = $response["currentFile"];
316
317 $this->current_fileId = (string)$response_currentFile['id'];
318 $this->messages .= "saving does not success! ".(string)$response["message"];
319
320
321 } else {
322
323 $this->messages .= "saving success.";
324 var_dump((string)$response_file["id"]);
325
326 $this->file_id = (string)$response_file["id"];
327 $this->branch_id = (string)$response_branch["id"];
328
329 }
330 */
331
332 299
333 $response_file = $response["file"]; 300 $response_file = $response["file"];
334 $response_branch = $response["branch"]; 301 $response_branch = $response["branch"];
335 302
336 $status = (string)$response["status"]; 303 $status = (string)$response["status"];
337 if ($status == "ok") { 304 if ($status == "ok") {
338 $this->messages['info'] .= "[Info] Saving success. <br>"; 305 $this->messages['info'] .= "[Info] Saving success. <br>";
339 //$this->messages .= "Saving success.";
340 $this->file_id = (string)$response_file["id"]; 306 $this->file_id = (string)$response_file["id"];
341 $this->branch_id = (string)$response_branch["id"]; 307 $this->branch_id = (string)$response_branch["id"];
342 308
343 } else if ($status == "error") { 309 } else if ($status == "error") {
344 // saving not success 310 // saving not success
345 $this->messages['error'] .= "[Error] Saving Failed! ".(string)$response["message"]."<br>"; 311 $this->messages['error'] .= "[Error] Saving Failed! ".(string)$response["message"]."<br>";
346 $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version. <br>"; 312 $this->messages['warning'] .= "[Warning] Please check branch ".$this->branch_id." in LGService, and modify from the latest version. <br>";
347 313
348 /*
349 $this->messages .= "Saving Failed! ".(string)$response["message"]."<br>";
350 $this->messages .= "Please check branch ".$this->branch_id." in LGService, and modify from the latest version. <br>";
351 */
352 $response_currentFile = $response["currentFile"]; 314 $response_currentFile = $response["currentFile"];
353 //$this->current_fileId = $response["currentFileId"];
354 $this->current_fileId = (string)$response_currentFile["id"]; 315 $this->current_fileId = (string)$response_currentFile["id"];
355 316
356 } 317 }
357 318
358 319