Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46554e6965 | ||
|
|
c8686024e2 | ||
|
|
605ea06bf0 | ||
|
|
9ec19f5940 | ||
|
|
a27e4603a8 | ||
|
|
54b7af348b | ||
|
|
c5d624a318 | ||
|
|
47ffec1fd4 | ||
|
|
72c6844e74 | ||
|
|
d0753512a3 | ||
|
|
d0de3821f8 |
17
.htaccess
Normal file
17
.htaccess
Normal file
@@ -0,0 +1,17 @@
|
||||
php_flag display_startup_errors on
|
||||
php_flag display_errors on
|
||||
php_flag html_errors on
|
||||
php_flag log_errors on
|
||||
php_flag ignore_repeated_errors off
|
||||
php_flag ignore_repeated_source off
|
||||
php_flag report_memleaks on
|
||||
php_flag track_errors on
|
||||
php_value docref_root 0
|
||||
php_value docref_ext 0
|
||||
# Turn this on to redirect log to different folder
|
||||
#php_value error_log /var/www/html/developers/clemens/php/php-error/php-errors.log
|
||||
# this is E_ALL reporting ON
|
||||
php_value error_reporting -1
|
||||
# this is E_ALL | ~E_NOTICE
|
||||
#php_value error_reporting 2039
|
||||
php_value log_errors_max_len 0
|
||||
1
.phplint-cache
Normal file
1
.phplint-cache
Normal file
File diff suppressed because one or more lines are too long
@@ -51,6 +51,7 @@ INSERT INTO edit_page_menu_group VALUES ((SELECT edit_page_id FROM edit_page WHE
|
||||
DELETE FROM edit_access_right;
|
||||
INSERT INTO edit_access_right (name, level, type) VALUES ('Default', -1, 'default');
|
||||
INSERT INTO edit_access_right (name, level, type) VALUES ('No Access', 0, 'none');
|
||||
INSERT INTO edit_access_right (name, level, type) VALUES ('List', 10, 'list');
|
||||
INSERT INTO edit_access_right (name, level, type) VALUES ('Read', 20, 'read');
|
||||
INSERT INTO edit_access_right (name, level, type) VALUES ('Translator', 30, 'mod_trans');
|
||||
INSERT INTO edit_access_right (name, level, type) VALUES ('Modify', 40, 'mod');
|
||||
|
||||
@@ -14,5 +14,6 @@ CREATE TABLE edit_access (
|
||||
uid VARCHAR,
|
||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||
protected INT,
|
||||
deleted SMALLINT DEFAULT 0
|
||||
deleted SMALLINT DEFAULT 0,
|
||||
additional_acl JSONB
|
||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||
|
||||
@@ -10,8 +10,10 @@ CREATE TABLE edit_group (
|
||||
edit_group_id SERIAL PRIMARY KEY,
|
||||
name VARCHAR,
|
||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||
deleted SMALLINT DEFAULT 0,
|
||||
edit_scheme_id INT,
|
||||
edit_access_right_id INT NOT NULL,
|
||||
additional_acl JSONB,
|
||||
FOREIGN KEY (edit_scheme_id) REFERENCES edit_scheme (edit_scheme_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (edit_access_right_id) REFERENCES edit_access_right (edit_access_right_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
-- DATE: 2005/07/05
|
||||
-- DESCRIPTION:
|
||||
-- edit tables, this table contains all pages in the edit interface and allocates rights + values to it
|
||||
-- TABLE: edit_table
|
||||
-- TABLE: edit_page
|
||||
-- HISTORY:
|
||||
|
||||
-- DROP TABLE edit_page;
|
||||
CREATE TABLE edit_page (
|
||||
edit_page_id SERIAL PRIMARY KEY,
|
||||
content_alias_edit_page_id INT, -- alias for page content, if the page content is defined on a different page, ege for ajax backend pages
|
||||
filename VARCHAR,
|
||||
name VARCHAR UNIQUE,
|
||||
order_number INT NOT NULL,
|
||||
@@ -15,5 +16,6 @@ CREATE TABLE edit_page (
|
||||
menu SMALLINT NOT NULL DEFAULT 0,
|
||||
popup SMALLINT NOT NULL DEFAULT 0,
|
||||
popup_x SMALLINT,
|
||||
popup_y SMALLINT
|
||||
popup_y SMALLINT,
|
||||
FOREIGN KEY (content_alias_edit_page_id) REFERENCES edit_page (edit_page_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||
|
||||
20
4dev/database/table/edit_page_content.sql
Executable file
20
4dev/database/table/edit_page_content.sql
Executable file
@@ -0,0 +1,20 @@
|
||||
-- AUTHOR: Clemens Schwaighofer
|
||||
-- DATE: 2019/9/9
|
||||
-- DESCRIPTION:
|
||||
-- sub content to one page with additional edit access right set
|
||||
-- can be eg JS content groups on one page
|
||||
-- TABLE: edit_page_content
|
||||
-- HISTORY:
|
||||
|
||||
-- DROP TABLE edit_page_content;
|
||||
CREATE TABLE edit_page_content (
|
||||
edit_page_content_id SERIAL PRIMARY KEY,
|
||||
edit_page_id INT NOT NULL,
|
||||
edit_access_right_id INT NOT NULL,
|
||||
name VARCHAR,
|
||||
uid VARCHAR UNIQUE,
|
||||
order_number INT NOT NULL,
|
||||
online SMALLINT NOT NULL DEFAULT 0,
|
||||
FOREIGN KEY (edit_access_right_id) REFERENCES edit_access_right (edit_access_right_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (edit_page_id) REFERENCES edit_page (edit_page_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||
@@ -16,6 +16,7 @@ CREATE TABLE edit_user (
|
||||
first_name_furigana VARCHAR,
|
||||
last_name_furigana VARCHAR,
|
||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||
deleted SMALLINT NOT NULL DEFAULT 0,
|
||||
debug SMALLINT NOT NULL DEFAULT 0,
|
||||
db_debug SMALLINT NOT NULL DEFAULT 0,
|
||||
email VARCHAR,
|
||||
@@ -32,6 +33,7 @@ CREATE TABLE edit_user (
|
||||
locked SMALLINT DEFAULT 0,
|
||||
password_change_date TIMESTAMP WITHOUT TIME ZONE, -- only when password is first set or changed
|
||||
password_change_interval INTERVAL, -- null if no change is needed, or d/m/y time interval
|
||||
additional_acl JSONB, -- additional ACL as JSON string (can be set by other pages)
|
||||
FOREIGN KEY (connect_edit_user_id) REFERENCES edit_user (edit_user_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (edit_language_id) REFERENCES edit_language (edit_language_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (edit_group_id) REFERENCES edit_group (edit_group_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
|
||||
4
4dev/database/trigger/trg_edit_page_content.sql
Executable file
4
4dev/database/trigger/trg_edit_page_content.sql
Executable file
@@ -0,0 +1,4 @@
|
||||
DROP TRIGGER trg_edit_page_content ON edit_page_content;
|
||||
CREATE TRIGGER trg_edit_page_content
|
||||
BEFORE INSERT OR UPDATE ON edit_page_content
|
||||
FOR EACH ROW EXECUTE PROCEDURE set_edit_generic();
|
||||
7
4dev/update/20190910_page_content/20190910_page_content_updates.sql
Executable file
7
4dev/update/20190910_page_content/20190910_page_content_updates.sql
Executable file
@@ -0,0 +1,7 @@
|
||||
-- 2019/9/10 update edit_page with reference
|
||||
|
||||
-- page content reference settings
|
||||
|
||||
-- UPDATE
|
||||
ALTER TABLE edit_page ADD content_alias_edit_page_id INT;
|
||||
ALTER TABLE edit_page ADD CONSTRAINT edit_page_content_alias_edit_page_id_fkey FOREIGN KEY (content_alias_edit_page_id) REFERENCES edit_page (edit_page_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
@@ -33,7 +33,7 @@ ob_end_flush();
|
||||
// set + check edit access id
|
||||
$edit_access_id = 3;
|
||||
if (isset($login) && is_object($login) && isset($login->acl['unit'])) {
|
||||
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."<br>";
|
||||
print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), true)."<br>";
|
||||
print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."<br>";
|
||||
if ($login->loginCheckEditAccess($edit_access_id)) {
|
||||
$basic->edit_access_id = $edit_access_id;
|
||||
@@ -87,22 +87,22 @@ while ($res = $basic->dbReturn("SELECT * FROM max_test")) {
|
||||
}
|
||||
|
||||
$status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO TEST ".time()."') RETURNING test");
|
||||
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||
print "DIRECT INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."<br>";
|
||||
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
|
||||
print "DIRECT INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), true)."<br>";
|
||||
$basic->dbPrepare("ins_foo", "INSERT INTO foo (test) VALUES ($1)");
|
||||
$status = $basic->dbExecute("ins_foo", array('BAR TEST '.time()));
|
||||
print "PREPARE INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||
print "PREPARE INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."<br>";
|
||||
print "PREPARE INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
|
||||
print "PREPARE INSERT PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), true)."<br>";
|
||||
// returning test with multiple entries
|
||||
// $status = $basic->db_exec("INSERT INTO foo (test) values ('BAR 1 ".time()."'), ('BAR 2 ".time()."'), ('BAR 3 ".time()."') RETURNING foo_id");
|
||||
$status = $basic->dbExec("INSERT INTO foo (test) values ('BAR 1 ".time()."'), ('BAR 2 ".time()."'), ('BAR 3 ".time()."') RETURNING foo_id, test");
|
||||
print "DIRECT MULTIPLE INSERT STATUS: $status | PRIMARY KEYS: ".print_r($basic->insert_id, 1)." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||
print "DIRECT MULTIPLE INSERT STATUS: $status | PRIMARY KEYS: ".print_r($basic->insert_id, true)." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
|
||||
// no returning, but not needed ;
|
||||
$status = $basic->dbExec("INSERT INTO foo (test) VALUES ('FOO; TEST ".time()."');");
|
||||
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||
print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id." | PRIMARY KEY EXT: ".print_r($basic->insert_id_ext, true)."<br>";
|
||||
// UPDATE WITH RETURNING
|
||||
$status = $basic->dbExec("UPDATE foo SET test = 'SOMETHING DIFFERENT' WHERE foo_id = 3688452 RETURNING test");
|
||||
print "UPDATE STATUS: $status | RETURNING EXT: ".print_r($basic->insert_id_ext, 1)."<br>";
|
||||
print "UPDATE STATUS: $status | RETURNING EXT: ".print_r($basic->insert_id_ext, true)."<br>";
|
||||
|
||||
# db write class test
|
||||
$table = 'foo';
|
||||
@@ -125,6 +125,11 @@ $data = array ('test' => 'BOOL TEST UNSET '.time());
|
||||
$primary_key = $basic->dbWriteDataExt($db_write_table, $primary_key, $table, $object_fields_not_touch, $object_fields_not_update, $data);
|
||||
print "Wrote to DB tabel $table and got primary key $primary_key<br>";
|
||||
|
||||
// return Array Test
|
||||
$query = "SELECT type, sdate, integer FROM foobar";
|
||||
$data = $basic->dbReturnArray($query, true);
|
||||
print "Full foobar list: <br><pre>".print_r($data, true)."</pre><br>";
|
||||
|
||||
# async test queries
|
||||
/* $basic->dbExecAsync("SELECT test FROM foo, (SELECT pg_sleep(10)) as sub WHERE foo_id IN (27, 50, 67, 44, 10)");
|
||||
echo "WAITING FOR ASYNC: ";
|
||||
@@ -156,7 +161,7 @@ while (($ret = $basic->dbCheckAsync()) === true)
|
||||
flush();
|
||||
}
|
||||
print "<br>END STATUS: ".$ret." | PK: ".$basic->insert_id."<br>";
|
||||
print "ASYNC PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."<br>"; */
|
||||
print "ASYNC PREVIOUS INSERTED: ".print_r($basic->dbReturnRow("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), true)."<br>"; */
|
||||
|
||||
$to_db_version = '9.1.9';
|
||||
print "VERSION DB: ".$basic->dbVersion()."<br>";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
// debug for L10n issues in php 7.3
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Foo;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
$ENABLE_ERROR_HANDLING = 0;
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2018/10/11
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
require 'config.php';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2005/07/19
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2008/08/14
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2008/08/01
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2007/09/03
|
||||
@@ -106,13 +106,15 @@ if (!$AJAX_PAGE) {
|
||||
if (file_exists($cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME)) {
|
||||
$cms->JS_SPECIAL_INCLUDE = $cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME;
|
||||
}
|
||||
// check if template names exist
|
||||
if (!file_exists($smarty->getTemplateDir()[0].DS.$MASTER_TEMPLATE_NAME)) {
|
||||
// abort if master template could not be found
|
||||
exit('MASTER TEMPLATE: '.$MASTER_TEMPLATE_NAME.' could not be found');
|
||||
}
|
||||
if (isset($TEMPLATE_NAME) && !file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_NAME)) {
|
||||
exit('INCLUDE TEMPLATE: '.$TEMPLATE_NAME.' could not be found');
|
||||
if ($smarty) {
|
||||
// check if template names exist
|
||||
if (!file_exists($smarty->getTemplateDir()[0].DS.$MASTER_TEMPLATE_NAME)) {
|
||||
// abort if master template could not be found
|
||||
exit('MASTER TEMPLATE: '.$MASTER_TEMPLATE_NAME.' could not be found');
|
||||
}
|
||||
if (isset($TEMPLATE_NAME) && !file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_NAME)) {
|
||||
exit('INCLUDE TEMPLATE: '.$TEMPLATE_NAME.' could not be found');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2005/07/12
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
|
||||
* CREATED: 2003/06/10
|
||||
@@ -41,7 +41,7 @@ if (!DEBUG) {
|
||||
}
|
||||
|
||||
// set default lang if not set otherwise
|
||||
if (!$lang) {
|
||||
if (!isset($lang)) {
|
||||
$lang = DEFAULT_LANG;
|
||||
}
|
||||
// should be utf8
|
||||
@@ -58,6 +58,8 @@ if ($form->mobile_phone) {
|
||||
// smarty template engine (extended Translation version)
|
||||
$smarty = new CoreLibs\Template\SmartyExtend($lang);
|
||||
|
||||
$form->debug('POST', $form->printAr($_POST));
|
||||
|
||||
if (TARGET == 'live' || TARGET == 'remote') {
|
||||
// login
|
||||
$login->debug_output_all = DEBUG ? 1 : 0;
|
||||
@@ -123,7 +125,7 @@ if ($form->my_page_name == 'edit_order') {
|
||||
// there are the POSITION stored, that should CHANGE there order (up/down)
|
||||
// $row_data_id ... has ALL ids from the sorting part
|
||||
// $row_data_order ... has ALL order positions from the soirting part
|
||||
if (!is_array($position)) {
|
||||
if (!isset($position)) {
|
||||
$position = array ();
|
||||
}
|
||||
if (count($position)) {
|
||||
@@ -131,7 +133,7 @@ if ($form->my_page_name == 'edit_order') {
|
||||
|
||||
// FIRST u have to put right sort, then read again ...
|
||||
// hast to be >0 or the first one is selected and then there is no move
|
||||
if ($up && $position[0] > 0) {
|
||||
if (isset($up) && $position[0] > 0) {
|
||||
for ($i = 0; $i < count($position); $i++) {
|
||||
// change position order
|
||||
// this gets temp, id before that, gets actual (moves one "down")
|
||||
@@ -146,7 +148,7 @@ if ($form->my_page_name == 'edit_order') {
|
||||
} // if up
|
||||
|
||||
// the last position id from position array is not to be the count-1 of row_data_id array, or it is the last element
|
||||
if ($down && ($position[count($position) - 1] != (count($row_data_id) - 1))) {
|
||||
if (isset($down) && ($position[count($position) - 1] != (count($row_data_id) - 1))) {
|
||||
for ($i = count($position) - 1; $i >= 0; $i --) {
|
||||
// same as up, just up in other way, starts from bottom (last element) and moves "up"
|
||||
// element before actuel gets temp, this element, becomes element after this,
|
||||
@@ -158,7 +160,9 @@ if ($form->my_page_name == 'edit_order') {
|
||||
} // if down
|
||||
|
||||
// write data ... (which has to be abstrackt ...)
|
||||
if (($up && $position[0] > 0) || ($down && ($position[count($position) - 1]!=(count($row_data_id) - 1)))) {
|
||||
if ((isset($up) && $position[0] > 0) ||
|
||||
(isset($down) && ($position[count($position) - 1] != (count($row_data_id) - 1)))
|
||||
) {
|
||||
for ($i = 0; $i < count($row_data_id); $i ++) {
|
||||
$q = "UPDATE ".$table_name." SET order_number = ".$row_data_order[$i]." WHERE ".$table_name."_id = ".$row_data_id[$i];
|
||||
$q = $form->dbExec($q);
|
||||
@@ -168,7 +172,7 @@ if ($form->my_page_name == 'edit_order') {
|
||||
|
||||
// get ...
|
||||
$q = "SELECT ".$table_name."_id, name, order_number FROM ".$table_name." ";
|
||||
if ($where_string) {
|
||||
if (!empty($where_string)) {
|
||||
$q .= "WHERE $where_string ";
|
||||
}
|
||||
$q .= "ORDER BY order_number";
|
||||
@@ -184,8 +188,9 @@ if ($form->my_page_name == 'edit_order') {
|
||||
// html title
|
||||
$HEADER['HTML_TITLE'] = $form->l->__('Edit Order');
|
||||
|
||||
$messages = array ();
|
||||
// error msg
|
||||
if ($error) {
|
||||
if (isset($error)) {
|
||||
$messages[] = array ('msg' => $msg, 'class' => 'error', 'width' => '100%');
|
||||
}
|
||||
$DATA['form_error_msg'] = $messages;
|
||||
@@ -199,11 +204,11 @@ if ($form->my_page_name == 'edit_order') {
|
||||
}
|
||||
for ($i = 0; $i < count($row_data); $i ++) {
|
||||
$options_id[] = $i;
|
||||
$options_name[] = $row_data[$i]["name"];
|
||||
$options_name[] = $row_data[$i]['name'];
|
||||
// list of points to order
|
||||
for ($j = 0; $j < count($position); $j++) {
|
||||
// if matches, put into select array
|
||||
if ($original_id[$position[$j]] == $row_data[$i]["id"]) {
|
||||
if ($original_id[$position[$j]] == $row_data[$i]['id']) {
|
||||
$options_selected[] = $i;
|
||||
}
|
||||
}
|
||||
@@ -216,23 +221,29 @@ if ($form->my_page_name == 'edit_order') {
|
||||
$row_data_id = array ();
|
||||
$row_data_order = array ();
|
||||
for ($i = 0; $i < count($row_data); $i++) {
|
||||
$row_data_id[] = $row_data[$i]["id"];
|
||||
$row_data_order[] = $row_data[$i]["order"];
|
||||
$row_data_id[] = $row_data[$i]['id'];
|
||||
$row_data_order[] = $row_data[$i]['order'];
|
||||
}
|
||||
$DATA['row_data_id'] = $row_data_id;
|
||||
$DATA['row_data_order'] = $row_data_order;
|
||||
|
||||
// hidden names for the table & where string
|
||||
$DATA['table_name'] = $table_name;
|
||||
$DATA['where_string'] = $where_string;
|
||||
$DATA['where_string'] = isset($where_string) ? $where_string : '';
|
||||
|
||||
$EDIT_TEMPLATE = 'edit_order.tpl';
|
||||
} else {
|
||||
$form->formProcedureLoad(${$form->archive_pk_name});
|
||||
// load call only if id is set
|
||||
if (isset(${$form->archive_pk_name})) {
|
||||
$form->formProcedureLoad(${$form->archive_pk_name});
|
||||
}
|
||||
$form->formProcedureNew();
|
||||
$form->formProcedureSave();
|
||||
$form->formProcedureDelete();
|
||||
$form->formProcedureDeleteFromElementList($element_list, $remove_name);
|
||||
// delete call only if those two are set
|
||||
if (isset($element_list) && isset($remove_name)) {
|
||||
$form->formProcedureDeleteFromElementList($element_list, $remove_name);
|
||||
}
|
||||
|
||||
$DATA['table_width'] = $table_width;
|
||||
|
||||
@@ -242,26 +253,26 @@ if ($form->my_page_name == 'edit_order') {
|
||||
|
||||
// MENU START
|
||||
// request some session vars
|
||||
if (!$HEADER_COLOR) {
|
||||
$DATA['HEADER_COLOR'] = "#E0E2FF";
|
||||
if (!isset($HEADER_COLOR)) {
|
||||
$DATA['HEADER_COLOR'] = '#E0E2FF';
|
||||
} else {
|
||||
$DATA['HEADER_COLOR'] = $_SESSION['HEADER_COLOR'];
|
||||
}
|
||||
$DATA['USER_NAME'] = $_SESSION["USER_NAME"];
|
||||
$DATA['EUID'] = $_SESSION["EUID"];
|
||||
$DATA['GROUP_NAME'] = $_SESSION["GROUP_NAME"];
|
||||
$DATA['GROUP_LEVEL'] = $_SESSION["GROUP_LEVEL"];
|
||||
$PAGES = $_SESSION["PAGES"];
|
||||
$DATA['USER_NAME'] = $_SESSION['USER_NAME'];
|
||||
$DATA['EUID'] = $_SESSION['EUID'];
|
||||
$DATA['GROUP_NAME'] = $_SESSION['GROUP_NAME'];
|
||||
$DATA['GROUP_LEVEL'] = $_SESSION['GROUP_ACL_LEVEL'];
|
||||
$PAGES = $_SESSION['PAGES'];
|
||||
|
||||
//$form->debug('menu', $form->printAr($PAGES));
|
||||
|
||||
// build nav from $PAGES ...
|
||||
if (!is_array($PAGES)) {
|
||||
if (!isset($PAGES) || !is_array($PAGES)) {
|
||||
$PAGES = array ();
|
||||
}
|
||||
for ($i = 0, $i_max = count($PAGES); $i < $i_max; $i ++) {
|
||||
if ($PAGES[$i]["menu"] && $PAGES[$i]["online"]) {
|
||||
$menuarray[] = $PAGES[$i];
|
||||
foreach ($PAGES as $PAGE_CUID => $PAGE_DATA) {
|
||||
if ($PAGE_DATA['menu'] && $PAGE_DATA['online']) {
|
||||
$menuarray[] = $PAGE_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,34 +287,44 @@ if ($form->my_page_name == 'edit_order') {
|
||||
}
|
||||
}
|
||||
|
||||
$position = 0;
|
||||
for ($i = 1; $i <= count($menuarray); $i ++) {
|
||||
// do that for new array
|
||||
$j = $i - 1;
|
||||
$menu_data[$j]['pagename'] = htmlentities($menuarray[($i-1)]["page_name"]);
|
||||
$menu_data[$j]['filename'] = $menuarray[($i-1)]["filename"].$menuarray[($i-1)]["query_string"];
|
||||
if ($i == 1 || !(($i - 1) % $SPLIT_FACTOR)) {
|
||||
$menu_data[$j]['pagename'] = htmlentities($menuarray[($i-1)]['page_name']);
|
||||
$menu_data[$j]['filename'] = $menuarray[($i-1)]['filename'].(isset($menuarray[$j]['query_string']) ? $menuarray[$j]['query_string'] : '');
|
||||
if ($i == 1 || !($j % $SPLIT_FACTOR)) {
|
||||
$menu_data[$j]['splitfactor_in'] = 1;
|
||||
} else {
|
||||
$menu_data[$j]['splitfactor_in'] = 0;
|
||||
}
|
||||
if ($menuarray[($i - 1)]["filename"] == $form->getPageName()) {
|
||||
$position = $i - 1;
|
||||
if ($menuarray[$j]['filename'] == $form->getPageName()) {
|
||||
$position = $j;
|
||||
$menu_data[$j]['position'] = 1;
|
||||
$menu_data[$j]['popup'] = 0;
|
||||
} else {
|
||||
// add query stuff
|
||||
// HAS TO DONE LATER ... set urlencode, etc ...
|
||||
// check if popup needed
|
||||
if ($menuarray[($i - 1)]["popup"]) {
|
||||
if (isset($menuarray[$j]['popup']) && $menuarray[$j]['popup'] == 1) {
|
||||
$menu_data[$j]['popup'] = 1;
|
||||
$menu_data[$j]['rand'] = uniqid(rand());
|
||||
$menu_data[$j]['width'] = $menuarray[($i-1)]["popup_x"];
|
||||
$menu_data[$j]['height'] = $menuarray[($i-1)]["popup_y"];
|
||||
} // popup or not
|
||||
$menu_data[$j]['rand'] = uniqid((string)rand());
|
||||
$menu_data[$j]['width'] = $menuarray[$j]['popup_x'];
|
||||
$menu_data[$j]['height'] = $menuarray[$j]['popup_y'];
|
||||
} else {
|
||||
$menu_data[$j]['popup'] = 0;
|
||||
}
|
||||
$menu_data[$j]['position'] = 0;
|
||||
} // highlight or not
|
||||
if (!($i % $SPLIT_FACTOR) || (($i + 1) > count($menuarray))) {
|
||||
$menu_data[$j]['splitfactor_out'] = 1;
|
||||
} // split
|
||||
} else {
|
||||
$menu_data[$j]['splitfactor_out'] = 0;
|
||||
}
|
||||
} // for
|
||||
// $form->debug('MENU ARRAY', $form->printAr($menu_data));
|
||||
$DATA['menu_data'] = $menu_data;
|
||||
$DATA['page_name'] = $menuarray[$position]["page_name"];
|
||||
$DATA['page_name'] = $menuarray[$position]['page_name'];
|
||||
$L_TITLE = $DATA['page_name'];
|
||||
// html title
|
||||
$HEADER['HTML_TITLE'] = $form->l->__($L_TITLE);
|
||||
@@ -315,115 +336,124 @@ if ($form->my_page_name == 'edit_order') {
|
||||
if ($form->yes) {
|
||||
$DATA['form_yes'] = $form->yes;
|
||||
$DATA['form_my_page_name'] = $form->my_page_name;
|
||||
$DATA['filename_exist'] = 0;
|
||||
$DATA['drop_down_input'] = 0;
|
||||
|
||||
// depending on the "getPageName()" I show different stuff
|
||||
switch ($form->my_page_name) {
|
||||
case "edit_users":
|
||||
$elements[] = $form->formCreateElement("login_error_count");
|
||||
$elements[] = $form->formCreateElement("login_error_date_last");
|
||||
$elements[] = $form->formCreateElement("login_error_date_first");
|
||||
$elements[] = $form->formCreateElement("enabled");
|
||||
$elements[] = $form->formCreateElement("protected");
|
||||
$elements[] = $form->formCreateElement("username");
|
||||
$elements[] = $form->formCreateElement("password");
|
||||
$elements[] = $form->formCreateElement("password_change_interval");
|
||||
$elements[] = $form->formCreateElement("email");
|
||||
$elements[] = $form->formCreateElement("last_name");
|
||||
$elements[] = $form->formCreateElement("first_name");
|
||||
$elements[] = $form->formCreateElement("edit_group_id");
|
||||
$elements[] = $form->formCreateElement("edit_access_right_id");
|
||||
$elements[] = $form->formCreateElement("strict");
|
||||
$elements[] = $form->formCreateElement("locked");
|
||||
$elements[] = $form->formCreateElement("admin");
|
||||
$elements[] = $form->formCreateElement("debug");
|
||||
$elements[] = $form->formCreateElement("db_debug");
|
||||
$elements[] = $form->formCreateElement("edit_language_id");
|
||||
$elements[] = $form->formCreateElement("edit_scheme_id");
|
||||
$elements[] = $form->formCreateElementListTable("edit_access_user");
|
||||
case 'edit_users':
|
||||
$elements[] = $form->formCreateElement('login_error_count');
|
||||
$elements[] = $form->formCreateElement('login_error_date_last');
|
||||
$elements[] = $form->formCreateElement('login_error_date_first');
|
||||
$elements[] = $form->formCreateElement('enabled');
|
||||
$elements[] = $form->formCreateElement('protected');
|
||||
$elements[] = $form->formCreateElement('username');
|
||||
$elements[] = $form->formCreateElement('password');
|
||||
$elements[] = $form->formCreateElement('password_change_interval');
|
||||
$elements[] = $form->formCreateElement('email');
|
||||
$elements[] = $form->formCreateElement('last_name');
|
||||
$elements[] = $form->formCreateElement('first_name');
|
||||
$elements[] = $form->formCreateElement('edit_group_id');
|
||||
$elements[] = $form->formCreateElement('edit_access_right_id');
|
||||
$elements[] = $form->formCreateElement('strict');
|
||||
$elements[] = $form->formCreateElement('locked');
|
||||
$elements[] = $form->formCreateElement('admin');
|
||||
$elements[] = $form->formCreateElement('debug');
|
||||
$elements[] = $form->formCreateElement('db_debug');
|
||||
$elements[] = $form->formCreateElement('edit_language_id');
|
||||
$elements[] = $form->formCreateElement('edit_scheme_id');
|
||||
$elements[] = $form->formCreateElementListTable('edit_access_user');
|
||||
$elements[] = $form->formCreateElement('additional_acl');
|
||||
break;
|
||||
case "edit_schemes":
|
||||
$elements[] = $form->formCreateElement("enabled");
|
||||
$elements[] = $form->formCreateElement("name");
|
||||
$elements[] = $form->formCreateElement("header_color");
|
||||
$elements[] = $form->formCreateElement("template");
|
||||
case 'edit_schemes':
|
||||
$elements[] = $form->formCreateElement('enabled');
|
||||
$elements[] = $form->formCreateElement('name');
|
||||
$elements[] = $form->formCreateElement('header_color');
|
||||
$elements[] = $form->formCreateElement('template');
|
||||
break;
|
||||
case "edit_pages":
|
||||
if (!$form->table_array["edit_page_id"]["value"]) {
|
||||
case 'edit_pages':
|
||||
if (!isset($form->table_array['edit_page_id']['value'])) {
|
||||
$q = "DELETE FROM temp_files";
|
||||
$form->dbExec($q);
|
||||
// gets all files in the current dir ending with .php
|
||||
$crap = exec("ls *.php", $output, $status);
|
||||
$crap = exec('ls *.php', $output, $status);
|
||||
// now get all that are NOT in de DB
|
||||
$q = "INSERT INTO temp_files VALUES ";
|
||||
for ($i = 0; $i < count($output); $i ++) {
|
||||
$t_q = "('".$form->dbEscapeString($output[$i])."')";
|
||||
$form->dbExec($q.$t_q, 'NULL');
|
||||
}
|
||||
$elements[] = $form->formCreateElement("filename");
|
||||
$elements[] = $form->formCreateElement('filename');
|
||||
} else {
|
||||
// show file menu
|
||||
// just show name of file ...
|
||||
$DATA['filename_exist'] = 1;
|
||||
$DATA['filename'] = $form->table_array["filename"]["value"];
|
||||
$DATA['filename'] = $form->table_array['filename']['value'];
|
||||
} // File Name View IF
|
||||
$elements[] = $form->formCreateElement("name");
|
||||
// $elements[] = $form->formCreateElement("tag");
|
||||
// $elements[] = $form->formCreateElement("min_acl");
|
||||
$elements[] = $form->formCreateElement("order_number");
|
||||
$elements[] = $form->formCreateElement("online");
|
||||
$elements[] = $form->formCreateElement("menu");
|
||||
$elements[] = $form->formCreateElementListTable("edit_query_string");
|
||||
$elements[] = $form->formCreateElement("popup");
|
||||
$elements[] = $form->formCreateElement("popup_x");
|
||||
$elements[] = $form->formCreateElement("popup_y");
|
||||
$elements[] = $form->formCreateElementReferenceTable("edit_visible_group");
|
||||
$elements[] = $form->formCreateElementReferenceTable("edit_menu_group");
|
||||
$elements[] = $form->formCreateElement('name');
|
||||
// $elements[] = $form->formCreateElement('tag');
|
||||
// $elements[] = $form->formCreateElement('min_acl');
|
||||
$elements[] = $form->formCreateElement('order_number');
|
||||
$elements[] = $form->formCreateElement('online');
|
||||
$elements[] = $form->formCreateElement('menu');
|
||||
$elements[] = $form->formCreateElementListTable('edit_query_string');
|
||||
$elements[] = $form->formCreateElement('content_alias_edit_page_id');
|
||||
$elements[] = $form->formCreateElementListTable('edit_page_content');
|
||||
$elements[] = $form->formCreateElement('popup');
|
||||
$elements[] = $form->formCreateElement('popup_x');
|
||||
$elements[] = $form->formCreateElement('popup_y');
|
||||
$elements[] = $form->formCreateElementReferenceTable('edit_visible_group');
|
||||
$elements[] = $form->formCreateElementReferenceTable('edit_menu_group');
|
||||
break;
|
||||
case "edit_languages":
|
||||
$elements[] = $form->formCreateElement("enabled");
|
||||
$elements[] = $form->formCreateElement("short_name");
|
||||
$elements[] = $form->formCreateElement("long_name");
|
||||
$elements[] = $form->formCreateElement("iso_name");
|
||||
case 'edit_languages':
|
||||
$elements[] = $form->formCreateElement('enabled');
|
||||
$elements[] = $form->formCreateElement('short_name');
|
||||
$elements[] = $form->formCreateElement('long_name');
|
||||
$elements[] = $form->formCreateElement('iso_name');
|
||||
break;
|
||||
case "edit_groups":
|
||||
$elements[] = $form->formCreateElement("enabled");
|
||||
$elements[] = $form->formCreateElement("name");
|
||||
$elements[] = $form->formCreateElement("edit_access_right_id");
|
||||
$elements[] = $form->formCreateElement("edit_scheme_id");
|
||||
$elements[] = $form->formCreateElementListTable("edit_page_access");
|
||||
case 'edit_groups':
|
||||
$elements[] = $form->formCreateElement('enabled');
|
||||
$elements[] = $form->formCreateElement('name');
|
||||
$elements[] = $form->formCreateElement('edit_access_right_id');
|
||||
$elements[] = $form->formCreateElement('edit_scheme_id');
|
||||
$elements[] = $form->formCreateElementListTable('edit_page_access');
|
||||
$elements[] = $form->formCreateElement('additional_acl');
|
||||
break;
|
||||
case "edit_visible_group":
|
||||
$elements[] = $form->formCreateElement("name");
|
||||
$elements[] = $form->formCreateElement("flag");
|
||||
case 'edit_visible_group':
|
||||
$elements[] = $form->formCreateElement('name');
|
||||
$elements[] = $form->formCreateElement('flag');
|
||||
break;
|
||||
case "edit_menu_group":
|
||||
$elements[] = $form->formCreateElement("name");
|
||||
$elements[] = $form->formCreateElement("flag");
|
||||
$elements[] = $form->formCreateElement("order_number");
|
||||
case 'edit_menu_group':
|
||||
$elements[] = $form->formCreateElement('name');
|
||||
$elements[] = $form->formCreateElement('flag');
|
||||
$elements[] = $form->formCreateElement('order_number');
|
||||
break;
|
||||
case "edit_access":
|
||||
$elements[] = $form->formCreateElement("name");
|
||||
$elements[] = $form->formCreateElement("enabled");
|
||||
$elements[] = $form->formCreateElement("protected");
|
||||
$elements[] = $form->formCreateElement("color");
|
||||
$elements[] = $form->formCreateElement("description");
|
||||
case 'edit_access':
|
||||
$elements[] = $form->formCreateElement('name');
|
||||
$elements[] = $form->formCreateElement('enabled');
|
||||
$elements[] = $form->formCreateElement('protected');
|
||||
$elements[] = $form->formCreateElement('color');
|
||||
$elements[] = $form->formCreateElement('description');
|
||||
// add name/value list here
|
||||
$elements[] = $form->formCreateElementListTable("edit_access_data");
|
||||
$elements[] = $form->formCreateElementListTable('edit_access_data');
|
||||
$elements[] = $form->formCreateElement('additional_acl');
|
||||
break;
|
||||
default:
|
||||
print "[No valid page definition given]";
|
||||
print '[No valid page definition given]';
|
||||
break;
|
||||
}
|
||||
// $form->debug('edit', "Elements: <pre>".$form->printAr($elements));
|
||||
$DATA['elements'] = $elements;
|
||||
$DATA['hidden'] = $form->formCreateHiddenFields();
|
||||
$DATA['save_delete'] = $form->formCreateSaveDelete();
|
||||
} else {
|
||||
$DATA['form_yes'] = 0;
|
||||
}
|
||||
$EDIT_TEMPLATE = 'edit_body.tpl';
|
||||
}
|
||||
|
||||
// debug data, if DEBUG flag is on, this data is print out
|
||||
$DEBUG_DATA['DEBUG'] = $DEBUG_TMPL;
|
||||
$DEBUG_DATA['DEBUG'] = isset($DEBUG_TMPL) ? $DEBUG_TMPL : '';
|
||||
|
||||
// create main data array
|
||||
$CONTENT_DATA = array_merge($HEADER, $DATA, $DEBUG_DATA);
|
||||
|
||||
@@ -1,95 +1,104 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_access = array (
|
||||
"table_array" => array (
|
||||
"edit_access_id" => array (
|
||||
"value" => $GLOBALS["edit_access_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1
|
||||
'table_array' => array (
|
||||
'edit_access_id' => array (
|
||||
'value' => isset($GLOBALS['edit_access_id']) ? $GLOBALS['edit_access_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1
|
||||
),
|
||||
"name" => array (
|
||||
"value" => $GLOBALS["name"],
|
||||
"output_name" => $this->l->__("Access Group Name"),
|
||||
"mandatory" => 1,
|
||||
"type" => "text",
|
||||
"error_check" => "alphanumericspace|unique"
|
||||
'name' => array (
|
||||
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
|
||||
'output_name' => $this->l->__('Access Group Name'),
|
||||
'mandatory' => 1,
|
||||
'type' => 'text',
|
||||
'error_check' => 'alphanumericspace|unique'
|
||||
),
|
||||
"description" => array (
|
||||
"value" => $GLOBALS["description"],
|
||||
"output_name" => $this->l->__("Description"),
|
||||
"type" => "textarea"
|
||||
'description' => array (
|
||||
'value' => isset($GLOBALS['description']) ? $GLOBALS['description'] : '',
|
||||
'output_name' => $this->l->__('Description'),
|
||||
'type' => 'textarea'
|
||||
),
|
||||
"color" => array (
|
||||
"value" => $GLOBALS["color"],
|
||||
"output_name" => $this->l->__("Color"),
|
||||
"mandatory" => 0,
|
||||
"type" => "text",
|
||||
"size" => 6,
|
||||
"length" => 6,
|
||||
"error_check" => "custom",
|
||||
"error_regex" => "/[\dA-Fa-f]{6}/",
|
||||
"error_example" => "F6A544"
|
||||
'color' => array (
|
||||
'value' => isset($GLOBALS['color']) ? $GLOBALS['color'] : '',
|
||||
'output_name' => $this->l->__('Color'),
|
||||
'mandatory' => 0,
|
||||
'type' => 'text',
|
||||
'size' => 6,
|
||||
'length' => 6,
|
||||
'error_check' => 'custom',
|
||||
'error_regex' => "/[\dA-Fa-f]{6}/",
|
||||
'error_example' => 'F6A544'
|
||||
),
|
||||
"enabled" => array (
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"type" => "binary",
|
||||
"int" => 1, // OR "bool" => 1
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'enabled' => array (
|
||||
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : 0,
|
||||
'output_name' => 'Enabled',
|
||||
'type' => 'binary',
|
||||
'int' => 1, // OR 'bool' => 1
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"protected" => array (
|
||||
"value" => $GLOBALS["protected"],
|
||||
"output_name" => "Protected",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'protected' => array (
|
||||
'value' => isset($GLOBALS['protected']) ? $GLOBALS['protected'] : 0,
|
||||
'output_name' => 'Protected',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
)
|
||||
),
|
||||
'additional_acl' => array (
|
||||
'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
|
||||
'output_name' => 'Additional ACL (as JSON)',
|
||||
'type' => 'textarea',
|
||||
'error_check' => 'json',
|
||||
'rows' => 10,
|
||||
'cols' => 60
|
||||
),
|
||||
),
|
||||
"table_name" => "edit_access",
|
||||
'table_name' => 'edit_access',
|
||||
"load_query" => "SELECT edit_access_id, name FROM edit_access ORDER BY name",
|
||||
"show_fields" => array (
|
||||
'show_fields' => array (
|
||||
array (
|
||||
"name" => "name"
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
"element_list" => array (
|
||||
"edit_access_data" => array (
|
||||
"output_name" => "Edit Access Data",
|
||||
"type" => "reference_data", # is not a sub table read and connect, but only a sub table with data
|
||||
"max_empty" => 5, # maxium visible if no data is set, if filled add this number to visible
|
||||
"prefix" => "ead",
|
||||
"elements" => array (
|
||||
"edit_access_data_id" => array (
|
||||
"output_name" => "Activate",
|
||||
"type" => "hidden",
|
||||
"int" => 1,
|
||||
"pk_id" => 1
|
||||
'element_list' => array (
|
||||
'edit_access_data' => array (
|
||||
'output_name' => 'Edit Access Data',
|
||||
'delete_name' => 'remove_edit_access_data',
|
||||
// 'type' => 'reference_data', # is not a sub table read and connect, but only a sub table with data
|
||||
'max_empty' => 5, # maxium visible if no data is set, if filled add this number to visible
|
||||
'prefix' => 'ead',
|
||||
'elements' => array (
|
||||
'name' => array (
|
||||
'type' => 'text',
|
||||
'error_check' => 'alphanumeric|unique',
|
||||
'output_name' => 'Name',
|
||||
'mandatory' => 1
|
||||
),
|
||||
"name" => array (
|
||||
"type" => "text",
|
||||
"error_check" => "alphanumeric|unique",
|
||||
"output_name" => "Name"
|
||||
'value' => array (
|
||||
'type' => 'text',
|
||||
'output_name' => 'Value'
|
||||
),
|
||||
"value" => array (
|
||||
"type" => "text",
|
||||
"output_name" => "Value"
|
||||
'enabled' => array (
|
||||
'type' => 'checkbox',
|
||||
'output_name' => 'Activate',
|
||||
'int' => 1,
|
||||
'element_list' => array(1)
|
||||
),
|
||||
"enabled" => array (
|
||||
"type" => "checkbox",
|
||||
"output_name" => "Activate",
|
||||
"int" => 1,
|
||||
"element_list" => array(1)
|
||||
),
|
||||
"edit_access_id" => array (
|
||||
"int" => 1,
|
||||
"type" => "hidden",
|
||||
"fk_id" => 1 # reference main key from master table above
|
||||
/*'edit_access_id' => array (
|
||||
'int' => 1,
|
||||
'type' => 'hidden',
|
||||
'fk_id' => 1 # reference main key from master table above
|
||||
),*/
|
||||
'edit_access_data_id' => array (
|
||||
'type' => 'hidden',
|
||||
'int' => 1,
|
||||
'pk_id' => 1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,98 +1,105 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_groups = array (
|
||||
"table_array" => array (
|
||||
"edit_group_id" => array (
|
||||
"value" => $GLOBALS["edit_group_id"],
|
||||
"pk" => 1,
|
||||
"type" => "hidden"
|
||||
'table_array' => array (
|
||||
'edit_group_id' => array (
|
||||
'value' => isset($GLOBALS['edit_group_id']) ? $GLOBALS['edit_group_id'] : '',
|
||||
'pk' => 1,
|
||||
'type' => 'hidden'
|
||||
),
|
||||
"enabled" => array (
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'enabled' => array (
|
||||
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
|
||||
'output_name' => 'Enabled',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"name" => array (
|
||||
"value" => $GLOBALS["name"],
|
||||
"output_name" => "Group Name",
|
||||
"type" => "text",
|
||||
"mandatory" => 1
|
||||
'name' => array (
|
||||
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
|
||||
'output_name' => 'Group Name',
|
||||
'type' => 'text',
|
||||
'mandatory' => 1
|
||||
),
|
||||
"edit_access_right_id" => array (
|
||||
"value" => $GLOBALS["edit_access_right_id"],
|
||||
"output_name" => "Group Level",
|
||||
"mandatory" => 1,
|
||||
"int" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
'edit_access_right_id' => array (
|
||||
'value' => isset($GLOBALS['edit_access_right_id']) ? $GLOBALS['edit_access_right_id'] : '',
|
||||
'output_name' => 'Group Level',
|
||||
'mandatory' => 1,
|
||||
'int' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
),
|
||||
'edit_scheme_id' => array (
|
||||
'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
|
||||
'output_name' => 'Group Scheme',
|
||||
'int_null' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
|
||||
),
|
||||
'additional_acl' => array (
|
||||
'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
|
||||
'output_name' => 'Additional ACL (as JSON)',
|
||||
'type' => 'textarea',
|
||||
'error_check' => 'json',
|
||||
'rows' => 10,
|
||||
'cols' => 60
|
||||
),
|
||||
"edit_scheme_id" => array (
|
||||
"value" => $GLOBALS["edit_scheme_id"],
|
||||
"output_name" => "Group Scheme",
|
||||
"int_null" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
|
||||
)
|
||||
),
|
||||
"load_query" => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name",
|
||||
"table_name" => "edit_group",
|
||||
"show_fields" => array (
|
||||
'load_query' => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name",
|
||||
'table_name' => 'edit_group',
|
||||
'show_fields' => array (
|
||||
array (
|
||||
"name" => "name"
|
||||
'name' => 'name'
|
||||
),
|
||||
array (
|
||||
"name" => "enabled",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "Enabled: "
|
||||
'name' => 'enabled',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'Enabled: '
|
||||
)
|
||||
),
|
||||
"element_list" => array (
|
||||
"edit_page_access" => array (
|
||||
"output_name" => "Pages",
|
||||
"mandatory" => 1,
|
||||
"delete" => 0, // set then reference entries are deleted, else the "enable" flag is only set
|
||||
"enable_name" => "enable_page_access",
|
||||
"prefix" => "epa",
|
||||
"read_data" => array (
|
||||
"table_name" => "edit_page",
|
||||
"pk_id" => "edit_page_id",
|
||||
"name" => "name",
|
||||
"order" => "order_number"
|
||||
'element_list' => array (
|
||||
'edit_page_access' => array (
|
||||
'output_name' => 'Pages',
|
||||
'mandatory' => 1,
|
||||
'delete' => 0, // set then reference entries are deleted, else the 'enable' flag is only set
|
||||
'enable_name' => 'enable_page_access',
|
||||
'prefix' => 'epa',
|
||||
'read_data' => array (
|
||||
'table_name' => 'edit_page',
|
||||
'pk_id' => 'edit_page_id',
|
||||
'name' => 'name',
|
||||
'order' => 'order_number'
|
||||
),
|
||||
"elements" => array (
|
||||
"edit_page_access_id" => array (
|
||||
"output_name" => "Activate",
|
||||
"type" => "hidden",
|
||||
"int" => 1,
|
||||
"pk_id" => 1
|
||||
'elements' => array (
|
||||
'edit_page_access_id' => array (
|
||||
'type' => 'hidden',
|
||||
'int' => 1,
|
||||
'pk_id' => 1
|
||||
),
|
||||
"enabled" => array (
|
||||
"type" => "checkbox",
|
||||
"output_name" => "Activate",
|
||||
"int" => 1,
|
||||
"element_list" => array(1)
|
||||
'enabled' => array (
|
||||
'type' => 'checkbox',
|
||||
'output_name' => 'Activate',
|
||||
'int' => 1,
|
||||
'element_list' => array(1)
|
||||
),
|
||||
"edit_access_right_id" => array (
|
||||
"type" => "drop_down_db",
|
||||
"output_name" => "Access Level",
|
||||
"int" => 1,
|
||||
"preset" => 1, // first of the select
|
||||
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
'edit_access_right_id' => array (
|
||||
'type' => 'drop_down_db',
|
||||
'output_name' => 'Access Level',
|
||||
'int' => 1,
|
||||
'preset' => 1, // first of the select
|
||||
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
),
|
||||
"edit_page_id" => array (
|
||||
"int" => 1,
|
||||
"type" => "hidden"
|
||||
'edit_page_id' => array (
|
||||
'int' => 1,
|
||||
'type' => 'hidden'
|
||||
)
|
||||
/*,
|
||||
"edit_default" => array (
|
||||
"output_name" => "Default",
|
||||
"type" => "radio",
|
||||
"mandatory" => 1
|
||||
'edit_default' => array (
|
||||
'output_name' => 'Default',
|
||||
'type' => 'radio',
|
||||
'mandatory' => 1
|
||||
)*/
|
||||
)
|
||||
) // edit pages ggroup
|
||||
|
||||
@@ -1,75 +1,75 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_languages=array (
|
||||
"table_array" => array (
|
||||
"edit_language_id" => array (
|
||||
"value" => $GLOBALS["edit_language_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1
|
||||
'table_array' => array (
|
||||
'edit_language_id' => array (
|
||||
'value' => isset($GLOBALS['edit_language_id']) ? $GLOBALS['edit_language_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1
|
||||
),
|
||||
"short_name" => array (
|
||||
"value" => $GLOBALS["short_name"],
|
||||
"output_name" => "Language (short)",
|
||||
"mandatory" => 1,
|
||||
"type" => "text",
|
||||
"size" => 2,
|
||||
"length" => 2
|
||||
'short_name' => array (
|
||||
'value' => isset($GLOBALS['short_name']) ? $GLOBALS['short_name'] : '',
|
||||
'output_name' => 'Language (short)',
|
||||
'mandatory' => 1,
|
||||
'type' => 'text',
|
||||
'size' => 2,
|
||||
'length' => 2
|
||||
),
|
||||
"long_name" => array (
|
||||
"value" => $GLOBALS["long_name"],
|
||||
"output_name" => "Language (long)",
|
||||
"mandatory" => 1,
|
||||
"type" => "text",
|
||||
"size" => 40
|
||||
'long_name' => array (
|
||||
'value' => isset($GLOBALS['long_name']) ? $GLOBALS['long_name'] : '',
|
||||
'output_name' => 'Language (long)',
|
||||
'mandatory' => 1,
|
||||
'type' => 'text',
|
||||
'size' => 40
|
||||
),
|
||||
"iso_name" => array (
|
||||
"value" => $GLOBALS["iso_name"],
|
||||
"output_name" => "ISO Code",
|
||||
"mandatory" => 1,
|
||||
"type" => "text"
|
||||
'iso_name' => array (
|
||||
'value' => isset($GLOBALS['iso_name']) ? $GLOBALS['iso_name'] : '',
|
||||
'output_name' => 'ISO Code',
|
||||
'mandatory' => 1,
|
||||
'type' => 'text'
|
||||
),
|
||||
"order_number" => array (
|
||||
"value" => $GLOBALS["order_number"],
|
||||
"int" => 1,
|
||||
"order" => 1
|
||||
'order_number' => array (
|
||||
'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
|
||||
'int' => 1,
|
||||
'order' => 1
|
||||
),
|
||||
"enabled" => array (
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'enabled' => array (
|
||||
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
|
||||
'output_name' => 'Enabled',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"lang_default" => array (
|
||||
"value" => $GLOBALS["lang_default"],
|
||||
"output_name" => "Default Language",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'lang_default' => array (
|
||||
'value' => isset($GLOBALS['lang_default']) ? $GLOBALS['lang_default'] : '',
|
||||
'output_name' => 'Default Language',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
)
|
||||
),
|
||||
"load_query" => "SELECT edit_language_id, long_name, iso_name, enabled FROM edit_language ORDER BY long_name",
|
||||
"show_fields" => array (
|
||||
'load_query' => "SELECT edit_language_id, long_name, iso_name, enabled FROM edit_language ORDER BY long_name",
|
||||
'show_fields' => array (
|
||||
array (
|
||||
"name" => "long_name"
|
||||
'name' => 'long_name'
|
||||
),
|
||||
array (
|
||||
"name" => "iso_name",
|
||||
"before_value" => "ISO: "
|
||||
'name' => 'iso_name',
|
||||
'before_value' => 'ISO: '
|
||||
),
|
||||
array (
|
||||
"name" => "enabled",
|
||||
"before_value" => "Enabled: ",
|
||||
"binary" => array ("Yes","No")
|
||||
'name' => 'enabled',
|
||||
'before_value' => 'Enabled: ',
|
||||
'binary' => array ('Yes','No')
|
||||
)
|
||||
),
|
||||
"table_name" => "edit_language"
|
||||
'table_name' => 'edit_language'
|
||||
);
|
||||
|
||||
// __END__
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_menu_group = array (
|
||||
"table_array" => array (
|
||||
"edit_menu_group_id" => array (
|
||||
"value" => $GLOBALS["edit_menu_group_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1
|
||||
'table_array' => array (
|
||||
'edit_menu_group_id' => array (
|
||||
'value' => isset($GLOBALS['edit_menu_group_id']) ? $GLOBALS['edit_menu_group_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1
|
||||
),
|
||||
"name" => array (
|
||||
"value" => $GLOBALS["name"],
|
||||
"output_name" => $this->l->__("Group name"),
|
||||
"mandatory" => 1,
|
||||
"type" => "text"
|
||||
'name' => array (
|
||||
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
|
||||
'output_name' => $this->l->__('Group name'),
|
||||
'mandatory' => 1,
|
||||
'type' => 'text'
|
||||
),
|
||||
"flag" => array (
|
||||
"value" => $GLOBALS["flag"],
|
||||
"output_name" => $this->l->__("Flag"),
|
||||
"mandatory" => 1,
|
||||
"type" => "text",
|
||||
"error_check" => "alphanumeric|unique"
|
||||
'flag' => array (
|
||||
'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
|
||||
'output_name' => $this->l->__('Flag'),
|
||||
'mandatory' => 1,
|
||||
'type' => 'text',
|
||||
'error_check' => 'alphanumeric|unique'
|
||||
),
|
||||
"order_number" => array (
|
||||
"value" => $GLOBALS["order_number"],
|
||||
"output_name" => "Group order",
|
||||
"type" => "order",
|
||||
"int" => 1,
|
||||
"order" => 1
|
||||
'order_number' => array (
|
||||
'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
|
||||
'output_name' => 'Group order',
|
||||
'type' => 'order',
|
||||
'int' => 1,
|
||||
'order' => 1
|
||||
)
|
||||
),
|
||||
"table_name" => "edit_menu_group",
|
||||
"load_query" => "SELECT edit_menu_group_id, name FROM edit_menu_group ORDER BY name",
|
||||
"show_fields" => array (
|
||||
'table_name' => 'edit_menu_group',
|
||||
'load_query' => "SELECT edit_menu_group_id, name FROM edit_menu_group ORDER BY name",
|
||||
'show_fields' => array (
|
||||
array (
|
||||
"name" => "name"
|
||||
'name' => 'name'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,179 +1,235 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_pages = array (
|
||||
"table_array" => array (
|
||||
"edit_page_id" => array (
|
||||
"value" => $GLOBALS["edit_page_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1
|
||||
'table_array' => array (
|
||||
'edit_page_id' => array (
|
||||
'value' => isset($GLOBALS['edit_page_id']) ? $GLOBALS['edit_page_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1
|
||||
),
|
||||
"filename" => array (
|
||||
"value" => $GLOBALS["filename"],
|
||||
"output_name" => "Add File ...",
|
||||
"mandatory" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT DISTINCT temp_files.filename AS id, temp_files.filename AS name FROM temp_files LEFT JOIN edit_page ep ON temp_files.filename = ep.filename WHERE ep.filename IS NULL"
|
||||
'filename' => array (
|
||||
'value' => isset($GLOBALS['filename']) ? $GLOBALS['filename'] : '',
|
||||
'output_name' => 'Add File ...',
|
||||
'mandatory' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT DISTINCT temp_files.filename AS id, temp_files.filename AS name ".
|
||||
"FROM temp_files ".
|
||||
"LEFT JOIN edit_page ep ON temp_files.filename = ep.filename ".
|
||||
"WHERE ep.filename IS NULL"
|
||||
),
|
||||
"name" => array (
|
||||
"value" => $GLOBALS["name"],
|
||||
"output_name" => "Page name",
|
||||
"mandatory" => 1,
|
||||
"type" => "text"
|
||||
'name' => array (
|
||||
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
|
||||
'output_name' => 'Page name',
|
||||
'mandatory' => 1,
|
||||
'type' => 'text'
|
||||
),
|
||||
"order_number" => array (
|
||||
"value" => $GLOBALS["order_number"],
|
||||
"output_name" => "Page order",
|
||||
"type" => "order",
|
||||
"int" => 1,
|
||||
"order" => 1
|
||||
'order_number' => array (
|
||||
'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
|
||||
'output_name' => 'Page order',
|
||||
'type' => 'order',
|
||||
'int' => 1,
|
||||
'order' => 1
|
||||
),
|
||||
/* "flag" => array (
|
||||
"value" => $GLOBALS["flag"],
|
||||
"output_name" => "Page Flag",
|
||||
"type" => "drop_down_array",
|
||||
"query" => array (
|
||||
"0" => "0",
|
||||
"1" => "1",
|
||||
"2" => "2",
|
||||
"3" => "3",
|
||||
"4" => "4",
|
||||
"5" => "5"
|
||||
/* 'flag' => array (
|
||||
'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
|
||||
'output_name' => 'Page Flag',
|
||||
'type' => 'drop_down_array',
|
||||
'query' => array (
|
||||
'0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5'
|
||||
)
|
||||
),*/
|
||||
"online" => array (
|
||||
"value" => $GLOBALS["online"],
|
||||
"output_name" => "Online",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'online' => array (
|
||||
'value' => isset($GLOBALS['online']) ? $GLOBALS['online'] : '',
|
||||
'output_name' => 'Online',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"menu" => array (
|
||||
"value" => $GLOBALS["menu"],
|
||||
"output_name" => "Menu",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'menu' => array (
|
||||
'value' => isset($GLOBALS['menu']) ? $GLOBALS['menu'] : '',
|
||||
'output_name' => 'Menu',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"popup" => array (
|
||||
"value" => $GLOBALS["popup"],
|
||||
"output_name" => "Popup",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'popup' => array (
|
||||
'value' => isset($GLOBALS['popup']) ? $GLOBALS['popup'] : '',
|
||||
'output_name' => 'Popup',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"popup_x" => array (
|
||||
"value" => $GLOBALS["popup_x"],
|
||||
"output_name" => "Popup Width",
|
||||
"int_null" => 1,
|
||||
"type" => "text",
|
||||
"size" => 4,
|
||||
"length" => 4
|
||||
'popup_x' => array (
|
||||
'value' => isset($GLOBALS['popup_x']) ? $GLOBALS['popup_x'] : '',
|
||||
'output_name' => 'Popup Width',
|
||||
'int_null' => 1,
|
||||
'type' => 'text',
|
||||
'size' => 4,
|
||||
'length' => 4
|
||||
),
|
||||
"popup_y" => array (
|
||||
"value" => $GLOBALS["popup_y"],
|
||||
"output_name" => "Popup Height",
|
||||
"int_null" => 1,
|
||||
"type" => "text",
|
||||
"size" => 4,
|
||||
"length" => 4
|
||||
)/*,
|
||||
"query_string" => array (
|
||||
"value" => $GLOBALS["query_string"],
|
||||
"output_name" => "Query String for Link",
|
||||
"type" => "text",
|
||||
"size" => "50"
|
||||
)*/
|
||||
),
|
||||
"load_query" => "SELECT edit_page_id, filename, name, online, menu, popup FROM edit_page ORDER BY order_number",
|
||||
"table_name" => "edit_page",
|
||||
"show_fields" => array (
|
||||
array (
|
||||
"name" => "name"
|
||||
'popup_y' => array (
|
||||
'value' => isset($GLOBALS['popup_y']) ? $GLOBALS['popup_y'] : '',
|
||||
'output_name' => 'Popup Height',
|
||||
'int_null' => 1,
|
||||
'type' => 'text',
|
||||
'size' => 4,
|
||||
'length' => 4
|
||||
),
|
||||
array (
|
||||
"name" => "filename",
|
||||
"before_value" => "Filename: "
|
||||
),
|
||||
array (
|
||||
"name" => "online",
|
||||
"binary" => array ("Yes","No"),
|
||||
"before_value" => "Online: "
|
||||
),
|
||||
array (
|
||||
"name" => "menu",
|
||||
"binary" => array ("Yes","No"),
|
||||
"before_value" => "Menu: "
|
||||
),
|
||||
array (
|
||||
"name" => "popup",
|
||||
"binary" => array ("Yes","No"),
|
||||
"before_value" => "Popup: "
|
||||
'content_alias_edit_page_id' => array (
|
||||
'value' => isset($GLOBALS['content_alias_edit_page_id']) ? $GLOBALS['content_alias_edit_page_id'] : '',
|
||||
'output_name' => 'Content Alias Source',
|
||||
'int' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
// query creation
|
||||
'select_distinct' => 0,
|
||||
'pk_name' => 'edit_page_id AS content_alias_edit_page_id',
|
||||
'input_name' => 'name',
|
||||
'table_name' => 'edit_page',
|
||||
'where_not_self' => 1,
|
||||
'order_by' => 'order_number'
|
||||
// 'query' => "SELECT edit_page_id AS content_alias_edit_page_id, name ".
|
||||
// "FROM edit_page ".
|
||||
// (isset($GLOBALS['edit_page_id']) ? " WHERE edit_page_id <> ".$GLOBALS['edit_page_id'] : "")." ".
|
||||
// "ORDER BY order_number"
|
||||
)
|
||||
),
|
||||
"reference_arrays" => array (
|
||||
"edit_visible_group" => array (
|
||||
"table_name" => "edit_page_visible_group",
|
||||
"other_table_pk" => "edit_visible_group_id",
|
||||
"output_name" => "Visible Groups (access)",
|
||||
"mandatory" => 1,
|
||||
"select_size" => 10,
|
||||
"selected" => $GLOBALS["edit_visible_group_id"],
|
||||
"query" => 'SELECT edit_visible_group_id, \'Name: \' || name || \', \' || \'Flag: \' || flag FROM edit_visible_group ORDER BY name'
|
||||
'load_query' => "SELECT edit_page_id, filename, name, online, menu, popup FROM edit_page ORDER BY order_number",
|
||||
'table_name' => 'edit_page',
|
||||
'show_fields' => array (
|
||||
array (
|
||||
'name' => 'name'
|
||||
),
|
||||
"edit_menu_group" => array (
|
||||
"table_name" => "edit_page_menu_group",
|
||||
"other_table_pk" => "edit_menu_group_id",
|
||||
"output_name" => "Menu Groups (grouping)",
|
||||
"mandatory" => 1,
|
||||
"select_size" => 10,
|
||||
"selected" => $GLOBALS["edit_menu_group_id"],
|
||||
"query" => 'SELECT edit_menu_group_id, \'Name: \' || name || \', \' || \'Flag: \' || flag FROM edit_menu_group ORDER BY order_number'
|
||||
array (
|
||||
'name' => 'filename',
|
||||
'before_value' => 'Filename: '
|
||||
),
|
||||
array (
|
||||
'name' => 'online',
|
||||
'binary' => array ('Yes','No'),
|
||||
'before_value' => 'Online: '
|
||||
),
|
||||
array (
|
||||
'name' => 'menu',
|
||||
'binary' => array ('Yes','No'),
|
||||
'before_value' => 'Menu: '
|
||||
),
|
||||
array (
|
||||
'name' => 'popup',
|
||||
'binary' => array ('Yes','No'),
|
||||
'before_value' => 'Popup: '
|
||||
)
|
||||
),
|
||||
'reference_arrays' => array (
|
||||
'edit_visible_group' => array (
|
||||
'table_name' => 'edit_page_visible_group',
|
||||
'other_table_pk' => 'edit_visible_group_id',
|
||||
'output_name' => 'Visible Groups (access)',
|
||||
'mandatory' => 1,
|
||||
'select_size' => 10,
|
||||
'selected' => isset($GLOBALS['edit_visible_group_id']) ? $GLOBALS['edit_visible_group_id'] : '',
|
||||
'query' => "SELECT edit_visible_group_id, 'Name: ' || name || ', ' || 'Flag: ' || flag FROM edit_visible_group ORDER BY name"
|
||||
),
|
||||
'edit_menu_group' => array (
|
||||
'table_name' => 'edit_page_menu_group',
|
||||
'other_table_pk' => 'edit_menu_group_id',
|
||||
'output_name' => 'Menu Groups (grouping)',
|
||||
'mandatory' => 1,
|
||||
'select_size' => 10,
|
||||
'selected' => isset($GLOBALS['edit_menu_group_id']) ? $GLOBALS['edit_menu_group_id'] : '',
|
||||
'query' => "SELECT edit_menu_group_id, 'Name: ' || name || ', ' || 'Flag: ' || flag FROM edit_menu_group ORDER BY order_number"
|
||||
)
|
||||
|
||||
),
|
||||
"element_list" => array (
|
||||
"edit_query_string" => array (
|
||||
"output_name" => "Query Strings",
|
||||
"delete_name" => "remove_query_string",
|
||||
"prefix" => "eqs",
|
||||
"elements" => array (
|
||||
"name" => array (
|
||||
"output_name" => "Name",
|
||||
"type" => "text",
|
||||
"error_check" => "unique|alphanumeric",
|
||||
"mandatory" => 1
|
||||
'element_list' => array (
|
||||
'edit_query_string' => array (
|
||||
'output_name' => 'Query Strings',
|
||||
'delete_name' => 'remove_query_string',
|
||||
'prefix' => 'eqs',
|
||||
'elements' => array (
|
||||
'name' => array (
|
||||
'output_name' => 'Name',
|
||||
'type' => 'text',
|
||||
'error_check' => 'unique|alphanumeric',
|
||||
'mandatory' => 1
|
||||
),
|
||||
"value" => array (
|
||||
"output_name" => "Value",
|
||||
"type" => "text"
|
||||
'value' => array (
|
||||
'output_name' => 'Value',
|
||||
'type' => 'text'
|
||||
),
|
||||
"enabled" => array (
|
||||
"output_name" => "Enabled",
|
||||
"int" => 1,
|
||||
"type" => "checkbox",
|
||||
"element_list" => array (1)
|
||||
'enabled' => array (
|
||||
'output_name' => 'Enabled',
|
||||
'int' => 1,
|
||||
'type' => 'checkbox',
|
||||
'element_list' => array (1)
|
||||
),
|
||||
"dynamic" => array (
|
||||
"output_name" => "Dynamic",
|
||||
"int" => 1,
|
||||
"type" => "checkbox",
|
||||
"element_list" => array (1)
|
||||
'dynamic' => array (
|
||||
'output_name' => 'Dynamic',
|
||||
'int' => 1,
|
||||
'type' => 'checkbox',
|
||||
'element_list' => array (1)
|
||||
),
|
||||
"edit_query_string_id" => array (
|
||||
"type" => "hidden",
|
||||
"pk_id" => 1
|
||||
'edit_query_string_id' => array (
|
||||
'type' => 'hidden',
|
||||
'pk_id' => 1
|
||||
)
|
||||
) // elements
|
||||
) // query_string element list
|
||||
), // query_string element list
|
||||
'edit_page_content' => array (
|
||||
'output_name' => 'Page Content',
|
||||
'delete_name' => 'remove_page_content',
|
||||
'prefix' => 'epc',
|
||||
'elements' => array (
|
||||
'name' => array (
|
||||
'output_name' => 'Content',
|
||||
'type' => 'text',
|
||||
'error_check' => 'alphanumeric',
|
||||
'mandatory' => 1
|
||||
),
|
||||
'uid' => array (
|
||||
'output_name' => 'UID',
|
||||
'type' => 'text',
|
||||
'error_check' => 'unique|alphanumeric',
|
||||
'mandatory' => 1
|
||||
),
|
||||
'order_number' => array (
|
||||
'output_name' => 'Order',
|
||||
'type' => 'text',
|
||||
'error_check' => 'int',
|
||||
'mandatory' => 1
|
||||
),
|
||||
'online' => array (
|
||||
'output_name' => 'Online',
|
||||
'int' => 1,
|
||||
'type' => 'checkbox',
|
||||
'element_list' => array (1)
|
||||
),
|
||||
'edit_access_right_id' => array (
|
||||
'type' => 'drop_down_db',
|
||||
'output_name' => 'Access Level',
|
||||
'int' => 1,
|
||||
'preset' => 1, // first of the select
|
||||
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
),
|
||||
'edit_page_content_id' => array (
|
||||
'type' => 'hidden',
|
||||
'pk_id' => 1
|
||||
)
|
||||
)
|
||||
)
|
||||
) // element list
|
||||
);
|
||||
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_schemes = array (
|
||||
"table_array" => array (
|
||||
"edit_scheme_id" => array (
|
||||
"value" => $GLOBALS["edit_scheme_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1
|
||||
'table_array' => array (
|
||||
'edit_scheme_id' => array (
|
||||
'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1
|
||||
),
|
||||
"name" => array (
|
||||
"value" => $GLOBALS["name"],
|
||||
"output_name" => "Scheme Name",
|
||||
"mandatory" => 1,
|
||||
"type" => "text"
|
||||
'name' => array (
|
||||
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
|
||||
'output_name' => 'Scheme Name',
|
||||
'mandatory' => 1,
|
||||
'type' => 'text'
|
||||
),
|
||||
"header_color" => array (
|
||||
"value" => $GLOBALS["header_color"],
|
||||
"output_name" => "Header Color",
|
||||
"mandatory" => 1,
|
||||
"type" => "text",
|
||||
"size" => 6,
|
||||
"length" => 6,
|
||||
"error_check" => "custom",
|
||||
"error_regex" => "/[\dA-Fa-f]{6}/",
|
||||
"error_example" => "F6A544"
|
||||
'header_color' => array (
|
||||
'value' => isset($GLOBALS['header_color']) ? $GLOBALS['header_color'] : '',
|
||||
'output_name' => 'Header Color',
|
||||
'mandatory' => 1,
|
||||
'type' => 'text',
|
||||
'size' => 6,
|
||||
'length' => 6,
|
||||
'error_check' => 'custom',
|
||||
'error_regex' => '/[\dA-Fa-f]{6}/',
|
||||
'error_example' => 'F6A544'
|
||||
),
|
||||
"enabled" => array (
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"int" => 1,
|
||||
"type" => "binary",
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'enabled' => array (
|
||||
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
|
||||
'output_name' => 'Enabled',
|
||||
'int' => 1,
|
||||
'type' => 'binary',
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"template" => array (
|
||||
"value" => $GLOBALS["template"],
|
||||
"output_name" => "Template",
|
||||
"type" => "text"
|
||||
'template' => array (
|
||||
'value' => isset($GLOBALS['template']) ? $GLOBALS['template'] : '',
|
||||
'output_name' => 'Template',
|
||||
'type' => 'text'
|
||||
)
|
||||
),
|
||||
"table_name" => "edit_scheme",
|
||||
"load_query" => "SELECT edit_scheme_id, name, enabled FROM edit_scheme ORDER BY name",
|
||||
"show_fields" => array (
|
||||
'table_name' => 'edit_scheme',
|
||||
'load_query' => "SELECT edit_scheme_id, name, enabled FROM edit_scheme ORDER BY name",
|
||||
'show_fields' => array (
|
||||
array (
|
||||
"name" => "name"
|
||||
'name' => 'name'
|
||||
),
|
||||
array (
|
||||
"name" => "enabled",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "Enabled: "
|
||||
'name' => 'enabled',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'Enabled: '
|
||||
)
|
||||
)
|
||||
); // main array
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_users = array (
|
||||
"table_array" => array (
|
||||
"edit_user_id" => array (
|
||||
"value" => $GLOBALS["edit_user_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1,
|
||||
"int" => 1
|
||||
'table_array' => array (
|
||||
'edit_user_id' => array (
|
||||
'value' => isset($GLOBALS['edit_user_id']) ? $GLOBALS['edit_user_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1,
|
||||
'int' => 1
|
||||
),
|
||||
"username" => array (
|
||||
"value" => $GLOBALS["username"],
|
||||
"output_name" => "Username",
|
||||
"mandatory" => 1,
|
||||
"error_check" => "unique|alphanumericextended",
|
||||
"type" => "text"
|
||||
'username' => array (
|
||||
'value' => isset($GLOBALS['username']) ? $GLOBALS['username'] : '',
|
||||
'output_name' => 'Username',
|
||||
'mandatory' => 1,
|
||||
'error_check' => 'unique|alphanumericextended',
|
||||
'type' => 'text'
|
||||
),
|
||||
"password" => array (
|
||||
"value" => $GLOBALS["password"],
|
||||
"HIDDEN_value" => $GLOBALS["HIDDEN_password"],
|
||||
"CONFIRM_value" => $GLOBALS["CONFIRM_password"],
|
||||
"output_name" => "Password",
|
||||
"mandatory" => 1,
|
||||
"type" => "password", // later has to be password for encryption in database
|
||||
'password' => array (
|
||||
'value' => isset($GLOBALS['password']) ? $GLOBALS['password'] : '',
|
||||
'HIDDEN_value' => isset($GLOBALS['HIDDEN_password']) ? $GLOBALS['HIDDEN_password'] : '',
|
||||
'CONFIRM_value' => isset($GLOBALS['CONFIRM_password']) ? $GLOBALS['CONFIRM_password'] : '',
|
||||
'output_name' => 'Password',
|
||||
'mandatory' => 1,
|
||||
'type' => 'password', // later has to be password for encryption in database
|
||||
'update' => array ( // connected field updates, and update data
|
||||
'password_change_date' => array ( // db row to update
|
||||
'type' => 'date', // type of field (int/text/date/etc)
|
||||
@@ -32,7 +32,7 @@ $edit_users = array (
|
||||
// password date when first insert and password is set, needs special field with connection to password
|
||||
// password reset force interval, if set, user needs to reset password after X time period
|
||||
'password_change_interval' => array (
|
||||
'value' => $GLOBALS['password_change_interval'],
|
||||
'value' => isset($GLOBALS['password_change_interval']) ? $GLOBALS['password_change_interval'] : '',
|
||||
'output_name' => 'Password change interval',
|
||||
'error_check' => 'intervalshort', // can be any date length format. n Y/M/D [not H/M/S], only one set, no combination
|
||||
'type' => 'text',
|
||||
@@ -40,218 +40,227 @@ $edit_users = array (
|
||||
'size' => 5, // make it 5 chars long
|
||||
'length' => 5
|
||||
),
|
||||
"enabled" => array (
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'enabled' => array (
|
||||
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
|
||||
'output_name' => 'Enabled',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"strict" => array (
|
||||
"value" => $GLOBALS["strict"],
|
||||
"output_name" => "Strict (Lock after errors)",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'strict' => array (
|
||||
'value' => isset($GLOBALS['strict']) ? $GLOBALS['strict'] : '',
|
||||
'output_name' => 'Strict (Lock after errors)',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"locked" => array (
|
||||
"value" => $GLOBALS["locked"],
|
||||
"output_name" => "Locked (auto set if strict with errors)",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'locked' => array (
|
||||
'value' => isset($GLOBALS['locked']) ? $GLOBALS['locked'] : '',
|
||||
'output_name' => 'Locked (auto set if strict with errors)',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"admin" => array (
|
||||
"value" => $GLOBALS["admin"],
|
||||
"output_name" => "Admin",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'admin' => array (
|
||||
'value' => isset($GLOBALS['admin']) ? $GLOBALS['admin'] : '',
|
||||
'output_name' => 'Admin',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"debug" => array (
|
||||
"value" => $GLOBALS["debug"],
|
||||
"output_name" => "Debug",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'debug' => array (
|
||||
'value' => isset($GLOBALS['debug']) ? $GLOBALS['debug'] : '',
|
||||
'output_name' => 'Debug',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"db_debug" => array (
|
||||
"value" => $GLOBALS["db_debug"],
|
||||
"output_name" => "DB Debug",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'db_debug' => array (
|
||||
'value' => isset($GLOBALS['db_debug']) ? $GLOBALS['db_debug'] : '',
|
||||
'output_name' => 'DB Debug',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
"email" => array (
|
||||
"value" => $GLOBALS["email"],
|
||||
"output_name" => "E-Mail",
|
||||
"type" => "text"
|
||||
'email' => array (
|
||||
'value' => isset($GLOBALS['email']) ? $GLOBALS['email'] : '',
|
||||
'output_name' => 'E-Mail',
|
||||
'type' => 'text',
|
||||
'error_check' => 'email'
|
||||
),
|
||||
"last_name" => array (
|
||||
"value" => $GLOBALS["last_name"],
|
||||
"output_name" => "Last Name",
|
||||
"type" => "text"
|
||||
'last_name' => array (
|
||||
'value' => isset($GLOBALS['last_name']) ? $GLOBALS['last_name'] : '',
|
||||
'output_name' => 'Last Name',
|
||||
'type' => 'text'
|
||||
),
|
||||
"first_name" => array (
|
||||
"value" => $GLOBALS["first_name"],
|
||||
"output_name" => "First Name",
|
||||
"type" => "text"
|
||||
'first_name' => array (
|
||||
'value' => isset($GLOBALS['first_name']) ? $GLOBALS['first_name'] : '',
|
||||
'output_name' => 'First Name',
|
||||
'type' => 'text'
|
||||
),
|
||||
"edit_language_id" => array (
|
||||
"value" => $GLOBALS["edit_language_id"],
|
||||
"output_name" => "Language",
|
||||
"mandatory" => 1,
|
||||
"int" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT edit_language_id, long_name FROM edit_language WHERE enabled = 1 ORDER BY order_number"
|
||||
'edit_language_id' => array (
|
||||
'value' => isset($GLOBALS['edit_language_id']) ? $GLOBALS['edit_language_id'] : '',
|
||||
'output_name' => 'Language',
|
||||
'mandatory' => 1,
|
||||
'int' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT edit_language_id, long_name FROM edit_language WHERE enabled = 1 ORDER BY order_number"
|
||||
),
|
||||
"edit_scheme_id" => array (
|
||||
"value" => $GLOBALS["edit_scheme_id"],
|
||||
"output_name" => "Scheme",
|
||||
"int_null" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
|
||||
'edit_scheme_id' => array (
|
||||
'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
|
||||
'output_name' => 'Scheme',
|
||||
'int_null' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
|
||||
),
|
||||
"edit_group_id" => array (
|
||||
"value" => $GLOBALS["edit_group_id"],
|
||||
"output_name" => "Group",
|
||||
"int" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT edit_group_id, name FROM edit_group WHERE enabled = 1 ORDER BY name",
|
||||
"mandatory" => 1
|
||||
'edit_group_id' => array (
|
||||
'value' => isset($GLOBALS['edit_group_id']) ? $GLOBALS['edit_group_id'] : '',
|
||||
'output_name' => 'Group',
|
||||
'int' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT edit_group_id, name FROM edit_group WHERE enabled = 1 ORDER BY name",
|
||||
'mandatory' => 1
|
||||
),
|
||||
"edit_access_right_id" => array (
|
||||
"value" => $GLOBALS["edit_access_right_id"],
|
||||
"output_name" => "User Level",
|
||||
"mandatory" => 1,
|
||||
"int" => 1,
|
||||
"type" => "drop_down_db",
|
||||
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
'edit_access_right_id' => array (
|
||||
'value' => isset($GLOBALS['edit_access_right_id']) ? $GLOBALS['edit_access_right_id'] : '',
|
||||
'output_name' => 'User Level',
|
||||
'mandatory' => 1,
|
||||
'int' => 1,
|
||||
'type' => 'drop_down_db',
|
||||
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
),
|
||||
"login_error_count" => array (
|
||||
"output_name" => "Login error count",
|
||||
"value" => $GLOBALS['login_error_count'],
|
||||
"type" => "view",
|
||||
"empty" => "0"
|
||||
'login_error_count' => array (
|
||||
'output_name' => 'Login error count',
|
||||
'value' => isset($GLOBALS['login_error_count']) ? $GLOBALS['login_error_count'] : '',
|
||||
'type' => 'view',
|
||||
'empty' => '0'
|
||||
),
|
||||
"login_error_date_last" => array (
|
||||
"output_name" => "Last login error",
|
||||
"value" => $GLOBALS['login_error_date_liast'],
|
||||
"type" => "view",
|
||||
"empty" => "-"
|
||||
'login_error_date_last' => array (
|
||||
'output_name' => 'Last login error',
|
||||
'value' => isset($GLOBALS['login_error_date_liast']) ? $GLOBALS['login_error_date_liast'] : '',
|
||||
'type' => 'view',
|
||||
'empty' => '-'
|
||||
),
|
||||
"login_error_date_first" => array (
|
||||
"output_name" => "First login error",
|
||||
"value" => $GLOBALS['login_error_date_first'],
|
||||
"type" => "view",
|
||||
"empty" => "-"
|
||||
'login_error_date_first' => array (
|
||||
'output_name' => 'First login error',
|
||||
'value' => isset($GLOBALS['login_error_date_first']) ? $GLOBALS['login_error_date_first'] : '',
|
||||
'type' => 'view',
|
||||
'empty' => '-'
|
||||
),
|
||||
"protected" => array (
|
||||
"value" => $GLOBALS["protected"],
|
||||
"output_name" => "Protected",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
'protected' => array (
|
||||
'value' => isset($GLOBALS['protected']) ? $GLOBALS['protected'] : '',
|
||||
'output_name' => 'Protected',
|
||||
'type' => 'binary',
|
||||
'int' => 1,
|
||||
'element_list' => array (
|
||||
'1' => 'Yes',
|
||||
'0' => 'No'
|
||||
)
|
||||
),
|
||||
'additional_acl' => array (
|
||||
'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
|
||||
'output_name' => 'Additional ACL (as JSON)',
|
||||
'type' => 'textarea',
|
||||
'error_check' => 'json',
|
||||
'rows' => 10,
|
||||
'cols' => 60
|
||||
),
|
||||
),
|
||||
'load_query' => "SELECT edit_user_id, username, enabled, debug, db_debug, strict, locked, login_error_count FROM edit_user ORDER BY username",
|
||||
'table_name' => 'edit_user',
|
||||
'show_fields' => array (
|
||||
array (
|
||||
'name' => 'username'
|
||||
),
|
||||
array (
|
||||
'name' => 'enabled',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'Enabled: '
|
||||
),
|
||||
array (
|
||||
'name' => 'debug',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'Debug: '
|
||||
),
|
||||
array (
|
||||
'name' => 'db_debug',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'DB Debug: '
|
||||
),
|
||||
array (
|
||||
'name' => 'strict',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'Strict: '
|
||||
),
|
||||
array (
|
||||
'name' => 'locked',
|
||||
'binary' => array ('Yes', 'No'),
|
||||
'before_value' => 'Locked: '
|
||||
),
|
||||
array (
|
||||
'name' => 'login_error_count',
|
||||
'before_value' => 'Errors: '
|
||||
)
|
||||
),
|
||||
"load_query" => "SELECT edit_user_id, username, enabled, debug, db_debug, strict, locked, login_error_count FROM edit_user ORDER BY username",
|
||||
"table_name" => "edit_user",
|
||||
"show_fields" => array (
|
||||
array (
|
||||
"name" => "username"
|
||||
),
|
||||
array (
|
||||
"name" => "enabled",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "Enabled: "
|
||||
),
|
||||
array (
|
||||
"name" => "debug",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "Debug: "
|
||||
),
|
||||
array (
|
||||
"name" => "db_debug",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "DB Debug: "
|
||||
),
|
||||
array (
|
||||
"name" => "strict",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "Strict: "
|
||||
),
|
||||
array (
|
||||
"name" => "locked",
|
||||
"binary" => array ("Yes", "No"),
|
||||
"before_value" => "Locked: "
|
||||
),
|
||||
array (
|
||||
"name" => "login_error_count",
|
||||
"before_value" => "Errors: "
|
||||
)
|
||||
),
|
||||
"element_list" => array (
|
||||
"edit_access_user" => array (
|
||||
"output_name" => "Accounts",
|
||||
"mandatory" => 1,
|
||||
"delete" => 0, // set then reference entries are deleted, else the "enable" flag is only set
|
||||
"prefix" => "ecu",
|
||||
"read_data" => array (
|
||||
"table_name" => "edit_access",
|
||||
"pk_id" => "edit_access_id",
|
||||
"name" => "name",
|
||||
"order" => "name"
|
||||
'element_list' => array (
|
||||
'edit_access_user' => array (
|
||||
'output_name' => 'Accounts',
|
||||
'mandatory' => 1,
|
||||
'delete' => 0, // set then reference entries are deleted, else the 'enable' flag is only set
|
||||
'prefix' => 'ecu',
|
||||
'read_data' => array (
|
||||
'table_name' => 'edit_access',
|
||||
'pk_id' => 'edit_access_id',
|
||||
'name' => 'name',
|
||||
'order' => 'name'
|
||||
),
|
||||
"elements" => array (
|
||||
"edit_access_user_id" => array (
|
||||
"output_name" => "Activate",
|
||||
"type" => "hidden",
|
||||
"int" => 1,
|
||||
"pk_id" => 1
|
||||
'elements' => array (
|
||||
'edit_access_user_id' => array (
|
||||
'output_name' => 'Activate',
|
||||
'type' => 'hidden',
|
||||
'int' => 1,
|
||||
'pk_id' => 1
|
||||
),
|
||||
"enabled" => array (
|
||||
"type" => "checkbox",
|
||||
"output_name" => "Activate",
|
||||
"int" => 1,
|
||||
"element_list" => array (1)
|
||||
'enabled' => array (
|
||||
'type' => 'checkbox',
|
||||
'output_name' => 'Activate',
|
||||
'int' => 1,
|
||||
'element_list' => array (1)
|
||||
),
|
||||
"edit_access_right_id" => array (
|
||||
"type" => "drop_down_db",
|
||||
"output_name" => "Access Level",
|
||||
"preset" => 1, // first of the select
|
||||
"int" => 1,
|
||||
"query" => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
'edit_access_right_id' => array (
|
||||
'type' => 'drop_down_db',
|
||||
'output_name' => 'Access Level',
|
||||
'preset' => 1, // first of the select
|
||||
'int' => 1,
|
||||
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
|
||||
),
|
||||
"edit_default" => array (
|
||||
"type" => "radio_group",
|
||||
"output_name" => "Default",
|
||||
"int" => 1,
|
||||
"element_list" => "radio_group"
|
||||
'edit_default' => array (
|
||||
'type' => 'radio_group',
|
||||
'output_name' => 'Default',
|
||||
'int' => 1,
|
||||
'element_list' => 'radio_group'
|
||||
),
|
||||
"edit_access_id" => array (
|
||||
"type" => "hidden",
|
||||
"int" => 1
|
||||
'edit_access_id' => array (
|
||||
'type' => 'hidden',
|
||||
'int' => 1
|
||||
)
|
||||
)
|
||||
) // edit pages ggroup
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
$edit_visible_group = array (
|
||||
"table_array" => array (
|
||||
"edit_visible_group_id" => array (
|
||||
"value" => $GLOBALS["edit_visible_group_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1
|
||||
'table_array' => array (
|
||||
'edit_visible_group_id' => array (
|
||||
'value' => isset($GLOBALS['edit_visible_group_id']) ? $GLOBALS['edit_visible_group_id'] : '',
|
||||
'type' => 'hidden',
|
||||
'pk' => 1
|
||||
),
|
||||
"name" => array (
|
||||
"value" => $GLOBALS["name"],
|
||||
"output_name" => $this->l->__("Group name"),
|
||||
"mandatory" => 1,
|
||||
"type" => "text"
|
||||
'name' => array (
|
||||
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
|
||||
'output_name' => $this->l->__('Group name'),
|
||||
'mandatory' => 1,
|
||||
'type' => 'text'
|
||||
),
|
||||
"flag" => array (
|
||||
"value" => $GLOBALS["flag"],
|
||||
"output_name" => $this->l->__("Flag"),
|
||||
"mandatory" => 1,
|
||||
"type" => "text",
|
||||
"error_check" => "alphanumeric|unique"
|
||||
'flag' => array (
|
||||
'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
|
||||
'output_name' => $this->l->__('Flag'),
|
||||
'mandatory' => 1,
|
||||
'type' => 'text',
|
||||
'error_check' => 'alphanumeric|unique'
|
||||
)
|
||||
),
|
||||
"table_name" => "edit_visible_group",
|
||||
"load_query" => "SELECT edit_visible_group_id, name FROM edit_visible_group ORDER BY name",
|
||||
"show_fields" => array (
|
||||
'table_name' => 'edit_visible_group',
|
||||
'load_query' => "SELECT edit_visible_group_id, name FROM edit_visible_group ORDER BY name",
|
||||
'show_fields' => array (
|
||||
array (
|
||||
"name" => "name"
|
||||
'name' => 'name'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -114,8 +114,8 @@
|
||||
{/foreach}
|
||||
</table>
|
||||
{if $element.data.delete_name}
|
||||
<input type="hidden" value="" name="{$element.data.delete_name}">
|
||||
<input type="hidden" value="" name="{$element.data.delete_name}_flag">
|
||||
<input type="hidden" value="" id="{$element.data.delete_name}" name="{$element.data.delete_name}">
|
||||
<input type="hidden" value="" id="{$element.data.delete_name}_flag" name="{$element.data.delete_name}_flag">
|
||||
<input type="hidden" name="remove_name[]" value="{$element.data.delete_name}">
|
||||
{/if}
|
||||
{if $element.data.enable_name}
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
{if $STYLESHEET}
|
||||
<link rel=stylesheet type="text/css" href="{$css}{$STYLESHEET}">
|
||||
{/if}
|
||||
{if $JAVASCRIPT}
|
||||
<script language="JavaScript" src="{$JS}{$JAVASCRIPT}"></script>
|
||||
{/if}
|
||||
{if $DATE_JAVASCRIPT}
|
||||
<script language="JavaScript" src="{$JS}{$DATE_JAVASCRIPT}"></script>
|
||||
{/if}
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="1">
|
||||
|
||||
@@ -221,6 +221,38 @@ function getTimestamp()
|
||||
return date.getTime();
|
||||
}
|
||||
|
||||
// METHOD: dec2hex
|
||||
// PARAMS: decimal string
|
||||
// RETURN: string
|
||||
// DESC : dec2hex :: Integer -> String
|
||||
// i.e. 0-255 -> '00'-'ff'
|
||||
function dec2hex(dec)
|
||||
{
|
||||
return ('0' + dec.toString(16)).substr(-2);
|
||||
}
|
||||
|
||||
// METHOD: generateId
|
||||
// PARAMS: lenght in int
|
||||
// RETURN: random string
|
||||
// DESC : generateId :: Integer -> String
|
||||
// only works on mondern browsers
|
||||
function generateId(len)
|
||||
{
|
||||
var arr = new Uint8Array((len || 40) / 2);
|
||||
(window.crypto || window.msCrypto).getRandomValues(arr);
|
||||
return Array.from(arr, dec2hex).join('');
|
||||
}
|
||||
|
||||
// METHOD: randomIdF()
|
||||
// PARAMS: none
|
||||
// RETURN: not true random string
|
||||
// DESC : creates a pseudo random string of 10 characters
|
||||
// after many runs it will create duplicates
|
||||
function randomIdF()
|
||||
{
|
||||
return Math.random().toString(36).substring(2);
|
||||
}
|
||||
|
||||
// METHOD: isObject
|
||||
// PARAMS: possible object
|
||||
// RETURN: true/false if it is an object or not
|
||||
@@ -242,6 +274,22 @@ const keyInObject = (key, object) => (key in object) ? true : false;
|
||||
return (key in object) ? true : false;
|
||||
}*/
|
||||
|
||||
// METHOD: getKeyByValue
|
||||
// PARAMS: object, value
|
||||
// RETURN: key found
|
||||
// DESC : returns matching key of value
|
||||
const getKeyByValue = (obj, value) => Object.keys(obj).find(key => obj[key] === value);
|
||||
// function getKeyByValue(object, value)
|
||||
// {
|
||||
// return Object.keys(object).find(key => object[key] === value);
|
||||
// }
|
||||
|
||||
// METHOD: valueInObject
|
||||
// PARAMS: obj, value
|
||||
// RETURN: true/false
|
||||
// DESC : returns true if value is found in object with a key
|
||||
const valueInObject = (obj, value) => (Object.keys(obj).find(key => obj[key] === value)) ? true : false;
|
||||
|
||||
// METHOD: exists
|
||||
// PARAMS: uid
|
||||
// RETURN: true/false
|
||||
@@ -554,6 +602,8 @@ function phfo(tree)
|
||||
// *** DOM MANAGEMENT FUNCTIONS
|
||||
|
||||
// BLOCK: html wrappers for quickly creating html data blocks
|
||||
|
||||
// NOTE : OLD FORMAT which misses multiple block set
|
||||
// METHOD: html_options
|
||||
// PARAMS: name/id, array for the options, selected item uid
|
||||
// options_only [def false] if this is true, it will not print the select part
|
||||
@@ -563,15 +613,40 @@ function phfo(tree)
|
||||
// DESC : creates an select/options drop down block.
|
||||
// the array needs to be key -> value format. key is for the option id and value is for the data output
|
||||
function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '')
|
||||
{
|
||||
// wrapper to new call
|
||||
return html_options_block(name, data, selected, false, options_only, return_string, sort);
|
||||
}
|
||||
|
||||
// NOTE : USE THIS CALL, the above one is deprecated
|
||||
// METHOD: html_options
|
||||
// PARAMS: name/id, array for the options,
|
||||
// selected item uid [drop down string, multi select array]
|
||||
// multiple [def 0] if this is 1 or larger, the drop down will be turned into multiple select
|
||||
// the number sets the size value unless it is 1, then it is default
|
||||
// options_only [def false] if this is true, it will not print the select part
|
||||
// return_string [def false]: return as string and not as element
|
||||
// sort [def '']: if empty as is, else allowed 'keys', 'values' all others are ignored
|
||||
// RETURN: html with build options block
|
||||
// DESC : creates an select/options drop down block.
|
||||
// the array needs to be key -> value format. key is for the option id and value is for the data output
|
||||
function html_options_block(name, data, selected = '', multiple = 0, options_only = false, return_string = false, sort = '')
|
||||
{
|
||||
var content = [];
|
||||
var element_select;
|
||||
var select_options = {};
|
||||
var element_option;
|
||||
var data_list = []; // for sorted output
|
||||
var value;
|
||||
var options;
|
||||
var option;
|
||||
if (multiple > 0) {
|
||||
select_options.multiple = '';
|
||||
if (multiple > 1) {
|
||||
select_options.size = multiple;
|
||||
}
|
||||
}
|
||||
// set outside select, gets stripped on return if options only is true
|
||||
element_select = cel('select', name);
|
||||
element_select = cel('select', name, '', [], select_options);
|
||||
// console.log('Call for %s, options: %s', name, options_only);
|
||||
if (sort == 'keys') {
|
||||
data_list = Object.keys(data).sort();
|
||||
@@ -585,14 +660,18 @@ function html_options(name, data, selected = '', options_only = false, return_st
|
||||
// for (const [key, value] of Object.entries(data)) {
|
||||
for (const key of data_list) {
|
||||
value = data[key];
|
||||
console.log('create [%s] options: key: %s, value: %s', name, key, value);
|
||||
// console.log('create [%s] options: key: %s, value: %s', name, key, value);
|
||||
// basic options init
|
||||
options = {
|
||||
'label': value,
|
||||
'value': key
|
||||
};
|
||||
// add selected if matching
|
||||
if (selected == key) {
|
||||
if (multiple == 0 && !Array.isArray(selected) && selected == key) {
|
||||
options.selected = '';
|
||||
}
|
||||
// for multiple, we match selected as array
|
||||
if (multiple == 1 && Array.isArray(selected) && selected.indexOf(key) != -1) {
|
||||
options.selected = '';
|
||||
}
|
||||
// create the element option
|
||||
|
||||
@@ -299,6 +299,38 @@ function getTimestamp()
|
||||
return date.getTime();
|
||||
}
|
||||
|
||||
// METHOD: dec2hex
|
||||
// PARAMS: decimal string
|
||||
// RETURN: string
|
||||
// DESC : dec2hex :: Integer -> String
|
||||
// i.e. 0-255 -> '00'-'ff'
|
||||
function dec2hex(dec)
|
||||
{
|
||||
return ('0' + dec.toString(16)).substr(-2);
|
||||
}
|
||||
|
||||
// METHOD: generateId
|
||||
// PARAMS: lenght in int
|
||||
// RETURN: random string
|
||||
// DESC : generateId :: Integer -> String
|
||||
// only works on mondern browsers
|
||||
function generateId(len)
|
||||
{
|
||||
var arr = new Uint8Array((len || 40) / 2);
|
||||
(window.crypto || window.msCrypto).getRandomValues(arr);
|
||||
return Array.from(arr, dec2hex).join('');
|
||||
}
|
||||
|
||||
// METHOD: randomIdF()
|
||||
// PARAMS: none
|
||||
// RETURN: not true random string
|
||||
// DESC : creates a pseudo random string of 10 characters
|
||||
// after many runs it will create duplicates
|
||||
function randomIdF()
|
||||
{
|
||||
return Math.random().toString(36).substring(2);
|
||||
}
|
||||
|
||||
// METHOD: isObject
|
||||
// PARAMS: possible object
|
||||
// RETURN: true/false if it is an object or not
|
||||
@@ -320,6 +352,22 @@ const keyInObject = (key, object) => (key in object) ? true : false;
|
||||
return (key in object) ? true : false;
|
||||
}*/
|
||||
|
||||
// METHOD: getKeyByValue
|
||||
// PARAMS: object, value
|
||||
// RETURN: key found
|
||||
// DESC : returns matching key of value
|
||||
const getKeyByValue = (obj, value) => Object.keys(obj).find(key => obj[key] === value);
|
||||
// function getKeyByValue(object, value)
|
||||
// {
|
||||
// return Object.keys(object).find(key => object[key] === value);
|
||||
// }
|
||||
|
||||
// METHOD: valueInObject
|
||||
// PARAMS: obj, value
|
||||
// RETURN: true/false
|
||||
// DESC : returns true if value is found in object with a key
|
||||
const valueInObject = (obj, value) => (Object.keys(obj).find(key => obj[key] === value)) ? true : false;
|
||||
|
||||
// METHOD: exists
|
||||
// PARAMS: uid
|
||||
// RETURN: true/false
|
||||
@@ -632,6 +680,8 @@ function phfo(tree)
|
||||
// *** DOM MANAGEMENT FUNCTIONS
|
||||
|
||||
// BLOCK: html wrappers for quickly creating html data blocks
|
||||
|
||||
// NOTE : OLD FORMAT which misses multiple block set
|
||||
// METHOD: html_options
|
||||
// PARAMS: name/id, array for the options, selected item uid
|
||||
// options_only [def false] if this is true, it will not print the select part
|
||||
@@ -641,15 +691,40 @@ function phfo(tree)
|
||||
// DESC : creates an select/options drop down block.
|
||||
// the array needs to be key -> value format. key is for the option id and value is for the data output
|
||||
function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '')
|
||||
{
|
||||
// wrapper to new call
|
||||
return html_options_block(name, data, selected, false, options_only, return_string, sort);
|
||||
}
|
||||
|
||||
// NOTE : USE THIS CALL, the above one is deprecated
|
||||
// METHOD: html_options
|
||||
// PARAMS: name/id, array for the options,
|
||||
// selected item uid [drop down string, multi select array]
|
||||
// multiple [def 0] if this is 1 or larger, the drop down will be turned into multiple select
|
||||
// the number sets the size value unless it is 1, then it is default
|
||||
// options_only [def false] if this is true, it will not print the select part
|
||||
// return_string [def false]: return as string and not as element
|
||||
// sort [def '']: if empty as is, else allowed 'keys', 'values' all others are ignored
|
||||
// RETURN: html with build options block
|
||||
// DESC : creates an select/options drop down block.
|
||||
// the array needs to be key -> value format. key is for the option id and value is for the data output
|
||||
function html_options_block(name, data, selected = '', multiple = 0, options_only = false, return_string = false, sort = '')
|
||||
{
|
||||
var content = [];
|
||||
var element_select;
|
||||
var select_options = {};
|
||||
var element_option;
|
||||
var data_list = []; // for sorted output
|
||||
var value;
|
||||
var options;
|
||||
var option;
|
||||
if (multiple > 0) {
|
||||
select_options.multiple = '';
|
||||
if (multiple > 1) {
|
||||
select_options.size = multiple;
|
||||
}
|
||||
}
|
||||
// set outside select, gets stripped on return if options only is true
|
||||
element_select = cel('select', name);
|
||||
element_select = cel('select', name, '', [], select_options);
|
||||
// console.log('Call for %s, options: %s', name, options_only);
|
||||
if (sort == 'keys') {
|
||||
data_list = Object.keys(data).sort();
|
||||
@@ -663,14 +738,18 @@ function html_options(name, data, selected = '', options_only = false, return_st
|
||||
// for (const [key, value] of Object.entries(data)) {
|
||||
for (const key of data_list) {
|
||||
value = data[key];
|
||||
console.log('create [%s] options: key: %s, value: %s', name, key, value);
|
||||
// console.log('create [%s] options: key: %s, value: %s', name, key, value);
|
||||
// basic options init
|
||||
options = {
|
||||
'label': value,
|
||||
'value': key
|
||||
};
|
||||
// add selected if matching
|
||||
if (selected == key) {
|
||||
if (multiple == 0 && !Array.isArray(selected) && selected == key) {
|
||||
options.selected = '';
|
||||
}
|
||||
// for multiple, we match selected as array
|
||||
if (multiple == 1 && Array.isArray(selected) && selected.indexOf(key) != -1) {
|
||||
options.selected = '';
|
||||
}
|
||||
// create the element option
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.4.0
|
||||
* jQuery JavaScript Library v3.4.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
@@ -9,7 +9,7 @@
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2019-04-10T19:48Z
|
||||
* Date: 2019-05-01T21:04Z
|
||||
*/
|
||||
( function( global, factory ) {
|
||||
|
||||
@@ -142,7 +142,7 @@ function toType( obj ) {
|
||||
|
||||
|
||||
var
|
||||
version = "3.4.0",
|
||||
version = "3.4.1",
|
||||
|
||||
// Define a local copy of jQuery
|
||||
jQuery = function( selector, context ) {
|
||||
@@ -4498,8 +4498,12 @@ var documentElement = document.documentElement;
|
||||
},
|
||||
composed = { composed: true };
|
||||
|
||||
// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
|
||||
// Check attachment across shadow DOM boundaries when possible (gh-3504)
|
||||
if ( documentElement.attachShadow ) {
|
||||
// Support: iOS 10.0-10.2 only
|
||||
// Early iOS 10 versions support `attachShadow` but not `getRootNode`,
|
||||
// leading to errors. We need to check for `getRootNode`.
|
||||
if ( documentElement.getRootNode ) {
|
||||
isAttached = function( elem ) {
|
||||
return jQuery.contains( elem.ownerDocument, elem ) ||
|
||||
elem.getRootNode( composed ) === elem.ownerDocument;
|
||||
@@ -5359,8 +5363,7 @@ jQuery.event = {
|
||||
|
||||
// Claim the first handler
|
||||
if ( rcheckableType.test( el.type ) &&
|
||||
el.click && nodeName( el, "input" ) &&
|
||||
dataPriv.get( el, "click" ) === undefined ) {
|
||||
el.click && nodeName( el, "input" ) ) {
|
||||
|
||||
// dataPriv.set( el, "click", ... )
|
||||
leverageNative( el, "click", returnTrue );
|
||||
@@ -5377,8 +5380,7 @@ jQuery.event = {
|
||||
|
||||
// Force setup before triggering a click
|
||||
if ( rcheckableType.test( el.type ) &&
|
||||
el.click && nodeName( el, "input" ) &&
|
||||
dataPriv.get( el, "click" ) === undefined ) {
|
||||
el.click && nodeName( el, "input" ) ) {
|
||||
|
||||
leverageNative( el, "click" );
|
||||
}
|
||||
@@ -5419,7 +5421,9 @@ function leverageNative( el, type, expectSync ) {
|
||||
|
||||
// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
|
||||
if ( !expectSync ) {
|
||||
jQuery.event.add( el, type, returnTrue );
|
||||
if ( dataPriv.get( el, type ) === undefined ) {
|
||||
jQuery.event.add( el, type, returnTrue );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5434,9 +5438,13 @@ function leverageNative( el, type, expectSync ) {
|
||||
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
|
||||
|
||||
// Interrupt processing of the outer synthetic .trigger()ed event
|
||||
if ( !saved ) {
|
||||
// Saved data should be false in such cases, but might be a leftover capture object
|
||||
// from an async native handler (gh-4350)
|
||||
if ( !saved.length ) {
|
||||
|
||||
// Store arguments for use when handling the inner native event
|
||||
// There will always be at least one argument (an event object), so this array
|
||||
// will not be confused with a leftover capture object.
|
||||
saved = slice.call( arguments );
|
||||
dataPriv.set( this, type, saved );
|
||||
|
||||
@@ -5449,14 +5457,14 @@ function leverageNative( el, type, expectSync ) {
|
||||
if ( saved !== result || notAsync ) {
|
||||
dataPriv.set( this, type, false );
|
||||
} else {
|
||||
result = undefined;
|
||||
result = {};
|
||||
}
|
||||
if ( saved !== result ) {
|
||||
|
||||
// Cancel the outer synthetic event
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
return result;
|
||||
return result.value;
|
||||
}
|
||||
|
||||
// If this is an inner synthetic event for an event with a bubbling surrogate
|
||||
@@ -5471,17 +5479,19 @@ function leverageNative( el, type, expectSync ) {
|
||||
|
||||
// If this is a native event triggered above, everything is now in order
|
||||
// Fire an inner synthetic event with the original arguments
|
||||
} else if ( saved ) {
|
||||
} else if ( saved.length ) {
|
||||
|
||||
// ...and capture the result
|
||||
dataPriv.set( this, type, jQuery.event.trigger(
|
||||
dataPriv.set( this, type, {
|
||||
value: jQuery.event.trigger(
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Extend with the prototype to reset the above stopImmediatePropagation()
|
||||
jQuery.extend( saved.shift(), jQuery.Event.prototype ),
|
||||
saved,
|
||||
this
|
||||
) );
|
||||
// Support: IE <=9 - 11+
|
||||
// Extend with the prototype to reset the above stopImmediatePropagation()
|
||||
jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
|
||||
saved.slice( 1 ),
|
||||
this
|
||||
)
|
||||
} );
|
||||
|
||||
// Abort handling of the native event
|
||||
event.stopImmediatePropagation();
|
||||
2
www/layout/admin/javascript/jquery-3.4.1.min.js
vendored
Normal file
2
www/layout/admin/javascript/jquery-3.4.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
www/layout/admin/javascript/jquery.js
vendored
2
www/layout/admin/javascript/jquery.js
vendored
@@ -1 +1 @@
|
||||
jquery-3.4.0.js
|
||||
jquery-3.4.1.js
|
||||
2
www/layout/admin/javascript/jquery.min.js
vendored
2
www/layout/admin/javascript/jquery.min.js
vendored
@@ -1 +1 @@
|
||||
jquery-3.4.0.min.js
|
||||
jquery-3.4.1.min.js
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2000/06/01
|
||||
@@ -67,7 +67,7 @@ class Login extends \CoreLibs\DB\IO
|
||||
private $username; // login name
|
||||
private $password; // login password
|
||||
private $logout; // logout button
|
||||
private $login_error; // login error code, can be matched to the array login_error_msg, which holds the string
|
||||
private $login_error = 0; // login error code, can be matched to the array login_error_msg, which holds the string
|
||||
private $password_change = false; // if this is set to true, the user can change passwords
|
||||
private $password_change_ok = false; // password change was successful
|
||||
private $password_forgot = false; // can we reset password and mail to user with new password set screen
|
||||
@@ -426,18 +426,22 @@ class Login extends \CoreLibs\DB\IO
|
||||
$pages = array();
|
||||
$edit_page_ids = array();
|
||||
// set pages access
|
||||
$q = "SELECT ep.edit_page_id, filename, ep.name AS edit_page_name, ep.order_number AS edit_page_order, menu, ";
|
||||
$q .= "popup, popup_x, popup_y, online, ear.level, ear.type ";
|
||||
$q .= "FROM edit_page ep, edit_page_access epa, edit_access_right ear ";
|
||||
$q = "SELECT ep.edit_page_id, ep.cuid, epca.cuid AS content_alias_uid, ep.filename, ep.name AS edit_page_name, ep.order_number AS edit_page_order, ep.menu, ";
|
||||
$q .= "ep.popup, ep.popup_x, ep.popup_y, ep.online, ear.level, ear.type ";
|
||||
$q .= "FROM edit_page ep ";
|
||||
$q .= "LEFT JOIN edit_page epca ON (epca.edit_page_id = ep.content_alias_edit_page_id)";
|
||||
$q .= ", edit_page_access epa, edit_access_right ear ";
|
||||
$q .= "WHERE ep.edit_page_id = epa.edit_page_id AND ear.edit_access_right_id = epa.edit_access_right_id ";
|
||||
$q .= "AND epa.enabled = 1 AND epa.edit_group_id = ".$res["edit_group_id"]." ";
|
||||
$q .= "ORDER BY ep.order_number";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
// page id array for sub data readout
|
||||
$edit_page_ids[] = $res['edit_page_id'];
|
||||
$edit_page_ids[$res['edit_page_id']] = $res['cuid'];
|
||||
// create the array for pages
|
||||
array_push($pages, array (
|
||||
$pages[$res['cuid']] = array (
|
||||
'edit_page_id' => $res['edit_page_id'],
|
||||
'cuid' => $res['cuid'],
|
||||
'content_alias_uid' => $res['content_alias_uid'], // for reference of content data on a differen page
|
||||
'filename' => $res['filename'],
|
||||
'page_name' => $res['edit_page_name'],
|
||||
'order' => $res['edit_page_order'],
|
||||
@@ -450,7 +454,7 @@ class Login extends \CoreLibs\DB\IO
|
||||
'acl_type' => $res['type'],
|
||||
'query' => array (),
|
||||
'visible' => array ()
|
||||
));
|
||||
);
|
||||
// make reference filename -> level
|
||||
$pages_acl[$res['filename']] = $res['level'];
|
||||
} // for each page
|
||||
@@ -458,33 +462,42 @@ class Login extends \CoreLibs\DB\IO
|
||||
$_edit_page_id = 0;
|
||||
$q = "SELECT epvg.edit_page_id, name, flag ";
|
||||
$q .= "FROM edit_visible_group evp, edit_page_visible_group epvg ";
|
||||
$q .= "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id AND epvg.edit_page_id IN (".join(', ', $edit_page_ids).") ";
|
||||
$q .= "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id AND epvg.edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
|
||||
$q .= "ORDER BY epvg.edit_page_id";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
if ($res['edit_page_id'] != $_edit_page_id) {
|
||||
// search the pos in the array push
|
||||
$pos = $this->arraySearchRecursive($res['edit_page_id'], $pages, 'edit_page_id');
|
||||
$_edit_page_id = $res['edit_page_id'];
|
||||
}
|
||||
$pages[$pos[0]]['visible'][$res['name']] = $res['flag'];
|
||||
$pages[$edit_page_ids[$res['edit_page_id']]]['visible'][$res['name']] = $res['flag'];
|
||||
}
|
||||
// get the same for the query strings
|
||||
$_edit_page_id = 0;
|
||||
$q = "SELECT eqs.edit_page_id, name, value, dynamic FROM edit_query_string eqs ";
|
||||
$q .= "WHERE enabled = 1 AND edit_page_id IN (".join(', ', $edit_page_ids).") ORDER BY eqs.edit_page_id";
|
||||
$q .= "WHERE enabled = 1 AND edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
|
||||
$q .= "ORDER BY eqs.edit_page_id";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
if ($res['edit_page_id'] != $_edit_page_id) {
|
||||
// search the pos in the array push
|
||||
$pos = $this->arraySearchRecursive($res['edit_page_id'], $pages, 'edit_page_id');
|
||||
$_edit_page_id = $res['edit_page_id'];
|
||||
}
|
||||
$pages[$pos[0]]['query'][] = array (
|
||||
$pages[$edit_page_ids[$res['edit_page_id']]]['query'][] = array (
|
||||
'name' => $res['name'],
|
||||
'value' => $res['value'],
|
||||
'dynamic' => $res['dynamic']
|
||||
);
|
||||
}
|
||||
|
||||
// get the page content and add them to the page
|
||||
$_edit_page_id = 0;
|
||||
$q = "SELECT epc.edit_page_id, epc.name, epc.uid, epc.order_number, epc.online, ear.level, ear.type ";
|
||||
$q .= "FROM edit_page_content epc, edit_access_right ear ";
|
||||
$q .= "WHERE epc.edit_access_right_id = ear.edit_access_right_id AND ";
|
||||
$q .= "epc.edit_page_id IN (".join(', ', array_keys($edit_page_ids)).") ";
|
||||
$q .= "ORDER BY epc.order_number";
|
||||
while ($res = $this->dbReturn($q)) {
|
||||
$pages[$edit_page_ids[$res['edit_page_id']]]['content'][$res['uid']] = array (
|
||||
'name' => $res['name'],
|
||||
'uid' => $res['uid'],
|
||||
'online' => $res['online'],
|
||||
'order' => $res['order_number'],
|
||||
// access name and level
|
||||
'acl_type' => $res['type'],
|
||||
'acl_level' => $res['level']
|
||||
);
|
||||
}
|
||||
// write back the pages data to the output array
|
||||
$_SESSION['PAGES'] = $pages;
|
||||
$_SESSION['PAGES_ACL_LEVEL'] = $pages_acl;
|
||||
// load the edit_access user rights
|
||||
@@ -593,7 +606,8 @@ class Login extends \CoreLibs\DB\IO
|
||||
if ($this->logout || $this->login_error) {
|
||||
// unregister and destroy session vars
|
||||
unset($_SESSION['EUID']);
|
||||
unset($_SESSION['GROUP_LEVEL']);
|
||||
unset($_SESSION['GROUP_ACL_LEVEL']);
|
||||
unset($_SESSION['USER_ACL_LEVEL']);
|
||||
unset($_SESSION['PAGES']);
|
||||
unset($_SESSION['USER_NAME']);
|
||||
unset($_SESSION['UNIT']);
|
||||
@@ -658,6 +672,7 @@ class Login extends \CoreLibs\DB\IO
|
||||
$this->acl['base'] = $_SESSION['USER_ACL_LEVEL'];
|
||||
}
|
||||
}
|
||||
$_SESSION['BASE_ACL_LEVEL'] = $this->acl['base'];
|
||||
|
||||
// set the current page acl
|
||||
// start with default acl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2006/08/15
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2003/03/24
|
||||
@@ -169,7 +169,7 @@ class Basic
|
||||
public function __construct($debug_all = 0, $echo_all = 1, $print_all = 0)
|
||||
{
|
||||
// set per run UID for logging
|
||||
$this->running_uid = hash($this->hash_algo, uniqid(rand(), true));
|
||||
$this->running_uid = hash($this->hash_algo, uniqid((string)rand(), true));
|
||||
|
||||
// internal info var
|
||||
$this->class_info["basic"] = array (
|
||||
@@ -369,8 +369,6 @@ class Basic
|
||||
$this->session_id = session_id();
|
||||
}
|
||||
|
||||
// [!!! DEPRECATED !!!] init crypt settings
|
||||
$this->cryptInit();
|
||||
// new better password init
|
||||
$this->passwordInit();
|
||||
|
||||
@@ -442,7 +440,7 @@ class Basic
|
||||
// on second call it sends the end time and then also prints the running time
|
||||
public function runningTime($simple = false)
|
||||
{
|
||||
list($micro, $timestamp) = explode(" ", microtime());
|
||||
list($micro, $timestamp) = explode(' ', microtime());
|
||||
$string = '';
|
||||
$running_time = '';
|
||||
if (!$this->starttime) {
|
||||
@@ -452,7 +450,7 @@ class Basic
|
||||
$this->endtime = ((float)$micro + (float)$timestamp);
|
||||
$string .= $simple ? 'End: ' : "<b>Stopped at</b>: ";
|
||||
}
|
||||
$string .= date("Y-m-d H:i:s", $timestamp);
|
||||
$string .= date("Y-m-d H:i:s", (int)$timestamp);
|
||||
$string .= " ".$micro;
|
||||
if ($this->starttime && $this->endtime) {
|
||||
$running_time = $this->endtime - $this->starttime;
|
||||
@@ -480,7 +478,7 @@ class Basic
|
||||
public static function printTime($set_microtime = -1)
|
||||
{
|
||||
list($microtime, $timestamp) = explode(' ', microtime());
|
||||
$string = date("Y-m-d H:i:s", $timestamp);
|
||||
$string = date("Y-m-d H:i:s", (int)$timestamp);
|
||||
// if microtime flag is -1 no round, if 0, no microtime, if >= 1, round that size
|
||||
if ($set_microtime == -1) {
|
||||
$string .= substr($microtime, 1);
|
||||
@@ -494,8 +492,8 @@ class Basic
|
||||
|
||||
// METHOD: fdebug
|
||||
// PARAMS: $string: data to write to file
|
||||
// $enter: default on true, if set to false, no linebreak (\n) will be put at the end
|
||||
// RETURN: none
|
||||
// $enter: default on true, if set to false, no linebreak (\n) will be put at the end
|
||||
// RETURN: none
|
||||
// DESC : writes a string to a file immediatly, for fast debug output
|
||||
public function fdebug($string, $enter = 1)
|
||||
{
|
||||
@@ -695,7 +693,7 @@ class Basic
|
||||
$this->log_file_unique_id = $GLOBALS['LOG_FILE_UNIQUE_ID'];
|
||||
}
|
||||
if (!$this->log_file_unique_id) {
|
||||
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid(mt_rand(), true)), 0, 8);
|
||||
$GLOBALS['LOG_FILE_UNIQUE_ID'] = $this->log_file_unique_id = date('Y-m-d_His').'_U_'.substr(hash('sha1', uniqid((string)mt_rand(), true)), 0, 8);
|
||||
}
|
||||
$rpl_string = '_'.$this->log_file_unique_id; // add 8 char unique string
|
||||
} else {
|
||||
@@ -792,9 +790,9 @@ class Basic
|
||||
// PARAMS: $array
|
||||
// RETURN: string html formatted
|
||||
// DESC : prints a html formatted (pre) array
|
||||
public static function printAr($array)
|
||||
public static function printAr(array $array)
|
||||
{
|
||||
return "<pre>".print_r($array, 1)."</pre>";
|
||||
return "<pre>".print_r($array, true)."</pre>";
|
||||
}
|
||||
|
||||
// METHOD: checked
|
||||
@@ -951,6 +949,8 @@ class Basic
|
||||
$host_name = 'NA';
|
||||
}
|
||||
$this->host_port = $port ? $port : 80;
|
||||
$this->host_name = $host_name;
|
||||
// also return for old type call
|
||||
return $host_name;
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ class Basic
|
||||
// RETURN: array with the elements where the needle can be found in the haystack array
|
||||
// DESC : searches key = value in an array / array
|
||||
// only returns the first one found
|
||||
public static function arraySearchRecursive($needle, $haystack, $key_lookin = "")
|
||||
public static function arraySearchRecursive($needle, $haystack, $key_lookin = '')
|
||||
{
|
||||
$path = null;
|
||||
if (!is_array($haystack)) {
|
||||
@@ -1088,6 +1088,84 @@ class Basic
|
||||
return false;
|
||||
}
|
||||
|
||||
// METHOD: arrayMergeRecursive
|
||||
// PARAMS: array, array, ..., true/false flag how to handle key
|
||||
// key flag: true: handle keys as string or int, default false: all keys are string
|
||||
// RETURN: merged array
|
||||
// DESC : correctly recursive merges as an array as array_merge_recursive just glues things together
|
||||
public static function arrayMergeRecursive()
|
||||
{
|
||||
// croak on not enough arguemnts (we need at least two)
|
||||
if (func_num_args() < 2) {
|
||||
trigger_error(__FUNCTION__ .' needs two or more array arguments', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
// default key is not string
|
||||
$key_is_string = false;
|
||||
$arrays = func_get_args();
|
||||
// if last is not array, then assume it is trigger for key is always string
|
||||
if (!is_array(end($arrays))) {
|
||||
if (array_pop($arrays)) {
|
||||
$key_is_string = true;
|
||||
}
|
||||
}
|
||||
// check that arrays count is at least two, else we don't have enough to do anything
|
||||
if (count($arrays) < 2) {
|
||||
trigger_error(__FUNCTION__.' needs two or more array arguments', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
$merged = array();
|
||||
while ($arrays) {
|
||||
$array = array_shift($arrays);
|
||||
if (!is_array($array)) {
|
||||
trigger_error(__FUNCTION__ .' encountered a non array argument', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
if (!$array) {
|
||||
continue;
|
||||
}
|
||||
foreach ($array as $key => $value) {
|
||||
// if string or if key is assumed to be string do key match else add new entry
|
||||
if (is_string($key) || $key_is_string === false) {
|
||||
if (is_array($value) && array_key_exists($key, $merged) && is_array($merged[$key])) {
|
||||
// $merged[$key] = call_user_func(__METHOD__, $merged[$key], $value, $key_is_string);
|
||||
$merged[$key] = Basic::arrayMergeRecursive($merged[$key], $value, $key_is_string);
|
||||
} else {
|
||||
$merged[$key] = $value;
|
||||
}
|
||||
} else {
|
||||
$merged[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $merged;
|
||||
}
|
||||
|
||||
// METHOD: arrayFlatForKey
|
||||
// PARAMS: array (nested)
|
||||
// search, key to find that has no sub leaf and will be pushed up
|
||||
// RETURN: modified array
|
||||
// DESC : searches for key -> value in an array tree and writes the value one level up
|
||||
// this will remove this leaf will all other values
|
||||
public static function arrayFlatForKey($array, $search)
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
// if it is not an array do just nothing
|
||||
if (is_array($value)) {
|
||||
// probe it has search key
|
||||
if (isset($value[$search])) {
|
||||
// set as current
|
||||
$array[$key] = $value[$search];
|
||||
} else {
|
||||
// call up next node down
|
||||
// $array[$key] = call_user_func(__METHOD__, $value, $search);
|
||||
$array[$key] = Basic::arrayFlatForKey($value, $search);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
// METHOD: inArrayAny
|
||||
// WAS : in_array_any
|
||||
// PARAMS: needle: array
|
||||
@@ -1282,9 +1360,9 @@ class Basic
|
||||
public static function timeStringFormat($timestamp, $show_micro = true)
|
||||
{
|
||||
// check if the timestamp has any h/m/s/ms inside, if yes skip
|
||||
if (!preg_match("/(h|m|s|ms)/", $timestamp)) {
|
||||
if (!preg_match("/(h|m|s|ms)/", (string)$timestamp)) {
|
||||
$ms = 0;
|
||||
list ($timestamp, $ms) = explode('.', round($timestamp, 4));
|
||||
list ($timestamp, $ms) = explode('.', (string)round($timestamp, 4));
|
||||
$timegroups = array (86400, 3600, 60, 1);
|
||||
$labels = array ('d', 'h', 'm', 's');
|
||||
$time_string = '';
|
||||
@@ -1322,6 +1400,7 @@ class Basic
|
||||
if (preg_match("/(d|h|m|s|ms)/", $timestring)) {
|
||||
// pos for preg match read + multiply factor
|
||||
$timegroups = array (2 => 86400, 4 => 3600, 6 => 60, 8 => 1);
|
||||
$matches = array ();
|
||||
// preg match: 0: full strsing
|
||||
// 2, 4, 6, 8 are the to need values
|
||||
preg_match("/^((\d+)d ?)?((\d+)h ?)?((\d+)m ?)?((\d+)s ?)?((\d+)ms)?$/", $timestring, $matches);
|
||||
@@ -1459,6 +1538,8 @@ class Basic
|
||||
$days = array ();
|
||||
$start = new \DateTime($start_date);
|
||||
$end = new \DateTime($end_date);
|
||||
// so we include the last day too, we need to add +1 second in the time
|
||||
$end->setTime(0, 0, 1);
|
||||
|
||||
$days[0] = $end->diff($start)->days;
|
||||
|
||||
@@ -1503,14 +1584,14 @@ class Basic
|
||||
3 => 'png'
|
||||
);
|
||||
|
||||
if ($cache_source) {
|
||||
if (!empty($cache_source)) {
|
||||
$tmp_src = $cache_source;
|
||||
} else {
|
||||
$tmp_src = BASE.TMP;
|
||||
}
|
||||
// check if pic has a path, and override next sets
|
||||
if (strstr($pic, '/') === false) {
|
||||
if (!$path) {
|
||||
if (empty($path)) {
|
||||
$path = BASE;
|
||||
}
|
||||
$filename = $path.MEDIA.PICTURES.$pic;
|
||||
@@ -1766,6 +1847,7 @@ class Basic
|
||||
// there is no auto init for this at the moment
|
||||
private function cryptInit()
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// SET CRYPT SALT PREFIX:
|
||||
// the prefix string is defined by what the server can do
|
||||
// first we check if we can do blowfish, if not we try md5 and then des
|
||||
@@ -1811,6 +1893,7 @@ class Basic
|
||||
// DESC : creates a random string from alphanumeric characters: A-Z a-z 0-9 ./
|
||||
private function cryptSaltString($nSize = 22)
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// A-Z is 65,90
|
||||
// a-z is 97,122
|
||||
// 0-9 is 48,57
|
||||
@@ -1840,6 +1923,7 @@ class Basic
|
||||
// DESC : encrypts the string with blowfish and returns the full string + salt part that needs to be stored somewhere (eg DB)
|
||||
public function cryptString($string)
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// the crypt prefix is set in the init of the class
|
||||
// uses the random string method to create the salt
|
||||
return crypt($string, $this->cryptSaltPrefix.$this->cryptSaltString($this->cryptSaltSize).$this->cryptSaltSuffix);
|
||||
@@ -1853,6 +1937,7 @@ class Basic
|
||||
// DESC : compares the string with the crypted one, is counter method to cryptString
|
||||
public function verifyCryptString($string, $crypt)
|
||||
{
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
// the full crypted string needs to be passed on to the salt, so the init (for blowfish) and salt are passed on
|
||||
if (crypt($string, $crypt) == $crypt) {
|
||||
return true;
|
||||
@@ -2376,6 +2461,7 @@ class Basic
|
||||
public function checkConvert($string, $from_encoding, $to_encoding)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->checkConvertEncoding($string, $from_encoding, $to_encoding);
|
||||
}
|
||||
|
||||
@@ -2388,144 +2474,168 @@ class Basic
|
||||
public function running_time($simple = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->runningTime($simple);
|
||||
}
|
||||
|
||||
public static function print_time($set_microtime = -1)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::printTime($set_microtime);
|
||||
}
|
||||
|
||||
private function fdebug_fp($flag = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->fdebugFP($flag);
|
||||
}
|
||||
|
||||
public function debug_for($type, $flag)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->debugFor($type, $flag);
|
||||
}
|
||||
|
||||
public function get_caller_method($level = 2)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->getCallerMethod($level);
|
||||
}
|
||||
|
||||
public function merge_errors($error_msg = array ())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->mergeErrors($error_msg);
|
||||
}
|
||||
|
||||
public function print_error_msg($string = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->printErrorMsg($string);
|
||||
}
|
||||
|
||||
private function write_error_msg($level, $error_string)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->writeErrorMsg($level, $error_string);
|
||||
}
|
||||
|
||||
public function reset_error_msg($level = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->resetErrorMsg($level);
|
||||
}
|
||||
|
||||
public static function print_ar($array)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::printAr($array);
|
||||
}
|
||||
|
||||
public function magic_links($string, $target = "_blank")
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->magicLinks($string, $target);
|
||||
}
|
||||
|
||||
private function create_url($href, $atag, $_1, $_2, $_3, $name, $class)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->createUrl($href, $atag, $_1, $_2, $_3, $name, $class);
|
||||
}
|
||||
|
||||
private function create_email($mailto, $atag, $_1, $_2, $_3, $title, $class)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->createEmail($mailto, $atag, $_1, $_2, $_3, $title, $class);
|
||||
}
|
||||
|
||||
public function get_host_name()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->getHostName();
|
||||
}
|
||||
|
||||
public static function get_page_name($strip_ext = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::getPageName($strip_ext);
|
||||
}
|
||||
|
||||
public static function get_filename_ending($filename)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::getFilenameEnding($filename);
|
||||
}
|
||||
|
||||
public static function array_search_recursive($needle, $haystack, $key_lookin = "")
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::arraySearchRecursive($needle, $haystack, $key_lookin);
|
||||
}
|
||||
|
||||
public static function array_search_recursive_all($needle, $haystack, $key, $path = null)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::arraySearchRecursiveAll($needle, $haystack, $key, $path);
|
||||
}
|
||||
|
||||
public static function array_search_simple($array, $key, $value)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::arraySearchSimple($array, $key, $value);
|
||||
}
|
||||
|
||||
public static function _mb_mime_encode($string, $encoding)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::__mbMimeEncode($string, $encoding);
|
||||
}
|
||||
|
||||
public function _crc32b($string)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__crc32b($string);
|
||||
}
|
||||
|
||||
public function _sha1_short($string, $use_sha = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__sha1Short($string, $use_sha);
|
||||
}
|
||||
|
||||
public function _hash($string, $hash_type = 'adler32')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__hash($string, $hash_type);
|
||||
}
|
||||
|
||||
public static function in_array_any($needle, $haystack)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return Basic::inArrayAny($needle, $haystack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2002/12/17
|
||||
@@ -69,7 +69,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
// set primary key for given table_array
|
||||
if (is_array($this->table_array)) {
|
||||
foreach ($this->table_array as $key => $value) {
|
||||
if ($value['pk']) {
|
||||
if (isset($value['pk'])) {
|
||||
$this->pk_name = $key;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q_where = '';
|
||||
foreach ($this->table_array as $column => $data_array) {
|
||||
// suchen nach bildern und lschen ...
|
||||
if ($this->table_array[$column]['file'] && file_exists($this->table_array[$column]['url'].$this->table_array[$column]['value'])) {
|
||||
if (!empty($this->table_array[$column]['file']) &&
|
||||
file_exists($this->table_array[$column]['url'].$this->table_array[$column]['value'])
|
||||
) {
|
||||
if (file_exists($this->table_array[$column]['path'].$this->table_array[$column]['value'])) {
|
||||
unlink($this->table_array[$column]['path'].$this->table_array[$column]['value']);
|
||||
}
|
||||
@@ -214,7 +216,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
}
|
||||
}
|
||||
// if we have a foreign key
|
||||
if ($this->table_array[$column]['fk']) {
|
||||
if (!empty($this->table_array[$column]['fk'])) {
|
||||
// create FK constraint checks
|
||||
if ($q_where) {
|
||||
$q_where .= ' AND ';
|
||||
@@ -263,7 +265,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q_select .= $column;
|
||||
|
||||
// check FK ...
|
||||
if ($this->table_array[$column]['fk'] && $this->table_array[$column]['value']) {
|
||||
if (isset($this->table_array[$column]['fk']) && isset($this->table_array[$column]['value'])) {
|
||||
if ($q_where) {
|
||||
$q_where .= ' AND ';
|
||||
}
|
||||
@@ -290,7 +292,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
if ($edit) {
|
||||
$this->table_array[$column]['value'] = $res[$column];
|
||||
// if password, also write to hidden
|
||||
if ($this->table_array[$column]['type'] == 'password') {
|
||||
if (isset($this->table_array[$column]['type']) &&
|
||||
$this->table_array[$column]['type'] == 'password'
|
||||
) {
|
||||
$this->table_array[$column]['HIDDEN_value'] = $res[$column];
|
||||
}
|
||||
} else {
|
||||
@@ -334,9 +338,9 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q_vars = '';
|
||||
$q_where = '';
|
||||
foreach ($this->table_array as $column => $data_array) {
|
||||
/********************************* START FILE *************************************/
|
||||
/********************************* START FILE *************************************/
|
||||
// file upload
|
||||
if ($this->table_array[$column]['file']) {
|
||||
if (isset($this->table_array[$column]['file'])) {
|
||||
// falls was im tmp drinnen, sprich ein upload, datei kopieren, Dateinamen in db schreiben
|
||||
// falls datei schon am server (physischer pfad), dann einfach url in db schreiben (update)
|
||||
// falls in 'delete' 'ja' dann loeschen (und gibts eh nur beim update)
|
||||
@@ -381,12 +385,19 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
}
|
||||
} // delete or upload
|
||||
} // file IF
|
||||
/********************************* END FILE **************************************/
|
||||
/********************************* END FILE **************************************/
|
||||
|
||||
// do not write 'pk' (primary key) or 'view' values
|
||||
if (!$this->table_array[$column]['pk'] && $this->table_array[$column]['type'] != 'view' && strlen($column) > 0) {
|
||||
if (!isset($this->table_array[$column]['pk']) &&
|
||||
isset($this->table_array[$column]['type']) &&
|
||||
$this->table_array[$column]['type'] != 'view' &&
|
||||
strlen($column) > 0
|
||||
) {
|
||||
// for password use hidden value if main is not set
|
||||
if ($this->table_array[$column]['type'] == 'password' && !$this->table_array[$column]['value']) {
|
||||
if (isset($this->table_array[$column]['type']) &&
|
||||
$this->table_array[$column]['type'] == 'password' &&
|
||||
empty($this->table_array[$column]['value'])
|
||||
) {
|
||||
$this->table_array[$column]['value'] = $this->table_array[$column]['HIDDEN_value'];
|
||||
}
|
||||
if (!$insert) {
|
||||
@@ -399,41 +410,59 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
if (strlen($q_data)) {
|
||||
$q_data .= ', ';
|
||||
}
|
||||
if ($q_vars) {
|
||||
if (strlen($q_vars)) {
|
||||
$q_vars .= ', ';
|
||||
}
|
||||
$q_vars .= $column;
|
||||
}
|
||||
// integer is different
|
||||
if ($this->table_array[$column]['int'] || $this->table_array[$column]['int_null']) {
|
||||
$this->debug('write_check', '[$column]['.$this->table_array[$column]['value'].'] Foo: '.isset($this->table_array[$column]['value']).' | '.$this->table_array[$column]['int_null']);
|
||||
if (!$this->table_array[$column]['value'] && $this->table_array[$column]['int_null']) {
|
||||
if (isset($this->table_array[$column]['int']) || isset($this->table_array[$column]['int_null'])) {
|
||||
$this->debug('write_check', '['.$column.']['.$this->table_array[$column]['value'].']['.$this->table_array[$column]['type'].'] VALUE SET: '.isset($this->table_array[$column]['value']).' | INT NULL: '.isset($this->table_array[$column]['int_null']));
|
||||
if (isset($this->table_array[$column]['value']) &&
|
||||
!$this->table_array[$column]['value'] &&
|
||||
isset($this->table_array[$column]['int_null'])
|
||||
) {
|
||||
$_value = 'NULL';
|
||||
} elseif (!isset($this->table_array[$column]['value'])) {
|
||||
} elseif (!isset($this->table_array[$column]['value']) ||
|
||||
(isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value'])
|
||||
) {
|
||||
$_value = 0;
|
||||
} else {
|
||||
$_value = $this->table_array[$column]['value'];
|
||||
}
|
||||
$q_data .= $_value;
|
||||
} elseif ($this->table_array[$column]['bool']) {
|
||||
} elseif (isset($this->table_array[$column]['bool'])) {
|
||||
// boolean storeage (reverse check on ifset)
|
||||
$q_data .= "'".$this->dbBoolean($this->table_array[$column]['value'], true)."'";
|
||||
} elseif ($this->table_array[$column]["interval"]) {
|
||||
} elseif (isset($this->table_array[$column]['interval'])) {
|
||||
// for interval we check if no value, then we set null
|
||||
if (!$this->table_array[$column]['value']) {
|
||||
if (!isset($this->table_array[$column]['value']) ||
|
||||
(isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value'])
|
||||
) {
|
||||
$_value = 'NULL';
|
||||
} elseif (isset($this->table_array[$column]['value'])) {
|
||||
$_value = $this->table_array[$column]['value'];
|
||||
}
|
||||
$q_data .= $_value;
|
||||
} else {
|
||||
// normal string
|
||||
$q_data .= "'";
|
||||
// if add slashes do convert & add slashes else write AS is
|
||||
if ($addslashes) {
|
||||
$q_data .= $this->dbEscapeString($this->convertEntities($this->table_array[$column]['value']));
|
||||
// if the error check is json, we set field to null if NOT set
|
||||
// else normal string write
|
||||
if (isset($this->table_array[$column]['error_check']) &&
|
||||
$this->table_array[$column]['error_check'] == 'json' &&
|
||||
(!isset($this->table_array[$column]['value']) || (isset($this->table_array[$column]['value']) && !$this->table_array[$column]['value']))
|
||||
) {
|
||||
$q_data .= 'NULL';
|
||||
} else {
|
||||
$q_data .= $this->dbEscapeString($this->table_array[$column]['value']);
|
||||
// normal string
|
||||
$q_data .= "'";
|
||||
// if add slashes do convert & add slashes else write AS is
|
||||
if ($addslashes) {
|
||||
$q_data .= $this->dbEscapeString($this->convertEntities($this->table_array[$column]['value']));
|
||||
} else {
|
||||
$q_data .= $this->dbEscapeString($this->table_array[$column]['value']);
|
||||
}
|
||||
$q_data .= "'";
|
||||
}
|
||||
$q_data .= "'";
|
||||
}
|
||||
}
|
||||
} // while ...
|
||||
@@ -444,8 +473,8 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
// create select part & addition FK part
|
||||
foreach ($this->table_array as $column => $data_array) {
|
||||
// check FK ...
|
||||
if ($this->table_array[$column]['fk'] && $this->table_array[$column]['value']) {
|
||||
if ($q_where) {
|
||||
if (isset($this->table_array[$column]['fk']) && isset($this->table_array[$column]['value'])) {
|
||||
if (!empty($q_where)) {
|
||||
$q_where .= ' AND ';
|
||||
}
|
||||
$q_where .= $column .= ' = '.$this->table_array[$column]['value'];
|
||||
@@ -453,11 +482,11 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
}
|
||||
|
||||
// if no PK set, then get max ID from DB
|
||||
if (!$this->table_array[$this->pk_name]["value"]) {
|
||||
if (!$this->table_array[$this->pk_name]['value']) {
|
||||
// max id, falls INSERT
|
||||
$q = 'SELECT MAX('.$this->pk_name.') + 1 AS pk_id FROM '.$this->table_name;
|
||||
$res = $this->dbReturnRow($q);
|
||||
if (!$res['pk_id']) {
|
||||
if (!isset($res['pk_id'])) {
|
||||
$res['pk_id'] = 1;
|
||||
}
|
||||
$this->table_array[$this->pk_name]['value'] = $res['pk_id'];
|
||||
@@ -468,7 +497,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
$q .= $q_data;
|
||||
$q .= ' WHERE ';
|
||||
$q .= $this->pk_name.' = '.$this->table_array[$this->pk_name]['value'].' ';
|
||||
if ($q_where) {
|
||||
if (!empty($q_where)) {
|
||||
$q .= ' AND '.$q_where;
|
||||
}
|
||||
// set pk_id ... if it has changed or so
|
||||
@@ -480,8 +509,8 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
// write primary key too
|
||||
// if ($q_data)
|
||||
// $q .= ", ";
|
||||
// $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]["value"]." ";
|
||||
// $this->pk_id = $this->table_array[$this->pk_name]["value"];
|
||||
// $q .= $this->pk_name." = ".$this->table_array[$this->pk_name]['value']." ";
|
||||
// $this->pk_id = $this->table_array[$this->pk_name]['value'];
|
||||
}
|
||||
// return success or not
|
||||
if (!$this->dbExec($q)) {
|
||||
@@ -506,48 +535,56 @@ class ArrayIO extends \CoreLibs\DB\IO
|
||||
public function convert_data($text)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->convertData($text);
|
||||
}
|
||||
|
||||
public function convert_entities($text)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->convertEntities($text);
|
||||
}
|
||||
|
||||
public function db_dump_array($write = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbDumpArray($write);
|
||||
}
|
||||
|
||||
public function db_check_pk_set()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCheckPkSet();
|
||||
}
|
||||
|
||||
public function db_reset_array($reset_pk = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbResetArray($reset_pk);
|
||||
}
|
||||
|
||||
public function db_delete($table_array = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbDelete($table_array);
|
||||
}
|
||||
|
||||
public function db_read($edit = 0, $table_array = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbRead($edit, $table_array);
|
||||
}
|
||||
|
||||
public function db_write($addslashes = 0, $table_array = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbWrite($addslashes, $table_array);
|
||||
}
|
||||
} // end of class
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2000/11/23
|
||||
@@ -784,7 +784,7 @@ class IO extends \CoreLibs\Basic
|
||||
// we have returning, now we need to check if we get one or many returned
|
||||
// we'll need to loop this, if we have multiple insert_id returns
|
||||
while ($_insert_id = $this->db_functions->__dbFetchArray($this->cursor, PGSQL_ASSOC)) {
|
||||
// echo "*** RETURNING: ".print_r($_insert_id, 1)."<br>";
|
||||
// echo "*** RETURNING: ".print_r($_insert_id, true)."<br>";
|
||||
$this->insert_id[] = $_insert_id;
|
||||
}
|
||||
// if we have only one, revert from array to single
|
||||
@@ -1259,9 +1259,10 @@ class IO extends \CoreLibs\Basic
|
||||
// WAS : db_fetch_array
|
||||
// PARAMS: cusors -> the cursor from db_exec or pg_query/pg_exec/mysql_query
|
||||
// if not set will use internal cursor, if not found, stops with 0 (error)
|
||||
// assoc_only -> false is default, if true only assoc rows
|
||||
// RETURN: a mixed row
|
||||
// DESC : executes a cursor and returns the data, if no more data 0 will be returned
|
||||
public function dbFetchArray($cursor = 0)
|
||||
public function dbFetchArray($cursor = 0, $assoc_only = false)
|
||||
{
|
||||
// return false if no query or cursor set ...
|
||||
if (!$cursor) {
|
||||
@@ -1272,15 +1273,21 @@ class IO extends \CoreLibs\Basic
|
||||
$this->__dbError();
|
||||
return false;
|
||||
}
|
||||
return $this->__dbConvertEncoding($this->db_functions->__dbFetchArray($cursor));
|
||||
return $this->__dbConvertEncoding(
|
||||
$this->db_functions->__dbFetchArray(
|
||||
$cursor,
|
||||
$this->db_functions->__dbResultType($assoc_only)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// METHOD: dbReturnRow
|
||||
// WAS : db_return_row
|
||||
// PARAMS: query -> the query to be executed
|
||||
// assoc_only -> if true, only return assoc entry, else both (pgsql)
|
||||
// RETURN: mixed db result
|
||||
// DESC : returns the FIRST row of the given query
|
||||
public function dbReturnRow($query)
|
||||
public function dbReturnRow($query, $assoc_only = false)
|
||||
{
|
||||
if (!$query) {
|
||||
$this->error_id = 11;
|
||||
@@ -1294,16 +1301,17 @@ class IO extends \CoreLibs\Basic
|
||||
return false;
|
||||
}
|
||||
$cursor = $this->dbExec($query);
|
||||
$result = $this->dbFetchArray($cursor);
|
||||
$result = $this->dbFetchArray($cursor, $assoc_only);
|
||||
return $result;
|
||||
}
|
||||
|
||||
// METHOD: dbReturnArray
|
||||
// WAS : db_return_array
|
||||
// PARAMS: query -> the query to be executed, named_only -> if true, only name ref are returned
|
||||
// PARAMS: query -> the query to be executed
|
||||
// assoc_only -> if true, only name ref are returned
|
||||
// RETURN: array of hashes (row -> fields)
|
||||
// DESC : createds an array of hashes of the query (all data)
|
||||
public function dbReturnArray($query, $named_only = 0)
|
||||
public function dbReturnArray($query, $assoc_only = false)
|
||||
{
|
||||
if (!$query) {
|
||||
$this->error_id = 11;
|
||||
@@ -1317,14 +1325,9 @@ class IO extends \CoreLibs\Basic
|
||||
return false;
|
||||
}
|
||||
$cursor = $this->dbExec($query);
|
||||
while ($res = $this->dbFetchArray($cursor)) {
|
||||
while ($res = $this->dbFetchArray($cursor, $assoc_only)) {
|
||||
for ($i = 0; $i < $this->num_fields; $i ++) {
|
||||
// cereated mixed, first name
|
||||
$data[$this->field_names[$i]] = $res[$this->field_names[$i]];
|
||||
// then number
|
||||
if (!$named_only) {
|
||||
$data[$i] = $res[$this->field_names[$i]];
|
||||
}
|
||||
}
|
||||
$rows[] = $data;
|
||||
}
|
||||
@@ -1583,7 +1586,7 @@ class IO extends \CoreLibs\Basic
|
||||
public function dbCompareVersion($compare)
|
||||
{
|
||||
// compare has =, >, < prefix, and gets stripped, if the rest is not X.Y format then error
|
||||
preg_match("/^([<>=]{1,2})(\d{1,2})\.(\d{1,2})/", $compare, $matches);
|
||||
preg_match("/^([<>=]{1,})(\d{1,})\.(\d{1,})/", $compare, $matches);
|
||||
$compare = $matches[1];
|
||||
$to_master = $matches[2];
|
||||
$to_minor = $matches[3];
|
||||
@@ -1594,7 +1597,9 @@ class IO extends \CoreLibs\Basic
|
||||
}
|
||||
// db_version can return X.Y.Z
|
||||
// we only compare the first two
|
||||
list ($master, $minor, $_other) = explode('.', $this->dbVersion());
|
||||
preg_match("/^(\d{1,})\.(\d{1,})\.?(\d{1,})?/", $this->dbVersion(), $matches);
|
||||
$master = $matches[1];
|
||||
$minor = $matches[2];
|
||||
$version = $master.($minor < 10 ? '0' : '').$minor;
|
||||
$return = false;
|
||||
// compare
|
||||
@@ -1859,264 +1864,308 @@ class IO extends \CoreLibs\Basic
|
||||
private function _connect_to_db()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__connectToDB();
|
||||
}
|
||||
|
||||
private function _close_db()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__closeDB();
|
||||
}
|
||||
|
||||
private function _check_query_for_select($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__checkQueryForSelect($query);
|
||||
}
|
||||
|
||||
private function _check_query_for_insert($query, $pure = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__checkQueryForInsert($query, $pure);
|
||||
}
|
||||
|
||||
private function _print_array($array)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__printArray($array);
|
||||
}
|
||||
|
||||
private function _db_debug($debug_id, $error_string, $id = '', $type = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbDebug($debug_id, $error_string, $id, $type);
|
||||
}
|
||||
|
||||
public function _db_error($cursor = '', $msg = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbError($cursor, $msg);
|
||||
}
|
||||
|
||||
private function _db_convert_encoding($row)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbConvertEncoding($row);
|
||||
}
|
||||
|
||||
private function _db_debug_prepare($stm_name, $data = array())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbDebugPrepare($stm_name, $data);
|
||||
}
|
||||
|
||||
private function _db_return_table($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbReturnTable($query);
|
||||
}
|
||||
|
||||
private function _db_prepare_exec($query, $pk_name)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbPrepareExec($query, $pk_name);
|
||||
}
|
||||
|
||||
private function _db_post_exec()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->__dbPostExec();
|
||||
}
|
||||
|
||||
public function db_set_debug($debug = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSetDebug($debug);
|
||||
}
|
||||
|
||||
public function db_reset_query_called($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbResetQueryCalled($query);
|
||||
}
|
||||
|
||||
public function db_get_query_called($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbGetQueryCalled($query);
|
||||
}
|
||||
|
||||
public function db_close()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbClose();
|
||||
}
|
||||
|
||||
public function db_set_schema($db_schema = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSetSchema($db_schema);
|
||||
}
|
||||
|
||||
public function db_get_schema()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbGetSchema();
|
||||
}
|
||||
|
||||
public function db_set_encoding($db_encoding = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSetEncoding($db_encoding);
|
||||
}
|
||||
|
||||
public function db_info($show = 1)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbInfo($show);
|
||||
}
|
||||
|
||||
public function db_dump_data($query = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbDumpData($query);
|
||||
}
|
||||
|
||||
public function db_return($query, $reset = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbReturn($query, $reset);
|
||||
}
|
||||
|
||||
public function db_cache_reset($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCacheReset($query);
|
||||
}
|
||||
|
||||
public function db_exec($query = 0, $pk_name = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbExec($query, $pk_name);
|
||||
}
|
||||
|
||||
public function db_exec_async($query, $pk_name = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbExecAsync($query, $pk_name);
|
||||
}
|
||||
|
||||
public function db_check_async()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCheckAsync();
|
||||
}
|
||||
|
||||
public function db_fetch_array($cursor = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbFetchArray($cursor);
|
||||
}
|
||||
|
||||
public function db_return_row($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbReturnRow($query);
|
||||
}
|
||||
|
||||
public function db_return_array($query, $named_only = 0)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbReturnArray($query, $named_only);
|
||||
}
|
||||
|
||||
public function db_cursor_pos($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCursorPos($query);
|
||||
}
|
||||
|
||||
public function db_cursor_num_rows($query)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCursorNumRows($query);
|
||||
}
|
||||
|
||||
public function db_show_table_meta_data($table, $schema = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbShowTableMetaData($table, $schema);
|
||||
}
|
||||
|
||||
public function db_prepare($stm_name, $query, $pk_name = '')
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbPrepare($stm_name, $query, $pk_name);
|
||||
}
|
||||
|
||||
public function db_execute($stm_name, $data = array())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbExecute($stm_name, $data);
|
||||
}
|
||||
|
||||
public function db_escape_string($string)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbEscapeString($string);
|
||||
}
|
||||
|
||||
public function db_escape_bytea($bytea)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbEscapeBytea($bytea);
|
||||
}
|
||||
|
||||
public function db_version()
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbVersion();
|
||||
}
|
||||
|
||||
public function db_compare_version($compare)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbCompareVersion($compare);
|
||||
}
|
||||
|
||||
public function db_boolean($string, $rev = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbBoolean($string, $rev);
|
||||
}
|
||||
|
||||
public function db_write_data($write_array, $not_write_array, $primary_key, $table, $data = array ())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbWriteData($write_array, $not_write_array, $primary_key, $table, $data);
|
||||
}
|
||||
|
||||
public function db_write_data_ext($write_array, $primary_key, $table, $not_write_array = array (), $not_write_update_array = array (), $data = array ())
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbWriteDataExt($write_array, $primary_key, $table, $not_write_array, $not_write_update_array, $data);
|
||||
}
|
||||
|
||||
public function db_time_format($age, $show_micro = false)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbTimeFormat($age, $show_micro);
|
||||
}
|
||||
|
||||
public function db_array_parse($text)
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbArrayParse($text);
|
||||
}
|
||||
|
||||
public function db_sql_escape($value, $kbn = "")
|
||||
{
|
||||
error_log('DEPRECATED CALL: '.__METHOD__.', '.__FILE__.':'.__LINE__.', '.debug_backtrace()[0]['file'].':'.debug_backtrace()[0]['line']);
|
||||
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
|
||||
return $this->dbSqlEscape($value, $kbn);
|
||||
}
|
||||
} // end if db class
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2003/04/09
|
||||
@@ -190,6 +190,9 @@ class PgSQL
|
||||
// DESC : wrapper for pg_fetch_array
|
||||
public function __dbFetchArray($cursor, $result_type = '')
|
||||
{
|
||||
if ($result_type == true) {
|
||||
$result_type = PGSQL_ASSOC;
|
||||
}
|
||||
// result type is passed on as is [should be checked]
|
||||
if ($result_type) {
|
||||
return pg_fetch_array($cursor, null, $result_type);
|
||||
@@ -198,6 +201,18 @@ class PgSQL
|
||||
}
|
||||
}
|
||||
|
||||
// METHOD: __dbResultType
|
||||
// PARAMS: true/false for ASSOC only or BOTH
|
||||
// RETURN: PGSQL assoc type
|
||||
// DESC : simple match up between assoc true/false
|
||||
public function __dbResultType($assoc_type)
|
||||
{
|
||||
if ($assoc_type == true) {
|
||||
return PGSQL_ASSOC;
|
||||
}
|
||||
return ''; // fallback to default
|
||||
}
|
||||
|
||||
// METHOD: __dbFetchAll
|
||||
// WAS : _db_fetch_all
|
||||
// PARAMS: cursor
|
||||
@@ -361,7 +376,7 @@ class PgSQL
|
||||
// DESC : wrapper for pg_escape_string
|
||||
public function __dbEscapeString($string)
|
||||
{
|
||||
return pg_escape_string($this->dbh, $string);
|
||||
return pg_escape_string($this->dbh, (string)$string);
|
||||
}
|
||||
|
||||
// METHOD: __dbEscapeBytea
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2004/11/18
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* Class ProgressBar
|
||||
*
|
||||
@@ -481,7 +481,7 @@ class ProgressBar
|
||||
$js .= ' }'."\n";
|
||||
$js .= '}'."\n";
|
||||
|
||||
// print "DUMP LABEL: <br><pre>".print_r($this->label, 1)."</pre><br>";
|
||||
// print "DUMP LABEL: <br><pre>".print_r($this->label, true)."</pre><br>";
|
||||
foreach ($this->label as $name => $data) {
|
||||
// set what type of move we do
|
||||
$move_prefix = $data['type'] == 'button' ? 'margin' : 'padding';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2004/12/21
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/*********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2011/2/8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Autoloader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user