forked from richienabuk/vchess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vchess.module
51 lines (42 loc) · 1.12 KB
/
vchess.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @file
* Drupal chess module
* VChess is based on OCC chess by Michael Speck
* VChess for Drupal 7 is based on VChess for Drupal 6 by Andrej Prochazka
*
*/
// VChess module files
use Drupal\vchess\Game\Piece;
global $base_url; // e.g. http://localhost/chess_drupal-7.14
// Define the default time per move
define("DEFAULT_TIME_PER_MOVE", 3);
define("DEFAULT_TIME_UNITS", 'days');
define("VCHESS_PENDING_LIMIT", 3);
// During testing, it is sometimes useful to allow the possiblity to play against
// oneself.
define("MAY_PLAY_SELF", FALSE);
// Only set the error display on if debugging locally
if (strpos($base_url, "localhost") > 0) {
ini_set('display_errors', 'On');
error_reporting(E_ALL);
}
/**
* Display help and module information
*/
function vchess_help($path, $arg) {
if ($path == 'admin/help#vchess') {
$txt = t('VChess module. Chess games between site users');
return $txt;
}
}
/**
* Implements hook_theme().
*/
function vchess_theme($existing, $type, $theme, $path) {
return [
'vchess_captured_pieces' => [
'variables' => ['pieces' => NULL, 'board_theme' => NULL],
],
];
}