Switch all array init calles to no space before bracket

Also bug fix in Form General for load int PK calls with non int types
This commit is contained in:
Clemens Schwaighofer
2019-09-20 11:10:13 +09:00
parent 8ade113070
commit ef1df6f171
26 changed files with 398 additions and 397 deletions

View File

@@ -8,8 +8,8 @@
*********************************************************************/
// please be VERY carefull only to change the right side
$DB_CONFIG = array (
'test' => array (
$DB_CONFIG = array(
'test' => array(
'db_name' => 'gullevek',
'db_user' => 'gullevek',
'db_pass' => 'gullevek',

View File

@@ -13,9 +13,9 @@
*********************************************************************/
// each host has a different db_host
$SITE_CONFIG = array (
$SITE_CONFIG = array(
// development host
'soba.tokyo.tequila.jp' => array (
'soba.tokyo.tequila.jp' => array(
// db config selection
'db_host' => 'test',
// other db connections

View File

@@ -172,14 +172,14 @@ if (file_exists(BASE.CONFIGS.'config.host.php')) {
require BASE.CONFIGS.'config.host.php';
}
if (!isset($SITE_CONFIG)) {
$SITE_CONFIG = array ();
$SITE_CONFIG = array();
}
/************* DB ACCESS *****************/
if (file_exists(BASE.CONFIGS.'config.db.php')) {
require BASE.CONFIGS.'config.db.php';
}
if (!isset($DB_CONFIG)) {
$DB_CONFIG = array ();
$DB_CONFIG = array();
}
/************* OTHER PATHS *****************/
if (file_exists(BASE.CONFIGS.'config.path.php')) {
@@ -219,7 +219,7 @@ if ((array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVE
}
// define the db config set name, the db config and the db schema
DEFINE('DB_CONFIG_NAME', $SITE_CONFIG[$HOST_NAME]['db_host']);
DEFINE('DB_CONFIG', isset($DB_CONFIG[DB_CONFIG_NAME]) ? $DB_CONFIG[DB_CONFIG_NAME] : array ());
DEFINE('DB_CONFIG', isset($DB_CONFIG[DB_CONFIG_NAME]) ? $DB_CONFIG[DB_CONFIG_NAME] : array());
// DEFINE('DB_CONFIG_TARGET', SITE_CONFIG[$HOST_NAME]['db_host_target']);
// DEFINE('DB_CONFIG_OTHER', SITE_CONFIG[$HOST_NAME]['db_host_other']);
// override for login and global schemas
@@ -253,7 +253,7 @@ DEFINE('JAVASCRIPT', 'frontend.js');
// DEFINE('SOME_ID', <SOME VALUE>);
/************* CONVERT *******************/
$paths = array (
$paths = array(
'/bin',
'/usr/bin',
'/usr/local/bin'

View File

@@ -10,8 +10,8 @@
// File and Folder paths
// ID is TARGET (first array element)
/*$PATHS = array (
'test' => array (
/*$PATHS = array(
'test' => array(
'csv_path' => '',
'perl_bin' => '',
'other_url' => '',

View File

@@ -22,7 +22,7 @@ if (!defined('DS')) {
exit('Base config unloadable');
}
// find trigger name "admin/" or "frontend/" in the getcwd() folder
foreach (array ('admin', 'frontend') as $folder) {
foreach (array('admin', 'frontend') as $folder) {
if (strstr(getcwd(), DS.$folder)) {
define('CONTENT_PATH', $folder.DS);
break;

View File

@@ -7,7 +7,7 @@
* HISTORY:
*********************************************************************/
$day_short = array (
$day_short = array(
1 => 'Mon',
2 => 'Tue',
3 => 'Wed',
@@ -17,7 +17,7 @@ $day_short = array (
7 => 'Sun'
);
$day_long = array (
$day_long = array(
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
@@ -28,7 +28,7 @@ $day_long = array (
);
// months
$month_long = array (
$month_long = array(
1 => 'January',
2 => 'February',
3 => 'March',
@@ -43,7 +43,7 @@ $month_long = array (
12 => 'December'
);
$month_short = array (
$month_short = array(
1 => 'Jan',
2 => 'Feb',
3 => 'Mar',

View File

@@ -14,7 +14,7 @@ if ($DEBUG_ALL && $ENABLE_ERROR_HANDLING) {
}
// predefine vars
$lang = '';
$messages = array ();
$messages = array();
// import all POST vars
extract($_POST, EXTR_SKIP);
//------------------------------ variable init end
@@ -70,7 +70,7 @@ ob_end_flush();
//------------------------------ logging start
// log backend data
// data part creation
$data = array (
$data = array(
'_SESSION' => $_SESSION,
'_GET' => $_GET,
'_POST' => $_POST,

View File

@@ -94,13 +94,13 @@ if ($form->my_page_name == 'edit_order') {
// order name is _always_ order_number for the edit interface
// follwing arrays do exist here:
// $position ... has the positions of the array (0..max), cause in a <select>
// $position ... has the positions of the array(0..max), cause in a <select>
// I can't put an number into the array field, in this array,
// 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 (!isset($position)) {
$position = array ();
$position = array();
}
$row_data_id = $_POST['row_data_id'];
$original_id = $row_data_id;
@@ -154,7 +154,7 @@ if ($form->my_page_name == 'edit_order') {
$q .= "ORDER BY order_number";
while ($res = $form->dbReturn($q)) {
$row_data[] = array (
$row_data[] = array(
"id" => $res[$table_name."_id"],
"name" => $res["name"],
"order" => $res["order_number"]
@@ -164,22 +164,22 @@ if ($form->my_page_name == 'edit_order') {
// html title
$HEADER['HTML_TITLE'] = $form->l->__('Edit Order');
$messages = array ();
$messages = array();
// error msg
if (isset($error)) {
if (!isset($msg)) {
$msg = array ();
$msg = array();
}
$messages[] = array ('msg' => $msg, 'class' => 'error', 'width' => '100%');
$messages[] = array('msg' => $msg, 'class' => 'error', 'width' => '100%');
}
$DATA['form_error_msg'] = $messages;
// all the row data
$options_id = array ();
$options_name = array ();
$options_selected = array ();
$options_id = array();
$options_name = array();
$options_selected = array();
if (!isset($row_data) || !is_array($row_data)) {
$row_data = array ();
$row_data = array();
}
for ($i = 0; $i < count($row_data); $i ++) {
$options_id[] = $i;
@@ -197,8 +197,8 @@ if ($form->my_page_name == 'edit_order') {
$DATA['options_selected'] = $options_selected;
// hidden list for the data (id, order number)
$row_data_id = array ();
$row_data_order = array ();
$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'];
@@ -247,9 +247,9 @@ if ($form->my_page_name == 'edit_order') {
// build nav from $PAGES ...
if (!isset($PAGES) || !is_array($PAGES)) {
$PAGES = array ();
$PAGES = array();
}
$menuarray = array ();
$menuarray = array();
foreach ($PAGES as $PAGE_CUID => $PAGE_DATA) {
if ($PAGE_DATA['menu'] && $PAGE_DATA['online']) {
$menuarray[] = $PAGE_DATA;
@@ -268,7 +268,7 @@ if ($form->my_page_name == 'edit_order') {
}
$position = 0;
$menu_data = array ();
$menu_data = array();
for ($i = 1; $i <= count($menuarray); $i ++) {
// do that for new array
$j = $i - 1;
@@ -319,7 +319,7 @@ if ($form->my_page_name == 'edit_order') {
$DATA['form_my_page_name'] = $form->my_page_name;
$DATA['filename_exist'] = 0;
$DATA['drop_down_input'] = 0;
$elements = array ();
$elements = array();
// depending on the "getPageName()" I show different stuff
switch ($form->my_page_name) {
case 'edit_users':

View File

@@ -1,25 +1,25 @@
<?php declare(strict_types=1);
$edit_access = array (
'table_array' => array (
'edit_access_id' => array (
$edit_access = array(
'table_array' => array(
'edit_access_id' => array(
'value' => isset($GLOBALS['edit_access_id']) ? $GLOBALS['edit_access_id'] : '',
'type' => 'hidden',
'pk' => 1
),
'name' => array (
'name' => array(
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
'output_name' => 'Access Group Name',
'mandatory' => 1,
'type' => 'text',
'error_check' => 'alphanumericspace|unique'
),
'description' => array (
'description' => array(
'value' => isset($GLOBALS['description']) ? $GLOBALS['description'] : '',
'output_name' => 'Description',
'type' => 'textarea'
),
'color' => array (
'color' => array(
'value' => isset($GLOBALS['color']) ? $GLOBALS['color'] : '',
'output_name' => 'Color',
'mandatory' => 0,
@@ -30,27 +30,27 @@ $edit_access = array (
'error_regex' => "/[\dA-Fa-f]{6}/",
'error_example' => 'F6A544'
),
'enabled' => array (
'enabled' => array(
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : 0,
'output_name' => 'Enabled',
'type' => 'binary',
'int' => 1, // OR 'bool' => 1
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'protected' => array (
'protected' => array(
'value' => isset($GLOBALS['protected']) ? $GLOBALS['protected'] : 0,
'output_name' => 'Protected',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'additional_acl' => array (
'additional_acl' => array(
'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
'output_name' => 'Additional ACL (as JSON)',
'type' => 'textarea',
@@ -61,41 +61,41 @@ $edit_access = array (
),
'table_name' => 'edit_access',
"load_query" => "SELECT edit_access_id, name FROM edit_access ORDER BY name",
'show_fields' => array (
array (
'show_fields' => array(
array(
'name' => 'name'
)
),
'element_list' => array (
'edit_access_data' => array (
'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 (
'elements' => array(
'name' => array(
'type' => 'text',
'error_check' => 'alphanumeric|unique',
'output_name' => 'Name',
'mandatory' => 1
),
'value' => array (
'value' => array(
'type' => 'text',
'output_name' => 'Value'
),
'enabled' => array (
'enabled' => array(
'type' => 'checkbox',
'output_name' => 'Activate',
'int' => 1,
'element_list' => array(1)
),
/*'edit_access_id' => array (
/*'edit_access_id' => array(
'int' => 1,
'type' => 'hidden',
'fk_id' => 1 # reference main key from master table above
),*/
'edit_access_data_id' => array (
'edit_access_data_id' => array(
'type' => 'hidden',
'int' => 1,
'pk_id' => 1

View File

@@ -1,29 +1,29 @@
<?php declare(strict_types=1);
$edit_groups = array (
'table_array' => array (
'edit_group_id' => array (
$edit_groups = array(
'table_array' => array(
'edit_group_id' => array(
'value' => isset($GLOBALS['edit_group_id']) ? $GLOBALS['edit_group_id'] : '',
'pk' => 1,
'type' => 'hidden'
),
'enabled' => array (
'enabled' => array(
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
'output_name' => 'Enabled',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'name' => array (
'name' => array(
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
'output_name' => 'Group Name',
'type' => 'text',
'mandatory' => 1
),
'edit_access_right_id' => array (
'edit_access_right_id' => array(
'value' => isset($GLOBALS['edit_access_right_id']) ? $GLOBALS['edit_access_right_id'] : '',
'output_name' => 'Group Level',
'mandatory' => 1,
@@ -31,14 +31,14 @@ $edit_groups = array (
'type' => 'drop_down_db',
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
),
'edit_scheme_id' => array (
'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 (
'additional_acl' => array(
'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
'output_name' => 'Additional ACL (as JSON)',
'type' => 'textarea',
@@ -49,54 +49,54 @@ $edit_groups = array (
),
'load_query' => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name",
'table_name' => 'edit_group',
'show_fields' => array (
array (
'show_fields' => array(
array(
'name' => 'name'
),
array (
array(
'name' => 'enabled',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'Enabled: '
)
),
'element_list' => array (
'edit_page_access' => array (
'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 (
'read_data' => array(
'table_name' => 'edit_page',
'pk_id' => 'edit_page_id',
'name' => 'name',
'order' => 'order_number'
),
'elements' => array (
'edit_page_access_id' => array (
'elements' => array(
'edit_page_access_id' => array(
'type' => 'hidden',
'int' => 1,
'pk_id' => 1
),
'enabled' => array (
'enabled' => array(
'type' => 'checkbox',
'output_name' => 'Activate',
'int' => 1,
'element_list' => array(1)
),
'edit_access_right_id' => array (
'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 (
'edit_page_id' => array(
'int' => 1,
'type' => 'hidden'
)
/*,
'edit_default' => array (
'edit_default' => array(
'output_name' => 'Default',
'type' => 'radio',
'mandatory' => 1

View File

@@ -1,13 +1,13 @@
<?php declare(strict_types=1);
$edit_languages=array (
'table_array' => array (
'edit_language_id' => array (
$edit_languages=array(
'table_array' => array(
'edit_language_id' => array(
'value' => isset($GLOBALS['edit_language_id']) ? $GLOBALS['edit_language_id'] : '',
'type' => 'hidden',
'pk' => 1
),
'short_name' => array (
'short_name' => array(
'value' => isset($GLOBALS['short_name']) ? $GLOBALS['short_name'] : '',
'output_name' => 'Language (short)',
'mandatory' => 1,
@@ -15,58 +15,58 @@ $edit_languages=array (
'size' => 2,
'length' => 2
),
'long_name' => array (
'long_name' => array(
'value' => isset($GLOBALS['long_name']) ? $GLOBALS['long_name'] : '',
'output_name' => 'Language (long)',
'mandatory' => 1,
'type' => 'text',
'size' => 40
),
'iso_name' => array (
'iso_name' => array(
'value' => isset($GLOBALS['iso_name']) ? $GLOBALS['iso_name'] : '',
'output_name' => 'ISO Code',
'mandatory' => 1,
'type' => 'text'
),
'order_number' => array (
'order_number' => array(
'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
'int' => 1,
'order' => 1
),
'enabled' => array (
'enabled' => array(
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
'output_name' => 'Enabled',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'lang_default' => array (
'lang_default' => array(
'value' => isset($GLOBALS['lang_default']) ? $GLOBALS['lang_default'] : '',
'output_name' => 'Default Language',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'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 (
array (
'show_fields' => array(
array(
'name' => 'long_name'
),
array (
array(
'name' => 'iso_name',
'before_value' => 'ISO: '
),
array (
array(
'name' => 'enabled',
'before_value' => 'Enabled: ',
'binary' => array ('Yes','No')
'binary' => array('Yes','No')
)
),
'table_name' => 'edit_language'

View File

@@ -1,26 +1,26 @@
<?php declare(strict_types=1);
$edit_menu_group = array (
'table_array' => array (
'edit_menu_group_id' => array (
$edit_menu_group = array(
'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 (
'name' => array(
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
'output_name' => 'Group name',
'mandatory' => 1,
'type' => 'text'
),
'flag' => array (
'flag' => array(
'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
'output_name' => 'Flag',
'mandatory' => 1,
'type' => 'text',
'error_check' => 'alphanumeric|unique'
),
'order_number' => array (
'order_number' => array(
'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
'output_name' => 'Group order',
'type' => 'order',
@@ -30,8 +30,8 @@ $edit_menu_group = 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 (
'show_fields' => array(
array(
'name' => 'name'
)
)

View File

@@ -1,13 +1,13 @@
<?php declare(strict_types=1);
$edit_pages = array (
'table_array' => array (
'edit_page_id' => array (
$edit_pages = array(
'table_array' => array(
'edit_page_id' => array(
'value' => isset($GLOBALS['edit_page_id']) ? $GLOBALS['edit_page_id'] : '',
'type' => 'hidden',
'pk' => 1
),
'filename' => array (
'filename' => array(
'value' => isset($GLOBALS['filename']) ? $GLOBALS['filename'] : '',
'output_name' => 'Add File ...',
'mandatory' => 1,
@@ -17,24 +17,24 @@ $edit_pages = array (
"LEFT JOIN edit_page ep ON temp_files.filename = ep.filename ".
"WHERE ep.filename IS NULL"
),
'name' => array (
'name' => array(
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
'output_name' => 'Page name',
'mandatory' => 1,
'type' => 'text'
),
'order_number' => array (
'order_number' => array(
'value' => isset($GLOBALS['order_number']) ? $GLOBALS['order_number'] : '',
'output_name' => 'Page order',
'type' => 'order',
'int' => 1,
'order' => 1
),
/* 'flag' => array (
/* 'flag' => array(
'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
'output_name' => 'Page Flag',
'type' => 'drop_down_array',
'query' => array (
'query' => array(
'0' => '0',
'1' => '1',
'2' => '2',
@@ -43,37 +43,37 @@ $edit_pages = array (
'5' => '5'
)
),*/
'online' => array (
'online' => array(
'value' => isset($GLOBALS['online']) ? $GLOBALS['online'] : '',
'output_name' => 'Online',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'menu' => array (
'menu' => array(
'value' => isset($GLOBALS['menu']) ? $GLOBALS['menu'] : '',
'output_name' => 'Menu',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'popup' => array (
'popup' => array(
'value' => isset($GLOBALS['popup']) ? $GLOBALS['popup'] : '',
'output_name' => 'Popup',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'popup_x' => array (
'popup_x' => array(
'value' => isset($GLOBALS['popup_x']) ? $GLOBALS['popup_x'] : '',
'output_name' => 'Popup Width',
'int_null' => 1,
@@ -81,7 +81,7 @@ $edit_pages = array (
'size' => 4,
'length' => 4
),
'popup_y' => array (
'popup_y' => array(
'value' => isset($GLOBALS['popup_y']) ? $GLOBALS['popup_y'] : '',
'output_name' => 'Popup Height',
'int_null' => 1,
@@ -89,7 +89,7 @@ $edit_pages = array (
'size' => 4,
'length' => 4
),
'content_alias_edit_page_id' => array (
'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_null' => 1,
@@ -109,32 +109,32 @@ $edit_pages = array (
),
'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 (
'show_fields' => array(
array(
'name' => 'name'
),
array (
array(
'name' => 'filename',
'before_value' => 'Filename: '
),
array (
array(
'name' => 'online',
'binary' => array ('Yes','No'),
'binary' => array('Yes','No'),
'before_value' => 'Online: '
),
array (
array(
'name' => 'menu',
'binary' => array ('Yes','No'),
'binary' => array('Yes','No'),
'before_value' => 'Menu: '
),
array (
array(
'name' => 'popup',
'binary' => array ('Yes','No'),
'binary' => array('Yes','No'),
'before_value' => 'Popup: '
)
),
'reference_arrays' => array (
'edit_visible_group' => array (
'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)',
@@ -143,7 +143,7 @@ $edit_pages = array (
'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 (
'edit_menu_group' => array(
'table_name' => 'edit_page_menu_group',
'other_table_pk' => 'edit_menu_group_id',
'output_name' => 'Menu Groups (grouping)',
@@ -154,77 +154,77 @@ $edit_pages = array (
)
),
'element_list' => array (
'edit_query_string' => array (
'element_list' => array(
'edit_query_string' => array(
'output_name' => 'Query Strings',
'delete_name' => 'remove_query_string',
'prefix' => 'eqs',
'elements' => array (
'name' => array (
'elements' => array(
'name' => array(
'output_name' => 'Name',
'type' => 'text',
'error_check' => 'unique|alphanumeric',
'mandatory' => 1
),
'value' => array (
'value' => array(
'output_name' => 'Value',
'type' => 'text'
),
'enabled' => array (
'enabled' => array(
'output_name' => 'Enabled',
'int' => 1,
'type' => 'checkbox',
'element_list' => array (1)
'element_list' => array(1)
),
'dynamic' => array (
'dynamic' => array(
'output_name' => 'Dynamic',
'int' => 1,
'type' => 'checkbox',
'element_list' => array (1)
'element_list' => array(1)
),
'edit_query_string_id' => array (
'edit_query_string_id' => array(
'type' => 'hidden',
'pk_id' => 1
)
) // elements
), // query_string element list
'edit_page_content' => array (
'edit_page_content' => array(
'output_name' => 'Page Content',
'delete_name' => 'remove_page_content',
'prefix' => 'epc',
'elements' => array (
'name' => array (
'elements' => array(
'name' => array(
'output_name' => 'Content',
'type' => 'text',
'error_check' => 'alphanumeric',
'mandatory' => 1
),
'uid' => array (
'uid' => array(
'output_name' => 'UID',
'type' => 'text',
'error_check' => 'unique|alphanumeric',
'mandatory' => 1
),
'order_number' => array (
'order_number' => array(
'output_name' => 'Order',
'type' => 'text',
'error_check' => 'int',
'mandatory' => 1
),
'online' => array (
'online' => array(
'output_name' => 'Online',
'int' => 1,
'type' => 'checkbox',
'element_list' => array (1)
'element_list' => array(1)
),
'edit_access_right_id' => array (
'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 (
'edit_page_content_id' => array(
'type' => 'hidden',
'pk_id' => 1
)

View File

@@ -1,19 +1,19 @@
<?php declare(strict_types=1);
$edit_schemes = array (
'table_array' => array (
'edit_scheme_id' => array (
$edit_schemes = array(
'table_array' => array(
'edit_scheme_id' => array(
'value' => isset($GLOBALS['edit_scheme_id']) ? $GLOBALS['edit_scheme_id'] : '',
'type' => 'hidden',
'pk' => 1
),
'name' => array (
'name' => array(
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
'output_name' => 'Scheme Name',
'mandatory' => 1,
'type' => 'text'
),
'header_color' => array (
'header_color' => array(
'value' => isset($GLOBALS['header_color']) ? $GLOBALS['header_color'] : '',
'output_name' => 'Header Color',
'mandatory' => 1,
@@ -24,17 +24,17 @@ $edit_schemes = array (
'error_regex' => '/[\dA-Fa-f]{6}/',
'error_example' => 'F6A544'
),
'enabled' => array (
'enabled' => array(
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
'output_name' => 'Enabled',
'int' => 1,
'type' => 'binary',
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'template' => array (
'template' => array(
'value' => isset($GLOBALS['template']) ? $GLOBALS['template'] : '',
'output_name' => 'Template',
'type' => 'text'
@@ -42,13 +42,13 @@ $edit_schemes = array (
),
'table_name' => 'edit_scheme',
'load_query' => "SELECT edit_scheme_id, name, enabled FROM edit_scheme ORDER BY name",
'show_fields' => array (
array (
'show_fields' => array(
array(
'name' => 'name'
),
array (
array(
'name' => 'enabled',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'Enabled: '
)
)

View File

@@ -1,29 +1,29 @@
<?php declare(strict_types=1);
$edit_users = array (
'table_array' => array (
'edit_user_id' => array (
$edit_users = array(
'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 (
'username' => array(
'value' => isset($GLOBALS['username']) ? $GLOBALS['username'] : '',
'output_name' => 'Username',
'mandatory' => 1,
'error_check' => 'unique|alphanumericextended',
'type' => 'text'
),
'password' => array (
'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
'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)
'value' => 'NOW()' // value [todo: complex reference
)
@@ -31,7 +31,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 (
'password_change_interval' => array(
'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
@@ -40,83 +40,83 @@ $edit_users = array (
'size' => 5, // make it 5 chars long
'length' => 5
),
'enabled' => array (
'enabled' => array(
'value' => isset($GLOBALS['enabled']) ? $GLOBALS['enabled'] : '',
'output_name' => 'Enabled',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'strict' => array (
'strict' => array(
'value' => isset($GLOBALS['strict']) ? $GLOBALS['strict'] : '',
'output_name' => 'Strict (Lock after errors)',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'locked' => array (
'locked' => array(
'value' => isset($GLOBALS['locked']) ? $GLOBALS['locked'] : '',
'output_name' => 'Locked (auto set if strict with errors)',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'admin' => array (
'admin' => array(
'value' => isset($GLOBALS['admin']) ? $GLOBALS['admin'] : '',
'output_name' => 'Admin',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'debug' => array (
'debug' => array(
'value' => isset($GLOBALS['debug']) ? $GLOBALS['debug'] : '',
'output_name' => 'Debug',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'db_debug' => array (
'db_debug' => array(
'value' => isset($GLOBALS['db_debug']) ? $GLOBALS['db_debug'] : '',
'output_name' => 'DB Debug',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'email' => array (
'email' => array(
'value' => isset($GLOBALS['email']) ? $GLOBALS['email'] : '',
'output_name' => 'E-Mail',
'type' => 'text',
'error_check' => 'email'
),
'last_name' => array (
'last_name' => array(
'value' => isset($GLOBALS['last_name']) ? $GLOBALS['last_name'] : '',
'output_name' => 'Last Name',
'type' => 'text'
),
'first_name' => array (
'first_name' => array(
'value' => isset($GLOBALS['first_name']) ? $GLOBALS['first_name'] : '',
'output_name' => 'First Name',
'type' => 'text'
),
'edit_language_id' => array (
'edit_language_id' => array(
'value' => isset($GLOBALS['edit_language_id']) ? $GLOBALS['edit_language_id'] : '',
'output_name' => 'Language',
'mandatory' => 1,
@@ -124,14 +124,14 @@ $edit_users = array (
'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 (
'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 (
'edit_group_id' => array(
'value' => isset($GLOBALS['edit_group_id']) ? $GLOBALS['edit_group_id'] : '',
'output_name' => 'Group',
'int' => 1,
@@ -139,7 +139,7 @@ $edit_users = array (
'query' => "SELECT edit_group_id, name FROM edit_group WHERE enabled = 1 ORDER BY name",
'mandatory' => 1
),
'edit_access_right_id' => array (
'edit_access_right_id' => array(
'value' => isset($GLOBALS['edit_access_right_id']) ? $GLOBALS['edit_access_right_id'] : '',
'output_name' => 'User Level',
'mandatory' => 1,
@@ -147,35 +147,35 @@ $edit_users = array (
'type' => 'drop_down_db',
'query' => "SELECT edit_access_right_id, name FROM edit_access_right ORDER BY level"
),
'login_error_count' => array (
'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 (
'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 (
'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 (
'protected' => array(
'value' => isset($GLOBALS['protected']) ? $GLOBALS['protected'] : '',
'output_name' => 'Protected',
'type' => 'binary',
'int' => 1,
'element_list' => array (
'element_list' => array(
'1' => 'Yes',
'0' => 'No'
)
),
'additional_acl' => array (
'additional_acl' => array(
'value' => isset($GLOBALS['additional_acl']) ? $GLOBALS['additional_acl'] : '',
'output_name' => 'Additional ACL (as JSON)',
'type' => 'textarea',
@@ -186,79 +186,79 @@ $edit_users = array (
),
'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 (
'show_fields' => array(
array(
'name' => 'username'
),
array (
array(
'name' => 'enabled',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'Enabled: '
),
array (
array(
'name' => 'debug',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'Debug: '
),
array (
array(
'name' => 'db_debug',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'DB Debug: '
),
array (
array(
'name' => 'strict',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'Strict: '
),
array (
array(
'name' => 'locked',
'binary' => array ('Yes', 'No'),
'binary' => array('Yes', 'No'),
'before_value' => 'Locked: '
),
array (
array(
'name' => 'login_error_count',
'before_value' => 'Errors: '
)
),
'element_list' => array (
'edit_access_user' => array (
'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 (
'read_data' => array(
'table_name' => 'edit_access',
'pk_id' => 'edit_access_id',
'name' => 'name',
'order' => 'name'
),
'elements' => array (
'edit_access_user_id' => array (
'elements' => array(
'edit_access_user_id' => array(
'output_name' => 'Activate',
'type' => 'hidden',
'int' => 1,
'pk_id' => 1
),
'enabled' => array (
'enabled' => array(
'type' => 'checkbox',
'output_name' => 'Activate',
'int' => 1,
'element_list' => array (1)
'element_list' => array(1)
),
'edit_access_right_id' => array (
'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 (
'edit_default' => array(
'type' => 'radio_group',
'output_name' => 'Default',
'int' => 1,
'element_list' => 'radio_group'
),
'edit_access_id' => array (
'edit_access_id' => array(
'type' => 'hidden',
'int' => 1
)

View File

@@ -1,19 +1,19 @@
<?php declare(strict_types=1);
$edit_visible_group = array (
'table_array' => array (
'edit_visible_group_id' => array (
$edit_visible_group = array(
'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 (
'name' => array(
'value' => isset($GLOBALS['name']) ? $GLOBALS['name'] : '',
'output_name' => 'Group name',
'mandatory' => 1,
'type' => 'text'
),
'flag' => array (
'flag' => array(
'value' => isset($GLOBALS['flag']) ? $GLOBALS['flag'] : '',
'output_name' => 'Flag',
'mandatory' => 1,
@@ -23,8 +23,8 @@ $edit_visible_group = 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 (
'show_fields' => array(
array(
'name' => 'name'
)
)

View File

@@ -78,33 +78,33 @@ class Login extends \CoreLibs\DB\IO
private $pw_old_password;
private $pw_new_password;
private $pw_new_password_confirm;
private $pw_change_deny_users = array (); // array of users for which the password change is forbidden
private $pw_change_deny_users = array(); // array of users for which the password change is forbidden
private $logout_target;
private $max_login_error_count = -1;
private $lock_deny_users = array ();
private $lock_deny_users = array();
// if we have password change we need to define some rules
private $password_min_length = PASSWORD_MIN_LENGTH;
// max length is fixed as 255 (for input type max), if set highter, it will be set back to 255
private $password_max_length = PASSWORD_MAX_LENGTH;
// can have several regexes, if nothing set, all is ok
private $password_valid_chars = array (
private $password_valid_chars = array(
// '^(?=.*\d)(?=.*[A-Za-z])[0-9A-Za-z!@#$%]{8,}$',
// '^(?.*(\pL)u)(?=.*(\pN)u)(?=.*([^\pL\pN])u).{8,}',
);
// all possible login error conditions
private $login_error_msg = array ();
private $login_error_msg = array();
// this is an array holding all strings & templates passed from the outside (translation)
private $login_template = array (
'strings' => array (),
private $login_template = array(
'strings' => array(),
'password_change' => '',
'template' => ''
);
// acl vars
public $acl = array ();
public $default_acl_list = array ();
public $acl = array();
public $default_acl_list = array();
// language
public $l;
@@ -207,7 +207,7 @@ class Login extends \CoreLibs\DB\IO
// logout target (from config)
$this->logout_target = LOGOUT_TARGET;
// disallow user list for password change
$this->pw_change_deny_users = array ('admin');
$this->pw_change_deny_users = array('admin');
// set flag if password change is okay
if (defined('PASSWORD_CHANGE')) {
$this->password_change = PASSWORD_CHANGE;
@@ -219,15 +219,15 @@ class Login extends \CoreLibs\DB\IO
// max login counts before error reporting
$this->max_login_error_count = 10;
// users that never get locked, even if they are set strict
$this->lock_deny_users = array ('admin');
$this->lock_deny_users = array('admin');
// init default ACL list array
$_SESSION['DEFAULT_ACL_LIST'] = array ();
$_SESSION['DEFAULT_ACL_LIST'] = array();
// read the current edit_access_right list into an array
$q = "SELECT level, type, name FROM edit_access_right WHERE level >= 0 ORDER BY level";
while ($res = $this->dbReturn($q)) {
// level to description format (numeric)
$this->default_acl_list[$res['level']] = array (
$this->default_acl_list[$res['level']] = array(
'type' => $res['type'],
'name' => $res['name']
);
@@ -428,7 +428,7 @@ class Login extends \CoreLibs\DB\IO
}
$edit_page_ids = array();
$pages = array();
$pages_acl = array ();
$pages_acl = array();
// set pages access
$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 ";
@@ -442,7 +442,7 @@ class Login extends \CoreLibs\DB\IO
// page id array for sub data readout
$edit_page_ids[$res['edit_page_id']] = $res['cuid'];
// create the array for pages
$pages[$res['cuid']] = 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
@@ -456,8 +456,8 @@ class Login extends \CoreLibs\DB\IO
'online' => $res['online'],
'acl_level' => $res['level'],
'acl_type' => $res['type'],
'query' => array (),
'visible' => array ()
'query' => array(),
'visible' => array()
);
// make reference filename -> level
$pages_acl[$res['filename']] = $res['level'];
@@ -477,7 +477,7 @@ class Login extends \CoreLibs\DB\IO
$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)) {
$pages[$edit_page_ids[$res['edit_page_id']]]['query'][] = array (
$pages[$edit_page_ids[$res['edit_page_id']]]['query'][] = array(
'name' => $res['name'],
'value' => $res['value'],
'dynamic' => $res['dynamic']
@@ -491,7 +491,7 @@ class Login extends \CoreLibs\DB\IO
$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 (
$pages[$edit_page_ids[$res['edit_page_id']]]['content'][$res['uid']] = array(
'name' => $res['name'],
'uid' => $res['uid'],
'online' => $res['online'],
@@ -516,12 +516,12 @@ class Login extends \CoreLibs\DB\IO
while ($res = $this->dbReturn($q)) {
// read edit access data fields and drop them into the unit access array
$q_sub ="SELECT name, value FROM edit_access_data WHERE enabled = 1 AND edit_access_id = ".$res['edit_access_id'];
$ea_data = array ();
$ea_data = array();
while ($res_sub = $this->dbReturn($q_sub)) {
$ea_data[$res_sub['name']] = $res_sub['value'];
}
// build master unit array
$unit_access[$res['edit_access_id']] = array (
$unit_access[$res['edit_access_id']] = array(
'id' => $res['edit_access_id'],
'acl_level' => $res['level'],
'acl_type' => $res['type'],
@@ -721,7 +721,7 @@ class Login extends \CoreLibs\DB\IO
}
}
// detail name/level set
$this->acl['unit_detail'][$ea_id] = array (
$this->acl['unit_detail'][$ea_id] = array(
'name' => $unit['name'],
'uid' => $unit['uid'],
'level' => $this->default_acl_list[$this->acl['unit'][$ea_id]]['name'],
@@ -906,10 +906,10 @@ class Login extends \CoreLibs\DB\IO
// if true, return error ajax
global $AJAX_PAGE;
if ($AJAX_PAGE === true) {
$data = array (
$data = array(
'status' => 'error',
'error_code' => $this->login_error,
'msg' => array (
'msg' => array(
'level' => 'error',
'str' => $this->l->__('Login necessary')
)
@@ -1020,7 +1020,7 @@ class Login extends \CoreLibs\DB\IO
*/
private function loginSetTemplates()
{
$strings = array (
$strings = array(
'HTML_TITLE' => $this->l->__('LOGIN'),
'TITLE' => $this->l->__('LOGIN'),
'USERNAME' => $this->l->__('Username'),
@@ -1031,7 +1031,7 @@ class Login extends \CoreLibs\DB\IO
'PASSWORD_CHANGE_BUTTON_VALUE' => $this->l->__('Change Password')
);
$error_msgs = array (
$error_msgs = array(
'100' => $this->l->__('Fatal Error: <b>[EUID] came in as GET/POST!</b>'), // actually obsolete
'1010' => $this->l->__('Fatal Error: <b>Login Failed - Wrong Username or Password</b>'), // user not found
'1011' => $this->l->__('Fatal Error: <b>Login Failed - Wrong Username or Password</b>'), // blowfish password wrong
@@ -1054,7 +1054,7 @@ class Login extends \CoreLibs\DB\IO
// if password change is okay
if ($this->password_change) {
$strings = array_merge($strings, array (
$strings = array_merge($strings, array(
'TITLE_PASSWORD_CHANGE' => 'Change Password for User',
'OLD_PASSWORD' => $this->l->__('Old Password'),
'NEW_PASSWORD' => $this->l->__('New Password'),
@@ -1081,7 +1081,7 @@ EOM;
if ($this->password_forgot) {
}
if (!$this->password_change && !$this->password_forgot) {
$strings = array_merge($strings, array (
$strings = array_merge($strings, array(
'JS_SHOW_HIDE' => '',
'PASSWORD_CHANGE_BUTTON' => '',
'PASSWORD_CHANGE_DIV' => ''
@@ -1186,7 +1186,7 @@ EOM;
} else {
$this->action = '';
}
$_data_binary = array (
$_data_binary = array(
'_SESSION' => $_SESSION,
'_GET' => $_GET,
'_POST' => $_POST,

View File

@@ -30,7 +30,7 @@ class Backend extends \CoreLibs\DB\IO
public $menu = array();
public $menu_show_flag = 0; // top menu flag (mostly string)
// action ids
public $action_list = array ('action', 'action_id', 'action_sub_id', 'action_yes', 'action_flag', 'action_menu', 'action_value', 'action_error', 'action_loaded');
public $action_list = array('action', 'action_id', 'action_sub_id', 'action_yes', 'action_flag', 'action_menu', 'action_value', 'action_error', 'action_loaded');
public $action;
public $action_id;
public $action_sub_id;
@@ -41,14 +41,14 @@ class Backend extends \CoreLibs\DB\IO
public $action_value;
public $action_error;
// ACL array variable if we want to set acl data from outisde
public $acl = array ();
public $acl = array();
public $default_acl;
// queue key
public $queue_key;
// the current active edit access id
public $edit_access_id;
// error/warning/info messages
public $messages = array ();
public $messages = array();
public $error = 0;
public $warning = 0;
public $info = 0;
@@ -195,9 +195,9 @@ class Backend extends \CoreLibs\DB\IO
// get the session pages array
$PAGES = $_SESSION['PAGES'];
if (!isset($PAGES) || !is_array($PAGES)) {
$PAGES = array ();
$PAGES = array();
}
$pages = array ();
$pages = array();
foreach ($PAGES as $PAGE_CUID => $PAGE_DATA) {
$pages[] = $PAGE_DATA;
}
@@ -340,12 +340,12 @@ class Backend extends \CoreLibs\DB\IO
* @param array $vars optional data for a possible printf formated msg
* @return void has no return
*/
public function adbMsg(string $level, string $msg, array $vars = array ()): void
public function adbMsg(string $level, string $msg, array $vars = array()): void
{
if (!preg_match("/^info|warning|error$/", $level)) {
$level = "info";
}
$this->messages[] = array (
$this->messages[] = array(
'msg' => vsprintf($this->l->__($msg), $vars),
'class' => $level
);

View File

@@ -112,7 +112,7 @@ class Basic
public $host_port;
// internal error reporting vars
protected $error_id; // error ID for errors in classes
protected $error_msg = array (); // the "connection" to the outside errors
protected $error_msg = array(); // the "connection" to the outside errors
// debug output prefix
public $error_msg_prefix = ''; // prefix to the error string (the class name)
// debug flags
@@ -152,14 +152,14 @@ class Basic
private $script_starttime;
// email valid checks
public $email_regex_check = array ();
public $mobile_email_type = array ();
public $mobile_email_type_short = array ();
public $email_regex_check = array();
public $mobile_email_type = array();
public $mobile_email_type_short = array();
public $email_regex; // regex var for email check
public $keitai_email_regex; // regex var for email check
// data path for files
public $data_path = array ();
public $data_path = array();
// error char for the char conver
public $mbErrorChar;
@@ -170,12 +170,12 @@ class Basic
public $cryptIterationCost = 7; // this is for staying backwards compatible with the old ones
public $cryptSaltSize = 22; // default 22 chars for blowfish, 2 for STD DES, 8 for MD5,
// new better password management
protected $password_options = array ();
protected $password_options = array();
// session name
private $session_name = '';
private $session_id = '';
// key generation
private $key_range = array ();
private $key_range = array();
private $one_key_length;
private $key_length;
private $max_key_length = 256; // max allowed length
@@ -233,7 +233,7 @@ class Basic
}
// set the paths matching to the valid file types
$this->data_path = array (
$this->data_path = array(
'P' => PICTURES,
'F' => FLASH,
'V' => VIDEOS,
@@ -299,7 +299,7 @@ class Basic
// set the regex for checking emails
$this->email_regex = "^[A-Za-z0-9!#$%&'*+\-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+\-\/=?^_`{|}~\.]{0,63}@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*\.([a-zA-Z]{2,}){1}$";
// this is for error check parts in where the email regex failed
$this->email_regex_check = array (
$this->email_regex_check = array(
1 => "@(.*)@(.*)", // double @
2 => "^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+-\/=?^_`{|}~\.]{0,63}@", // wrong part before @
3 => "@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,}){1}$", // wrong part after @
@@ -309,7 +309,7 @@ class Basic
7 => "@.*\.$" // ends with a dot, top level, domain missing
);
// the array with the mobile types that are valid
$this->mobile_email_type = array (
$this->mobile_email_type = array(
'.*@docomo\.ne\.jp$' => 'keitai_docomo',
'.*@([a-z0-9]{2}\.)?ezweb\.ne\.jp$' => 'keitai_kddi_ezweb', # correct are a[2-4], b2, c[1-9], e[2-9], h[2-4], t[1-9]
'.*@(ez[a-j]{1}\.)?ido\.ne\.jp$' => 'keitai_kddi_ido', # ez[a-j] or nothing
@@ -335,7 +335,7 @@ class Basic
'.*@emobile-s\.ne\.jp$' => 'keitai_willcom_emnet' # e-mobile, group will willcom
);
// short list for mobile email types
$this->mobile_email_type_short = array (
$this->mobile_email_type_short = array(
'keitai_docomo' => 'docomo',
'keitai_kddi_ezweb' => 'kddi',
'keitai_kddi' => 'kddi',
@@ -738,10 +738,10 @@ class Basic
* @param array $error_msg error array
* @return void has no return
*/
public function mergeErrors(array $error_msg = array ()): void
public function mergeErrors(array $error_msg = array()): void
{
if (!is_array($error_msg)) {
$error_msg = array ();
$error_msg = array();
}
foreach ($error_msg as $level => $msg) {
$this->error_msg[$level] .= $msg;
@@ -1171,7 +1171,7 @@ class Basic
*/
public static function arraySearchRecursive($needle, array $haystack, $key_lookin = ''): ?array
{
$path = array ();
$path = array();
if (!is_array($haystack)) {
$haystack = array();
}
@@ -1211,10 +1211,10 @@ class Basic
$path['level'] = 0;
}
if (!isset($path['work'])) {
$path['work'] = array ();
$path['work'] = array();
}
if (!is_array($haystack)) {
$haystack = array ();
$haystack = array();
}
// go through the array,
@@ -1245,7 +1245,7 @@ class Basic
/**
* array search simple. looks for key, value combination, if found, returns true
* @param array $array array (search in)
* @param array $array array(search in)
* @param string|int $key key (key to search in)
* @param string|int $value value (what to find)
* @return bool true on found, false on not found
@@ -1253,7 +1253,7 @@ class Basic
public static function arraySearchSimple(array $array, $key, $value): bool
{
if (!is_array($array)) {
$array = array ();
$array = array();
}
foreach ($array as $_key => $_value) {
// if value is an array, we search
@@ -1342,7 +1342,7 @@ class Basic
if (!is_array($haystack)) {
return false;
}
$found = array ();
$found = array();
foreach ($needle as $element) {
if (in_array($element, $haystack)) {
$found[] = $element;
@@ -1365,7 +1365,7 @@ class Basic
*/
public static function genAssocArray(array $db_array, $key, $value, bool $set_only = false): array
{
$ret_array = array ();
$ret_array = array();
// do this to only run count once
for ($i = 0, $iMax = count($db_array); $i < $iMax; $i ++) {
// if no key then we make an order reference
@@ -1395,7 +1395,7 @@ class Basic
{
trigger_error('Method '.__METHOD__.' is deprecated, use join()', E_USER_DEPRECATED);
if (!is_array($array)) {
$array = array ();
$array = array();
}
return join($connect_char, $array);
}
@@ -1408,7 +1408,7 @@ class Basic
*/
public static function flattenArray(array $array): array
{
$return = array ();
$return = array();
array_walk_recursive(
$array,
function ($value) use (&$return) {
@@ -1423,9 +1423,9 @@ class Basic
* @param array $array multidemnsional array to flatten
* @return array flattened keys array
*/
public static function flattenArrayKey(array $array/*, array $return = array ()*/): array
public static function flattenArrayKey(array $array/*, array $return = array()*/): array
{
$return = array ();
$return = array();
array_walk_recursive(
$array,
function ($value, $key) use (&$return) {
@@ -1438,14 +1438,14 @@ class Basic
/**
* searches for key -> value in an array tree and writes the value one level up
* this will remove this leaf will all other values
* @param array $array array (nested)
* @param array $array array(nested)
* @param string|int $search key to find that has no sub leaf and will be pushed up
* @return array modified, flattened array
*/
public static function arrayFlatForKey(array $array, $search): array
{
if (!is_array($array)) {
$array = array ();
$array = array();
}
foreach ($array as $key => $value) {
// if it is not an array do just nothing
@@ -1600,8 +1600,8 @@ class Basic
if (!preg_match("/(h|m|s|ms)/", (string)$timestamp)) {
$ms = 0;
list ($timestamp, $ms) = explode('.', (string)round($timestamp, 4));
$timegroups = array (86400, 3600, 60, 1);
$labels = array ('d', 'h', 'm', 's');
$timegroups = array(86400, 3600, 60, 1);
$labels = array('d', 'h', 'm', 's');
$time_string = '';
for ($i = 0, $iMax = count($timegroups); $i < $iMax; $i ++) {
$output = floor((float)$timestamp / $timegroups[$i]);
@@ -1636,8 +1636,8 @@ class Basic
$timestamp = 0;
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 ();
$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);
@@ -1785,7 +1785,7 @@ class Basic
public static function calcDaysInterval($start_date, $end_date, bool $return_named = false): array
{
// pos 0 all, pos 1 weekday, pos 2 weekend
$days = array ();
$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
@@ -1806,7 +1806,7 @@ class Basic
}
}
if ($return_named === true) {
return array (
return array(
'overall' => $days[0],
'weekday' => $days[1],
'weekend' => $days[2]
@@ -1830,7 +1830,7 @@ class Basic
public static function createThumbnail(string $pic, int $size_x, int $size_y, string $dummy = '', string $path = '', string $cache_source = '', bool $clear_cache = false)
{
// get image type flags
$image_types = array (
$image_types = array(
1 => 'gif',
2 => 'jpg',
3 => 'png'
@@ -1956,7 +1956,7 @@ class Basic
$compare = mb_convert_encoding($temp, $from_encoding, $to_encoding);
// if string does not match anymore we have a convert problem
if ($string != $compare) {
$failed = array ();
$failed = array();
// go through each character and find the ones that do not match
for ($i = 0, $iMax = mb_strlen($string, $from_encoding); $i < $iMax; $i ++) {
$char = mb_substr($string, $i, 1, $from_encoding);
@@ -2161,9 +2161,9 @@ class Basic
// a-z is 97,122
// 0-9 is 48,57
// ./ is 46,47 (so first lower limit is 46)
$min = array (46, 65, 97);
$max = array (57, 90, 122);
$chars = array ();
$min = array(46, 65, 97);
$max = array(57, 90, 122);
$chars = array();
for ($i = 0, $iMax = count($min); $i < $iMax; $i ++) {
for ($j = $min[$i]; $j <= $max[$i]; $j ++) {
$chars[] = chr($j);
@@ -2224,7 +2224,7 @@ class Basic
private function passwordInit(): void
{
// set default password cost: use default set automatically
$this->password_options = array (
$this->password_options = array(
// 'cost' => PASSWORD_BCRYPT_DEFAULT_COST
);
}
@@ -2325,7 +2325,7 @@ class Basic
if ($hex_prefix === true) {
$hex_color = '#';
}
foreach (array ('red', 'green', 'blue') as $color) {
foreach (array('red', 'green', 'blue') as $color) {
// if not valid, set to gray
if ($$color < 0 || $$color > 255) {
$$color = 125;

View File

@@ -6,7 +6,7 @@
* RELEASED LICENSE: GNU GPL 3
* SHORT DESC :RIPTION:
* DB Array IO Class:
* writes, reads or deletes a complete array (one data set) in/out a
* writes, reads or deletes a complete array(one data set) in/out a
* table from the connected DB.
* you don't have to write any SQL queries, worry over update/insert
*
@@ -189,7 +189,7 @@ class ArrayIO extends \CoreLibs\DB\IO
* set this as new table array too
* @return array returns the table array that was deleted
*/
public function dbDelete($table_array = array ())
public function dbDelete($table_array = array())
{
// is array and has values, override set and set new
if (is_array($table_array) && count($table_array)) {
@@ -248,7 +248,7 @@ class ArrayIO extends \CoreLibs\DB\IO
* @param array $table_array optional table array, overwrites internal set array
* @return array set table array with values
*/
public function dbRead($edit = false, $table_array = array ())
public function dbRead($edit = false, $table_array = array())
{
// if array give, overrules internal array
if (is_array($table_array) && count($table_array)) {
@@ -321,7 +321,7 @@ class ArrayIO extends \CoreLibs\DB\IO
* @param array $table_array optional table array, overwrites internal one
* @return array table array or null
*/
public function dbWrite($addslashes = false, $table_array = array ())
public function dbWrite($addslashes = false, $table_array = array())
{
if (is_array($table_array) && count($table_array)) {
$this->table_array = $table_array;

View File

@@ -41,7 +41,7 @@
* $class_name
* - the name of the class
* $class_version
* - the version as an array (major, minor, patchlvl, daypatch)
* - the version as an array(major, minor, patchlvl, daypatch)
* $class_last_changed
* - date (mysql format) for the last change
* $class_created
@@ -134,7 +134,7 @@
* - correctly escapes string for db insert
* $string db_boolean(string)
* - if the string value is 't' or 'f' it returns correct TRUE/FALSE for php
* $primary_key db_write_data($write_array, $not_write_array, $primary_key, $table, $data = array ())
* $primary_key db_write_data($write_array, $not_write_array, $primary_key, $table, $data = array())
* - writes into one table based on arrays of columns to write and not write, reads data from global vars or optional array
* $boolean db_set_schema(schema)
* - sets search path to a schema
@@ -147,7 +147,7 @@
* _db_error()
* - INTERNAL ONLY!! error that occured during execution
* $string _print_array($array)
* - returns string of an array (only for interal use)
* - returns string of an array(only for interal use)
* 1/0 _connect_to_db()
* - returns 1 for successfull DB connection or 0 for none
* 1/0 _check_query_for_select($query)
@@ -270,7 +270,7 @@ class IO extends \CoreLibs\Basic
public $cursor; // actual cursor (DBH)
public $num_rows; // how many rows have been found
public $num_fields; // how many fields has the query
public $field_names = array (); // array with the field names of the current query
public $field_names = array(); // array with the field names of the current query
public $insert_id; // last inserted ID
public $insert_id_ext; // extended insert ID (for data outside only primary key)
private $temp_sql;
@@ -288,14 +288,14 @@ class IO extends \CoreLibs\Basic
// endless loop protection
private $MAX_QUERY_CALL;
private $query_called = array ();
private $query_called = array();
// error string
protected $error_string = array ();
protected $error_string = array();
// prepared list
public $prepare_cursor = array ();
public $prepare_cursor = array();
// primary key per table list
// format is 'table' => 'pk_name'
public $pk_name_table = array ();
public $pk_name_table = array();
// internal primary key name, for cross calls in async
public $pk_name;
// if we use RETURNING in the INSERT call
@@ -314,7 +314,7 @@ class IO extends \CoreLibs\Basic
parent::__construct($set_control_flag);
// dummy init array for db config if not array
if (!is_array($db_config)) {
$db_config = array ();
$db_config = array();
}
// sets the names (for connect/reconnect)
$this->db_name = $db_config['db_name'] ?? '';
@@ -508,7 +508,7 @@ class IO extends \CoreLibs\Basic
{
$string = '';
if (!is_array($array)) {
$array = array ();
$array = array();
}
foreach ($array as $key => $value) {
$string .= $this->nbsp.'<b>'.$key.'</b> => ';
@@ -765,7 +765,7 @@ class IO extends \CoreLibs\Basic
// count the fields
$this->num_fields = $this->db_functions->__dbNumFields($this->cursor);
// set field names
$this->field_names = array ();
$this->field_names = array();
for ($i = 0; $i < $this->num_fields; $i ++) {
$this->field_names[] = $this->db_functions->__dbFieldName($this->cursor, $i);
}
@@ -781,8 +781,8 @@ class IO extends \CoreLibs\Basic
if (!$this->returning_id) {
$this->insert_id = $this->db_functions->__dbInsertId($this->query, $this->pk_name);
} else {
$this->insert_id = array ();
$this->insert_id_ext = array ();
$this->insert_id = array();
$this->insert_id_ext = array();
// echo "** PREPARE RETURNING FOR CURSOR: ".$this->cursor."<br>";
// 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
@@ -1033,7 +1033,7 @@ class IO extends \CoreLibs\Basic
$md5 = md5($query);
// pre declare array
if (!isset($this->cursor_ext[$md5])) {
$this->cursor_ext[$md5] = array (
$this->cursor_ext[$md5] = array(
'query' => '',
'pos' => 0,
'cursor' => 0,
@@ -1135,7 +1135,7 @@ class IO extends \CoreLibs\Basic
$return = false;
} else {
// unset return value ...
$return = array ();
$return = array();
for ($i = 0; $i < $this->cursor_ext[$md5]['num_fields']; $i ++) {
// create mixed return array
if ($assoc_only === false && isset($this->cursor_ext[$md5]['data'][$this->cursor_ext[$md5]['pos']][$i])) {
@@ -1171,7 +1171,7 @@ class IO extends \CoreLibs\Basic
$this->cursor_ext[$md5]['read_rows'] ++;
// if reset is <3 caching is done, else no
if ($reset < 3) {
$temp = array ();
$temp = array();
foreach ($return as $field_name => $data) {
$temp[$field_name] = $data;
}
@@ -1361,9 +1361,9 @@ class IO extends \CoreLibs\Basic
return false;
}
$cursor = $this->dbExec($query);
$rows = array ();
$rows = array();
while ($res = $this->dbFetchArray($cursor, $assoc_only)) {
$data = array ();
$data = array();
for ($i = 0; $i < $this->num_fields; $i ++) {
$data[$this->field_names[$i]] = $res[$this->field_names[$i]];
}
@@ -1547,8 +1547,8 @@ class IO extends \CoreLibs\Basic
if (!$this->prepare_cursor[$stm_name]['returning_id']) {
$this->insert_id = $this->db_functions->__dbInsertId($this->prepare_cursor[$stm_name]['query'], $this->prepare_cursor[$stm_name]['pk_name']);
} elseif ($result) {
$this->insert_id = array ();
$this->insert_id_ext = array ();
$this->insert_id = array();
$this->insert_id_ext = array();
// 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(
@@ -1738,18 +1738,18 @@ class IO extends \CoreLibs\Basic
* @param array $data data array to override _POST data
* @return int|bool primary key
*/
public function dbWriteData(array $write_array, array $not_write_array, $primary_key, string $table, $data = array ())
public function dbWriteData(array $write_array, array $not_write_array, $primary_key, string $table, $data = array())
{
if (!is_array($write_array)) {
$write_array = array ();
$write_array = array();
}
if (!is_array($not_write_array)) {
$not_write_array = array ();
$not_write_array = array();
}
if (is_array($table)) {
return false;
}
$not_write_update_array = array ();
$not_write_update_array = array();
return $this->dbWriteDataExt($write_array, $primary_key, $table, $not_write_array, $not_write_update_array, $data);
}
@@ -1757,7 +1757,7 @@ class IO extends \CoreLibs\Basic
* writes into one table based on array of table columns
* PARAM INFO: $primary key
* this can be a plain string/int and will be internal transformed into the array form
* or it takes the array form of array (row => column, value => pk value)
* or it takes the array form of array(row => column, value => pk value)
* @param array $write_array list of elements to write
* @param int|string|array $primary_key primary key string or array set
* @param string $table name for the target table
@@ -1770,12 +1770,12 @@ class IO extends \CoreLibs\Basic
array $write_array,
$primary_key,
string $table,
array $not_write_array = array (),
array $not_write_update_array = array (),
array $data = array ()
array $not_write_array = array(),
array $not_write_update_array = array(),
array $data = array()
) {
if (!is_array($primary_key)) {
$primary_key = array (
$primary_key = array(
'row' => $table.'_id',
'value' => $primary_key
);
@@ -1895,7 +1895,7 @@ class IO extends \CoreLibs\Basic
*/
public function dbArrayParse(string $text): array
{
$output = array ();
$output = array();
return $this->db_functions->__dbArrayParse($text, $output);
}

View File

@@ -444,7 +444,7 @@ class PgSQL
{
if (false === $limit) {
$limit = strlen($text) - 1;
$output = array ();
$output = array();
}
if ('{}' != $text) {
do {

View File

@@ -50,7 +50,7 @@ class GetTextReader
private $total = 0; // total string count
private $table_originals = null; // table for original strings (offsets)
private $table_translations = null; // table for translated strings (offsets)
private $cache_translations = array (); // original -> translation mapping
private $cache_translations = array(); // original -> translation mapping
/* Methods */
@@ -161,7 +161,7 @@ class GetTextReader
}
if ($this->enable_cache) {
$this->cache_translations = array ();
$this->cache_translations = array();
/* read all strings in the cache */
for ($i = 0; $i < $this->total; $i++) {
$this->STREAM->seekto($this->table_originals[$i * 2 + 2]);

View File

@@ -35,7 +35,7 @@
* 'order_by' => 'order bY' string for drop_down_db(_input) if no query given but fields set
* 'query' => for drop_down_db/array if no outer query given
* 'preset' => value to preset when array is unset (available for all types)
* 'element_list' => array ( 'true', 'false') - MUST (!) be set for binary
* 'element_list' => array( 'true', 'false') - MUST (!) be set for binary
* 'length' => 'nr' - only available for 'text' (maxlength)
* 'size' => 'nr' - only available for 'text' (size of input field)
* 'rows' => 'nr' - only available for 'textarea'
@@ -69,7 +69,7 @@
* array(
* 'name' => 'name_of_col_in_query' - col from the query that should be shown
* 'before_value' => 'text' - if set this text will be put in FRONT of the value from the col
* 'binary' => array ('true','false') - for 1/0 fields in DB changes it int human readable format
* 'binary' => array('true','false') - for 1/0 fields in DB changes it int human readable format
* ),
* ...
* ),
@@ -215,7 +215,7 @@ namespace CoreLibs\Output\Form;
class Generate extends \CoreLibs\DB\Extended\ArrayIO
{
// rest
public $field_array = array (); // for the load statetment describes which elements from the load query should be shown and i which format
public $field_array = array(); // for the load statetment describes which elements from the load query should be shown and i which format
public $load_query; // the query needed for loading a data set (one row in the table)
public $col_name; // the name of the columen (before _<type>) [used for order button]
public $yes; // the yes flag that triggers the template to show ALL and not only new/load
@@ -224,9 +224,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
public $warning; // warning flag, for information (saved, loaded, etc)
public $archive_pk_name; // the pk name for the load select form
private $int_pk_name; // primary key, only internal usage
public $reference_array = array (); // reference arrays -> stored in $this->reference_array[$table_name]=>array();
public $reference_array = array(); // reference arrays -> stored in $this->reference_array[$table_name]=>array();
public $element_list; // element list for elements next to each other as a special sub group
public $table_array = array ();
public $table_array = array();
public $my_page_name; // the name of the page without .php extension
public $mobile_phone = false;
// buttons and checkboxes
@@ -246,7 +246,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
public $l;
// now some default error msgs (english)
public $language_array = array ();
public $language_array = array();
/**
* construct form generator
@@ -277,8 +277,8 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$config_array = ${$this->my_page_name};
} else {
// dummy created
$config_array = array (
'table_array' => array (),
$config_array = array(
'table_array' => array(),
'table_name' => '',
);
}
@@ -326,7 +326,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if (!isset($config_array['security_level']) || !is_array($config_array['security_level']) ||
(is_array($config_array['security_level']) && count($config_array['security_level']) < 4)
) {
$config_array['security_level'] = array (
$config_array['security_level'] = array(
'load' => 100,
'new' => 100,
'save' => 100,
@@ -355,7 +355,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
public function formDumpTableArray()
{
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
$string = '<b>TABLE ARRAY DUMP:</b> '.$this->table_name.'<br>';
@@ -376,7 +376,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
public function formGetColNameFromKey(string $want_key, ?string $key_value = null): ?string
{
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -400,7 +400,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
{
$key_array = array();
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -427,7 +427,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if ($this->warning) {
$class = 'warning';
}
return array (
return array(
'msg' => $this->msg,
'width' => $this->table_width,
'class' => $class
@@ -437,10 +437,10 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// next for functions are pre_test fkts for easier default new,load, etc handling
/**
* default load procedure
* @param int $archive_id archive id to load
* @return void has no return
* @param string $archive_id archive id to load
* @return void has no return
*/
public function formProcedureLoad(int $archive_id): void
public function formProcedureLoad(string $archive_id): void
{
if ($this->archive && $archive_id && $this->base_acl_level >= $this->security_level['load']) {
$this->formLoadTableArray($archive_id);
@@ -520,7 +520,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
!$this->error
) {
if (!is_array($element_list)) {
$element_list = array ();
$element_list = array();
}
for ($i = 0, $i_max = count($element_list); $i < $i_max; $i ++) {
// $this->debug('form_error', 'Array: '.is_array($this->element_list[$element_list[$i]]['read_data']).' | '.$this->element_list[$element_list[$i]]['delete']);
@@ -551,7 +551,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
!$this->element_list[$element_list[$i]]['delete']
) {
if (!isset($_POST[$id])) {
$_POST[$id] = array ();
$_POST[$id] = array();
}
for ($j = 0, $j_max = count($_POST[$id]); $j < $j_max; $j ++) {
// if it is not activated
@@ -594,8 +594,8 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
{
$pk_selected = '';
$t_pk_name = '';
$pk_names = array ();
$pk_ids = array ();
$pk_names = array();
$pk_ids = array();
// when security level is okay ...
if ($this->base_acl_level >= $this->security_level['load']) {
$t_pk_name = $this->archive_pk_name;
@@ -626,7 +626,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$pk_names[] = $t_string;
}
} // show it at all
return array (
return array(
't_pk_name' => $t_pk_name,
'pk_ids' => $pk_ids,
'pk_names' => $pk_names,
@@ -655,7 +655,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$new_name = $this->l->__('New');
}
} // security level okay
return array (
return array(
'new_name' => $new_name,
'show_checkbox' => $show_checkbox
);
@@ -742,8 +742,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$data['value'][] = $i;
$data['output'][] = $this->table_array[$element_name]['element_list'][$i];
$data['name'] = $element_name;
if (($i && isset($this->table_array[$element_name]['value'])) ||
(!$i && !isset($this->table_array[$element_name]['value']))
if (isset($this->table_array[$element_name]['value']) &&
(($i && $this->table_array[$element_name]['value']) ||
(!$i && !$this->table_array[$element_name]['value']))
) {
$data['checked'] = $this->table_array[$element_name]['value'];
}
@@ -927,7 +928,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
public function formErrorCheck(): void
{
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -1068,7 +1069,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
}
} else {
$this->reference_array = array ();
$this->reference_array = array();
}
// $this->debug('edit_error', 'QS: <pre>'.print_r($_POST, true).'</pre>');
if (is_array($this->element_list)) {
@@ -1076,7 +1077,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// if mandatory, check that at least on pk exists or if at least the mandatory field is filled
foreach ($this->element_list as $table_name => $reference_array) {
if (!is_array($reference_array)) {
$reference_array = array ();
$reference_array = array();
}
// set pk/fk id for this
$_pk_name = '';
@@ -1222,7 +1223,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
{
unset($this->pk_id);
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -1235,7 +1236,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
if (is_array($this->reference_array)) {
if (!is_array($this->reference_array)) {
$this->reference_array = array ();
$this->reference_array = array();
}
reset($this->reference_array);
foreach ($this->reference_array as $key => $value) {
@@ -1248,10 +1249,10 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
/**
* load a table & reference
* @param int|null $pk_id overrule pk_id
* @return void has no return
* @param string|null $pk_id overrule pk_id
* @return void has no return
*/
public function formLoadTableArray(?int $pk_id = null): void
public function formLoadTableArray(?string $pk_id = null): void
{
if ($pk_id) {
$this->pk_id = $pk_id;
@@ -1260,7 +1261,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// reset all temp fields
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -1270,7 +1271,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if (is_array($this->reference_array)) {
// load each reference_table
if (!is_array($this->reference_array)) {
$this->reference_array = array ();
$this->reference_array = array();
}
reset($this->reference_array);
foreach ($this->reference_array as $key => $value) {
@@ -1297,7 +1298,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// for drop_down_db_input check if text field is filled and if, if not yet in db ...
// and upload files
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -1408,7 +1409,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// write reference array(s) if necessary
if (is_array($this->reference_array)) {
if (!is_array($this->reference_array)) {
$this->reference_array = array ();
$this->reference_array = array();
}
reset($this->reference_array);
foreach ($this->reference_array as $reference_array) {
@@ -1423,18 +1424,18 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
} // if reference arrays
// write element list
if (isset($this->element_list) && is_array($this->element_list)) {
$type = array ();
$type = array();
reset($this->element_list);
foreach ($this->element_list as $table_name => $reference_array) {
// init arrays
$q_begin = array ();
$q_middle = array ();
$q_end = array ();
$q_names = array ();
$q_data = array ();
$q_values = array ();
$no_write = array ();
$block_write = array ();
$q_begin = array();
$q_middle = array();
$q_end = array();
$q_names = array();
$q_data = array();
$q_values = array();
$no_write = array();
$block_write = array();
// get the number of keys from the elements array
$keys = array_keys($reference_array['elements']);
// element prefix name
@@ -1596,7 +1597,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// remove any reference arrays
if (is_array($this->reference_array)) {
if (!is_array($this->reference_array)) {
$this->reference_array = array ();
$this->reference_array = array();
}
reset($this->reference_array);
foreach ($this->reference_array as $reference_array) {
@@ -1607,7 +1608,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// remove any element list references
if (is_array($this->element_list)) {
if (!is_array($this->element_list)) {
$this->element_list = array ();
$this->element_list = array();
}
reset($this->element_list);
foreach ($this->element_list as $table_name => $data_array) {
@@ -1617,7 +1618,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
// unlink ALL files
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -1635,11 +1636,11 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// PARAMS: $hidden_array
// RETURN: the input fields (html)
// DESC : creates HTML hidden input fields out of an hash array
public function formCreateHiddenFields($hidden_array = array ())
public function formCreateHiddenFields($hidden_array = array())
{
$hidden = array ();
$hidden = array();
if (!is_array($this->table_array)) {
$this->table_array = array ();
$this->table_array = array();
}
reset($this->table_array);
foreach ($this->table_array as $key => $value) {
@@ -1728,13 +1729,13 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// build the select part
if (!isset($this->element_list[$table_name]['elements']) || !is_array($this->element_list[$table_name]['elements'])) {
$this->element_list[$table_name]['elements'] = array ();
$this->element_list[$table_name]['elements'] = array();
}
reset($this->element_list[$table_name]['elements']);
// generic data read in (counts for all rows)
// visible list data output
$q_select = array ();
$proto = array ();
$q_select = array();
$proto = array();
foreach ($this->element_list[$table_name]['elements'] as $el_name => $data_array) {
// $this->debug('CFG', 'El: '.$el_name.' -> '.$this->printAr($data_array));
// if the element name matches the read array, then set the table as a name prefix
@@ -1798,7 +1799,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if (isset($this->element_list[$table_name]['read_data'])) {
// we need a second one for the query build only
// prefix all elements with the $table name
$_q_select = array ();
$_q_select = array();
foreach ($q_select as $_pos => $element) {
$_q_select[$_pos] = $table_name.'.'.$element;
}
@@ -1844,7 +1845,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
$pos = 0; // position in while for overwrite if needed
// read out the list and add the selected data if needed
while ($res = $this->dbReturn($q)) {
$_data = array ();
$_data = array();
$prfx = $data['prefix']; // short
// go through each res
for ($i = 0, $i_max = count($q_select); $i < $i_max; $i ++) {
@@ -1895,7 +1896,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
// set if we need more open entries or if we do not have any entries yet
if (($missing_empty_count < $this->element_list[$table_name]['max_empty']) || $element_count == 0) {
for ($pos = $element_count, $pos_max = $this->element_list[$table_name]['max_empty'] + $element_count; $pos <= $pos_max; $pos ++) {
$_data = array ();
$_data = array();
// the fields that need to be filled are in data->type array:
// pk fields are unfilled
// fk fields are filled with the fk_id 'int_pk_name' value
@@ -1911,7 +1912,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
}
$data['content'][] = $_data;
$data['pos'][] = array (0 => $pos); // this is for the checkboxes
$data['pos'][] = array(0 => $pos); // this is for the checkboxes
// $this->debug('CFG ELEMENT LIST FILL', 'Pos: '.$pos.'/'.$pos_max.', Content: '.count($data['content']).', Pos: '.count($data['pos']));
}
}
@@ -1921,13 +1922,13 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
if (isset($data['delete_name']) && !empty($data['delete_name'])) {
$data['content'][] = $proto;
// we also need the pos add or we through an error in smarty
$data['pos'][] = array (
$data['pos'][] = array(
0 => isset($data['pos']) ? count($data['pos']) : 0
);
}
// $this->debug('CFG ELEMENT LIST FILL', 'Data array: '.$this->printAr($data));
$type = 'element_list';
return array (
return array(
'output_name' => $output_name,
'type' => $type,
'color' => 'edit_fgcolor',

View File

@@ -157,7 +157,7 @@ class ProgressBar
$pixel = $bar - ($this->pedding * 2);
}
$position = array ();
$position = array();
switch ($this->direction) {
case 'right':
$position['left'] = $this->pedding;
@@ -212,7 +212,7 @@ class ProgressBar
*/
public function setFrame(int $width = 0, int $height = 0): void
{
$this->frame = array (
$this->frame = array(
'show' => true,
'left' => 20,
'top' => 35,

View File

@@ -32,7 +32,7 @@ function MyErrorHandler($type, $message, $file, $line, $context)
return;
}
// ERROR LEVEL
$error_level = array (
$error_level = array(
1 => 'E_ERROR',
2 => 'E_WARNING',
4 => 'E_PARSE',