2017-06-28 00:31:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class pluginVersion extends Plugin {
|
|
|
|
|
2017-06-28 22:27:17 +02:00
|
|
|
public function adminHead()
|
|
|
|
{
|
|
|
|
$html = '<style>
|
|
|
|
#plugin-version {
|
|
|
|
display: block;
|
|
|
|
position: fixed;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
background: #eee;
|
|
|
|
padding: 2px 10px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
color: #555;
|
|
|
|
}
|
|
|
|
#plugin-version a {
|
|
|
|
color: #777;
|
|
|
|
margin-left: 8px;
|
|
|
|
}
|
2018-03-06 23:50:31 +01:00
|
|
|
#new-version,
|
|
|
|
#current-version {
|
|
|
|
display: none;
|
|
|
|
}
|
2017-06-28 22:27:17 +02:00
|
|
|
</style>';
|
|
|
|
|
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
|
2018-03-06 23:50:31 +01:00
|
|
|
public function adminBodyBegin()
|
2017-06-28 22:27:17 +02:00
|
|
|
{
|
2017-09-03 23:29:09 +02:00
|
|
|
global $Language;
|
2017-06-28 22:27:17 +02:00
|
|
|
|
2018-03-06 23:50:31 +01:00
|
|
|
$html = '<div id="plugin-version">';
|
|
|
|
$html .= '<div id="new-version"><a target="_blank" href="https://www.bludit.com"><i class="fa fa-download" aria-hidden="true"></i> '.$Language->get('New version available').'</a></div>';
|
2017-06-28 22:27:17 +02:00
|
|
|
|
2018-03-06 23:50:31 +01:00
|
|
|
if (defined('BLUDIT_PRO')) {
|
|
|
|
$html .= '<div id="current-version">Bludit PRO v'.BLUDIT_VERSION.'</div>';
|
2017-06-28 22:27:17 +02:00
|
|
|
} else {
|
2018-03-06 23:50:31 +01:00
|
|
|
$html .= '<div id="current-version">Bludit v'.BLUDIT_VERSION.'<a target="_blank" href="https://pro.bludit.com">'.$Language->get('Upgrade to Bludit PRO').'</a></div>';
|
2017-06-28 22:27:17 +02:00
|
|
|
}
|
|
|
|
|
2018-03-06 23:50:31 +01:00
|
|
|
$html .= '</div>';
|
|
|
|
$html .= '</div>';
|
2017-06-28 22:27:17 +02:00
|
|
|
|
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-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
|
|
|
}
|
|
|
|
}
|