1: <?php
2: /**
3: * The Ingo_Script_Maildrop_Comment:: class represents a maildrop comment.
4: * This is a pretty simple class, but it makes the code in
5: * Ingo_Script_Maildrop:: cleaner as it provides a generate() function and can
6: * be added to the recipe list the same way as a recipe can be.
7: *
8: * Copyright 2005-2007 Matt Weyland <mathias@weyland.ch>
9: *
10: * See the enclosed file LICENSE for license information (ASL). If you
11: * did not receive this file, see http://www.horde.org/licenses/apache.
12: *
13: * @author Matt Weyland <mathias@weyland.ch>
14: * @package Ingo
15: */
16: class Ingo_Script_Maildrop_Comment
17: {
18: /**
19: * The comment text.
20: *
21: * @var string
22: */
23: protected $_comment = '';
24:
25: /**
26: * Constructs a new maildrop comment.
27: *
28: * @param string $comment Comment to be generated.
29: * @param boolean $disable Output 'DISABLED' comment?
30: * @param boolean $header Output a 'header' comment?
31: */
32: public function __construct($comment, $disable = false, $header = false)
33: {
34: if ($disable) {
35: $comment = _("DISABLED: ") . $comment;
36: }
37:
38: $this->_comment = $header
39: ? '##### ' . $comment . ' #####'
40: : '# ' . $comment;
41: }
42:
43: /**
44: * Returns the comment stored by this object.
45: *
46: * @return string The comment stored by this object.
47: */
48: public function generate()
49: {
50: return $this->_comment;
51: }
52:
53: }
54: