多言語対応:ソースコード修正に関するメモ
提供:MoodleDocs
いくつかの代表的なコードを挙げていきましょう.
ブラウザの種別を判別する check_browser_version()
いまアクセスして来ているクライアントPCのブラウザの種別を判別します.ib/moodlelib.php中で宣言されています.
/** * Checks to see if is a browser matches the specified * brand and is equal or better version. * * @uses $_SERVER * @param string $brand The browser identifier being tested * @param int $version The version of the browser * @return bool true if the given version is below that of the detected browser */ function check_browser_version($brand='MSIE', $version=5.5)
$brandは以下の文字列が許されているようです.
case 'Camino': /// Mozilla Firefox browsers case 'Firefox': /// Mozilla Firefox browsers case 'Gecko': /// Gecko based browsers case 'MSIE': /// Internet Explorer case 'Opera': /// Opera case 'Safari': /// Safari
具体的には,
if (check_browser_version('MSIE')) { $filename = urlencode($filename); }
このように使うようです.