You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rcmail_output.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------+
  4. | program/include/rcmail_output.php |
  5. | |
  6. | This file is part of the Roundcube PHP suite |
  7. | Copyright (C) 2005-2012 The Roundcube Dev Team |
  8. | |
  9. | Licensed under the GNU General Public License version 3 or |
  10. | any later version with exceptions for skins & plugins. |
  11. | See the README file for a full license statement. |
  12. | CONTENTS: |
  13. | Abstract class for output generation |
  14. | |
  15. +-----------------------------------------------------------------------+
  16. | Author: Thomas Bruederli <roundcube@gmail.com> |
  17. | Author: Aleksander Machniak <alec@alec.pl> |
  18. +-----------------------------------------------------------------------+
  19. */
  20. /**
  21. * Class for output generation
  22. *
  23. * @package Webmail
  24. * @subpackage View
  25. */
  26. abstract class rcmail_output extends rcube_output
  27. {
  28. const JS_OBJECT_NAME = 'rcmail';
  29. const BLANK_GIF = 'R0lGODlhDwAPAIAAAMDAwAAAACH5BAEAAAAALAAAAAAPAA8AQAINhI+py+0Po5y02otnAQA7';
  30. public $type = 'html';
  31. public $ajax_call = false;
  32. public $framed = false;
  33. protected $pagetitle = '';
  34. protected $object_handlers = array();
  35. protected $devel_mode = false;
  36. /**
  37. * Object constructor
  38. */
  39. public function __construct($task = null, $framed = false)
  40. {
  41. parent::__construct();
  42. $this->devel_mode = (bool) $this->config->get('devel_mode');
  43. }
  44. /**
  45. * Setter for page title
  46. *
  47. * @param string $title Page title
  48. */
  49. public function set_pagetitle($title)
  50. {
  51. $this->pagetitle = $title;
  52. }
  53. /**
  54. * Getter for the current skin path property
  55. */
  56. public function get_skin_path()
  57. {
  58. return $this->config->get('skin_path');
  59. }
  60. /**
  61. * Delete all stored env variables and commands
  62. */
  63. public function reset()
  64. {
  65. parent::reset();
  66. $this->object_handlers = array();
  67. $this->pagetitle = '';
  68. }
  69. /**
  70. * Call a client method
  71. *
  72. * @param string Method to call
  73. * @param ... Additional arguments
  74. */
  75. abstract function command();
  76. /**
  77. * Add a localized label to the client environment
  78. */
  79. abstract function add_label();
  80. /**
  81. * Register a template object handler
  82. *
  83. * @param string $name Object name
  84. * @param string $func Function name to call
  85. *
  86. * @return void
  87. */
  88. public function add_handler($name, $func)
  89. {
  90. $this->object_handlers[$name] = $func;
  91. }
  92. /**
  93. * Register a list of template object handlers
  94. *
  95. * @param array $handlers Hash array with object=>handler pairs
  96. *
  97. * @return void
  98. */
  99. public function add_handlers($handlers)
  100. {
  101. $this->object_handlers = array_merge($this->object_handlers, $handlers);
  102. }
  103. }