You are here

function opigno_quiz_app_get_certificate in Opigno Quiz App 7

Helper function to get the certificate download link from the Opigno Certificate App.

Parameters

int $nid:

int $uid:

Return value

string

2 calls to opigno_quiz_app_get_certificate()
theme_opigno_quiz_app_course_user_results in ./opigno_quiz_app.module
Theme callback: display course results for a specific user.
theme_opigno_quiz_app_user_course_results in ./opigno_quiz_app.module
Theme callback: display user results for a specific course.

File

./opigno_quiz_app.module, line 1185
Module file. Defines module hooks.

Code

function opigno_quiz_app_get_certificate($nid, $uid) {
  $download_certificate = '';
  if (function_exists('opigno_certificate_app_get_certificate_path')) {
    $certificate_path = opigno_certificate_app_get_certificate_path($nid, $uid);
    if ($certificate_path) {
      $download_certificate = '<a href="' . url($certificate_path) . '" class="opigno-quiz-app-download-certificate opigno-certificate-app-download-certificate-link"><div class="d-inline-block">' . t("certificate") . '</div></a>';
    }
    else {
      $download_certificate = '<span class="opigno-quiz-app-download-certificate"><div class="d-inline-block">' . t("certificate") . '</div></span>';
    }
  }
  return $download_certificate;
}