Browse Source

Fix:Moodle 2.8 compatibility

MOODLE_20_STABLE
Vasilis Daloukas 10 years ago
parent
commit
02c7d5f414
  1. 14
      locallib.php
  2. 4
      version.php

14
locallib.php

@ -2012,7 +2012,9 @@ function game_can_start_new_attempt( $game)
function game_strlen( $str)
{
if( game_get_moodle_version() >= '02.04')
if( game_get_moodle_version() >= '02.08')
return core_text::strlen( $str);
else if( game_get_moodle_version() >= '02.04')
return textlib::strlen( $str);
else
return textlib_get_instance()->strlen( $str);
@ -2025,12 +2027,16 @@ function game_substr()
if( $num == 3)
{
if( game_get_moodle_version() >= '02.04')
if( game_get_moodle_version() >= '02.08')
return core_text::substr( $a[ 0], $a[ 1], $a[ 2]);
else if( game_get_moodle_version() >= '02.04')
return textlib::substr( $a[ 0], $a[ 1], $a[ 2]);
else
return textlib_get_instance()->substr( $a[ 0], $a[ 1], $a[ 2]);
}else if( $num == 2)
{
if( game_get_moodle_version() >= '02.08')
return core_text::substr( $a[ 0], $a[ 1]);
if( game_get_moodle_version() >= '02.04')
return textlib::substr( $a[ 0], $a[ 1]);
else
@ -2041,6 +2047,8 @@ function game_substr()
function game_strtoupper( $str)
{
if( game_get_moodle_version() >= '02.08')
return core_text::strtoupper( $str);
if( game_get_moodle_version() >= '02.04')
return textlib::strtoupper( $str);
else if( game_get_moodle_version() >= '02.01')
@ -2051,6 +2059,8 @@ function game_strtoupper( $str)
function game_strpos( $haystack, $needle, $offset = 0)
{
if( game_get_moodle_version() >= '02.08')
return core_text::strpos( $haystack, $needle, $offset);
if( game_get_moodle_version() >= '02.04')
return textlib::strpos( $haystack, $needle, $offset);
else

4
version.php

@ -22,10 +22,10 @@ if( !isset( $plugin))
$useplugin = 2;
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics)
$plugin->version = 2014072201; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2014122801; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2010112400; // Requires Moodle 2.0
$plugin->cron = 0; // Period for cron to check this module (secs)
$plugin->release = '3.19.22';
$plugin->release = '3.24.28';
if( $useplugin != 2)
$module = $plugin;

Loading…
Cancel
Save