fixes for PHP 7

Dieser Commit ist enthalten in:
Oldperl 2017-01-13 12:45:12 +00:00
Ursprung 0a54ff7ec8
Commit 0e0b093b26
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')) {
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,24 +34,20 @@ 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;
break;
@ -74,13 +61,9 @@ class cSetupMask
$this->_sHeader = $sHeader;
break;
}
}
function _createNavigation ()
{
public function _createNavigation() {
$link = new cHTMLLink("#");
$link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '" . $this->_bNextstep . "';");
@ -93,8 +76,7 @@ class cSetupMask
$link->setContent($nextSetup);
if ($this->_bNextstep != "")
{
if ($this->_bNextstep != "") {
$this->_oStepTemplate->set("s", "NEXT", $link->render());
} else {
$this->_oStepTemplate->set("s", "NEXT", '');
@ -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", "");

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,24 +18,13 @@
* @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')) {
die('Illegal call');
}
class Template
{
class Template {
/**
* Needles (static)
* @var array
@ -94,19 +83,19 @@ class Template
* Constructor function
* @return void
*/
function Template($tags = false)
{
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,8 +154,7 @@ class Template
*
* @return void
*/
function reset()
{
public function reset() {
$this->dyn_cnt = 0;
$this->needles = array();
$this->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
@ -207,15 +186,13 @@ class Template
$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);
//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");
@ -224,8 +201,7 @@ class Template
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");
@ -239,15 +215,13 @@ class Template
$this->replacei18n($pieces[2][0], "trans");
$content .= $pieces[2][0];
unset($pieces[2][0]);
} else
{
} else {
$content = str_replace($this->needles, $this->replacements, $content);
$this->replacei18n($content, "i18n");
$this->replacei18n($content, "trans");
}
if ($this->_encoding != "")
{
if ($this->_encoding != "") {
$content = str_replace("</head>", '<meta http-equiv="Content-Type" content="text/html; charset=' . $this->_encoding . '">' . "\n" . '</head>', $content);
}
@ -255,8 +229,9 @@ class Template
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);
$matches = array_values(array_unique($matches[2]));
for ($a = 0; $a < count($matches); $a ++)
{
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
@ -45,13 +46,12 @@
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"));

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -31,15 +32,14 @@
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";
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."));
@ -58,14 +58,11 @@ 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] == "")
{
foreach ($aClients as $iIdClient => $aInfo) {
if (!isset($_SESSION["frontendpath"][$iIdClient]) || $_SESSION["frontendpath"][$iIdClient] == "") {
$iDifferencePos = findSimilarText($cfg['path']['frontend'] . "/", $aInfo["frontendpath"]);
if ($iDifferencePos > 0)
{
if ($iDifferencePos > 0) {
$sClientPath = $a_root_path . "/" . substr($aInfo["frontendpath"], $iDifferencePos + 1, strlen($aInfo["frontendpath"]) - $iDifferencePos);
$_SESSION["frontendpath"][$iIdClient] = $sClientPath;
@ -74,13 +71,11 @@ 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"]);
if ($iDifferencePos > 0)
{
if ($iDifferencePos > 0) {
$sClientPath = $a_root_http_path . "/" . substr($aInfo["frontendpath"], $iDifferencePos + 1, strlen($aInfo["frontendpath"]) - $iDifferencePos);
$_SESSION["htmlpath"][$iIdClient] = $sClientPath;
@ -122,5 +117,7 @@ class cSetupClientAdjust extends cSetupMask
$this->setNavigation($previous, $next);
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -30,13 +31,10 @@
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."));
@ -48,14 +46,12 @@ class cSetupClientMode extends cSetupMask
"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");
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -22,15 +23,13 @@
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,12 +60,10 @@ 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 */
}
@ -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
@ -30,21 +31,17 @@
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
@ -30,13 +31,10 @@
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."));
@ -67,5 +65,7 @@ class cSetupPath extends cSetupMask
$this->setNavigation($previous, $next);
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -17,17 +18,14 @@
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') {
@ -46,8 +44,7 @@ class cSetupResults extends cSetupMask
$cHTMLButtonLink = new cHTMLButtonLink($root_http_path . "/conlite/", "Backend - CMS");
$this->_oStepTemplate->set("s", "BACKEND", $cHTMLButtonLink->render());
if ($_SESSION["setuptype"] == "setup" && $_SESSION["clientmode"] == "CLIENTEXAMPLES")
{
if ($_SESSION["setuptype"] == "setup" && $_SESSION["clientmode"] == "CLIENTEXAMPLES") {
$cHTMLButtonLink = new cHTMLButtonLink($root_http_path . "/cms/", "Frontend - Web");
$this->_oStepTemplate->set("s", "FRONTEND", $cHTMLButtonLink->render());
} else {
@ -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
@ -30,21 +31,17 @@
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;
@ -71,8 +67,7 @@ class cSetupSetupSummary extends cSetupMask
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")
{
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"),
@ -83,13 +78,13 @@ class cSetupSetupSummary extends cSetupMask
// 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
@ -30,13 +31,10 @@
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();
@ -66,21 +64,17 @@ class cSetupSystemData extends cSetupMask
"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."));
break;
@ -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,8 +118,7 @@ class cSetupSystemData extends cSetupMask
$this->_oStepTemplate->set("s", "LABEL_DBHOST", i18n_setup("Database Server (IP or name)"));
if ($_SESSION["setuptype"] == "setup")
{
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"));
@ -147,16 +138,11 @@ class cSetupSystemData extends cSetupMask
$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."));
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 {
@ -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,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -34,11 +35,10 @@
session_unset();
class cSetupLanguageChooser extends cSetupMask
{
function cSetupLanguageChooser ()
{
cSetupMask::cSetupMask("templates/languagechooser.tpl");
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.");
@ -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,4 +1,5 @@
<?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,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -20,11 +21,10 @@
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));
@ -87,6 +87,7 @@ class cSetupTypeChooser extends cSetupMask
}
}
$cSetupStep1 = new cSetupTypeChooser;
$cSetupStep1->render();
?>