$form->setDefaults(array('enabled' => $row->enabled, 'discontinued' => $row->discontinued, 'name' => HTML_Element::makeXmlSafe($row->name), 'sku' => $row->sku, 'category_id' => $row->category_id, 'short_description' => $row->short_description, 'description' => $row->description, 'price' => $row->price, 'price_group_id' => $row->price_group_id, 'postage' => $row->postage, 'weight' => $row->weight, 'author_id' => $row->author_id, 'isbn' => $row->isbn, 'image_status' => $row->image_status, 'quantity' => $row->quantity, 'image' => $row->image)); $tab_array = array('details' => null, 'description' => null, 'price' => null, 'attributes' => null, 'image_upload' => null); foreach ($errors as $value) { $err = $form->getElementError($value); if ($err) { $this->registry->Warning($err); } } $renderer = new UthandoForm(__SITE_PATH . '/templates/' . $this->get('admin_config.site.template')); $renderer->setFormTemplate('form'); $renderer->setHeaderTemplate('header'); $renderer->setElementTemplate('element'); $form->accept($renderer); // output the form $tabs = new HTML_Tabs($tab_array, true); $tabs->addPanels($renderer->toHtml()); $this->content .= $tabs->toHtml(); //$this->content .= $renderer->toHtml(); $session = Utility::encodeString(session_id()); $this->addScriptDeclaration("UthandoAdmin.sid = ['" . $session[0] . "','" . $session[1] . "'];"); $this->loadJavaScript(array('/Common/editor/tiny_mce/tiny_mce_gzip.js', '/Common/js/tinyMCEGz.js')); $this->registry->component_js = array('/components/ushop/js/products.js'); $this->registry->component_css = array('/templates/' . $this->get('admin_config.site.template') . '/css/FileManager.css', '/templates/' . $this->get('admin_config.site.template') . '/css/Additions.css'); } } else { $params['TYPE'] = 'info'; if (!$tax_codes) { $params['MESSAGE'] = '<h2>First define some tax codes.</h2>'; } elseif (!$categories) { $params['MESSAGE'] = '<h2>First define some categories.</h2>'; } else {
} } } $panels .= '<tr class="option file"> <td class="check"> <div class="check" id="' . $key . '" deps="' . substr($deps, 0, -1) . '"> <input type="checkbox" name="files[]" value="' . $folder . '/' . $key . '.js" ' . $checked . ' /> </div> </td> <td class="name">' . $key . '</td> <td class="description"> <p>' . $value['desc'] . '</p> </td> </tr>'; } } $panels .= '</table>'; $panels .= '</div>'; } //$json .= '</div>'; $tabs = new HTML_Tabs($tab_array, true); $tabs->addPanels($panels); $json .= $tabs->toHtml(); $json .= '</form>'; $json .= '</div>'; $this->content .= $json; $this->registry->component_js = array('/components/template/js/mootools.js'); } else { header("Location:" . $registry->config->get('web_url', 'SERVER')); exit; }