From f253b833f26aeb85f8a3cd18a154343eae454e17 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Sun, 1 Jul 2018 14:17:24 +0200 Subject: [PATCH] clean up plugins and improve them --- bl-kernel/abstract/plugin.class.php | 5 + bl-kernel/admin/themes/booty/css/bludit.css | 4 +- bl-kernel/admin/views/edit-content.php | 10 +- bl-kernel/admin/views/new-content.php | 2 +- bl-languages/en.json | 3 +- bl-plugins/api/plugin.php | 6 +- bl-plugins/backup/languages/de_CH.json | 3 +- bl-plugins/backup/languages/de_DE.json | 3 +- bl-plugins/backup/languages/en.json | 3 +- bl-plugins/backup/languages/es.json | 3 +- bl-plugins/backup/languages/fr_FR.json | 3 +- bl-plugins/backup/languages/it.json | 3 +- bl-plugins/backup/languages/tr_TR.json | 3 +- bl-plugins/backup/plugin.php | 21 ++- bl-plugins/links/plugin.php | 2 +- bl-plugins/opengraph/plugin.php | 16 +- bl-plugins/quill/metadata.json | 10 +- bl-plugins/simple-stats/plugin.php | 6 +- bl-plugins/simplemde/plugin.php | 167 ++++++++++---------- index.php | 2 +- 20 files changed, 148 insertions(+), 127 deletions(-) diff --git a/bl-kernel/abstract/plugin.class.php b/bl-kernel/abstract/plugin.class.php index ce15c75e..786f868b 100644 --- a/bl-kernel/abstract/plugin.class.php +++ b/bl-kernel/abstract/plugin.class.php @@ -156,6 +156,11 @@ class Plugin { return ''; } + public function label() + { + return $this->getMetadata('label'); + } + public function name() { return $this->getMetadata('name'); diff --git a/bl-kernel/admin/themes/booty/css/bludit.css b/bl-kernel/admin/themes/booty/css/bludit.css index 27f3f502..7f3043a0 100644 --- a/bl-kernel/admin/themes/booty/css/bludit.css +++ b/bl-kernel/admin/themes/booty/css/bludit.css @@ -99,7 +99,9 @@ body.login { border-radius: 0px; border: 0; z-index: 1000; - width: 100%; + bottom: 0; + right: 0; + margin: 0; } .alert-success { diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index ee381ca9..c3b2989b 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -65,9 +65,9 @@
- - - g('Cancel') ?> + + + g('Cancel') ?>
@@ -79,7 +79,7 @@ echo Bootstrap::formTitle(array('title'=>'Select images')); ?> - + 'Cover image')); @@ -92,7 +92,7 @@ } ?> - 200x200 + coverImagePreview 'External Cover image')); diff --git a/bl-kernel/admin/views/new-content.php b/bl-kernel/admin/views/new-content.php index 972429c3..cdb84510 100644 --- a/bl-kernel/admin/views/new-content.php +++ b/bl-kernel/admin/views/new-content.php @@ -73,7 +73,7 @@ echo Bootstrap::formTitle(array('title'=>'Select images or upload images')); ?> - + 'Cover image')); diff --git a/bl-languages/en.json b/bl-languages/en.json index fafad5ac..91a45c2c 100644 --- a/bl-languages/en.json +++ b/bl-languages/en.json @@ -295,5 +295,6 @@ "example-page-3-content": "Get information about news, new releases, new themes or new plugins on our social networks [Facebook](https:\/\/www.facebook.com\/bluditcms\/), [Twitter](https:\/\/twitter.com\/bludit) and [GooglePlus](https:\/\/plus.google.com\/+Bluditcms) or visit our [Blog](https:\/\/blog.bludit.com).", "example-page-4-slug": "about", "example-page-4-title": "About", - "example-page-4-content": "Your About page is typically one of the most visited pages on your site, need to be simple with a few key things, such as your name, who are you, how can contact you, a small story, etc." + "example-page-4-content": "Your About page is typically one of the most visited pages on your site, need to be simple with a few key things, such as your name, who are you, how can contact you, a small story, etc.", + "the-extension-zip-is-not-installed": "The extension zip is not installed, to use this plugin you need to install the extension." } \ No newline at end of file diff --git a/bl-plugins/api/plugin.php b/bl-plugins/api/plugin.php index 78e2e6e9..ac187475 100644 --- a/bl-plugins/api/plugin.php +++ b/bl-plugins/api/plugin.php @@ -19,7 +19,11 @@ class pluginAPI extends Plugin { { global $Language; - $html = '
'; + $html = ''; + + $html .= '
'; $html .= ''; $html .= ''; $html .= ''.$Language->get('This token is for read only and is regenerated every time you install the plugin').''; diff --git a/bl-plugins/backup/languages/de_CH.json b/bl-plugins/backup/languages/de_CH.json index 4c790096..b36f925d 100644 --- a/bl-plugins/backup/languages/de_CH.json +++ b/bl-plugins/backup/languages/de_CH.json @@ -7,5 +7,6 @@ "create-backup": "Backup erstellen", "download": "Backup herunterladen", "restore-backup": "Backup wiederherstellen", - "delete-backup": "Backup löschen" + "delete-backup": "Backup löschen", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } diff --git a/bl-plugins/backup/languages/de_DE.json b/bl-plugins/backup/languages/de_DE.json index 4c790096..b36f925d 100644 --- a/bl-plugins/backup/languages/de_DE.json +++ b/bl-plugins/backup/languages/de_DE.json @@ -7,5 +7,6 @@ "create-backup": "Backup erstellen", "download": "Backup herunterladen", "restore-backup": "Backup wiederherstellen", - "delete-backup": "Backup löschen" + "delete-backup": "Backup löschen", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } diff --git a/bl-plugins/backup/languages/en.json b/bl-plugins/backup/languages/en.json index 0453ba3b..a9f5a578 100644 --- a/bl-plugins/backup/languages/en.json +++ b/bl-plugins/backup/languages/en.json @@ -7,5 +7,6 @@ "create-backup": "Create Backup", "download": "Download", "restore-backup": "Restore Backup", - "delete-backup": "Delete Backup" + "delete-backup": "Delete Backup", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } \ No newline at end of file diff --git a/bl-plugins/backup/languages/es.json b/bl-plugins/backup/languages/es.json index fed6c356..6d5a3b31 100644 --- a/bl-plugins/backup/languages/es.json +++ b/bl-plugins/backup/languages/es.json @@ -7,5 +7,6 @@ "create-backup": "Crear Backup", "download": "Descargar", "restore-backup": "Recuperar Backup", - "delete-backup": "Eliminar Backup" + "delete-backup": "Eliminar Backup", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } \ No newline at end of file diff --git a/bl-plugins/backup/languages/fr_FR.json b/bl-plugins/backup/languages/fr_FR.json index 5ddb357e..3356b97e 100755 --- a/bl-plugins/backup/languages/fr_FR.json +++ b/bl-plugins/backup/languages/fr_FR.json @@ -7,5 +7,6 @@ "create-backup": "Créer une sauvegarde", "download": "Télécharger", "restore-backup": "Restaurer la sauvegarde", - "delete-backup": "Supprimer la sauvegarde" + "delete-backup": "Supprimer la sauvegarde", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } \ No newline at end of file diff --git a/bl-plugins/backup/languages/it.json b/bl-plugins/backup/languages/it.json index e73a3cf1..175f4f04 100644 --- a/bl-plugins/backup/languages/it.json +++ b/bl-plugins/backup/languages/it.json @@ -7,5 +7,6 @@ "create-backup": "Crea Backup", "download": "Scarica", "restore-backup": "Ripristina Backup", - "delete-backup": "Elimina Backup" + "delete-backup": "Elimina Backup", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } \ No newline at end of file diff --git a/bl-plugins/backup/languages/tr_TR.json b/bl-plugins/backup/languages/tr_TR.json index 193002a7..0024bbce 100644 --- a/bl-plugins/backup/languages/tr_TR.json +++ b/bl-plugins/backup/languages/tr_TR.json @@ -7,5 +7,6 @@ "create-backup": "Yedek Al", "download": "İndir", "restore-backup": "Geri Yükle", - "delete-backup": "Delete Backup" + "delete-backup": "Delete Backup", + "there-are-no-backups-for-the-moment": "There are no backups for the moment" } \ No newline at end of file diff --git a/bl-plugins/backup/plugin.php b/bl-plugins/backup/plugin.php index 56f5ca42..1cdec29d 100644 --- a/bl-plugins/backup/plugin.php +++ b/bl-plugins/backup/plugin.php @@ -2,7 +2,7 @@ class pluginBackup extends Plugin { - // List of directories to backup + // Directories to backup private $directoriesToBackup = array( PATH_PAGES, PATH_DATABASES, @@ -65,8 +65,15 @@ class pluginBackup extends Plugin { $backups = Filesystem::listFiles($this->workspace(), '*', 'zip', true); } - $html = '
'; - $html .= ''; + $html = ''; + if (empty($backups)) { + $html .= ''; + } + + $html .= '
'; + $html .= ''; $html .= '
'; $html .= '
'; @@ -75,13 +82,13 @@ class pluginBackup extends Plugin { $basename = pathinfo($backup,PATHINFO_BASENAME); $html .= '
'; - $html .= '

'.Date::format($filename, BACKUP_DATE_FORMAT, 'F j, Y, g:i a').'

'; + $html .= '

'.Date::format($filename, BACKUP_DATE_FORMAT, 'F j, Y, g:i a').'

'; // Allow download if a zip file if ($this->zip) { - $html .= ' '.$Language->get('download').''; + $html .= ' '.$Language->get('download').''; } - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; $html .= '
'; $html .= '
'; } diff --git a/bl-plugins/links/plugin.php b/bl-plugins/links/plugin.php index b63c7e86..61e690d4 100644 --- a/bl-plugins/links/plugin.php +++ b/bl-plugins/links/plugin.php @@ -71,7 +71,7 @@ class pluginLinks extends Plugin { $html .= '
'; $html .= '
'; - $html .= ''; + $html .= ''; $html .= '
'; // New link, when the user click on save button this call the method post() diff --git a/bl-plugins/opengraph/plugin.php b/bl-plugins/opengraph/plugin.php index 0642bc4c..e9e5ac86 100644 --- a/bl-plugins/opengraph/plugin.php +++ b/bl-plugins/opengraph/plugin.php @@ -17,23 +17,9 @@ class pluginOpenGraph extends Plugin { $html = '
'; $html .= ''; $html .= ''; + $html .= 'Set a default image for the content without pictures.'; $html .= '
'; - /* - $html = '
'; - $html .= ''; - $html .= ''; - $html .= '
'; - */ - return $html; } diff --git a/bl-plugins/quill/metadata.json b/bl-plugins/quill/metadata.json index e7db68e5..864d76c9 100644 --- a/bl-plugins/quill/metadata.json +++ b/bl-plugins/quill/metadata.json @@ -1,10 +1,10 @@ { "author": "Quill", "email": "", - "website": "https://www.quill.com", - "version": "4.7.5", - "releaseDate": "2018-01-22", - "license": "GPL v2", - "compatible": "2.3", + "website": "https://quilljs.com/", + "version": "1.3.6", + "releaseDate": "2018-03-12", + "license": "BSD 3-Clause", + "compatible": "3.0", "notes": "" } \ No newline at end of file diff --git a/bl-plugins/simple-stats/plugin.php b/bl-plugins/simple-stats/plugin.php index bfc684c8..b4776a39 100644 --- a/bl-plugins/simple-stats/plugin.php +++ b/bl-plugins/simple-stats/plugin.php @@ -22,7 +22,11 @@ class pluginSimpleStats extends Plugin { { global $Language; - $html = '
'; + $html = ''; + + $html .= '
'; $html .= ''; $html .= ''; $html .= ''.$Language->get('This title is almost always used in the sidebar of the site').''; diff --git a/bl-plugins/simplemde/plugin.php b/bl-plugins/simplemde/plugin.php index 6c0b3cdd..30abc230 100644 --- a/bl-plugins/simplemde/plugin.php +++ b/bl-plugins/simplemde/plugin.php @@ -44,94 +44,99 @@ class pluginsimpleMDE extends Plugin { public function adminHead() { - if (in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { - $html = ''; - - // Path plugin. - $pluginPath = $this->htmlPath(); - - // SimpleMDE css - $html .= ''; - - // SimpleMDE js - $html .= ''; - - // Hack for Bludit - $html .= ''; - - return $html; + if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { + return false; } - return false; + $html = ''; + + // Path plugin. + $pluginPath = $this->htmlPath(); + + // SimpleMDE css + $html .= ''; + + // Hack for Bludit + $html .= ''; + + return $html; } public function adminBodyEnd() { - if (in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { - // Autosave - global $Page; - global $Language; - $autosaveID = $GLOBALS['ADMIN_CONTROLLER']; - $autosaveEnable = $this->getDbField('autosave')?'true':'false'; - if (!empty($Page)) { - $autosaveID = $Page->key(); - } - - // Spell Checker - $spellCheckerEnable = $this->getDbField('spellChecker')?'true':'false'; - - $pluginPath = $this->htmlPath(); - - $html = ''; - return $html; + if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) { + return false; } - return false; + // Autosave + global $Page; + global $Language; + $autosaveID = $GLOBALS['ADMIN_CONTROLLER']; + $autosaveEnable = $this->getDbField('autosave')?'true':'false'; + if (!empty($Page)) { + $autosaveID = $Page->key(); + } + + // Spell Checker + $spellCheckerEnable = $this->getDbField('spellChecker')?'true':'false'; + + $pluginPath = $this->htmlPath(); + + // SimpleMDE js + $html = ''; + + $html .= ''; + return $html; } } diff --git a/index.php b/index.php index fa11bcdb..5f04e248 100644 --- a/index.php +++ b/index.php @@ -38,4 +38,4 @@ if ($Url->whereAmI()==='admin') { // Site else { require(PATH_BOOT.'site.php'); -} \ No newline at end of file +}