From: Boris Z. <bo...@am...> - 2003-03-06 08:40:02
|
Hi Bill, Am Donnerstag, 6. M=E4rz 2003 00:06 schrieb Bill Karwin: > Hi, > > May I suggest a change to the reporting of missing mandatory fields? T= he Yes, sure. > error report for missing fields is hard-coded to describe the mandatory > fields as "red". This limits the HTML designer to match color schemes,= and > also confuses users if I have set errorspan_begin_tag to something othe= r > than the color red. I want to establish a different visual cue than si= mply > color. It is done this way, to be full backward compatible to older PageKit's. B= ut=20 the error message ( 'You did not fill out all the required ...' is passed= to=20 the gettext extension. So you can change this message ( and all other=20 [error]messages ) to whatever you like without changing the code of Model= .pm.=20 The big advantage of this approach is that you can have different sites w= ith=20 different errormessages. Or different errormessages for the language of t= he=20 user! a example for this is in eg/contrib/locale/README And this works also for every message of your application too. > > I have changed Model.pm line 171: > > $model->pkit_gettext_message(qq{You did not fill out all the requi= red > fields. Please fill the <font color=3D"<PKIT_ERRORSTR>">red</font> fiel= ds.}); > > To this code (based on pkit_set_errorfont()): > > my $color_str =3D $model->pkit_get_config_attr( GLOBAL =3D> > 'default_errorstr' ) || "#ff0000"; > my $errorspan_begin_tag =3D $model->pkit_get_config_attr( GLOBAL =3D= > > 'errorspan_begin_tag' ) || qq{<font color=3D"$color_str">}; > my $errorspan_end_tag =3D $model->pkit_get_config_attr( GLOBAL =3D= > > 'errorspan_end_tag' ) || q{</font>}; > $model->pkit_gettext_message('You did not fill out all the ' . > $errorspan_begin_tag . 'mandatory' . $errorspan_end_tag . ' fields.'); > > Now I can use the Config.xml GLOBAL attributes default_errorstr, > errorspan_begin_tag, and errorspan_end_tag to set the style of the erro= r > message, without the message describing the style. > > Regards, > Bill Karwin --=20 Boris |