setup.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * SquirrelMail Preview Pane Plugin
  4. *
  5. * @copyright 1999-2025 The SquirrelMail Project Team
  6. * @author Paul Lesniewski <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. * Register this plugin with SquirrelMail
  14. */
  15. function squirrelmail_plugin_init_preview_pane()
  16. {
  17. global $squirrelmail_plugin_hooks;
  18. $squirrelmail_plugin_hooks['subject_link']['preview_pane']
  19. = 'preview_pane_change_message_target';
  20. $squirrelmail_plugin_hooks['optpage_loadhook_display']['preview_pane']
  21. = 'preview_pane_show_options';
  22. $squirrelmail_plugin_hooks['template_construct_message_list.tpl']['preview_pane']
  23. = 'preview_pane_message_list';
  24. $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['preview_pane']
  25. = 'preview_pane_open_close_buttons';
  26. }
  27. if (!defined('SM_PATH'))
  28. define('SM_PATH', '../');
  29. /**
  30. * Returns info about this plugin
  31. */
  32. function preview_pane_info()
  33. {
  34. return array(
  35. 'english_name' => 'Preview Pane',
  36. 'version' => '2.0',
  37. 'required_sm_version' => '1.5.2',
  38. 'requires_configuration' => 0,
  39. 'requires_source_patch' => 0,
  40. 'required_plugins' => array(
  41. ),
  42. 'summary' => 'Provides a third frame below the message list for viewing message bodies.',
  43. '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.',
  44. );
  45. }
  46. /**
  47. * Returns version info about this plugin
  48. */
  49. function preview_pane_version()
  50. {
  51. $info = preview_pane_info();
  52. return $info['version'];
  53. }
  54. /**
  55. * Build user options for display on "Display Preferences" page
  56. */
  57. function preview_pane_show_options()
  58. {
  59. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  60. preview_pane_show_options_do();
  61. }
  62. /**
  63. * Construct button that clears out any preview pane
  64. * contents and inserts JavaScript function used by
  65. * message subject link onclick handler. Also disallows
  66. * the message list to be loaded into the bottom frame.
  67. */
  68. function preview_pane_message_list()
  69. {
  70. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  71. return preview_pane_message_list_do();
  72. }
  73. /**
  74. * Points message targets to open in the preview pane
  75. * (and possibly refresh message list as well)
  76. */
  77. function preview_pane_change_message_target($args)
  78. {
  79. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  80. preview_pane_change_message_target_do($args);
  81. }
  82. /**
  83. * Adds preview pane open/close (and clear) buttons next to
  84. * "provider link"
  85. */
  86. function preview_pane_open_close_buttons()
  87. {
  88. include_once(SM_PATH . 'plugins/preview_pane/functions.php');
  89. return preview_pane_open_close_buttons_do();
  90. }