Beispiel #1
0
 /**
  *  フォーム項目表示名を取得する
  *
  *  @access public
  *  @param  string  $name   フォーム値の名称
  *  @return mixed   フォーム値の表示名
  */
 public function getName($name)
 {
     if (isset($this->form[$name]) == false) {
         return null;
     }
     if (isset($this->form[$name]['name']) && $this->form[$name]['name'] != null) {
         return $this->form[$name]['name'];
     }
     // try message catalog
     return $this->i18n->get($name);
 }
Beispiel #2
0
 public function test_setTimeZone()
 {
     $expected = 'GMT';
     Ethna_I18N::setTimeZone($expected);
     $actual = ini_get('date.timezone');
     if (version_compare(PHP_VERSION, '5.1.0') === 1) {
         $this->assertEquals($expected, $actual);
     } else {
         $this->assertTrue(empty($actural));
     }
 }
Beispiel #3
0
 /**
  *  messageへのアクセサ(R)
  *
  *  以下の処理を行う
  *  - エラーメッセージのi18n処理
  *  - $userinfoとして渡されたデータによるvsprintf()処理
  *
  *  @access public
  *  @return string  エラーメッセージ
  */
 public function getMessage()
 {
     $tmp_message = $this->i18n ? $this->i18n->get($this->message) : $this->message;
     $tmp_userinfo = to_array($this->userinfo);
     $tmp_message_arg_list = array();
     for ($i = 0; $i < count($tmp_userinfo); $i++) {
         $tmp_message_arg_list[] = $this->i18n ? $this->i18n->get($tmp_userinfo[$i]) : $tmp_userinfo[$i];
     }
     return vsprintf($tmp_message, $tmp_message_arg_list);
 }