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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. /**
  36. * Object constructor
  37. */
  38. public function __construct($task = null, $framed = false)
  39. {
  40. parent::__construct();
  41. }
  42. /**
  43. * Setter for page title
  44. *
  45. * @param string $title Page title
  46. */
  47. public function set_pagetitle($title)
  48. {
  49. $this->pagetitle = $title;
  50. }
  51. /**
  52. * Getter for the current skin path property
  53. */
  54. public function get_skin_path()
  55. {
  56. return $this->config->get('skin_path');
  57. }
  58. /**
  59. * Delete all stored env variables and commands
  60. */
  61. public function reset()
  62. {
  63. parent::reset();
  64. $this->object_handlers = array();
  65. $this->pagetitle = '';
  66. }
  67. /**
  68. * Call a client method
  69. *
  70. * @param string Method to call
  71. * @param ... Additional arguments
  72. */
  73. abstract function command();
  74. /**
  75. * Add a localized label to the client environment
  76. */
  77. abstract function add_label();
  78. /**
  79. * Register a template object handler
  80. *
  81. * @param string Object name
  82. * @param string Function name to call
  83. * @return void
  84. */
  85. public function add_handler($obj, $func)
  86. {
  87. $this->object_handlers[$obj] = $func;
  88. }
  89. /**
  90. * Register a list of template object handlers
  91. *
  92. * @param array Hash array with object=>handler pairs
  93. * @return void
  94. */
  95. public function add_handlers($arr)
  96. {
  97. $this->object_handlers = array_merge($this->object_handlers, $arr);
  98. }
  99. }