| @@ 203-215 (lines=13) @@ | ||
| 200 | $form->addRule('forum_category_title', get_lang('ThisFieldIsRequired'), 'required'); |
|
| 201 | ||
| 202 | // The validation or display |
|
| 203 | if ($form->validate()) { |
|
| 204 | $check = Security::check_token('post'); |
|
| 205 | if ($check) { |
|
| 206 | $values = $form->exportValues(); |
|
| 207 | store_forumcategory($values); |
|
| 208 | } |
|
| 209 | Security::clear_token(); |
|
| 210 | } else { |
|
| 211 | $token = Security::get_token(); |
|
| 212 | $form->addElement('hidden', 'sec_token'); |
|
| 213 | $form->setConstants(array('sec_token' => $token)); |
|
| 214 | $form->display(); |
|
| 215 | } |
|
| 216 | } |
|
| 217 | ||
| 218 | /** |
|
| @@ 496-508 (lines=13) @@ | ||
| 493 | $form->addRule('forum_category_title', get_lang('ThisFieldIsRequired'), 'required'); |
|
| 494 | ||
| 495 | // Validation or display |
|
| 496 | if ($form->validate()) { |
|
| 497 | $check = Security::check_token('post'); |
|
| 498 | if ($check) { |
|
| 499 | $values = $form->exportValues(); |
|
| 500 | store_forumcategory($values); |
|
| 501 | } |
|
| 502 | Security::clear_token(); |
|
| 503 | } else { |
|
| 504 | $token = Security::get_token(); |
|
| 505 | $form->addElement('hidden', 'sec_token'); |
|
| 506 | $form->setConstants(array('sec_token' => $token)); |
|
| 507 | $form->display(); |
|
| 508 | } |
|
| 509 | } |
|
| 510 | ||
| 511 | /** |
|
| @@ 408-421 (lines=14) @@ | ||
| 405 | } |
|
| 406 | $form->setDefaults($defaults); |
|
| 407 | // Validation or display |
|
| 408 | if ($form->validate()) { |
|
| 409 | $check = Security::check_token('post'); |
|
| 410 | if ($check) { |
|
| 411 | $values = $form->getSubmitValues(); |
|
| 412 | $return_message = store_forum($values); |
|
| 413 | Display :: display_confirmation_message($return_message); |
|
| 414 | } |
|
| 415 | Security::clear_token(); |
|
| 416 | } else { |
|
| 417 | $token = Security::get_token(); |
|
| 418 | $form->addElement('hidden', 'sec_token'); |
|
| 419 | $form->setConstants(array('sec_token' => $token)); |
|
| 420 | $form->display(); |
|
| 421 | } |
|
| 422 | } |
|
| 423 | ||
| 424 | /** |
|