Controlled π-junctions in a T-shaped double quantum dot system