fixes for PHP 7

Dieser Commit ist enthalten in:
oldperl 2017-01-13 12:45:12 +00:00
Ursprung 263db360cf
Commit 6a52c9cda3
18 geänderte Dateien mit 979 neuen und 1068 gelöschten Zeilen

Datei anzeigen

@ -38,7 +38,7 @@ class cHTMLAlphaImage extends cHTMLImage {
var $_sMouseoverSrc;
function __construct() {
cHTMLImage::__construct();
parent::__construct();
}
function setMouseover ($sMouseoverSrc)
@ -90,7 +90,7 @@ class cHTMLErrorMessageList extends cHTMLDiv {
public function __construct() {
$this->_oTable = new cHTMLTable();
$this->_oTable->setWidth("100%");
cHTMLDiv::__construct();
parent::__construct();
$this->setClass("errorlist");
$this->setStyle("width: 450px; height: 218px; overflow: auto; border: 1px solid black;");
}
@ -163,7 +163,7 @@ class cHTMLFoldableErrorMessage extends cHTMLTableRow {
$this->_oIcon->setContent(" ");
}
cHTMLTableRow::__construct();
parent::__construct();
}
function toHTML() {
@ -191,7 +191,7 @@ class cHTMLInfoMessage extends cHTMLTableRow {
$this->_oMessage->setContent($sMessage);
$this->_oMessage->setClass("entry_nowrap");
cHTMLTableRow::__construct();
parent::__construct();
}
function toHTML() {
@ -209,7 +209,7 @@ class cHTMLLanguageLink extends cHTMLDiv {
* @param int $stepnumber
*/
function __construct($langcode, $langname, $stepnumber) {
cHTMLDiv::__construct();
parent::__construct();
$linkImage = new cHTMLAlphaImage();
$linkImage->setAlt("");
@ -249,7 +249,7 @@ class cHTMLButtonLink extends cHTMLDiv {
* @param string $title
*/
function __construct($href, $title) {
cHTMLDiv::__construct();
parent::__construct();
$linkImage = new cHTMLAlphaImage();
$linkImage->setSrc("../conlite/images/submit.gif");

Datei anzeigen

@ -1,13 +1,16 @@
<?php
/**
* Project:
* Contenido Content Management System
* Class Setup Mask
*
* Description:
*
* Requirements:
* @con_php_req 5
* @package ConLite
* @subpackage Setup
* @version $Rev: 279 $
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2017, conlite.org
*
* $Id: class.setupmask.php 279 2013-11-21 14:34:53Z oldperl $:
*/
/**
* @package ContenidoBackendArea
* @version 0.2
* @author unknown
@ -15,26 +18,14 @@
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
*
*
* {@internal
* created unknown
* modified 2008-07-07, bilal arslan, added security fix
*
* $Id: class.setupmask.php 279 2013-11-21 14:34:53Z oldperl $:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupMask {
class cSetupMask
{
function cSetupMask ($sStepTemplate, $iStep = false)
{
public function __construct($sStepTemplate, $iStep = false) {
$this->_oTpl = new Template;
$this->_oStepTemplate = new Template;
@ -43,47 +34,39 @@ class cSetupMask
$this->_bNavigationEnabled = false;
}
function setNavigation ($sBackstep, $sNextstep)
{
public function setNavigation($sBackstep, $sNextstep) {
$this->_bNavigationEnabled = true;
$this->_bBackstep = $sBackstep;
$this->_bNextstep = $sNextstep;
}
function setHeader ($sHeader)
{
if (array_key_exists("setuptype", $_SESSION))
{
public function setHeader($sHeader) {
if (array_key_exists("setuptype", $_SESSION)) {
$sSetupType = $_SESSION["setuptype"];
} else {
$sSetupType = "";
}
switch ($sSetupType)
{
switch ($sSetupType) {
case "setup":
$this->_sHeader = "Setup - ".$sHeader;
$this->_sHeader = "Setup - " . $sHeader;
break;
case "upgrade":
$this->_sHeader = "Upgrade - ".$sHeader;
$this->_sHeader = "Upgrade - " . $sHeader;
break;
case "migration":
$this->_sHeader = "Migration - ".$sHeader;
$this->_sHeader = "Migration - " . $sHeader;
break;
default:
$this->_sHeader = $sHeader;
break;
}
}
function _createNavigation ()
{
public function _createNavigation() {
$link = new cHTMLLink("#");
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."';");
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bNextstep . "';");
$link->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
$nextSetup = new cHTMLAlphaImage;
@ -93,15 +76,14 @@ class cSetupMask
$link->setContent($nextSetup);
if ($this->_bNextstep != "")
{
if ($this->_bNextstep != "") {
$this->_oStepTemplate->set("s", "NEXT", $link->render());
} else {
$this->_oStepTemplate->set("s", "NEXT", '');
}
$backlink = new cHTMLLink("#");
$backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bBackstep."';");
$backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bBackstep . "';");
$backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
$backSetup = new cHTMLAlphaImage;
@ -111,18 +93,14 @@ class cSetupMask
$backSetup->setStyle("margin-right: 10px");
$backlink->setContent($backSetup);
$this->_oStepTemplate->set("s", "BACK", $backlink->render());
}
function render ()
{
if ($this->_bNavigationEnabled)
{
public function render() {
if ($this->_bNavigationEnabled) {
$this->_createNavigation();
}
if ($this->_iStep !== false)
{
if ($this->_iStep !== false) {
$this->_oTpl->set("s", "STEPS", cGenerateSetupStepsDisplay($this->_iStep));
} else {
$this->_oTpl->set("s", "STEPS", "");
@ -133,7 +111,7 @@ class cSetupMask
$this->_oTpl->set("s", "CONTENT", $this->_oStepTemplate->generate($this->_sStepTemplate, true, false));
$this->_oTpl->generate("templates/setup.tpl",false,false);
$this->_oTpl->generate("templates/setup.tpl", false, false);
}
}
?>

Datei anzeigen

@ -1,16 +1,16 @@
<?php
/**
* Project:
* Contenido Content Management System
* Class Template for setup
*
* Description:
* Contenido Template Engine
*
* Requirements:
* @con_php_req 5
* @con_notice
* Light template mechanism
* @package ConLite
* @subpackage Setup
* @version $Rev: 283 $
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2017, conlite.org
*
* $Id: class.template.php 283 2014-01-09 14:48:38Z oldperl $:
*/
/**
* @package ContenidoBackendArea
* @version 1.2
* @author Jan Lengowski <Jan.Lengowski@4fb.de>
@ -18,47 +18,36 @@
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
*
*
* {@internal
* created unknown
* modified unknown, Stefan Jelner (Optimizations)
* modified 2008-07-07, bilal arslan, added security fix
*
* $Id: class.template.php 283 2014-01-09 14:48:38Z oldperl $:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class Template
{
class Template {
/**
* Needles (static)
* @var array
*/
var $needles = array ();
var $needles = array();
/**
* Replacements (static)
* @var array
*/
var $replacements = array ();
var $replacements = array();
/**
* Dyn_Needles (dynamic)
* @var array
*/
var $Dyn_needles = array ();
var $Dyn_needles = array();
/**
* Dyn_Replacements (dynamic)
* @var array
*/
var $Dyn_replacements = array ();
var $Dyn_replacements = array();
/**
* Database instance
@ -88,25 +77,25 @@ class Template
* Tags array (for dynamic blocks);
* @var array
*/
var $tags = array ('static' => '{%s}', 'start' => '<!-- BEGIN:BLOCK -->', 'end' => '<!-- END:BLOCK -->');
var $tags = array('static' => '{%s}', 'start' => '<!-- BEGIN:BLOCK -->', 'end' => '<!-- END:BLOCK -->');
/**
* Constructor function
* @return void
*/
function Template($tags = false)
{
$this->tplcache = Array ();
$this->tplnamecache = Array ();
public function __construct($tags = false) {
$this->tplcache = Array();
$this->tplnamecache = Array();
if (is_array($tags))
{
if (is_array($tags)) {
$this->tags = $tags;
}
$this->setEncoding("");
$this->setDomain("conlite");
} // end function
}
// end function
/**
* setDomain
@ -116,8 +105,7 @@ class Template
* @param $sDomain string Sets the domain to use for template translations
* @return none
*/
function setDomain ($sDomain)
{
public function setDomain($sDomain) {
$this->_sDomain = $sDomain;
}
@ -133,18 +121,13 @@ class Template
*
* @return void
*/
function set($which = 's', $needle, $replacement)
{
if ($which == 's')
{ // static
public function set($which = 's', $needle, $replacement) {
if ($which == 's') { // static
$this->needles[] = sprintf($this->tags['static'], $needle);
$this->replacements[] = $replacement;
} else
{ // dynamic
} else { // dynamic
$this->Dyn_needles[$this->dyn_cnt][] = sprintf($this->tags['static'], $needle);
$this->Dyn_replacements[$this->dyn_cnt][] = $replacement;
}
}
@ -153,8 +136,7 @@ class Template
*
* @param $encoding string Encoding to set
*/
function setEncoding ($encoding)
{
public function setEncoding($encoding) {
$this->_encoding = $encoding;
}
@ -163,8 +145,7 @@ class Template
*
* @return void
*/
function next()
{
public function next() {
$this->dyn_cnt++;
}
@ -173,13 +154,12 @@ class Template
*
* @return void
*/
function reset()
{
public function reset() {
$this->dyn_cnt = 0;
$this->needles = array ();
$this->replacements = array ();
$this->Dyn_needles = array ();
$this->Dyn_replacements = array ();
$this->needles = array();
$this->replacements = array();
$this->Dyn_needles = array();
$this->Dyn_replacements = array();
}
/**
@ -192,8 +172,7 @@ class Template
*
* @return string complete Template string
*/
function generate($template, $return = 0, $note = 1)
{
public function generate($template, $return = 0, $note = 1) {
global $cfg;
$this->set("s", "TPL_ACT_YEAR", date("Y"));
//check if the template is a file or a string
@ -202,61 +181,57 @@ class Template
else
$content = implode("", file($template)); //template is a file
$content = (($note) ? "<!-- Generated by ConLite ".$cfg['version']."-->\n" : "").$content;
$content = (($note) ? "<!-- Generated by ConLite " . $cfg['version'] . "-->\n" : "") . $content;
$pieces = array();
//if content has dynamic blocks
if (preg_match("/^.*".preg_quote($this->tags['start'], "/").".*?".preg_quote($this->tags['end'], "/").".*$/s", $content))
{
if (preg_match("/^.*" . preg_quote($this->tags['start'], "/") . ".*?" . preg_quote($this->tags['end'], "/") . ".*$/s", $content)) {
//split everything into an array
preg_match_all("/^(.*)".preg_quote($this->tags['start'], "/")."(.*?)".preg_quote($this->tags['end'], "/")."(.*)$/s", $content, $pieces);
preg_match_all("/^(.*)" . preg_quote($this->tags['start'], "/") . "(.*?)" . preg_quote($this->tags['end'], "/") . "(.*)$/s", $content, $pieces);
//safe memory
array_shift($pieces);
$content = "";
//now combine pieces together
//start block
$pieces[0][0] = str_replace($this->needles, $this->replacements, $pieces[0][0]);
$this->replacei18n($pieces[0][0], "i18n");
$this->replacei18n($pieces[0][0], "trans");
$content .= $pieces[0][0];
unset ($pieces[0][0]);
unset($pieces[0][0]);
//generate dynamic blocks
for ($a = 0; $a < $this->dyn_cnt; $a ++)
{
for ($a = 0; $a < $this->dyn_cnt; $a ++) {
$temp = str_replace($this->Dyn_needles[$a], $this->Dyn_replacements[$a], $pieces[1][0]);
$this->replacei18n($temp, "i18n");
$this->replacei18n($temp, "trans");
$content .= $temp;
}
unset ($temp);
unset($temp);
//end block
$pieces[2][0] = str_replace($this->needles, $this->replacements, $pieces[2][0]);
$this->replacei18n($pieces[2][0], "i18n");
$this->replacei18n($pieces[2][0], "trans");
$content .= $pieces[2][0];
unset ($pieces[2][0]);
} else
{
unset($pieces[2][0]);
} else {
$content = str_replace($this->needles, $this->replacements, $content);
$this->replacei18n($content, "i18n");
$this->replacei18n($content, "trans");
}
if ($this->_encoding != "")
{
$content = str_replace("</head>", '<meta http-equiv="Content-Type" content="text/html; charset='.$this->_encoding.'">'."\n".'</head>', $content);
if ($this->_encoding != "") {
$content = str_replace("</head>", '<meta http-equiv="Content-Type" content="text/html; charset=' . $this->_encoding . '">' . "\n" . '</head>', $content);
}
if ($return)
return $content;
else
echo $content;
}
} # end function
# end function
/**
* replacei18n()
@ -266,18 +241,16 @@ class Template
* @param $template string Contents of the template to translate (it is reference to save memory!!!)
* @param $functionName string Name of the translation function (e.g. i18n)
*/
function replacei18n(& $template, $functionName)
{
public function replacei18n(& $template, $functionName) {
$matches = array();
//if template contains functionName + parameter store all matches
preg_match_all("/".preg_quote($functionName, "/")."\\(([\\\"\\'])(.*?)\\1\\)/s", $template, $matches);
preg_match_all("/" . preg_quote($functionName, "/") . "\\(([\\\"\\'])(.*?)\\1\\)/s", $template, $matches);
$matches = array_values(array_unique($matches[2]));
for ($a = 0; $a < count($matches); $a ++)
{
$template = preg_replace("/".preg_quote($functionName, "/")."\\([\\\"\\']".preg_quote($matches[$a], "/")."[\\\"\\']\\)/s", i18n($matches[$a], $this->_sDomain), $template);
for ($a = 0; $a < count($matches); $a ++) {
$template = preg_replace("/" . preg_quote($functionName, "/") . "\\([\\\"\\']" . preg_quote($matches[$a], "/") . "[\\\"\\']\\)/s", i18n($matches[$a], $this->_sDomain), $template);
}
}
} # end class
}
?>

Datei anzeigen

@ -57,5 +57,5 @@ define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png');
define('C_SETUP_STEPWIDTH', 28);
define('C_SETUP_STEPHEIGHT', 28);
define('C_SETUP_MIN_PHP_VERSION', '5.3');
define('C_SETUP_VERSION', '2.0.0RC3');
define('C_SETUP_VERSION', '2.0.1');
?>

Datei anzeigen

@ -43,8 +43,8 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
// Check version
//PHP >= 5.0.0 and < 6.0.0
if (version_compare(PHP_VERSION, '6.0.0', '>=')) {
die("You need PHP >= 5.3.0 < 6.0.0 for ConLite. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
die("You need PHP >= 5.3.0 < 7.2.0 for ConLite. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -41,17 +42,16 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupAdditionalPlugins extends cSetupMask
{
function cSetupAdditionalPlugins ($step, $previous, $next)
{
class cSetupAdditionalPlugins extends cSetupMask {
public function __construct($step, $previous, $next) {
$db = getSetupMySQLDBConnection();
cSetupMask::cSetupMask("templates/setup/forms/additionalplugins.tpl", $step);
parent::__construct("templates/setup/forms/additionalplugins.tpl", $step);
$this->setHeader(i18n_setup("Additional Plugins"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Additional Plugins"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please select Plugins to be installed"));
@ -67,10 +67,10 @@ class cSetupAdditionalPlugins extends cSetupMask
foreach ($aPlugins as $sInternalName => $aPluginData) {
$sChecked = ((isset($_SESSION[$sInternalName]) && strval($_SESSION[$sInternalName]) || checkExistingPlugin($db, $sInternalName)) == 'true') ? ' checked="checked"' : '';
$sCheckBoxes .= '<p class="plugin_select">
<input type="checkbox" class="plugin_checkbox" id="'.$sInternalName.'" name="'.$sInternalName.'" value="true"'.$sChecked.'>
<label for="'.$sInternalName.'">'.$aPluginData['label'].'</label>
<a href="javascript://" onclick="showPluginInfo(\''.$aPluginData['label'].'\', \''.$aPluginData['desc'].'\');">
<img src="../conlite/images/info.gif" alt="'.i18n_setup('More information').'" title="'.i18n_setup('More information').'" class="plugin_info">
<input type="checkbox" class="plugin_checkbox" id="' . $sInternalName . '" name="' . $sInternalName . '" value="true"' . $sChecked . '>
<label for="' . $sInternalName . '">' . $aPluginData['label'] . '</label>
<a href="javascript://" onclick="showPluginInfo(\'' . $aPluginData['label'] . '\', \'' . $aPluginData['desc'] . '\');">
<img src="../conlite/images/info.gif" alt="' . i18n_setup('More information') . '" title="' . i18n_setup('More information') . '" class="plugin_info">
</a>
</p>';
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,26 +28,25 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupClientAdjust extends cSetupMask
{
function cSetupClientAdjust ($step, $previous, $next)
{
class cSetupClientAdjust extends cSetupMask {
public function __construct($step, $previous, $next) {
global $cfg;
$cfg["tab"]["sequence"] = $_SESSION["dbprefix"]."_sequence";
$cfg["tab"]["sequence"] = $_SESSION["dbprefix"] . "_sequence";
cSetupMask::cSetupMask("templates/setup/forms/pathinfo.tpl", $step);
parent::__construct("templates/setup/forms/pathinfo.tpl", $step);
$this->setHeader(i18n_setup("Client Settings"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Client Settings"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("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."));
$db = getSetupMySQLDBConnection();
$aClients = listClients($db, $_SESSION["dbprefix"]."_clients");
$aClients = listClients($db, $_SESSION["dbprefix"] . "_clients");
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
$cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;");
@ -58,15 +58,12 @@ class cSetupClientAdjust extends cSetupMask
@include($a_root_path . "data/config/" . CL_ENVIRONMENT . "/config.php");
foreach ($aClients as $iIdClient => $aInfo)
{
if (!isset($_SESSION["frontendpath"][$iIdClient]) || $_SESSION["frontendpath"][$iIdClient] == "")
{
$iDifferencePos = findSimilarText($cfg['path']['frontend']."/", $aInfo["frontendpath"]);
foreach ($aClients as $iIdClient => $aInfo) {
if (!isset($_SESSION["frontendpath"][$iIdClient]) || $_SESSION["frontendpath"][$iIdClient] == "") {
$iDifferencePos = findSimilarText($cfg['path']['frontend'] . "/", $aInfo["frontendpath"]);
if ($iDifferencePos > 0)
{
$sClientPath = $a_root_path ."/". substr($aInfo["frontendpath"], $iDifferencePos + 1, strlen($aInfo["frontendpath"]) - $iDifferencePos);
if ($iDifferencePos > 0) {
$sClientPath = $a_root_path . "/" . substr($aInfo["frontendpath"], $iDifferencePos + 1, strlen($aInfo["frontendpath"]) - $iDifferencePos);
$_SESSION["frontendpath"][$iIdClient] = $sClientPath;
} else {
@ -74,14 +71,12 @@ class cSetupClientAdjust extends cSetupMask
}
}
if (!isset($_SESSION["htmlpath"][$iIdClient]) || $_SESSION["htmlpath"][$iIdClient] == "")
{
if (!isset($_SESSION["htmlpath"][$iIdClient]) || $_SESSION["htmlpath"][$iIdClient] == "") {
/* Use frontendpath instead of htmlpath as the directories should be aligned pairwhise */
$iDifferencePos = findSimilarText($cfg['path']['frontend']."/", $aInfo["frontendpath"]);
$iDifferencePos = findSimilarText($cfg['path']['frontend'] . "/", $aInfo["frontendpath"]);
if ($iDifferencePos > 0)
{
$sClientPath = $a_root_http_path . "/".substr($aInfo["frontendpath"], $iDifferencePos + 1, strlen($aInfo["frontendpath"]) - $iDifferencePos);
if ($iDifferencePos > 0) {
$sClientPath = $a_root_http_path . "/" . substr($aInfo["frontendpath"], $iDifferencePos + 1, strlen($aInfo["frontendpath"]) - $iDifferencePos);
$_SESSION["htmlpath"][$iIdClient] = $sClientPath;
} else {
@ -90,7 +85,7 @@ class cSetupClientAdjust extends cSetupMask
}
$sName = sprintf(i18n_setup("Old server path for %s (%s)"), $aInfo["name"], $iIdClient);
$sName .= ":<br>" . $aInfo["frontendpath"]."<br><br>";
$sName .= ":<br>" . $aInfo["frontendpath"] . "<br><br>";
$sName .= sprintf(i18n_setup("New server path for %s (%s)"), $aInfo["name"], $iIdClient);
$sName .= ":<br>";
$oSystemPathBox = new cHTMLTextbox("frontendpath[$iIdClient]", $_SESSION["frontendpath"][$iIdClient]);
@ -102,7 +97,7 @@ class cSetupClientAdjust extends cSetupMask
$aPathList[] = $oClientSystemPath;
$sName = sprintf(i18n_setup("Old web path for %s (%s)"), $aInfo["name"], $iIdClient);
$sName .= ":<br>" . $aInfo["htmlpath"]."<br><br>";
$sName .= ":<br>" . $aInfo["htmlpath"] . "<br><br>";
$sName .= sprintf(i18n_setup("New web path for %s (%s)"), $aInfo["name"], $iIdClient);
$sName .= ":<br>";
$oSystemPathBox = new cHTMLTextbox("htmlpath[$iIdClient]", $_SESSION["htmlpath"][$iIdClient]);
@ -122,5 +117,7 @@ class cSetupClientAdjust extends cSetupMask
$this->setNavigation($previous, $next);
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,43 +27,38 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupClientMode extends cSetupMask {
class cSetupClientMode extends cSetupMask
{
function cSetupClientMode ($step, $previous, $next)
{
cSetupMask::cSetupMask("templates/setup/forms/clientmode.tpl", $step);
public function __construct($step, $previous, $next) {
parent::__construct("templates/setup/forms/clientmode.tpl", $step);
$this->setHeader(i18n_setup("Example Client"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Example Client"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("If you are new to ConLite, you should create an example client to start working with."));
cInitializeArrayKey($_SESSION, "clientmode", "");
$aChoices = array( "CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"),
$aChoices = array("CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"),
"CLIENTMODULES" => i18n_setup("Client with example modules, but without example content"),
"CLIENT" => i18n_setup("Client without examples"),
"NOCLIENT" => i18n_setup("Don't create client"));
foreach ($aChoices as $sKey => $sChoice)
{
foreach ($aChoices as $sKey => $sChoice) {
$oRadio = new cHTMLRadiobutton("clientmode", $sKey);
$oRadio->setLabelText(" ");
$oRadio->setStyle('width:auto;border:0;');
if ($_SESSION["clientmode"] == $sKey || ($_SESSION["clientmode"] == "" && $sKey == "CLIENTEXAMPLES"))
{
if ($_SESSION["clientmode"] == $sKey || ($_SESSION["clientmode"] == "" && $sKey == "CLIENTEXAMPLES")) {
$oRadio->setChecked("checked");
}
$oLabel = new cHTMLLabel($sChoice, $oRadio->getId());
$this->_oStepTemplate->set("s", "CONTROL_".$sKey, $oRadio->toHtml(false));
$this->_oStepTemplate->set("s", "LABEL_".$sKey, $oLabel->render());
$this->_oStepTemplate->set("s", "CONTROL_" . $sKey, $oRadio->toHtml(false));
$this->_oStepTemplate->set("s", "LABEL_" . $sKey, $oLabel->render());
}
$this->setNavigation($previous, $next);

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -18,19 +19,17 @@
*
* $Id: configmode.php 279 2013-11-21 14:34:53Z oldperl $:
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupConfigMode extends cSetupMask
{
function cSetupConfigMode ($step, $previous, $next)
{
if ($_SESSION["setuptype"] == "setup")
{
cSetupMask::cSetupMask("templates/setup/forms/configmode.tpl", $step);
class cSetupConfigMode extends cSetupMask {
public function __construct($step, $previous, $next) {
if ($_SESSION["setuptype"] == "setup") {
parent::__construct("templates/setup/forms/configmode.tpl", $step);
} else {
cSetupMask::cSetupMask("templates/setup/forms/configmodewopass.tpl", $step);
parent::__construct("templates/setup/forms/configmodewopass.tpl", $step);
}
$this->setHeader(i18n_setup("config.php mode"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("config.php mode"));
@ -43,8 +42,7 @@ class cSetupConfigMode extends cSetupMask
$oConfigDownload = new cHTMLRadiobutton("configmode", "download");
$oConfigDownload->setStyle('width:auto;border:0;');
if (canWriteFile("../conlite/includes/config.php"))
{
if (canWriteFile("../conlite/includes/config.php")) {
$oConfigSave->setChecked(true);
} else {
$oConfigDownload->setChecked(true);
@ -62,16 +60,14 @@ class cSetupConfigMode extends cSetupMask
$this->setNavigation($previous, $next);
}
function _createNavigation ()
{
public function _createNavigation() {
$link = new cHTMLLink("#");
if ($this->_bNextstep == "doinstall")
{
if ($this->_bNextstep == "doinstall") {
/* Install launcher */
}
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."'; document.setupform.submit();");
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bNextstep . "'; document.setupform.submit();");
$nextSetup = new cHTMLAlphaImage;
$nextSetup->setSrc("../conlite/images/submit.gif");
@ -83,7 +79,7 @@ class cSetupConfigMode extends cSetupMask
$this->_oStepTemplate->set("s", "NEXT", $link->render());
$backlink = new cHTMLLink("#");
$backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bBackstep."';");
$backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bBackstep . "';");
$backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
$backSetup = new cHTMLAlphaImage;
@ -93,8 +89,8 @@ class cSetupConfigMode extends cSetupMask
$backSetup->setStyle("margin-right: 10px");
$backlink->setContent($backSetup);
$this->_oStepTemplate->set("s", "BACK", $backlink->render());
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,25 +27,21 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupInstaller extends cSetupMask {
class cSetupInstaller extends cSetupMask
{
function cSetupInstaller ($step)
{
cSetupMask::cSetupMask("templates/setup/forms/installer.tpl", $step);
public function __construct($step) {
parent::__construct("templates/setup/forms/installer.tpl", $step);
$this->setHeader(i18n_setup("System Installation"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("System Installation"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("ConLite will be installed, please wait ..."));
$this->_oStepTemplate->set("s", "DBUPDATESCRIPT", "dbupdate.php");
switch ($_SESSION["setuptype"])
{
switch ($_SESSION["setuptype"]) {
case "setup":
$this->_oStepTemplate->set("s", "DONEINSTALLATION", i18n_setup("Setup completed installing. Click on next to continue."));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Setup is installing, please wait..."));
@ -64,7 +61,8 @@ class cSetupInstaller extends cSetupMask
$this->setNavigation("", "migration8");
break;
}
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,17 +27,14 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupPath extends cSetupMask {
class cSetupPath extends cSetupMask
{
function cSetupPath ($step, $previous, $next)
{
cSetupMask::cSetupMask("templates/setup/forms/pathinfo.tpl", $step);
public function __construct($step, $previous, $next) {
parent::__construct("templates/setup/forms/pathinfo.tpl", $step);
$this->setHeader(i18n_setup("System Directories"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("System Directories"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please check the directories identified by the system. If you need to change a path, click on the name and enter the new path in the available input box."));
@ -55,9 +53,9 @@ class cSetupPath extends cSetupMask
$oWebPath->setWidth(100);
$oWebPath->setClass("small");
$cHTMLFoldableErrorMessages[0] = new cHTMLFoldableErrorMessage(i18n_setup("ConLite Root Path").":<br>".$root_path, $oRootPath);
$cHTMLFoldableErrorMessages[0] = new cHTMLFoldableErrorMessage(i18n_setup("ConLite Root Path") . ":<br>" . $root_path, $oRootPath);
$cHTMLFoldableErrorMessages[0]->_oContent->setStyle("padding-bottom: 8px;");
$cHTMLFoldableErrorMessages[1] = new cHTMLFoldableErrorMessage(i18n_setup("ConLite Web Path").":<br>".$root_http_path, $oWebPath);
$cHTMLFoldableErrorMessages[1] = new cHTMLFoldableErrorMessage(i18n_setup("ConLite Web Path") . ":<br>" . $root_http_path, $oWebPath);
$cHTMLFoldableErrorMessages[1]->_oContent->setStyle("padding-bottom: 8px;");
$cHTMLErrorMessageList->setContent($cHTMLFoldableErrorMessages);
@ -67,5 +65,7 @@ class cSetupPath extends cSetupMask
$this->setNavigation($previous, $next);
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -13,25 +14,22 @@
*
* $Id: setupresults.php 377 2015-11-09 19:10:37Z oldperl $:
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupResults extends cSetupMask {
class cSetupResults extends cSetupMask
{
function cSetupResults ($step)
{
public function __construct($step) {
$this->setHeader(i18n_setup("Results"));
if (!isset($_SESSION["install_failedchunks"]) && !isset($_SESSION["install_failedupgradetable"]) && !isset($_SESSION["configsavefailed"]))
{
cSetupMask::cSetupMask("templates/setup/forms/setupresults.tpl", $step);
if (!isset($_SESSION["install_failedchunks"]) && !isset($_SESSION["install_failedupgradetable"]) && !isset($_SESSION["configsavefailed"])) {
parent::__construct("templates/setup/forms/setupresults.tpl", $step);
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Results"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("ConLite was installed and configured successfully on your server."));
if ($_SESSION["setuptype"] == 'setup') {
$this->_oStepTemplate->set("s", "LOGIN_INFO", '<p>'.i18n_setup("Please use username <b>sysadmin</b> and password <b>sysadmin</b> to login into ConLite Backend.").'</p>');
$this->_oStepTemplate->set("s", "LOGIN_INFO", '<p>' . i18n_setup("Please use username <b>sysadmin</b> and password <b>sysadmin</b> to login into ConLite Backend.") . '</p>');
} else {
$this->_oStepTemplate->set("s", "LOGIN_INFO", '');
}
@ -43,12 +41,11 @@ class cSetupResults extends cSetupMask
$cHTMLButtonLink = new cHTMLButtonLink($root_http_path."/conlite/", "Backend - CMS");
$cHTMLButtonLink = new cHTMLButtonLink($root_http_path . "/conlite/", "Backend - CMS");
$this->_oStepTemplate->set("s", "BACKEND", $cHTMLButtonLink->render());
if ($_SESSION["setuptype"] == "setup" && $_SESSION["clientmode"] == "CLIENTEXAMPLES")
{
$cHTMLButtonLink = new cHTMLButtonLink($root_http_path."/cms/", "Frontend - Web");
if ($_SESSION["setuptype"] == "setup" && $_SESSION["clientmode"] == "CLIENTEXAMPLES") {
$cHTMLButtonLink = new cHTMLButtonLink($root_http_path . "/cms/", "Frontend - Web");
$this->_oStepTemplate->set("s", "FRONTEND", $cHTMLButtonLink->render());
} else {
$this->_oStepTemplate->set("s", "FRONTEND", "");
@ -59,23 +56,22 @@ class cSetupResults extends cSetupMask
/*
$cHTMLButtonLink = new cHTMLButtonLink("http://forum.contenido.org/", "Contenido Forum");
$this->_oStepTemplate->set("s", "FORUM", $cHTMLButtonLink->render());
$cHTMLButtonLink = new cHTMLButtonLink("http://faq.contenido.org/", "Contenido FAQ");
$this->_oStepTemplate->set("s", "FAQ", $cHTMLButtonLink->render());
*
*/
$this->_oStepTemplate->set("s", "FORUM", '');
$this->_oStepTemplate->set("s", "FAQ", '');
$cHTMLButtonLink = new cHTMLButtonLink("https://faq.conlite.org/", "ConLite FAQ");
$this->_oStepTemplate->set("s", "FAQ", $cHTMLButtonLink->render());
} else {
cSetupMask::cSetupMask("templates/setup/forms/setupresultsfail.tpl", $step);
parent::__construct("templates/setup/forms/setupresultsfail.tpl", $step);
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Setup Results"));
list($sRootPath, $rootWebPath) = getSystemDirectories();
if (file_exists($sRootPath . "/data/logs/setuplog.txt"))
{
if (file_exists($sRootPath . "/data/logs/setuplog.txt")) {
$sErrorLink = '<a target="_blank" href="../data/logs/setuplog.txt">setuplog.txt</a>';
} else {
$sErrorLink = 'setuplog.txt';
@ -83,8 +79,7 @@ class cSetupResults extends cSetupMask
$this->_oStepTemplate->set("s", "DESCRIPTION", sprintf(i18n_setup("An error occured during installation. Please take a look at the file %s (located in &quot;data/logs/&quot;) for more information."), $sErrorLink));
switch ($_SESSION["setuptype"])
{
switch ($_SESSION["setuptype"]) {
case "setup":
$this->setNavigation("setup1", "");
break;
@ -97,5 +92,7 @@ class cSetupResults extends cSetupMask
}
}
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,25 +27,21 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupSetupSummary extends cSetupMask {
class cSetupSetupSummary extends cSetupMask
{
function cSetupSetupSummary ($step, $previous, $next)
{
cSetupMask::cSetupMask("templates/setup/forms/setupsummary.tpl", $step);
public function __construct($step, $previous, $next) {
parent::__construct("templates/setup/forms/setupsummary.tpl", $step);
$this->setHeader(i18n_setup("Summary"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Summary"));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please check your settings and click on the next button to start the installation"));
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
switch ($_SESSION["setuptype"])
{
switch ($_SESSION["setuptype"]) {
case "setup":
$sType = i18n_setup("Setup");
break;
@ -56,8 +53,7 @@ class cSetupSetupSummary extends cSetupMask
break;
}
switch ($_SESSION["configmode"])
{
switch ($_SESSION["configmode"]) {
case "save":
$sConfigMode = i18n_setup("Save");
break;
@ -67,29 +63,28 @@ class cSetupSetupSummary extends cSetupMask
}
$messages = array(
i18n_setup("Installation type").":" => $sType,
i18n_setup("Database parameters").":" => i18n_setup("Database host").": ".$_SESSION["dbhost"] . "<br>" . i18n_setup("Database name").": ".$_SESSION["dbname"] ."<br>".i18n_setup("Database username").": " . $_SESSION["dbuser"]. "<br>".i18n_setup("Database prefix").": ".$_SESSION["dbprefix"],
i18n_setup("Installation type") . ":" => $sType,
i18n_setup("Database parameters") . ":" => i18n_setup("Database host") . ": " . $_SESSION["dbhost"] . "<br>" . i18n_setup("Database name") . ": " . $_SESSION["dbname"] . "<br>" . i18n_setup("Database username") . ": " . $_SESSION["dbuser"] . "<br>" . i18n_setup("Database prefix") . ": " . $_SESSION["dbprefix"],
);
if ($_SESSION["setuptype"] == "setup")
{
$aChoices = array( "CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"),
if ($_SESSION["setuptype"] == "setup") {
$aChoices = array("CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"),
"CLIENTMODULES" => i18n_setup("Client with example modules but without example content"),
"CLIENT" => i18n_setup("Client without examples"),
"NOCLIENT" => i18n_setup("Don't create a client"));
$messages[i18n_setup("Client installation").":"] = $aChoices[$_SESSION["clientmode"]];
$messages[i18n_setup("Client installation") . ":"] = $aChoices[$_SESSION["clientmode"]];
}
// additional plugins
$aPlugins = $this->_getSelectedAdditionalPlugins();
if (count($aPlugins) > 0) {
$messages[i18n_setup("Additional Plugins").":"] = implode('<br>', $aPlugins);;
$messages[i18n_setup("Additional Plugins") . ":"] = implode('<br>', $aPlugins);
;
}
$cHTMLFoldableErrorMessages = array();
foreach ($messages as $key => $message)
{
foreach ($messages as $key => $message) {
$cHTMLFoldableErrorMessages[] = new cHTMLInfoMessage($key, $message);
}
@ -100,8 +95,7 @@ class cSetupSetupSummary extends cSetupMask
$this->setNavigation($previous, $next);
}
function _getSelectedAdditionalPlugins()
{
public function _getSelectedAdditionalPlugins() {
$aPlugins = array();
if ($_SESSION['plugin_newsletter'] == 'true') {
$aPlugins[] = i18n_setup('Newsletter');
@ -114,6 +108,7 @@ class cSetupSetupSummary extends cSetupMask
}
return $aPlugins;
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,17 +27,14 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cSetupSystemData extends cSetupMask {
class cSetupSystemData extends cSetupMask
{
function cSetupSystemData ($step, $previous, $next)
{
cSetupMask::cSetupMask("templates/setup/forms/systemdata.tpl", $step);
public function __construct($step, $previous, $next) {
parent::__construct("templates/setup/forms/systemdata.tpl", $step);
list($a_root_path, $a_root_http_path) = getSystemDirectories();
@ -46,7 +44,7 @@ class cSetupSystemData extends cSetupMask
cInitializeArrayKey($_SESSION, "dbname", "");
cInitializeArrayKey($_SESSION, "dbpass", "");
if(file_exists($a_root_path."/conlite/includes/config.php") || file_exists($a_root_path."/data/config/".CL_ENVIRONMENT."/config.php")) {
if (file_exists($a_root_path . "/conlite/includes/config.php") || file_exists($a_root_path . "/data/config/" . CL_ENVIRONMENT . "/config.php")) {
global $cfg; // Avoiding error message about "prepend3.php" on update from V4.x
$contenido_host = ""; // Just define the variables to avoid warnings in IDE
@ -54,35 +52,31 @@ class cSetupSystemData extends cSetupMask
$contenido_database = "";
$contenido_password = "";
if(file_exists($a_root_path."/conlite/includes/config.php")) {
@include($a_root_path."/conlite/includes/config.php");
if (file_exists($a_root_path . "/conlite/includes/config.php")) {
@include($a_root_path . "/conlite/includes/config.php");
} else {
@include($a_root_path."/data/config/".CL_ENVIRONMENT."/config.php");
@include($a_root_path . "/data/config/" . CL_ENVIRONMENT . "/config.php");
}
$aVars = array( "dbhost" => $contenido_host,
$aVars = array("dbhost" => $contenido_host,
"dbuser" => $contenido_user,
"dbname" => $contenido_database,
"dbpass" => $contenido_password,
"dbprefix" => $cfg["sql"]["sqlprefix"]);
foreach ($aVars as $aVar => $sValue)
{
if ($_SESSION[$aVar] == "")
{
foreach ($aVars as $aVar => $sValue) {
if ($_SESSION[$aVar] == "") {
$_SESSION[$aVar] = $sValue;
}
}
}
$this->setHeader(i18n_setup("Database Parameters"));
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("Database Parameters"));
switch ($_SESSION["setuptype"])
{
switch ($_SESSION["setuptype"]) {
case "setup":
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please enter the required database information. If you are unsure about the data, ask your provider or administrator.").i18n_setup("If the database does not exist and your database user has the sufficient permissions, setup will create the database automatically."));
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please enter the required database information. If you are unsure about the data, ask your provider or administrator.") . i18n_setup("If the database does not exist and your database user has the sufficient permissions, setup will create the database automatically."));
break;
case "upgrade":
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please enter the required database information. If the database data of your previous installation could have been read, the data will be inserted automatically. If you are unsure about the data, please ask your provider or administrator."));
@ -92,8 +86,7 @@ class cSetupSystemData extends cSetupMask
break;
}
if ($_SESSION["dbprefix"] == "")
{
if ($_SESSION["dbprefix"] == "") {
$_SESSION["dbprefix"] = "cl";
}
@ -107,8 +100,7 @@ class cSetupSystemData extends cSetupMask
$dbname = new cHTMLTextbox("dbname", $_SESSION["dbname"], 30, 255);
$dbuser = new cHTMLTextbox("dbuser", $_SESSION["dbuser"], 30, 255);
if ($_SESSION["dbpass"] != "")
{
if ($_SESSION["dbpass"] != "") {
$mpass = str_repeat("*", strlen($_SESSION["dbpass"]));
} else {
$mpass = "";
@ -126,9 +118,8 @@ class cSetupSystemData extends cSetupMask
$this->_oStepTemplate->set("s", "LABEL_DBHOST", i18n_setup("Database Server (IP or name)"));
if ($_SESSION["setuptype"] == "setup")
{
$this->_oStepTemplate->set("s", "LABEL_DBNAME", i18n_setup("Database Name")."<br>".i18n_setup("(use empty or non-existant database)"));
if ($_SESSION["setuptype"] == "setup") {
$this->_oStepTemplate->set("s", "LABEL_DBNAME", i18n_setup("Database Name") . "<br>" . i18n_setup("(use empty or non-existant database)"));
} else {
$this->_oStepTemplate->set("s", "LABEL_DBNAME", i18n_setup("Database Name"));
}
@ -141,26 +132,21 @@ class cSetupSystemData extends cSetupMask
$this->_oStepTemplate->set("s", "INPUT_DBHOST", $dbhost->render());
$this->_oStepTemplate->set("s", "INPUT_DBNAME", $dbname->render());
$this->_oStepTemplate->set("s", "INPUT_DBUSERNAME", $dbuser->render());
$this->_oStepTemplate->set("s", "INPUT_DBPASSWORD", $dbpass->render().$dbpass_hidden->render());
$this->_oStepTemplate->set("s", "INPUT_DBPASSWORD", $dbpass->render() . $dbpass_hidden->render());
$this->_oStepTemplate->set("s", "INPUT_DBPREFIX", $dbprefix->render());
$this->setNavigation($previous, $next);
}
function _createNavigation ()
{
public function _createNavigation() {
$link = new cHTMLLink("#");
if ($_SESSION["setuptype"] == "setup")
{
$checkScript = sprintf('var msg = ""; if (document.setupform.dbhost.value == "") { msg += "%s "; } if (document.setupform.dbname.value == "") { msg += "%s "; } if (document.setupform.dbuser.value == "") { msg += "%s "; } if (document.setupform.dbhost.value != "" && document.setupform.dbname.value != "" && document.setupform.dbuser.value != "") { document.setupform.submit(); } else { alert(msg); }',
i18n_setup("You need to enter a database host."),
i18n_setup("You need to enter a database name."),
i18n_setup("You need to enter a database user."));
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."';");
if ($_SESSION["setuptype"] == "setup") {
$checkScript = sprintf('var msg = ""; if (document.setupform.dbhost.value == "") { msg += "%s "; } if (document.setupform.dbname.value == "") { msg += "%s "; } if (document.setupform.dbuser.value == "") { msg += "%s "; } if (document.setupform.dbhost.value != "" && document.setupform.dbname.value != "" && document.setupform.dbuser.value != "") { document.setupform.submit(); } else { alert(msg); }', i18n_setup("You need to enter a database host."), i18n_setup("You need to enter a database name."), i18n_setup("You need to enter a database user."));
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bNextstep . "';");
$link->attachEventDefinition("submitAttach", "onclick", "$checkScript");
} else {
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."'; document.setupform.submit();");
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bNextstep . "'; document.setupform.submit();");
}
$nextSetup = new cHTMLAlphaImage;
@ -173,7 +159,7 @@ class cSetupSystemData extends cSetupMask
$this->_oStepTemplate->set("s", "NEXT", $link->render());
$backlink = new cHTMLLink("#");
$backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bBackstep."';");
$backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bBackstep . "';");
$backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
$backSetup = new cHTMLAlphaImage;
@ -183,10 +169,8 @@ class cSetupSystemData extends cSetupMask
$backSetup->setStyle("margin-right: 10px");
$backlink->setContent($backSetup);
$this->_oStepTemplate->set("s", "BACK", $backlink->render());
}
}
?>

Datei anzeigen

@ -24,8 +24,8 @@ define("C_SEVERITY_ERROR", 4);
class cSetupSystemtest extends cSetupMask {
function cSetupSystemtest($step, $previous, $next) {
cSetupMask::cSetupMask("templates/setup/forms/systemtest.tpl", $step);
public function __construct($step, $previous, $next) {
parent::__construct("templates/setup/forms/systemtest.tpl", $step);
$bErrors = false;
$this->setHeader(i18n_setup("System Test"));
@ -94,7 +94,7 @@ class cSetupSystemtest extends cSetupMask {
}
}
function doExistingOldPluginTests() {
public function doExistingOldPluginTests() {
$db = getSetupMySQLDBConnection(false);
$sMessage = '';
@ -157,7 +157,7 @@ class cSetupSystemtest extends cSetupMask {
}
}
function runTest($mResult, $iSeverity, $sHeadline = "", $sErrorMessage = "") {
public function runTest($mResult, $iSeverity, $sHeadline = "", $sErrorMessage = "") {
/**
* @todo: Store results into an external file
*/
@ -166,7 +166,7 @@ class cSetupSystemtest extends cSetupMask {
}
}
function doPHPTests() {
public function doPHPTests() {
#new demo client requires PHP5
if (!version_compare(phpversion(), "5.2.0", ">=") && $_SESSION["setuptype"] == 'setup') {
$this->runTest(false, C_SEVERITY_WARNING, i18n_setup('ConLite demo client requires PHP 5.2 or higher'), i18n_setup('The ConLite demo client requires PHP 5.2 or higher. If you want to install the demo client, please update your PHP version.')
@ -245,7 +245,7 @@ class cSetupSystemtest extends cSetupMask {
*/
}
function doGDTests() {
public function doGDTests() {
$this->runTest(function_exists("imagecreatefromgif"), C_SEVERITY_INFO, i18n_setup("GD-Library GIF read support missing"), i18n_setup("Your GD version doesn't support reading GIF files. This might cause problems with some modules."));
$this->runTest(function_exists("imagegif"), C_SEVERITY_INFO, i18n_setup("GD-Library GIF write support missing"), i18n_setup("Your GD version doesn't support writing GIF files. This might cause problems with some modules."));
@ -259,7 +259,7 @@ class cSetupSystemtest extends cSetupMask {
$this->runTest(function_exists("imagepng"), C_SEVERITY_INFO, i18n_setup("GD-Library PNG write support missing"), i18n_setup("Your GD version doesn't support writing PNG files. This might cause problems with some modules."));
}
function doMySQLTests() {
public function doMySQLTests() {
list($handle, $status) = doMySQLConnect($_SESSION["dbhost"], $_SESSION["dbuser"], $_SESSION["dbpass"]);
@ -445,7 +445,7 @@ class cSetupSystemtest extends cSetupMask {
}
}
function doFileSystemTests() {
public function doFileSystemTests() {
// old logs
if ($_SESSION["setuptype"] != "setup") {
// old folders
@ -500,7 +500,7 @@ class cSetupSystemtest extends cSetupMask {
}
}
function logFilePrediction($sFile, $iSeverity = C_SEVERITY_WARNING) {
public function logFilePrediction($sFile, $iSeverity = C_SEVERITY_WARNING) {
$status = canWriteFile("../" . $sFile);
$sTitle = sprintf(i18n_setup("Can't write %s"), $sFile);
$sMessage = sprintf(i18n_setup("Setup or ConLite can't write to the file %s. Please change the file permissions to correct this problem."), $sFile);

Datei anzeigen

@ -1,5 +1,6 @@
<?php
/**
/**
* Project:
* Contenido Content Management System
*
@ -26,7 +27,7 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -34,12 +35,11 @@
session_unset();
class cSetupLanguageChooser extends cSetupMask
{
function cSetupLanguageChooser ()
{
cSetupMask::cSetupMask("templates/languagechooser.tpl");
$this->setHeader('Version '.C_SETUP_VERSION);
class cSetupLanguageChooser extends cSetupMask {
public function __construct() {
parent::__construct("templates/languagechooser.tpl");
$this->setHeader('Version ' . C_SETUP_VERSION);
$this->_oStepTemplate->set("s", "DE_HINT", "Diese Anwendung hilft Ihnen bei der Installation.");
$this->_oStepTemplate->set("s", "EN_HINT", "This application will guide you trough the setup process.");
$this->_oStepTemplate->set("s", "DE_HINT_LANG", "W&auml;hlen Sie bitte die gew&uuml;nschte Sprache f&uuml;r das Setup aus.");
@ -49,18 +49,16 @@ class cSetupLanguageChooser extends cSetupMask
$m = "";
foreach ($langs as $entity => $lang)
{
foreach ($langs as $entity => $lang) {
$test = new cHTMLLanguageLink($entity, $lang, "setuptype");
$m .= $test->render();
}
$this->_oStepTemplate->set("s", "LANGUAGECHOOSER", $m);
}
}
$cSetupStep1 = new cSetupLanguageChooser;
$cSetupStep1->render();
?>

Datei anzeigen

@ -1,5 +1,6 @@
<?php
/**
/**
* Project:
* Contenido Content Management System
*
@ -15,7 +16,6 @@
*
* $Id: notinstallable.php 137 2012-10-02 12:00:00Z oldperl $:
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -23,12 +23,10 @@ if (!defined('CON_FRAMEWORK')) {
session_unset();
class cSetupNotInstallable extends cSetupMask
{
class cSetupNotInstallable extends cSetupMask {
function cSetupNotInstallable ($sReason)
{
cSetupMask::cSetupMask("templates/notinstallable.tpl");
public function __construct($sReason) {
parent::__construct("templates/notinstallable.tpl");
$this->setHeader("Contenido Version " . C_SETUP_VERSION);
$this->_oStepTemplate->set("s", "TITLE", "Willkommen zu dem Setup von ConLite / Welcome to the ConLite Setup");
$this->_oStepTemplate->set("s", "ERRORTEXT", "Setup nicht ausf&uuml;hrbar / Setup not runnable");
@ -43,6 +41,7 @@ class cSetupNotInstallable extends cSetupMask
$this->_oStepTemplate->set("s", "REASONTEXT", "Reason unknown");
}
}
}
global $sNotInstallableReason;
@ -51,5 +50,4 @@ $cNotInstallable = new cSetupNotInstallable($sNotInstallableReason);
$cNotInstallable->render();
die();
?>

Datei anzeigen

@ -1,5 +1,6 @@
<?php
/**
/**
* Project:
* Contenido Content Management System
*
@ -13,30 +14,29 @@
*
* $Id: setuptype.php 279 2013-11-21 14:34:53Z oldperl $:
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
unset($_SESSION["setuptype"]);
class cSetupTypeChooser extends cSetupMask
{
function cSetupTypeChooser ()
{
cSetupMask::cSetupMask("templates/setuptype.tpl");
class cSetupTypeChooser extends cSetupMask {
public function __construct() {
parent::__construct("templates/setuptype.tpl");
$this->setHeader(i18n_setup("Please choose your setup type"));
$this->_oStepTemplate->set("s", "TITLE_SETUP", i18n_setup("Install new version"));
$this->_oStepTemplate->set("s", "VERSION_SETUP", sprintf(i18n_setup("Version %s"), C_SETUP_VERSION));
$this->_oStepTemplate->set("s", "DESCRIPTION_SETUP", sprintf(i18n_setup("This setup type will install %s."), C_SETUP_VERSION)."<br><br>".i18n_setup("Please choose this type if you want to start with an empty or an example installation.")."<br><br>".i18n_setup("Recommended for new projects."));
$this->_oStepTemplate->set("s", "DESCRIPTION_SETUP", sprintf(i18n_setup("This setup type will install %s."), C_SETUP_VERSION) . "<br><br>" . i18n_setup("Please choose this type if you want to start with an empty or an example installation.") . "<br><br>" . i18n_setup("Recommended for new projects."));
$this->_oStepTemplate->set("s", "TITLE_UPGRADE", i18n_setup("Upgrade existing installation"));
$this->_oStepTemplate->set("s", "VERSION_UPGRADE", sprintf(i18n_setup("Upgrade to %s"), C_SETUP_VERSION));
$this->_oStepTemplate->set("s", "DESCRIPTION_UPGRADE", i18n_setup("This setup type will upgrade your existing installation (ConLite 1.0.x/Contenido 4.6.x or later required).")."<br><br>".i18n_setup("Recommended for existing projects."));
$this->_oStepTemplate->set("s", "DESCRIPTION_UPGRADE", i18n_setup("This setup type will upgrade your existing installation (ConLite 1.0.x/Contenido 4.6.x or later required).") . "<br><br>" . i18n_setup("Recommended for existing projects."));
$this->_oStepTemplate->set("s", "TITLE_MIGRATION", i18n_setup("Migrate existing installation"));
$this->_oStepTemplate->set("s", "VERSION_MIGRATION", sprintf(i18n_setup("Migrate (Version %s)"), C_SETUP_VERSION));
$this->_oStepTemplate->set("s", "DESCRIPTION_MIGRATION", i18n_setup("This setup type will help you migrating an existing installation to another server.")."<br><br>".i18n_setup("Recommended for moving projects across servers."));
$this->_oStepTemplate->set("s", "DESCRIPTION_MIGRATION", i18n_setup("This setup type will help you migrating an existing installation to another server.") . "<br><br>" . i18n_setup("Recommended for moving projects across servers."));
$link = new cHTMLLink("#");
@ -87,6 +87,7 @@ class cSetupTypeChooser extends cSetupMask
}
}
$cSetupStep1 = new cSetupTypeChooser;
$cSetupStep1->render();
?>