/src/library/Framework/Framework.Control.NoticeCollector.php

http://lussumo-vanilla.googlecode.com/ · PHP · 66 lines · 26 code · 5 blank · 35 comment · 1 complexity · a3ea3e57e5188827da27034b876e505c MD5 · raw file

  1. <?php
  2. /*
  3. * Copyright 2003 Mark O'Sullivan
  4. * This file is part of The Lussumo Software Library.
  5. * Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  6. * Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  7. * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  8. * The latest source code is available at www.vanilla1forums.com
  9. * Contact Mark O'Sullivan at mark [at] lussumo [dot] com
  10. *
  11. * Description: The NoticeCollector control is simply a control that gathers html
  12. * strings and then spits them out. In Vanilla it is used to report messages to
  13. * administrators.
  14. */
  15. /**
  16. * The NoticeCollector control is simply a control that gathers html
  17. * strings and then spits them out. In Vanilla it is used to report messages to
  18. * administrators.
  19. *
  20. * Copyright 2003 Mark O'Sullivan
  21. * This file is part of Lussumo's Software Library.
  22. * Lussumo's Software Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  23. * Lussumo's Software Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  24. * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25. * The latest source code is available at www.vanilla1forums.com
  26. * Contact Mark O'Sullivan at mark [at] lussumo [dot] com
  27. *
  28. * @author Mark O'Sullivan
  29. * @copyright 2003 Mark O'Sullivan
  30. * @license http://www.gnu.org/licenses/gpl-2.0.html GPL 2
  31. * @package Framework
  32. */
  33. /**
  34. * Panel control collection.
  35. * @package Framework
  36. */
  37. class NoticeCollector extends Control {
  38. var $CssClass; // The CSS Class to be applied to the containing div element (default is "Notices")
  39. var $Notices; // A collection of customized strings to be echoed
  40. function NoticeCollector(&$Context) {
  41. $this->Name = 'NoticeCollector';
  42. $this->Control($Context);
  43. $this->Notices = array();
  44. $this->CssClass = "Notices";
  45. }
  46. function AddNotice($Notice, $Position = '0', $ForcePosition = '0') {
  47. $this->CallDelegate('AddNotice');
  48. $Position = ForceInt($Position, 0);
  49. $this->AddItemToCollection($this->Notices,
  50. $Notice,
  51. $Position,
  52. $ForcePosition);
  53. }
  54. function Render() {
  55. if (is_array($this->Notices)) ksort($this->Notices);
  56. $this->CallDelegate('PreRender');
  57. include(ThemeFilePath($this->Context->Configuration, 'notices.php'));
  58. $this->CallDelegate('PostRender');
  59. }
  60. }
  61. ?>