diff --git a/bl-kernel/admin/controllers/configure-plugin.php b/bl-kernel/admin/controllers/configure-plugin.php index 13039d16..60946a16 100644 --- a/bl-kernel/admin/controllers/configure-plugin.php +++ b/bl-kernel/admin/controllers/configure-plugin.php @@ -43,6 +43,9 @@ if(!method_exists($_Plugin, 'form')) { if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $_Plugin->setDb($_POST); + + Theme::plugins('afterFormSave'); + Alert::set($Language->g('the-changes-have-been-saved')); } diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index fe970c02..0e26b89a 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -25,6 +25,7 @@ $plugins = array( 'afterAdminLoad'=>array(), 'beforeRulesLoad'=>array(), + 'afterFormSave'=>array(), 'afterPostCreate'=>array(), 'afterPostModify'=>array(), diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php index ab412a8c..e907d46d 100644 --- a/bl-kernel/page.class.php +++ b/bl-kernel/page.class.php @@ -55,6 +55,7 @@ class Page extends Content { return false; } + // Returns an array with all children's key public function children() { $tmp = array(); diff --git a/bl-plugins/api/plugin.php b/bl-plugins/api/plugin.php index ddc2a3c6..3fa9cb42 100644 --- a/bl-plugins/api/plugin.php +++ b/bl-plugins/api/plugin.php @@ -2,7 +2,37 @@ class pluginAPI extends Plugin { - public function getPost($key) + public function init() + { + $this->dbFields = array( + 'ping'=>false + ); + } + + public function form() + { + $html = '
'; + $html .= 'getDbField('ping')?'checked':'').'>'; + $html .= ''; + $html .= '
'; + + return $html; + } + + public function afterFormSave() + { + $this->ping(); + } + + private function ping() + { + if($this->getDbField('ping')) { + // Just a request HTTP with the website URL + Log::set( file_get_contents('https://www.bludit.com/api.php') ); + } + } + + private function getPost($key) { // Generate the object Post $Post = buildPost($key); @@ -18,7 +48,7 @@ class pluginAPI extends Plugin { return $Post->json(); } - public function getPage($key) + private function getPage($key) { // Generate the object Page $Page = buildPage($key); @@ -53,6 +83,8 @@ class pluginAPI extends Plugin { // ------------------------------------------------------------ // show post {post slug} // show page {page slug} + // show all posts + // show all pages // Get parameters $parameters = explode('/', $URI);