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