(c) No child shall be ordered detained at the training school unless there is pending against the child a petition setting forth facts that would constitute a felony or misdemeanor if committed by an adult or that alleges a violation of a valid court order, or unless the child is adjudged in contempt of court. Provided, the family court shall not detain a juvenile at the training school for the violation of a valid court order, until a hearing is conducted and it is determined that the child intentionally violated the order, and the violation involves the failure of the child to engage in services or activities intended to protect or promote the child's health or safety, or the health or safety of any other person or persons. In the event a child is ordered to be detained at the training school, the family court shall conduct a probable cause hearing within five (5) calendar days of the child's detention (exclusive of weekends and/or holidays). At the conclusion of the probable cause hearing, the court shall order the release of the child from the training school unless the court finds that the child poses a substantial risk of harm to self or to others.
Nothing in this section prohibits the temporary commitment by the family court to the department of children, youth and families for placement of a child in a specific facility or program other than the training school for youth.