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