--- moodle/lib/filelib.php 2009-05-08 09:06:44.000000000 +0900
+++ moodle195+/lib/filelib.php 2009-05-15 09:53:21.000000000 +0900
@@ -601,7 +601,17 @@
// if user is using IE, urlencode the filename so that multibyte file name will show up correctly on popup
if (check_browser_version('MSIE')) {
- $filename = urlencode($filename);
+ // $filename = urlencode($filename);
+
+ if (strlen(rawurlencode($filename)) > 21 * 3 * 3) {
+ $filename = mb_convert_encoding($filename, "SJIS-WIN", "UTF-8");
+ $filename = str_replace('#', '%23', $filename);
+ } else {
+ $filename = rawurlencode($filename);
+ }
+ } else if (check_browser_version('Safari')) {
+ $filename = "";
+
}
$filesize = $pathisstring ? strlen($path) : filesize($path);
diff -Naru moodle/lib/form/dateselector.php moodle195+/lib/form/dateselector.php
--- moodle/lib/form/dateselector.php 2007-04-14 11:10:30.000000000 +0900
+++ moodle195+/lib/form/dateselector.php 2009-05-15 09:53:21.000000000 +0900
@@ -76,9 +76,20 @@
for ($i=$this->_options['startyear']; $i<=$this->_options['stopyear']; $i++) {
$years[$i] = $i;
}
+
+ preg_match_all('/%[dBmY]/', get_string("strftimedate"), $dmatches ); //t-kita 20090407
+ $dmatches0 = $dmatches[0];
+ if (count($dmatches0)!=3){ $dmatches0 = array('%d','%B','%Y'); }
+ foreach ($dmatches0 as $dpiece){
+ if ($dpiece=='%d'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true);
+ }elseif (($dpiece=='%B') || ($dpiece=='%m')){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true);
+ }elseif ($dpiece=='%Y'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
+ }
+ }
+
// If optional we add a checkbox which the user can use to turn if on
if($this->_options['optional']) {
$this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'off', null, get_string('disable'), $this->getAttributes(), true);
diff -Naru moodle/lib/form/datetimeselector.php moodle195+/lib/form/datetimeselector.php
--- moodle/lib/form/datetimeselector.php 2007-08-10 01:56:36.000000000 +0900
+++ moodle195+/lib/form/datetimeselector.php 2009-05-15 09:53:21.000000000 +0900
@@ -81,9 +81,20 @@
for ($i=0; $i<60; $i+=$this->_options['step']) {
$minutes[$i] = sprintf("%02d",$i);
}
+
+ preg_match_all('/%[dBmY]/', get_string("strftimedate"), $dmatches ); //t-kita 20090407
+ $dmatches0 = $dmatches[0];
+ if (count($dmatches0)!=3){ $dmatches0 = array('%d','%B','%Y'); }
+ foreach ($dmatches0 as $dpiece){
+ if ($dpiece=='%d'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true);
+ }elseif (($dpiece=='%B') || ($dpiece=='%m')){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true);
+ }elseif ($dpiece=='%Y'){
$this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
+ }
+ }
+
if (right_to_left()) { // Switch order of elements for Right-to-Left
$this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true);
$this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true);
diff -Naru moodle/lib/weblib.php moodle195+/lib/weblib.php
--- moodle/lib/weblib.php 2009-05-13 16:03:36.000000000 +0900
+++ moodle195+/lib/weblib.php 2009-05-15 09:53:21.000000000 +0900
@@ -5523,12 +5523,22 @@
// Note: There should probably be a fieldset around these fields as they are
// clearly grouped. However this causes problems with display. See Mozilla
// bug 474415
+
+ preg_match_all('/%[dBmY]/', get_string("strftimedate"), $dmatches ); //t-kita 20090407
+ $dmatches0 = $dmatches[0];
+ if (count($dmatches0)!=3){ $dmatches0 = array('%d','%B','%Y'); }
+ foreach ($dmatches0 as $dpiece){
+ if ($dpiece=='%d'){
$result.='';
$result.=choose_from_menu($days, $day, $currentdate['mday'], '', '', '0', true);
+ }elseif (($dpiece=='%B') || ($dpiece=='%m')){
$result.='';
$result.=choose_from_menu($months, $month, $currentdate['mon'], '', '', '0', true);
+ }elseif ($dpiece=='%Y'){
$result.='';
$result.=choose_from_menu($years, $year, $currentdate['year'], '', '', '0', true);
+ }
+ }
if ($return) {
return $result;