setup.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. /**
  3. * SquirrelMail Preview Pane Plugin
  4. *
  5. * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  6. * @author Paul Lesneiwski <paul@squirrelmail.org>
  7. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8. * @version $Id$
  9. * @package plugins
  10. * @subpackage preview_pane
  11. *
  12. */
  13. /**
  14. * Register this plugin with SquirrelMail
  15. *
  16. */
  17. function squirrelmail_plugin_init_preview_pane()
  18. {
  19. global $squirrelmail_plugin_hooks;
  20. $squirrelmail_plugin_hooks['subject_link']['preview_pane']
  21. = 'preview_pane_change_message_target';
  22. $squirrelmail_plugin_hooks['optpage_loadhook_display']['preview_pane']
  23. = 'preview_pane_show_options';
  24. $squirrelmail_plugin_hooks['template_construct_message_list.tpl']['preview_pane']
  25. = 'preview_pane_message_list';
  26. $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['preview_pane']
  27. = 'preview_pane_open_close_buttons';
  28. }
  29. if (!defined('SM_PATH'))
  30. define('SM_PATH', '../');
  31. /**
  32. * Returns info about this plugin
  33. *
  34. */
  35. function preview_pane_info()
  36. {
  37. return array(
  38. 'english_name' => 'Preview Pane',
  39. 'version' => '2.0',
  40. 'required_sm_version' => '1.5.2',
  41. 'requires_configuration' => 0,
  42. 'requires_source_patch' => 0,
  43. 'required_plugins' => array(
  44. ),
  45. 'summary' => 'Provides a third frame below the message list for viewing message bodies.',
  46. 'details' => 'This plugin allows the user to turn on an extra frame below the mailbox message list where the messages themselves are displayed, very similar to many other popular (typically non-web-based) email clients.',
  47. );
  48. }
  49. /**
  50. * Returns version info about this plugin
  51. *
  52. */
  53. function preview_pane_version()
  54. {
  55. $info = preview_pane_info();
  56. return $info['version'];
  57. }
  58. /**
  59. * Build user options for display on "Display Preferences" page
  60. *
  61. */
  62. function preview_pane_show_options()
  63. {
  64. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  65. preview_pane_show_options_do();
  66. }
  67. /**
  68. * Construct button that clears out any preview pane
  69. * contents and inserts JavaScript function used by
  70. * message subject link onclick handler. Also disallows
  71. * the message list to be loaded into the bottom frame.
  72. *
  73. */
  74. function preview_pane_message_list()
  75. {
  76. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  77. return preview_pane_message_list_do();
  78. }
  79. /**
  80. * Points message targets to open in the preview pane
  81. * (and possibly refresh message list as well)
  82. *
  83. */
  84. function preview_pane_change_message_target($args)
  85. {
  86. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  87. preview_pane_change_message_target_do($args);
  88. }
  89. /**
  90. * Adds preview pane open/close (and clear) buttons next to
  91. * "provider link"
  92. *
  93. */
  94. function preview_pane_open_close_buttons()
  95. {
  96. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  97. return preview_pane_open_close_buttons_do();
  98. }