/** * テンプレートパスをアサインする. * * @param integer $device_type_id 端末種別ID */ function assignTemplatePath($device_type_id) { // テンプレート変数を割り当て $this->assign("TPL_URLPATH", SC_Helper_PageLayout_Ex::getUserDir($device_type_id, true)); // ヘッダとフッタを割り当て $templatePath = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id); $header_tpl = $templatePath . "header.tpl"; $footer_tpl = $templatePath . "footer.tpl"; $this->assign("header_tpl", $header_tpl); $this->assign("footer_tpl", $footer_tpl); }
/** * Get a list of locale files. * * @param string $lang_code language code * @param integer $device_type_id device type ID * @return array file list */ function get_locale_file_list($lang_code, $device_type_id = FALSE) { $file_list = array(); // Path to the EC-CUBE Core locale file. $core_locale_path = DATA_REALDIR . "locales/{$lang_code}.mo"; // If a locale file of specified language is exist, add to the file list. if (file_exists($core_locale_path)) { $file_list[] = $core_locale_path; } // Get a list of enabled plugins. if (defined('ECCUBE_INSTALL')) { $arrPluginDataList = SC_Plugin_Util_Ex::getAllPlugin(); // Get the plugins directory. $arrPluginDirectory = SC_Plugin_Util_Ex::getPluginDirectory(); foreach ($arrPluginDataList as $arrPluginData) { // Check that the plugin filename is contained in the list of plugins directory. if (array_search($arrPluginData['plugin_code'], $arrPluginDirectory) !== false) { // Path to the plugin locale file. $plugin_locale_path = PLUGIN_UPLOAD_REALDIR . $arrPluginData['plugin_code'] . "/locales/{$lang_code}.mo"; // If a locale file of specified language is exist, add to the file list. if (file_exists($plugin_locale_path)) { $file_list[] = $plugin_locale_path; } } } } // Path to the template locale file. if ($device_type_id !== FALSE) { $template_locale_path = HTML_REALDIR . SC_Helper_PageLayout_Ex::getUserDir($device_type_id, true) . "locales/{$lang_code}.mo"; // If a locale file of specified language is exist, add to the file list. if (file_exists($template_locale_path)) { $file_list[] = $template_locale_path; } } return $file_list; }