Passed
Push — master ( 7742f2...4200a0 )
by Michael
02:27
created
xoops_version.php 1 patch
Indentation   +239 added lines, -239 removed lines patch added patch discarded remove patch
@@ -30,98 +30,98 @@  discard block
 block discarded – undo
30 30
 
31 31
 // ------------------- Informations ------------------- //
32 32
 $modversion = [
33
-    'version'       => 2.01,
34
-    'module_status' => 'Alpha 1',
35
-    'release_date'  => '2020/05/19',
36
-    'name'          => _MI_CHESS,
37
-    'description'   => _MI_CHESS_DES,
38
-    'official'      => 0,
39
-    //1 indicates official XOOPS module supported by XOOPS Dev Team, 0 means 3rd party supported
40
-    'author'        => '<a target="_blank" href="http://Dave-L.com/">Dave Lerner</a>, Mamba',
41
-
42
-    'credits'             => 'XOOPS Development Team',
43
-    'author_mail'         => 'author-email',
44
-    'author_website_url'  => 'https://xoops.org',
45
-    'author_website_name' => 'XOOPS',
46
-    'license'             => 'GPL 2.0 or later',
47
-    'license_url'         => 'www.gnu.org/licenses/gpl-2.0.html/',
48
-    // ------------------- Folders & Files -------------------
49
-    'release_info'        => 'Changelog',
50
-    'release_file'        => XOOPS_URL . "/modules/$moduleDirName/docs/changelog.txt",
51
-
52
-    'manual'              => 'link to manual file',
53
-    'manual_file'         => XOOPS_URL . "/modules/$moduleDirName/docs/install.txt",
54
-    // images
55
-    'image'               => 'assets/images/logoModule.png',
56
-    'iconsmall'           => 'assets/images/iconsmall.png',
57
-    'iconbig'             => 'assets/images/iconbig.png',
58
-    'dirname'             => $moduleDirName,
59
-    //Frameworks
60
-    //    'dirmoduleadmin'      => 'Frameworks/moduleclasses/moduleadmin',
61
-    //    'sysicons16'          => 'Frameworks/moduleclasses/icons/16',
62
-    //    'sysicons32'          => 'Frameworks/moduleclasses/icons/32',
63
-    // Local path icons
64
-    'modicons16'          => 'assets/images/icons/16',
65
-    'modicons32'          => 'assets/images/icons/32',
66
-    //About
67
-    'demo_site_url'       => 'https://xoops.org',
68
-    'demo_site_name'      => 'XOOPS Demo Site',
69
-    'support_url'         => 'https://xoops.org/modules/newbb/viewforum.php?forum=28/',
70
-    'support_name'        => 'Support Forum',
71
-    'submit_bug'          => 'https://github.com/XoopsModules25x/' . $moduleDirName . '/issues',
72
-    'module_website_url'  => 'www.xoops.org',
73
-    'module_website_name' => 'XOOPS Project',
74
-    // ------------------- Min Requirements -------------------
75
-    'min_php'             => '7.1',
76
-    'min_xoops'           => '2.5.10',
77
-    'min_admin'           => '1.2',
78
-    'min_db'              => ['mysql' => '5.5'],
79
-    // ------------------- Admin Menu -------------------
80
-    'system_menu'         => 1,
81
-    'hasAdmin'            => 1,
82
-    'adminindex'          => 'admin/index.php',
83
-    'adminmenu'           => 'admin/menu.php',
84
-    // ------------------- Install/Update -------------------
85
-    'onInstall'           => 'include/install.php',
86
-    //    'onInstall' => 'include/oninstall.php',
87
-    //    'onUpdate' => 'include/onupdate.php',
88
-    //  'onUninstall'         => 'include/onuninstall.php',
89
-    // -------------------  PayPal ---------------------------
90
-    'paypal'              => [
91
-        'business'      => '[email protected]',
92
-        'item_name'     => 'Donation : ' . _MI_CHESS_NAME,
93
-        'amount'        => 0,
94
-        'currency_code' => 'USD',
95
-    ],
96
-    // ------------------- Search ---------------------------
97
-    'hasSearch'           => 0,
98
-    //    'search'              => [
99
-    //        'file' => 'include/search.inc.php',
100
-    //        'func' => 'pedigree_search',
101
-    //    ],
102
-    // ------------------- Comments -------------------------
103
-    'hasComments'         => 1,
104
-    'comments'            => [
105
-        'itemName' => 'game_id',
106
-        'pageName' => 'game.php',
107
-    ],
108
-    // ------------------- Mysql -----------------------------
109
-    'sqlfile'             => ['mysql' => 'sql/mysql.sql'],
110
-    // ------------------- Tables ----------------------------
111
-    'tables'              => [
112
-        $moduleDirName . '_' . 'games',
113
-        $moduleDirName . '_' . 'challenges',
114
-        $moduleDirName . '_' . 'ratings',
115
-    ],
33
+	'version'       => 2.01,
34
+	'module_status' => 'Alpha 1',
35
+	'release_date'  => '2020/05/19',
36
+	'name'          => _MI_CHESS,
37
+	'description'   => _MI_CHESS_DES,
38
+	'official'      => 0,
39
+	//1 indicates official XOOPS module supported by XOOPS Dev Team, 0 means 3rd party supported
40
+	'author'        => '<a target="_blank" href="http://Dave-L.com/">Dave Lerner</a>, Mamba',
41
+
42
+	'credits'             => 'XOOPS Development Team',
43
+	'author_mail'         => 'author-email',
44
+	'author_website_url'  => 'https://xoops.org',
45
+	'author_website_name' => 'XOOPS',
46
+	'license'             => 'GPL 2.0 or later',
47
+	'license_url'         => 'www.gnu.org/licenses/gpl-2.0.html/',
48
+	// ------------------- Folders & Files -------------------
49
+	'release_info'        => 'Changelog',
50
+	'release_file'        => XOOPS_URL . "/modules/$moduleDirName/docs/changelog.txt",
51
+
52
+	'manual'              => 'link to manual file',
53
+	'manual_file'         => XOOPS_URL . "/modules/$moduleDirName/docs/install.txt",
54
+	// images
55
+	'image'               => 'assets/images/logoModule.png',
56
+	'iconsmall'           => 'assets/images/iconsmall.png',
57
+	'iconbig'             => 'assets/images/iconbig.png',
58
+	'dirname'             => $moduleDirName,
59
+	//Frameworks
60
+	//    'dirmoduleadmin'      => 'Frameworks/moduleclasses/moduleadmin',
61
+	//    'sysicons16'          => 'Frameworks/moduleclasses/icons/16',
62
+	//    'sysicons32'          => 'Frameworks/moduleclasses/icons/32',
63
+	// Local path icons
64
+	'modicons16'          => 'assets/images/icons/16',
65
+	'modicons32'          => 'assets/images/icons/32',
66
+	//About
67
+	'demo_site_url'       => 'https://xoops.org',
68
+	'demo_site_name'      => 'XOOPS Demo Site',
69
+	'support_url'         => 'https://xoops.org/modules/newbb/viewforum.php?forum=28/',
70
+	'support_name'        => 'Support Forum',
71
+	'submit_bug'          => 'https://github.com/XoopsModules25x/' . $moduleDirName . '/issues',
72
+	'module_website_url'  => 'www.xoops.org',
73
+	'module_website_name' => 'XOOPS Project',
74
+	// ------------------- Min Requirements -------------------
75
+	'min_php'             => '7.1',
76
+	'min_xoops'           => '2.5.10',
77
+	'min_admin'           => '1.2',
78
+	'min_db'              => ['mysql' => '5.5'],
79
+	// ------------------- Admin Menu -------------------
80
+	'system_menu'         => 1,
81
+	'hasAdmin'            => 1,
82
+	'adminindex'          => 'admin/index.php',
83
+	'adminmenu'           => 'admin/menu.php',
84
+	// ------------------- Install/Update -------------------
85
+	'onInstall'           => 'include/install.php',
86
+	//    'onInstall' => 'include/oninstall.php',
87
+	//    'onUpdate' => 'include/onupdate.php',
88
+	//  'onUninstall'         => 'include/onuninstall.php',
89
+	// -------------------  PayPal ---------------------------
90
+	'paypal'              => [
91
+		'business'      => '[email protected]',
92
+		'item_name'     => 'Donation : ' . _MI_CHESS_NAME,
93
+		'amount'        => 0,
94
+		'currency_code' => 'USD',
95
+	],
96
+	// ------------------- Search ---------------------------
97
+	'hasSearch'           => 0,
98
+	//    'search'              => [
99
+	//        'file' => 'include/search.inc.php',
100
+	//        'func' => 'pedigree_search',
101
+	//    ],
102
+	// ------------------- Comments -------------------------
103
+	'hasComments'         => 1,
104
+	'comments'            => [
105
+		'itemName' => 'game_id',
106
+		'pageName' => 'game.php',
107
+	],
108
+	// ------------------- Mysql -----------------------------
109
+	'sqlfile'             => ['mysql' => 'sql/mysql.sql'],
110
+	// ------------------- Tables ----------------------------
111
+	'tables'              => [
112
+		$moduleDirName . '_' . 'games',
113
+		$moduleDirName . '_' . 'challenges',
114
+		$moduleDirName . '_' . 'ratings',
115
+	],
116 116
 ];
117 117
 
118 118
 // ------------------- Help files ------------------- //
119 119
 $modversion['help']        = 'page=help';
120 120
 $modversion['helpsection'] = [
121
-    ['name' => _MI_CHESS_OVERVIEW, 'link' => 'page=help'],
122
-    ['name' => _MI_CHESS_DISCLAIMER, 'link' => 'page=disclaimer'],
123
-    ['name' => _MI_CHESS_LICENSE, 'link' => 'page=license'],
124
-    ['name' => _MI_CHESS_SUPPORT, 'link' => 'page=support'],
121
+	['name' => _MI_CHESS_OVERVIEW, 'link' => 'page=help'],
122
+	['name' => _MI_CHESS_DISCLAIMER, 'link' => 'page=disclaimer'],
123
+	['name' => _MI_CHESS_LICENSE, 'link' => 'page=license'],
124
+	['name' => _MI_CHESS_SUPPORT, 'link' => 'page=support'],
125 125
 ];
126 126
 
127 127
 // Config
@@ -129,77 +129,77 @@  discard block
 block discarded – undo
129 129
 $memberHandler = xoops_getHandler('member');
130 130
 $groups        = $memberHandler->getGroups();
131 131
 foreach ($groups as $group) {
132
-    if (XOOPS_GROUP_ANONYMOUS != $group->getVar('groupid')) {
133
-        $grouparray[$group->getVar('name')] = $group->getVar('groupid');
134
-    }
132
+	if (XOOPS_GROUP_ANONYMOUS != $group->getVar('groupid')) {
133
+		$grouparray[$group->getVar('name')] = $group->getVar('groupid');
134
+	}
135 135
 }
136 136
 
137 137
 $modversion['config'][] = [
138
-    'name'        => 'groups_play',
139
-    'title'       => '_MI_CHESS_GROUPS_PLAY',
140
-    'description' => '_MI_CHESS_GROUPS_PLAY_DES',
141
-    'formtype'    => 'group_multi',
142
-    'valuetype'   => 'array',
143
-    'default'     => [XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS],
138
+	'name'        => 'groups_play',
139
+	'title'       => '_MI_CHESS_GROUPS_PLAY',
140
+	'description' => '_MI_CHESS_GROUPS_PLAY_DES',
141
+	'formtype'    => 'group_multi',
142
+	'valuetype'   => 'array',
143
+	'default'     => [XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS],
144 144
 ];
145 145
 
146 146
 $modversion['config'][] = [
147
-    'name'        => 'groups_delete',
148
-    'title'       => '_MI_CHESS_GROUPS_DELETE',
149
-    'description' => '_MI_CHESS_GROUPS_DELETE_DES',
150
-    'formtype'    => 'group_multi',
151
-    'valuetype'   => 'array',
152
-    'default'     => [],
147
+	'name'        => 'groups_delete',
148
+	'title'       => '_MI_CHESS_GROUPS_DELETE',
149
+	'description' => '_MI_CHESS_GROUPS_DELETE_DES',
150
+	'formtype'    => 'group_multi',
151
+	'valuetype'   => 'array',
152
+	'default'     => [],
153 153
 ];
154 154
 
155 155
 $modversion['config'][] = [
156
-    'name'        => 'allow_setup',
157
-    'title'       => '_MI_CHESS_ALLOW_SETUP',
158
-    'description' => '_MI_CHESS_ALLOW_SETUP_DES',
159
-    'formtype'    => 'yesno',
160
-    'valuetype'   => 'int',
161
-    'default'     => 0,
156
+	'name'        => 'allow_setup',
157
+	'title'       => '_MI_CHESS_ALLOW_SETUP',
158
+	'description' => '_MI_CHESS_ALLOW_SETUP_DES',
159
+	'formtype'    => 'yesno',
160
+	'valuetype'   => 'int',
161
+	'default'     => 0,
162 162
 ];
163 163
 
164 164
 $modversion['config'][] = [
165
-    'name'        => 'max_items',
166
-    'title'       => '_MI_CHESS_MAX_ITEMS',
167
-    'description' => '_MI_CHESS_MAX_ITEMS_DES',
168
-    'formtype'    => 'textbox',
169
-    'valuetype'   => 'int',
170
-    'default'     => 10,
165
+	'name'        => 'max_items',
166
+	'title'       => '_MI_CHESS_MAX_ITEMS',
167
+	'description' => '_MI_CHESS_MAX_ITEMS_DES',
168
+	'formtype'    => 'textbox',
169
+	'valuetype'   => 'int',
170
+	'default'     => 10,
171 171
 ];
172 172
 
173 173
 $modversion['config'][] = [
174
-    'name'        => 'rating_system',
175
-    'title'       => '_MI_CHESS_RATING_SYSTEM',
176
-    'description' => '_MI_CHESS_RATING_SYSTEM_DES',
177
-    'formtype'    => 'select',
178
-    'valuetype'   => 'text',
179
-    'options'     => [
180
-        _MI_CHESS_RATING_SYSTEM_NONE   => 'none',
181
-        _MI_CHESS_RATING_SYSTEM_CXR    => 'cxr',
182
-        _MI_CHESS_RATING_SYSTEM_LINEAR => 'linear',
183
-    ],
184
-    'default'     => 'cxr',
174
+	'name'        => 'rating_system',
175
+	'title'       => '_MI_CHESS_RATING_SYSTEM',
176
+	'description' => '_MI_CHESS_RATING_SYSTEM_DES',
177
+	'formtype'    => 'select',
178
+	'valuetype'   => 'text',
179
+	'options'     => [
180
+		_MI_CHESS_RATING_SYSTEM_NONE   => 'none',
181
+		_MI_CHESS_RATING_SYSTEM_CXR    => 'cxr',
182
+		_MI_CHESS_RATING_SYSTEM_LINEAR => 'linear',
183
+	],
184
+	'default'     => 'cxr',
185 185
 ];
186 186
 
187 187
 $modversion['config'][] = [
188
-    'name'        => 'initial_rating',
189
-    'title'       => '_MI_CHESS_INITIAL_RATING',
190
-    'description' => '_MI_CHESS_INITIAL_RATING_DES',
191
-    'formtype'    => 'textbox',
192
-    'valuetype'   => 'int',
193
-    'default'     => 1200,
188
+	'name'        => 'initial_rating',
189
+	'title'       => '_MI_CHESS_INITIAL_RATING',
190
+	'description' => '_MI_CHESS_INITIAL_RATING_DES',
191
+	'formtype'    => 'textbox',
192
+	'valuetype'   => 'int',
193
+	'default'     => 1200,
194 194
 ];
195 195
 
196 196
 $modversion['config'][] = [
197
-    'name'        => 'allow_unrated_games',
198
-    'title'       => '_MI_CHESS_ALLOW_UNRATED',
199
-    'description' => '_MI_CHESS_ALLOW_UNRATED_DES',
200
-    'formtype'    => 'yesno',
201
-    'valuetype'   => 'int',
202
-    'default'     => 1,
197
+	'name'        => 'allow_unrated_games',
198
+	'title'       => '_MI_CHESS_ALLOW_UNRATED',
199
+	'description' => '_MI_CHESS_ALLOW_UNRATED_DES',
200
+	'formtype'    => 'yesno',
201
+	'valuetype'   => 'int',
202
+	'default'     => 1,
203 203
 ];
204 204
 
205 205
 // Menu
@@ -214,83 +214,83 @@  discard block
 block discarded – undo
214 214
 // Conditional menu items
215 215
 global $xoopsModule, $xoopsModuleConfig, $xoopsUser;
216 216
 if (is_object($xoopsModule) && 'chess' == $xoopsModule->getVar('dirname')) {
217
-    // Display create-game menu item if current user has the play-chess right.
217
+	// Display create-game menu item if current user has the play-chess right.
218 218
 
219
-    if (!empty($xoopsModuleConfig['groups_play']) && is_array($xoopsModuleConfig['groups_play'])
220
-        && (in_array(XOOPS_GROUP_ANONYMOUS, $xoopsModuleConfig['groups_play'])
221
-            || (is_object($xoopsUser) && count(array_intersect($xoopsUser->getGroups(), $xoopsModuleConfig['groups_play'])) > 0))) {
222
-        $modversion['sub'][3]['name'] = _MI_CHESS_SMNAME3;
223
-        $modversion['sub'][3]['url']  = 'create.php';
224
-    }
219
+	if (!empty($xoopsModuleConfig['groups_play']) && is_array($xoopsModuleConfig['groups_play'])
220
+		&& (in_array(XOOPS_GROUP_ANONYMOUS, $xoopsModuleConfig['groups_play'])
221
+			|| (is_object($xoopsUser) && count(array_intersect($xoopsUser->getGroups(), $xoopsModuleConfig['groups_play'])) > 0))) {
222
+		$modversion['sub'][3]['name'] = _MI_CHESS_SMNAME3;
223
+		$modversion['sub'][3]['url']  = 'create.php';
224
+	}
225 225
 
226
-    // Display ratings menu item if ratings system is enabled.
226
+	// Display ratings menu item if ratings system is enabled.
227 227
 
228
-    if ('none' != $xoopsModuleConfig['rating_system']) {
229
-        $modversion['sub'][4]['name'] = _MI_CHESS_SMNAME4;
230
-        $modversion['sub'][4]['url']  = 'ratings.php';
231
-    }
228
+	if ('none' != $xoopsModuleConfig['rating_system']) {
229
+		$modversion['sub'][4]['name'] = _MI_CHESS_SMNAME4;
230
+		$modversion['sub'][4]['url']  = 'ratings.php';
231
+	}
232 232
 
233
-    // Display my-games menu item if current user is logged in.
233
+	// Display my-games menu item if current user is logged in.
234 234
 
235
-    if (is_object($xoopsUser)) {
236
-        $modversion['sub'][5]['name'] = _MI_CHESS_SMNAME5;
237
-        $modversion['sub'][5]['url']  = 'player_stats.php?player_uid=' . $xoopsUser->getVar('uid');
238
-    }
235
+	if (is_object($xoopsUser)) {
236
+		$modversion['sub'][5]['name'] = _MI_CHESS_SMNAME5;
237
+		$modversion['sub'][5]['url']  = 'player_stats.php?player_uid=' . $xoopsUser->getVar('uid');
238
+	}
239 239
 }
240 240
 
241 241
 // Page Awareness
242 242
 $modversion['pages'][] = [
243
-    ['name' => _MI_CHESS_SMNAME1, 'url' => 'help.php'],
244
-    ['name' => _MI_CHESS_SMNAME2, 'url' => 'index.php'],
245
-    ['name' => _MI_CHESS_SMNAME3, 'url' => 'create.php'],
246
-    ['name' => _MI_CHESS_SMNAME4, 'url' => 'ratings.php'],
247
-    ['name' => _MI_CHESS_SMNAME5, 'url' => 'player_stats.php'],
243
+	['name' => _MI_CHESS_SMNAME1, 'url' => 'help.php'],
244
+	['name' => _MI_CHESS_SMNAME2, 'url' => 'index.php'],
245
+	['name' => _MI_CHESS_SMNAME3, 'url' => 'create.php'],
246
+	['name' => _MI_CHESS_SMNAME4, 'url' => 'ratings.php'],
247
+	['name' => _MI_CHESS_SMNAME5, 'url' => 'player_stats.php'],
248 248
 ];
249 249
 
250 250
 // Templates
251 251
 $modversion['templates'] = [
252
-    ['file' => 'chess_games.tpl', 'description' => _MI_CHESS_INDEX],
253
-    ['file' => 'chess_game_main.tpl', 'description' => _MI_CHESS_GAME],
254
-    ['file' => 'chess_game_moveform.tpl', 'description' => _MI_CHESS_MOVE_FORM],
255
-    ['file' => 'chess_game_promote_popup.tpl', 'description' => _MI_CHESS_PROMOTE_POPUP],
256
-    ['file' => 'chess_game_board.tpl', 'description' => _MI_CHESS_BOARD],
257
-    ['file' => 'chess_game_prefsform.tpl', 'description' => _MI_CHESS_PREFS_FORM],
258
-    ['file' => 'chess_game_arbitrateform.tpl', 'description' => _MI_CHESS_ARBITER_FORM],
259
-    ['file' => 'chess_help.tpl', 'description' => _MI_CHESS_HELP],
260
-    ['file' => 'chess_ratings.tpl', 'description' => _MI_CHESS_RATINGS],
261
-    ['file' => 'chess_player_stats.tpl', 'description' => _MI_CHESS_PLAYER_STATS],
252
+	['file' => 'chess_games.tpl', 'description' => _MI_CHESS_INDEX],
253
+	['file' => 'chess_game_main.tpl', 'description' => _MI_CHESS_GAME],
254
+	['file' => 'chess_game_moveform.tpl', 'description' => _MI_CHESS_MOVE_FORM],
255
+	['file' => 'chess_game_promote_popup.tpl', 'description' => _MI_CHESS_PROMOTE_POPUP],
256
+	['file' => 'chess_game_board.tpl', 'description' => _MI_CHESS_BOARD],
257
+	['file' => 'chess_game_prefsform.tpl', 'description' => _MI_CHESS_PREFS_FORM],
258
+	['file' => 'chess_game_arbitrateform.tpl', 'description' => _MI_CHESS_ARBITER_FORM],
259
+	['file' => 'chess_help.tpl', 'description' => _MI_CHESS_HELP],
260
+	['file' => 'chess_ratings.tpl', 'description' => _MI_CHESS_RATINGS],
261
+	['file' => 'chess_player_stats.tpl', 'description' => _MI_CHESS_PLAYER_STATS],
262 262
 ];
263 263
 // Blocks
264 264
 $modversion['blocks'][] = [
265
-    'file'        => 'blocks.php',
266
-    'name'        => _MI_CHESS_GAMES,
267
-    'description' => _MI_CHESS_GAMES_DES,
268
-    'show_func'   => 'b_chess_games_show',
269
-    // options: maximum number of games to display | 1=show games in play only/2=show concluded games only/3=show both | 1=show rated games only/2=show rated and unrated games
270
-    'options'     => '4|3',
271
-    'edit_func'   => 'b_chess_games_edit',
272
-    'template'    => 'chess_block_games.tpl',
265
+	'file'        => 'blocks.php',
266
+	'name'        => _MI_CHESS_GAMES,
267
+	'description' => _MI_CHESS_GAMES_DES,
268
+	'show_func'   => 'b_chess_games_show',
269
+	// options: maximum number of games to display | 1=show games in play only/2=show concluded games only/3=show both | 1=show rated games only/2=show rated and unrated games
270
+	'options'     => '4|3',
271
+	'edit_func'   => 'b_chess_games_edit',
272
+	'template'    => 'chess_block_games.tpl',
273 273
 ];
274 274
 
275 275
 $modversion['blocks'][] = [
276
-    'file'        => 'blocks.php',
277
-    'name'        => _MI_CHESS_CHALLENGES,
278
-    'description' => _MI_CHESS_CHALLENGES_DES,
279
-    'show_func'   => 'b_chess_challenges_show',
280
-    // options: maximum number of challenges to display | 1=show open challenges only/2=show individual challenges only/3=show both
281
-    'options'     => '4|3',
282
-    'edit_func'   => 'b_chess_challenges_edit',
283
-    'template'    => 'chess_block_challenges.tpl',
276
+	'file'        => 'blocks.php',
277
+	'name'        => _MI_CHESS_CHALLENGES,
278
+	'description' => _MI_CHESS_CHALLENGES_DES,
279
+	'show_func'   => 'b_chess_challenges_show',
280
+	// options: maximum number of challenges to display | 1=show open challenges only/2=show individual challenges only/3=show both
281
+	'options'     => '4|3',
282
+	'edit_func'   => 'b_chess_challenges_edit',
283
+	'template'    => 'chess_block_challenges.tpl',
284 284
 ];
285 285
 $modversion['blocks'][] = [
286
-    'file'        => 'blocks.php',
287
-    'name'        => _MI_CHESS_PLAYERS,
288
-    'description' => _MI_CHESS_PLAYERS_DES,
289
-    'show_func'   => 'b_chess_players_show',
290
-    // options: maximum number of players to display | 1=show non-provisional ratings only/2=show all ratings
291
-    'options'     => '4|1',
292
-    'edit_func'   => 'b_chess_players_edit',
293
-    'template'    => 'chess_block_players.tpl',
286
+	'file'        => 'blocks.php',
287
+	'name'        => _MI_CHESS_PLAYERS,
288
+	'description' => _MI_CHESS_PLAYERS_DES,
289
+	'show_func'   => 'b_chess_players_show',
290
+	// options: maximum number of players to display | 1=show non-provisional ratings only/2=show all ratings
291
+	'options'     => '4|1',
292
+	'edit_func'   => 'b_chess_players_edit',
293
+	'template'    => 'chess_block_players.tpl',
294 294
 ];
295 295
 
296 296
 // Notification
@@ -299,68 +299,68 @@  discard block
 block discarded – undo
299 299
 $modversion['notification']['lookup_func'] = 'chess_notify_item_info';
300 300
 
301 301
 $modversion['notification']['category'][] = [
302
-    'name'           => 'game',
303
-    'title'          => _MI_CHESS_NCAT_GAME,
304
-    'description'    => _MI_CHESS_NCAT_GAME_DES,
305
-    'subscribe_from' => 'game.php',
306
-    'item_name'      => 'game_id',
307
-    'allow_bookmark' => 1,
302
+	'name'           => 'game',
303
+	'title'          => _MI_CHESS_NCAT_GAME,
304
+	'description'    => _MI_CHESS_NCAT_GAME_DES,
305
+	'subscribe_from' => 'game.php',
306
+	'item_name'      => 'game_id',
307
+	'allow_bookmark' => 1,
308 308
 ];
309 309
 
310 310
 $modversion['notification']['category'][] = [
311
-    'name'           => 'global',
312
-    'title'          => _MI_CHESS_NCAT_GLOBAL,
313
-    'description'    => _MI_CHESS_NCAT_GLOBAL_DES,
314
-    'subscribe_from' => ['index.php', 'game.php'],
311
+	'name'           => 'global',
312
+	'title'          => _MI_CHESS_NCAT_GLOBAL,
313
+	'description'    => _MI_CHESS_NCAT_GLOBAL_DES,
314
+	'subscribe_from' => ['index.php', 'game.php'],
315 315
 ];
316 316
 
317 317
 $modversion['notification']['event'][] = [
318
-    'name'          => 'notify_game_move',
319
-    'category'      => 'game',
320
-    'title'         => _MI_CHESS_NEVT_MOVE,
321
-    'caption'       => _MI_CHESS_NEVT_MOVE_CAP,
322
-    'description'   => _MI_CHESS_NEVT_MOVE_DES,
323
-    'mail_template' => 'notify_game_move',
324
-    'mail_subject'  => _MI_CHESS_NEVT_MOVE_SUB,
318
+	'name'          => 'notify_game_move',
319
+	'category'      => 'game',
320
+	'title'         => _MI_CHESS_NEVT_MOVE,
321
+	'caption'       => _MI_CHESS_NEVT_MOVE_CAP,
322
+	'description'   => _MI_CHESS_NEVT_MOVE_DES,
323
+	'mail_template' => 'notify_game_move',
324
+	'mail_subject'  => _MI_CHESS_NEVT_MOVE_SUB,
325 325
 ];
326 326
 
327 327
 $modversion['notification']['event'][] = [
328
-    'name'          => 'notify_challenge_user',
329
-    'category'      => 'global',
330
-    'title'         => _MI_CHESS_NEVT_CHAL_USER,
331
-    'caption'       => _MI_CHESS_NEVT_CHAL_USER_CAP,
332
-    'description'   => _MI_CHESS_NEVT_CHAL_USER_DES,
333
-    'mail_template' => 'notify_challenge_user',
334
-    'mail_subject'  => _MI_CHESS_NEVT_CHAL_USER_SUB,
328
+	'name'          => 'notify_challenge_user',
329
+	'category'      => 'global',
330
+	'title'         => _MI_CHESS_NEVT_CHAL_USER,
331
+	'caption'       => _MI_CHESS_NEVT_CHAL_USER_CAP,
332
+	'description'   => _MI_CHESS_NEVT_CHAL_USER_DES,
333
+	'mail_template' => 'notify_challenge_user',
334
+	'mail_subject'  => _MI_CHESS_NEVT_CHAL_USER_SUB,
335 335
 ];
336 336
 
337 337
 $modversion['notification']['event'][] = [
338
-    'name'          => 'notify_challenge_open',
339
-    'category'      => 'global',
340
-    'title'         => _MI_CHESS_NEVT_CHAL_OPEN,
341
-    'caption'       => _MI_CHESS_NEVT_CHAL_OPEN_CAP,
342
-    'description'   => _MI_CHESS_NEVT_CHAL_OPEN_DES,
343
-    'mail_template' => 'notify_challenge_open',
344
-    'mail_subject'  => _MI_CHESS_NEVT_CHAL_OPEN_SUB,
338
+	'name'          => 'notify_challenge_open',
339
+	'category'      => 'global',
340
+	'title'         => _MI_CHESS_NEVT_CHAL_OPEN,
341
+	'caption'       => _MI_CHESS_NEVT_CHAL_OPEN_CAP,
342
+	'description'   => _MI_CHESS_NEVT_CHAL_OPEN_DES,
343
+	'mail_template' => 'notify_challenge_open',
344
+	'mail_subject'  => _MI_CHESS_NEVT_CHAL_OPEN_SUB,
345 345
 ];
346 346
 
347 347
 $modversion['notification']['event'][] = [
348
-    'name'          => 'notify_accept_challenge',
349
-    'category'      => 'global',
350
-    'title'         => _MI_CHESS_NEVT_ACPT_CHAL,
351
-    'caption'       => _MI_CHESS_NEVT_ACPT_CHAL_CAP,
352
-    'description'   => _MI_CHESS_NEVT_ACPT_CHAL_DES,
353
-    'mail_template' => 'notify_accept_challenge',
354
-    'mail_subject'  => _MI_CHESS_NEVT_ACPT_CHAL_SUB,
348
+	'name'          => 'notify_accept_challenge',
349
+	'category'      => 'global',
350
+	'title'         => _MI_CHESS_NEVT_ACPT_CHAL,
351
+	'caption'       => _MI_CHESS_NEVT_ACPT_CHAL_CAP,
352
+	'description'   => _MI_CHESS_NEVT_ACPT_CHAL_DES,
353
+	'mail_template' => 'notify_accept_challenge',
354
+	'mail_subject'  => _MI_CHESS_NEVT_ACPT_CHAL_SUB,
355 355
 ];
356 356
 
357 357
 $modversion['notification']['event'][] = [
358
-    'name'          => 'notify_request_arbitration',
359
-    'category'      => 'global',
360
-    'title'         => _MI_CHESS_NEVT_RQST_ARBT,
361
-    'caption'       => _MI_CHESS_NEVT_RQST_ARBT_CAP,
362
-    'description'   => _MI_CHESS_NEVT_RQST_ARBT_DES,
363
-    'mail_template' => 'notify_request_arbitration',
364
-    'mail_subject'  => _MI_CHESS_NEVT_RQST_ARBT_SUB,
365
-    'admin_only'    => 1,
358
+	'name'          => 'notify_request_arbitration',
359
+	'category'      => 'global',
360
+	'title'         => _MI_CHESS_NEVT_RQST_ARBT,
361
+	'caption'       => _MI_CHESS_NEVT_RQST_ARBT_CAP,
362
+	'description'   => _MI_CHESS_NEVT_RQST_ARBT_DES,
363
+	'mail_template' => 'notify_request_arbitration',
364
+	'mail_subject'  => _MI_CHESS_NEVT_RQST_ARBT_SUB,
365
+	'admin_only'    => 1,
366 366
 ];
Please login to merge, or discard this patch.
testdata/index.php 1 patch
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -32,121 +32,121 @@
 block discarded – undo
32 32
 $helper->loadLanguage('common');
33 33
 
34 34
 switch ($op) {
35
-    case 'load':
36
-        if (\Xmf\Request::hasVar('ok', 'REQUEST') && 1 == $_REQUEST['ok']) {
37
-            if (!$GLOBALS['xoopsSecurity']->check()) {
38
-                redirect_header('../admin/index.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
39
-            }
40
-
41
-            loadSampleData();
42
-        } else {
43
-            xoops_cp_header();
44
-
45
-            xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
46
-
47
-            xoops_cp_footer();
48
-        }
49
-        break;
50
-    case 'save':
51
-        saveSampleData();
52
-        break;
35
+	case 'load':
36
+		if (\Xmf\Request::hasVar('ok', 'REQUEST') && 1 == $_REQUEST['ok']) {
37
+			if (!$GLOBALS['xoopsSecurity']->check()) {
38
+				redirect_header('../admin/index.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
39
+			}
40
+
41
+			loadSampleData();
42
+		} else {
43
+			xoops_cp_header();
44
+
45
+			xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
46
+
47
+			xoops_cp_footer();
48
+		}
49
+		break;
50
+	case 'save':
51
+		saveSampleData();
52
+		break;
53 53
 }
54 54
 
55 55
 // XMF TableLoad for SAMPLE data
56 56
 
57 57
 function loadSampleData()
58 58
 {
59
-    global $xoopsConfig;
59
+	global $xoopsConfig;
60 60
 
61
-    $moduleDirName = basename(dirname(__DIR__));
61
+	$moduleDirName = basename(dirname(__DIR__));
62 62
 
63
-    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
63
+	$moduleDirNameUpper = mb_strtoupper($moduleDirName);
64 64
 
65
-    $utility = new Chess\Utility();
65
+	$utility = new Chess\Utility();
66 66
 
67
-    $configurator = new Common\Configurator();
67
+	$configurator = new Common\Configurator();
68 68
 
69
-    $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
69
+	$tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
70 70
 
71
-    $language = 'english/';
71
+	$language = 'english/';
72 72
 
73
-    if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) {
74
-        $language = $xoopsConfig['language'] . '/';
75
-    }
73
+	if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) {
74
+		$language = $xoopsConfig['language'] . '/';
75
+	}
76 76
 
77
-    foreach ($tables as $table) {
78
-        $tabledata = \Xmf\Yaml::readWrapped($language . $table . '.yml');
77
+	foreach ($tables as $table) {
78
+		$tabledata = \Xmf\Yaml::readWrapped($language . $table . '.yml');
79 79
 
80
-        if (is_array($tabledata)) {
81
-            \Xmf\Database\TableLoad::truncateTable($table);
80
+		if (is_array($tabledata)) {
81
+			\Xmf\Database\TableLoad::truncateTable($table);
82 82
 
83
-            \Xmf\Database\TableLoad::loadTableFromArray($table, $tabledata);
84
-        }
85
-    }
83
+			\Xmf\Database\TableLoad::loadTableFromArray($table, $tabledata);
84
+		}
85
+	}
86 86
 
87
-    //  ---  COPY test folder files ---------------
87
+	//  ---  COPY test folder files ---------------
88 88
 
89
-    if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders) > 0) {
90
-        //        $file =  dirname(__DIR__) . '/testdata/images/';
89
+	if (is_array($configurator->copyTestFolders) && count($configurator->copyTestFolders) > 0) {
90
+		//        $file =  dirname(__DIR__) . '/testdata/images/';
91 91
 
92
-        foreach (array_keys($configurator->copyTestFolders) as $i) {
93
-            $src = $configurator->copyTestFolders[$i][0];
92
+		foreach (array_keys($configurator->copyTestFolders) as $i) {
93
+			$src = $configurator->copyTestFolders[$i][0];
94 94
 
95
-            $dest = $configurator->copyTestFolders[$i][1];
95
+			$dest = $configurator->copyTestFolders[$i][1];
96 96
 
97
-            $utility::rcopy($src, $dest);
98
-        }
99
-    }
97
+			$utility::rcopy($src, $dest);
98
+		}
99
+	}
100 100
 
101
-    redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
101
+	redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
102 102
 }
103 103
 
104 104
 function saveSampleData()
105 105
 {
106
-    global $xoopsConfig;
106
+	global $xoopsConfig;
107 107
 
108
-    $moduleDirName = basename(dirname(__DIR__));
108
+	$moduleDirName = basename(dirname(__DIR__));
109 109
 
110
-    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
110
+	$moduleDirNameUpper = mb_strtoupper($moduleDirName);
111 111
 
112
-    $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
112
+	$tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
113 113
 
114
-    $language = 'english/';
114
+	$language = 'english/';
115 115
 
116
-    if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) {
117
-        $language = $xoopsConfig['language'] . '/';
118
-    }
116
+	if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) {
117
+		$language = $xoopsConfig['language'] . '/';
118
+	}
119 119
 
120
-    $languageFolder = __DIR__ . '/' . $language;
120
+	$languageFolder = __DIR__ . '/' . $language;
121 121
 
122
-    if (!file_exists($languageFolder . '/')) {
123
-        Utility::createFolder($languageFolder . '/');
124
-    }
122
+	if (!file_exists($languageFolder . '/')) {
123
+		Utility::createFolder($languageFolder . '/');
124
+	}
125 125
 
126
-    $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/';
126
+	$exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/';
127 127
 
128
-    Utility::createFolder($exportFolder);
128
+	Utility::createFolder($exportFolder);
129 129
 
130
-    foreach ($tables as $table) {
131
-        \Xmf\Database\TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml');
132
-    }
130
+	foreach ($tables as $table) {
131
+		\Xmf\Database\TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml');
132
+	}
133 133
 
134
-    redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
134
+	redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
135 135
 }
136 136
 
137 137
 function exportSchema()
138 138
 {
139
-    $moduleDirName = basename(dirname(__DIR__));
140
-
141
-    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
142
-
143
-    try {
144
-        // TODO set exportSchema
145
-        //        $migrate = new Chess\Migrate($moduleDirName);
146
-        //        $migrate->saveCurrentSchema();
147
-        //
148
-        //        redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS'));
149
-    } catch (\Throwable $e) {
150
-        exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR'));
151
-    }
139
+	$moduleDirName = basename(dirname(__DIR__));
140
+
141
+	$moduleDirNameUpper = mb_strtoupper($moduleDirName);
142
+
143
+	try {
144
+		// TODO set exportSchema
145
+		//        $migrate = new Chess\Migrate($moduleDirName);
146
+		//        $migrate->saveCurrentSchema();
147
+		//
148
+		//        redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS'));
149
+	} catch (\Throwable $e) {
150
+		exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR'));
151
+	}
152 152
 }
Please login to merge, or discard this patch.
language/english/help.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 define('_HE_CHESS_INTRO_TITLE', 'Introduction');
23 23
 
24 24
 define(
25
-    '_HE_CHESS_INTRO_010',
26
-    '
25
+	'_HE_CHESS_INTRO_010',
26
+	'
27 27
 This software is intended to comply with the <a href="http://fide.com/official/handbook.asp?level=EE1">Laws of Chess</a>
28 28
 as stipulated by the F&eacute;d&eacute;ration Internationale des &Eacute;checs (International Chess Federation),
29 29
 commonly known as FIDE.
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 define('_HE_CHESS_CREATE_TITLE', 'Creating new games');
36 36
 
37 37
 define(
38
-    '_HE_CHESS_CREATE_010',
39
-    '
38
+	'_HE_CHESS_CREATE_010',
39
+	'
40 40
 There are three types of games that you may create:
41 41
 '
42 42
 );
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 define('_HE_CHESS_CREATE_010_3', 'Self-play');
46 46
 
47 47
 define(
48
-    '_HE_CHESS_CREATE_020',
49
-    '
48
+	'_HE_CHESS_CREATE_020',
49
+	'
50 50
 An <em>open challenge</em> may be accepted by anyone.
51 51
 An <em>individual challenge</em> may only be accepted by a specified user.
52 52
 A <em>self-play</em> game may be created if you wish to experiment with this software.
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
 );
55 55
 
56 56
 define(
57
-    '_HE_CHESS_CREATE_030',
58
-    '
57
+	'_HE_CHESS_CREATE_030',
58
+	'
59 59
 	You may optionally provide an initial board setup position using Forsyth-Edwards Notation (FEN).
60 60
 '
61 61
 );
62 62
 
63 63
 define(
64
-    '_HE_CHESS_CREATE_040',
65
-    '
64
+	'_HE_CHESS_CREATE_040',
65
+	'
66 66
 You may specify that your opponent will choose the colors,
67 67
 that the colors will be assigned randomly,
68 68
 or you may choose a specific color.
@@ -70,23 +70,23 @@  discard block
 block discarded – undo
70 70
 );
71 71
 
72 72
 define(
73
-    '_HE_CHESS_CREATE_050',
74
-    '
73
+	'_HE_CHESS_CREATE_050',
74
+	'
75 75
 	You may specify whether the game will be rated.
76 76
 '
77 77
 );
78 78
 
79 79
 define(
80
-    '_HE_CHESS_CREATE_060',
81
-    '
80
+	'_HE_CHESS_CREATE_060',
81
+	'
82 82
 A challenge game will be created as soon as another user accepts the challenge.
83 83
 A self-play game will be created immediately.
84 84
 '
85 85
 );
86 86
 
87 87
 define(
88
-    '_HE_CHESS_CREATE_070',
89
-    '
88
+	'_HE_CHESS_CREATE_070',
89
+	'
90 90
 A challenger may delete his challenge at any time prior to its acceptance.
91 91
 '
92 92
 );
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 define('_HE_CHESS_RATINGS_TITLE', 'Player rating system');
97 97
 
98 98
 define(
99
-    '_HE_CHESS_RATINGS_CXR',
100
-    '
99
+	'_HE_CHESS_RATINGS_CXR',
100
+	'
101 101
 	CXR - An adaptation of the ELO rating system, used by permission of <a target="_blank" href="http://chess-express.com/">Chess Express Ratings, Inc.</a>
102 102
 '
103 103
 );
104 104
 
105 105
 define(
106
-    '_HE_CHESS_RATINGS_LINEAR',
107
-    '
106
+	'_HE_CHESS_RATINGS_LINEAR',
107
+	'
108 108
 	Linear - A very simple system that adds (subtracts) a fixed number of points for a win (loss).
109 109
 '
110 110
 );
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 define('_HE_CHESS_PLAY_TITLE', 'Playing a game');
115 115
 
116 116
 define(
117
-    '_HE_CHESS_PLAY_010',
118
-    '
117
+	'_HE_CHESS_PLAY_010',
118
+	'
119 119
 A player can choose from the following actions.
120 120
 Not all of these actions are available all of the time.
121 121
 '
@@ -131,16 +131,16 @@  discard block
 block discarded – undo
131 131
 define('_HE_CHESS_PLAY_010_9', 'Request arbitration');
132 132
 
133 133
 define(
134
-    '_HE_CHESS_PLAY_020',
135
-    '
134
+	'_HE_CHESS_PLAY_020',
135
+	'
136 136
 You may make a <em>normal move</em> if it is your turn to move.
137 137
 Moving is discussed in detail <a href="#moving">below</a>.
138 138
 '
139 139
 );
140 140
 
141 141
 define(
142
-    '_HE_CHESS_PLAY_030',
143
-    '
142
+	'_HE_CHESS_PLAY_030',
143
+	'
144 144
 You may <em>claim a draw</em> if the conditions are satisfied for the 50-move rule or the threefold repetition rule,
145 145
 and it is your turn to move.
146 146
 You may optionally enter a (legal) move that will cause the conditions to be satisfied.
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 );
151 151
 
152 152
 define(
153
-    '_HE_CHESS_PLAY_040',
154
-    '
153
+	'_HE_CHESS_PLAY_040',
154
+	'
155 155
 You may <em>offer a draw</em> either on your turn or on your opponent\'s turn.
156 156
 You may not withdraw the offer.
157 157
 Your opponent must either <em>accept</em> it or <em>reject</em> it.
@@ -164,40 +164,40 @@  discard block
 block discarded – undo
164 164
 );
165 165
 
166 166
 define(
167
-    '_HE_CHESS_PLAY_050',
168
-    '
167
+	'_HE_CHESS_PLAY_050',
168
+	'
169 169
 You may <em>resign</em> either on your turn or on your opponent\'s turn.
170 170
 This will immediately end the game, and your opponent will be the winner.
171 171
 '
172 172
 );
173 173
 
174 174
 define(
175
-    '_HE_CHESS_PLAY_060',
176
-    '
175
+	'_HE_CHESS_PLAY_060',
176
+	'
177 177
 In a self-play game, you may <em>restart</em> the game at any time.
178 178
 This will delete all moves made in the game and restart the game at its initial position.
179 179
 '
180 180
 );
181 181
 
182 182
 define(
183
-    '_HE_CHESS_PLAY_070',
184
-    '
183
+	'_HE_CHESS_PLAY_070',
184
+	'
185 185
 You may <em>delete</em> the game at any time.
186 186
 This will permanently remove the game from the database.
187 187
 '
188 188
 );
189 189
 
190 190
 define(
191
-    '_HE_CHESS_PLAY_075',
192
-    '
191
+	'_HE_CHESS_PLAY_075',
192
+	'
193 193
 In a self-play game, you may <em>delete</em> the game at any time.
194 194
 This will permanently remove the game from the database.
195 195
 '
196 196
 );
197 197
 
198 198
 define(
199
-    '_HE_CHESS_PLAY_080',
200
-    '
199
+	'_HE_CHESS_PLAY_080',
200
+	'
201 201
 You may <em>request arbitration</em> either on your turn or on your opponent\'s turn.
202 202
 This will immediately suspend the game so that an arbiter may review it.
203 203
 This action may be used for any situation that warrants it, including software bugs.
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 );
208 208
 
209 209
 define(
210
-    '_HE_CHESS_PLAY_090',
211
-    '
210
+	'_HE_CHESS_PLAY_090',
211
+	'
212 212
 If your browser is Javascript-enabled, a dialog will popup to <em>confirm</em> your move or other action.
213 213
 If you prefer, you may disable that dialog by unchecking the Confirm checkbox.
214 214
 (But remember, just like in "real" chess, once you make a move, you can\'t withdraw it.)
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 define('_HE_CHESS_ARBITRATION_TITLE', 'Suspended games and arbitration');
223 223
 
224 224
 define(
225
-    '_HE_CHESS_ARBITRATION_010',
226
-    '
225
+	'_HE_CHESS_ARBITRATION_010',
226
+	'
227 227
 While a game is suspended, no moves or other player actions can be made.
228 228
 An arbiter will review the game and make a decision in compliance with the accepted Laws of Chess.
229 229
 If necessary, the arbiter will consult the player(s) and/or seek advice elsewhere prior to making a decision.
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
 define('_HE_CHESS_ARBITRATION_010_3', 'Delete game');
237 237
 
238 238
 define(
239
-    '_HE_CHESS_ARBITRATION_020',
240
-    '
239
+	'_HE_CHESS_ARBITRATION_020',
240
+	'
241 241
 When appropriate, an arbiter may also suspend a game that\'s in normal play.
242 242
 '
243 243
 );
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
 define('_HE_CHESS_DISPLAY_TITLE', 'Board orientation and refreshing the display');
248 248
 
249 249
 define(
250
-    '_HE_CHESS_DISPLAY_010',
251
-    '
250
+	'_HE_CHESS_DISPLAY_010',
251
+	'
252 252
 There are three choices for how the chess board is oriented:
253 253
 '
254 254
 );
@@ -258,24 +258,24 @@  discard block
 block discarded – undo
258 258
 define('_HE_CHESS_DISPLAY_010_3', 'Black at bottom');
259 259
 
260 260
 define(
261
-    '_HE_CHESS_DISPLAY_020',
262
-    '
261
+	'_HE_CHESS_DISPLAY_020',
262
+	'
263 263
 When you view a game in which you\'re playing, your color is at the bottom by default.
264 264
 Otherwise white is at the bottom by default.
265 265
 '
266 266
 );
267 267
 
268 268
 define(
269
-    '_HE_CHESS_DISPLAY_030',
270
-    '
269
+	'_HE_CHESS_DISPLAY_030',
270
+	'
271 271
 If you change the orientation setting, click the <em>Refresh</em> button to effect the change.
272 272
 The orientation setting will revert to the default if you leave the page and later return to it.
273 273
 '
274 274
 );
275 275
 
276 276
 define(
277
-    '_HE_CHESS_DISPLAY_040',
278
-    '
277
+	'_HE_CHESS_DISPLAY_040',
278
+	'
279 279
 Note that if your opponent moves while you\'re viewing the board, your view will not automatically update.
280 280
 You would need to use the Refresh button to update the board to see his move.
281 281
 '
@@ -286,16 +286,16 @@  discard block
 block discarded – undo
286 286
 define('_HE_CHESS_NOTIFY_TITLE', 'Notifications and comments');
287 287
 
288 288
 define(
289
-    '_HE_CHESS_NOTIFY_010',
290
-    '
289
+	'_HE_CHESS_NOTIFY_010',
290
+	'
291 291
 You can subscribe to any of several <em>Notification Options</em> related to chess games,
292 292
 such as notification when a new move is made and notification when a new challenge game is created.
293 293
 '
294 294
 );
295 295
 
296 296
 define(
297
-    '_HE_CHESS_NOTIFY_020',
298
-    '
297
+	'_HE_CHESS_NOTIFY_020',
298
+	'
299 299
 <em>Comments</em> may be posted for each game.
300 300
 '
301 301
 );
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
 define('_HE_CHESS_MOUSE_TITLE', 'Moving (using the mouse)');
306 306
 
307 307
 define(
308
-    '_HE_CHESS_MOUSE_010',
309
-    '
308
+	'_HE_CHESS_MOUSE_010',
309
+	'
310 310
 Moves are made either by using a mouse (recommended), or by typing the notation for the move in the text box.
311 311
 '
312 312
 );
313 313
 
314 314
 define(
315
-    '_HE_CHESS_MOUSE_020',
316
-    '
315
+	'_HE_CHESS_MOUSE_020',
316
+	'
317 317
 To use the mouse, click on the piece to move, and then click on the destination tile.
318 318
 (To castle, click on the king and its destination tile.)
319 319
 Each tile clicked will be highlighted.
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 );
325 325
 
326 326
 define(
327
-    '_HE_CHESS_MOUSE_030',
328
-    '
327
+	'_HE_CHESS_MOUSE_030',
328
+	'
329 329
 Moving with the mouse requires that your browser be Javascript-enabled.
330 330
 '
331 331
 );
@@ -335,15 +335,15 @@  discard block
 block discarded – undo
335 335
 define('_HE_CHESS_NOTATION_TITLE', 'Moving (using notation)');
336 336
 
337 337
 define(
338
-    '_HE_CHESS_NOTATION_010',
339
-    '
338
+	'_HE_CHESS_NOTATION_010',
339
+	'
340 340
 As an alternative to using the mouse, you may enter moves by typing the notation in the text box.
341 341
 '
342 342
 );
343 343
 
344 344
 define(
345
-    '_HE_CHESS_NOTATION_020',
346
-    '
345
+	'_HE_CHESS_NOTATION_020',
346
+	'
347 347
 The notation for a move is composed of four parts (and an optional fifth part for pawn promotion):
348 348
 '
349 349
 );
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 define('_HE_CHESS_NOTATION_020_5_A', 'Possible values: =Q, =R, =B, =N');
366 366
 
367 367
 define(
368
-    '_HE_CHESS_NOTATION_030',
369
-    '
368
+	'_HE_CHESS_NOTATION_030',
369
+	'
370 370
 Examples of complete moves:
371 371
 '
372 372
 );
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 define('_HE_CHESS_NOTATION_030_7', 'Pe7-e8=Q  (pawn moves from e7 to e8 and is promoted to queen)');
380 380
 
381 381
 define(
382
-    '_HE_CHESS_NOTATION_040',
383
-    '
382
+	'_HE_CHESS_NOTATION_040',
383
+	'
384 384
 Instead of the above notation, you may use Standard Algebraic Notation (SAN). Examples:
385 385
 '
386 386
 );
@@ -393,22 +393,22 @@  discard block
 block discarded – undo
393 393
 define('_HE_CHESS_NOTATION_040_7', 'e8Q  (pawn moves to e8 and is promoted to queen)');
394 394
 
395 395
 define(
396
-    '_HE_CHESS_NOTATION_050',
397
-    '
396
+	'_HE_CHESS_NOTATION_050',
397
+	'
398 398
 The notation for castling uses the uppercase letter "O" (oh), not the digit "0" (zero).
399 399
 '
400 400
 );
401 401
 
402 402
 define(
403
-    '_HE_CHESS_NOTATION_060',
404
-    '
403
+	'_HE_CHESS_NOTATION_060',
404
+	'
405 405
 SAN is described in more detail at the <a href="#fide">FIDE</a> site.
406 406
 '
407 407
 );
408 408
 
409 409
 define(
410
-    '_HE_CHESS_NOTATION_070',
411
-    '
410
+	'_HE_CHESS_NOTATION_070',
411
+	'
412 412
 <em>The piece identifier must be upper case, and the file coordinate must be lower case.
413 413
 Only valid, non-ambiguous moves will be accepted.</em>
414 414
 '
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 define('_HE_CHESS_EXPORT_TITLE', 'Exporting games');
420 420
 
421 421
 define(
422
-    '_HE_CHESS_EXPORT_010',
423
-    '
422
+	'_HE_CHESS_EXPORT_010',
423
+	'
424 424
 The current state of the game is displayed in both Portable Game Notation (PGN) and Forsyth-Edwards Notation (FEN).
425 425
 These are widely used notations for representing chess games.
426 426
 You may save the PGN or FEN representation of the game for your own records,
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 define('_HE_CHESS_MISC_TITLE', 'Miscellaneous');
434 434
 
435 435
 define(
436
-    '_HE_CHESS_MISC_010',
437
-    '
436
+	'_HE_CHESS_MISC_010',
437
+	'
438 438
 The stalemate test does not recognize whether a piece, other than the king,
439 439
 is bound by check (unable to move because it would place the king in check).
440 440
 So although the player won\'t be able to make any moves, the situation will not be detected as stalemate.
@@ -446,8 +446,8 @@  discard block
 block discarded – undo
446 446
 define('_HE_CHESS_MISC_010_IMAGE', 'stalemate example');
447 447
 
448 448
 define(
449
-    '_HE_CHESS_MISC_020',
450
-    '
449
+	'_HE_CHESS_MISC_020',
450
+	'
451 451
 Article 9.6 of the FIDE Laws of Chess states that
452 452
 <em>The game is drawn when a position is reached from which a checkmate cannot occur by any possible series of legal moves,
453 453
 even with the most unskilled play. This immediately ends the game.</em>
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
 );
460 460
 
461 461
 define(
462
-    '_HE_CHESS_MISC_030',
463
-    '
462
+	'_HE_CHESS_MISC_030',
463
+	'
464 464
 There are no time constraints on play.
465 465
 None of the FIDE rules concerning clocks, time limits or flags are applicable here.
466 466
 '
@@ -471,29 +471,29 @@  discard block
 block discarded – undo
471 471
 define('_HE_CHESS_ADMIN_TITLE', 'Administration and arbitration');
472 472
 
473 473
 define(
474
-    '_HE_CHESS_ADMIN_010',
475
-    '
474
+	'_HE_CHESS_ADMIN_010',
475
+	'
476 476
 An <em>arbiter</em> is a user with module admin rights for the chess module.
477 477
 '
478 478
 );
479 479
 
480 480
 define(
481
-    '_HE_CHESS_ADMIN_020',
482
-    '
481
+	'_HE_CHESS_ADMIN_020',
482
+	'
483 483
 From the Xoops control panel, an arbiter may view or edit the chess module preferences, and may arbitrate games and challenges.
484 484
 '
485 485
 );
486 486
 
487 487
 define(
488
-    '_HE_CHESS_ADMIN_030',
489
-    '
488
+	'_HE_CHESS_ADMIN_030',
489
+	'
490 490
 When an arbiter accesses a challenge from the control panel, he has the option of deleting that challenge.
491 491
 '
492 492
 );
493 493
 
494 494
 define(
495
-    '_HE_CHESS_ADMIN_040',
496
-    '
495
+	'_HE_CHESS_ADMIN_040',
496
+	'
497 497
 When an arbiter accesses an active or suspended game from the control panel,
498 498
 he will see the normal game page, with the addition of <em>arbiter controls</em>.
499 499
 If a game is active, the arbiter controls allow the arbiter to suspend the game.
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 );
505 505
 
506 506
 define(
507
-    '_HE_CHESS_ADMIN_050',
508
-    '
507
+	'_HE_CHESS_ADMIN_050',
508
+	'
509 509
 An arbiter may subscribe to be notified when a player requests arbitration in a chess game.
510 510
 '
511 511
 );
Please login to merge, or discard this patch.
language/german/help.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 define('_HE_CHESS_INTRO_TITLE', 'Einführung');
23 23
 
24 24
 define(
25
-    '_HE_CHESS_INTRO_010',
26
-    '
25
+	'_HE_CHESS_INTRO_010',
26
+	'
27 27
 Dieses Programm arbeitet in Einklang mit den <A href="http://fide.com/official/handbook.asp?level=EE1">Laws of Chess</A>,
28 28
 bekannt als FIDE,
29 29
 wie sie von der F&eacute;d&eacute;ration Internationale des &Eacute;checs (International Chess Federation) festgelegt wurden.
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 define('_HE_CHESS_CREATE_TITLE', 'Neue Partien beginnen');
36 36
 
37 37
 define(
38
-    '_HE_CHESS_CREATE_010',
39
-    '
38
+	'_HE_CHESS_CREATE_010',
39
+	'
40 40
 Es gibt drei Möglichkeiten, eine Partie zu beginnen:
41 41
 '
42 42
 );
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 define('_HE_CHESS_CREATE_010_3', 'Eine Partie gegen sich selbst');
46 46
 
47 47
 define(
48
-    '_HE_CHESS_CREATE_020',
49
-    '
48
+	'_HE_CHESS_CREATE_020',
49
+	'
50 50
 Eine <EM>offene Herausforderung</EM> kann von jedem angenommen werden.
51 51
 Eine <EM>persönliche Herausforderung</EM> kann nur vom herausgeforderten Benutzer angenommen werden.
52 52
 Eine <EM>Partie gegen sich selbst</EM> kann jederzeit begonnen werden, um dieses Programm auszuprobieren.
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
 );
55 55
 
56 56
 define(
57
-    '_HE_CHESS_CREATE_030',
58
-    '
57
+	'_HE_CHESS_CREATE_030',
58
+	'
59 59
 	Man kann optional eine Schachbrett-Ausgangsstellung in der Forsyth-Edwards Notation (FEN) angeben.
60 60
 '
61 61
 );
62 62
 
63 63
 define(
64
-    '_HE_CHESS_CREATE_040',
65
-    '
64
+	'_HE_CHESS_CREATE_040',
65
+	'
66 66
 Man kann vorgeben, daß der Gegner die Farbe wählt,
67 67
 daß die Farben zufällig vergeben werden,
68 68
 oder man kann selbst die eigene Farbe bestimmen.
@@ -70,23 +70,23 @@  discard block
 block discarded – undo
70 70
 );
71 71
 
72 72
 define(
73
-    '_HE_CHESS_CREATE_050',
74
-    '
73
+	'_HE_CHESS_CREATE_050',
74
+	'
75 75
 	Man kann angeben, ob die Partie bewertet werden soll.
76 76
 '
77 77
 );
78 78
 
79 79
 define(
80
-    '_HE_CHESS_CREATE_060',
81
-    '
80
+	'_HE_CHESS_CREATE_060',
81
+	'
82 82
 Eine Partie, die auf einer Herausforderung basiert, wird begonnen, sobald ein anderer Benutzer die Herausforderung annimmt.
83 83
 Eine Partie gegen sich selbst wird sofort begonnen.
84 84
 '
85 85
 );
86 86
 
87 87
 define(
88
-    '_HE_CHESS_CREATE_070',
89
-    '
88
+	'_HE_CHESS_CREATE_070',
89
+	'
90 90
 Ein Herausforderer kann seine Herausforderung jederzeit löschen, sofern sie noch nicht angenommen wurde.
91 91
 '
92 92
 );
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 define('_HE_CHESS_RATINGS_TITLE', 'Bewertungssystem');
97 97
 
98 98
 define(
99
-    '_HE_CHESS_RATINGS_CXR',
100
-    '
99
+	'_HE_CHESS_RATINGS_CXR',
100
+	'
101 101
 	CXR - Eine Adaption des ELO Bewertungssystems, verwendet mit Genehmigung von <A target="_blank" href="http://chess-express.com/">Chess Express Ratings, Inc.</A>
102 102
 '
103 103
 );
104 104
 
105 105
 define(
106
-    '_HE_CHESS_RATINGS_LINEAR',
107
-    '
106
+	'_HE_CHESS_RATINGS_LINEAR',
107
+	'
108 108
 	Linear - Ein sehr einfaches System, das für einen Sieg (Niederlage) eine feste Anzahl an Punkten addiert (subtrahiert).
109 109
 '
110 110
 );
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 define('_HE_CHESS_PLAY_TITLE', 'Eine Partie spielen');
115 115
 
116 116
 define(
117
-    '_HE_CHESS_PLAY_010',
118
-    '
117
+	'_HE_CHESS_PLAY_010',
118
+	'
119 119
 Ein Spieler kann eine der folgenden Aktionen auswählen.
120 120
 Nicht jede Aktion kann zu jedem Zeitpunkt ausgeführt werden.
121 121
 '
@@ -131,16 +131,16 @@  discard block
 block discarded – undo
131 131
 define('_HE_CHESS_PLAY_010_9', 'Schiedsurteil anfordern');
132 132
 
133 133
 define(
134
-    '_HE_CHESS_PLAY_020',
135
-    '
134
+	'_HE_CHESS_PLAY_020',
135
+	'
136 136
 Einen <EM>normalen Zug</EM> kann man machen, wenn man an der Reihe ist.
137 137
 Mögliche Züge werden <A href="#moving">unten</A> erläutert.
138 138
 '
139 139
 );
140 140
 
141 141
 define(
142
-    '_HE_CHESS_PLAY_030',
143
-    '
142
+	'_HE_CHESS_PLAY_030',
143
+	'
144 144
 Man kann <EM>Remis fordern</EM>, wenn die Bedingungen für die 50-Zug-Regel oder die Dreifach-Wiederholungsregel erfüllt sind
145 145
 und man am Zug ist.
146 146
 Man kann optional einen (erlaubten) Zug angeben, der dazu führt, daß die Bedingungen erfüllt sind.
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 );
151 151
 
152 152
 define(
153
-    '_HE_CHESS_PLAY_040',
154
-    '
153
+	'_HE_CHESS_PLAY_040',
154
+	'
155 155
 Man kann <EM>Remis anbieten</EM>, und zwar unabhängig davon, wer am Zug ist.
156 156
 Ein Remis-Angebot kann man nicht zurückziehen.
157 157
 Der Gegner muß das Angebot entweder <EM>annehmen</EM> oder <EM>ablehnen</EM>
@@ -164,40 +164,40 @@  discard block
 block discarded – undo
164 164
 );
165 165
 
166 166
 define(
167
-    '_HE_CHESS_PLAY_050',
168
-    '
167
+	'_HE_CHESS_PLAY_050',
168
+	'
169 169
 <EM>Aufgeben</EM> kann man jederzeit, unabhängig davon, wer am Zug ist.
170 170
 Die Partie wird dann beendet, und der Gegner gewinnt.
171 171
 '
172 172
 );
173 173
 
174 174
 define(
175
-    '_HE_CHESS_PLAY_060',
176
-    '
175
+	'_HE_CHESS_PLAY_060',
176
+	'
177 177
 In einer Partie gegen sich selbst darf die Partie jederzeit <EM>neu gestartet</EM> werden.
178 178
 Dann wird die Partie von der Ausgangssituation aus erneut begonnen.
179 179
 '
180 180
 );
181 181
 
182 182
 define(
183
-    '_HE_CHESS_PLAY_070',
184
-    '
183
+	'_HE_CHESS_PLAY_070',
184
+	'
185 185
 Eine Partie kann jederzeit <EM>gelöscht</EM> werden.
186 186
 Die Partie wird dann unwiederruflich aus der Datenbank entfernt.
187 187
 '
188 188
 );
189 189
 
190 190
 define(
191
-    '_HE_CHESS_PLAY_075',
192
-    '
191
+	'_HE_CHESS_PLAY_075',
192
+	'
193 193
 In einer Partie gegen sich selbst kann die Partie jederzeit <EM>gelöscht</EM> werden.
194 194
 Die Partie wird dann unwiederruflich aus der Datenbank entfernt.
195 195
 '
196 196
 );
197 197
 
198 198
 define(
199
-    '_HE_CHESS_PLAY_080',
200
-    '
199
+	'_HE_CHESS_PLAY_080',
200
+	'
201 201
 Man kann jederzeit ein <EM>Schiedsurteil anfordern</EM>.
202 202
 Dies führt dazu, daß die Partie sofort unterbrochen wird, so daß ein Schiedrichter sie überprüfen kann.
203 203
 Diese Aktion darf jederzeit ausgeführt werden, wenn Bedarf dafür besteht, etwa bei Programmfehlern.
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 );
208 208
 
209 209
 define(
210
-    '_HE_CHESS_PLAY_090',
211
-    '
210
+	'_HE_CHESS_PLAY_090',
211
+	'
212 212
 Falls JavaScript aktiviert ist, wird über eine Abfrage eine <EM>Bestätigung</EM> eines Zuges oder einer Aktivität verlangt.
213 213
 Falls dies nicht gewünscht ist, kann die Abfrage durch deselektieren des Bestätigungskästchens deaktiviert werden.
214 214
 (Es sollte beachtet werden, daß jeder ausgeführte Zug - wie beim "echten" Schach - nicht zurückgenommen werden kann)
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 define('_HE_CHESS_ARBITRATION_TITLE', 'Unterbrochene Spiele und Schiedsurteile');
223 223
 
224 224
 define(
225
-    '_HE_CHESS_ARBITRATION_010',
226
-    '
225
+	'_HE_CHESS_ARBITRATION_010',
226
+	'
227 227
 Solange eine Partie unterbrochen ist, können weder Züge noch andere Aktionen durchgeführt werden.
228 228
 Ein Schiedsrichter wird sich den Stand der Partie ansehen und eine Entscheidung gemäß den geltenden Schachregeln fällen.
229 229
 Falls notwendig, wird der Schiedsrichter die Spieler kontaktieren und/oder anderweitige Erkundigungen einziehen, bevor er seine Entscheidung trifft.
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
 define('_HE_CHESS_ARBITRATION_010_3', 'Partie löschen');
237 237
 
238 238
 define(
239
-    '_HE_CHESS_ARBITRATION_020',
240
-    '
239
+	'_HE_CHESS_ARBITRATION_020',
240
+	'
241 241
 Falls notwendig, kann ein Schiedsrichter auch eine laufende Partie unterbrechen.
242 242
 '
243 243
 );
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
 define('_HE_CHESS_DISPLAY_TITLE', 'Ausrichtung des Schachbretts und Aktualisierung der Anzeige');
248 248
 
249 249
 define(
250
-    '_HE_CHESS_DISPLAY_010',
251
-    '
250
+	'_HE_CHESS_DISPLAY_010',
251
+	'
252 252
 Es gibt drei Möglichkeiten zur Anzeige des Schachbretts:
253 253
 '
254 254
 );
@@ -258,24 +258,24 @@  discard block
 block discarded – undo
258 258
 define('_HE_CHESS_DISPLAY_010_3', 'Schwarz unten');
259 259
 
260 260
 define(
261
-    '_HE_CHESS_DISPLAY_020',
262
-    '
261
+	'_HE_CHESS_DISPLAY_020',
262
+	'
263 263
 Falls man aktiver Teilnehmer einer Partie ist, wird standardmäßig die eigene Farbe unten dargestellt.
264 264
 Ansonsten ist standardmäßig weiß unten.
265 265
 '
266 266
 );
267 267
 
268 268
 define(
269
-    '_HE_CHESS_DISPLAY_030',
270
-    '
269
+	'_HE_CHESS_DISPLAY_030',
270
+	'
271 271
 Ändert man die Orientierung des Schachbretts, ist es erforderlich, auf <EM>aktualisieren</EM> zu klicken, um die neuen Einstellungen zu übernehmen.
272 272
 Die Einstellung wird auf den Standard zurückgesetzt, wenn man die Seite verlässt und später erneut besucht.
273 273
 '
274 274
 );
275 275
 
276 276
 define(
277
-    '_HE_CHESS_DISPLAY_040',
278
-    '
277
+	'_HE_CHESS_DISPLAY_040',
278
+	'
279 279
 Man beachte, daß die Anzeige des Schachbretts bei einem Zug des Gegners nicht automatisch aktualisiert wird, wenn die Seite bereits geöffnet wurde.
280 280
 In diesem Fall ist es erforderlich, die Seite neu zu laden.
281 281
 '
@@ -286,16 +286,16 @@  discard block
 block discarded – undo
286 286
 define('_HE_CHESS_NOTIFY_TITLE', 'Benachrichtigungen und Anmerkungen');
287 287
 
288 288
 define(
289
-    '_HE_CHESS_NOTIFY_010',
290
-    '
289
+	'_HE_CHESS_NOTIFY_010',
290
+	'
291 291
 Man kann beliebige <EM>Benachrichtigungs-Optionen</EM> zu Schachpartien einstellen,
292 292
 etwa eine Benachrichtigung, wenn ein neuer Zug geführt wurde oder eine neue Partie begonnen wurde.
293 293
 '
294 294
 );
295 295
 
296 296
 define(
297
-    '_HE_CHESS_NOTIFY_020',
298
-    '
297
+	'_HE_CHESS_NOTIFY_020',
298
+	'
299 299
 <EM>Anmerkungen</EM> können zu jeder Partie gemacht werden.
300 300
 '
301 301
 );
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
 define('_HE_CHESS_MOUSE_TITLE', 'Ziehen (mit der Maus)');
306 306
 
307 307
 define(
308
-    '_HE_CHESS_MOUSE_010',
309
-    '
308
+	'_HE_CHESS_MOUSE_010',
309
+	'
310 310
 Es gibt zwei Möglichkeiten, einen Zug abzugeben: entweder mit der Maus (empfohlen) oder durch Angabe der Zugsequenz des Zuges im entsprechenden Textfeld.
311 311
 '
312 312
 );
313 313
 
314 314
 define(
315
-    '_HE_CHESS_MOUSE_020',
316
-    '
315
+	'_HE_CHESS_MOUSE_020',
316
+	'
317 317
 Um einen Zug mit der Maus abzugeben, klickt man auf die Figur, die man bewegen will, und dann auf das Feld, auf das man setzen möchte.
318 318
 (Für eine Rochade zieht man den König auf seine neue Position.)
319 319
 Jedes angeklickte Feld wird markiert.
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 );
325 325
 
326 326
 define(
327
-    '_HE_CHESS_MOUSE_030',
328
-    '
327
+	'_HE_CHESS_MOUSE_030',
328
+	'
329 329
 Ziehen mit der Maus erfordert aktiviertes JavaScript.
330 330
 '
331 331
 );
@@ -335,15 +335,15 @@  discard block
 block discarded – undo
335 335
 define('_HE_CHESS_NOTATION_TITLE', 'Ziehen (mit Zugsequenz)');
336 336
 
337 337
 define(
338
-    '_HE_CHESS_NOTATION_010',
339
-    '
338
+	'_HE_CHESS_NOTATION_010',
339
+	'
340 340
 Alternativ zum Ziehen mit der Maus können Züge auch durch Eingabe der Zugsequenz im entsprechenden Textfeld abgegeben werden.
341 341
 '
342 342
 );
343 343
 
344 344
 define(
345
-    '_HE_CHESS_NOTATION_020',
346
-    '
345
+	'_HE_CHESS_NOTATION_020',
346
+	'
347 347
 Die Zugsequenz eines Zuges setzt sich aus vier Teilen zusammen (und einem fünften bei Verwandlung eines Bauern):
348 348
 '
349 349
 );
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 define('_HE_CHESS_NOTATION_020_5_A', 'mögliche Werte: =Q, =R, =B, =N');
366 366
 
367 367
 define(
368
-    '_HE_CHESS_NOTATION_030',
369
-    '
368
+	'_HE_CHESS_NOTATION_030',
369
+	'
370 370
 Beispiele für Züge:
371 371
 '
372 372
 );
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 define('_HE_CHESS_NOTATION_030_7', 'Pe7-e8=Q  (Bauer zieht von e7 auf e8 und wird zu einer Dame)');
380 380
 
381 381
 define(
382
-    '_HE_CHESS_NOTATION_040',
383
-    '
382
+	'_HE_CHESS_NOTATION_040',
383
+	'
384 384
 Anstatt obiger Zugsequenz kann man auch Standard Algebraic Notation (SAN) verwenden. Beispiele:
385 385
 '
386 386
 );
@@ -393,22 +393,22 @@  discard block
 block discarded – undo
393 393
 define('_HE_CHESS_NOTATION_040_7', 'e8Q  (Bauer zieht auf e8 und wird zu einer Dame)');
394 394
 
395 395
 define(
396
-    '_HE_CHESS_NOTATION_050',
397
-    '
396
+	'_HE_CHESS_NOTATION_050',
397
+	'
398 398
 Die Notation für eine Rochade enthält das große "O" (oh), nicht die Zahl 0 (Null).
399 399
 '
400 400
 );
401 401
 
402 402
 define(
403
-    '_HE_CHESS_NOTATION_060',
404
-    '
403
+	'_HE_CHESS_NOTATION_060',
404
+	'
405 405
 SAN wird auf der <A href="#fide">FIDE</A>-Seite näher beschrieben.
406 406
 '
407 407
 );
408 408
 
409 409
 define(
410
-    '_HE_CHESS_NOTATION_070',
411
-    '
410
+	'_HE_CHESS_NOTATION_070',
411
+	'
412 412
 <EM>Der Figurbezeichner muß in Großbuchstaben angegeben werden, die Spaltenkoordinaten müssen in Kleinbuchstaben stehen.
413 413
 Nur gültige, nicht-doppeldeutige Züge werden akzeptiert.</EM>
414 414
 '
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 define('_HE_CHESS_EXPORT_TITLE', 'Partien exportieren');
420 420
 
421 421
 define(
422
-    '_HE_CHESS_EXPORT_010',
423
-    '
422
+	'_HE_CHESS_EXPORT_010',
423
+	'
424 424
 Der aktuelle Stand der Partie wird sowohl in Portable Game Notation (PGN) als auch in Forsyth-Edwards Notation (FEN) angezeigt.
425 425
 Dabei handelt es sich um weitverbreitete Notationen für die Darstellung von Schachpartien.
426 426
 Man kann die PGN- oder FEN-Daten der Partie speichern und z.B. 
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 define('_HE_CHESS_MISC_TITLE', 'Verschiedenes');
434 434
 
435 435
 define(
436
-    '_HE_CHESS_MISC_010',
437
-    '
436
+	'_HE_CHESS_MISC_010',
437
+	'
438 438
 Der Patt-Test überprüft nicht, ob eine andere Figur als der König am Zug gehindert wird, weil durch den Zug der eigene König in Schach gerät.
439 439
 Dadurch kann es vorkommen, daß ein Patt nicht automatisch erkannt wird, obwohl der Spieler keine erlaubten Züge mehr abgeben kann.
440 440
 Dieses Problem kann durch Anbieten eines Remis, durch Fordern eines Remis (falls anwendbar) oder durch Anfordern eines Schiedsurteils umgangen werden.
@@ -446,8 +446,8 @@  discard block
 block discarded – undo
446 446
 define('_HE_CHESS_MISC_010_IMAGE', 'Patt-Beispiel');
447 447
 
448 448
 define(
449
-    '_HE_CHESS_MISC_020',
450
-    '
449
+	'_HE_CHESS_MISC_020',
450
+	'
451 451
 Artikel 9.6 der FIDE Schachregeln besagt, daß
452 452
 <EM>Eine Partie gilt als unentschieden, wenn eine Stellung erreicht wurde, in der ein Schach-Matt durch keine Folge gültiger Züge erreicht werden kann,
453 453
 nicht einmal mit unerfahrenster Spielweise. In diesem Fall ist die Partie sofort beendet.</EM>
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
 );
460 460
 
461 461
 define(
462
-    '_HE_CHESS_MISC_030',
463
-    '
462
+	'_HE_CHESS_MISC_030',
463
+	'
464 464
 Es gibt keinerlei Zeitbeschränkungen im Spiel.
465 465
 Keine der FIDE-Regeln für Zeitmessung oder Zeitbeschränkungen werden hier benutzt.
466 466
 '
@@ -471,29 +471,29 @@  discard block
 block discarded – undo
471 471
 define('_HE_CHESS_ADMIN_TITLE', 'Administration und Schiedsurteile');
472 472
 
473 473
 define(
474
-    '_HE_CHESS_ADMIN_010',
475
-    '
474
+	'_HE_CHESS_ADMIN_010',
475
+	'
476 476
 Ein <EM>Schiedsrichter</EM> ist ein Benutzer mit Administratorrechten für das Schachmodul.
477 477
 '
478 478
 );
479 479
 
480 480
 define(
481
-    '_HE_CHESS_ADMIN_020',
482
-    '
481
+	'_HE_CHESS_ADMIN_020',
482
+	'
483 483
 Ein Schiedsrichter kann die Schachmodul-Einstellungen im Xoops-Kontrollpanel einsehen und ändern, und kann Schiedsurteile für Partien und Herausforderungen fällen.
484 484
 '
485 485
 );
486 486
 
487 487
 define(
488
-    '_HE_CHESS_ADMIN_030',
489
-    '
488
+	'_HE_CHESS_ADMIN_030',
489
+	'
490 490
 Wenn ein Schiedsrichter eine Herausforderung im Kontrollpanel öffnet, kann er diese Herausforderung löschen.
491 491
 '
492 492
 );
493 493
 
494 494
 define(
495
-    '_HE_CHESS_ADMIN_040',
496
-    '
495
+	'_HE_CHESS_ADMIN_040',
496
+	'
497 497
 Wenn ein Schiedsrichter im Kontrollpanel eine aktive oder unterbrochene Partie öffnet,
498 498
 sieht er die normale Partie-Seite, mit dem zusätzlichen Eintrag <EM>Schiedsrichter-Optionen</EM>.
499 499
 Falls die Partie läuft, kann der Schiedsrichter sie unterbrechen.
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 );
505 505
 
506 506
 define(
507
-    '_HE_CHESS_ADMIN_050',
508
-    '
507
+	'_HE_CHESS_ADMIN_050',
508
+	'
509 509
 Ein Schiedsrichter kann einstellen, daß er benachrichtigt wird, falls ein Spieler ein Schiedsurteil für eine Partie anfordert.
510 510
 '
511 511
 );
Please login to merge, or discard this patch.
language/german/modinfo.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 define('_MI_CHESS', 'Schach');
18 18
 define('_MI_CHESS_DES', 'Ermöglicht den Benutzern, gegeneinander Schach zu spielen.');
19 19
 define(
20
-    '_MI_CHESS_CREDITS',
21
-    '
20
+	'_MI_CHESS_CREDITS',
21
+	'
22 22
 	Meiko Jensen (german language pack).
23 23
 	<br>
24 24
 	CXR Rating System used by permission of <A target="_blank" href="http://chess-express.com/">Chess Express Ratings, Inc.</A>
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 define('_MI_CHESS_MAX_ITEMS_DES', 'Bezogen auf Partien, Herausforderungen und Spieler.');
69 69
 define('_MI_CHESS_RATING_SYSTEM', 'Spielerbewertungssystem');
70 70
 define(
71
-    '_MI_CHESS_RATING_SYSTEM_DES',
72
-    '
71
+	'_MI_CHESS_RATING_SYSTEM_DES',
72
+	'
73 73
 	Verfügbare Bewertungssysteme:
74 74
 	<br><br>
75 75
 	&nbsp;&nbsp;' . _MI_CHESS_RATING_SYSTEM_CXR . '    - Adaptation des ELO Bewertungssystem, Verwendung erlaubt durch <A target="_blank" href="http://chess-express.com/">Chess Express Ratings, Inc.</A>
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 );
85 85
 define('_MI_CHESS_INITIAL_RATING', 'Anfängliche Spielerbewertung');
86 86
 define(
87
-    '_MI_CHESS_INITIAL_RATING_DES',
88
-    '
87
+	'_MI_CHESS_INITIAL_RATING_DES',
88
+	'
89 89
 	Falls das "' . _MI_CHESS_RATING_SYSTEM_CXR . '" Bewertungssystem gewählt wird, sollte dieser Wert zwischen 800 und 2000 liegen.
90 90
 	<br><br>
91 91
 	Nur wirksam, falls ein Bewertungssystem ausgewählt wurde.
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 );
96 96
 define('_MI_CHESS_ALLOW_UNRATED', 'Unbewertete Partien erlauben?');
97 97
 define(
98
-    '_MI_CHESS_ALLOW_UNRATED_DES',
99
-    '
98
+	'_MI_CHESS_ALLOW_UNRATED_DES',
99
+	'
100 100
 	Darf ein Benutzer bei einer Herausforderung auswählen, daß diese Partie nicht in die Bewertung eingeht?
101 101
 	<br><br>
102 102
 	Nur wirksam, falls ein Bewertungssystem ausgewählt wurde.
Please login to merge, or discard this patch.
preloads/autoloader.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -4,39 +4,39 @@
 block discarded – undo
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6 6
 spl_autoload_register(
7
-    static function ($class) {
8
-        // project-specific namespace prefix
7
+	static function ($class) {
8
+		// project-specific namespace prefix
9 9
 
10
-        $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
10
+		$prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
11 11
 
12
-        // base directory for the namespace prefix
12
+		// base directory for the namespace prefix
13 13
 
14
-        $baseDir = dirname(__DIR__) . '/class/';
14
+		$baseDir = dirname(__DIR__) . '/class/';
15 15
 
16
-        // does the class use the namespace prefix?
16
+		// does the class use the namespace prefix?
17 17
 
18
-        $len = mb_strlen($prefix);
18
+		$len = mb_strlen($prefix);
19 19
 
20
-        if (0 !== strncmp($prefix, $class, $len)) {
21
-            return;
22
-        }
20
+		if (0 !== strncmp($prefix, $class, $len)) {
21
+			return;
22
+		}
23 23
 
24
-        // get the relative class name
24
+		// get the relative class name
25 25
 
26
-        $relativeClass = mb_substr($class, $len);
26
+		$relativeClass = mb_substr($class, $len);
27 27
 
28
-        // replace the namespace prefix with the base directory, replace namespace
28
+		// replace the namespace prefix with the base directory, replace namespace
29 29
 
30
-        // separators with directory separators in the relative class name, append
30
+		// separators with directory separators in the relative class name, append
31 31
 
32
-        // with .php
32
+		// with .php
33 33
 
34
-        $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
34
+		$file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
35 35
 
36
-        // if the file exists, require it
36
+		// if the file exists, require it
37 37
 
38
-        if (file_exists($file)) {
39
-            require $file;
40
-        }
41
-    }
38
+		if (file_exists($file)) {
39
+			require $file;
40
+		}
41
+	}
42 42
 );
Please login to merge, or discard this patch.
include/ratings_cxr.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -50,86 +50,86 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function chess_ratings_adj_cxr($white_rating, $white_games, $black_rating, $black_games, $pgn_result)
52 52
 {
53
-    // compute score: +1 for win, 0 for draw, -1 for loss
53
+	// compute score: +1 for win, 0 for draw, -1 for loss
54 54
 
55
-    switch ($pgn_result) {
56
-        case '1-0':
57
-            $S = 1;
58
-            break;
59
-        case '1/2-1/2':
60
-        default: // should not occur
61
-            $S = 0;
62
-            break;
63
-        case '0-1':
64
-            $S = -1;
65
-            break;
66
-    }
55
+	switch ($pgn_result) {
56
+		case '1-0':
57
+			$S = 1;
58
+			break;
59
+		case '1/2-1/2':
60
+		default: // should not occur
61
+			$S = 0;
62
+			break;
63
+		case '0-1':
64
+			$S = -1;
65
+			break;
66
+	}
67 67
 
68
-    if (($white_games < 5 && $black_games < 5) || ($white_games > 5 && $black_games > 5)) {
69
-        // Formula 1: Rnew = Rold + (S x 21) + (Ropponent - Rold) / 25
68
+	if (($white_games < 5 && $black_games < 5) || ($white_games > 5 && $black_games > 5)) {
69
+		// Formula 1: Rnew = Rold + (S x 21) + (Ropponent - Rold) / 25
70 70
 
71
-        $w_new = ($S * 21) + ($black_rating - $white_rating) / 25;
71
+		$w_new = ($S * 21) + ($black_rating - $white_rating) / 25;
72 72
 
73
-        $b_new = (-$S * 21) + ($white_rating - $black_rating) / 25;
74
-    } elseif ($white_games > 5 && $black_games < 5) {
75
-        // Formula 2: Rnew = Rold + (S x 6) + (Ropponent - Rold) / 100
73
+		$b_new = (-$S * 21) + ($white_rating - $black_rating) / 25;
74
+	} elseif ($white_games > 5 && $black_games < 5) {
75
+		// Formula 2: Rnew = Rold + (S x 6) + (Ropponent - Rold) / 100
76 76
 
77
-        $w_new = ($S * 6) + ($black_rating - $white_rating) / 100;
77
+		$w_new = ($S * 6) + ($black_rating - $white_rating) / 100;
78 78
 
79
-        // Formula 3: Rnew = (4/5) x Rold + (1/5) x Ropponent + (S x 80)
79
+		// Formula 3: Rnew = (4/5) x Rold + (1/5) x Ropponent + (S x 80)
80 80
 
81
-        $b_new = ($white_rating / 5) + ($S * -80) - ($black_rating / 5);
82
-    } else {
83
-        // Formula 2: Rnew = Rold + (S x 6) + (Ropponent - Rold) / 100
81
+		$b_new = ($white_rating / 5) + ($S * -80) - ($black_rating / 5);
82
+	} else {
83
+		// Formula 2: Rnew = Rold + (S x 6) + (Ropponent - Rold) / 100
84 84
 
85
-        $b_new = ($S * 6) + ($white_rating - $black_rating) / 100;
85
+		$b_new = ($S * 6) + ($white_rating - $black_rating) / 100;
86 86
 
87
-        // Formula 3: Rnew = (4/5) x Rold + (1/5) x Ropponent + (S x 80)
87
+		// Formula 3: Rnew = (4/5) x Rold + (1/5) x Ropponent + (S x 80)
88 88
 
89
-        $w_new = ($black_rating / 5) + ($S * -80) - ($white_rating / 5);
90
-    }
89
+		$w_new = ($black_rating / 5) + ($S * -80) - ($white_rating / 5);
90
+	}
91 91
 
92
-    // Rule R1: The winning rated player must gain at least two points.
92
+	// Rule R1: The winning rated player must gain at least two points.
93 93
 
94
-    // Rule R2: The losing rated player must lose at least two points.
94
+	// Rule R2: The losing rated player must lose at least two points.
95 95
 
96
-    if (abs($w_new) < 2) {
97
-        $w_new = $S * 2;
98
-    }
96
+	if (abs($w_new) < 2) {
97
+		$w_new = $S * 2;
98
+	}
99 99
 
100
-    if (abs($b_new) < 2) {
101
-        $b_new = $S * -2;
102
-    }
100
+	if (abs($b_new) < 2) {
101
+		$b_new = $S * -2;
102
+	}
103 103
 
104
-    // Rule R3: The rated player must not gain nor lose more than 41 points.
104
+	// Rule R3: The rated player must not gain nor lose more than 41 points.
105 105
 
106
-    if (abs($w_new) > 41) {
107
-        $w_new = $S * 41;
108
-    }
106
+	if (abs($w_new) > 41) {
107
+		$w_new = $S * 41;
108
+	}
109 109
 
110
-    if (abs($b_new) > 41) {
111
-        $b_new = $S * -41;
112
-    }
110
+	if (abs($b_new) > 41) {
111
+		$b_new = $S * -41;
112
+	}
113 113
 
114
-    if (1 == $S) {
115
-        if ($white_games < 5 && $w_new < 0) {
116
-            $w_new = 2;
117
-        }
114
+	if (1 == $S) {
115
+		if ($white_games < 5 && $w_new < 0) {
116
+			$w_new = 2;
117
+		}
118 118
 
119
-        if ($black_games < 5 && $b_new > 0) {
120
-            $b_new = -2;
121
-        }
122
-    } elseif (-1 == $S) {
123
-        if ($white_games < 5 && $w_new > 0) {
124
-            $w_new = -2;
125
-        }
119
+		if ($black_games < 5 && $b_new > 0) {
120
+			$b_new = -2;
121
+		}
122
+	} elseif (-1 == $S) {
123
+		if ($white_games < 5 && $w_new > 0) {
124
+			$w_new = -2;
125
+		}
126 126
 
127
-        if ($black_games < 5 && $b_new < 0) {
128
-            $b_new = 2;
129
-        }
130
-    }
127
+		if ($black_games < 5 && $b_new < 0) {
128
+			$b_new = 2;
129
+		}
130
+	}
131 131
 
132
-    return [$white_rating + $w_new, $black_rating + $b_new];
132
+	return [$white_rating + $w_new, $black_rating + $b_new];
133 133
 }
134 134
 
135 135
 /**
@@ -139,5 +139,5 @@  discard block
 block discarded – undo
139 139
  */
140 140
 function chess_ratings_num_provisional_games_cxr()
141 141
 {
142
-    return 5;
142
+	return 5;
143 143
 }
Please login to merge, or discard this patch.
include/install.php 1 patch
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -50,105 +50,105 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function xoops_module_pre_update_chess($module, $oldversion)
52 52
 {
53
-    global $xoopsDB;
53
+	global $xoopsDB;
54 54
 
55
-    // For downward-compatiblity, in case this function doesn't get called by the module handler.
55
+	// For downward-compatiblity, in case this function doesn't get called by the module handler.
56 56
 
57
-    $GLOBALS['chess_module_pre_update_called'] = true;
57
+	$GLOBALS['chess_module_pre_update_called'] = true;
58 58
 
59
-    if ($oldversion < 102) { // old version < 1.02: direct update not supported.
60
-        $docfile = XOOPS_ROOT_PATH . '/modules/chess/docs/INSTALL.TXT';
59
+	if ($oldversion < 102) { // old version < 1.02: direct update not supported.
60
+		$docfile = XOOPS_ROOT_PATH . '/modules/chess/docs/INSTALL.TXT';
61 61
 
62
-        chess_set_message($module, sprintf(_MI_CHESS_OLD_VERSION, (string)$oldversion, $docfile), true);
62
+		chess_set_message($module, sprintf(_MI_CHESS_OLD_VERSION, (string)$oldversion, $docfile), true);
63 63
 
64
-        return false;
65
-    } elseif ($oldversion >= 107) { // old version >= 1.07:  no action needed.
66
-        return true;
67
-    }
64
+		return false;
65
+	} elseif ($oldversion >= 107) { // old version >= 1.07:  no action needed.
66
+		return true;
67
+	}
68 68
 
69
-    // 1.02 <= old version < 1.07: perform update.
69
+	// 1.02 <= old version < 1.07: perform update.
70 70
 
71
-    $ratings_table = $xoopsDB->prefix('chess_ratings');
71
+	$ratings_table = $xoopsDB->prefix('chess_ratings');
72 72
 
73
-    $challenges_table = $xoopsDB->prefix('chess_challenges');
73
+	$challenges_table = $xoopsDB->prefix('chess_challenges');
74 74
 
75
-    $games_table = $xoopsDB->prefix('chess_games');
75
+	$games_table = $xoopsDB->prefix('chess_games');
76 76
 
77
-    // Check that ratings table does not already exist.
77
+	// Check that ratings table does not already exist.
78 78
 
79
-    chess_set_message($module, sprintf(_MI_CHESS_RATINGS_TABLE_1, $ratings_table));
79
+	chess_set_message($module, sprintf(_MI_CHESS_RATINGS_TABLE_1, $ratings_table));
80 80
 
81
-    $result = $xoopsDB->query("SHOW TABLES LIKE '$ratings_table'");
81
+	$result = $xoopsDB->query("SHOW TABLES LIKE '$ratings_table'");
82 82
 
83
-    if (!$result) {
84
-        $mysql_errno = $xoopsDB->errno();
83
+	if (!$result) {
84
+		$mysql_errno = $xoopsDB->errno();
85 85
 
86
-        $mysql_error = $xoopsDB->error();
86
+		$mysql_error = $xoopsDB->error();
87 87
 
88
-        chess_set_message($module, sprintf(_MI_CHESS_RATINGS_TABLE_2, $ratings_table, (string)$mysql_errno, $mysql_error), true);
88
+		chess_set_message($module, sprintf(_MI_CHESS_RATINGS_TABLE_2, $ratings_table, (string)$mysql_errno, $mysql_error), true);
89 89
 
90
-        return false;
91
-    }
90
+		return false;
91
+	}
92 92
 
93
-    if ($xoopsDB->getRowsNum($result) > 0) {
94
-        chess_set_message($module, sprintf(_MI_CHESS_RATINGS_TABLE_3, $ratings_table), true);
93
+	if ($xoopsDB->getRowsNum($result) > 0) {
94
+		chess_set_message($module, sprintf(_MI_CHESS_RATINGS_TABLE_3, $ratings_table), true);
95 95
 
96
-        return false;
97
-    }
96
+		return false;
97
+	}
98 98
 
99
-    $xoopsDB->freeRecordSet($result);
99
+	$xoopsDB->freeRecordSet($result);
100 100
 
101
-    chess_set_message($module, _MI_CHESS_OK);
101
+	chess_set_message($module, _MI_CHESS_OK);
102 102
 
103
-    // Check database tables.
103
+	// Check database tables.
104 104
 
105
-    chess_set_message($module, _MI_CHESS_CHK_DB_TABLES);
105
+	chess_set_message($module, _MI_CHESS_CHK_DB_TABLES);
106 106
 
107
-    $table_check_messages = chess_check_tables([$challenges_table, $games_table]);
107
+	$table_check_messages = chess_check_tables([$challenges_table, $games_table]);
108 108
 
109
-    if (!empty($table_check_messages)) {
110
-        foreach ($table_check_messages as $message) {
111
-            chess_set_message($module, $message, true);
112
-        }
109
+	if (!empty($table_check_messages)) {
110
+		foreach ($table_check_messages as $message) {
111
+			chess_set_message($module, $message, true);
112
+		}
113 113
 
114
-        return false;
115
-    }
114
+		return false;
115
+	}
116 116
 
117
-    chess_set_message($module, _MI_CHESS_OK);
117
+	chess_set_message($module, _MI_CHESS_OK);
118 118
 
119
-    // Check that values in column pgn_result of games table are in range.
119
+	// Check that values in column pgn_result of games table are in range.
120 120
 
121
-    $pgn_result_values = "'*','1-0','0-1','1/2-1/2'";
121
+	$pgn_result_values = "'*','1-0','0-1','1/2-1/2'";
122 122
 
123
-    chess_set_message($module, sprintf(_MI_CHESS_GAMES_TABLE_1, $games_table));
123
+	chess_set_message($module, sprintf(_MI_CHESS_GAMES_TABLE_1, $games_table));
124 124
 
125
-    $result = $xoopsDB->query("SELECT COUNT(*) FROM `$games_table` WHERE `pgn_result` NOT IN ($pgn_result_values)");
125
+	$result = $xoopsDB->query("SELECT COUNT(*) FROM `$games_table` WHERE `pgn_result` NOT IN ($pgn_result_values)");
126 126
 
127
-    if (!$result) {
128
-        $mysql_errno = $xoopsDB->errno();
127
+	if (!$result) {
128
+		$mysql_errno = $xoopsDB->errno();
129 129
 
130
-        $mysql_error = $xoopsDB->error();
130
+		$mysql_error = $xoopsDB->error();
131 131
 
132
-        chess_set_message($module, sprintf(_MI_CHESS_GAMES_TABLE_2, $games_table, (string)$mysql_errno, $mysql_error), true);
132
+		chess_set_message($module, sprintf(_MI_CHESS_GAMES_TABLE_2, $games_table, (string)$mysql_errno, $mysql_error), true);
133 133
 
134
-        return false;
135
-    }
134
+		return false;
135
+	}
136 136
 
137
-    [$count] = $xoopsDB->fetchRow($result);
137
+	[$count] = $xoopsDB->fetchRow($result);
138 138
 
139
-    if ($count > 0) {
140
-        chess_set_message($module, sprintf(_MI_CHESS_GAMES_TABLE_3, 'pgn_result', $games_table, $pgn_result_values), true);
139
+	if ($count > 0) {
140
+		chess_set_message($module, sprintf(_MI_CHESS_GAMES_TABLE_3, 'pgn_result', $games_table, $pgn_result_values), true);
141 141
 
142
-        chess_set_message($module, _MI_CHESS_GAMES_TABLE_4, true);
142
+		chess_set_message($module, _MI_CHESS_GAMES_TABLE_4, true);
143 143
 
144
-        return false;
145
-    }
144
+		return false;
145
+	}
146 146
 
147
-    $xoopsDB->freeRecordSet($result);
147
+	$xoopsDB->freeRecordSet($result);
148 148
 
149
-    chess_set_message($module, _MI_CHESS_OK);
149
+	chess_set_message($module, _MI_CHESS_OK);
150 150
 
151
-    return true; // successful
151
+	return true; // successful
152 152
 }
153 153
 
154 154
 /**
@@ -160,28 +160,28 @@  discard block
 block discarded – undo
160 160
  */
161 161
 function xoops_module_update_chess($module, $oldversion)
162 162
 {
163
-    global $xoopsDB;
163
+	global $xoopsDB;
164 164
 
165
-    // Before proceeding, ensure that pre-update processing has been done, and that all the checks pass.
165
+	// Before proceeding, ensure that pre-update processing has been done, and that all the checks pass.
166 166
 
167
-    // For downward-compatiblity, in case the "pre_update" function doesn't get called by the module handler.
167
+	// For downward-compatiblity, in case the "pre_update" function doesn't get called by the module handler.
168 168
 
169
-    if (!@$GLOBALS['chess_module_pre_update_called'] && !xoops_module_pre_update_chess($module, $oldversion)) {
170
-        return false;
171
-    }
169
+	if (!@$GLOBALS['chess_module_pre_update_called'] && !xoops_module_pre_update_chess($module, $oldversion)) {
170
+		return false;
171
+	}
172 172
 
173
-    if ($oldversion >= 107) { // old version >= 1.07:  no action needed.
174
-        return true;
175
-    }
173
+	if ($oldversion >= 107) { // old version >= 1.07:  no action needed.
174
+		return true;
175
+	}
176 176
 
177
-    $ratings_table = $xoopsDB->prefix('chess_ratings');
177
+	$ratings_table = $xoopsDB->prefix('chess_ratings');
178 178
 
179
-    $challenges_table = $xoopsDB->prefix('chess_challenges');
179
+	$challenges_table = $xoopsDB->prefix('chess_challenges');
180 180
 
181
-    $games_table = $xoopsDB->prefix('chess_games');
181
+	$games_table = $xoopsDB->prefix('chess_games');
182 182
 
183
-    $queries = [
184
-        "CREATE TABLE `$ratings_table` (
183
+	$queries = [
184
+		"CREATE TABLE `$ratings_table` (
185 185
 			`player_uid` mediumint(8) unsigned NOT NULL default '0',
186 186
 			`rating` smallint(6) unsigned NOT NULL default '1200',
187 187
 			`games_won` smallint(6) unsigned NOT NULL default '0',
@@ -192,48 +192,48 @@  discard block
 block discarded – undo
192 192
 			KEY `games` (`games_won`,`games_lost`,`games_drawn`)
193 193
 			) ENGINE=MyISAM",
194 194
 
195
-        "ALTER TABLE `$challenges_table` ADD `is_rated` ENUM('1','0') DEFAULT '1' NOT NULL",
196
-        "ALTER TABLE `$challenges_table` ADD INDEX `game_type` (`game_type`)",
197
-        "ALTER TABLE `$challenges_table` ADD INDEX `player1_uid` (`player1_uid`)",
198
-        "ALTER TABLE `$challenges_table` ADD INDEX `player2_uid` (`player2_uid`)",
199
-        "ALTER TABLE `$challenges_table` ADD INDEX `create_date` (`create_date`)",
200
-        "ALTER TABLE `$challenges_table` ADD INDEX `is_rated` (`is_rated`)",
195
+		"ALTER TABLE `$challenges_table` ADD `is_rated` ENUM('1','0') DEFAULT '1' NOT NULL",
196
+		"ALTER TABLE `$challenges_table` ADD INDEX `game_type` (`game_type`)",
197
+		"ALTER TABLE `$challenges_table` ADD INDEX `player1_uid` (`player1_uid`)",
198
+		"ALTER TABLE `$challenges_table` ADD INDEX `player2_uid` (`player2_uid`)",
199
+		"ALTER TABLE `$challenges_table` ADD INDEX `create_date` (`create_date`)",
200
+		"ALTER TABLE `$challenges_table` ADD INDEX `is_rated` (`is_rated`)",
201 201
 
202
-        "ALTER TABLE `$games_table` CHANGE `pgn_result` `pgn_result` ENUM('*','0-1','1-0','1/2-1/2') DEFAULT '*' NOT NULL",
203
-        "ALTER TABLE `$games_table` ADD `is_rated` ENUM('1','0') DEFAULT '1' NOT NULL",
204
-        "ALTER TABLE `$games_table` ADD INDEX `white_uid` (`white_uid`)",
205
-        "ALTER TABLE `$games_table` ADD INDEX `black_uid` (`black_uid`)",
206
-        "ALTER TABLE `$games_table` ADD INDEX `date` (`create_date`,`start_date`,`last_date`)",
207
-        "ALTER TABLE `$games_table` ADD INDEX `pgn_result` (`pgn_result`)",
208
-        "ALTER TABLE `$games_table` ADD INDEX `suspended_date` (`suspended`(19))",
209
-        "ALTER TABLE `$games_table` ADD INDEX `is_rated` (`is_rated`)",
202
+		"ALTER TABLE `$games_table` CHANGE `pgn_result` `pgn_result` ENUM('*','0-1','1-0','1/2-1/2') DEFAULT '*' NOT NULL",
203
+		"ALTER TABLE `$games_table` ADD `is_rated` ENUM('1','0') DEFAULT '1' NOT NULL",
204
+		"ALTER TABLE `$games_table` ADD INDEX `white_uid` (`white_uid`)",
205
+		"ALTER TABLE `$games_table` ADD INDEX `black_uid` (`black_uid`)",
206
+		"ALTER TABLE `$games_table` ADD INDEX `date` (`create_date`,`start_date`,`last_date`)",
207
+		"ALTER TABLE `$games_table` ADD INDEX `pgn_result` (`pgn_result`)",
208
+		"ALTER TABLE `$games_table` ADD INDEX `suspended_date` (`suspended`(19))",
209
+		"ALTER TABLE `$games_table` ADD INDEX `is_rated` (`is_rated`)",
210 210
 
211
-        "UPDATE `$games_table` SET `is_rated` = '0' WHERE `white_uid` = `black_uid`",
212
-    ];
211
+		"UPDATE `$games_table` SET `is_rated` = '0' WHERE `white_uid` = `black_uid`",
212
+	];
213 213
 
214
-    // Update database tables.
214
+	// Update database tables.
215 215
 
216
-    chess_set_message($module, _MI_CHESS_UPDATING_DATABASE);
216
+	chess_set_message($module, _MI_CHESS_UPDATING_DATABASE);
217 217
 
218
-    foreach ($queries as $query) {
219
-        chess_set_message($module, "> $query");
218
+	foreach ($queries as $query) {
219
+		chess_set_message($module, "> $query");
220 220
 
221
-        $result = $xoopsDB->query($query);
221
+		$result = $xoopsDB->query($query);
222 222
 
223
-        if (!$result) {
224
-            $mysql_errno = $xoopsDB->errno();
223
+		if (!$result) {
224
+			$mysql_errno = $xoopsDB->errno();
225 225
 
226
-            $mysql_error = $xoopsDB->error();
226
+			$mysql_error = $xoopsDB->error();
227 227
 
228
-            chess_set_message($module, " ... ($mysql_errno) $mysql_error");
228
+			chess_set_message($module, " ... ($mysql_errno) $mysql_error");
229 229
 
230
-            return false;
231
-        }
230
+			return false;
231
+		}
232 232
 
233
-        chess_set_message($module, _MI_CHESS_OK);
234
-    }
233
+		chess_set_message($module, _MI_CHESS_OK);
234
+	}
235 235
 
236
-    /***
236
+	/***
237 237
      * #*#TODO# - Leave this here for now, in case I think of a way to get it to work.
238 238
      * # This causes an error about the rating_system module configuration parameter not being defined,
239 239
      * # so I added a note in INSTALL.TXT about manually recalculating the ratings after install.
@@ -244,9 +244,9 @@  discard block
 block discarded – undo
244 244
      * chess_recalc_ratings();
245 245
      ***/
246 246
 
247
-    chess_set_message($module, _MI_CHESS_UPDATE_SUCCESSFUL);
247
+	chess_set_message($module, _MI_CHESS_UPDATE_SUCCESSFUL);
248 248
 
249
-    return true; // successful
249
+	return true; // successful
250 250
 }
251 251
 
252 252
 /**
@@ -257,45 +257,45 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function chess_check_tables($table_names)
259 259
 {
260
-    global $xoopsDB;
260
+	global $xoopsDB;
261 261
 
262
-    $messages = [];
262
+	$messages = [];
263 263
 
264
-    foreach ($table_names as $table_name) {
265
-        $query = "CHECK TABLE `$table_name`";
264
+	foreach ($table_names as $table_name) {
265
+		$query = "CHECK TABLE `$table_name`";
266 266
 
267
-        $result = $xoopsDB->query($query);
267
+		$result = $xoopsDB->query($query);
268 268
 
269
-        if (!$result) {
270
-            $mysql_errno = $xoopsDB->errno();
269
+		if (!$result) {
270
+			$mysql_errno = $xoopsDB->errno();
271 271
 
272
-            $mysql_error = $xoopsDB->error();
272
+			$mysql_error = $xoopsDB->error();
273 273
 
274
-            $messages[] = $query;
274
+			$messages[] = $query;
275 275
 
276
-            $messages[] = " ... ($mysql_errno) $mysql_error";
276
+			$messages[] = " ... ($mysql_errno) $mysql_error";
277 277
 
278
-            continue;
279
-        }
278
+			continue;
279
+		}
280 280
 
281
-        // Initialize, in case the real table status fails to get retrieved.
281
+		// Initialize, in case the real table status fails to get retrieved.
282 282
 
283
-        $table_status = '*** STATUS UNKNOWN ***';
283
+		$table_status = '*** STATUS UNKNOWN ***';
284 284
 
285
-        // The query may return multiple rows.  Only the last row is normally of interest, so only that row is saved.
285
+		// The query may return multiple rows.  Only the last row is normally of interest, so only that row is saved.
286 286
 
287
-        while (false !== ($row = $xoopsDB->fetchArray($result))) {
288
-            $table_status = $row['Msg_text'];
289
-        }
287
+		while (false !== ($row = $xoopsDB->fetchArray($result))) {
288
+			$table_status = $row['Msg_text'];
289
+		}
290 290
 
291
-        $xoopsDB->freeRecordSet($result);
291
+		$xoopsDB->freeRecordSet($result);
292 292
 
293
-        if ('OK' != $table_status) {
294
-            $messages[] = " ... $table_name: $table_status";
295
-        }
296
-    }
293
+		if ('OK' != $table_status) {
294
+			$messages[] = " ... $table_name: $table_status";
295
+		}
296
+	}
297 297
 
298
-    return $messages;
298
+	return $messages;
299 299
 }
300 300
 
301 301
 /**
@@ -310,15 +310,15 @@  discard block
 block discarded – undo
310 310
  */
311 311
 function chess_load_lang_file($filename, $module = '', $default = 'english')
312 312
 {
313
-    $lang = $GLOBALS['xoopsConfig']['language'];
313
+	$lang = $GLOBALS['xoopsConfig']['language'];
314 314
 
315
-    $path = XOOPS_ROOT_PATH . (empty($module) ? '/' : "/modules/$module/") . 'language';
315
+	$path = XOOPS_ROOT_PATH . (empty($module) ? '/' : "/modules/$module/") . 'language';
316 316
 
317
-    if (!($ret = @include_once("$path/$lang/$filename.php"))) {
318
-        $ret = include_once("$path/$default/$filename.php");
319
-    }
317
+	if (!($ret = @include_once("$path/$lang/$filename.php"))) {
318
+		$ret = include_once("$path/$default/$filename.php");
319
+	}
320 320
 
321
-    return $ret;
321
+	return $ret;
322 322
 }
323 323
 
324 324
 /**
@@ -330,13 +330,13 @@  discard block
 block discarded – undo
330 330
  */
331 331
 function chess_set_message($module, $text = '', $error = false)
332 332
 {
333
-    $text = $error ? "<span style='color:#ff0000;background-color:#ffffff;font-weight:bold;'>$text</span>" : $text;
333
+	$text = $error ? "<span style='color:#ff0000;background-color:#ffffff;font-weight:bold;'>$text</span>" : $text;
334 334
 
335
-    // For downward compatibility with XOOPS versions that don't have the method XoopsModule::setMessage.
335
+	// For downward compatibility with XOOPS versions that don't have the method XoopsModule::setMessage.
336 336
 
337
-    if (is_object($module) && method_exists($module, 'setMessage')) {
338
-        $module->setMessage($text);
339
-    } else {
340
-        echo "<code>$text</code><br>\n";
341
-    }
337
+	if (is_object($module) && method_exists($module, 'setMessage')) {
338
+		$module->setMessage($text);
339
+	} else {
340
+		echo "<code>$text</code><br>\n";
341
+	}
342 342
 }
Please login to merge, or discard this patch.
include/ratings_linear.inc.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
  */
42 42
 function chess_ratings_adj_linear($white_rating, $white_games, $black_rating, $black_games, $pgn_result)
43 43
 {
44
-    // compute score: +1 for win, 0 for draw, -1 for loss
45
-    switch ($pgn_result) {
46
-        case '1-0':
47
-            $S = 1;
48
-            break;
49
-        case '1/2-1/2':
50
-        default: // should not occur
51
-            $S = 0;
52
-            break;
53
-        case '0-1':
54
-            $S = -1;
55
-            break;
56
-    }
44
+	// compute score: +1 for win, 0 for draw, -1 for loss
45
+	switch ($pgn_result) {
46
+		case '1-0':
47
+			$S = 1;
48
+			break;
49
+		case '1/2-1/2':
50
+		default: // should not occur
51
+			$S = 0;
52
+			break;
53
+		case '0-1':
54
+			$S = -1;
55
+			break;
56
+	}
57 57
 
58
-    return [$white_rating + $S * 10, $black_rating - $S * 10];
58
+	return [$white_rating + $S * 10, $black_rating - $S * 10];
59 59
 }
60 60
 
61 61
 /**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
  */
66 66
 function chess_ratings_num_provisional_games_linear()
67 67
 {
68
-    return 2;
68
+	return 2;
69 69
 }
70 70
 
71 71
 ?>
Please login to merge, or discard this patch.