2017-06-28 00:31:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class pluginVersion extends Plugin {
|
|
|
|
|
2018-07-02 00:24:53 +02:00
|
|
|
public function adminSidebar()
|
2017-06-28 22:27:17 +02:00
|
|
|
{
|
2018-08-05 17:54:20 +02:00
|
|
|
global $L;
|
2019-05-18 11:54:39 +02:00
|
|
|
$html = '<a id="current-version" class="nav-link" href="'.HTML_PATH_ADMIN_ROOT.'about'.'">Version '.(defined('BLUDIT_PRO')?'<span class="fa fa-heart" style="color: #ffc107"></span>':'').'<span class="badge badge-warning badge-pill">'.BLUDIT_VERSION.'</span></a>';
|
|
|
|
$html .= '<a id="new-version" style="display: none;" target="_blank" href="https://www.bludit.com">'.$L->get('New version available').' <span class="fa fa-bell" style="color: red"></span></a>';
|
2018-03-06 23:50:31 +01:00
|
|
|
return $html;
|
2017-09-03 23:29:09 +02:00
|
|
|
}
|
|
|
|
|
2018-03-06 23:50:31 +01:00
|
|
|
public function adminBodyEnd()
|
2017-06-28 00:31:40 +02:00
|
|
|
{
|
2018-07-02 00:24:53 +02:00
|
|
|
// The follow Javascript get via AJAX the information about new versions
|
|
|
|
// The script is on /bl-plugins/version/js/version.js
|
2018-03-06 23:50:31 +01:00
|
|
|
$jsPath = $this->phpPath() . 'js' . DS;
|
|
|
|
$scripts = '<script>' . file_get_contents($jsPath . 'version.js') . '</script>';
|
|
|
|
return $scripts;
|
2017-06-28 00:31:40 +02:00
|
|
|
}
|
|
|
|
}
|