Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a86145307 | ||
|
|
1afc0eb982 | ||
|
|
a7e7539911 | ||
|
|
6e3f017960 | ||
|
|
80715e5ef1 |
@@ -8,7 +8,7 @@
|
|||||||
-- DROP TABLE edit_access;
|
-- DROP TABLE edit_access;
|
||||||
CREATE TABLE edit_access (
|
CREATE TABLE edit_access (
|
||||||
edit_access_id SERIAL PRIMARY KEY,
|
edit_access_id SERIAL PRIMARY KEY,
|
||||||
name VARCHAR(255) UNIQUE,
|
name VARCHAR UNIQUE,
|
||||||
description VARCHAR,
|
description VARCHAR,
|
||||||
COLOR VARCHAR
|
COLOR VARCHAR
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
-- DROP TABLE edit_group;
|
-- DROP TABLE edit_group;
|
||||||
CREATE TABLE edit_group (
|
CREATE TABLE edit_group (
|
||||||
edit_group_id SERIAL PRIMARY KEY,
|
edit_group_id SERIAL PRIMARY KEY,
|
||||||
name VARCHAR(50),
|
name VARCHAR,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
edit_scheme_id INT,
|
edit_scheme_id INT,
|
||||||
edit_access_right_id INT NOT NULL,
|
edit_access_right_id INT NOT NULL,
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
-- DROP TABLE edit_language;
|
-- DROP TABLE edit_language;
|
||||||
CREATE TABLE edit_language (
|
CREATE TABLE edit_language (
|
||||||
edit_language_id SERIAL PRIMARY KEY,
|
edit_language_id SERIAL PRIMARY KEY,
|
||||||
short_name VARCHAR(2),
|
short_name VARCHAR,
|
||||||
long_name VARCHAR(70),
|
long_name VARCHAR,
|
||||||
iso_name VARCHAR(12),
|
iso_name VARCHAR,
|
||||||
order_number INT,
|
order_number INT,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
lang_default SMALLINT NOT NULL DEFAULT 0 UNIQUE
|
lang_default SMALLINT NOT NULL DEFAULT 0
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|
||||||
INSERT INTO edit_language (short_name, long_name, iso_name, order_number, enabled, lang_default) VALUES ('en', 'English', 'UTF-8', 1, 1, 1);
|
INSERT INTO edit_language (short_name, long_name, iso_name, order_number, enabled, lang_default) VALUES ('en', 'English', 'UTF-8', 1, 1, 1);
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
-- DROP TABLE edit_menu_group;
|
-- DROP TABLE edit_menu_group;
|
||||||
CREATE TABLE edit_menu_group (
|
CREATE TABLE edit_menu_group (
|
||||||
edit_menu_group_id SERIAL PRIMARY KEY,
|
edit_menu_group_id SERIAL PRIMARY KEY,
|
||||||
name VARCHAR(255),
|
name VARCHAR,
|
||||||
flag VARCHAR(50),
|
flag VARCHAR,
|
||||||
order_number INT NOT NULL
|
order_number INT NOT NULL
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
-- DROP TABLE edit_page;
|
-- DROP TABLE edit_page;
|
||||||
CREATE TABLE edit_page (
|
CREATE TABLE edit_page (
|
||||||
edit_page_id SERIAL PRIMARY KEY,
|
edit_page_id SERIAL PRIMARY KEY,
|
||||||
filename VARCHAR(70),
|
filename VARCHAR,
|
||||||
name VARCHAR(255) UNIQUE,
|
name VARCHAR UNIQUE,
|
||||||
order_number INT NOT NULL,
|
order_number INT NOT NULL,
|
||||||
online SMALLINT NOT NULL DEFAULT 0,
|
online SMALLINT NOT NULL DEFAULT 0,
|
||||||
menu SMALLINT NOT NULL DEFAULT 0,
|
menu SMALLINT NOT NULL DEFAULT 0,
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
-- DROP TABLE edit_query_string;
|
-- DROP TABLE edit_query_string;
|
||||||
CREATE TABLE edit_query_string (
|
CREATE TABLE edit_query_string (
|
||||||
edit_query_string_id SERIAL PRIMARY KEY,
|
edit_query_string_id SERIAL PRIMARY KEY,
|
||||||
name VARCHAR(255),
|
name VARCHAR,
|
||||||
value VARCHAR(255),
|
value VARCHAR,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
dynamic SMALLINT NOT NULL DEFAULT 0,
|
dynamic SMALLINT NOT NULL DEFAULT 0,
|
||||||
edit_page_id INT NOT NULL,
|
edit_page_id INT NOT NULL,
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
CREATE TABLE edit_scheme (
|
CREATE TABLE edit_scheme (
|
||||||
edit_scheme_id SERIAL PRIMARY KEY,
|
edit_scheme_id SERIAL PRIMARY KEY,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
name VARCHAR(50),
|
name VARCHAR,
|
||||||
header_color VARCHAR(7),
|
header_color VARCHAR,
|
||||||
css_file VARCHAR(50),
|
css_file VARCHAR,
|
||||||
template VARCHAR(50)
|
template VARCHARs
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Default Scheme', '#E0E2FF', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Default Scheme', 'E0E2FF', 1);
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Admin', '#CC7E7E', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Admin', 'CC7E7E', 1);
|
||||||
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Visitor', '#B0C4B3', 1);
|
INSERT INTO edit_scheme (name, header_color, enabled) VALUES ('Visitor', 'B0C4B3', 1);
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
|
|
||||||
-- DROP TABLE temp_files;
|
-- DROP TABLE temp_files;
|
||||||
CREATE TABLE temp_files (
|
CREATE TABLE temp_files (
|
||||||
filename VARCHAR(250)
|
filename VARCHAR
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
-- DROP TABLE edit_visible_group;
|
-- DROP TABLE edit_visible_group;
|
||||||
CREATE TABLE edit_visible_group (
|
CREATE TABLE edit_visible_group (
|
||||||
edit_visible_group_id SERIAL PRIMARY KEY,
|
edit_visible_group_id SERIAL PRIMARY KEY,
|
||||||
name VARCHAR(255),
|
name VARCHAR,
|
||||||
flag VARCHAR(50)
|
flag VARCHAR
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|
||||||
DELETE FROM edit_visible_group;
|
DELETE FROM edit_visible_group;
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ The active branch, which is the namespace branch
|
|||||||
|
|
||||||
### legacy
|
### legacy
|
||||||
|
|
||||||
The old non namepsace format layout. This will only get bug fixes and no new development
|
The old non namepsace format layout.
|
||||||
|
This is fully deprecated and will no longer be maintaned.
|
||||||
|
last tested PHP 5.6 and PHP 7.0
|
||||||
|
|
||||||
### namespace
|
### namespace
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ extract($_POST, EXTR_SKIP);
|
|||||||
|
|
||||||
$table_width = 750;
|
$table_width = 750;
|
||||||
// this is for certain CMS modules that set a relative path
|
// this is for certain CMS modules that set a relative path
|
||||||
define(REL_PATH, '');
|
define('REL_PATH', '');
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
include("config.inc");
|
include("config.inc");
|
||||||
@@ -137,7 +137,7 @@ $DATA['GROUP_NAME'] = $_SESSION["GROUP_NAME"];
|
|||||||
$DATA['GROUP_LEVEL'] = $_SESSION["GROUP_LEVEL"];
|
$DATA['GROUP_LEVEL'] = $_SESSION["GROUP_LEVEL"];
|
||||||
$PAGES = $_SESSION["PAGES"];
|
$PAGES = $_SESSION["PAGES"];
|
||||||
|
|
||||||
//$form->debug('menu', $form->print_ar($PAGES));
|
//$form->debug('menu', $form->printAr($PAGES));
|
||||||
|
|
||||||
// baue nav aus $PAGES ...
|
// baue nav aus $PAGES ...
|
||||||
for ($i = 0; $i < count($PAGES); $i ++) {
|
for ($i = 0; $i < count($PAGES); $i ++) {
|
||||||
@@ -292,7 +292,7 @@ if ($form->yes) {
|
|||||||
print "[No valid page definition given]";
|
print "[No valid page definition given]";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// $form->debug('edit', "Elements: <pre>".$form->print_ar($elements));
|
// $form->debug('edit', "Elements: <pre>".$form->printAr($elements));
|
||||||
$DATA['elements'] = $elements;
|
$DATA['elements'] = $elements;
|
||||||
$DATA['hidden'] = $form->formCreateHiddenFields();
|
$DATA['hidden'] = $form->formCreateHiddenFields();
|
||||||
$DATA['save_delete'] = $form->formCreateSaveDelete();
|
$DATA['save_delete'] = $form->formCreateSaveDelete();
|
||||||
@@ -304,7 +304,7 @@ $DEBUG_DATA['DEBUG'] = $DEBUG_TMPL;
|
|||||||
// create main data array
|
// create main data array
|
||||||
$CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);
|
$CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);
|
||||||
// data is 1:1 mapping (all vars, values, etc)
|
// data is 1:1 mapping (all vars, values, etc)
|
||||||
while (list($key, $value) = each($CONTENT_DATA)) {
|
foreach ($CONTENT_DATA as $key => $value) {
|
||||||
$smarty->assign($key, $value);
|
$smarty->assign($key, $value);
|
||||||
}
|
}
|
||||||
if (is_dir(BASE.TEMPLATES_C)) {
|
if (is_dir(BASE.TEMPLATES_C)) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?
|
<?
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
|
* AUTHOR: Clemens Schwaighofer
|
||||||
* CREATED: 2003/06/10
|
* CREATED: 2003/06/10
|
||||||
* SHORT DESCRIPTION:
|
* SHORT DESCRIPTION:
|
||||||
* configuration file
|
* configuration file
|
||||||
@@ -9,16 +9,16 @@
|
|||||||
|
|
||||||
/************* SESSION NAMES *************/
|
/************* SESSION NAMES *************/
|
||||||
// backend
|
// backend
|
||||||
DEFINE('EDIT_SESSION_NAME', "<ADMIN SESSION NAME>");
|
DEFINE('EDIT_SESSION_NAME', '<ADMIN SESSION NAME>');
|
||||||
// frontend
|
// frontend
|
||||||
DEFINE('SESSION_NAME', "<SESSION NAME>");
|
DEFINE('SESSION_NAME', '<SESSION NAME>');
|
||||||
// set the session name
|
// set the session name
|
||||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||||
|
|
||||||
/************* LANGUAGE / ENCODING *******/
|
/************* LANGUAGE / ENCODING *******/
|
||||||
DEFINE('DEFAULT_LANG', "en_utf8");
|
DEFINE('DEFAULT_LANG', 'en_utf8');
|
||||||
// default web page encoding setting
|
// default web page encoding setting
|
||||||
DEFINE('DEFAULT_ENCODING', "UTF-8");
|
DEFINE('DEFAULT_ENCODING', 'UTF-8');
|
||||||
|
|
||||||
/************* PATHS *********************/
|
/************* PATHS *********************/
|
||||||
// directory seperator
|
// directory seperator
|
||||||
@@ -40,51 +40,51 @@ DEFINE('INCLUDES', 'includes'.DS);
|
|||||||
// layout base path
|
// layout base path
|
||||||
DEFINE('LAYOUT', 'layout'.DS);
|
DEFINE('LAYOUT', 'layout'.DS);
|
||||||
// pic-root (compatible to CMS)
|
// pic-root (compatible to CMS)
|
||||||
DEFINE('PICTURES', "images".DS);
|
DEFINE('PICTURES', 'images'.DS);
|
||||||
// images
|
// images
|
||||||
DEFINE('IMAGES', "images".DS);
|
DEFINE('IMAGES', 'images'.DS);
|
||||||
// icons (below the images/ folder)
|
// icons (below the images/ folder)
|
||||||
DEFINE('ICONS', 'icons'.DS);
|
DEFINE('ICONS', 'icons'.DS);
|
||||||
// media
|
// media
|
||||||
DEFINE('MEDIA', "media".DS);
|
DEFINE('MEDIA', 'media'.DS);
|
||||||
// flash-root (below media)
|
// flash-root (below media)
|
||||||
DEFINE('FLASH', "flash".DS);
|
DEFINE('FLASH', 'flash'.DS);
|
||||||
// uploads (anything to keep)
|
// uploads (anything to keep)
|
||||||
DEFINE('UPLOADS', "uploads".DS);
|
DEFINE('UPLOADS', 'uploads'.DS);
|
||||||
// files (binaries) (below media)
|
// files (binaries) (below media)
|
||||||
DEFINE('BINARIES', "binaries".DS);
|
DEFINE('BINARIES', 'binaries'.DS);
|
||||||
// files (videos) (below media)
|
// files (videos) (below media)
|
||||||
DEFINE('VIDEOS', "videos".DS);
|
DEFINE('VIDEOS', 'videos'.DS);
|
||||||
// files (documents) (below media)
|
// files (documents) (below media)
|
||||||
DEFINE('DOCUMENTS', "documents".DS);
|
DEFINE('DOCUMENTS', 'documents'.DS);
|
||||||
// files (pdfs) (below media)
|
// files (pdfs) (below media)
|
||||||
DEFINE('PDFS', "documents".DS);
|
DEFINE('PDFS', 'documents'.DS);
|
||||||
// CSV
|
// CSV
|
||||||
DEFINE('CSV', 'csv'.DS);
|
DEFINE('CSV', 'csv'.DS);
|
||||||
// css
|
// css
|
||||||
DEFINE('CSS', "css".DS);
|
DEFINE('CSS', 'css'.DS);
|
||||||
// js
|
// js
|
||||||
DEFINE('JS', "javascript".DS);
|
DEFINE('JS', 'javascript'.DS);
|
||||||
// table arrays
|
// table arrays
|
||||||
DEFINE('TABLE_ARRAYS', "table_arrays".DS);
|
DEFINE('TABLE_ARRAYS', 'table_arrays'.DS);
|
||||||
// smarty libs path
|
// smarty libs path
|
||||||
DEFINE('SMARTY', "Smarty".DS);
|
DEFINE('SMARTY', 'Smarty'.DS);
|
||||||
// po langs
|
// po langs
|
||||||
DEFINE('LANG', "lang".DS);
|
DEFINE('LANG', 'lang'.DS);
|
||||||
// cache path
|
// cache path
|
||||||
DEFINE('CACHE', "cache".DS);
|
DEFINE('CACHE', 'cache'.DS);
|
||||||
// temp path
|
// temp path
|
||||||
DEFINE('TMP', "tmp".DS);
|
DEFINE('TMP', 'tmp'.DS);
|
||||||
// log files
|
// log files
|
||||||
DEFINE('LOG', 'log'.DS);
|
DEFINE('LOG', 'log'.DS);
|
||||||
// compiled template folder
|
// compiled template folder
|
||||||
DEFINE('TEMPLATES_C', 'templates_c'.DS);
|
DEFINE('TEMPLATES_C', 'templates_c'.DS);
|
||||||
// template base
|
// template base
|
||||||
DEFINE('TEMPLATES', "templates".DS);
|
DEFINE('TEMPLATES', 'templates'.DS);
|
||||||
// frontend template dir', only for admin
|
// frontend template dir', only for admin
|
||||||
DEFINE('TEMPLATES_FRONTEND', "templates_frontend".DS);
|
DEFINE('TEMPLATES_FRONTEND', 'templates_frontend'.DS);
|
||||||
// default template
|
// default template
|
||||||
DEFINE('DEFAULT_TEMPLATE', "default".DS);
|
DEFINE('DEFAULT_TEMPLATE', 'default'.DS);
|
||||||
// default template file
|
// default template file
|
||||||
DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl');
|
DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl');
|
||||||
|
|
||||||
@@ -102,14 +102,14 @@ DEFINE('DEFAULT_ACL_SEND', 70);
|
|||||||
DEFINE('DEFAULT_ACL_DEL', 80);
|
DEFINE('DEFAULT_ACL_DEL', 80);
|
||||||
DEFINE('DEFAULT_ACL_ADMIN', 100); */
|
DEFINE('DEFAULT_ACL_ADMIN', 100); */
|
||||||
// SSL host name
|
// SSL host name
|
||||||
// DEFINE('SSL_HOST', "ssl.host.name");
|
// DEFINE('SSL_HOST', 'ssl.host.name');
|
||||||
// error page strictness, Default is 3
|
// error page strictness, Default is 3
|
||||||
// 1: only show error page as the last mesure if really no mid & aid can be loaded and found at all
|
// 1: only show error page as the last mesure if really no mid & aid can be loaded and found at all
|
||||||
// 2: if template not found, do not search, show error template
|
// 2: if template not found, do not search, show error template
|
||||||
// 3: if default template is not found, show error template, do not fall back to default tree
|
// 3: if default template is not found, show error template, do not fall back to default tree
|
||||||
// 4: very strict, even on normal fixable errors through error
|
// 4: very strict, even on normal fixable errors through error
|
||||||
// DEFINE('ERROR_STRICT', 3);
|
// DEFINE('ERROR_STRICT', 3);
|
||||||
// allow page caching in general, set to "FALSE" if you do debugging or development!
|
// allow page caching in general, set to 'FALSE' if you do debugging or development!
|
||||||
// DEFINE('ALLOW_SMARTY_CACHE', FALSE);
|
// DEFINE('ALLOW_SMARTY_CACHE', FALSE);
|
||||||
// cache life time, in seconds, default here is 2 days (172800s)
|
// cache life time, in seconds, default here is 2 days (172800s)
|
||||||
// -1 is never expire cache
|
// -1 is never expire cache
|
||||||
@@ -134,6 +134,11 @@ DEFINE('PAGE_WIDTH', 800);
|
|||||||
// the default template name
|
// the default template name
|
||||||
DEFINE('MASTER_TEMPLATE_NAME', 'main_body.tpl');
|
DEFINE('MASTER_TEMPLATE_NAME', 'main_body.tpl');
|
||||||
|
|
||||||
|
// below two can be defined here, but they should be
|
||||||
|
// defined in either the header file or the file itself
|
||||||
|
/************* LOGGING *******************/
|
||||||
|
// DEFINE('LOG_FILE_ID', '');
|
||||||
|
|
||||||
/************* QUEUE TABLE *************/
|
/************* QUEUE TABLE *************/
|
||||||
// if we have a dev/live system
|
// if we have a dev/live system
|
||||||
// set_live is a per page/per item
|
// set_live is a per page/per item
|
||||||
@@ -151,32 +156,32 @@ DEFINE('LIVE_SCHEMA', 'public');
|
|||||||
/************* DB ACCESS *****************/
|
/************* DB ACCESS *****************/
|
||||||
// please be VERY carefull only to change the right side
|
// please be VERY carefull only to change the right side
|
||||||
$DB_CONFIG = array (
|
$DB_CONFIG = array (
|
||||||
"<db id>" => array (
|
'<db id>' => array (
|
||||||
"db_name" => "<database>",
|
'db_name' => '<database>',
|
||||||
"db_user" => "<user>",
|
'db_user' => '<user>',
|
||||||
"db_pass" => "<password>",
|
'db_pass' => '<password>',
|
||||||
"db_host" => "<host>",
|
'db_host' => '<host>',
|
||||||
"db_port" => "5432",
|
'db_port' => '5432',
|
||||||
"db_schema" => "public", // if not set, uses public
|
'db_schema' => 'public', // if not set, uses public
|
||||||
"db_type" => "pgsql",
|
'db_type' => 'pgsql',
|
||||||
"db_encoding" => '',
|
'db_encoding' => '',
|
||||||
"db_ssl" => 'disable' // allow, disable, require, prefer
|
'db_ssl' => 'disable' // allow, disable, require, prefer
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// File and Folder paths
|
// File and Folder paths
|
||||||
// ID is TARGET (first array element)
|
// ID is TARGET (first array element)
|
||||||
// $PATHS["test"]["csv_path"] = "";
|
// $PATHS['test']['csv_path'] = '';
|
||||||
// $PATHS["test"]["perl_bin"] = "";
|
// $PATHS['test']['perl_bin'] = '';
|
||||||
// $PATHS["test"]["redirect_url"] = "";
|
// $PATHS['test']['redirect_url'] = '';
|
||||||
|
|
||||||
// each host has a different db_host
|
// each host has a different db_host
|
||||||
// development host
|
// development host
|
||||||
$DB_HOST['<host>'] = "<db id>";
|
$DB_HOST['<host>'] = '<db id>';
|
||||||
// target host (live)
|
// target host (live)
|
||||||
// $DB_TARGET_HOST['<host>'] = "<DB ID>";
|
// $DB_TARGET_HOST['<host>'] = '<DB ID>';
|
||||||
// url redirect database
|
// url redirect database
|
||||||
// $DB_URL_REDIRECT_HOST['<host>'] = "<DB ID>";
|
// $DB_URL_REDIRECT_HOST['<host>'] = '<DB ID>';
|
||||||
// location flagging
|
// location flagging
|
||||||
// test/dev/live
|
// test/dev/live
|
||||||
$LOCATION['<host>'] = '<test|live|remote|etc>';
|
$LOCATION['<host>'] = '<test|live|remote|etc>';
|
||||||
@@ -192,9 +197,9 @@ $USE_DATABASE = defined('USE_DATABASE') ? USE_DATABASE : true;
|
|||||||
// live frontend pages
|
// live frontend pages
|
||||||
// ** missing live domains **
|
// ** missing live domains **
|
||||||
// get the name without the port
|
// get the name without the port
|
||||||
list($HOST_NAME, $PORT) = array_pad(explode(":", $_SERVER['HTTP_HOST'], 2), 2, null);
|
list($HOST_NAME) = array_pad(explode(':', $_SERVER['HTTP_HOST'], 2), 2, null);
|
||||||
if (!$DB_HOST[$HOST_NAME] && $USE_DATABASE) {
|
if (!$DB_HOST[$HOST_NAME] && $USE_DATABASE) {
|
||||||
echo "No matching DB config found. Contact Admin<br>";
|
echo 'No matching DB config found. Contact Admin<br>';
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,11 +226,11 @@ DEFINE('SHOW_ALL_ERRORS', false); // show all errors if debug_all & show_error_h
|
|||||||
$G_TITLE = '<OVERALL PAGE TITLE>';
|
$G_TITLE = '<OVERALL PAGE TITLE>';
|
||||||
|
|
||||||
/************ STYLE SHEETS / JS **********/
|
/************ STYLE SHEETS / JS **********/
|
||||||
$EDIT_STYLESHEET = "edit.css";
|
$EDIT_STYLESHEET = 'edit.css';
|
||||||
$EDIT_JAVASCRIPT = "edit.js";
|
$EDIT_JAVASCRIPT = 'edit.js';
|
||||||
|
|
||||||
$STYLESHEET = "frontend.css";
|
$STYLESHEET = 'frontend.css';
|
||||||
$JAVASCRIPT = "frontend.js";
|
$JAVASCRIPT = 'frontend.js';
|
||||||
|
|
||||||
/************* CONVERT *******************/
|
/************* CONVERT *******************/
|
||||||
$paths = array (
|
$paths = array (
|
||||||
@@ -235,14 +240,14 @@ $paths = array (
|
|||||||
);
|
);
|
||||||
// find convert
|
// find convert
|
||||||
foreach ($paths as $path) {
|
foreach ($paths as $path) {
|
||||||
if (file_exists($path."/convert") && is_file($path."/convert")) {
|
if (file_exists($path.DS.'convert') && is_file($path.DS.'convert')) {
|
||||||
// image magick convert location
|
// image magick convert location
|
||||||
DEFINE('CONVERT', $path."/convert");
|
DEFINE('CONVERT', $path.DS.'convert');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn off debug if debug flag is OFF
|
// turn off debug if debug flag is OFF
|
||||||
if (DEBUG == false) {
|
if (defined('DEBUG') && DEBUG == false) {
|
||||||
$ECHO_ALL = 0;
|
$ECHO_ALL = 0;
|
||||||
$DEBUG_ALL = 0;
|
$DEBUG_ALL = 0;
|
||||||
$PRINT_ALL = 0;
|
$PRINT_ALL = 0;
|
||||||
@@ -255,3 +260,5 @@ if (DEBUG == false) {
|
|||||||
|
|
||||||
// read auto loader
|
// read auto loader
|
||||||
require BASE.LIB.'autoloader.php';
|
require BASE.LIB.'autoloader.php';
|
||||||
|
|
||||||
|
# __END__
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
$q .= "eu.edit_access_right_id = eareu.edit_access_right_id AND ";
|
$q .= "eu.edit_access_right_id = eareu.edit_access_right_id AND ";
|
||||||
$q .= "eg.edit_access_right_id = eareg.edit_access_right_id AND ";
|
$q .= "eg.edit_access_right_id = eareg.edit_access_right_id AND ";
|
||||||
// password match is done in script, against old plain or new blowfish encypted
|
// password match is done in script, against old plain or new blowfish encypted
|
||||||
$q .= "(LOWER(username) = '".strtolower($this->username)."') ";
|
$q .= "(LOWER(username) = '".$this->dbEscapeString(strtolower($this->username))."') ";
|
||||||
$res = $this->dbReturn($q);
|
$res = $this->dbReturn($q);
|
||||||
// username is wrong, but we throw for wrong username and wrong password the same error
|
// username is wrong, but we throw for wrong username and wrong password the same error
|
||||||
if (!$this->cursor_ext[md5($q)]["num_rows"]) {
|
if (!$this->cursor_ext[md5($q)]["num_rows"]) {
|
||||||
|
|||||||
@@ -270,12 +270,12 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->int_pk_name = $this->pk_name;
|
$this->int_pk_name = $this->pk_name;
|
||||||
// check if reference_arrays are given and proceed them
|
// check if reference_arrays are given and proceed them
|
||||||
if (is_array($config_array["reference_arrays"])) {
|
if (is_array($config_array["reference_arrays"])) {
|
||||||
while (list($key, $value) = each($config_array["reference_arrays"])) {
|
foreach ($config_array["reference_arrays"] as $key => $value) {
|
||||||
$this->reference_array[$key] = $value;
|
$this->reference_array[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($config_array["element_list"])) {
|
if (is_array($config_array["element_list"])) {
|
||||||
while (list($key, $value) = each($config_array["element_list"])) {
|
foreach ($config_array["element_list"] as $key => $value) {
|
||||||
$this->element_list[$key] = $value;
|
$this->element_list[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,7 +319,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
$string .= "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
|
$string .= "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
$string .= "<b>$key</b>: ".$value["value"]."<br>";
|
$string .= "<b>$key</b>: ".$value["value"]."<br>";
|
||||||
}
|
}
|
||||||
return $string;
|
return $string;
|
||||||
@@ -347,7 +347,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
if ($value[$want_key] && !$key_value) {
|
if ($value[$want_key] && !$key_value) {
|
||||||
return $key;
|
return $key;
|
||||||
} elseif ($value[$want_key] == $key_value && $key_value) {
|
} elseif ($value[$want_key] == $key_value && $key_value) {
|
||||||
@@ -368,7 +368,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
if ($value[$want_key] && !$key_value) {
|
if ($value[$want_key] && !$key_value) {
|
||||||
array_push($key_array, $key);
|
array_push($key_array, $key);
|
||||||
}
|
}
|
||||||
@@ -474,22 +474,26 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
{
|
{
|
||||||
// only do if the user is allowed to delete
|
// only do if the user is allowed to delete
|
||||||
if ($this->group_level_user <= $this->security_level["delete"] && !$this->table_array["protected"]["value"] && !$this->error) {
|
if ($this->group_level_user <= $this->security_level["delete"] && !$this->table_array["protected"]["value"] && !$this->error) {
|
||||||
for ($i = 0; $i < count($element_list); $i ++) {
|
if (!is_array($element_list)) {
|
||||||
|
$element_list = array ();
|
||||||
|
}
|
||||||
|
for ($i = 0, $i_max = count($element_list); $i < $i_max; $i ++) {
|
||||||
// $this->debug('form_error', "Array: ".is_array($this->element_list[$element_list[$i]]["read_data"])." | ".$this->element_list[$element_list[$i]]["delete"]);
|
// $this->debug('form_error', "Array: ".is_array($this->element_list[$element_list[$i]]["read_data"])." | ".$this->element_list[$element_list[$i]]["delete"]);
|
||||||
// if prefix, set it
|
// if prefix, set it
|
||||||
$prfx = ($this->element_list[$element_list[$i]]["prefix"]) ? $this->element_list[$element_list[$i]]["prefix"]."_" : '';
|
$prfx = ($this->element_list[$element_list[$i]]["prefix"]) ? $this->element_list[$element_list[$i]]["prefix"]."_" : '';
|
||||||
// get the primary key
|
// get the primary key
|
||||||
while (list($el_name, $data) = each($this->element_list[$element_list[$i]]["elements"])) {
|
foreach ($this->element_list[$element_list[$i]]["elements"] as $el_name => $data) {
|
||||||
if ($data["pk_id"]) {
|
if ($data["pk_id"]) {
|
||||||
$pk_name = $el_name;
|
$pk_name = $el_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// which key should be deleted
|
// which key should be deleted
|
||||||
$id = $remove_name[$i];
|
$id = $remove_name[$i];
|
||||||
if (($this->element_list[$element_list[$i]]["delete_name"] || $this->element_list[$element_list[$i]]["delete"]) && !$this->element_list[$element_list[$i]]["enable_name"]) {
|
if (($this->element_list[$element_list[$i]]["delete_name"] || $this->element_list[$element_list[$i]]["delete"]) &&
|
||||||
|
!$this->element_list[$element_list[$i]]["enable_name"]
|
||||||
|
) {
|
||||||
// flag var name
|
// flag var name
|
||||||
$flag = $remove_name[$i]."_flag";
|
$flag = $remove_name[$i]."_flag";
|
||||||
|
|
||||||
if ($_POST[$flag] == "true") {
|
if ($_POST[$flag] == "true") {
|
||||||
$q = "DELETE FROM ".$element_list[$i]." WHERE ".$pk_name." = ".$_POST[$id];
|
$q = "DELETE FROM ".$element_list[$i]." WHERE ".$pk_name." = ".$_POST[$id];
|
||||||
$this->dbExec($q);
|
$this->dbExec($q);
|
||||||
@@ -497,7 +501,10 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->warning = 1;
|
$this->warning = 1;
|
||||||
} // post okay true -> delete
|
} // post okay true -> delete
|
||||||
} elseif (is_array($this->element_list[$element_list[$i]]["read_data"]) && !$this->element_list[$element_list[$i]]["delete"]) {
|
} elseif (is_array($this->element_list[$element_list[$i]]["read_data"]) && !$this->element_list[$element_list[$i]]["delete"]) {
|
||||||
for ($j = 0; $j < count($_POST[$id]); $j ++) {
|
if (!is_array($_POST[$id])) {
|
||||||
|
$_POST[$id] = array ();
|
||||||
|
}
|
||||||
|
for ($j = 0, $j_max = count($_POST[$id]); $j < $j_max; $j ++) {
|
||||||
// if it is not activated
|
// if it is not activated
|
||||||
if (!$_POST[$remove_name[$i]][$j]) {
|
if (!$_POST[$remove_name[$i]][$j]) {
|
||||||
$q = "UPDATE ".$element_list[$i]." WHERE ".$pk_name." = ".$_POST[$prfx.$pk_name][$j];
|
$q = "UPDATE ".$element_list[$i]." WHERE ".$pk_name." = ".$_POST[$prfx.$pk_name][$j];
|
||||||
@@ -511,7 +518,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// $this->debug('form_clean', "ID [$id] [$prfx.$pk_name]");
|
// $this->debug('form_clean', "ID [$id] [$prfx.$pk_name]");
|
||||||
// $this->debug('form_clean', "ID arr: ".$this->print_ar($_POST[$id]));
|
// $this->debug('form_clean', "ID arr: ".$this->print_ar($_POST[$id]));
|
||||||
// $this->debug('form_clean', "PK arr: ".$this->print_ar($_POST[$prfx.$pk_name]));
|
// $this->debug('form_clean', "PK arr: ".$this->print_ar($_POST[$prfx.$pk_name]));
|
||||||
for ($j = 0; $j < count($_POST[$prfx.$pk_name]); $j ++) {
|
for ($j = 0, $j_max = count($_POST[$prfx.$pk_name]); $j < $j_max; $j ++) {
|
||||||
if (!$_POST[$remove_name[$i]][$j] && $_POST[$prfx.$pk_name][$j]) {
|
if (!$_POST[$remove_name[$i]][$j] && $_POST[$prfx.$pk_name][$j]) {
|
||||||
$q = "DELETE FROM ".$element_list[$i]." WHERE ".$pk_name." = ".$_POST[$prfx.$pk_name][$j];
|
$q = "DELETE FROM ".$element_list[$i]." WHERE ".$pk_name." = ".$_POST[$prfx.$pk_name][$j];
|
||||||
// $this->debug('edit_db', "DEL: $q");
|
// $this->debug('edit_db', "DEL: $q");
|
||||||
@@ -540,13 +547,13 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
|
|
||||||
// lade liste
|
// lade liste
|
||||||
$this->dbExec($this->load_query);
|
$this->dbExec($this->load_query);
|
||||||
while ($res = $this->db_fetch_array()) {
|
while ($res = $this->dbFetchArray()) {
|
||||||
$pk_ids[] = $res[$this->int_pk_name];
|
$pk_ids[] = $res[$this->int_pk_name];
|
||||||
if ($res[$this->int_pk_name] == $this->table_array[$this->int_pk_name]["value"]) {
|
if ($res[$this->int_pk_name] == $this->table_array[$this->int_pk_name]["value"]) {
|
||||||
$pk_selected = $res[$this->int_pk_name];
|
$pk_selected = $res[$this->int_pk_name];
|
||||||
}
|
}
|
||||||
unset($t_string);
|
unset($t_string);
|
||||||
for ($i = 0; $i < count($this->field_array); $i ++) {
|
for ($i = 0, $i_max = count($this->field_array); $i < $i_max; $i ++) {
|
||||||
if ($t_string) {
|
if ($t_string) {
|
||||||
$t_string .= ", ";
|
$t_string .= ", ";
|
||||||
}
|
}
|
||||||
@@ -612,7 +619,14 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$show_delete = 1;
|
$show_delete = 1;
|
||||||
}
|
}
|
||||||
} // print save/delete row at all$
|
} // print save/delete row at all$
|
||||||
return array('seclevel_okay' => $seclevel_okay, 'save' => $save, 'pk_name' => $pk_name, 'pk_value' => $pk_value, 'show_delete' => $show_delete, 'hide_delete_checkbox' => $hide_delete_checkbox);
|
return array(
|
||||||
|
'seclevel_okay' => $seclevel_okay,
|
||||||
|
'save' => $save,
|
||||||
|
'pk_name' => $pk_name,
|
||||||
|
'pk_value' => $pk_value,
|
||||||
|
'show_delete' => $show_delete,
|
||||||
|
'hide_delete_checkbox' => $hide_delete_checkbox
|
||||||
|
);
|
||||||
} // end of function
|
} // end of function
|
||||||
|
|
||||||
// METHOD: formCreateElement
|
// METHOD: formCreateElement
|
||||||
@@ -717,7 +731,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$data['name'] = $element_name;
|
$data['name'] = $element_name;
|
||||||
$data['value'][] = "";
|
$data['value'][] = "";
|
||||||
$data['output'][] = $this->l->__("Please choose ...");
|
$data['output'][] = $this->l->__("Please choose ...");
|
||||||
while ($res = $this->db_return($query)) {
|
while ($res = $this->dbReturn($query)) {
|
||||||
$data['value'][] = $res[0];
|
$data['value'][] = $res[0];
|
||||||
$data['output'][] = $res[1];
|
$data['output'][] = $res[1];
|
||||||
if ($this->table_array[$element_name]["value"] == $res[0]) {
|
if ($this->table_array[$element_name]["value"] == $res[0]) {
|
||||||
@@ -743,7 +757,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$data['value'][] = "";
|
$data['value'][] = "";
|
||||||
$data['output'][] = $this->l->__("Please choose ...");
|
$data['output'][] = $this->l->__("Please choose ...");
|
||||||
// outer query overrules inner
|
// outer query overrules inner
|
||||||
while (list($key, $value) = each($query)) {
|
foreach ($query as $key => $value) {
|
||||||
$data['value'][] = $key;
|
$data['value'][] = $key;
|
||||||
$data['output'][] = $value;
|
$data['output'][] = $value;
|
||||||
if ($this->table_array[$element_name]["value"] == $key) {
|
if ($this->table_array[$element_name]["value"] == $key) {
|
||||||
@@ -757,7 +771,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$query = $this->table_array[$element_name]["query"];
|
$query = $this->table_array[$element_name]["query"];
|
||||||
}
|
}
|
||||||
$data['name'] = $element_name;
|
$data['name'] = $element_name;
|
||||||
while (list($key, $value) = each($query)) {
|
foreach ($query as $key => $value) {
|
||||||
$data['value'][] = $key;
|
$data['value'][] = $key;
|
||||||
$data['output'][] = $value;
|
$data['output'][] = $value;
|
||||||
if ($this->table_array[$element_name]["value"] == $key) {
|
if ($this->table_array[$element_name]["value"] == $key) {
|
||||||
@@ -806,7 +820,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
//if ($value["mandatory"] && $value["error_check"])
|
//if ($value["mandatory"] && $value["error_check"])
|
||||||
// if error value set && somethign input, check if input okay
|
// if error value set && somethign input, check if input okay
|
||||||
if ($value["error_check"] && $this->table_array[$key]["value"]) {
|
if ($value["error_check"] && $this->table_array[$key]["value"]) {
|
||||||
@@ -844,7 +858,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
break;
|
break;
|
||||||
// check unique, check if field in table is not yet exist
|
// check unique, check if field in table is not yet exist
|
||||||
case "unique":
|
case "unique":
|
||||||
$q = "SELECT ".$key." FROM ".$this->table_name." WHERE ".$key." = '".$this->db_escape_string($this->table_array[$key]["value"])."'";
|
$q = "SELECT ".$key." FROM ".$this->table_name." WHERE ".$key." = '".$this->dbEscapeString($this->table_array[$key]["value"])."'";
|
||||||
if ($this->table_array[$this->int_pk_name]["value"]) {
|
if ($this->table_array[$this->int_pk_name]["value"]) {
|
||||||
$q .= " AND ".$this->int_pk_name." <> ".$this->table_array[$this->int_pk_name]["value"];
|
$q .= " AND ".$this->int_pk_name." <> ".$this->table_array[$this->int_pk_name]["value"];
|
||||||
}
|
}
|
||||||
@@ -928,7 +942,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->reference_array = array ();
|
$this->reference_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->reference_array);
|
reset($this->reference_array);
|
||||||
while (list($key, $value) = each($this->reference_array)) {
|
foreach ($this->reference_array as $key => $value) {
|
||||||
if ($this->reference_array[$key]["mandatory"] && !$this->reference_array[$key]["selected"][0]) {
|
if ($this->reference_array[$key]["mandatory"] && !$this->reference_array[$key]["selected"][0]) {
|
||||||
$this->msg .= sprintf($this->l->__("Please select at least one Element from field <b>%s</b>!<br>"), $this->reference_array[$key]["output_name"]);
|
$this->msg .= sprintf($this->l->__("Please select at least one Element from field <b>%s</b>!<br>"), $this->reference_array[$key]["output_name"]);
|
||||||
}
|
}
|
||||||
@@ -938,7 +952,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
if (is_array($this->element_list)) {
|
if (is_array($this->element_list)) {
|
||||||
// check the mandatory stuff
|
// check the mandatory stuff
|
||||||
// if mandatory, check that at least on pk exists or if at least the mandatory field is filled
|
// if mandatory, check that at least on pk exists or if at least the mandatory field is filled
|
||||||
while (list($table_name, $reference_array) = each($this->element_list)) {
|
foreach ($this->element_list as $table_name => $reference_array) {
|
||||||
// set pk/fk id for this
|
// set pk/fk id for this
|
||||||
foreach ($reference_array['elements'] as $_name => $_data) {
|
foreach ($reference_array['elements'] as $_name => $_data) {
|
||||||
if ($_data['pk_id']) {
|
if ($_data['pk_id']) {
|
||||||
@@ -955,7 +969,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// get max elements
|
// get max elements
|
||||||
$max = 0;
|
$max = 0;
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
if (count($_POST[$prfx.$key]) > $max) {
|
if (is_array($_POST[$prfx.$key]) && count($_POST[$prfx.$key]) > $max) {
|
||||||
$max = count($_POST[$prfx.$key]);
|
$max = count($_POST[$prfx.$key]);
|
||||||
}
|
}
|
||||||
// $this->debug('edit_error_chk', "KEY: $prfx$key | count: ".count($_POST[$prfx.$key])." | M: $max");
|
// $this->debug('edit_error_chk', "KEY: $prfx$key | count: ".count($_POST[$prfx.$key])." | M: $max");
|
||||||
@@ -965,7 +979,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
# check each row
|
# check each row
|
||||||
for ($i = 0; $i < $max; $i ++) {
|
for ($i = 0; $i < $max; $i ++) {
|
||||||
// either one of the post pks is set, or the mandatory
|
// either one of the post pks is set, or the mandatory
|
||||||
while (list($el_name, $data_array) = each($reference_array["elements"])) {
|
foreach ($reference_array["elements"] as $el_name => $data_array) {
|
||||||
if ($data_array["mandatory"]) {
|
if ($data_array["mandatory"]) {
|
||||||
$mand_name = $data_array["output_name"];
|
$mand_name = $data_array["output_name"];
|
||||||
}
|
}
|
||||||
@@ -999,7 +1013,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
switch ($error_check) {
|
switch ($error_check) {
|
||||||
// check unique, check if field in table is not yet exist
|
// check unique, check if field in table is not yet exist
|
||||||
case "unique":
|
case "unique":
|
||||||
$q = "SELECT ".$_pk_name." FROM ".$table_name." WHERE ".$el_name." = '".$this->db_escape_string($_POST[$prfx.$el_name][$i])."'";
|
$q = "SELECT ".$_pk_name." FROM ".$table_name." WHERE ".$el_name." = '".$this->dbEscapeString($_POST[$prfx.$el_name][$i])."'";
|
||||||
if ($this->table_array[$this->int_pk_name]["value"]) {
|
if ($this->table_array[$this->int_pk_name]["value"]) {
|
||||||
$q .= " AND ".$this->int_pk_name." <> ".$this->table_array[$this->int_pk_name]["value"];
|
$q .= " AND ".$this->int_pk_name." <> ".$this->table_array[$this->int_pk_name]["value"];
|
||||||
}
|
}
|
||||||
@@ -1078,7 +1092,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
unset($this->table_array[$key]["value"]);
|
unset($this->table_array[$key]["value"]);
|
||||||
unset($this->table_array[$key]["input_value"]);
|
unset($this->table_array[$key]["input_value"]);
|
||||||
// if preset var present preset
|
// if preset var present preset
|
||||||
@@ -1091,7 +1105,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->reference_array = array ();
|
$this->reference_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->reference_array);
|
reset($this->reference_array);
|
||||||
while (list($key, $value) = each($this->reference_array)) {
|
foreach ($this->reference_array as $key => $value) {
|
||||||
unset($this->reference_array[$key]["selected"]);
|
unset($this->reference_array[$key]["selected"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1109,14 +1123,14 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
if ($pk_id) {
|
if ($pk_id) {
|
||||||
$this->pk_id = $pk_id;
|
$this->pk_id = $pk_id;
|
||||||
}
|
}
|
||||||
$this->table_array = $this->db_read(1);
|
$this->table_array = $this->dbRead(1);
|
||||||
|
|
||||||
// reset all temp fields
|
// reset all temp fields
|
||||||
if (!is_array($this->table_array)) {
|
if (!is_array($this->table_array)) {
|
||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
unset($this->table_array[$key]["input_value"]);
|
unset($this->table_array[$key]["input_value"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1126,10 +1140,10 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->reference_array = array ();
|
$this->reference_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->reference_array);
|
reset($this->reference_array);
|
||||||
while (list($key, $value) = each($this->reference_array)) {
|
foreach ($this->reference_array as $key => $value) {
|
||||||
unset($this->reference_array[$key]["selected"]);
|
unset($this->reference_array[$key]["selected"]);
|
||||||
$q = "SELECT ".$this->reference_array[$key]["other_table_pk"]." FROM ".$this->reference_array[$key]["table_name"]." WHERE ".$this->int_pk_name."=".$this->table_array[$this->int_pk_name]["value"];
|
$q = "SELECT ".$this->reference_array[$key]["other_table_pk"]." FROM ".$this->reference_array[$key]["table_name"]." WHERE ".$this->int_pk_name."=".$this->table_array[$this->int_pk_name]["value"];
|
||||||
while ($res = $this->db_return($q)) {
|
while ($res = $this->dbReturn($q)) {
|
||||||
$this->reference_array[$key]["selected"][] = $res[$this->reference_array[$key]["other_table_pk"]];
|
$this->reference_array[$key]["selected"][] = $res[$this->reference_array[$key]["other_table_pk"]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1151,13 +1165,13 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
// drop_down_db with input + reference table
|
// drop_down_db with input + reference table
|
||||||
// $this->debug('form', "A: ".$this->table_array[$key]["type"]." --- ".$this->table_array[$key]["input_value"]);
|
// $this->debug('form', "A: ".$this->table_array[$key]["type"]." --- ".$this->table_array[$key]["input_value"]);
|
||||||
if ($this->table_array[$key]["type"] == "drop_down_db_input" && $this->table_array[$key]["input_value"]) {
|
if ($this->table_array[$key]["type"] == "drop_down_db_input" && $this->table_array[$key]["input_value"]) {
|
||||||
// $this->debug('form', "HERE");
|
// $this->debug('form', "HERE");
|
||||||
// check if this text name already exists (lowercase compare)
|
// check if this text name already exists (lowercase compare)
|
||||||
$q = "SELECT ".$this->table_array[$key]["pk_name"]." FROM ".$this->table_array[$key]["table_name"]." WHERE LCASE(".$this->table_array[$key]["input_name"].") = '".$this->db_escape_string(strtolower($this->table_array[$key]["input_value"]))."'";
|
$q = "SELECT ".$this->table_array[$key]["pk_name"]." FROM ".$this->table_array[$key]["table_name"]." WHERE LCASE(".$this->table_array[$key]["input_name"].") = '".$this->dbEscapeString(strtolower($this->table_array[$key]["input_value"]))."'";
|
||||||
// if a where was given, add here
|
// if a where was given, add here
|
||||||
if ($this->table_array[$key]["where"]) {
|
if ($this->table_array[$key]["where"]) {
|
||||||
$q .= " AND ".$this->table_array[$key]["where"];
|
$q .= " AND ".$this->table_array[$key]["where"];
|
||||||
@@ -1168,7 +1182,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
} else {
|
} else {
|
||||||
// if a where was given, set this key also [dangerous!]
|
// if a where was given, set this key also [dangerous!]
|
||||||
// postgreSQL compatible insert
|
// postgreSQL compatible insert
|
||||||
$q = "INSERT INTO ".$this->table_array[$key]["table_name"]." (".$this->table_array[$key]["input_name"].") VALUES ('".$this->db_escape_string($this->table_array[$key]["input_value"])."')";
|
$q = "INSERT INTO ".$this->table_array[$key]["table_name"]." (".$this->table_array[$key]["input_name"].") VALUES ('".$this->dbEscapeString($this->table_array[$key]["input_value"])."')";
|
||||||
$this->dbExec($q);
|
$this->dbExec($q);
|
||||||
if ($this->table_array[$key]["where"]) {
|
if ($this->table_array[$key]["where"]) {
|
||||||
// make an update on the just inseted data with the where data als update values
|
// make an update on the just inseted data with the where data als update values
|
||||||
@@ -1186,7 +1200,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// if drop down & input are different
|
// if drop down & input are different
|
||||||
if ($this->table_array[$key]["input_value"] != $this->table_array[$key]["value"]) {
|
if ($this->table_array[$key]["input_value"] != $this->table_array[$key]["value"]) {
|
||||||
// check if "right input" is in DB
|
// check if "right input" is in DB
|
||||||
$q = "SELECT ".$this->table_array[$key]["input_name"]." FROM ".$this->table_array[$key]["table_name"]." WHERE LCASE(".$this->table_array[$key]["input_name"].") = '".strtolower($this->db_escape_string($this->table_array[$key]["input_value"]))."'";
|
$q = "SELECT ".$this->table_array[$key]["input_name"]." FROM ".$this->table_array[$key]["table_name"]." WHERE LCASE(".$this->table_array[$key]["input_name"].") = '".strtolower($this->dbEscapeString($this->table_array[$key]["input_value"]))."'";
|
||||||
// if a where was given, add here
|
// if a where was given, add here
|
||||||
if ($this->table_array[$key]["where"]) {
|
if ($this->table_array[$key]["where"]) {
|
||||||
$q .= " AND ".$this->table_array[$key]["where"];
|
$q .= " AND ".$this->table_array[$key]["where"];
|
||||||
@@ -1262,7 +1276,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$q = "DELETE FROM ".$reference_array["table_name"]." WHERE ".$this->int_pk_name."=".$this->table_array[$this->int_pk_name]["value"];
|
$q = "DELETE FROM ".$reference_array["table_name"]." WHERE ".$this->int_pk_name."=".$this->table_array[$this->int_pk_name]["value"];
|
||||||
$this->dbExec($q);
|
$this->dbExec($q);
|
||||||
$q = "INSERT INTO ".$reference_array["table_name"]." (".$reference_array["other_table_pk"].", ".$this->int_pk_name.") VALUES ";
|
$q = "INSERT INTO ".$reference_array["table_name"]." (".$reference_array["other_table_pk"].", ".$this->int_pk_name.") VALUES ";
|
||||||
for ($i = 0; $i < count($reference_array["selected"]); $i ++) {
|
for ($i = 0, $i_max = count($reference_array["selected"]); $i < $i_max; $i ++) {
|
||||||
$t_q = "(".$reference_array["selected"][$i].", ".$this->table_array[$this->int_pk_name]["value"].")";
|
$t_q = "(".$reference_array["selected"][$i].", ".$this->table_array[$this->int_pk_name]["value"].")";
|
||||||
$this->dbExec($q.$t_q);
|
$this->dbExec($q.$t_q);
|
||||||
}
|
}
|
||||||
@@ -1274,7 +1288,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->element_list = array ();
|
$this->element_list = array ();
|
||||||
}
|
}
|
||||||
reset($this->element_list);
|
reset($this->element_list);
|
||||||
while (list($table_name, $reference_array) = each($this->element_list)) {
|
foreach ($this->element_list as $table_name => $reference_array) {
|
||||||
// get the number of keys from the elements array
|
// get the number of keys from the elements array
|
||||||
$keys = array_keys($reference_array["elements"]);
|
$keys = array_keys($reference_array["elements"]);
|
||||||
// element prefix name
|
// element prefix name
|
||||||
@@ -1282,13 +1296,13 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// get max elements
|
// get max elements
|
||||||
$max = 0;
|
$max = 0;
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
if (count($_POST[$prfx.$key]) > $max) {
|
if (is_array($_POST[$prfx.$key]) && count($_POST[$prfx.$key]) > $max) {
|
||||||
$max = count($_POST[$prfx.$key]);
|
$max = count($_POST[$prfx.$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// $this->debug('edit_error', "MAX: $max");
|
// $this->debug('edit_error', "MAX: $max");
|
||||||
// check if there is a hidden key, update, else insert
|
// check if there is a hidden key, update, else insert
|
||||||
while (list($el_name, $data_array) = each($reference_array["elements"])) {
|
foreach ($reference_array["elements"] as $el_name => $data_array) {
|
||||||
// this is only for reference_data part, at least one of the text fields need to be set for writing
|
// this is only for reference_data part, at least one of the text fields need to be set for writing
|
||||||
$blow_write = array ();
|
$blow_write = array ();
|
||||||
// $this->debug('edit_error_query', "QUERY: ".$this->print_ar($_POST));
|
// $this->debug('edit_error_query', "QUERY: ".$this->print_ar($_POST));
|
||||||
@@ -1364,14 +1378,14 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$q_values[$i] .= $_value;
|
$q_values[$i] .= $_value;
|
||||||
} else {
|
} else {
|
||||||
// normal data gets escaped
|
// normal data gets escaped
|
||||||
$q_data[$i] .= $el_name." = '".$this->db_escape_string($_value)."'";
|
$q_data[$i] .= $el_name." = '".$this->dbEscapeString($_value)."'";
|
||||||
$q_values[$i] .= "'".$this->db_escape_string($_value)."'";
|
$q_values[$i] .= "'".$this->dbEscapeString($_value)."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // eche table elements
|
} // eche table elements
|
||||||
// finalize the queries, add FK key reference for inserts and run the query
|
// finalize the queries, add FK key reference for inserts and run the query
|
||||||
for ($i = 0; $i < count($type); $i ++) {
|
for ($i = 0, $i_max = count($type); $i < $i_max; $i ++) {
|
||||||
$q = '';
|
$q = '';
|
||||||
if (!$no_write[$i]) {
|
if (!$no_write[$i]) {
|
||||||
if ($type[$i] == "update") {
|
if ($type[$i] == "update") {
|
||||||
@@ -1416,7 +1430,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->element_list = array ();
|
$this->element_list = array ();
|
||||||
}
|
}
|
||||||
reset($this->element_list);
|
reset($this->element_list);
|
||||||
while (list($table_name, $data_array) = each($this->element_list)) {
|
foreach ($this->element_list as $table_name => $data_array) {
|
||||||
$q = "DELETE FROM ".$table_name." WHERE ".$this->int_pk_name." = ".$this->table_array[$this->int_pk_name]["value"];
|
$q = "DELETE FROM ".$table_name." WHERE ".$this->int_pk_name." = ".$this->table_array[$this->int_pk_name]["value"];
|
||||||
$this->dbExec($q);
|
$this->dbExec($q);
|
||||||
}
|
}
|
||||||
@@ -1426,12 +1440,12 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
if ($this->table_array[$key]["type"] == "file") {
|
if ($this->table_array[$key]["type"] == "file") {
|
||||||
unlink($this->table_array[$key]["save_dir"].$this->table_array[$key]["value"]);
|
unlink($this->table_array[$key]["save_dir"].$this->table_array[$key]["value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->db_delete();
|
$this->dbDelete();
|
||||||
$this->warning = 1;
|
$this->warning = 1;
|
||||||
$this->msg = $this->l->__("Dataset has been deleted!");
|
$this->msg = $this->l->__("Dataset has been deleted!");
|
||||||
}
|
}
|
||||||
@@ -1441,21 +1455,25 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// PARAMS: $hidden_array
|
// PARAMS: $hidden_array
|
||||||
// RETURN: the input fields (html)
|
// RETURN: the input fields (html)
|
||||||
// DESC : creates HTML hidden input fields out of an hash array
|
// DESC : creates HTML hidden input fields out of an hash array
|
||||||
public function formCreateHiddenFields($hidden_array = "")
|
public function formCreateHiddenFields($hidden_array = array ())
|
||||||
{
|
{
|
||||||
$hidden = array ();
|
$hidden = array ();
|
||||||
if (!is_array($this->table_array)) {
|
if (!is_array($this->table_array)) {
|
||||||
$this->table_array = array ();
|
$this->table_array = array ();
|
||||||
}
|
}
|
||||||
reset($this->table_array);
|
reset($this->table_array);
|
||||||
while (list($key, $value) = each($this->table_array)) {
|
foreach ($this->table_array as $key => $value) {
|
||||||
if ($this->table_array[$key]["type"] == "hidden") {
|
if ($this->table_array[$key]["type"] == "hidden") {
|
||||||
$hidden_array[$key] = $this->table_array[$key]["value"];
|
if (array_key_exists($key, $this->table_array)) {
|
||||||
|
$hidden_array[$key] = $this->table_array[$key]["value"];
|
||||||
|
} else {
|
||||||
|
$hidden_array[$key] = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($hidden_array)) {
|
if (is_array($hidden_array)) {
|
||||||
reset($hidden_array);
|
reset($hidden_array);
|
||||||
while (list($key, $value) = each($hidden_array)) {
|
foreach ($hidden_array as $key => $value) {
|
||||||
$hidden[] = array('key' => $key, 'value' => $value);
|
$hidden[] = array('key' => $key, 'value' => $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1475,7 +1493,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
}
|
}
|
||||||
$data['name'] = $this->reference_array[$table_name]["other_table_pk"];
|
$data['name'] = $this->reference_array[$table_name]["other_table_pk"];
|
||||||
$data['size'] = $this->reference_array[$table_name]["select_size"];
|
$data['size'] = $this->reference_array[$table_name]["select_size"];
|
||||||
while ($res = $this->db_return($this->reference_array[$table_name]["query"])) {
|
while ($res = $this->dbReturn($this->reference_array[$table_name]["query"])) {
|
||||||
$data['value'][] = $res[0];
|
$data['value'][] = $res[0];
|
||||||
$data['output'][] = $res[1];
|
$data['output'][] = $res[1];
|
||||||
$data['selected'][] = ($this->checked($this->reference_array[$table_name]["selected"], $res[0])) ? $res[0] : '';
|
$data['selected'][] = ($this->checked($this->reference_array[$table_name]["selected"], $res[0])) ? $res[0] : '';
|
||||||
@@ -1523,7 +1541,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
reset($this->element_list[$table_name]["elements"]);
|
reset($this->element_list[$table_name]["elements"]);
|
||||||
// generic data read in (counts for all rows)
|
// generic data read in (counts for all rows)
|
||||||
// visible list data output
|
// visible list data output
|
||||||
while (list($el_name, $data_array) = each($this->element_list[$table_name]["elements"])) {
|
foreach ($this->element_list[$table_name]["elements"] as $el_name => $data_array) {
|
||||||
$this->debug('CFG', 'El: '.$el_name.' -> '.$this->print_ar($data_array));
|
$this->debug('CFG', 'El: '.$el_name.' -> '.$this->print_ar($data_array));
|
||||||
// if the element name matches the read array, then set the table as a name prefix
|
// if the element name matches the read array, then set the table as a name prefix
|
||||||
$q_select[] = $el_name; // this is for reading the data
|
$q_select[] = $el_name; // this is for reading the data
|
||||||
@@ -1542,7 +1560,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// only two elements are allowed: pos 0 is key, pso 1 is visible output name
|
// only two elements are allowed: pos 0 is key, pso 1 is visible output name
|
||||||
if ($data_array['type'] == 'drop_down_db') {
|
if ($data_array['type'] == 'drop_down_db') {
|
||||||
$md_q = md5($data_array['query']);
|
$md_q = md5($data_array['query']);
|
||||||
while ($res = $this->db_return($data_array['query'])) {
|
while ($res = $this->dbReturn($data_array['query'])) {
|
||||||
$this->debug('edit', "Q[$md_q] pos: ".$this->cursor_ext[$md_q]["pos"]." | want: ".$data_array["preset"]." | set: ".$data['preset'][$el_name]);
|
$this->debug('edit', "Q[$md_q] pos: ".$this->cursor_ext[$md_q]["pos"]." | want: ".$data_array["preset"]." | set: ".$data['preset'][$el_name]);
|
||||||
// first is default for this element
|
// first is default for this element
|
||||||
if (!$data['preset'][$el_name] && ($this->cursor_ext[$md_q]["pos"] == $data_array['preset'])) {
|
if (!$data['preset'][$el_name] && ($this->cursor_ext[$md_q]["pos"] == $data_array['preset'])) {
|
||||||
@@ -1555,7 +1573,19 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
} elseif ($data_array["element_list"]) {
|
} elseif ($data_array["element_list"]) {
|
||||||
$data['element_list'][$el_name] = $data_array["element_list"]; // this is for the checkboxes
|
$data['element_list'][$el_name] = $data_array["element_list"]; // this is for the checkboxes
|
||||||
}
|
}
|
||||||
$proto[$el_name] = ($this->error) ? $_POST[$el_name][(count($_POST[$el_name]) - 1)] : ''; // this is for the new line
|
$this->debug('CREATE ELEMENT LIST TABLE', 'Post: '.$el_name.' => '.$_POST[$el_name].' => '.is_array($_POST[$el_name]));
|
||||||
|
// if error, check new line addition so we don't loose it
|
||||||
|
if ($this->error) {
|
||||||
|
if (is_array($_POST[$el_name])) {
|
||||||
|
// this is for the new line
|
||||||
|
$proto[$el_name] = $_POST[$el_name][(count($_POST[$el_name]) - 1)];
|
||||||
|
} else {
|
||||||
|
$proto[$el_name] = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$proto[$el_name] = '';
|
||||||
|
}
|
||||||
|
// $proto[$el_name] = $this->error ? $_POST[$el_name][(count($_POST[$el_name]) - 1)] : '';
|
||||||
}
|
}
|
||||||
// $this->debug('CFG DATA', 'Data: '.$this->print_ar($data));
|
// $this->debug('CFG DATA', 'Data: '.$this->print_ar($data));
|
||||||
// $this->debug('CFG PROTO', 'Proto: '.$this->print_ar($proto));
|
// $this->debug('CFG PROTO', 'Proto: '.$this->print_ar($proto));
|
||||||
@@ -1610,11 +1640,11 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
if ($q) {
|
if ($q) {
|
||||||
$pos = 0; // position in while for overwrite if needed
|
$pos = 0; // position in while for overwrite if needed
|
||||||
// read out the list and add the selected data if needed
|
// read out the list and add the selected data if needed
|
||||||
while ($res = $this->db_return($q)) {
|
while ($res = $this->dbReturn($q)) {
|
||||||
$_data = array ();
|
$_data = array ();
|
||||||
$prfx = $data["prefix"]; // short
|
$prfx = $data["prefix"]; // short
|
||||||
// go through each res
|
// go through each res
|
||||||
for ($i = 0; $i < count($q_select); $i ++) {
|
for ($i = 0, $i_max = count($q_select); $i < $i_max; $i ++) {
|
||||||
// query select part, set to the element name
|
// query select part, set to the element name
|
||||||
$el_name = $q_select[$i];
|
$el_name = $q_select[$i];
|
||||||
// $this->debug('edit_error', "[$i] ELNAME: $el_name | POS[$prfx$el_name]: ".$_POST[$prfx.$el_name][$pos]." | RES: ".$res[$el_name]);
|
// $this->debug('edit_error', "[$i] ELNAME: $el_name | POS[$prfx$el_name]: ".$_POST[$prfx.$el_name][$pos]." | RES: ".$res[$el_name]);
|
||||||
@@ -1649,12 +1679,12 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$this->element_list[$table_name]['max_empty'] = 10;
|
$this->element_list[$table_name]['max_empty'] = 10;
|
||||||
}
|
}
|
||||||
// check if we need to fill fields
|
// check if we need to fill fields
|
||||||
$element_count = count($data['content']);
|
$element_count = is_array($data['content']) ? count($data['content']) : 0;
|
||||||
$missing_empty_count = $this->element_list[$table_name]['max_empty'] - count($data['content']);
|
$missing_empty_count = $this->element_list[$table_name]['max_empty'] - $element_count;
|
||||||
$this->debug('CFG MAX', 'Max empty: '.$this->element_list[$table_name]['max_empty'].', Missing: '.$missing_empty_count.', Has: '.$element_count);
|
$this->debug('CFG MAX', 'Max empty: '.$this->element_list[$table_name]['max_empty'].', Missing: '.$missing_empty_count.', Has: '.$element_count);
|
||||||
// set if we need more open entries or if we do not have any entries yet
|
// set if we need more open entries or if we do not have any entries yet
|
||||||
if (($missing_empty_count < $this->element_list[$table_name]['max_empty']) || $element_count == 0) {
|
if (($missing_empty_count < $this->element_list[$table_name]['max_empty']) || $element_count == 0) {
|
||||||
for ($pos = count($data['content']); $pos <= ($this->element_list[$table_name]['max_empty'] + $element_count); $pos ++) {
|
for ($pos = $element_count , $pos_max = $this->element_list[$table_name]['max_empty'] + $element_count; $pos <= $pos_max; $pos ++) {
|
||||||
$_data = array ();
|
$_data = array ();
|
||||||
|
|
||||||
// the fields that need to be filled are in data->type array:
|
// the fields that need to be filled are in data->type array:
|
||||||
|
|||||||
Reference in New Issue
Block a user