functions.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * SquirrelMail Demo Plugin
  4. *
  5. * @copyright 2006-2025 The SquirrelMail Project Team
  6. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  7. * @version $Id$
  8. * @package plugins
  9. * @subpackage demo
  10. */
  11. /**
  12. * Add link to menu at top of content pane
  13. *
  14. * @return void
  15. *
  16. */
  17. function demo_page_header_template_do()
  18. {
  19. global $oTemplate, $nbsp;
  20. sq_change_text_domain('demo');
  21. $output = makeInternalLink('plugins/demo/demo.php', _("Demo"), '')
  22. . $nbsp . $nbsp;
  23. sq_change_text_domain('squirrelmail');
  24. return array('menuline' => $output);
  25. }
  26. /**
  27. * Inserts an option block in the main SM options page
  28. *
  29. */
  30. function demo_option_link_do()
  31. {
  32. global $optpage_blocks;
  33. sq_change_text_domain('demo');
  34. $optpage_blocks[] = array(
  35. 'name' => _("Demo"),
  36. 'url' => sqm_baseuri() . 'plugins/demo/demo.php',
  37. 'desc' => _("This is where you would describe what your plugin does."),
  38. 'js' => FALSE
  39. );
  40. sq_change_text_domain('squirrelmail');
  41. }
  42. /**
  43. * Validate that this plugin is configured correctly
  44. *
  45. * @return boolean Whether or not there was a
  46. * configuration error for this plugin.
  47. *
  48. */
  49. function demo_check_configuration_do()
  50. {
  51. // test for something that this plugin requires, print error if
  52. // misconfigured or requirements are missing
  53. //
  54. if (FALSE) // put something meaningful here
  55. {
  56. do_err('Demo plugin is missing something important', FALSE);
  57. return TRUE; // return FALSE if you only want to display a non-critical error
  58. }
  59. return FALSE;
  60. }