public static function check_data($value, $data) { switch ($data['type']) { case 'static': return TRUE; case 'module': return Valid::not_empty($value) and Valid::alpha_dash($value) and $value != '-'; case 'page': return Valid::not_empty($value) and Valid::digit($value) and $value != '-' and $data['id'] != $value; case 'url': return Valid::not_empty($value) and Model_Page::check_link($value) and $value != '-'; } return FALSE; }