Posted by joe.baz on November 4, 2009 at 5:51pm
| Project: | Signwriter |
| Version: | 6.x-2.0-beta1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Can you add the ability to automatically output text in all uppercase or all lowercase letters just like you can in CSS?
Comments
#1
subscribe
#2
subscribe
#3
subscribe
#4
subscribe
#5
subscribe
#6
I would like to see this feature as well.
Thanks!
#7
I really need this feature as well, subscribing :)
#8
Someone just had to do it ... Here is a patch, but please be indulgent cause it's my first one.
It applies to uppercase transformation only, but if someone really needs lowercase transformation, it would be easily extendable.
#9
Wouldn't it be better to support BOTH upper AND lowercase, like the title of the issue suggests?
I think it's very easy to achieve based on kla2t's patch (#8). Instead of a form item called 'upper case' it could contain a set of radio buttons:
+ $form['general']['text_case'] = array(
+ '#type' => 'radios',
+ '#title' => t('Case transform'),
+ '#default_value' => _signwriter_get_val($p, 'text_case', 0),
+ '#description' => t('Whether to transform the text case to lowercase or uppercase.'),
+ '#options' => array(t('Do not transform'), t('Transform to uppercase'), t('Transform to lowercase')),
+ );
Then, text_case = 1 means uppercase and text_case = 2 means lowercase.
I'll post an updated patch within an hour.
#10
Updated patch is based on patch provided by kla2t at #8 but:
- Allows UPPER or lowercase text transformation
- Uses drupal_strtolower() and drupal_strtoupper() instead of strtolower() beacause Drupal's upper/lowercase functions are multibyte-safe (UTF-8 characters)
#11
I was not able to apply the patch from #10 to 6.x-2.0-beta1, 6.x-2.0-beta2 or 6.x-2.x-dev...
patch < signwriter-textcase.patch
patching file signwriter.admin.inc
patching file signwriter.install
Hunk #2 FAILED at 323.
1 out of 2 hunks FAILED -- saving rejects to file signwriter.install.rej
patching file signwriter.module
#12
Rerolled changes against 6.x-2.x-dev, hope this works.