示例#1
0
$variable->id_variable = $id;
if ($id > 0) {
    if (!$variable->Load()) {
        $variable->id_variable = 0;
    }
}
if ($save) {
    $variable->module = $module;
    $variable->name = $name;
    $variable->show_name = $show_name;
    $variable->required = $required;
    $variable->type = $type;
    $variable->format = $format;
    $variable->error_message = $error_message;
    $variable->order = $order;
    $variable->list_show = $list_show;
    $errors = $variable->IsValidData();
    if (count($errors) == 0) {
        $variable->Save();
        $db = db_class::get_instance();
        $query = 'CALL create_' . str_replace('-', '_', $variable->module) . '_variable_view ()';
        $db->query($query);
    }
} else {
    if ($variable->id_variable == 0) {
        $variable->order = $variable->GetNextOrder();
    }
}
include SITE_FILE_ROOT . 'template/simple_header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';