Mercurial > hg > extraction-interface
view develop/controllers/extractapp.php @ 16:fb948097de39
fix bug: Edittaglist is working on Firefox.
fix bug: name of regex used to show with strange <span id="transmark"></span> showing only on FF but not Saf. Change it to use "document.getElementById(id).textContent to get the pure text string.
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 20 Feb 2015 16:39:08 +0100 |
parents | ac77748bb813 |
children | 82f8c6bd2b69 |
line wrap: on
line source
<?php class Extractapp extends BaseController { protected function Index() { $viewmodel = new ExtractappModel(); $this->ReturnView($viewmodel->Index(), true); } protected $viewmodel; public function __construct($action, $urlvalues, $postdata){ parent::__construct($action, $urlvalues, $postdata); $this->viewmodel = new ExtractappModel(); } protected function TaggingText() { //$viewmodel = new ExtractappModel(); $viewmodel = $this->viewmodel; switch ($this->postdata['func']) { case 'SaveFullText': $viewmodel->SaveFullText($this->postdata); $this->ReturnView($viewmodel->StartTagging(), true); break; case 'SaveFullTextToLGService': $viewmodel->messages .= "[Z] SaveFullTextToLGService! "; $viewmodel->GetInfoFromPreviousPage($this->postdata); $response = $viewmodel->SaveFullTextToLGService($this->postdata); $viewmodel->UpdateInfoByResponseFromLGService($response); // update file_id, branch_id, user_id $this->ReturnView($viewmodel->StartTagging(), true); break; case 'SmartRegexLoad': $viewmodel->SmartRegexLoad($this->postdata['topic_id']); break; case 'SmartRegexSave': $viewmodel->SmartRegexSave($this->postdata); break; case 'ContinueTagging': $viewmodel->messages .= "[Z] (Countinue tagging) "; if ($this->postdata['topic']) { $viewmodel->SetTopic($this->postdata['topic']); } $viewmodel->GetInfoFromPreviousPage($this->postdata); $this->ReturnView($viewmodel->StartTagging(), true); break; default: // first time visit extraction interface from LGService $viewmodel->messages .= "[Z] Welcome to Extraction Interface. "; if ($this->postdata['fileId'] != 0) { // ($this->postdata['branchId'] != 0) { // get text from fileId, from LGService $viewmodel->GetTextFromFileId($this->postdata); } else if ($this->postdata['sectionId'] != 0 && $this->postdata['userId'] != 0) { // get text from sectionId from LGService $viewmodel->GetTextFromSectionId($this->postdata); } else if ($this->postdata['sectionId'] != 0) { $viewmodel->GetTextFromLocal($this->postdata['sectionId']); } else if (is_numeric($this->urlvalues['id'])) { // get text from local file system (for development stage only) $viewmodel->GetTextFromLocal($this->urlvalues['id']); $this->ReturnView_localtest($viewmodel->StartTagging(), true); break; } else { $viewmodel->messages .= "wrong url!!"; return; } $this->ReturnView($viewmodel->StartTagging(), true); break; } } protected function ExportTable() { //$viewmodel = new ExtractappModel(); $viewmodel = $this->viewmodel; $this->ReturnView($viewmodel->ExportTable($this->postdata), true); } protected function EditWordlist() { // $viewmodel = new ExtractappModel(); $viewmodel = $this->viewmodel; switch ($this->postdata['func']) { case 'AddNewList': $this->ReturnView($viewmodel->AddNewList($this->postdata), true); break; case 'SaveWordlist': $this->ReturnView($viewmodel->SaveWordlist($this->postdata), true); break; default: // EditWordlist $this->ReturnView($viewmodel->EditWordlist(), true); break; } } protected function EditTaglist() { //$viewmodel = new ExtractappModel(); $viewmodel = $this->viewmodel; switch ($this->postdata['func']) { case 'NewTagElement': $this->ReturnView($viewmodel->NewTagElement($this->postdata), true); break; case 'SaveTagElement': $this->ReturnView($viewmodel->SaveTagElement($this->postdata), true); break; case 'DeleteTag': $this->ReturnView($viewmodel->DeleteTag($this->postdata), true); break; default: // EditTaglist $this->ReturnView($viewmodel->EditTaglist(), true); break; } } protected function ConfigTagsInTopic() { //$viewmodel = new ExtractappModel(); $viewmodel = $this->viewmodel; switch ($this->postdata['func']) { case 'somefunc': break; default: $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), true); break; } } protected function TestAction() { $viewmodel = new ExtractappModel(); $this->ReturnView($viewmodel->Test(), true); } } ?>