Improve whispeak plugin messages - refs BT#14921

pull/2697/head
Angel Fernando Quiroz Campos 8 years ago
parent 15d9bbd4c1
commit 3f76737026
  1. 4
      plugin/whispeakauth/ajax/record_audio.php
  2. 2
      plugin/whispeakauth/enrollment.php
  3. 1
      plugin/whispeakauth/lang/english.php
  4. 1
      plugin/whispeakauth/lang/spanish.php
  5. 9
      plugin/whispeakauth/view/record_audio.html.twig

@ -89,7 +89,7 @@ if ($isAuthentify) {
$result = $plugin->requestAuthentify($user, $newFullPath);
if (empty($result)) {
echo Display::return_message($plugin->get_lang('AuthentifyFailed'));
echo Display::return_message($plugin->get_lang('AuthentifyFailed'), 'error');
exit;
}
@ -97,7 +97,7 @@ if ($isAuthentify) {
$success = (bool) $result['audio'][0]['result'];
if (!$success) {
echo Display::return_message($plugin->get_lang('TryAgain'));
echo Display::return_message($plugin->get_lang('TryAgain'), 'warning');
exit;
}

@ -7,6 +7,7 @@ require_once __DIR__.'/../../main/inc/global.inc.php';
api_block_anonymous_users(true);
$userId = api_get_user_id();
$plugin = WhispeakAuthPlugin::create();
$sampleText = $plugin->get_lang('EnrollmentSampleText');
@ -15,6 +16,7 @@ $htmlHeadXtra[] = api_get_js('rtc/RecordRTC.js');
$htmlHeadXtra[] = api_get_js_simple(api_get_path(WEB_PLUGIN_PATH).'whispeakauth/assets/js/RecordAudio.js');
$template = new Template();
$template->assign('is_authenticated', WhispeakAuthPlugin::checkUserIsEnrolled($userId));
$template->assign('sample_text', $sampleText);
$content = $template->fetch('whispeakauth/view/record_audio.html.twig');

@ -15,6 +15,7 @@ $strings['EnrollmentSampleText'] = 'The famous Mona Lisa painting was painted by
$strings['RepeatThisPhrase'] = 'Repeat this phrase three times after allowing audio recording:';
$strings['SpeechAuthAlreadyEnrolled'] = 'Speech authentication already enrolled previously.';
$strings['SpeechAuthentication'] = 'Speech authentication';
$strings['EnrollmentFailed'] = 'Enrollment failed.';
$strings['EnrollmentSuccess'] = 'Enrollment success.';

@ -15,6 +15,7 @@ $strings['EnrollmentSampleText'] = 'El famoso cuadro de Mona Lisa fue pintado po
$strings['RepeatThisPhrase'] = 'Repita esta frase tres veces después de permitir la grabación de audio:';
$strings['SpeechAuthAlreadyEnrolled'] = 'Autenticación de voz registrada anteriormente.';
$strings['SpeechAuthentication'] = 'Atenticación con voz';
$strings['EnrollmentFailed'] = 'Inscripción fallida.';
$strings['EnrollmentSuccess'] = 'Inscripción correcta.';

@ -37,7 +37,14 @@
<audio class="center-block" controls id="record-preview"></audio>
</p>
</div>
<div class="col-sm-5 col-sm-offset-1" id="messages-deck"></div>
<div class="col-sm-5 col-sm-offset-1" id="messages-deck">
{% if is_authenticated %}
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span>
<strong>{{ 'SpeechAuthAlreadyEnrolled'|get_plugin_lang('WhispeakAuthPlugin') }}</strong>
</div>
{% endif %}
</div>
</div>
<script>

Loading…
Cancel
Save