From 941c3ba4769f9f133c72349327d65350657dcb71 Mon Sep 17 00:00:00 2001 From: Eric Marguin Date: Wed, 2 Apr 2014 14:35:51 +0200 Subject: [PATCH] #6948 add message in multiple lp audio upload form when no items in lp --- main/newscorm/learnpath.class.php | 49 ++++++++++++++++++------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index ee2e1bcfc8..76eae50650 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -5041,28 +5041,35 @@ class learnpath if ($update_audio == 'true') { $return .= '
'; } - $return .= '
'; - - $return_audio = ''; - $return_audio .= ''; - $return_audio .= ''; - $return_audio .= ''; - $return_audio .= ''; - - if ($update_audio != 'true') { - $return .= '
'; - $return .= self::return_new_tree($update_audio); - $return .='
'; - $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.'
' . get_lang('Title') . '' . get_lang('Audio') . '
'; - } + $return .= '
'; + if(count($this->items) == 0) + { + $return .= Display::display_normal_message(get_lang('YouShouldAddItemsBeforeAttachAudio')); + } + else + { + + $return_audio = ''; + $return_audio .= ''; + $return_audio .= ''; + $return_audio .= ''; + $return_audio .= ''; + + if ($update_audio != 'true') { + $return .= '
'; + $return .= self::return_new_tree($update_audio); + $return .='
'; + $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.'
' . get_lang('Title') . '' . get_lang('Audio') . '
'; + } - // We need to close the form when we are updating the mp3 files. - if ($update_audio == 'true') { - $return .= '
'; // TODO: What kind of language variable is this? - } + // We need to close the form when we are updating the mp3 files. + if ($update_audio == 'true') { + $return .= '
'; // TODO: What kind of language variable is this? + } + } // We need to close the form when we are updating the mp3 files. if ($update_audio == 'true' && count($arrLP) != 0) {