Dieser Commit ist enthalten in:
o.pinke 2022-05-23 18:49:34 +02:00
Ursprung 50553924d4
Commit d482a362af
6 geänderte Dateien mit 695 neuen und 954 gelöschten Zeilen

Datei anzeigen

@ -1,53 +0,0 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* <Description>
*
* Requirements:
* @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
*
*
* @package ContenidoBackendArea
* @version <version>
* @author <author>
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
*
*
* {@internal
* created <date>
* modified 2008-07-04, bilal arslan, added security fix
*
* $Id$:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// Relative path to contenido directory, for all inclusions, in most cases: "../contenido/"
$contenido_path = "!PATH!";
// If language isn't specified, set this client and language (ID)
$load_lang = "!LANG!";
$load_client = "!CLIENT!";
/* Various debugging options */
$frontend_debug["container_display"] = false;
$frontend_debug["module_display"] = false;
$frontend_debug["module_timing"] = false;
$frontend_debug["module_timing_summary"] = false;
/* Set to 1 to brute-force module regeneration */
$force = 0;
?>

Datei anzeigen

@ -8,9 +8,11 @@
* *
* Requirements: * Requirements:
* @con_php_req 5 * @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
*
* *
* @package ContenidoBackendArea * @package ContenidoBackendArea
* @version <version>
* @author unknown * @author unknown
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt * @license http://www.contenido.org/license/LIZENZ.txt
@ -22,13 +24,15 @@
* {@internal * {@internal
* created unknown * created unknown
* modified 2008-06-16, H. Librenz - Hotfix: checking for potential unsecure calling * modified 2008-06-16, H. Librenz - Hotfix: checking for potential unsecure calling
* modified 2008-07-04, bilal arslan, added security fix * modified 2008-07-03, bilal arslan, added security fix
* modified 2010-05-20, Murat Purc, standardized Contenido startup and security check invocations, see [#CON-307]
* *
* $Id$: * $Id$:
* }} * }}
* *
*/ */
if (!defined("CON_FRAMEWORK")) {
if (!defined("CON_FRAMEWORK")) {
define("CON_FRAMEWORK", true); define("CON_FRAMEWORK", true);
} }
@ -36,12 +40,8 @@ $contenido_path = '';
# include the config file of the frontend to init the Client and Language Id # include the config file of the frontend to init the Client and Language Id
include_once ("config.php"); include_once ("config.php");
// include security class and check request variables // Contenido startup process
include_once ($contenido_path . 'classes/class.security.php'); include_once ($contenido_path . 'includes/startup.php');
Contenido_Security::checkRequests();
include_once ($contenido_path . "includes/startup.php");
cInclude("includes", "functions.general.php");
if ($contenido) if ($contenido)
{ {

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,40 +1,25 @@
<?php <?php
/** /**
* Project: * file: front_crcloginform.inc.php
* Contenido Content Management System
* *
* Description: * @package ConLite
* <Description> * @subpackage Frontend
* * @version $Rev$
* Requirements: * @author Ortwin Pinke
* @con_php_req 5 * @copyright conrepo.org
* @con_template <Templatefiles> * @link http://conlite.conrepo.org
* @con_notice <Notice>
*
*
* @package ContenidoBackendArea
* @version <version>
* @author Jan Lengowski * @author Jan Lengowski
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt * @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de * @link http://www.4fb.de
* @link http://www.contenido.org * @link http://www.contenido.org
* *
*
*
* {@internal
* created 2003-01-21
* modified 2005-09-29, Andreas Lindner
* modified 2008-07-04, bilal arslan, added security fix
* modified 2008-11-18, Murat Purc, add usage of Contenido_Url to create urls to frontend pages and redesign of HTML markup
* modified 2009-01-03, Murat Purc, synchronized with cms/front_crcloginform.inc.php
* modified 2011-02-07, Dominik Ziegler, fixed check of but_ok.gif and changed input type button to submit
*
* $Id$: * $Id$:
* }}
*
*/ */
/**
* security check
*/
if(!defined('CON_FRAMEWORK')) { if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -108,18 +93,17 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
} }
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $encoding[$lang] ?>" /> <meta charset="<?php echo $encoding[$lang] ?>" />
<title>:: :: :: :: Contenido Login</title> <title>:: :: :: :: Contenido Login</title>
<script type="text/javascript"><!-- <script type="text/javascript">
if (top != self) { if (top != self) {
top.location.href = self.location.href; top.location.href = self.location.href;
} }
// --></script> </script>
<style type="text/css"><!-- <style type="text/css">
* {margin:0; padding:0;} * {margin:0; padding:0;}
html, body {height: 100%;} html, body {height: 100%;}
body {background-color:#fff; font-family: Verdana, Arial, Helvetica, Sans-Serif; font-size: 11px; color:#000;} body {background-color:#fff; font-family: Verdana, Arial, Helvetica, Sans-Serif; font-size: 11px; color:#000;}
@ -134,7 +118,7 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
#login .formHeader {font-weight:bold; background-color:<?php echo $cfg['color']['table_header'] ?>; border-bottom:1px solid <?php echo $cfg['color']['table_border'] ?>; padding:3px; margin-bottom:10px;} #login .formHeader {font-weight:bold; background-color:<?php echo $cfg['color']['table_header'] ?>; border-bottom:1px solid <?php echo $cfg['color']['table_border'] ?>; padding:3px; margin-bottom:10px;}
#login .formRow {padding:0 10px; height:31px;} #login .formRow {padding:0 10px; height:31px;}
#login .clear {clear:both;} #login .clear {clear:both;}
// --></style> </style>
</head> </head>
<body> <body>
@ -156,13 +140,14 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
</form> </form>
</div> </div>
<script type="text/javascript"><!-- <script type="text/javascript">
if (document.login.username.value == '') { <!--
if (document.login.username.value == '') {
document.login.username.focus(); document.login.username.focus();
} else { } else {
document.login.password.focus(); document.login.password.focus();
} }
// --></script> // -->
</script>
</body> </body>
</html> </html>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -26,14 +27,13 @@
* *
* $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"). * Constructor. Creates an HTML select field (aka "DropDown").
* *
@ -45,13 +45,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @param string $sAccesskey Key to access the field * @param string $sAccesskey Key to access the field
* *
* @return none * @return none
**/ * */
function cHTMLInputSelectElement ($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "") function __construct($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "") {
{
cHTMLSelectElement :: __construct($sName, $iWidth, $sID, $bDisabled, $iTabIndex, $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.
* *
@ -61,27 +59,25 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @param string $sSpaces Just some "&nbsp;" to show data hierarchically (used in conjunction with addCategories) * @param string $sSpaces Just some "&nbsp;" 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_ConLite; $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 {
@ -95,13 +91,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
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."&nbsp;&nbsp;&nbsp;".substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart")); $oOption = new cHTMLOptionElement($sSpaces . "&nbsp;&nbsp;&nbsp;" . 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
@ -111,8 +105,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
$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;");
@ -150,23 +143,22 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @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_ConLite; $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";
@ -177,8 +169,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
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");
@ -188,18 +179,17 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
} }
// 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.">&nbsp;".urldecode($oDB->f("name")), $sValue); $oOption = new cHTMLOptionElement($sSpaces . ">&nbsp;" . 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");
@ -227,24 +217,22 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @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_ConLite; $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";
@ -255,12 +243,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
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);
@ -279,14 +266,10 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* *
* @return none * @return none
*/ */
function setSelected($aElements) function setSelected($aElements) {
{ if (is_array($this->_options) && is_array($aElements)) {
if (is_array($this->_options) && is_array($aElements)) foreach ($this->_options as $sKey => $oOption) {
{ if (in_array($oOption->getAttribute("value"), $aElements)) {
foreach ($this->_options as $sKey => $oOption)
{
if (in_array($oOption->getAttribute("value"), $aElements))
{
$oOption->setSelected(true); $oOption->setSelected(true);
$this->_options[$sKey] = $oOption; $this->_options[$sKey] = $oOption;
} else { } else {
@ -296,13 +279,13 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
} }
} }
} }
} }
class UI_Config_Table class UI_Config_Table {
{
var $_sTplCellCode; var $_sTplCellCode;
var $_sTplTableFile; var $_sTplTableFile;
var $_sWidth; var $_sWidth;
var $_sBorder; var $_sBorder;
var $_sBorderColor; var $_sBorderColor;
@ -316,148 +299,125 @@ class UI_Config_Table
var $_aRowBgColor; var $_aRowBgColor;
var $_aRowExtra; var $_aRowExtra;
var $_bAddMultiSelJS; var $_bAddMultiSelJS;
var $_sColorLight; var $_sColorLight;
var $_sColorDark; var $_sColorDark;
function UI_Config_Table() function __construct() {
{
global $cfg; global $cfg;
$this->_sPadding = 2; $this->_sPadding = 2;
$this->_sBorder = 0; $this->_sBorder = 0;
$this->_sBorderColor = $cfg['color']['table_border']; $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->_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->_sTplTableFile = $cfg['path']['contenido'] . $cfg['path']['templates'] . $cfg['templates']['generic_list'];
$this->_sColorLight = $cfg['color']['table_light']; $this->_sColorLight = $cfg['color']['table_light'];
$this->_sColorDark = $cfg['color']['table_dark']; $this->_sColorDark = $cfg['color']['table_dark'];
} }
function setCellTemplate($sCode) function setCellTemplate($sCode) {
{
$this->_sTplCellCode = $sCode; $this->_sTplCellCode = $sCode;
} }
function setTableTemplateFile($sPath) {
function setTableTemplateFile($sPath)
{
$this->_sTplTableFile = $sPath; $this->_sTplTableFile = $sPath;
} }
function setLightColor($sColor) function setLightColor($sColor) {
{
$this->_sColorLight = $sColor; $this->_sColorLight = $sColor;
} }
function setDarkColor($sColor) function setDarkColor($sColor) {
{
$this->_sColorDark = $sColor; $this->_sColorDark = $sColor;
} }
function setAddMultiSelJS($bEnabled = true) function setAddMultiSelJS($bEnabled = true) {
{ $this->_bAddMultiSelJS = (bool) $bEnabled;
$this->_bAddMultiSelJS = (bool)$bEnabled;
} }
function setWidth ($sWidth) function setWidth($sWidth) {
{
$this->_sWidth = $sWidth; $this->_sWidth = $sWidth;
} }
function setPadding ($sPadding) function setPadding($sPadding) {
{
$this->_sPadding = $sPadding; $this->_sPadding = $sPadding;
} }
function setBorder ($sBorder) function setBorder($sBorder) {
{
$this->_sBorder = $sBorder; $this->_sBorder = $sBorder;
} }
function setBorderColor ($sBorderColor) function setBorderColor($sBorderColor) {
{
$this->_sBorderColor = $sBorderColor; $this->_sBorderColor = $sBorderColor;
} }
function setSolidBorder ($bSolidBorder = true) function setSolidBorder($bSolidBorder = true) {
{ $this->_bSolidBorder = (bool) $bSolidBorder;
$this->_bSolidBorder = (bool)$bSolidBorder;
} }
function setCell ($sRow, $sCell, $sContent) function setCell($sRow, $sCell, $sContent) {
{
$this->_aCells[$sRow][$sCell] = $sContent; $this->_aCells[$sRow][$sCell] = $sContent;
$this->_aCellAlignment[$sRow][$sCell] = ""; $this->_aCellAlignment[$sRow][$sCell] = "";
} }
function setCellAlignment ($sRow, $sCell, $sAlignment) function setCellAlignment($sRow, $sCell, $sAlignment) {
{
$this->_aCellAlignment[$sRow][$sCell] = $sAlignment; $this->_aCellAlignment[$sRow][$sCell] = $sAlignment;
} }
function setCellVAlignment ($sRow, $sCell, $sAlignment) function setCellVAlignment($sRow, $sCell, $sAlignment) {
{
$this->_aCellVAlignment[$sRow][$sCell] = $sAlignment; $this->_aCellVAlignment[$sRow][$sCell] = $sAlignment;
} }
function setCellColspan ($sRow, $sCell, $iColSpan) function setCellColspan($sRow, $sCell, $iColSpan) {
{
$this->_aCellColSpan[$sRow][$sCell] = $iColSpan; $this->_aCellColSpan[$sRow][$sCell] = $iColSpan;
} }
function setCellClass ($sRow, $sCell, $sClass) function setCellClass($sRow, $sCell, $sClass) {
{
$this->_aCellClass[$sRow][$sCell] = $sClass; $this->_aCellClass[$sRow][$sCell] = $sClass;
} }
function setRowBgColor ($sRow, $sColor) function setRowBgColor($sRow, $sColor) {
{
$this->_aRowBgColor[$sRow] = $sColor; $this->_aRowBgColor[$sRow] = $sColor;
} }
function setRowExtra ($sRow, $sExtra) function setRowExtra($sRow, $sExtra) {
{
$this->_aRowExtra[$sRow] = $sExtra; $this->_aRowExtra[$sRow] = $sExtra;
} }
function _addMultiSelJS() function _addMultiSelJS() {
{
// Trick: To save multiple selections in <select>-Element, add some JS which saves the // Trick: To save multiple selections in <select>-Element, add some JS which saves the
// selection, comma separated in a hidden input field on change. // selection, comma separated in a hidden input field on change.
// Try ... catch prevents error messages, if function is added more than once // Try ... catch prevents error messages, if function is added more than once
// if (!fncUpdateSel) in JS has not worked... // if (!fncUpdateSel) in JS has not worked...
$sSkript = ' <script type="text/javascript"><!--'."\n". $sSkript = ' <script type="text/javascript"><!--' . "\n" .
' try {'."\n". ' try {' . "\n" .
' function fncUpdateSel(sSelectBox, sStorage)'."\n". ' function fncUpdateSel(sSelectBox, sStorage)' . "\n" .
' {'."\n". ' {' . "\n" .
' var sSelection = "";'."\n". ' var sSelection = "";' . "\n" .
' var oSelectBox = document.getElementsByName(sSelectBox)[0];'."\n". ' var oSelectBox = document.getElementsByName(sSelectBox)[0];' . "\n" .
' var oStorage = document.getElementsByName(sStorage)[0];'."\n". ' var oStorage = document.getElementsByName(sStorage)[0];' . "\n" .
' '."\n". ' ' . "\n" .
' if (oSelectBox && oStorage)'."\n". ' if (oSelectBox && oStorage)' . "\n" .
' {'."\n". ' {' . "\n" .
' for (i = 0; i < oSelectBox.length; i++)'."\n". ' for (i = 0; i < oSelectBox.length; i++)' . "\n" .
' {'."\n". ' {' . "\n" .
' if(oSelectBox.options[i].selected == true)'."\n". ' if(oSelectBox.options[i].selected == true)' . "\n" .
' {'."\n". ' {' . "\n" .
' if (sSelection != "")'."\n". ' if (sSelection != "")' . "\n" .
' sSelection = sSelection + ",";'."\n". ' sSelection = sSelection + ",";' . "\n" .
' sSelection = sSelection + oSelectBox.options[i].value;'."\n". ' sSelection = sSelection + oSelectBox.options[i].value;' . "\n" .
' }'."\n". ' }' . "\n" .
' }'."\n". ' }' . "\n" .
' oStorage.value = sSelection;'."\n". ' oStorage.value = sSelection;' . "\n" .
' }'."\n". ' }' . "\n" .
' }'."\n". ' }' . "\n" .
' } catch (e) { }'."\n". ' } catch (e) { }' . "\n" .
' //--></script>'."\n"; ' //--></script>' . "\n";
return $sSkript; return $sSkript;
} }
function render($bPrint = false) function render($bPrint = false) {
{
$oTable = new Template; $oTable = new Template;
$oTable->reset(); $oTable->reset();
@ -469,31 +429,26 @@ class UI_Config_Table
$bDark = false; $bDark = false;
$sBgColor = ""; $sBgColor = "";
$bMultiSelJSAdded = false; $bMultiSelJSAdded = false;
if (is_array($this->_aCells)) if (is_array($this->_aCells)) {
{ foreach ($this->_aCells as $sRow => $aCells) {
foreach ($this->_aCells as $sRow => $aCells)
{
$iColCount++; $iColCount++;
//$bDark = !$bDark; //$bDark = !$bDark;
$sLine = ""; $sLine = "";
$iCount = 0; $iCount = 0;
foreach ($aCells as $sCell => $sData) foreach ($aCells as $sCell => $sData) {
{
$iCount++; $iCount++;
$sTplCell = $this->_sTplCellCode; $sTplCell = $this->_sTplCellCode;
if ($this->_bSolidBorder) if ($this->_bSolidBorder) {
{ if ($iCount < count($aCells)) {
if ($iCount < count($aCells))
{
if ($iColCount < count($this->_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); $sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
} else { } else {
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell); $sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
} }
} else if ($iColCount < count($this->_aCells)) { } else if ($iColCount < count($this->_aCells)) {
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-bottom: 1px; border-color: '.$this->_sBorderColor.'; border-style: solid;', $sTplCell); $sTplCell = str_replace('{EXTRA}', 'border: 0px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
} else { } else {
$sTplCell = str_replace('{EXTRA}', '', $sTplCell); $sTplCell = str_replace('{EXTRA}', '', $sTplCell);
} }
@ -557,7 +512,7 @@ class UI_Config_Table
if ($this->_sWidth) { if ($this->_sWidth) {
// Table: Width // Table: Width
$oTable->set('s', 'EXTRA', 'width: '.$this->_sWidth.';'); $oTable->set('s', 'EXTRA', 'width: ' . $this->_sWidth . ';');
} else { } else {
$oTable->set('s', 'EXTRA', ''); $oTable->set('s', 'EXTRA', '');
} }
@ -569,5 +524,7 @@ class UI_Config_Table
return $sRendered; return $sRendered;
} }
} }
} }
?> ?>

Datei anzeigen

@ -1,6 +1,6 @@
auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true
include.path=${php.global.include.path} include.path=${php.global.include.path}
php.version=PHP_80 php.version=PHP_81
source.encoding=UTF-8 source.encoding=UTF-8
src.dir=. src.dir=.
tags.asp=false tags.asp=false