Exemplo n.º 1
0
        $result = CMap::create($map);
        $result = DBend($result);
        add_audit_if($result, AUDIT_ACTION_ADD, AUDIT_RESOURCE_MAP, 'Name [' . $_REQUEST['name'] . ']');
        show_messages($result, S_MAP_ADDED, S_CANNOT_ADD_MAP);
    }
    if ($result) {
        unset($_REQUEST['form']);
    }
} else {
    if (isset($_REQUEST['delete']) && isset($_REQUEST['sysmapid']) || $_REQUEST['go'] == 'delete') {
        $sysmapids = get_request('maps', array());
        if (isset($_REQUEST['sysmapid'])) {
            $sysmapids[] = $_REQUEST['sysmapid'];
        }
        $maps = CMap::get(array('sysmapids' => $sysmapids, 'output' => API_OUTPUT_EXTEND, 'editable => 1'));
        $go_result = CMap::delete($sysmapids);
        show_messages($go_result, S_MAP_DELETED, S_CANNOT_DELETE_MAP);
        if ($go_result) {
            unset($_REQUEST['form']);
            foreach ($maps as $map) {
                add_audit_ext(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_MAP, $map['sysmapid'], $map['name'], null, null, null);
            }
        }
    }
}
if ($_REQUEST['go'] != 'none' && isset($go_result) && $go_result) {
    $url = new CUrl();
    $path = $url->getPath();
    insert_js('cookie.eraseArray("' . $path . '")');
}
$form = new CForm(null, 'get');