diff --git a/plugins/cipf_plugin/html/menu/cipf_menu.html b/plugins/cipf_plugin/html/menu/cipf_menu.html
index 7113318..982570d 100644
--- a/plugins/cipf_plugin/html/menu/cipf_menu.html
+++ b/plugins/cipf_plugin/html/menu/cipf_menu.html
@@ -55,31 +55,6 @@
-
-
email a la creation de compte
-
-
diff --git a/plugins/cipf_plugin/php/admin_menu/menu_content.php b/plugins/cipf_plugin/php/admin_menu/menu_content.php
index 0b5f6bb..ae29d9e 100644
--- a/plugins/cipf_plugin/php/admin_menu/menu_content.php
+++ b/plugins/cipf_plugin/php/admin_menu/menu_content.php
@@ -32,10 +32,10 @@ function add_plugin_content_CIPF() {
/*
* registration email
*
- */
$admin_post_payment_messages = Plgntls::ADMIN_POST_PAYMENT_MESSAGES;
$nonce_payment_messages = Plgntls::ADMIN_MENU_NONCE_PAYMENT_MESSAGES;
$payment_messages = get_payment_messages_option_CIPF();
+ */
ob_start();
include(Plgntls::root_path() . '/html/menu/cipf_menu.html');
diff --git a/plugins/xtxpatch/html/admin_menu.html b/plugins/xtxpatch/html/admin_menu.html
new file mode 100644
index 0000000..a8f295c
--- /dev/null
+++ b/plugins/xtxpatch/html/admin_menu.html
@@ -0,0 +1,50 @@
+
+
+
+email a la creation de compte
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/xtxpatch/php/classes/plgntls_class.php b/plugins/xtxpatch/php/classes/plgntls_class.php
index 5a5b1ef..65f6a4f 100644
--- a/plugins/xtxpatch/php/classes/plgntls_class.php
+++ b/plugins/xtxpatch/php/classes/plgntls_class.php
@@ -487,9 +487,7 @@ class Plgntls_xtx {
if ($file->ext === 'html')
include($file->path);
}
- $html = ob_get_clean();
-
- return $html;
+ return ob_get_clean();
}
/*
@@ -883,11 +881,8 @@ class Plgntls_xtx {
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
- const SLUG_TOOGLE_ADMIN_MENU = "toggle_admin_menu_url_xtxpatch";
- const ACTION_TOOGLE_ADMIN_MENU = "toggle_admin_menu_url_xtxpatch";
const OPTION_TOGGLE_MENU = [
'_name'=>'toggle_admin_menu_option_xtxpatch',
- '_callback'=>__CLASS__.'::toggle_plugin_menu',
'_default'=>'hide',
'show'=>'show',
'hide'=>'hide',
@@ -919,7 +914,7 @@ class Plgntls_xtx {
$menu_options = array('callback'=>$menu_options);
}
- self::_create_menu($options);
+ self::_create_menu($menu_options);
}
/*
@@ -1004,18 +999,13 @@ class Plgntls_xtx {
* handle the toggle menu when url is reached
*
*/
- public static function toggle_plugin_menu($request, $option_name) {
- error_log("inside toggle_plugin_menu");
-
+ public static function toggle_plugin_menu($request, $option_name, $option_value) {
if ($request[$option_name] === 'show') {
update_option($option_name, 'show');
}
else if ($request[$option_name] === 'hide') {
update_option($option_name, 'hide');
}
-
- self::redirect_menu_referer();
- exit;
}
@@ -1077,12 +1067,38 @@ class Plgntls_xtx {
public static function get_option_safe($option) {
/*
* first init option, in case it was not already
+ * it will returns the option name or false
+ * it also works if the option is the name directly
*
*/
- if (false === self::_init_option($option)) {
+ $option_name = self::_init_option($option);
+ if (false === $option_name) {
return;
}
- return get_option($option['_name']);
+
+ $option_data = get_option($option_name);
+ if (!is_string($option_data)) {
+ $option_data = serialize($option_data);
+ }
+ return $option_data;
+ }
+
+ public static function update_option_safe($option, $option_data) {
+ /*
+ * first init option, in case it was not already
+ * it will returns the option name or false
+ * it also works if the option is the name directly
+ *
+ */
+ $option_name = self::_init_option($option);
+ if (false === $option_name) {
+ return;
+ }
+
+ if (!is_string($option_data)) {
+ $option_data = serialize($option_data);
+ }
+ update_option($option_name, $option_data);
}
public static function get_option_link_href($option_name) {
@@ -1109,11 +1125,12 @@ class Plgntls_xtx {
if (false === $option_data) {
return null;
}
- $form = '