Browse Source

Moodle 3.3 compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
80c129876f
  1. 2
      hangman/play.php
  2. 26
      lib.php
  3. 10
      millionaire/play.php
  4. 4
      version.php

2
hangman/play.php

@ -234,7 +234,7 @@ function game_hangman_play( $id, $game, $attempt, $hangman, $onlyshow, $showsolu
if ($game->param3 == 0) {
$game->param3 = 1;
}
echo "\r\n<br/><img src=\"".$OUTPUT->pix_url('hangman/'.$game->param3.'/hangman_'.$wrong, 'mod_game')."\"";
echo "\r\n<br/><img src=\"".game_pix_url('hangman/'.$game->param3.'/hangman_'.$wrong, 'mod_game')."\"";
$message = sprintf( get_string( 'hangman_wrongnum', 'game'), $wrong, $max);
echo ' ALIGN="MIDDLE" BORDER="0" HEIGHT="100" alt="'.$message.'"/>';

26
lib.php

@ -984,7 +984,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=hangman";
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->title = get_string('game_hangman', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_hangman', 'game');
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
get_string_manager()->string_exists('help' . $type->name, 'game')) {
@ -1002,7 +1002,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=cross";
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->title = get_string('game_cross', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_cross', 'game');
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
get_string_manager()->string_exists('help' . $type->name, 'game')) {
@ -1019,7 +1019,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type = new stdClass;
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=cryptex";
$type->title = get_string('game_cryptex', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_cryptex', 'game');
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
@ -1033,7 +1033,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type = new stdClass;
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=millionaire";
$type->title = get_string('game_millionaire', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_millionaire', 'game');
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
@ -1047,7 +1047,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type = new stdClass;
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=sudoku";
$type->title = get_string('game_sudoku', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_sudoku', 'game');
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
@ -1061,7 +1061,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type = new stdClass;
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=snakes";
$type->title = get_string('game_snakes', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_snakes', 'game');
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
@ -1075,7 +1075,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type = new stdClass;
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=hiddenpicture";
$type->title = get_string('game_hiddenpicture', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_hiddenpicture', 'game');
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
@ -1090,7 +1090,7 @@ if (defined('USE_GET_SHORTCUTS')) {
$type = new stdClass;
$type->archetype = MOD_CLASS_ACTIVITY;
$type->type = "game&type=bookquiz";
$type->title = get_string('game_bookquiz', 'game');
$type->title = get_string('pluginname', 'game').' - '.get_string('game_bookquiz', 'game');
$type->name = preg_replace('/.*type=/', '', $type->type);
$type->link = new moodle_url($defaultitem->link, array('type' => $type->name));
if (empty($type->help) && !empty($type->name) &&
@ -1356,3 +1356,13 @@ function game_get_context_course_instance( $courseid) {
return get_context_instance( CONTEXT_COURSE, $courseid);
}
function game_pix_url( $filename) {
global $OUTPUT;
if (game_get_moodle_version() >= '03.03') {
return $OUTPUT->image_url($filename, 'mod_game');
} else {
return $OUTPUT->pix_url($filename, 'mod_game');
}
}

10
millionaire/play.php

@ -135,8 +135,8 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer,
$gif = "5050";
$disabled = "";
}
echo '<input type="image" '.$disabled.' name="Help5050" id="Help5050" Title="50 50" src="'.
$OUTPUT->pix_url($dirgif.$gif, 'mod_game').'" alt="" border="0">&nbsp;';
$src = game_pix_url($dirgif.$gif, 'mod_game');
echo '<input type="image" '.$disabled.' name="Help5050" id="Help5050" Title="50 50" src="'.$src.'" alt="" border="0">&nbsp;';
if ($state & 2) {
$gif = "telephonex";
@ -148,7 +148,7 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer,
echo '<input type="image" name="HelpTelephone" '.$disabled.
' id="HelpTelephone" Title="'.get_string( 'millionaire_telephone', 'game').
'" src="'.$OUTPUT->pix_url($dirgif.$gif, 'mod_game').'" alt="" border="0">&nbsp;';
'" src="'.game_pix_url($dirgif.$gif, 'mod_game').'" alt="" border="0">&nbsp;';
if ($state & 4) {
$gif = "peoplex";
@ -159,11 +159,11 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer,
}
echo '<input type="image" name="HelpPeople" '.$disabled.' id="HelpPeople" Title="'.
get_string( 'millionaire_helppeople', 'game').'" src="'.
$OUTPUT->pix_url($dirgif.$gif, 'mod_game').'" alt="" border="0">&nbsp;';
game_pix_url($dirgif.$gif, 'mod_game').'" alt="" border="0">&nbsp;';
echo '<input type="image" name="Quit" id="Quit" Title="'.
get_string( 'millionaire_quit', 'game').'" src="'.
$OUTPUT->pix_url($dirgif.'x', 'mod_game').'" alt="" border="0">&nbsp;';
game_pix_url($dirgif.'x', 'mod_game').'" alt="" border="0">&nbsp;';
echo "\r\n";
echo "</td>\r\n";

4
version.php

@ -36,10 +36,10 @@ if (!isset( $plugin)) {
}
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2017041701; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2017053001; // 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 = '2016-09-17';
$plugin->release = '2017-05-30';
if ($useplugin != 2) {
$module = $plugin;

Loading…
Cancel
Save