Note the "$mode"
switch ($mode) { case 'config':