(1) This section applies to a person who is—
(a) in the chief executive's custody but not admitted as a detainee at a correctional centre; and
(b) required to attend a court.
(2) The chief executive may direct that the person be detained at a court cell in the custody of a corrections officer for the purposes of the person's attendance at the court.
(3) However, the person may not be detained continuously at a court cell for a period longer than 36 hours.
(4) If the person is required to remain in detention for a period longer than 36 hours for the court attendance, the chief executive must—
(a) arrange for the person's admission to a correctional centre; and
(b) keep the person in custody under full-time detention for the attendance; and
(c) take the person to the court as required by the court.
(5) The person is taken to be a detainee for all purposes under this Act while detained at the court cell.