Greetings,
Here is an idea how you can improve list selection profile field. The problem is that now user can specify only list values which will be used as list keys at the same time. My idea is to provide an ability to specify both keys and values.
Instead of specifying just modile operators phone codes:
067
095
068
063
both codes and titles can be specified:
067=>Operator1 (067)
095=>Operator2 (095)
068=>Operator3 (068)
063=>Operator4 (063)
The patch is very simple and will look like this. Not the best solution, but I've just made it for quick.
function profile_form_profile(), case 'selection':
$options = $field->required ? array() : array('--');
$lines = split("[,\n\r]", $field->options);
foreach ($lines as $line) {
$vals = explode('=>', $line);
if ($line = trim($line)) {
if (empty($vals[0]) || empty($vals[1])) {
$options[$line] = $line;
} else {
$options[trim($vals[0])] = trim($vals[1]);
}
}
}
In this case, it will be very easy to use chosen operator code to flexibly build full cell phone number. This is just an example, but having keys may help a lot for different tasks.
Please, give me your feedback about this idea.
Thanks.
Comments
Comment #1
killes@www.drop.org commentednew features go into devel version.
Comment #2
coreb commented(Moving x.y.z version to a real version number) Feature Request => 6.x-dev
Comment #3
pasqualleComment #4
damien tournoud commentedThe profile module is obsolete. Won't fix.