コード例 #1
0
ファイル: store.edit.php プロジェクト: sbeam/cshop
}
if ($SHOWFORM) {
    $fex->left_td_style = '';
    if ($ACTION == OP_EDIT) {
        $pc->set_id($productid);
    }
    if (isset($pc->colmap_help) && is_array($pc->colmap_help)) {
        foreach ($pc->colmap_help as $k => $text) {
            $fex->set_elem_helptext($k, $text);
        }
    }
    if (isset($colmap['cm_manufacturers_id'])) {
        $fex->set_element_opts('cm_manufacturers_id', cshopUtils::get_all_manufacturers($pdb));
    }
    if (isset($colmap['cm_ship_class_id'])) {
        $fex->set_element_opts('cm_ship_class_id', cshopUtils::get_all_ship_classes($pdb));
    }
    if ($ACTION == OP_EDIT) {
        $fex->elem_vals = $pc->fetch(null, true);
        $product_name = $fex->elem_vals['title'];
        $fex->add_element('id', array('', 'hidden', $productid, null));
        // important
    }
    $fex->add_element('op', array($ACTION, 'submit'));
    // the button
    if ($ACTION == OP_EDIT) {
        $confirm_msg = 'This will remove this product from the site permanently. Are you sure?';
        $fex->add_element('op_kill', array(OP_KILL, 'submit', null, array('class' => 'killButton'), "onclick=\"return confirm('{$confirm_msg}')\""));
    }
}
/* decide which tab to show based on GET param 'win' */