+
certificate->generated_body;
?>
@@ -196,12 +217,15 @@
{
jQuery('#certificateContent').hide();
}
- else
- {
- certificateImage.generateImage(document.querySelector("#certificateContent"));
- }
certificateImage.enableDownloadShareBtns();
});
+window.onload = function() {
+ if (!imageExists)
+ {
+ certificateImage.generateImage(document.querySelector("#certificateContent"));
+ }
+}
+
diff --git a/src/components/com_tjcertificate/site/views/certificate/view.html.php b/src/components/com_tjcertificate/site/views/certificate/view.html.php
index 34d45bfc..a4a63504 100644
--- a/src/components/com_tjcertificate/site/views/certificate/view.html.php
+++ b/src/components/com_tjcertificate/site/views/certificate/view.html.php
@@ -46,6 +46,8 @@ class TjCertificateViewCertificate extends JViewLegacy
public $fileName = null;
+ public $downloadPermission = null;
+
/**
* Display the view
*
@@ -58,7 +60,7 @@ class TjCertificateViewCertificate extends JViewLegacy
public function display($tpl = null)
{
$this->params = ComponentHelper::getParams('com_tjcertificate');
- $input = Factory::getApplication()->input;
+ $input = Factory::getApplication()->input;
$this->uniqueCertificateId = $input->get('certificate', '', 'STRING');
$this->showSearchBox = $input->getInt('show_search', $this->params->get('show_search_box'));
@@ -72,6 +74,8 @@ public function display($tpl = null)
if (!$this->certificate->id)
{
JError::raiseWarning(500, Text::_('COM_TJCERTIFICATE_ERROR_CERTIFICATE_EXPIRED'));
+
+ return false;
}
}
@@ -89,6 +93,7 @@ public function display($tpl = null)
$certificateUrl = 'index.php?option=com_tjcertificate&view=certificate&certificate=' . $this->certificate->unique_certificate_id;
$this->certificateUrl = Uri::root() . substr(Route::_($certificateUrl), strlen(Uri::base(true)) + 1);
+ $this->downloadPermission = $certificate::canDownload($this->certificate->unique_certificate_id);
// Get HTML
$clientId = $this->certificate->getClientId();
diff --git a/src/components/com_tjcertificate/site/views/certificates/tmpl/my.php b/src/components/com_tjcertificate/site/views/certificates/tmpl/my.php
index 99e969b9..fcd6a227 100644
--- a/src/components/com_tjcertificate/site/views/certificates/tmpl/my.php
+++ b/src/components/com_tjcertificate/site/views/certificates/tmpl/my.php
@@ -57,7 +57,7 @@
|
-
+
|
@@ -105,7 +105,7 @@
?>
|
- title; ?>
+ title ? $data[0]->title : "-"; ?>
|
issued_on, Text::_('DATE_FORMAT_LC')); ?> |
|