Browse Source

Add introduction to form when adding read-out text - refs BT#14334

Angel Fernando Quiroz Campos 6 years ago
parent
commit
c9e7c9e5bb
1 changed files with 17 additions and 0 deletions
  1. 17 0
      main/lp/learnpath.class.php

+ 17 - 0
main/lp/learnpath.class.php

@@ -9226,6 +9226,16 @@ class learnpath
             $formHeader = get_lang('EditTheCurrentDocument');
         }
 
+        if ('edit' === $action) {
+            $urlAudioIcon = Display::url(
+                Display::return_icon('audio.png', get_lang('CreateReadOutText'), [], ICON_SIZE_TINY),
+                api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&lp_id='.$this->lp_id.'&'
+                    .http_build_query(['view' => 'build', 'id' => $id, 'action' => 'add_audio'])
+            );
+        } else {
+            $urlAudioIcon = Display::return_icon('audio.png', get_lang('CreateReadOutText'), [], ICON_SIZE_TINY);
+        }
+
         $form = new FormValidator(
             'frm_add_reading',
             'POST',
@@ -9234,6 +9244,13 @@ class learnpath
             ['enctype' => 'multipart/form-data']
         );
         $form->addHeader($formHeader);
+        $form->addHtml(
+            Display::return_message(
+                sprintf(get_lang('FrmReadOutTextIntro'), $urlAudioIcon),
+                'normal',
+                false
+            )
+        );
         $defaults['title'] = !empty($item_title) ? Security::remove_XSS($item_title) : '';
         $defaults['description'] = $item_description;