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: function logSetupFailure($sErrorMessage) {
45: global $cfg;
46: cFileHandler::write($cfg['path']['contenido_logs'] . 'setuplog.txt', $sErrorMessage . PHP_EOL . PHP_EOL, true);
47: }
48:
49: 50: 51: 52: 53: 54:
55: function setupInitializeCfgClient($reset = false) {
56: global $cfg, $cfgClient;
57:
58: if (true === $reset) {
59: $cfgClient = array();
60: }
61:
62:
63: if (empty($cfgClient) || !isset($cfgClient['set'])) {
64: if (cFileHandler::exists($cfg['path']['contenido_config'] . 'config.clients.php')) {
65: require($cfg['path']['contenido_config'] . 'config.clients.php');
66: } else {
67: $db = getSetupMySQLDBConnection();
68:
69: $db->query("SELECT * FROM " . $cfg["tab"]["clients"]);
70: while ($db->nextRecord()) {
71: updateClientCache($db->f("idclient"), $db->f("htmlpath"), $db->f("frontendpath"));
72: }
73: }
74: }
75: }
76:
77: ?>