Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cSetupAdminPassword
  • cSetupClientAdjust
  • cSetupClientMode
  • cSetupConfigMode
  • cSetupInstaller
  • cSetupPath
  • cSetupResults
  • cSetupSetupSummary
  • cSetupSystemData
  • cSetupSystemtest
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the client adjust setup mask.
  4:  *
  5:  * @package    Setup
  6:  * @subpackage Form
  7:  * @author     Unknown
  8:  * @copyright  four for business AG <www.4fb.de>
  9:  * @license    http://www.contenido.org/license/LIZENZ.txt
 10:  * @link       http://www.4fb.de
 11:  * @link       http://www.contenido.org
 12:  */
 13: 
 14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 15: 
 16: /**
 17:  * Client adjust setup mask.
 18:  *
 19:  * @package Setup
 20:  * @subpackage Form
 21:  */
 22: class cSetupClientAdjust extends cSetupMask {
 23: 
 24:     /**
 25:      * cSetupClientAdjust constructor.
 26:      * @param string $step
 27:      * @param bool $previous
 28:      * @param $next
 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:                 // Use frontendpath instead of htmlpath as the directories should be aligned pairwhise
 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), "&nbsp;");
 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), "&nbsp;");
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:      * Old constructor
120:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
121:      * @param $step
122:      * @param $previous
123:      * @param $next
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: ?>
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0