comparison controllers/extractapp.php @ 71:26d8c4c43d86 extractapp

minor checking for variable/index in php
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 08 Apr 2015 14:57:01 +0200
parents edb8a2e8ce84
children 2daef8e36214
comparison
equal deleted inserted replaced
70:359f48d58cbc 71:26d8c4c43d86
13 $this->viewmodel = new ExtractappModel(); 13 $this->viewmodel = new ExtractappModel();
14 } 14 }
15 15
16 protected function TaggingText() { 16 protected function TaggingText() {
17 $viewmodel = $this->viewmodel; 17 $viewmodel = $this->viewmodel;
18 18
19 switch ($this->postdata['func']) { 19 if (isset($this->postdata['func'])) {
20 $func = $this->postdata['func'];
21 }
22 switch ($func) {
20 case 'SaveFullText': 23 case 'SaveFullText':
21 $viewmodel->SaveFullText($this->postdata); 24 $viewmodel->SaveFullText($this->postdata);
22 $this->ReturnView($viewmodel->StartTagging(), true); 25 $this->ReturnView($viewmodel->StartTagging(), true);
23 break; 26 break;
24 case 'SaveFullTextToLGService': 27 case 'SaveFullTextToLGService':
98 101
99 } 102 }
100 103
101 protected function EditWordlist() { 104 protected function EditWordlist() {
102 $viewmodel = $this->viewmodel; 105 $viewmodel = $this->viewmodel;
103 switch ($this->postdata['func']) { 106 if (isset($this->postdata['func'])) {
107 $func = $this->postdata['func'];
108 }
109 switch ($func) {
104 case 'AddNewList': 110 case 'AddNewList':
105 $this->ReturnView($viewmodel->AddNewList($this->postdata), true); 111 $this->ReturnView($viewmodel->AddNewList($this->postdata), true);
106 break; 112 break;
107 case 'SaveWordlist': 113 case 'SaveWordlist':
108 $this->ReturnView($viewmodel->SaveWordlist($this->postdata), true); 114 $this->ReturnView($viewmodel->SaveWordlist($this->postdata), true);
109 break; 115 break;
110 default: // EditWordlist 116 default: // EditWordlist
111
112 $this->ReturnView($viewmodel->EditWordlist(), true); 117 $this->ReturnView($viewmodel->EditWordlist(), true);
113 break; 118 break;
114 } 119 }
115 } 120 }
116 121
117 122
118 protected function EditTaglist() { 123 protected function EditTaglist() {
119 $viewmodel = $this->viewmodel; 124 $viewmodel = $this->viewmodel;
120 switch ($this->postdata['func']) { 125 if (isset($this->postdata['func'])) {
126 $func = $this->postdata['func'];
127 }
128 switch ($func) {
121 case 'NewTagElement': 129 case 'NewTagElement':
122 $this->ReturnView($viewmodel->NewTagElement($this->postdata), true); 130 $this->ReturnView($viewmodel->NewTagElement($this->postdata), true);
123 break; 131 break;
124 case 'SaveTagElement': 132 case 'SaveTagElement':
125 $this->ReturnView($viewmodel->SaveTagElement($this->postdata), true); 133 $this->ReturnView($viewmodel->SaveTagElement($this->postdata), true);
134 } 142 }
135 143
136 144
137 protected function ConfigTagsInTopic() { 145 protected function ConfigTagsInTopic() {
138 $viewmodel = $this->viewmodel; 146 $viewmodel = $this->viewmodel;
139 switch ($this->postdata['func']) { 147 if (isset($this->postdata['func'])) {
148 $func = $this->postdata['func'];
149 }
150 switch ($func) {
140 case 'Update': 151 case 'Update':
141 $viewmodel->UpdateTagsInTopic($this->postdata); 152 $viewmodel->UpdateTagsInTopic($this->postdata);
142 break; 153 break;
143 default: 154 default:
144 $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), true); 155 $this->ReturnView($viewmodel->ConfigTagsInTopic($this->postdata), true);