예제 #1
0
         $content = $form->return_form();
     }
     break;
 case 'edit':
     // Action handling: Editing
     $url = api_get_self() . '?action=' . Security::remove_XSS($_GET['action']) . '&id=' . intval($_GET['id']);
     $form = $timeline->return_form($url, 'edit');
     // The validation or display
     if ($form->validate()) {
         if ($check) {
             $values = $form->exportValues();
             //$timeline->update_all_promotion_status_by_career_id($values['id'],$values['status']);
             $res = $timeline->update($values);
             $message = Display::return_message(sprintf(get_lang('ItemUpdated'), $values['name']), 'confirmation');
         }
         $timeline->display();
     } else {
         $actions = '<a href="' . api_get_self() . '">' . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
         $form->addElement('hidden', 'sec_token');
         $form->setConstants(array('sec_token' => $token));
         $content = $form->return_form();
     }
     break;
 case 'add_item':
     // Action handling: Editing
     $url = api_get_self() . '?action=' . Security::remove_XSS($_GET['action']) . '&parent_id=' . intval($_GET['parent_id']);
     $form = $timeline->return_item_form($url, 'edit');
     // The validation or display
     if ($form->validate()) {
         if ($check) {
             $values = $form->exportValues();