Merge branch 'develop' of https://oldperl@gitport.de/ConLite/ConLite.git into develop
Conflicts: .gitignore setup/lib/defines.php setup/lib/startup.php
Dieser Commit ist enthalten in:
Commit
b3e921255c
|
@ -4,8 +4,8 @@
|
||||||
/conlite/plugins/pluginmanager/_src/
|
/conlite/plugins/pluginmanager/_src/
|
||||||
/.project
|
/.project
|
||||||
/_api/
|
/_api/
|
||||||
|
/cl-releasetool/
|
||||||
/data/cache/edit_area_full_with_plugins.gz
|
/data/cache/edit_area_full_with_plugins.gz
|
||||||
/data/cache/edit_area_full_with_plugins.js
|
/data/cache/edit_area_full_with_plugins.js
|
||||||
/data/config/production/config.local.php
|
/data/config/production/config.local.php
|
||||||
/cms/data/modules/up-download/
|
/cms/data/modules/up-download/
|
||||||
/cl-releasetool/
|
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
################################################################################
|
||||||
|
# ConLite AMR plugin simple rewrite rules set.
|
||||||
|
#
|
||||||
|
# Contains few easy to handle rewrite rules.
|
||||||
|
#
|
||||||
|
# @version 1.0.0
|
||||||
|
# @author Ortwin Pinke <ortwin.pinke@php-backoffice.de>
|
||||||
|
# @author Murat Purc <murat@purc.de>
|
||||||
|
# @copyright 2019 ConLite Team
|
||||||
|
# @link http://www.conlite.org
|
||||||
|
#
|
||||||
|
# Versions before 1.0 copyright 4fb, author Murat Purc
|
||||||
|
#
|
||||||
|
# $Id: htaccess_simple.txt 145 2019-10-25 16:00:47Z oldperl $
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
#SetEnv CONLITE_ENVIRONMENT development
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
|
||||||
|
# Enable rewrite engine
|
||||||
|
RewriteEngine on
|
||||||
|
|
||||||
|
# Specify a base URL-path for the rules
|
||||||
|
RewriteBase /cms
|
||||||
|
|
||||||
|
# Catch some common exploits in query string to get rid of them
|
||||||
|
# NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could
|
||||||
|
# be a disadvantage in some cases
|
||||||
|
RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR]
|
||||||
|
RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR]
|
||||||
|
RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR]
|
||||||
|
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
|
||||||
|
RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR]
|
||||||
|
RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC]
|
||||||
|
RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana
|
||||||
|
|
||||||
|
# Rewrite request to root to front_content.php
|
||||||
|
RewriteRule ^$ front_content.php [QSA,L]
|
||||||
|
|
||||||
|
# Exclude following request from rewriting
|
||||||
|
# tests for favicon.ico, valid symlinks (-s), not empty files (-l) and folders (-d)
|
||||||
|
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
RewriteRule ^.*$ - [NC,L]
|
||||||
|
|
||||||
|
# Pass other requests to front_content.php
|
||||||
|
RewriteRule ^.*$ front_content.php [QSA,NC,L]
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Some rules to compress files.
|
||||||
|
# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate
|
||||||
|
# for some file types can help to reduce bandwith.
|
||||||
|
<IfModule mod_deflate.c>
|
||||||
|
<FilesMatch "\.(js|css|html|htm|php|xml)$">
|
||||||
|
SetOutputFilter DEFLATE
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project:
|
* Project:
|
||||||
* Contenido Content Management System
|
* Contenido Content Management System
|
||||||
|
@ -26,548 +27,504 @@
|
||||||
*
|
*
|
||||||
* $Id$:
|
* $Id$:
|
||||||
*/
|
*/
|
||||||
|
if (!defined('CON_FRAMEWORK')) {
|
||||||
if(!defined('CON_FRAMEWORK')) {
|
die('Illegal call');
|
||||||
die('Illegal call');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select box with additional functions for category and article selection
|
// Select box with additional functions for category and article selection
|
||||||
class cHTMLInputSelectElement extends cHTMLSelectElement
|
class cHTMLInputSelectElement extends cHTMLSelectElement {
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Constructor. Creates an HTML select field (aka "DropDown").
|
|
||||||
*
|
|
||||||
* @param string $sName Name of the element
|
|
||||||
* @param int $iWidth Width of the select element
|
|
||||||
* @param string $sID ID of the element
|
|
||||||
* @param string $bDisabled Item disabled flag (non-empty to set disabled)
|
|
||||||
* @param int $iTabIndex Tab index for form elements
|
|
||||||
* @param string $sAccesskey Key to access the field
|
|
||||||
*
|
|
||||||
* @return none
|
|
||||||
**/
|
|
||||||
function __construct ($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "")
|
|
||||||
{
|
|
||||||
cHTMLSelectElement :: __construct($sName, $iWidth, $sID, $bDisabled, $iTabIndex, $sAccessKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Creates an HTML select field (aka "DropDown").
|
||||||
|
*
|
||||||
|
* @param string $sName Name of the element
|
||||||
|
* @param int $iWidth Width of the select element
|
||||||
|
* @param string $sID ID of the element
|
||||||
|
* @param string $bDisabled Item disabled flag (non-empty to set disabled)
|
||||||
|
* @param int $iTabIndex Tab index for form elements
|
||||||
|
* @param string $sAccesskey Key to access the field
|
||||||
|
*
|
||||||
|
* @return none
|
||||||
|
* */
|
||||||
|
function __construct($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "") {
|
||||||
|
cHTMLSelectElement :: __construct($sName, $iWidth, $sID, $bDisabled, $iTabIndex, $sAccessKey);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addArticles. Adds articles to select box values.
|
* Function addArticles. Adds articles to select box values.
|
||||||
*
|
*
|
||||||
* @param int $iIDCat idcat of the category to be listed
|
* @param int $iIDCat idcat of the category to be listed
|
||||||
* @param bool $bColored Add color information to option elements
|
* @param bool $bColored Add color information to option elements
|
||||||
* @param bool $bArtOnline If true, only online articles will be added
|
* @param bool $bArtOnline If true, only online articles will be added
|
||||||
* @param string $sSpaces Just some " " to show data hierarchically (used in conjunction with addCategories)
|
* @param string $sSpaces Just some " " to show data hierarchically (used in conjunction with addCategories)
|
||||||
*
|
*
|
||||||
* @return int Number of items added
|
* @return int Number of items added
|
||||||
**/
|
* */
|
||||||
function addArticles ($iIDCat, $bColored = false, $bArtOnline = true, $sSpaces = "")
|
function addArticles($iIDCat, $bColored = false, $bArtOnline = true, $sSpaces = "") {
|
||||||
{
|
global $cfg, $lang;
|
||||||
global $cfg, $lang;
|
|
||||||
|
|
||||||
$oDB = new DB_Contenido;
|
$oDB = new DB_Contenido;
|
||||||
|
|
||||||
if (is_numeric($iIDCat) && $iIDCat > 0)
|
if (is_numeric($iIDCat) && $iIDCat > 0) {
|
||||||
{
|
$sSQL = "SELECT tblArtLang.title AS title, tblArtLang.idartlang AS idartlang, tblCatArt.idcat AS idcat, ";
|
||||||
$sSQL = "SELECT tblArtLang.title AS title, tblArtLang.idartlang AS idartlang, tblCatArt.idcat AS idcat, ";
|
$sSQL .= "tblCatArt.idcatart AS idcatart, tblCatArt.is_start AS isstart, tblArtLang.online AS online, ";
|
||||||
$sSQL .= "tblCatArt.idcatart AS idcatart, tblCatArt.is_start AS isstart, tblArtLang.online AS online, ";
|
$sSQL .= "tblCatLang.startidartlang as idstartartlang ";
|
||||||
$sSQL .= "tblCatLang.startidartlang as idstartartlang ";
|
$sSQL .= "FROM " . $cfg["tab"]["art_lang"] . " AS tblArtLang, " . $cfg["tab"]["cat_art"] . " AS tblCatArt, ";
|
||||||
$sSQL .= "FROM ".$cfg["tab"]["art_lang"]." AS tblArtLang, ".$cfg["tab"]["cat_art"]." AS tblCatArt, ";
|
$sSQL .= $cfg["tab"]["cat_lang"] . " AS tblCatLang ";
|
||||||
$sSQL .= $cfg["tab"]["cat_lang"]." AS tblCatLang ";
|
$sSQL .= "WHERE tblCatArt.idcat = '" . Contenido_Security::toInteger($iIDCat) . "' AND tblCatLang.idcat = tblCatArt.idcat AND tblCatLang.idlang = tblArtLang.idlang AND ";
|
||||||
$sSQL .= "WHERE tblCatArt.idcat = '".Contenido_Security::toInteger($iIDCat)."' AND tblCatLang.idcat = tblCatArt.idcat AND tblCatLang.idlang = tblArtLang.idlang AND ";
|
|
||||||
|
|
||||||
if ($bArtOnline) {
|
if ($bArtOnline) {
|
||||||
$sSQL .= "tblArtLang.online = '1' AND ";
|
$sSQL .= "tblArtLang.online = '1' AND ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '".Contenido_Security::escapeDB($lang, $oDB)."' ";
|
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '" . Contenido_Security::escapeDB($lang, $oDB) . "' ";
|
||||||
if ($cfg["is_start_compatible"] == true) {
|
if ($cfg["is_start_compatible"] == true) {
|
||||||
$sSQL .= "ORDER BY tblCatArt.is_start DESC, tblArtLang.title"; // Getting start article as first article
|
$sSQL .= "ORDER BY tblCatArt.is_start DESC, tblArtLang.title"; // Getting start article as first article
|
||||||
} else {
|
} else {
|
||||||
$sSQL .= "ORDER BY tblArtLang.title";
|
$sSQL .= "ORDER BY tblArtLang.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDB->query($sSQL);
|
$oDB->query($sSQL);
|
||||||
|
|
||||||
$iCount = $oDB->num_rows();
|
$iCount = $oDB->num_rows();
|
||||||
if ($iCount == 0) {
|
if ($iCount == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
$iCounter = count($this->_options);
|
$iCounter = count($this->_options);
|
||||||
while ($oDB->next_record())
|
while ($oDB->next_record()) {
|
||||||
{
|
// Generate new option element
|
||||||
// Generate new option element
|
$oOption = new cHTMLOptionElement($sSpaces . " " . substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart"));
|
||||||
$oOption = new cHTMLOptionElement($sSpaces." ".substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart"));
|
|
||||||
|
|
||||||
if ($bColored)
|
if ($bColored) {
|
||||||
{
|
$bIsStartArticle = false;
|
||||||
$bIsStartArticle = false;
|
if ($cfg["is_start_compatible"] == true && $oDB->f("isstart") == 1) {
|
||||||
if ($cfg["is_start_compatible"] == true && $oDB->f("isstart") == 1) {
|
// Compatible mode and "start article" flag is set
|
||||||
// Compatible mode and "start article" flag is set
|
$bIsStartArticle = true;
|
||||||
$bIsStartArticle = true;
|
} else if ($cfg["is_start_compatible"] != true && $oDB->f("idstartartlang") == $oDB->f("idartlang")) {
|
||||||
} else if ($cfg["is_start_compatible"] != true && $oDB->f("idstartartlang") == $oDB->f("idartlang")) {
|
// No compatible mode and current article is start article (idstartartlang is the same for all records within a category)
|
||||||
// No compatible mode and current article is start article (idstartartlang is the same for all records within a category)
|
$bIsStartArticle = true;
|
||||||
$bIsStartArticle = true;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($bIsStartArticle)
|
if ($bIsStartArticle) {
|
||||||
{
|
if ($oDB->f("online") == 0) {
|
||||||
if ($oDB->f("online") == 0) {
|
// Start article, but offline -> red
|
||||||
// Start article, but offline -> red
|
$oOption->setStyle("color: #ff0000;");
|
||||||
$oOption->setStyle("color: #ff0000;");
|
} else {
|
||||||
} else {
|
// Start article -> blue
|
||||||
// Start article -> blue
|
$oOption->setStyle("color: #0000ff;");
|
||||||
$oOption->setStyle("color: #0000ff;");
|
}
|
||||||
}
|
} else if ($oDB->f("online") == 0) {
|
||||||
} else if ($oDB->f("online") == 0) {
|
// Offline article -> grey
|
||||||
// Offline article -> grey
|
$oOption->setStyle("color: #666666;");
|
||||||
$oOption->setStyle("color: #666666;");
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Add option element to the list
|
// Add option element to the list
|
||||||
$this->addOptionElement($iCounter, $oOption);
|
$this->addOptionElement($iCounter, $oOption);
|
||||||
$iCounter++;
|
$iCounter++;
|
||||||
}
|
}
|
||||||
return $iCount;
|
return $iCount;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addCategories. Adds category elements (optionally including articles) to select box values.
|
* Function addCategories. Adds category elements (optionally including articles) to select box values.
|
||||||
* Note: Using "with articles" adds the articles also - but the categories will get a negative value!
|
* Note: Using "with articles" adds the articles also - but the categories will get a negative value!
|
||||||
* There is no way to distinguish between a category id and an article id...
|
* There is no way to distinguish between a category id and an article id...
|
||||||
*
|
*
|
||||||
* @param int $iMaxLevel Max. level shown (to be exact: except this level)
|
* @param int $iMaxLevel Max. level shown (to be exact: except this level)
|
||||||
* @param bool $bColored Add color information to option elements
|
* @param bool $bColored Add color information to option elements
|
||||||
* @param bool $bCatVisible If true, only add idcat as value, if cat is visible
|
* @param bool $bCatVisible If true, only add idcat as value, if cat is visible
|
||||||
* @param bool $bCatPublic If true, only add idcat as value, if cat is public
|
* @param bool $bCatPublic If true, only add idcat as value, if cat is public
|
||||||
* @param bool $bWithArt Add also articles per category
|
* @param bool $bWithArt Add also articles per category
|
||||||
* @param bool $bArtOnline If true, show only online articles
|
* @param bool $bArtOnline If true, show only online articles
|
||||||
*
|
*
|
||||||
* @return int Number of items added
|
* @return int Number of items added
|
||||||
**/
|
* */
|
||||||
function addCategories ($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true,
|
function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true,
|
||||||
$bWithArt = false, $bArtOnline = true)
|
$bWithArt = false, $bArtOnline = true) {
|
||||||
{
|
global $cfg, $client, $lang;
|
||||||
global $cfg, $client, $lang;
|
|
||||||
|
|
||||||
$oDB = new DB_Contenido;
|
$oDB = new DB_Contenido;
|
||||||
|
|
||||||
$sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, ";
|
$sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, ";
|
||||||
$sSQL .= "tblCatLang.visible AS visible, tblCatLang.public AS public, tblCatTree.level AS level ";
|
$sSQL .= "tblCatLang.visible AS visible, tblCatLang.public AS public, tblCatTree.level AS level ";
|
||||||
$sSQL .= "FROM ".$cfg["tab"]["cat"]." AS tblCat, ".$cfg["tab"]["cat_lang"]." AS tblCatLang, ";
|
$sSQL .= "FROM " . $cfg["tab"]["cat"] . " AS tblCat, " . $cfg["tab"]["cat_lang"] . " AS tblCatLang, ";
|
||||||
$sSQL .= $cfg["tab"]["cat_tree"]." AS tblCatTree ";
|
$sSQL .= $cfg["tab"]["cat_tree"] . " AS tblCatTree ";
|
||||||
$sSQL .= "WHERE tblCat.idclient = '".Contenido_Security::escapeDB($client, $oDB)."' AND tblCatLang.idlang = '".Contenido_Security::escapeDB($lang, $oDB)."' AND ";
|
$sSQL .= "WHERE tblCat.idclient = '" . Contenido_Security::escapeDB($client, $oDB) . "' AND tblCatLang.idlang = '" . Contenido_Security::escapeDB($lang, $oDB) . "' AND ";
|
||||||
$sSQL .= "tblCatLang.idcat = tblCat.idcat AND tblCatTree.idcat = tblCat.idcat ";
|
$sSQL .= "tblCatLang.idcat = tblCat.idcat AND tblCatTree.idcat = tblCat.idcat ";
|
||||||
|
|
||||||
if ($iMaxLevel > 0) {
|
if ($iMaxLevel > 0) {
|
||||||
$sSQL .= "AND tblCatTree.level < '".Contenido_Security::escapeDB($iMaxLevel, $oDB)."' ";
|
$sSQL .= "AND tblCatTree.level < '" . Contenido_Security::escapeDB($iMaxLevel, $oDB) . "' ";
|
||||||
}
|
}
|
||||||
$sSQL .= "ORDER BY tblCatTree.idtree";
|
$sSQL .= "ORDER BY tblCatTree.idtree";
|
||||||
|
|
||||||
$oDB->query($sSQL);
|
$oDB->query($sSQL);
|
||||||
|
|
||||||
$iCount = $oDB->num_rows();
|
$iCount = $oDB->num_rows();
|
||||||
if ($iCount == 0) {
|
if ($iCount == 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$iCounter = count($this->_options);
|
$iCounter = count($this->_options);
|
||||||
while ($oDB->next_record())
|
while ($oDB->next_record()) {
|
||||||
{
|
$sSpaces = "";
|
||||||
$sSpaces = "";
|
$sStyle = "";
|
||||||
$sStyle = "";
|
$iID = $oDB->f("idcat");
|
||||||
$iID = $oDB->f("idcat");
|
|
||||||
|
|
||||||
for ($i = 0; $i < $oDB->f("level"); $i++) {
|
for ($i = 0; $i < $oDB->f("level"); $i++) {
|
||||||
$sSpaces .= " ";
|
$sSpaces .= " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate new option element
|
// Generate new option element
|
||||||
if (($bCatVisible && $oDB->f("visible") == 0) ||
|
if (($bCatVisible && $oDB->f("visible") == 0) || ($bCatPublic && $oDB->f("public") == 0)) {
|
||||||
($bCatPublic && $oDB->f("public") == 0)) {
|
// If category has to be visible or public and it isn't, don't add value
|
||||||
// If category has to be visible or public and it isn't, don't add value
|
$sValue = "";
|
||||||
$sValue = "";
|
} else if ($bWithArt) {
|
||||||
} else if ($bWithArt) {
|
// If article will be added, set negative idcat as value
|
||||||
// If article will be added, set negative idcat as value
|
$sValue = "-" . $iID;
|
||||||
$sValue = "-".$iID;
|
} else {
|
||||||
} else {
|
// Show only categories - and everything is fine...
|
||||||
// Show only categories - and everything is fine...
|
$sValue = $iID;
|
||||||
$sValue = $iID;
|
}
|
||||||
}
|
$oOption = new cHTMLOptionElement($sSpaces . "> " . urldecode($oDB->f("name")), $sValue);
|
||||||
$oOption = new cHTMLOptionElement($sSpaces."> ".urldecode($oDB->f("name")), $sValue);
|
|
||||||
|
|
||||||
// Coloring option element, restricted shows grey color
|
// Coloring option element, restricted shows grey color
|
||||||
$oOption->setStyle("background-color: #EFEFEF");
|
$oOption->setStyle("background-color: #EFEFEF");
|
||||||
if ($bColored && ($oDB->f("visible") == 0 || $oDB->f("public") == 0)) {
|
if ($bColored && ($oDB->f("visible") == 0 || $oDB->f("public") == 0)) {
|
||||||
$oOption->setStyle("color: #666666;");
|
$oOption->setStyle("color: #666666;");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add option element to the list
|
// Add option element to the list
|
||||||
$this->addOptionElement($iCounter, $oOption);
|
$this->addOptionElement($iCounter, $oOption);
|
||||||
|
|
||||||
if ($bWithArt) {
|
if ($bWithArt) {
|
||||||
$iArticles = $this->addArticles($iID, $bColored, $bArtOnline, $sSpaces);
|
$iArticles = $this->addArticles($iID, $bColored, $bArtOnline, $sSpaces);
|
||||||
$iCount += $iArticles;
|
$iCount += $iArticles;
|
||||||
}
|
}
|
||||||
$iCounter = count($this->_options);
|
$iCounter = count($this->_options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $iCount;
|
return $iCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function addTypesFromArt. Adds types and type ids which are available for the specified article
|
* Function addTypesFromArt. Adds types and type ids which are available for the specified article
|
||||||
*
|
*
|
||||||
* @param int $iIDCatArt Article id
|
* @param int $iIDCatArt Article id
|
||||||
* @param string $sTypeRange Komma separated list of Contenido type ids which may be in the resulting list (e.g. '1','17','28')
|
* @param string $sTypeRange Komma separated list of Contenido type ids which may be in the resulting list (e.g. '1','17','28')
|
||||||
*
|
*
|
||||||
* @return int Number of items added
|
* @return int Number of items added
|
||||||
**/
|
* */
|
||||||
function addTypesFromArt ($iIDCatArt, $sTypeRange = "")
|
function addTypesFromArt($iIDCatArt, $sTypeRange = "") {
|
||||||
{
|
global $cfg, $lang;
|
||||||
global $cfg, $lang;
|
|
||||||
|
|
||||||
$oDB = new DB_Contenido;
|
$oDB = new DB_Contenido;
|
||||||
|
|
||||||
if (is_numeric($iIDCatArt) && $iIDCatArt > 0)
|
if (is_numeric($iIDCatArt) && $iIDCatArt > 0) {
|
||||||
{
|
$sSQL = "SELECT tblContent.typeid AS typeid, tblContent.idtype AS idtype, tblType.type AS type, tblType.description AS description, ";
|
||||||
$sSQL = "SELECT tblContent.typeid AS typeid, tblContent.idtype AS idtype, tblType.type AS type, tblType.description AS description, ";
|
$sSQL .= "tblContent.value AS value ";
|
||||||
$sSQL .= "tblContent.value AS value ";
|
$sSQL .= "FROM " . $cfg["tab"]["content"] . " AS tblContent, " . $cfg["tab"]["art_lang"] . " AS tblArtLang, ";
|
||||||
$sSQL .= "FROM ".$cfg["tab"]["content"]." AS tblContent, ".$cfg["tab"]["art_lang"]." AS tblArtLang, ";
|
$sSQL .= $cfg["tab"]["cat_art"] . " AS tblCatArt, " . $cfg["tab"]["type"] . " AS tblType ";
|
||||||
$sSQL .= $cfg["tab"]["cat_art"]." AS tblCatArt, ".$cfg["tab"]["type"]." AS tblType ";
|
$sSQL .= "WHERE tblContent.idtype = tblType.idtype AND tblContent.idartlang = tblArtLang.idartlang AND ";
|
||||||
$sSQL .= "WHERE tblContent.idtype = tblType.idtype AND tblContent.idartlang = tblArtLang.idartlang AND ";
|
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '" . Contenido_Security::escapeDB($lang, $oDB) . "' AND tblCatArt.idcatart = '" . Contenido_Security::toInteger($iIDCatArt) . "' ";
|
||||||
$sSQL .= "tblArtLang.idart = tblCatArt.idart AND tblArtLang.idlang = '". Contenido_Security::escapeDB($lang, $oDB)."' AND tblCatArt.idcatart = '". Contenido_Security::toInteger($iIDCatArt)."' ";
|
|
||||||
|
|
||||||
if ($sTypeRange != "") {
|
if ($sTypeRange != "") {
|
||||||
$sSQL .= "AND tblContent.idtype IN (". Contenido_Security::escapeDB($sTypeRange, $oDB).") ";
|
$sSQL .= "AND tblContent.idtype IN (" . Contenido_Security::escapeDB($sTypeRange, $oDB) . ") ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= "ORDER BY tblContent.idtype, tblContent.typeid";
|
$sql .= "ORDER BY tblContent.idtype, tblContent.typeid";
|
||||||
|
|
||||||
$oDB->query($sSQL);
|
$oDB->query($sSQL);
|
||||||
|
|
||||||
$iCount = $oDB->num_rows();
|
$iCount = $oDB->num_rows();
|
||||||
if ($iCount == 0) {
|
if ($iCount == 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
while ($oDB->next_record())
|
while ($oDB->next_record()) {
|
||||||
{
|
$sTypeIdentifier = "tblData.idtype = '" . $oDB->f('idtype') . "' AND tblData.typeid = '" . $oDB->f('typeid') . "'";
|
||||||
$sTypeIdentifier = "tblData.idtype = '".$oDB->f('idtype')."' AND tblData.typeid = '".$oDB->f('typeid')."'";
|
|
||||||
|
|
||||||
// Generate new option element
|
// Generate new option element
|
||||||
$oOption = new cHTMLOptionElement($oDB->f('type')."[".$oDB->f('typeid')."]: ".substr(strip_tags(urldecode($oDB->f("value"))), 0, 50), $sTypeIdentifier);
|
$oOption = new cHTMLOptionElement($oDB->f('type') . "[" . $oDB->f('typeid') . "]: " . substr(strip_tags(urldecode($oDB->f("value"))), 0, 50), $sTypeIdentifier);
|
||||||
|
|
||||||
// Add option element to the list
|
// Add option element to the list
|
||||||
$this->addOptionElement($sTypeIdentifier, $oOption);
|
$this->addOptionElement($sTypeIdentifier, $oOption);
|
||||||
}
|
}
|
||||||
return $iCount;
|
return $iCount;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects specified elements as selected
|
||||||
|
*
|
||||||
|
* @param array $aElements Array with "values" of the cHTMLOptionElement to set
|
||||||
|
*
|
||||||
|
* @return none
|
||||||
|
*/
|
||||||
|
function setSelected($aElements) {
|
||||||
|
if (is_array($this->_options) && is_array($aElements)) {
|
||||||
|
foreach ($this->_options as $sKey => $oOption) {
|
||||||
|
if (in_array($oOption->getAttribute("value"), $aElements)) {
|
||||||
|
$oOption->setSelected(true);
|
||||||
|
$this->_options[$sKey] = $oOption;
|
||||||
|
} else {
|
||||||
|
$oOption->setSelected(false);
|
||||||
|
$this->_options[$sKey] = $oOption;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Selects specified elements as selected
|
|
||||||
*
|
|
||||||
* @param array $aElements Array with "values" of the cHTMLOptionElement to set
|
|
||||||
*
|
|
||||||
* @return none
|
|
||||||
*/
|
|
||||||
function setSelected($aElements)
|
|
||||||
{
|
|
||||||
if (is_array($this->_options) && is_array($aElements))
|
|
||||||
{
|
|
||||||
foreach ($this->_options as $sKey => $oOption)
|
|
||||||
{
|
|
||||||
if (in_array($oOption->getAttribute("value"), $aElements))
|
|
||||||
{
|
|
||||||
$oOption->setSelected(true);
|
|
||||||
$this->_options[$sKey] = $oOption;
|
|
||||||
} else {
|
|
||||||
$oOption->setSelected(false);
|
|
||||||
$this->_options[$sKey] = $oOption;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class UI_Config_Table
|
class UI_Config_Table {
|
||||||
{
|
|
||||||
var $_sTplCellCode;
|
|
||||||
var $_sTplTableFile;
|
|
||||||
|
|
||||||
var $_sWidth;
|
|
||||||
var $_sBorder;
|
|
||||||
var $_sBorderColor;
|
|
||||||
var $_bSolidBorder;
|
|
||||||
var $_sPadding;
|
|
||||||
var $_aCells;
|
|
||||||
var $_aCellAlignment;
|
|
||||||
var $_aCellVAlignment;
|
|
||||||
var $_aCellColSpan;
|
|
||||||
var $_aCellClass;
|
|
||||||
var $_aRowBgColor;
|
|
||||||
var $_aRowExtra;
|
|
||||||
var $_bAddMultiSelJS;
|
|
||||||
|
|
||||||
var $_sColorLight;
|
|
||||||
var $_sColorDark;
|
|
||||||
|
|
||||||
function __construct()
|
var $_sTplCellCode;
|
||||||
{
|
var $_sTplTableFile;
|
||||||
global $cfg;
|
var $_sWidth;
|
||||||
|
var $_sBorder;
|
||||||
|
var $_sBorderColor;
|
||||||
|
var $_bSolidBorder;
|
||||||
|
var $_sPadding;
|
||||||
|
var $_aCells;
|
||||||
|
var $_aCellAlignment;
|
||||||
|
var $_aCellVAlignment;
|
||||||
|
var $_aCellColSpan;
|
||||||
|
var $_aCellClass;
|
||||||
|
var $_aRowBgColor;
|
||||||
|
var $_aRowExtra;
|
||||||
|
var $_bAddMultiSelJS;
|
||||||
|
var $_sColorLight;
|
||||||
|
var $_sColorDark;
|
||||||
|
|
||||||
$this->_sPadding = 2;
|
function __construct() {
|
||||||
$this->_sBorder = 0;
|
global $cfg;
|
||||||
$this->_sBorderColor = $cfg['color']['table_border'];
|
|
||||||
$this->_sTplCellCode = ' <td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">{CONTENT}</td>'."\n";
|
|
||||||
$this->_sTplTableFile = $cfg['path']['contenido'].$cfg['path']['templates'].$cfg['templates']['generic_list'];
|
|
||||||
$this->_sColorLight = $cfg['color']['table_light'];
|
|
||||||
$this->_sColorDark = $cfg['color']['table_dark'];
|
|
||||||
}
|
|
||||||
|
|
||||||
function setCellTemplate($sCode)
|
$this->_sPadding = 2;
|
||||||
{
|
$this->_sBorder = 0;
|
||||||
$this->_sTplCellCode = $sCode;
|
$this->_sBorderColor = $cfg['color']['table_border'];
|
||||||
}
|
$this->_sTplCellCode = ' <td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">{CONTENT}</td>' . "\n";
|
||||||
|
$this->_sTplTableFile = $cfg['path']['contenido'] . $cfg['path']['templates'] . $cfg['templates']['generic_list'];
|
||||||
|
$this->_sColorLight = $cfg['color']['table_light'];
|
||||||
|
$this->_sColorDark = $cfg['color']['table_dark'];
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCellTemplate($sCode) {
|
||||||
|
$this->_sTplCellCode = $sCode;
|
||||||
|
}
|
||||||
|
|
||||||
function setTableTemplateFile($sPath)
|
function setTableTemplateFile($sPath) {
|
||||||
{
|
$this->_sTplTableFile = $sPath;
|
||||||
$this->_sTplTableFile = $sPath;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setLightColor($sColor)
|
|
||||||
{
|
|
||||||
$this->_sColorLight = $sColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDarkColor($sColor)
|
|
||||||
{
|
|
||||||
$this->_sColorDark = $sColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAddMultiSelJS($bEnabled = true)
|
function setLightColor($sColor) {
|
||||||
{
|
$this->_sColorLight = $sColor;
|
||||||
$this->_bAddMultiSelJS = (bool)$bEnabled;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setWidth ($sWidth)
|
function setDarkColor($sColor) {
|
||||||
{
|
$this->_sColorDark = $sColor;
|
||||||
$this->_sWidth = $sWidth;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setPadding ($sPadding)
|
|
||||||
{
|
|
||||||
$this->_sPadding = $sPadding;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBorder ($sBorder)
|
function setAddMultiSelJS($bEnabled = true) {
|
||||||
{
|
$this->_bAddMultiSelJS = (bool) $bEnabled;
|
||||||
$this->_sBorder = $sBorder;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setBorderColor ($sBorderColor)
|
function setWidth($sWidth) {
|
||||||
{
|
$this->_sWidth = $sWidth;
|
||||||
$this->_sBorderColor = $sBorderColor;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setSolidBorder ($bSolidBorder = true)
|
|
||||||
{
|
|
||||||
$this->_bSolidBorder = (bool)$bSolidBorder;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setCell ($sRow, $sCell, $sContent)
|
function setPadding($sPadding) {
|
||||||
{
|
$this->_sPadding = $sPadding;
|
||||||
$this->_aCells[$sRow][$sCell] = $sContent;
|
}
|
||||||
$this->_aCellAlignment[$sRow][$sCell] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function setCellAlignment ($sRow, $sCell, $sAlignment)
|
function setBorder($sBorder) {
|
||||||
{
|
$this->_sBorder = $sBorder;
|
||||||
$this->_aCellAlignment[$sRow][$sCell] = $sAlignment;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setCellVAlignment ($sRow, $sCell, $sAlignment)
|
function setBorderColor($sBorderColor) {
|
||||||
{
|
$this->_sBorderColor = $sBorderColor;
|
||||||
$this->_aCellVAlignment[$sRow][$sCell] = $sAlignment;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setCellColspan ($sRow, $sCell, $iColSpan)
|
function setSolidBorder($bSolidBorder = true) {
|
||||||
{
|
$this->_bSolidBorder = (bool) $bSolidBorder;
|
||||||
$this->_aCellColSpan[$sRow][$sCell] = $iColSpan;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setCellClass ($sRow, $sCell, $sClass)
|
function setCell($sRow, $sCell, $sContent) {
|
||||||
{
|
$this->_aCells[$sRow][$sCell] = $sContent;
|
||||||
$this->_aCellClass[$sRow][$sCell] = $sClass;
|
$this->_aCellAlignment[$sRow][$sCell] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRowBgColor ($sRow, $sColor)
|
function setCellAlignment($sRow, $sCell, $sAlignment) {
|
||||||
{
|
$this->_aCellAlignment[$sRow][$sCell] = $sAlignment;
|
||||||
$this->_aRowBgColor[$sRow] = $sColor;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function setRowExtra ($sRow, $sExtra)
|
|
||||||
{
|
|
||||||
$this->_aRowExtra[$sRow] = $sExtra;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _addMultiSelJS()
|
function setCellVAlignment($sRow, $sCell, $sAlignment) {
|
||||||
{
|
$this->_aCellVAlignment[$sRow][$sCell] = $sAlignment;
|
||||||
// Trick: To save multiple selections in <select>-Element, add some JS which saves the
|
}
|
||||||
// selection, comma separated in a hidden input field on change.
|
|
||||||
|
|
||||||
// Try ... catch prevents error messages, if function is added more than once
|
function setCellColspan($sRow, $sCell, $iColSpan) {
|
||||||
// if (!fncUpdateSel) in JS has not worked...
|
$this->_aCellColSpan[$sRow][$sCell] = $iColSpan;
|
||||||
|
}
|
||||||
|
|
||||||
$sSkript = ' <script type="text/javascript"><!--'."\n".
|
function setCellClass($sRow, $sCell, $sClass) {
|
||||||
' try {'."\n".
|
$this->_aCellClass[$sRow][$sCell] = $sClass;
|
||||||
' function fncUpdateSel(sSelectBox, sStorage)'."\n".
|
}
|
||||||
' {'."\n".
|
|
||||||
' var sSelection = "";'."\n".
|
|
||||||
' var oSelectBox = document.getElementsByName(sSelectBox)[0];'."\n".
|
|
||||||
' var oStorage = document.getElementsByName(sStorage)[0];'."\n".
|
|
||||||
' '."\n".
|
|
||||||
' if (oSelectBox && oStorage)'."\n".
|
|
||||||
' {'."\n".
|
|
||||||
' for (i = 0; i < oSelectBox.length; i++)'."\n".
|
|
||||||
' {'."\n".
|
|
||||||
' if(oSelectBox.options[i].selected == true)'."\n".
|
|
||||||
' {'."\n".
|
|
||||||
' if (sSelection != "")'."\n".
|
|
||||||
' sSelection = sSelection + ",";'."\n".
|
|
||||||
' sSelection = sSelection + oSelectBox.options[i].value;'."\n".
|
|
||||||
' }'."\n".
|
|
||||||
' }'."\n".
|
|
||||||
' oStorage.value = sSelection;'."\n".
|
|
||||||
' }'."\n".
|
|
||||||
' }'."\n".
|
|
||||||
' } catch (e) { }'."\n".
|
|
||||||
' //--></script>'."\n";
|
|
||||||
|
|
||||||
return $sSkript;
|
function setRowBgColor($sRow, $sColor) {
|
||||||
}
|
$this->_aRowBgColor[$sRow] = $sColor;
|
||||||
|
}
|
||||||
function render($bPrint = false)
|
|
||||||
{
|
|
||||||
$oTable = new Template;
|
|
||||||
$oTable->reset();
|
|
||||||
|
|
||||||
$oTable->set('s', 'CELLPADDING', $this->_sPadding);
|
function setRowExtra($sRow, $sExtra) {
|
||||||
$oTable->set('s', 'BORDER', $this->_sBorder);
|
$this->_aRowExtra[$sRow] = $sExtra;
|
||||||
$oTable->set('s', 'BORDERCOLOR', $this->_sBorderColor);
|
}
|
||||||
|
|
||||||
$iColCount = 0;
|
function _addMultiSelJS() {
|
||||||
$bDark = false;
|
// Trick: To save multiple selections in <select>-Element, add some JS which saves the
|
||||||
$sBgColor = "";
|
// selection, comma separated in a hidden input field on change.
|
||||||
$bMultiSelJSAdded = false;
|
// Try ... catch prevents error messages, if function is added more than once
|
||||||
if (is_array($this->_aCells))
|
// if (!fncUpdateSel) in JS has not worked...
|
||||||
{
|
|
||||||
foreach ($this->_aCells as $sRow => $aCells)
|
|
||||||
{
|
|
||||||
$iColCount++;
|
|
||||||
//$bDark = !$bDark;
|
|
||||||
$sLine = "";
|
|
||||||
$iCount = 0;
|
|
||||||
|
|
||||||
foreach ($aCells as $sCell => $sData)
|
|
||||||
{
|
|
||||||
$iCount++;
|
|
||||||
$sTplCell = $this->_sTplCellCode;
|
|
||||||
|
|
||||||
if ($this->_bSolidBorder)
|
$sSkript = ' <script type="text/javascript"><!--' . "\n" .
|
||||||
{
|
' try {' . "\n" .
|
||||||
if ($iCount < count($aCells))
|
' function fncUpdateSel(sSelectBox, sStorage)' . "\n" .
|
||||||
{
|
' {' . "\n" .
|
||||||
if ($iColCount < count($this->_aCells)) {
|
' var sSelection = "";' . "\n" .
|
||||||
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell);
|
' var oSelectBox = document.getElementsByName(sSelectBox)[0];' . "\n" .
|
||||||
} else {
|
' var oStorage = document.getElementsByName(sStorage)[0];' . "\n" .
|
||||||
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell);
|
' ' . "\n" .
|
||||||
}
|
' if (oSelectBox && oStorage)' . "\n" .
|
||||||
} else if ($iColCount < count($this->_aCells)) {
|
' {' . "\n" .
|
||||||
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-bottom: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell);
|
' for (i = 0; i < oSelectBox.length; i++)' . "\n" .
|
||||||
} else {
|
' {' . "\n" .
|
||||||
$sTplCell = str_replace('{EXTRA}', '', $sTplCell);
|
' if(oSelectBox.options[i].selected == true)' . "\n" .
|
||||||
}
|
' {' . "\n" .
|
||||||
}
|
' if (sSelection != "")' . "\n" .
|
||||||
|
' sSelection = sSelection + ",";' . "\n" .
|
||||||
if ($this->_aCellAlignment[$sRow][$sCell] != "") {
|
' sSelection = sSelection + oSelectBox.options[i].value;' . "\n" .
|
||||||
$sTplCell = str_replace('{ALIGN}', $this->_aCellAlignment[$sRow][$sCell], $sTplCell);
|
' }' . "\n" .
|
||||||
} else {
|
' }' . "\n" .
|
||||||
$sTplCell = str_replace('{ALIGN}', 'left', $sTplCell);
|
' oStorage.value = sSelection;' . "\n" .
|
||||||
}
|
' }' . "\n" .
|
||||||
|
' }' . "\n" .
|
||||||
if ($this->_aCellVAlignment[$sRow][$sCell] != "") {
|
' } catch (e) { }' . "\n" .
|
||||||
$sTplCell = str_replace('{VALIGN}', $this->_aCellVAlignment[$sRow][$sCell], $sTplCell);
|
' //--></script>' . "\n";
|
||||||
} else {
|
|
||||||
$sTplCell = str_replace('{VALIGN}', 'top', $sTplCell);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->_aCellColSpan[$sRow][$sCell] != "") {
|
return $sSkript;
|
||||||
$sTplCell = str_replace('{COLSPAN}', $this->_aCellColSpan[$sRow][$sCell], $sTplCell);
|
}
|
||||||
} else {
|
|
||||||
$sTplCell = str_replace('{COLSPAN}', '1', $sTplCell);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->_aCellClass[$sRow][$sCell] != "") {
|
function render($bPrint = false) {
|
||||||
$sTplCell = str_replace('{CLASS}', $this->_aCellClass[$sRow][$sCell], $sTplCell);
|
$oTable = new Template;
|
||||||
} else {
|
$oTable->reset();
|
||||||
$sTplCell = str_replace('{CLASS}', 'text', $sTplCell);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Multi selection javascript
|
$oTable->set('s', 'CELLPADDING', $this->_sPadding);
|
||||||
if ($this->_bAddMultiSelJS) {
|
$oTable->set('s', 'BORDER', $this->_sBorder);
|
||||||
$sData = $this->_addMultiSelJS() . $sData;
|
$oTable->set('s', 'BORDERCOLOR', $this->_sBorderColor);
|
||||||
$this->_bAddMultiSelJS = false;
|
|
||||||
}
|
$iColCount = 0;
|
||||||
|
$bDark = false;
|
||||||
|
$sBgColor = "";
|
||||||
|
$bMultiSelJSAdded = false;
|
||||||
|
if (is_array($this->_aCells)) {
|
||||||
|
foreach ($this->_aCells as $sRow => $aCells) {
|
||||||
|
$iColCount++;
|
||||||
|
//$bDark = !$bDark;
|
||||||
|
$sLine = "";
|
||||||
|
$iCount = 0;
|
||||||
|
|
||||||
|
foreach ($aCells as $sCell => $sData) {
|
||||||
|
$iCount++;
|
||||||
|
$sTplCell = $this->_sTplCellCode;
|
||||||
|
|
||||||
|
if ($this->_bSolidBorder) {
|
||||||
|
if ($iCount < count($aCells)) {
|
||||||
|
if ($iColCount < count($this->_aCells)) {
|
||||||
|
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
|
||||||
|
} else {
|
||||||
|
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
|
||||||
|
}
|
||||||
|
} else if ($iColCount < count($this->_aCells)) {
|
||||||
|
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
|
||||||
|
} else {
|
||||||
|
$sTplCell = str_replace('{EXTRA}', '', $sTplCell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_aCellAlignment[$sRow][$sCell] != "") {
|
||||||
|
$sTplCell = str_replace('{ALIGN}', $this->_aCellAlignment[$sRow][$sCell], $sTplCell);
|
||||||
|
} else {
|
||||||
|
$sTplCell = str_replace('{ALIGN}', 'left', $sTplCell);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_aCellVAlignment[$sRow][$sCell] != "") {
|
||||||
|
$sTplCell = str_replace('{VALIGN}', $this->_aCellVAlignment[$sRow][$sCell], $sTplCell);
|
||||||
|
} else {
|
||||||
|
$sTplCell = str_replace('{VALIGN}', 'top', $sTplCell);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_aCellColSpan[$sRow][$sCell] != "") {
|
||||||
|
$sTplCell = str_replace('{COLSPAN}', $this->_aCellColSpan[$sRow][$sCell], $sTplCell);
|
||||||
|
} else {
|
||||||
|
$sTplCell = str_replace('{COLSPAN}', '1', $sTplCell);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_aCellClass[$sRow][$sCell] != "") {
|
||||||
|
$sTplCell = str_replace('{CLASS}', $this->_aCellClass[$sRow][$sCell], $sTplCell);
|
||||||
|
} else {
|
||||||
|
$sTplCell = str_replace('{CLASS}', 'text', $sTplCell);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multi selection javascript
|
||||||
|
if ($this->_bAddMultiSelJS) {
|
||||||
|
$sData = $this->_addMultiSelJS() . $sData;
|
||||||
|
$this->_bAddMultiSelJS = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sTplCell = str_replace('{CONTENT}', $sData, $sTplCell);
|
||||||
|
$sLine .= $sTplCell;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Row
|
||||||
|
$oTable->set('d', 'ROWS', $sLine);
|
||||||
|
|
||||||
|
if ($this->_aRowBgColor[$sRow] != "") {
|
||||||
|
$sBgColor = $this->_aRowBgColor[$sRow];
|
||||||
|
} else if ($sBgColor == $this->_sColorLight) {
|
||||||
|
$sBgColor = $this->_sColorDark;
|
||||||
|
} else {
|
||||||
|
$sBgColor = $this->_sColorLight;
|
||||||
|
}
|
||||||
|
$oTable->set('d', 'BGCOLOR', $sBgColor);
|
||||||
|
|
||||||
|
if ($this->_aRowExtra[$sRow] != "") {
|
||||||
|
$oTable->set('d', 'EXTRA', $this->_aRowExtra[$sRow]);
|
||||||
|
} else {
|
||||||
|
$oTable->set('d', 'EXTRA', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$oTable->next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_sWidth) {
|
||||||
|
// Table: Width
|
||||||
|
$oTable->set('s', 'EXTRA', 'width: ' . $this->_sWidth . ';');
|
||||||
|
} else {
|
||||||
|
$oTable->set('s', 'EXTRA', '');
|
||||||
|
}
|
||||||
|
$sRendered = $oTable->generate($this->_sTplTableFile, true, false);
|
||||||
|
|
||||||
|
if ($bPrint == true) {
|
||||||
|
echo $sRendered;
|
||||||
|
} else {
|
||||||
|
return $sRendered;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sTplCell = str_replace('{CONTENT}', $sData, $sTplCell);
|
|
||||||
$sLine .= $sTplCell;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Row
|
|
||||||
$oTable->set('d', 'ROWS', $sLine);
|
|
||||||
|
|
||||||
if ($this->_aRowBgColor[$sRow] != "") {
|
|
||||||
$sBgColor = $this->_aRowBgColor[$sRow];
|
|
||||||
} else if ($sBgColor == $this->_sColorLight) {
|
|
||||||
$sBgColor = $this->_sColorDark;
|
|
||||||
} else {
|
|
||||||
$sBgColor = $this->_sColorLight;
|
|
||||||
}
|
|
||||||
$oTable->set('d', 'BGCOLOR', $sBgColor);
|
|
||||||
|
|
||||||
if ($this->_aRowExtra[$sRow] != "") {
|
|
||||||
$oTable->set('d', 'EXTRA', $this->_aRowExtra[$sRow]);
|
|
||||||
} else {
|
|
||||||
$oTable->set('d', 'EXTRA', '');
|
|
||||||
}
|
|
||||||
|
|
||||||
$oTable->next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->_sWidth) {
|
|
||||||
// Table: Width
|
|
||||||
$oTable->set('s', 'EXTRA', 'width: '.$this->_sWidth.';');
|
|
||||||
} else {
|
|
||||||
$oTable->set('s', 'EXTRA', '');
|
|
||||||
}
|
|
||||||
$sRendered = $oTable->generate($this->_sTplTableFile, true, false);
|
|
||||||
|
|
||||||
if ($bPrint == true) {
|
|
||||||
echo $sRendered;
|
|
||||||
} else {
|
|
||||||
return $sRendered;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -1,10 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* defines.php
|
|
||||||
*
|
|
||||||
* define needed var for conlite setup
|
* define needed var for conlite setup
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @package ConLite
|
* @package ConLite
|
||||||
* @subpackage Setup
|
* @subpackage Setup
|
||||||
* @license https://www.gnu.de/documents/gpl-3.0.de.html GNU General Public License (GPL)
|
* @license https://www.gnu.de/documents/gpl-3.0.de.html GNU General Public License (GPL)
|
||||||
|
@ -33,6 +31,6 @@ define('C_SETUP_STEPFILE', 'images/steps/s%d.png');
|
||||||
define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png');
|
define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png');
|
||||||
define('C_SETUP_STEPWIDTH', 28);
|
define('C_SETUP_STEPWIDTH', 28);
|
||||||
define('C_SETUP_STEPHEIGHT', 28);
|
define('C_SETUP_STEPHEIGHT', 28);
|
||||||
define('C_SETUP_MIN_PHP_VERSION', '7.0.0');
|
define('C_SETUP_MIN_PHP_VERSION', '7.2');
|
||||||
define('C_SETUP_MAX_PHP_VERSION', '8.0.0');
|
define('C_SETUP_MAX_PHP_VERSION', '7.4');
|
||||||
define('C_SETUP_VERSION', '2.1.2');
|
define('C_SETUP_VERSION', '2.2.0');
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* startup.php
|
* startup.php
|
||||||
*
|
*
|
||||||
|
@ -15,6 +16,7 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
define('CON_BE_PATH', '../conlite/');
|
define('CON_BE_PATH', '../conlite/');
|
||||||
|
require_once 'defines.php';
|
||||||
|
|
||||||
require_once dirname(__FILE__).'/defines.php';
|
require_once dirname(__FILE__).'/defines.php';
|
||||||
|
|
||||||
|
@ -28,13 +30,13 @@ header('Content-Type: text/html; charset=UTF-8');
|
||||||
|
|
||||||
// Check php version
|
// Check php version
|
||||||
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')) {
|
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')) {
|
||||||
die("You need PHP >= 7.0.0 to install ConLite 2.1. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
|
die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check version
|
$iVersionMax = substr(C_SETUP_MAX_PHP_VERSION, 0, strrpos(C_SETUP_MAX_PHP_VERSION, ".") + 1) . (1 + substr(C_SETUP_MAX_PHP_VERSION, strrpos(C_SETUP_MAX_PHP_VERSION, ".") + 1));
|
||||||
//PHP >= 7.0.0 and < 7.4
|
|
||||||
if (version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>=')) {
|
if (!(version_compare($iVersionMax, PHP_VERSION, ">") && version_compare(C_SETUP_MAX_PHP_VERSION, PHP_VERSION, "<="))) {
|
||||||
die("You need PHP >= 7.0 and < 7.4 to install ConLite 2.1. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
|
die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " and <= " . C_SETUP_MAX_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +46,7 @@ if (version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>=')) {
|
||||||
* If you want to set a different enviroment value please define it in your .htaccess file
|
* If you want to set a different enviroment value please define it in your .htaccess file
|
||||||
* or in the server configuration.
|
* or in the server configuration.
|
||||||
*
|
*
|
||||||
* SetEnv CONTENIDO_ENVIRONMENT development
|
* SetEnv CONLITE_ENVIRONMENT development
|
||||||
*/
|
*/
|
||||||
if (!defined('CL_ENVIRONMENT')) {
|
if (!defined('CL_ENVIRONMENT')) {
|
||||||
if (getenv('CONLITE_ENVIRONMENT')) {
|
if (getenv('CONLITE_ENVIRONMENT')) {
|
||||||
|
@ -71,13 +73,13 @@ Contenido_Security::checkRequests();
|
||||||
*/
|
*/
|
||||||
function checkAndInclude($filename) {
|
function checkAndInclude($filename) {
|
||||||
if (file_exists($filename) && is_readable($filename)) {
|
if (file_exists($filename) && is_readable($filename)) {
|
||||||
require_once($filename);
|
require_once($filename);
|
||||||
} else {
|
} else {
|
||||||
echo "<pre>";
|
echo "<pre>";
|
||||||
echo "Setup was unable to include neccessary files. The file $filename was not found. Solutions:\n\n";
|
echo "Setup was unable to include neccessary files. The file $filename was not found. Solutions:\n\n";
|
||||||
echo "- Make sure that all files are correctly uploaded to the server.\n";
|
echo "- Make sure that all files are correctly uploaded to the server.\n";
|
||||||
echo "- Make sure that include_path is set to '.' (of course, it can contain also other directories). Your include path is: ".ini_get("include_path")."\n";
|
echo "- Make sure that include_path is set to '.' (of course, it can contain also other directories). Your include path is: " . ini_get("include_path") . "\n";
|
||||||
echo "</pre>";
|
echo "</pre>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +90,10 @@ $cfg['path']['frontend'] = CON_FRONTEND_PATH;
|
||||||
$cfg['path']['conlite'] = $cfg['path']['frontend'] . '/conlite/';
|
$cfg['path']['conlite'] = $cfg['path']['frontend'] . '/conlite/';
|
||||||
$cfg['path']['conlite_config'] = CON_FRONTEND_PATH . '/data/config/' . CL_ENVIRONMENT . '/';
|
$cfg['path']['conlite_config'] = CON_FRONTEND_PATH . '/data/config/' . CL_ENVIRONMENT . '/';
|
||||||
|
|
||||||
|
if(!is_dir($cfg['path']['conlite_config'])) {
|
||||||
|
die("Setup cannot find the config folder \"".$cfg['path']['conlite_config']."\"! Make shure folder exists and is readable.");
|
||||||
|
}
|
||||||
|
|
||||||
// (bool) Flag to use native i18n.
|
// (bool) Flag to use native i18n.
|
||||||
// Note: Enabling this could create unwanted side effects, because of
|
// Note: Enabling this could create unwanted side effects, because of
|
||||||
// native gettext() behavior.
|
// native gettext() behavior.
|
||||||
|
@ -96,8 +102,8 @@ $cfg['native_i18n'] = false;
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
// includes
|
// includes
|
||||||
//checkAndInclude('lib/defines.php');
|
checkAndInclude('lib/defines.php');
|
||||||
checkAndInclude($cfg['path']['frontend'].'/pear/HTML/Common2.php');
|
checkAndInclude($cfg['path']['frontend'] . '/pear/HTML/Common2.php');
|
||||||
checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml.php');
|
checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml.php');
|
||||||
checkAndInclude($cfg['path']['conlite'] . 'classes/class.htmlelements.php');
|
checkAndInclude($cfg['path']['conlite'] . 'classes/class.htmlelements.php');
|
||||||
checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.filehandler.php');
|
checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.filehandler.php');
|
||||||
|
|
Laden…
In neuem Issue referenzieren