Browse Source

Fix: Backward compatibility with Moodle 2.0 and textlib

MOODLE_20_STABLE
bdaloukas 12 years ago
parent
commit
01ee1b06c3
  1. 12
      locallib.php
  2. 4
      version.php

12
locallib.php

@ -1945,7 +1945,7 @@ function game_can_start_new_attempt( $game)
function game_strlen( $str) function game_strlen( $str)
{ {
if( game_get_moodle_version() < '02.05') if( game_get_moodle_version() < '02.03')
return textlib_get_instance()->strlen( $str); return textlib_get_instance()->strlen( $str);
else else
return textlib::strlen( $str); return textlib::strlen( $str);
@ -1958,13 +1958,13 @@ function game_substr()
if( $num == 3) if( $num == 3)
{ {
if( game_get_moodle_version() < '02.05') if( game_get_moodle_version() < '02.03')
return textlib_get_instance()->substr( $a[ 0], $a[ 1], $a[ 2]); return textlib_get_instance()->substr( $a[ 0], $a[ 1], $a[ 2]);
else else
return textlib::substr( $a[ 0], $a[ 1], $a[ 2]); return textlib::substr( $a[ 0], $a[ 1], $a[ 2]);
}else if( $num == 2) }else if( $num == 2)
{ {
if( game_get_moodle_version() < '02.05') if( game_get_moodle_version() < '02.03')
return textlib_get_instance()->substr( $a[ 0], $a[ 1]); return textlib_get_instance()->substr( $a[ 0], $a[ 1]);
else else
return textlib::substr( $a[ 0], $a[ 1]); return textlib::substr( $a[ 0], $a[ 1]);
@ -1974,15 +1974,15 @@ function game_substr()
function game_strtoupper( $str) function game_strtoupper( $str)
{ {
if( game_get_moodle_version() < '02.05') if( game_get_moodle_version() < '02.03')
return textlib_get_instance()->qstrtoupper( $str); return textlib_get_instance()->strtoupper( $str);
else else
return textlib::strtoupper( $str); return textlib::strtoupper( $str);
} }
function game_strpos( $haystack, $needle, $offset = 0) function game_strpos( $haystack, $needle, $offset = 0)
{ {
if( game_get_moodle_version() < '02.05') if( game_get_moodle_version() < '02.03')
return textlib_get_instance()->strpos( $haystack, $needle, $offset); return textlib_get_instance()->strpos( $haystack, $needle, $offset);
else else
return textlib::strpos( $haystack, $needle, $offset); return textlib::strpos( $haystack, $needle, $offset);

4
version.php

@ -11,7 +11,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) $module->component = 'mod_game'; // Full name of the plugin (used for diagnostics)
$module->version = 2013082403; // The current module version (Date: YYYYMMDDXX) $module->version = 2013082404; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2010112400; // Requires Moodle 2.0 $module->requires = 2010112400; // Requires Moodle 2.0
$module->cron = 0; // Period for cron to check this module (secs) $module->cron = 0; // Period for cron to check this module (secs)
$module->release = '3.8.24.3'; $module->release = '3.8.24.4';

Loading…
Cancel
Save