Exemple #1
0
 /**
  * メッセージ取得
  * 
  * @param string $module  モジュール名。定義ファイルは 'モジュール名'_message.ini となる
  * @param string $section セクション名。
  * @param string $msg_id  メッセージID
  * @param mixed $value_not_exists 定義が存在しない場合の戻り値
  * @return mixed 取得したメッセージ
  */
 function get_msg($module, $section, $msg_id, $value_not_exists = '')
 {
     global $_ACSMSG_INI_STACK;
     $ini_stack =& $_ACSMSG_INI_STACK;
     $module_key = ACSMsg::get_lang() . "." . $module;
     //if (!array_key_exists($module_key,$ini_stack)) {
     if (!is_array($ini_stack) || !array_key_exists($module_key, $ini_stack)) {
         $ini_stack[$module_key] = parse_ini_file(ACSMsg::get_messages_dir() . '/' . $module . '_messages.ini', TRUE);
     }
     if (is_array($ini_stack[$module_key][$section])) {
         if (array_key_exists($msg_id, $ini_stack[$module_key][$section])) {
             return $ini_stack[$module_key][$section][$msg_id];
         } else {
             return $value_not_exists;
         }
     } else {
         return "{$section}";
     }
 }