コード例 #1
0
            $item->description = cge_param::get_html($params, 'description');
            $item->save();
            // all done.
            if ($in_edit) {
                if ($formdata->post_edit_message) {
                    $mod->SetMessage($formdata->post_edit_message);
                }
            } else {
                if ($formdata->post_add_message) {
                    $mod->SetMessage($formdata->post_add_message);
                }
            }
            $mod->RedirectToTab($id, $formdata->return_tab, '', $formdata->return_action);
        }
    }
    // build the form
    $parms = array('_m' => $module_name, '_c' => $class, '_i' => $item_id);
    $tpl = $this->CreateSmartyTemplate('admin_lkp_edititem.tpl');
    $tpl->assign('item', $item);
    $tpl->assign('title', $formdata->title);
    $tpl->assign('subtitle', $formdata->subtitle);
    $tpl->assign('formstart', $this->CGCreateFormStart($id, 'admin_lkp_edititem', $returnid, \cge_utils::encrypt_params($parms)));
    $tpl->assign('formend', $this->CreateFormEnd());
    $tpl->display();
} catch (\Exception $e) {
    $mod->SetError($e->GetMessage());
    $mod->RedirectToTab($id, $formdata->return_tab, '', $formdata->return_action);
}
#
# EOF
#