$xmlwriter->setHeaderMessage($l->g('error'));
 if (!empty($room_id) && $room->_db_getList('id = ' . $room_id)) {
     // Room exists
     $xmlwriter->setHeaderStatus(0);
     $xmlwriter->setHeaderMessage('OK');
     $room_data = $room->_db_list[0];
     $room->_db_freelist();
     switch ($action) {
         case 'change_listpos':
             if (empty($dir)) {
                 // Move up
                 if ($room->_db_getList('id,listpos', 'category_id = ' . $room_data['category_id'], 'listpos < ' . $room_data['listpos'], 'listpos DESC', 1)) {
                     $higher_room_id = $room->_db_list[0]['id'];
                     $higher_room_listpos = $room->_db_list[0]['listpos'];
                     // Update room
                     $room->updateRoom($room_id, false, true, null, null, null, null, null, null, null, null, null, $higher_room_listpos);
                     // Update higher room
                     $room->updateRoom($higher_room_id, false, true, null, null, null, null, null, null, null, null, null, $room_data['listpos']);
                 }
             } else {
                 // Move down
                 if ($room->_db_getList('id,listpos', 'category_id = ' . $room_data['category_id'], 'listpos > ' . $room_data['listpos'], 'listpos ASC', 1)) {
                     $lower_room_id = $room->_db_list[0]['id'];
                     $lower_room_listpos = $room->_db_list[0]['listpos'];
                     // Update room
                     $room->updateRoom($room_id, false, true, null, null, null, null, null, null, null, null, null, $lower_room_listpos);
                     // Update lower room
                     $room->updateRoom($lower_room_id, false, true, null, null, null, null, null, null, null, null, null, $room_data['listpos']);
                 }
             }
             break;