bludit/bl-plugins/version/plugin.php

21 lines
904 B
PHP
Raw Normal View History

<?php
class pluginVersion extends Plugin {
2018-07-02 00:24:53 +02:00
public function adminSidebar()
2017-06-28 22:27:17 +02:00
{
global $language;
2018-07-02 00:24:53 +02:00
$html = '<a id="current-version" class="nav-link" href="'.HTML_PATH_ADMIN_ROOT.'about'.'">Version '.(defined('BLUDIT_PRO')?'<span class="oi oi-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">'.$language->get('New version available').' <span class="oi oi-bell" style="color: red"></span></a>';
return $html;
}
public function adminBodyEnd()
{
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
$jsPath = $this->phpPath() . 'js' . DS;
$scripts = '<script>' . file_get_contents($jsPath . 'version.js') . '</script>';
return $scripts;
}
}