setup.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /**
  3. * SquirrelMail Demo Plugin
  4. * @copyright &copy; 2006-2007 The SquirrelMail Project Team
  5. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  6. * @version $Id$
  7. * @package plugins
  8. * @subpackage demo
  9. */
  10. /**
  11. * Register this plugin with SquirrelMail
  12. *
  13. * @return void
  14. *
  15. */
  16. function squirrelmail_plugin_init_demo()
  17. {
  18. //FIXME: put *ALL* SM hooks in here... which includes template_construct hooks for any templates that have plugin output sections in them... and put them all in the right order
  19. //FIXME: many hooks have examples in the original demo plugin in trunk/plugins/demo
  20. global $squirrelmail_plugin_hooks;
  21. //FIXME: this hook not yet implemented below
  22. $squirrelmail_plugin_hooks['login_cookie']['demo']
  23. = 'demo_login_cookie';
  24. //FIXME: not all of the above hooks are yet implemented below
  25. $squirrelmail_plugin_hooks['login_top']['demo']
  26. = 'demo_login_top';
  27. //FIXME: not all of the above hooks are yet implemented below
  28. $squirrelmail_plugin_hooks['login_bottom']['demo']
  29. = 'demo_login_bottom';
  30. //FIXME: this template may have more plugin output sections that are not yet implemented below
  31. $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['demo']
  32. = 'demo_page_header_template';
  33. $squirrelmail_plugin_hooks['optpage_register_block']['demo']
  34. = 'demo_option_link';
  35. $squirrelmail_plugin_hooks['configtest']['demo']
  36. = 'demo_check_configuration';
  37. }
  38. /**
  39. * Returns info about this plugin
  40. *
  41. * @return array An array of plugin information.
  42. *
  43. */
  44. function demo_info()
  45. {
  46. return array(
  47. 'english_name' => 'Demo',
  48. 'version' => 'CORE',
  49. 'summary' => 'This plugin provides test/sample code for many of the hook points in the SquirrelMail core.',
  50. 'details' => 'This plugin provides test/sample code for many of the hook points in the SquirrelMail core.',
  51. 'requires_configuration' => 0,
  52. 'requires_source_patch' => 0,
  53. );
  54. }
  55. /**
  56. * Returns version info about this plugin
  57. *
  58. */
  59. function demo_version()
  60. {
  61. $info = demo_info();
  62. return $info['version'];
  63. }
  64. /**
  65. * Add link to menu at top of content pane
  66. *
  67. * @return void
  68. *
  69. */
  70. function demo_page_header_template()
  71. {
  72. include_once(SM_PATH . 'plugins/demo/functions.php');
  73. return demo_page_header_template_do();
  74. }
  75. /**
  76. * Inserts an option block in the main SM options page
  77. *
  78. * @return void
  79. *
  80. */
  81. function demo_option_link()
  82. {
  83. include_once(SM_PATH . 'plugins/demo/functions.php');
  84. demo_option_link_do();
  85. }
  86. /**
  87. * Validate that this plugin is configured correctly
  88. *
  89. * @return boolean Whether or not there was a
  90. * configuration error for this plugin.
  91. *
  92. */
  93. function demo_check_configuration()
  94. {
  95. include_once(SM_PATH . 'plugins/demo/functions.php');
  96. return demo_check_configuration_do();
  97. }