comparison models/extractapp.php @ 59:6e44605eb4f6 extractapp

New: 1.display messages 2.handle saving conflict:up-to-date or reload text
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 31 Mar 2015 11:32:25 +0200
parents a11f9103b8db
children 3239979f6673
comparison
equal deleted inserted replaced
58:a11f9103b8db 59:6e44605eb4f6
176 176
177 $this->lg_text = $lg_text; 177 $this->lg_text = $lg_text;
178 178
179 179
180 } 180 }
181 /* 181
182 public function Reload($_postdata) {
183
184 // update text using $this->current_fileId
185 // getTextbyFileId
186 $current_fileId = $_postdata['currentFileId'];
187 //$this->file_id = $_postdata['currentFileId'];
188 //$this->GetTextFromFileId($_postdata);
189 //$latest_editing = $this->lg_text;
190 // get from URL with file_id
191
192 $lg_text_url = $this->get_text_from_fileId_url.$current_fileId;
193 $lg_text = file_get_contents($lg_text_url);
194
195 $stringInput = $lg_text;
196 $stringInput = preg_replace("/ /u", "○", $stringInput);
197 $stringInput = preg_replace("/\n/u", "<br>", $stringInput);
198 $stringInput = preg_replace("/【(.*?)】/u", "【<a href=\"review_index_xml_images.php?books_id=".$bookId."&pages=\\1&entry=0\" target=\"_bookImg\">\\1</a>】", $stringInput);
199 $lg_text = $stringInput;
200
201
202 //var_dump($lg_text);
203
204 echo json_encode($lg_text);
205 //var_dump($this->file_id);
206
207 }
208 */
209
210 182
211 // TODO: comparison not correct 183 // TODO: comparison not correct
212 private function Taglist_infileUpToDate($taglistArray) { 184 private function Taglist_infileUpToDate($taglistArray) {
213 // compare $this->taglist_infile is the same as $taglistArray 185 // compare $this->taglist_infile is the same as $taglistArray
214 $taglist_infile = $this->taglist_infile; 186 $taglist_infile = $this->taglist_infile;
478 ); 450 );
479 $save_url = $this->save_to_LGService_url; 451 $save_url = $this->save_to_LGService_url;
480 452
481 } else { 453 } else {
482 // -- new branch case 454 // -- new branch case
483 echo "saveNew!"; 455 // echo "saveNew!";
484 $user_id = "0"; 456 $user_id = "0";
485 if ($_postdata['userId']) { 457 if ($_postdata['userId']) {
486 $user_id = $_postdata['userId']; 458 $user_id = $_postdata['userId'];
487 } 459 }
488 460