ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 12302


Ignore:
Timestamp:
Jul 18, 2009, 3:19:44 PM (11 years ago)
Author:
ebihara
Message:

added a utility method for appending a mobile input mode to form widgets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/util/opToolkit.class.php

    r12101 r12302  
    193193      (is_string($value) ? preg_replace("/[\x{0}-\x{08}\x{0b}-\x{1f}\x{7f}-\x{9f}\x{ad}]/u", '', $value) : $value);
    194194  }
     195
     196  public static function appendMobileInputModeAttributesForFormWidget(sfWidget &$widget, $mode = 'alphabet')
     197  {
     198    $modes = array(
     199      'hiragana'    => 1,
     200      'hankakukana' => 2,
     201      'alphabet'    => 3,
     202      'numeric'     => 4,
     203    );
     204
     205    if (empty($modes[$mode]))
     206    {
     207      return false;
     208    }
     209
     210    $widget->setAttribute('istyle', $modes[$mode]);
     211    $widget->setAttribute('mode', $mode);
     212  }
    195213}
Note: See TracChangeset for help on using the changeset viewer.