setup.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. /**
  3. * SquirrelMail Demo Plugin
  4. * @copyright 2006-2025 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_bottom']['demo']
  26. = 'demo_login_bottom';
  27. //FIXME: this template may have more plugin output sections that are not yet implemented below
  28. $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['demo']
  29. = 'demo_page_header_template';
  30. $squirrelmail_plugin_hooks['optpage_register_block']['demo']
  31. = 'demo_option_link';
  32. $squirrelmail_plugin_hooks['configtest']['demo']
  33. = 'demo_check_configuration';
  34. }
  35. /**
  36. * Returns info about this plugin
  37. *
  38. * @return array An array of plugin information.
  39. *
  40. */
  41. function demo_info()
  42. {
  43. return array(
  44. 'english_name' => 'Demo',
  45. 'version' => 'CORE',
  46. 'summary' => 'This plugin provides test/sample code for many of the hook points in the SquirrelMail core.',
  47. 'details' => 'This plugin provides test/sample code for many of the hook points in the SquirrelMail core.',
  48. 'requires_configuration' => 0,
  49. 'requires_source_patch' => 0,
  50. );
  51. }
  52. /**
  53. * Returns version info about this plugin
  54. *
  55. */
  56. function demo_version()
  57. {
  58. $info = demo_info();
  59. return $info['version'];
  60. }
  61. /**
  62. * Add link to menu at top of content pane
  63. *
  64. * @return void
  65. *
  66. */
  67. function demo_page_header_template()
  68. {
  69. include_once(SM_PATH . 'plugins/demo/functions.php');
  70. return demo_page_header_template_do();
  71. }
  72. /**
  73. * Inserts an option block in the main SM options page
  74. *
  75. * @return void
  76. *
  77. */
  78. function demo_option_link()
  79. {
  80. include_once(SM_PATH . 'plugins/demo/functions.php');
  81. demo_option_link_do();
  82. }
  83. /**
  84. * Validate that this plugin is configured correctly
  85. *
  86. * @return boolean Whether or not there was a
  87. * configuration error for this plugin.
  88. *
  89. */
  90. function demo_check_configuration()
  91. {
  92. include_once(SM_PATH . 'plugins/demo/functions.php');
  93. return demo_check_configuration_do();
  94. }