From 017cbfa667c03a8e111e1e866ac2d4e6ffb3e0ec Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Sat, 14 Mar 2020 12:02:23 +0100 Subject: [PATCH] Settings for the plugin version, new version alert and show current version --- bl-plugins/version/plugin.php | 57 ++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/bl-plugins/version/plugin.php b/bl-plugins/version/plugin.php index 17d8138b..2448597a 100644 --- a/bl-plugins/version/plugin.php +++ b/bl-plugins/version/plugin.php @@ -2,20 +2,63 @@ class pluginVersion extends Plugin { + public function init() + { + $this->dbFields = array( + 'showCurrentVersion'=>true, + 'newVersionAlert'=>true + ); + } + + public function form() + { + global $L; + + $html = ''; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + return $html; + } + public function adminSidebar() { global $L; - $html = 'Version '.(defined('BLUDIT_PRO')?'':'').''.BLUDIT_VERSION.''; - $html .= ''; + $html = ''; + if ($this->getValue('showCurrentVersion')) { + $html = 'Version '.(defined('BLUDIT_PRO')?'':'').''.BLUDIT_VERSION.''; + } + if ($this->getValue('newVersionAlert')) { + $html .= ''; + } return $html; } public function adminBodyEnd() { - // 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 = ''; - return $scripts; + if ($this->getValue('newVersionAlert')) { + // 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 = ''; + return $scripts; + } + return false; } } \ No newline at end of file