Browse Source

Added configtest hook

pdontthink 18 years ago
parent
commit
27509084b6
2 changed files with 42 additions and 0 deletions
  1. 25 0
      plugins/demo/functions.php
  2. 17 0
      plugins/demo/setup.php

+ 25 - 0
plugins/demo/functions.php

@@ -57,3 +57,28 @@ function demo_option_link_do()
 
 
 
+/**
+  * Validate that this plugin is configured correctly
+  *
+  * @return boolean Whether or not there was a
+  *                 configuration error for this plugin.
+  *
+  */
+function demo_check_configuration_do()
+{
+
+   // test for something that this plugin requires, print error if
+   // misconfigured or requirements are missing
+   //
+   if (FALSE)  // put something meaningful here
+   {
+      do_err('Demo plugin is missing something important', FALSE);
+      return TRUE;  // return FALSE if you only want to display a non-critical error
+   }
+
+   return FALSE;
+
+}
+
+
+

+ 17 - 0
plugins/demo/setup.php

@@ -43,6 +43,8 @@ function squirrelmail_plugin_init_demo()
    $squirrelmail_plugin_hooks['optpage_register_block']['demo']
       = 'demo_option_link';
 
+   $squirrelmail_plugin_hooks['configtest']['demo']
+      = 'demo_check_configuration';
 }
 
 
@@ -109,3 +111,18 @@ function demo_option_link()
 
 
 
+/**
+  * Validate that this plugin is configured correctly
+  *
+  * @return boolean Whether or not there was a
+  *                 configuration error for this plugin.
+  *
+  */
+function demo_check_configuration()
+{
+   include_once(SM_PATH . 'plugins/demo/functions.php');
+   return demo_check_configuration_do();
+}
+
+
+