Changeset 627 for trunk/app/controllers/forums_controller.php
- Timestamp:
- 07/05/08 01:09:56 (5 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/forums_controller.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/forums_controller.php
r626 r627 119 119 public function admin_topics( $f_id ) 120 120 { 121 $forum_id = (int) $f_id;122 123 if ( !is_int($forum_id) ) 124 {125 $this->redirect('/');126 }121 $forum_id = (int) $f_id; 122 123 if ( !is_int($forum_id) ): 124 $this->redirect('/'); 125 return false; 126 endif; 127 127 128 128 $this->layout = 'admin'; … … 139 139 $this->set('vclassrooms', $this->Forum->getVclassrooms($this->Auth->user('id'))); 140 140 141 if ( !empty( $this->data['Forum'] ) ) 142 { 141 if ( !empty( $this->data['Forum'] ) ): 142 143 143 $this->Sanitize = new Sanitize; 144 144 … … 149 149 $this->Forum->create(); 150 150 151 if ( $this->Forum->save($this->data['Forum']) ) 152 { 153 $this->msgFlash('Forum created', '/admin/catforums/listing'); 154 } 155 } 156 else 157 { 151 if ( $this->Forum->save($this->data['Forum']) ): 152 $this->msgFlash(__('Forum created', true), '/admin/catforums/listing'); 153 endif; 154 155 else: 158 156 $this->set('catforum_id', $catforum_id); 159 }157 endif; 160 158 } 161 159 … … 165 163 $this->set('vclassrooms', $this->Forum->getVclassrooms($this->Auth->user('id'))); 166 164 167 if (empty($this->data['Forum'])) 168 {165 if (empty($this->data['Forum'])): 166 169 167 $this->layout = 'admin'; 170 168 … … 172 170 173 171 $this->data = $this->Forum->read(); 174 } 175 else 176 { 177 $this->Sanitize = new Sanitize; 172 173 else: 174 $this->Sanitize = new Sanitize; 178 175 179 $this->Sanitize->clean($this->data['Forum']);176 $this->Sanitize->clean($this->data['Forum']); 180 177 181 if ($this->Forum->save($this->data['Forum'])) 182 { 183 $this->msgFlash('Forum updated', '/admin/catforums/listing'); 184 } 185 } 178 if ($this->Forum->save($this->data['Forum'])): 179 $this->msgFlash(__('Data saved', true), '/admin/catforums/listing'); 180 endif; 181 endif; 186 182 } 187 183 // change status published/draft … … 202 198 } 203 199 204 public function admin_delete($ id)200 public function admin_delete($forum_id) 205 201 { 206 if ( $this->Forum->del($id) ) 207 { 208 $this->msgFlash('Forum deleted', '/admin/catforums/listing'); 209 } 210 } 211 202 if ( $this->Forum->del($forum_id) ): 203 $this->msgFlash(__('Forum deleted', true), '/admin/catforums/listing'); 204 endif; 205 } 212 206 } 213 207 ?>
