Beispiel #1
0
 $errors = array();
 $form = new HTML_QuickForm('edit_product', 'post', $_SERVER['REQUEST_URI']);
 // Remove name attribute for xhtml strict compliance.
 $form->removeAttribute('name');
 //$form->addElement('html', '<div id="panelSet">');
 // Details.
 $form->addElement('html', '<div id="details" class="morphtabs_panel"><div class="panel_content">');
 //$form->addElement('header','details','Details');
 $form->addElement('checkbox', 'enabled', 'Enable:');
 $form->addElement('checkbox', 'discontinued', 'Discontinue:');
 $form->addElement('text', 'name', 'Product Name:', array('size' => 20, 'maxlength' => 60, 'class' => 'inputbox'));
 $errors[] = 'name';
 $form->addElement('text', 'sku', 'SKU:', array('size' => 20, 'maxlength' => 60, 'class' => 'inputbox'));
 $errors[] = 'sku';
 $items_opts[0] = 'Select One';
 foreach ($items = $tree->getTree() as $item) {
     $items_opts[$item['category_id']] = str_repeat(str_repeat('&nbsp;', 4), $item['depth']) . $item['category'];
 }
 $s = $form->createElement('select', 'category_id', 'Category:', null, array('id' => 'category'));
 $errors[] = 'category_id';
 $s->loadArray($items_opts);
 $form->addElement($s);
 $form->addElement('html', '</div></div>');
 // description
 $form->addElement('html', '<div id="description" class="morphtabs_panel"><div class="panel_content">');
 $form->addElement('text', 'short_description', 'Short Description:', array('size' => 30, 'maxlength' => 255, 'class' => 'inputbox'));
 $form->addElement('textarea', 'description', 'Description:', array('class' => 'inputbox', 'cols' => 40, 'rows' => 5, 'id' => 'descr_textarea'));
 $form->addElement('html', '</div></div>');
 // Price
 $form->addElement('html', '<div id="price" class="morphtabs_panel"><div class="panel_content">');
 //$form->addElement('header','price_header','Price');