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

killes@www.drop.org’s picture

Version: 4.7.3 » x.y.z

new features go into devel version.

coreb’s picture

Version: x.y.z » 6.x-dev

(Moving x.y.z version to a real version number) Feature Request => 6.x-dev

pasqualle’s picture

Version: 6.x-dev » 7.x-dev
damien tournoud’s picture

Status: Active » Closed (won't fix)

The profile module is obsolete. Won't fix.