Merge pull request #250 from emarguin/audio_in_lp_langvar

add message in multiple lp audio upload form when no items in lp - refs #6948
1.9.x
Yannick Warnier 11 years ago
commit 7832202531
  1. 49
      main/newscorm/learnpath.class.php

@ -5085,28 +5085,35 @@ class learnpath
if ($update_audio == 'true') { if ($update_audio == 'true') {
$return .= '<form action="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;updateaudio=' . Security :: remove_XSS($_GET['updateaudio']) .'&amp;action=' . Security :: remove_XSS($_GET['action']) . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">'; $return .= '<form action="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;updateaudio=' . Security :: remove_XSS($_GET['updateaudio']) .'&amp;action=' . Security :: remove_XSS($_GET['action']) . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">';
} }
$return .= '<div id="message"></div>'; $return .= '<div id="message"></div>';
if(count($this->items) == 0)
$return_audio = '<table class="data_table">'; {
$return_audio .= '<tr>'; $return .= Display::display_normal_message(get_lang('YouShouldAddItemsBeforeAttachAudio'));
$return_audio .= '<th width="60%">' . get_lang('Title') . '</th>'; }
$return_audio .= '<th>' . get_lang('Audio') . '</th>'; else
$return_audio .= '</tr>'; {
if ($update_audio != 'true') { $return_audio = '<table class="data_table">';
$return .= '<div class="span12">'; $return_audio .= '<tr>';
$return .= self::return_new_tree($update_audio); $return_audio .= '<th width="60%">' . get_lang('Title') . '</th>';
$return .='</div>'; $return_audio .= '<th>' . get_lang('Audio') . '</th>';
$return .= Display::div(Display::url(get_lang('Save'), '#', array('id'=>'listSubmit', 'class'=>'btn')), array('style'=>'float:left; margin-top:15px;width:100%')); $return_audio .= '</tr>';
} else {
$return_audio .= self::return_new_tree($update_audio); if ($update_audio != 'true') {
$return .= $return_audio.'</table>'; $return .= '<div class="span12">';
} $return .= self::return_new_tree($update_audio);
$return .='</div>';
$return .= Display::div(Display::url(get_lang('Save'), '#', array('id'=>'listSubmit', 'class'=>'btn')), array('style'=>'float:left; margin-top:15px;width:100%'));
} else {
$return_audio .= self::return_new_tree($update_audio);
$return .= $return_audio.'</table>';
}
// We need to close the form when we are updating the mp3 files. // We need to close the form when we are updating the mp3 files.
if ($update_audio == 'true') { if ($update_audio == 'true') {
$return .= '<div style="margin:40px 0; float:right;"><button class="save" type="submit" name="save_audio" id="save_audio">' . get_lang('SaveAudioAndOrganization') . '</button></div>'; // TODO: What kind of language variable is this? $return .= '<div style="margin:40px 0; float:right;"><button class="save" type="submit" name="save_audio" id="save_audio">' . get_lang('SaveAudioAndOrganization') . '</button></div>'; // TODO: What kind of language variable is this?
} }
}
// We need to close the form when we are updating the mp3 files. // We need to close the form when we are updating the mp3 files.
if ($update_audio == 'true' && count($arrLP) != 0) { if ($update_audio == 'true' && count($arrLP) != 0) {

Loading…
Cancel
Save