A code snippet I keep around whenever I need to use ctools modal framework.