Passed
Push — master ( 4eb8b5...c6e41d )
by Michael
07:19 queued 04:35
created
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.
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/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.
include/ratings_linear.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -47,22 +47,22 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function chess_ratings_adj_linear($white_rating, $white_games, $black_rating, $black_games, $pgn_result)
49 49
 {
50
-    // compute score: +1 for win, 0 for draw, -1 for loss
50
+	// compute score: +1 for win, 0 for draw, -1 for loss
51 51
 
52
-    switch ($pgn_result) {
53
-        case '1-0':
54
-            $S = 1;
55
-            break;
56
-        case '1/2-1/2':
57
-        default: // should not occur
58
-            $S = 0;
59
-            break;
60
-        case '0-1':
61
-            $S = -1;
62
-            break;
63
-    }
52
+	switch ($pgn_result) {
53
+		case '1-0':
54
+			$S = 1;
55
+			break;
56
+		case '1/2-1/2':
57
+		default: // should not occur
58
+			$S = 0;
59
+			break;
60
+		case '0-1':
61
+			$S = -1;
62
+			break;
63
+	}
64 64
 
65
-    return [$white_rating + $S * 10, $black_rating - $S * 10];
65
+	return [$white_rating + $S * 10, $black_rating - $S * 10];
66 66
 }
67 67
 
68 68
 /**
@@ -72,5 +72,5 @@  discard block
 block discarded – undo
72 72
  */
73 73
 function chess_ratings_num_provisional_games_linear()
74 74
 {
75
-    return 2;
75
+	return 2;
76 76
 }
Please login to merge, or discard this patch.
include/common.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -42,47 +42,47 @@  discard block
 block discarded – undo
42 42
 $pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16);
43 43
 $pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32);
44 44
 if (is_object($helper->getModule())) {
45
-    $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
45
+	$pathModIcon16 = $helper->getModule()->getInfo('modicons16');
46 46
 
47
-    $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
47
+	$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
48 48
 }
49 49
 
50 50
 if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) {
51
-    define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
51
+	define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
52 52
 
53
-    define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
53
+	define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
54 54
 
55
-    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
55
+	define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
56 56
 
57
-    define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
57
+	define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
58 58
 
59
-    define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
59
+	define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
60 60
 
61
-    define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
61
+	define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
62 62
 
63
-    define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
63
+	define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
64 64
 
65
-    define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
65
+	define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
66 66
 
67
-    define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
68
-    //    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
69
-    define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
70
-    define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
71
-    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', $pathIcon32 . '/xoopsmicrobutton.gif');
67
+	define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
68
+	//    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
69
+	define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
70
+	define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
71
+	define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', $pathIcon32 . '/xoopsmicrobutton.gif');
72 72
 
73
-    define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
73
+	define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
74 74
 }
75 75
 
76 76
 $icons = [
77
-    'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
78
-    'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
79
-    'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
80
-    'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
81
-    'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
82
-    'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
83
-    'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
84
-    '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
85
-    '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
77
+	'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
78
+	'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
79
+	'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
80
+	'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
81
+	'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
82
+	'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
83
+	'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
84
+	'0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
85
+	'1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
86 86
 ];
87 87
 
88 88
 $debug = false;
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
 $myts = \MyTextSanitizer::getInstance();
92 92
 
93 93
 if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) {
94
-    require_once $GLOBALS['xoops']->path('class/template.php');
94
+	require_once $GLOBALS['xoops']->path('class/template.php');
95 95
 
96
-    $GLOBALS['xoopsTpl'] = new \XoopsTpl();
96
+	$GLOBALS['xoopsTpl'] = new \XoopsTpl();
97 97
 }
98 98
 
99 99
 $GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName);
100 100
 // Local icons path
101 101
 if (is_object($helper->getModule())) {
102
-    $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
102
+	$pathModIcon16 = $helper->getModule()->getInfo('modicons16');
103 103
 
104
-    $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
104
+	$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
105 105
 
106
-    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
106
+	$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
107 107
 
108
-    $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
108
+	$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
109 109
 }
Please login to merge, or discard this patch.
config/icons.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,16 +4,16 @@
 block discarded – undo
4 4
 $moduleDirName = basename(dirname(__DIR__));
5 5
 
6 6
 return (object)[
7
-    'name'  => mb_strtoupper($moduleDirName) . ' IconConfigurator',
8
-    'icons' => [
9
-        'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
10
-        'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
11
-        'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
12
-        'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
13
-        'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
14
-        'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
15
-        'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
16
-        '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
17
-        '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
18
-    ],
7
+	'name'  => mb_strtoupper($moduleDirName) . ' IconConfigurator',
8
+	'icons' => [
9
+		'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
10
+		'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
11
+		'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
12
+		'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
13
+		'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
14
+		'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
15
+		'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
16
+		'0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
17
+		'1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
18
+	],
19 19
 ];
Please login to merge, or discard this patch.
admin/index.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -42,31 +42,31 @@  discard block
 block discarded – undo
42 42
 //------------- Test Data ----------------------------
43 43
 
44 44
 if ($helper->getConfig('displaySampleButton')) {
45
-    $yamlFile = dirname(__DIR__) . '/config/admin.yml';
45
+	$yamlFile = dirname(__DIR__) . '/config/admin.yml';
46 46
 
47
-    $config = loadAdminConfig($yamlFile);
47
+	$config = loadAdminConfig($yamlFile);
48 48
 
49
-    $displaySampleButton = $config['displaySampleButton'];
49
+	$displaySampleButton = $config['displaySampleButton'];
50 50
 
51
-    if (1 == $displaySampleButton) {
52
-        xoops_loadLanguage('admin/modulesadmin', 'system');
51
+	if (1 == $displaySampleButton) {
52
+		xoops_loadLanguage('admin/modulesadmin', 'system');
53 53
 
54
-        require_once dirname(__DIR__) . '/testdata/index.php';
54
+		require_once dirname(__DIR__) . '/testdata/index.php';
55 55
 
56
-        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add');
56
+		$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add');
57 57
 
58
-        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add');
58
+		$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add');
59 59
 
60
-        //    $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add');
60
+		//    $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add');
61 61
 
62
-        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
63
-    } else {
64
-        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
62
+		$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
63
+	} else {
64
+		$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
65 65
 
66
-        $displaySampleButton = $config['displaySampleButton'];
67
-    }
66
+		$displaySampleButton = $config['displaySampleButton'];
67
+	}
68 68
 
69
-    $adminObject->displayButton('left', '');
69
+	$adminObject->displayButton('left', '');
70 70
 }
71 71
 
72 72
 //------------- End Test Data ----------------------------
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
  */
80 80
 function loadAdminConfig($yamlFile)
81 81
 {
82
-    return \Xmf\Yaml::readWrapped($yamlFile);
82
+	return \Xmf\Yaml::readWrapped($yamlFile);
83 83
 }
84 84
 
85 85
 /**
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
  */
88 88
 function hideButtons($yamlFile)
89 89
 {
90
-    $app['displaySampleButton'] = 0;
90
+	$app['displaySampleButton'] = 0;
91 91
 
92
-    \Xmf\Yaml::save($app, $yamlFile);
92
+	\Xmf\Yaml::save($app, $yamlFile);
93 93
 
94
-    redirect_header('index.php', 0, '');
94
+	redirect_header('index.php', 0, '');
95 95
 }
96 96
 
97 97
 /**
@@ -99,22 +99,22 @@  discard block
 block discarded – undo
99 99
  */
100 100
 function showButtons($yamlFile)
101 101
 {
102
-    $app['displaySampleButton'] = 1;
102
+	$app['displaySampleButton'] = 1;
103 103
 
104
-    \Xmf\Yaml::save($app, $yamlFile);
104
+	\Xmf\Yaml::save($app, $yamlFile);
105 105
 
106
-    redirect_header('index.php', 0, '');
106
+	redirect_header('index.php', 0, '');
107 107
 }
108 108
 
109 109
 $op = \Xmf\Request::getString('op', 0, 'GET');
110 110
 
111 111
 switch ($op) {
112
-    case 'hide_buttons':
113
-        hideButtons($yamlFile);
114
-        break;
115
-    case 'show_buttons':
116
-        showButtons($yamlFile);
117
-        break;
112
+	case 'hide_buttons':
113
+		hideButtons($yamlFile);
114
+		break;
115
+	case 'show_buttons':
116
+		showButtons($yamlFile);
117
+		break;
118 118
 }
119 119
 
120 120
 echo $utility::getServerStats();
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -34,45 +34,45 @@
 block discarded – undo
34 34
 
35 35
 $pathIcon32 = \Xmf\Module\Admin::menuIconPath('');
36 36
 if (is_object($helper->getModule())) {
37
-    //    $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
37
+	//    $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
38 38
 
39
-    $pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32'));
39
+	$pathModIcon32 = $helper->url($helper->getModule()->getInfo('modicons32'));
40 40
 }
41 41
 
42 42
 $adminmenu[] = [
43
-    'title' => _MI_CHESS_MENU_HOME,
44
-    'link'  => 'admin/index.php',
45
-    'icon'  => $pathIcon32 . '/home.png',
43
+	'title' => _MI_CHESS_MENU_HOME,
44
+	'link'  => 'admin/index.php',
45
+	'icon'  => $pathIcon32 . '/home.png',
46 46
 ];
47 47
 
48 48
 $adminmenu[] = [
49
-    'title' => _MI_CHESS_ADMENU1,
50
-    'link'  => 'admin/main.php?op=suspended_games',
51
-    'icon'  => $pathIcon32 . '/alert.png',
49
+	'title' => _MI_CHESS_ADMENU1,
50
+	'link'  => 'admin/main.php?op=suspended_games',
51
+	'icon'  => $pathIcon32 . '/alert.png',
52 52
 ];
53 53
 
54 54
 $adminmenu[] = [
55
-    'title' => _MI_CHESS_ADMENU2,
56
-    'link'  => 'admin/main.php?op=active_games',
57
-    'icon'  => $pathIcon32 . '/button_ok.png',
55
+	'title' => _MI_CHESS_ADMENU2,
56
+	'link'  => 'admin/main.php?op=active_games',
57
+	'icon'  => $pathIcon32 . '/button_ok.png',
58 58
 ];
59 59
 
60 60
 $adminmenu[] = [
61
-    'title' => _MI_CHESS_ADMENU3,
62
-    'link'  => 'admin/main.php?op=challenges',
63
-    'icon'  => $pathIcon32 . '/cash_stack.png',
61
+	'title' => _MI_CHESS_ADMENU3,
62
+	'link'  => 'admin/main.php?op=challenges',
63
+	'icon'  => $pathIcon32 . '/cash_stack.png',
64 64
 ];
65 65
 
66 66
 if (is_object($helper->getModule()) && $helper->getConfig('displayDeveloperTools')) {
67
-    $adminmenu[] = [
68
-        'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE'),
69
-        'link'  => 'admin/migrate.php',
70
-        'icon'  => $pathIcon32 . '/database_go.png',
71
-    ];
67
+	$adminmenu[] = [
68
+		'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE'),
69
+		'link'  => 'admin/migrate.php',
70
+		'icon'  => $pathIcon32 . '/database_go.png',
71
+	];
72 72
 }
73 73
 
74 74
 $adminmenu[] = [
75
-    'title' => _MI_CHESS_MENU_ABOUT,
76
-    'link'  => 'admin/about.php',
77
-    'icon'  => $pathIcon32 . '/about.png',
75
+	'title' => _MI_CHESS_MENU_ABOUT,
76
+	'link'  => 'admin/about.php',
77
+	'icon'  => $pathIcon32 . '/about.png',
78 78
 ];
Please login to merge, or discard this patch.