1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23:
24: function cGenerateSetupStepsDisplay($iCurrentStep) {
25: if (!defined('CON_SETUP_STEPS')) {
26: return '';
27: }
28: $sStepsPath = '';
29: for ($i = 1; $i < CON_SETUP_STEPS + 1; $i++) {
30: $sCssActive = '';
31: if ($iCurrentStep == $i) {
32: $sCssActive = 'active';
33: }
34: $sStepsPath .= '<span class="' . $sCssActive . '"> ' . strval($i) . ' </span> ';
35: }
36: return $sStepsPath;
37: }
38:
39: 40: 41: 42: 43: 44:
45: function logSetupFailure($sErrorMessage) {
46: global $cfg;
47: cFileHandler::write($cfg['path']['contenido_logs'] . 'setuplog.txt', $sErrorMessage . PHP_EOL . PHP_EOL, true);
48: }
49:
50: 51: 52: 53: 54: 55:
56: function setupInitializeCfgClient($reset = false) {
57: global $cfg, $cfgClient;
58:
59: if (true === $reset) {
60: $cfgClient = array();
61: }
62:
63:
64: if (empty($cfgClient) || !isset($cfgClient['set'])) {
65: if (cFileHandler::exists($cfg['path']['contenido_config'] . 'config.clients.php')) {
66: require($cfg['path']['contenido_config'] . 'config.clients.php');
67: } else {
68: $db = getSetupMySQLDBConnection();
69:
70: $db->query("SELECT * FROM " . $cfg["tab"]["clients"]);
71: while ($db->nextRecord()) {
72: updateClientCache($db->f("idclient"), $db->f("htmlpath"), $db->f("frontendpath"));
73: }
74: }
75: }
76: }
77:
78: ?>