if (isset($_REQUEST['id'])) {
             $lp_item_obj = new learnpathItem($_REQUEST['id']);
             //Remove audio
             if (isset($_POST['delete_file']) && $_POST['delete_file'] == 1) {
                 $lp_item_obj->remove_audio();
             }
             //Upload audio
             if (isset($_FILES['file']) && !empty($_FILES['file'])) {
                 //Updating the lp.modified_on
                 $_SESSION['oLP']->set_modified_on();
                 $lp_item_obj->add_audio();
             }
             //Add audio file from documents
             if (isset($_REQUEST['document_id']) && !empty($_REQUEST['document_id'])) {
                 $_SESSION['oLP']->set_modified_on();
                 $lp_item_obj->add_audio_from_documents($_REQUEST['document_id']);
             }
             // Display.
             require 'lp_add_audio.php';
         } else {
             require 'lp_add_audio.php';
         }
     }
     break;
 case 'add_lp_category':
     if (!$is_allowed_to_edit) {
         api_not_allowed(true);
     }
     require 'lp_add_category.php';
     break;
 case 'move_up_category':
    $newMp3DocumentId = DocumentManager::addAndConvertWavToMp3(
        $documentData,
        $courseInfo,
        api_get_session_id(),
        api_get_user_id(),
        'overwrite',
        true
    );

    if ($newMp3DocumentId) {
        $newDocId = $newMp3DocumentId;
    }

    if (isset($_REQUEST['lp_item_id']) && !empty($_REQUEST['lp_item_id'])) {
        $lpItemId = $_REQUEST['lp_item_id'];
        /** @var learnpath $lp */
        $lp = isset($_SESSION['oLP']) ? $_SESSION['oLP'] : null;

        if (!empty($lp)) {
            $lp->set_modified_on();
            $lpItem = new learnpathItem($lpItemId);
            $lpItem->add_audio_from_documents($newDocId);
            Display::addFlash(
                Display::return_message(get_lang('Updated'), 'info')
            );
        }
    }
} else {
    Display::addFlash($contents);
}