/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/widgets/StandardDialogWidget.inc
ViewVC logotype

Contents of /nfo/php/libs/com.newsblob.phphtmllib/widgets/StandardDialogWidget.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Thu May 6 16:57:34 2004 UTC (20 years, 2 months ago) by jonen
Branch: MAIN
CVS Tags: HEAD
 updated all to v2.4.1 - Apr 01, 2004

1 <?php
2 /**
3 * This contains the TextNav widget
4 *
5 * $Id: StandardDialogWidget.inc,v 1.1 2003/09/29 22:29:23 hemna Exp $
6 *
7 * @author Walter A. Boring IV <waboring@buildabetterweb.com>
8 * @package phpHtmlLib
9 *
10 */
11
12 /**
13 * This class requires the DialogWidget
14 */
15 require_once($phphtmllib."/widgets/DialogWidget.inc");
16
17
18 /**
19 * This class is used to build a DialogWidget that
20 * can have 'blocks' for messages.
21 *
22 */
23 class StandardDialogWidget extends DialogWidget {
24
25
26 /**
27 * Pushes a block content onto the data object
28 * Each pushed block is separated by some white space
29 * defined in $_block_spacing
30 *
31 * @param string - block title
32 * @param mixed - either string, or tag object.
33 * @access public
34 */
35 function add_block($title, $content) {
36 $this->_data[] = array("title"=>$title,
37 "content"=>$content);
38 }
39
40
41 /**
42 * This method is used to add the message blocks
43 * to the appropriate container
44 *
45 * @return object - the container object with the messages.
46 */
47 function &_build_message_container() {
48 $box = new InfoTable($this->get_title());
49
50 //don't show the cell borders
51 $box->set_show_cellborders(false);
52
53 // add each block
54 foreach ($this->_data as $block) {
55 // we have a block with the title
56 $box->add_row($this->_build_block($block));
57 }
58 return $box;
59 }
60
61
62 /**
63 * Create a DIV that holds the title
64 * and data of a block
65 *
66 * @return a DIVtag
67 * @access private
68 */
69 function &_build_block($data) {
70 $div = html_div();
71 $div->set_style("text-align: center;");
72
73 if (is_array($data)) {
74 if (is_null($data["title"])) {
75 $div->add($data["content"]);
76 $block =& $div;
77 } else {
78 $block = html_fieldset($data["title"], $data["content"]);
79 }
80 } else {
81 $div->add($data);
82 $block =& $div;
83 }
84 return $block;
85 }
86 }
87 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed