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: class cSetupClientAdjust extends cSetupMask {
23:
24: 25: 26: 27: 28: 29:
30: public function __construct($step, $previous, $next) {
31: $cfg = cRegistry::getConfig();
32: $client = cRegistry::getClientId();
33: $cfgClient = cRegistry::getClientConfig($client);
34:
35: cSetupMask::__construct("templates/setup/forms/pathinfo.tpl", $step);
36: $this->setHeader(i18n("Client Settings", "setup"));
37: $this->_stepTemplateClass->set("s", "TITLE", i18n("Client Settings", "setup"));
38: $this->_stepTemplateClass->set("s", "DESCRIPTION", i18n("Please check the directories identified by the system. If you need to change a client path, click on the name and enter your new path in the available input box.", "setup"));
39:
40: $db = getSetupMySQLDBConnection();
41:
42: $aClients = listClients($db, $cfg['tab']['clients']);
43:
44: $cHTMLErrorMessageList = new cHTMLErrorMessageList();
45:
46: $aPathList = array();
47:
48: list($a_root_path, $a_root_http_path) = getSystemDirectories();
49:
50: @include($cfg['path']['contenido_config'] . 'config.php');
51:
52: setupInitializeCfgClient();
53:
54: foreach ($aClients as $idclient => $aInfo) {
55: $name = $aInfo['name'];
56:
57: if (isset($cfgClient[$idclient])) {
58: $htmlPath = $cfgClient[$idclient]["path"]["htmlpath"];
59: $frontendPath = $cfgClient[$idclient]["path"]["frontend"];
60: } else {
61: $htmlPath = '';
62: $frontendPath = '';
63: }
64:
65: if ($_SESSION["frontendpath"][$idclient] == "") {
66: $iDifferencePos = findSimilarText($cfg['path']['frontend'] . "/", $frontendPath);
67: if ($iDifferencePos > 0) {
68: $sClientPath = $a_root_path . "/" . cString::getPartOfString($frontendPath, $iDifferencePos + 1, cString::getStringLength($frontendPath) - $iDifferencePos);
69: $_SESSION["frontendpath"][$idclient] = $sClientPath;
70: } else {
71: $_SESSION["frontendpath"][$idclient] = $frontendPath;
72: }
73: }
74:
75: if ($_SESSION["htmlpath"][$idclient] == "") {
76:
77: $iDifferencePos = findSimilarText($cfg['path']['frontend'] . "/", $frontendPath);
78: if ($iDifferencePos > 0) {
79: $sClientPath = $a_root_http_path . "/" . cString::getPartOfString($frontendPath, $iDifferencePos + 1, cString::getStringLength($frontendPath) - $iDifferencePos);
80: $_SESSION["htmlpath"][$idclient] = $sClientPath;
81: } else {
82: $_SESSION["htmlpath"][$idclient] = $htmlPath;
83: }
84: }
85:
86: $sName = sprintf(i18n("Old server path for %s (%s)", "setup"), $name, $idclient);
87: $sName .= ":<br>" . $frontendPath . "<br><br>";
88: $sName .= sprintf(i18n("New server path for %s (%s)", "setup"), $name, $idclient);
89: $sName .= ":<br>";
90: $oSystemPathBox = new cHTMLTextbox("frontendpath[$idclient]", $_SESSION["frontendpath"][$idclient]);
91: $oSystemPathBox->setWidth(100);
92: $oSystemPathBox->setClass("small");
93: $oClientSystemPath = new cHTMLInfoMessage(array($sName, $oSystemPathBox), " ");
94: $oClientSystemPath->_oTitle->setStyle("padding-left:8px;padding-bottom:8px;width:90%;");
95:
96: $aPathList[] = $oClientSystemPath;
97:
98: $sName = sprintf(i18n("Old web path for %s (%s)", "setup"), $name, $idclient);
99: $sName .= ":<br>" . $htmlPath . "<br><br>";
100: $sName .= sprintf(i18n("New web path for %s (%s)", "setup"), $name, $idclient);
101: $sName .= ":<br>";
102: $oSystemPathBox = new cHTMLTextbox("htmlpath[$idclient]", $_SESSION["htmlpath"][$idclient]);
103: $oSystemPathBox->setWidth(100);
104: $oSystemPathBox->setClass("small");
105: $oClientSystemPath = new cHTMLInfoMessage(array($sName, $oSystemPathBox), " ");
106: $oClientSystemPath->_oTitle->setStyle("padding-left:8px;padding-bottom:8px;width:90%;");
107:
108: $aPathList[] = $oClientSystemPath;
109: }
110:
111: $cHTMLErrorMessageList->setContent($aPathList);
112:
113: $this->_stepTemplateClass->set("s", "CONTROL_PATHINFO", $cHTMLErrorMessageList->render());
114:
115: $this->setNavigation($previous, $next);
116: }
117:
118: 119: 120: 121: 122: 123: 124:
125: public function cSetupClientAdjust($step, $previous, $next) {
126: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
127: $this->__construct($step, $previous, $next);
128: }
129:
130: }
131:
132: ?>