Browse Source

Fix: Snakes - Show message when not specified background images

MOODLE_20_STABLE
bdaloukas 12 years ago
parent
commit
8f60fe5da0
  1. 3
      locallib.php
  2. 4
      version.php

3
locallib.php

@ -1596,11 +1596,14 @@ function game_snakes_create_user_defined_board( &$game)
require("snakes/createboard.php"); require("snakes/createboard.php");
$fs = get_file_storage(); $fs = get_file_storage();
$files = $fs->get_area_files($modcontext->id, 'mod_game', 'snakes_file', $game->id); $files = $fs->get_area_files($modcontext->id, 'mod_game', 'snakes_file', $game->id);
$f = false;
foreach ($files as $f) { foreach ($files as $f) {
if( $f->is_directory()) if( $f->is_directory())
continue; continue;
break; break;
} }
if( $f === false)
print_error( 'No image specified');
$im=game_createsnakesboard($f->get_content(), $board->cols, $board->rows, $board->headery, $board->headery, $board->footerx, $board->headerx, $board->data, $board->width, $board->height); $im=game_createsnakesboard($f->get_content(), $board->cols, $board->rows, $board->headery, $board->headery, $board->footerx, $board->headerx, $board->data, $board->width, $board->height);
ob_start(); ob_start();
imagepng($im); imagepng($im);

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 = 2013012703; // The current module version (Date: YYYYMMDDXX) $module->version = 2013012704; // 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 = 'v.2.13.27 (2013012703)'; $module->release = 'v.2.13.27 (2013012704)';

Loading…
Cancel
Save