1<?php
2
3class FormBox extends BlockBox {
4  /**
5   * @var String form name; it will be used as a prefix for field names when submitting forms
6   * @access private
7   */
8  var $_name;
9
10  function show(&$driver) {
11    global $g_config;
12    if ($g_config['renderforms']) {
13      $driver->new_form($this->_name);
14    };
15    return parent::show($driver);
16  }
17
18  function &create(&$root, &$pipeline) {
19    if ($root->has_attribute('name')) {
20      $name = $root->get_attribute('name');
21    } elseif ($root->has_attribute('id')) {
22      $name = $root->get_attribute('id');
23    } else {
24      $name = "";
25    };
26
27    $box = new FormBox($name);
28    $box->readCSS($pipeline->get_current_css_state());
29    $box->create_content($root, $pipeline);
30    return $box;
31  }
32
33  function FormBox($name) {
34    $this->BlockBox();
35
36    $this->_name = $name;
37  }
38}
39
40?>