Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
605ea06bf0 | ||
|
|
9ec19f5940 | ||
|
|
a27e4603a8 | ||
|
|
54b7af348b | ||
|
|
c5d624a318 | ||
|
|
47ffec1fd4 | ||
|
|
72c6844e74 | ||
|
|
d0753512a3 | ||
|
|
d0de3821f8 | ||
|
|
0d89eea1af | ||
|
|
d87033d57d | ||
|
|
19a44d9340 | ||
|
|
436025dd22 | ||
|
|
19458a2eba | ||
|
|
aa9e985120 | ||
|
|
a0d5e18832 | ||
|
|
6c1c528e2e |
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;
|
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 ('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 ('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 ('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 ('Translator', 30, 'mod_trans');
|
||||||
INSERT INTO edit_access_right (name, level, type) VALUES ('Modify', 40, 'mod');
|
INSERT INTO edit_access_right (name, level, type) VALUES ('Modify', 40, 'mod');
|
||||||
|
|||||||
@@ -14,5 +14,6 @@ CREATE TABLE edit_access (
|
|||||||
uid VARCHAR,
|
uid VARCHAR,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
protected INT,
|
protected INT,
|
||||||
deleted SMALLINT DEFAULT 0
|
deleted SMALLINT DEFAULT 0,
|
||||||
|
additional_acl JSONB
|
||||||
) INHERITS (edit_generic) WITHOUT OIDS;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ CREATE TABLE edit_group (
|
|||||||
edit_group_id SERIAL PRIMARY KEY,
|
edit_group_id SERIAL PRIMARY KEY,
|
||||||
name VARCHAR,
|
name VARCHAR,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
|
deleted SMALLINT DEFAULT 0,
|
||||||
edit_scheme_id INT,
|
edit_scheme_id INT,
|
||||||
edit_access_right_id INT NOT NULL,
|
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_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
|
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;
|
) INHERITS (edit_generic) WITHOUT OIDS;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ CREATE TABLE edit_user (
|
|||||||
first_name_furigana VARCHAR,
|
first_name_furigana VARCHAR,
|
||||||
last_name_furigana VARCHAR,
|
last_name_furigana VARCHAR,
|
||||||
enabled SMALLINT NOT NULL DEFAULT 0,
|
enabled SMALLINT NOT NULL DEFAULT 0,
|
||||||
|
deleted SMALLINT NOT NULL DEFAULT 0,
|
||||||
debug SMALLINT NOT NULL DEFAULT 0,
|
debug SMALLINT NOT NULL DEFAULT 0,
|
||||||
db_debug SMALLINT NOT NULL DEFAULT 0,
|
db_debug SMALLINT NOT NULL DEFAULT 0,
|
||||||
email VARCHAR,
|
email VARCHAR,
|
||||||
@@ -32,6 +33,7 @@ CREATE TABLE edit_user (
|
|||||||
locked SMALLINT DEFAULT 0,
|
locked SMALLINT DEFAULT 0,
|
||||||
password_change_date TIMESTAMP WITHOUT TIME ZONE, -- only when password is first set or changed
|
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
|
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 (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_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,
|
FOREIGN KEY (edit_group_id) REFERENCES edit_group (edit_group_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ $CSS_NAME = 'smart_test.css';
|
|||||||
$USE_PROTOTYPE = false;
|
$USE_PROTOTYPE = false;
|
||||||
$USE_JQUERY = true;
|
$USE_JQUERY = true;
|
||||||
if ($USE_PROTOTYPE) {
|
if ($USE_PROTOTYPE) {
|
||||||
$EDIT_JAVASCRIPT = 'edit.pt.js';
|
$ADMIN_JAVASCRIPT = 'edit.pt.js';
|
||||||
$JS_NAME = 'prototype.test.js';
|
$JS_NAME = 'prototype.test.js';
|
||||||
} else if ($USE_JQUERY) {
|
} elseif ($USE_JQUERY) {
|
||||||
$EDIT_JAVASCRIPT = 'edit.jq.js';
|
$ADMIN_JAVASCRIPT = 'edit.jq.js';
|
||||||
$JS_NAME = 'jquery.test.js';
|
$JS_NAME = 'jquery.test.js';
|
||||||
}
|
}
|
||||||
$PAGE_WIDTH = "100%";
|
$PAGE_WIDTH = "100%";
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ DEFINE('LIBS', 'lib'.DS);
|
|||||||
DEFINE('CONFIGS', 'configs'.DS);
|
DEFINE('CONFIGS', 'configs'.DS);
|
||||||
// includes (strings, arrays for static, etc)
|
// includes (strings, arrays for static, etc)
|
||||||
DEFINE('INCLUDES', 'includes'.DS);
|
DEFINE('INCLUDES', 'includes'.DS);
|
||||||
|
// data folder (mostly in includes)
|
||||||
|
DEFINE('DATA', 'data'.DS);
|
||||||
// layout base path
|
// layout base path
|
||||||
DEFINE('LAYOUT', 'layout'.DS);
|
DEFINE('LAYOUT', 'layout'.DS);
|
||||||
// pic-root (compatible to CMS)
|
// pic-root (compatible to CMS)
|
||||||
@@ -130,6 +132,10 @@ DEFINE('SESSION_NAME', 'SESSION_NAME'.SERVER_NAME_HASH);
|
|||||||
// SET_SESSION_NAME should be set in the header if a special session name is needed
|
// SET_SESSION_NAME should be set in the header if a special session name is needed
|
||||||
// DEFINE('SET_SESSION_NAME', SESSION_NAME);
|
// DEFINE('SET_SESSION_NAME', SESSION_NAME);
|
||||||
|
|
||||||
|
/************* CACHE/COMPILE IDS *************/
|
||||||
|
DEFINE('CACHE_ID', 'CACHE_'.SERVER_NAME_HASH);
|
||||||
|
DEFINE('COMPILE_ID', 'COMPILE_'.SERVER_NAME_HASH);
|
||||||
|
|
||||||
/************* LANGUAGE / ENCODING *******/
|
/************* LANGUAGE / ENCODING *******/
|
||||||
DEFINE('DEFAULT_LANG', 'en_utf8');
|
DEFINE('DEFAULT_LANG', 'en_utf8');
|
||||||
// default web page encoding setting
|
// default web page encoding setting
|
||||||
@@ -153,13 +159,6 @@ DEFINE('DEV_SCHEMA', 'public');
|
|||||||
DEFINE('TEST_SCHEMA', 'public');
|
DEFINE('TEST_SCHEMA', 'public');
|
||||||
DEFINE('LIVE_SCHEMA', 'public');
|
DEFINE('LIVE_SCHEMA', 'public');
|
||||||
|
|
||||||
/************* OTHER PATHS *****************/
|
|
||||||
// File and Folder paths
|
|
||||||
// ID is TARGET (first array element)
|
|
||||||
// $PATHS['test']['csv_path'] = '';
|
|
||||||
// $PATHS['test']['perl_bin'] = '';
|
|
||||||
// $PATHS['test']['redirect_url'] = '';
|
|
||||||
|
|
||||||
/************* DB ACCESS *****************/
|
/************* DB ACCESS *****************/
|
||||||
if (file_exists(BASE.CONFIGS.'config.db.inc')) {
|
if (file_exists(BASE.CONFIGS.'config.db.inc')) {
|
||||||
require BASE.CONFIGS.'config.db.inc';
|
require BASE.CONFIGS.'config.db.inc';
|
||||||
@@ -168,6 +167,10 @@ if (file_exists(BASE.CONFIGS.'config.db.inc')) {
|
|||||||
if (file_exists(BASE.CONFIGS.'config.host.inc')) {
|
if (file_exists(BASE.CONFIGS.'config.host.inc')) {
|
||||||
require BASE.CONFIGS.'config.host.inc';
|
require BASE.CONFIGS.'config.host.inc';
|
||||||
}
|
}
|
||||||
|
/************* OTHER PATHS *****************/
|
||||||
|
if (file_exists(BASE.CONFIGS.'config.path.inc')) {
|
||||||
|
require BASE.CONFIGS.'config.path.inc';
|
||||||
|
}
|
||||||
|
|
||||||
// set the USE_DATABASE var, if there is nothing set, we assume TRUE
|
// set the USE_DATABASE var, if there is nothing set, we assume TRUE
|
||||||
$USE_DATABASE = defined('USE_DATABASE') ? USE_DATABASE : true;
|
$USE_DATABASE = defined('USE_DATABASE') ? USE_DATABASE : true;
|
||||||
@@ -213,14 +216,13 @@ DEFINE('SITE_LANG', $SITE_LANG[$HOST_NAME]);
|
|||||||
DEFINE('SHOW_ALL_ERRORS', true); // show all errors if debug_all & show_error_handling are enabled
|
DEFINE('SHOW_ALL_ERRORS', true); // show all errors if debug_all & show_error_handling are enabled
|
||||||
|
|
||||||
/************* GENERAL PAGE TITLE ********/
|
/************* GENERAL PAGE TITLE ********/
|
||||||
$G_TITLE = '<OVERALL PAGE TITLE>';
|
DEFINE('G_TITLE', '<OVERALL FALLBACK PAGE TITLE>');
|
||||||
|
|
||||||
/************ STYLE SHEETS / JS **********/
|
/************ STYLE SHEETS / JS **********/
|
||||||
$EDIT_STYLESHEET = 'edit.css';
|
DEFINE('ADMIN_STYLESHEET', 'edit.css');
|
||||||
$EDIT_JAVASCRIPT = 'edit.js';
|
DEFINE('ADMIN_JAVASCRIPT', 'edit.js');
|
||||||
|
DEFINE('STYLESHEET', 'frontend.css');
|
||||||
$STYLESHEET = 'frontend.css';
|
DEFINE('JAVASCRIPT', 'frontend.js');
|
||||||
$JAVASCRIPT = 'frontend.js';
|
|
||||||
|
|
||||||
// anything optional
|
// anything optional
|
||||||
/************* INTERNAL ******************/
|
/************* INTERNAL ******************/
|
||||||
|
|||||||
17
www/configs/config.path.inc
Executable file
17
www/configs/config.path.inc
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
/********************************************************************
|
||||||
|
* AUTHOR: Clemens Schwaighofer
|
||||||
|
* CREATED: 2018/10/11
|
||||||
|
* SHORT DESCRIPTION:
|
||||||
|
* configuration file for core path settings
|
||||||
|
* CSV target paths, and other download access URLS or paths needed
|
||||||
|
* HISTORY:
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
// File and Folder paths
|
||||||
|
// ID is TARGET (first array element)
|
||||||
|
// $PATHS['test']['csv_path'] = '';
|
||||||
|
// $PATHS['test']['perl_bin'] = '';
|
||||||
|
// $PATHS['test']['redirect_url'] = '';
|
||||||
|
|
||||||
|
// __END__
|
||||||
@@ -33,12 +33,14 @@ if (!isset($encoding)) {
|
|||||||
if (session_id() && $_SESSION['DEFAULT_LANG']) {
|
if (session_id() && $_SESSION['DEFAULT_LANG']) {
|
||||||
$lang = $_SESSION['DEFAULT_LANG'];
|
$lang = $_SESSION['DEFAULT_LANG'];
|
||||||
} elseif (!$lang) {
|
} elseif (!$lang) {
|
||||||
$lang = DEFAULT_LANG;
|
$lang = defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG;
|
||||||
}
|
}
|
||||||
// end the stop of the output flow, but only if we didn't request a csv file download
|
// end the stop of the output flow, but only if we didn't request a csv file download
|
||||||
if (array_key_exists('action', $_POST) && $_POST['action'] != 'download_csv') {
|
if (array_key_exists('action', $_POST) && $_POST['action'] != 'download_csv') {
|
||||||
header("Content-type: text/html; charset=".$encoding);
|
header("Content-type: text/html; charset=".$encoding);
|
||||||
ob_end_flush();
|
}
|
||||||
|
if ($AJAX_PAGE && !$ZIP_STREAM) {
|
||||||
|
header("Content-Type: application/json; charset=UTF-8");
|
||||||
}
|
}
|
||||||
//------------------------------ basic variable settings start
|
//------------------------------ basic variable settings start
|
||||||
|
|
||||||
@@ -59,6 +61,8 @@ $cms->menu_show_flag = 'main';
|
|||||||
$cms->dbInfo();
|
$cms->dbInfo();
|
||||||
// set acl
|
// set acl
|
||||||
$cms->acl = $login->acl;
|
$cms->acl = $login->acl;
|
||||||
|
// flush
|
||||||
|
ob_end_flush();
|
||||||
//------------------------------ class init end
|
//------------------------------ class init end
|
||||||
|
|
||||||
//------------------------------ logging start
|
//------------------------------ logging start
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ if (isset($_SESSION['DEFAULT_LANG'])) {
|
|||||||
$lang_short = substr($lang, 0, 2);
|
$lang_short = substr($lang, 0, 2);
|
||||||
|
|
||||||
// set include & template names
|
// set include & template names
|
||||||
$CONTENT_INCLUDE = str_replace(".php", ".tpl", $cms->page_name);
|
$PAGE_FILE_NAME = str_replace(".php", "", $cms->page_name);
|
||||||
|
// set include & template names
|
||||||
|
if (!isset($CONTENT_INCLUDE)) {
|
||||||
|
$CONTENT_INCLUDE = $PAGE_FILE_NAME.'.tpl';
|
||||||
|
}
|
||||||
$FORM_NAME = !isset($FORM_NAME) || !$FORM_NAME ? str_replace(".php", "", $cms->page_name) : $FORM_NAME;
|
$FORM_NAME = !isset($FORM_NAME) || !$FORM_NAME ? str_replace(".php", "", $cms->page_name) : $FORM_NAME;
|
||||||
// set local page title
|
// set local page title
|
||||||
$L_TITLE = ucfirst(str_replace('_', ' ', $cms->getPageName(1))).' - '.$G_TITLE;
|
$L_TITLE = ucfirst(str_replace('_', ' ', $cms->getPageName(1))).' - '.$G_TITLE;
|
||||||
@@ -44,6 +48,9 @@ $cms->CSS_TEMPLATE_NAME = str_replace(".tpl", ".css", $CONTENT_INCLUDE);
|
|||||||
$cms->CSS_SPECIAL_TEMPLATE_NAME = $CSS_NAME;
|
$cms->CSS_SPECIAL_TEMPLATE_NAME = $CSS_NAME;
|
||||||
// special JS file
|
// special JS file
|
||||||
$cms->JS_SPECIAL_TEMPLATE_NAME = $JS_NAME;
|
$cms->JS_SPECIAL_TEMPLATE_NAME = $JS_NAME;
|
||||||
|
// compile & cache id
|
||||||
|
$cms->CACHE_ID = isset($CACHE_ID) ? $CACHE_ID : CACHE_ID;
|
||||||
|
$cms->COMPILE_ID = isset($COMPILE_ID) ? $COMPILE_ID : CACHE_ID;
|
||||||
|
|
||||||
// set basic template path (tmp)
|
// set basic template path (tmp)
|
||||||
$cms->includes = BASE.INCLUDES; // no longer in templates, only global
|
$cms->includes = BASE.INCLUDES; // no longer in templates, only global
|
||||||
@@ -52,7 +59,7 @@ if ($smarty) {
|
|||||||
$smarty->setTemplateDir($cms->template_path);
|
$smarty->setTemplateDir($cms->template_path);
|
||||||
}
|
}
|
||||||
if (isset($LANGUAGE_FOLDER)) {
|
if (isset($LANGUAGE_FOLDER)) {
|
||||||
$cms->kang_dir = $LANGUAGE_FOLDER;
|
$cms->lang_dir = $LANGUAGE_FOLDER;
|
||||||
} else {
|
} else {
|
||||||
$cms->lang_dir = BASE.INCLUDES.LANG.CONTENT_PATH; // no outside
|
$cms->lang_dir = BASE.INCLUDES.LANG.CONTENT_PATH; // no outside
|
||||||
}
|
}
|
||||||
@@ -64,14 +71,51 @@ $cms->cache_pictures_root = ROOT.$cms->cache_pictures;
|
|||||||
if (!is_dir($cms->cache_pictures_root)) {
|
if (!is_dir($cms->cache_pictures_root)) {
|
||||||
mkdir($cms->cache_pictures_root);
|
mkdir($cms->cache_pictures_root);
|
||||||
}
|
}
|
||||||
|
// check if we have an external file with the template name
|
||||||
// check if template names exist
|
if (file_exists($cms->includes.$cms->INC_TEMPLATE_NAME) &&
|
||||||
if (!file_exists($smarty->getTemplateDir()[0].DS.$MASTER_TEMPLATE_NAME)) {
|
is_file($cms->includes.$cms->INC_TEMPLATE_NAME)
|
||||||
// abort if master template could not be found
|
) {
|
||||||
exit('MASTER TEMPLATE: '.$MASTER_TEMPLATE_NAME.' could not be found');
|
include($cms->includes.$cms->INC_TEMPLATE_NAME);
|
||||||
}
|
}
|
||||||
if (isset($TEMPLATE_NAME) && !file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_NAME)) {
|
// only CSS/JS/etc include stuff if we have non AJAX page
|
||||||
exit('INCLUDE TEMPLATE: '.$TEMPLATE_NAME.' could not be found');
|
if (!$AJAX_PAGE) {
|
||||||
|
// check for template include
|
||||||
|
if (isset($USE_INCLUDE_TEMPLATE) && $USE_INCLUDE_TEMPLATE === true && !isset($TEMPLATE_NAME)) {
|
||||||
|
$TEMPLATE_NAME = $CONTENT_INCLUDE;
|
||||||
|
// add to cache & compile id
|
||||||
|
$cms->COMPILE_ID .= '_'.$TEMPLATE_NAME;
|
||||||
|
$cms->CACHE_ID .= '_'.$TEMPLATE_NAME;
|
||||||
|
}
|
||||||
|
// additional per page Javascript include
|
||||||
|
$cms->JS_INCLUDE = '';
|
||||||
|
if (file_exists($cms->javascript.$cms->JS_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_TEMPLATE_NAME)) {
|
||||||
|
$cms->JS_INCLUDE = $cms->javascript.$cms->JS_TEMPLATE_NAME;
|
||||||
|
}
|
||||||
|
// per page css file
|
||||||
|
$cms->CSS_INCLUDE = '';
|
||||||
|
if (file_exists($cms->css.$cms->CSS_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_TEMPLATE_NAME)) {
|
||||||
|
$cms->CSS_INCLUDE = $cms->css.$cms->CSS_TEMPLATE_NAME;
|
||||||
|
}
|
||||||
|
// optional CSS file
|
||||||
|
$cms->CSS_SPECIAL_INCLUDE = '';
|
||||||
|
if (file_exists($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME)) {
|
||||||
|
$cms->CSS_SPECIAL_INCLUDE = $cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME;
|
||||||
|
}
|
||||||
|
// optional JS file
|
||||||
|
$cms->JS_SPECIAL_INCLUDE = '';
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the lang folder is different to the default one
|
// if the lang folder is different to the default one
|
||||||
@@ -81,7 +125,7 @@ if (false === strstr(BASE.INCLUDES.LANG.CONTENT_PATH, $cms->lang_dir) ||
|
|||||||
) {
|
) {
|
||||||
$cms->debug('LANG', 'Orig: '.BASE.INCLUDES.LANG.CONTENT_PATH.', New: '.$cms->lang_dir.' | Orig Lang: '.(defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG).', New Lang: '.$lang);
|
$cms->debug('LANG', 'Orig: '.BASE.INCLUDES.LANG.CONTENT_PATH.', New: '.$cms->lang_dir.' | Orig Lang: '.(defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG).', New Lang: '.$lang);
|
||||||
$cms->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
$cms->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
||||||
// if we have login class
|
// if we have login class
|
||||||
if ($login) {
|
if ($login) {
|
||||||
$login->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
$login->l->l10nReloadMOfile($lang, $cms->lang_dir);
|
||||||
}
|
}
|
||||||
@@ -91,28 +135,32 @@ if (false === strstr(BASE.INCLUDES.LANG.CONTENT_PATH, $cms->lang_dir) ||
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// javascript translate data as template for auto translate
|
if (!$AJAX_PAGE) {
|
||||||
if (!$TEMPLATE_TRANSLATE) {
|
// javascript translate data as template for auto translate
|
||||||
$TEMPLATE_TRANSLATE = 'jsTranslate_'.$lang.'.tpl';
|
if (!$TEMPLATE_TRANSLATE) {
|
||||||
$cms->debug('LANG', 'Load lang: '.$lang.', for page file '.$TEMPLATE_TRANSLATE);
|
$TEMPLATE_TRANSLATE = 'jsTranslate_'.$lang.'.tpl';
|
||||||
} else {
|
$cms->debug('LANG', 'Load lang: '.$lang.', for page file '.$TEMPLATE_TRANSLATE);
|
||||||
// we assume we have some fixed set
|
|
||||||
// we must add _<$lang>
|
|
||||||
// if .tpl, put before .tpl
|
|
||||||
// if not .tpl, add _<$lang>.tpl
|
|
||||||
if (strpos($TEMPLATE_TRANSLATE, '.tpl')) {
|
|
||||||
$TEMPLATE_TRANSLATE = str_replace('.tpl', '_'.$lang.'.tpl', $TEMPLATE_TRANSLATE);
|
|
||||||
} else {
|
} else {
|
||||||
$TEMPLATE_TRANSLATE .= '_'.$lang.'.tpl';
|
// we assume we have some fixed set
|
||||||
|
// we must add _<$lang>
|
||||||
|
// if .tpl, put before .tpl
|
||||||
|
// if not .tpl, add _<$lang>.tpl
|
||||||
|
if (strpos($TEMPLATE_TRANSLATE, '.tpl')) {
|
||||||
|
$TEMPLATE_TRANSLATE = str_replace('.tpl', '_'.$lang.'.tpl', $TEMPLATE_TRANSLATE);
|
||||||
|
} else {
|
||||||
|
$TEMPLATE_TRANSLATE .= '_'.$lang.'.tpl';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if we can't find it, dump it
|
||||||
|
if ($smarty && !file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_TRANSLATE)) {
|
||||||
|
unset($TEMPLATE_TRANSLATE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// if we can't find it, dump it
|
|
||||||
if (!file_exists($smarty->getTemplateDir()[0].DS.$TEMPLATE_TRANSLATE)) {
|
|
||||||
unset($TEMPLATE_TRANSLATE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// $cms->debug("LANGUAGE", "L: $lang | ".$cms->lang_dir." | MO File: ".$cms->l->mofile);
|
// $cms->debug("LANGUAGE", "L: $lang | ".$cms->lang_dir." | MO File: ".$cms->l->mofile);
|
||||||
$cms->debug("LANGUAGE", "SL: ".$_SESSION['DEFAULT_CHARSET']." | ".$_SESSION['LANG']." | ".$_SESSION['DEFAULT_LANG']);
|
$cms->debug("LANGUAGE", "SL: ".$_SESSION['DEFAULT_CHARSET']." | ".$_SESSION['LANG']." | ".$_SESSION['DEFAULT_LANG']);
|
||||||
$cms->debug("TEMPLATE", "P: ".$smarty->getTemplateDir()[0]);
|
if ($smarty) {
|
||||||
|
$cms->debug("TEMPLATE", "P: ".$smarty->getTemplateDir()[0]);
|
||||||
|
}
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
@@ -16,34 +16,6 @@ if ($cms->HEADER['USE_PROTOTYPE']) {
|
|||||||
// jquery and prototype should not be used together
|
// jquery and prototype should not be used together
|
||||||
$cms->HEADER['USE_JQUERY'] = isset($USE_JQUERY) ? $USE_JQUERY : USE_JQUERY; // don't use either of those two together
|
$cms->HEADER['USE_JQUERY'] = isset($USE_JQUERY) ? $USE_JQUERY : USE_JQUERY; // don't use either of those two together
|
||||||
|
|
||||||
// set basic template path (tmp)
|
|
||||||
// paths are set in the 'set_paths.inc' file
|
|
||||||
|
|
||||||
// check if we have an external file with the template name
|
|
||||||
if (file_exists($cms->includes.$cms->INC_TEMPLATE_NAME) && is_file($cms->includes.$cms->INC_TEMPLATE_NAME)) {
|
|
||||||
include($cms->includes.$cms->INC_TEMPLATE_NAME);
|
|
||||||
}
|
|
||||||
// additional per page Javascript include
|
|
||||||
$cms->JS_INCLUDE = '';
|
|
||||||
if (file_exists($cms->javascript.$cms->JS_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_TEMPLATE_NAME)) {
|
|
||||||
$cms->JS_INCLUDE = $cms->javascript.$cms->JS_TEMPLATE_NAME;
|
|
||||||
}
|
|
||||||
// per page css file
|
|
||||||
$cms->CSS_INCLUDE = '';
|
|
||||||
if (file_exists($cms->css.$cms->CSS_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_TEMPLATE_NAME)) {
|
|
||||||
$cms->CSS_INCLUDE = $cms->css.$cms->CSS_TEMPLATE_NAME;
|
|
||||||
}
|
|
||||||
// optional CSS file
|
|
||||||
$cms->CSS_SPECIAL_INCLUDE = '';
|
|
||||||
if (file_exists($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME)) {
|
|
||||||
$cms->CSS_SPECIAL_INCLUDE = $cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME;
|
|
||||||
}
|
|
||||||
// optional JS file
|
|
||||||
$cms->JS_SPECIAL_INCLUDE = '';
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
// the actual include files for javascript (per page)
|
// the actual include files for javascript (per page)
|
||||||
$cms->HEADER['JS_INCLUDE'] = $cms->JS_INCLUDE;
|
$cms->HEADER['JS_INCLUDE'] = $cms->JS_INCLUDE;
|
||||||
$cms->HEADER['CSS_INCLUDE'] = $cms->CSS_INCLUDE;
|
$cms->HEADER['CSS_INCLUDE'] = $cms->CSS_INCLUDE;
|
||||||
@@ -61,11 +33,11 @@ $cms->HEADER['CSS'] = CSS;
|
|||||||
$cms->HEADER['JS'] = JS;
|
$cms->HEADER['JS'] = JS;
|
||||||
$cms->HEADER['ENCODING'] = $encoding;
|
$cms->HEADER['ENCODING'] = $encoding;
|
||||||
$cms->HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
|
$cms->HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
|
||||||
$cms->HEADER['STYLESHEET'] = $EDIT_STYLESHEET;
|
$cms->HEADER['STYLESHEET'] = isset($ADMIN_STYLESHEET) ? $ADMIN_STYLESHEET : ADMIN_STYLESHEET;
|
||||||
$cms->HEADER['JAVASCRIPT'] = $EDIT_JAVASCRIPT;
|
$cms->HEADER['JAVASCRIPT'] = isset($ADMIN_JAVASCRIPT) ? $ADMIN_JAVASCRIPT : ADMIN_JAVASCRIPT;
|
||||||
// html title
|
// html title
|
||||||
$cms->HEADER['HTML_TITLE'] = (!isset($L_TITLE) || !$L_TITLE) ? $cms->l->__($G_TITLE) : $cms->l->__($L_TITLE);
|
$cms->HEADER['HTML_TITLE'] = isset($L_TITLE) ? $cms->l->__($L_TITLE) : $cms->l->__(G_TITLE);
|
||||||
$cms->DATA['table_width'] = $PAGE_WIDTH ? $PAGE_WIDTH : PAGE_WIDTH;
|
$cms->DATA['table_width'] = isset($PAGE_WIDTH) ? $PAGE_WIDTH : PAGE_WIDTH;
|
||||||
|
|
||||||
// messages = array('msg' =>, 'class' => 'error/warning/...')
|
// messages = array('msg' =>, 'class' => 'error/warning/...')
|
||||||
$cms->DATA['messages'] = $cms->messages;
|
$cms->DATA['messages'] = $cms->messages;
|
||||||
@@ -99,6 +71,10 @@ if (is_dir(BASE.TEMPLATES_C)) {
|
|||||||
if (is_dir(BASE.CACHE)) {
|
if (is_dir(BASE.CACHE)) {
|
||||||
$smarty->setCacheDir(BASE.CACHE);
|
$smarty->setCacheDir(BASE.CACHE);
|
||||||
}
|
}
|
||||||
$smarty->display($MASTER_TEMPLATE_NAME, $TEMPLATE.$lang, $TEMPLATE.$lang);
|
$smarty->display(
|
||||||
|
$MASTER_TEMPLATE_NAME,
|
||||||
|
$cms->CACHE_ID.($cms->CACHE_ID ? '_' : '').$lang,
|
||||||
|
$cms->COMPILE_ID.($cms->COMPILE_ID ? '_' : '').$lang
|
||||||
|
);
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ $data = array (
|
|||||||
// log action
|
// log action
|
||||||
EditLog('Edit Submit', serialize($data));
|
EditLog('Edit Submit', serialize($data));
|
||||||
|
|
||||||
|
// define all needed smarty stuff for the general HTML/page building
|
||||||
|
$HEADER['CSS'] = CSS;
|
||||||
|
$HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
|
||||||
|
$HEADER['STYLESHEET'] = isset($ADMIN_STYLESHEET) ? $ADMIN_STYLESHEET : ADMIN_STYLESHEET;
|
||||||
|
|
||||||
if ($form->my_page_name == 'edit_order') {
|
if ($form->my_page_name == 'edit_order') {
|
||||||
// get is for "table_name" and "where" only
|
// get is for "table_name" and "where" only
|
||||||
$table_name = isset($_GET['table_name']) ? $_GET['table_name'] : '';
|
$table_name = isset($_GET['table_name']) ? $_GET['table_name'] : '';
|
||||||
@@ -176,18 +181,12 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
);
|
);
|
||||||
} // while read data ...
|
} // while read data ...
|
||||||
|
|
||||||
// define all needed smarty stuff for the general HTML/page building
|
|
||||||
$HEADER['CSS'] = CSS;
|
|
||||||
$HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
|
|
||||||
$HEADER['JS'] = JS;
|
|
||||||
$HEADER['STYLESHEET'] = $EDIT_STYLESHEET;
|
|
||||||
$HEADER['JAVASCRIPT'] = $EDIT_JAVASCRIPT;
|
|
||||||
// html title
|
// html title
|
||||||
$HEADER['HTML_TITLE'] = (!$L_TITLE) ? $smarty->l10n->__($G_TITLE) : $smarty->l10n->__($L_TITLE);
|
$HEADER['HTML_TITLE'] = $form->l->__('Edit Order');
|
||||||
|
|
||||||
// error msg
|
// error msg
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$messages[] = array('msg' => $msg, 'class' => 'error', 'width' => '100%');
|
$messages[] = array ('msg' => $msg, 'class' => 'error', 'width' => '100%');
|
||||||
}
|
}
|
||||||
$DATA['form_error_msg'] = $messages;
|
$DATA['form_error_msg'] = $messages;
|
||||||
|
|
||||||
@@ -235,13 +234,6 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$form->formProcedureDelete();
|
$form->formProcedureDelete();
|
||||||
$form->formProcedureDeleteFromElementList($element_list, $remove_name);
|
$form->formProcedureDeleteFromElementList($element_list, $remove_name);
|
||||||
|
|
||||||
// define all needed smarty stuff for the general HTML/page building
|
|
||||||
$HEADER['CSS'] = CSS;
|
|
||||||
$HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
|
|
||||||
$HEADER['JS'] = JS;
|
|
||||||
$HEADER['STYLESHEET'] = $EDIT_STYLESHEET;
|
|
||||||
$HEADER['JAVASCRIPT'] = $EDIT_JAVASCRIPT;
|
|
||||||
|
|
||||||
$DATA['table_width'] = $table_width;
|
$DATA['table_width'] = $table_width;
|
||||||
|
|
||||||
// write out error / status messages
|
// write out error / status messages
|
||||||
@@ -314,7 +306,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$DATA['page_name'] = $menuarray[$position]["page_name"];
|
$DATA['page_name'] = $menuarray[$position]["page_name"];
|
||||||
$L_TITLE = $DATA['page_name'];
|
$L_TITLE = $DATA['page_name'];
|
||||||
// html title
|
// html title
|
||||||
$HEADER['HTML_TITLE'] = ((!$L_TITLE) ? $form->l->__($G_TITLE) : $form->l->__($L_TITLE));
|
$HEADER['HTML_TITLE'] = $form->l->__($L_TITLE);
|
||||||
// END MENU
|
// END MENU
|
||||||
// LOAD AND NEW
|
// LOAD AND NEW
|
||||||
$DATA['load'] = $form->formCreateLoad();
|
$DATA['load'] = $form->formCreateLoad();
|
||||||
@@ -348,6 +340,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$elements[] = $form->formCreateElement("edit_language_id");
|
$elements[] = $form->formCreateElement("edit_language_id");
|
||||||
$elements[] = $form->formCreateElement("edit_scheme_id");
|
$elements[] = $form->formCreateElement("edit_scheme_id");
|
||||||
$elements[] = $form->formCreateElementListTable("edit_access_user");
|
$elements[] = $form->formCreateElementListTable("edit_access_user");
|
||||||
|
$elements[] = $form->formCreateElement("additional_acl");
|
||||||
break;
|
break;
|
||||||
case "edit_schemes":
|
case "edit_schemes":
|
||||||
$elements[] = $form->formCreateElement("enabled");
|
$elements[] = $form->formCreateElement("enabled");
|
||||||
@@ -399,6 +392,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$elements[] = $form->formCreateElement("edit_access_right_id");
|
$elements[] = $form->formCreateElement("edit_access_right_id");
|
||||||
$elements[] = $form->formCreateElement("edit_scheme_id");
|
$elements[] = $form->formCreateElement("edit_scheme_id");
|
||||||
$elements[] = $form->formCreateElementListTable("edit_page_access");
|
$elements[] = $form->formCreateElementListTable("edit_page_access");
|
||||||
|
$elements[] = $form->formCreateElement("additional_acl");
|
||||||
break;
|
break;
|
||||||
case "edit_visible_group":
|
case "edit_visible_group":
|
||||||
$elements[] = $form->formCreateElement("name");
|
$elements[] = $form->formCreateElement("name");
|
||||||
@@ -417,6 +411,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$elements[] = $form->formCreateElement("description");
|
$elements[] = $form->formCreateElement("description");
|
||||||
// add name/value list here
|
// add name/value list here
|
||||||
$elements[] = $form->formCreateElementListTable("edit_access_data");
|
$elements[] = $form->formCreateElementListTable("edit_access_data");
|
||||||
|
$elements[] = $form->formCreateElement("additional_acl");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print "[No valid page definition given]";
|
print "[No valid page definition given]";
|
||||||
@@ -445,7 +440,7 @@ if (is_dir(BASE.TEMPLATES_C)) {
|
|||||||
if (is_dir(BASE.CACHE)) {
|
if (is_dir(BASE.CACHE)) {
|
||||||
$smarty->setCacheDir(BASE.CACHE);
|
$smarty->setCacheDir(BASE.CACHE);
|
||||||
}
|
}
|
||||||
$smarty->display($EDIT_TEMPLATE, $lang, $lang);
|
$smarty->display($EDIT_TEMPLATE, 'editAdmin_'.$lang, 'editAdmin_'.$lang);
|
||||||
|
|
||||||
// debug output
|
// debug output
|
||||||
echo $login->printErrorMsg();
|
echo $login->printErrorMsg();
|
||||||
|
|||||||
@@ -49,7 +49,15 @@ $edit_access = array (
|
|||||||
"1" => "Yes",
|
"1" => "Yes",
|
||||||
"0" => "No"
|
"0" => "No"
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
"additional_acl" => array (
|
||||||
|
"value" => $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",
|
"load_query" => "SELECT edit_access_id, name FROM edit_access ORDER BY name",
|
||||||
|
|||||||
@@ -37,7 +37,15 @@ $edit_groups = array (
|
|||||||
"int_null" => 1,
|
"int_null" => 1,
|
||||||
"type" => "drop_down_db",
|
"type" => "drop_down_db",
|
||||||
"query" => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
|
"query" => "SELECT edit_scheme_id, name FROM edit_scheme WHERE enabled = 1 ORDER BY name"
|
||||||
)
|
),
|
||||||
|
"additional_acl" => array (
|
||||||
|
"value" => $GLOBALS["additional_acl"],
|
||||||
|
"output_name" => "Additional ACL (as JSON)",
|
||||||
|
"type" => "textarea",
|
||||||
|
"error_check" => "json",
|
||||||
|
"rows" => 10,
|
||||||
|
"cols" => 60
|
||||||
|
),
|
||||||
),
|
),
|
||||||
"load_query" => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name",
|
"load_query" => "SELECT edit_group_id, name, enabled FROM edit_group ORDER BY name",
|
||||||
"table_name" => "edit_group",
|
"table_name" => "edit_group",
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ $edit_users = array (
|
|||||||
"email" => array (
|
"email" => array (
|
||||||
"value" => $GLOBALS["email"],
|
"value" => $GLOBALS["email"],
|
||||||
"output_name" => "E-Mail",
|
"output_name" => "E-Mail",
|
||||||
"type" => "text"
|
"type" => "text",
|
||||||
|
"error_check" => "email"
|
||||||
),
|
),
|
||||||
"last_name" => array (
|
"last_name" => array (
|
||||||
"value" => $GLOBALS["last_name"],
|
"value" => $GLOBALS["last_name"],
|
||||||
@@ -173,7 +174,15 @@ $edit_users = array (
|
|||||||
"1" => "Yes",
|
"1" => "Yes",
|
||||||
"0" => "No"
|
"0" => "No"
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
"additional_acl" => array (
|
||||||
|
"value" => $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",
|
"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",
|
"table_name" => "edit_user",
|
||||||
|
|||||||
@@ -15,12 +15,14 @@
|
|||||||
{if $STYLESHEET}
|
{if $STYLESHEET}
|
||||||
<link rel=stylesheet type="text/css" href="{$css}{$STYLESHEET}">
|
<link rel=stylesheet type="text/css" href="{$css}{$STYLESHEET}">
|
||||||
{/if}
|
{/if}
|
||||||
{if $JAVASCRIPT}
|
<script language="JavaScript">
|
||||||
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
|
<!--
|
||||||
{/if}
|
function pop(theURL, winName, features) {
|
||||||
{if $DATE_JAVASCRIPT}
|
winName = window.open(theURL, winName, features);
|
||||||
<script language="JavaScript" src="{$JS}{$DATE_JAVASCRIPT}"></script>
|
winName.focus();
|
||||||
{/if}
|
}
|
||||||
|
//-->
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<table width="{$table_width}" border="0" cellpadding="0" cellspacing="1">
|
<table width="{$table_width}" border="0" cellpadding="0" cellspacing="1">
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
{*
|
|
||||||
********************************************************************
|
|
||||||
* AUTHOR: Clemens Schwaighofer
|
|
||||||
* DATE: 2005/06/23
|
|
||||||
* DESCRIPTION:
|
|
||||||
* edit body part
|
|
||||||
* HISTORY:
|
|
||||||
********************************************************************
|
|
||||||
*}
|
|
||||||
|
|
||||||
<div style="position:relative; width: {$table_width}px; margin-top: 5px; margin-bottom: 5px; top: 0px; left: 0px;">
|
|
||||||
{* <div style="position: absolute; top: 0px; left: 0px; width: 240px; height: 100%; z-index: 1; overflow: auto; border: 1px solid blue;">
|
|
||||||
|
|
||||||
left
|
|
||||||
|
|
||||||
</div> *}
|
|
||||||
<div style="position: relative; top: 0px; left: 0px; width: 790px; z-index: 2; margin: 2px; padding: 2px;">
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; position: relative; border: 1px solid #e5ddba;">
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; font-size: 12px; font-weight: bold;">
|
|
||||||
Status
|
|
||||||
</div>
|
|
||||||
<div id="index_issues_data" style="margin-bottom: 2px; padding: 2px; border: 1px solid gray;">
|
|
||||||
<b>Shops</b><br>
|
|
||||||
Shops Flagged Delete: {$shop_delete_flagged}<br>
|
|
||||||
Shops Flagged Offline: {$shop_offline_flagged}<br>
|
|
||||||
Shops Flagged Online: {$shop_online_flagged}<br>
|
|
||||||
Shops without any categories: {$shop_no_category}<br>
|
|
||||||
<br>
|
|
||||||
<b>Products</b><br>
|
|
||||||
Products Flagged no image: {$products_no_image_flagged}<br>
|
|
||||||
Products Flagged offline: {$products_offline_flagged}<br>
|
|
||||||
Products Flagged online: {$products_online_flagged}<br>
|
|
||||||
Products without any color tags: {$products_no_color_tags}<br>
|
|
||||||
<br>
|
|
||||||
<b>Categories</b><br>
|
|
||||||
Categories without Products: {$categories_no_products}<br>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{ * shows shops to be uploaded *}
|
|
||||||
{if $queued_items}
|
|
||||||
<form method="post" name="{$form_name}">
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; position: relative; border: 2px solid #8a1113;">
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; position: relative; height: 30px;">
|
|
||||||
<div style="position: absolute; top: 2px; left: 2px; height: 20px; width: 140px; padding: 2px; font-size: 12px; font-weight: bold;">
|
|
||||||
Items to push live
|
|
||||||
</div>
|
|
||||||
<div style="position: absolute; top: 2px; right: 2px; height: 25px; width: 450px; padding: 2px; text-align: right;">
|
|
||||||
<input type="button" id="cancel_push_live" name="cancel_push_live" value="Delete from live Queue" OnClick="document.{$form_name}.action.value='cancel_push_live';document.{$form_name}.action_yes.value=confirm('Do you want to want to delete the selected items from the live queue?');if (document.{$form_name}.action_yes.value == 'true') document.{$form_name}.submit();" {if $page_acl < 90}disabled{/if}>
|
|
||||||
<input type="button" id="push_live" name="push_live" value="Push data to live server" OnClick="document.{$form_name}.action.value='push_live';document.{$form_name}.action_yes.value=confirm('Do you want to push all the changes to the live server?');if (document.{$form_name}.action_yes.value == 'true') document.{$form_name}.submit();" {if $locked || $page_acl < 90}disabled{/if}>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="index_issues_data" style="margin-bottom: 2px; padding: 2px; border: 1px solid gray;">
|
|
||||||
<div style="clear: both;"></div>
|
|
||||||
<div style="float: left; width: 40px; text-align: right; font-weight: bold; padding-right: 2px; border-right: 1px solid gray; border-bottom: 1px solid gray;">del</div>
|
|
||||||
<div style="float: left; width: 30px; font-weight: bold; border-bottom: 1px solid gray; padding-left: 2px;">GK</div>
|
|
||||||
<div style="float: left; width: 140px; font-weight: bold; border-bottom: 1px solid gray;">Date</div>
|
|
||||||
<div style="float: left; width: 70px; font-weight: bold; border-bottom: 1px solid gray;">Type</div>
|
|
||||||
<div style="float: left; width: 50px; font-weight: bold; border-bottom: 1px solid gray;">Action</div>
|
|
||||||
<div style="float: left; width: 80px; font-weight: bold; border-bottom: 1px solid gray;">Target</div>
|
|
||||||
<div style="float: left; width: 80px; font-weight: bold; border-bottom: 1px solid gray;">Key</div>
|
|
||||||
<div style="float: left; width: 170px; font-weight: bold; border-bottom: 1px solid gray;">Key ID</div>
|
|
||||||
<div style="float: left; width: 30px; font-weight: bold; border-bottom: 1px solid gray;">Asc</div>
|
|
||||||
<div style="float: left; width: 50px; font-weight: bold; border-bottom: 1px solid gray;">Lock</div>
|
|
||||||
<div style="clear: both;"></div>
|
|
||||||
{foreach from=$queued_items key=key item=item}
|
|
||||||
<div style="float: left; width: 40px; text-align: right; padding-right: 2px; margin-right: 2px; border-right: 1px solid gray; background-color: {$item.color};">{if $item.checkbox}<input type="checkbox" name="group_key[]" value="{$item.group_key}" style="height: 9px;" {if $item.associate != '-'}disabled{/if}>{else} {/if}</div>
|
|
||||||
<div style="float: left; width: 30px; background-color: {$item.color};" {popup width="30" caption="ID" text="`$key`"}>{$item.group_key}</div>
|
|
||||||
<div style="float: left; width: 140px; background-color: {$item.color};">{$item.date_created}</div>
|
|
||||||
<div style="float: left; width: 70px; background-color: {$item.color}; font-weight: bold; color: {$item.type_color};" {popup width="450" caption="Data" text="`$item.data`"}>{$item.type}</div>
|
|
||||||
<div style="float: left; width: 50px; background-color: {$item.color};">{$item.action}</div>
|
|
||||||
<div style="float: left; width: 80px; background-color: {$item.color};">{$item.target}</div>
|
|
||||||
<div style="float: left; width: 80px; background-color: {$item.color};">{$item.key_name}</div>
|
|
||||||
<div style="float: left; width: 170px; background-color: {$item.color};" {popup width="250" caption="Key ID" text="`$item.key_value`"}>{$item.key_value}</div>
|
|
||||||
<div style="float: left; width: 30px; background-color: {$item.color};">{$item.associate}</div>
|
|
||||||
<div style="float: left; width: 50px; background-color: {$item.color}; font-weight: bold; color: red;">{$item.locked}</div>
|
|
||||||
<div style="clear: both;"></div>
|
|
||||||
{/foreach}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input type="hidden" id="action" name="action" value="">
|
|
||||||
<input type="hidden" id="action_yes" name="action_yes" value="">
|
|
||||||
<input type="hidden" name="action_loaded" value="true">
|
|
||||||
</form>
|
|
||||||
{/if}
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; position: relative; border: 1px solid #e5ddba;">
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; font-size: 12px; font-weight: bold;">
|
|
||||||
Issues
|
|
||||||
</div>
|
|
||||||
<div id="index_issues_data" style="margin-bottom: 2px; padding: 2px; border: 1px solid gray;">
|
|
||||||
{$issue_data}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; position: relative; border: 1px solid #e5ddba;">
|
|
||||||
<div style="margin-bottom: 2px; padding: 2px; position: relative; height: 26px;">
|
|
||||||
<div style="position: absolute; top: 2px; left: 2px; height: 20px; width: 250px; padding: 2px; font-size: 12px; font-weight: bold;">
|
|
||||||
Quick Search
|
|
||||||
</div>
|
|
||||||
<div style="position: absolute; top: 2px; right: 2px; height: 20px; width: 350px; padding: 2px; text-align: right;" {popup width="100" text="Search in Key, Name, Prefecture, Category"}>
|
|
||||||
<span id="search_status">Search for Key / String:</span> <input type="text" id="quick_search_shop" name="quick_search_shop" value="" onKeyup="QuickSearchInput(); return false;">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="quick_search_results" style="margin-bottom: 2px; padding: 2px; position: relative; border: 1px solid gray;">
|
|
||||||
Enter something to search into the search field
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -34,9 +34,20 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{if $USE_PROTOTYPE}
|
{if $USE_PROTOTYPE}
|
||||||
<script src="{$js}/scriptaculous/prototype.js" type="text/javascript"></script>
|
<script src="{$js}/scriptaculous/prototype.js" type="text/javascript"></script>
|
||||||
{/if}
|
{if $USE_SCRIPTACULOUS}
|
||||||
{if $USE_SCRIPTACULOUS}
|
|
||||||
<script src="{$js}/scriptaculous/scriptaculous.js" type="text/javascript"></script>
|
<script src="{$js}/scriptaculous/scriptaculous.js" type="text/javascript"></script>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
{* for including datepickr or flatpickr *}
|
||||||
|
{if $JS_DATEPICKR}
|
||||||
|
<link rel=stylesheet type="text/css" href="{$js}/datepickr/datepickr.min.css">
|
||||||
|
<script language="JavaScript" src="{$js}/datepickr/datepickr.min.js"></script>
|
||||||
|
<script language="JavaScript" src="{$js}/datepickr/datepickr.init.js"></script>
|
||||||
|
{/if}
|
||||||
|
{if $JS_FLATPICKR}
|
||||||
|
<link rel=stylesheet type="text/css" href="{$js}/flatpickr/flatpickr.min.css">
|
||||||
|
<script language="JavaScript" src="{$js}/flatpickr/flatpickr.min.js"></script>
|
||||||
|
<script language="JavaScript" src="{$js}/flatpickr/flatpickr.ja.js"></script>
|
||||||
{/if}
|
{/if}
|
||||||
{if $JAVASCRIPT}
|
{if $JAVASCRIPT}
|
||||||
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
|
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
|
||||||
|
|||||||
@@ -26,10 +26,16 @@
|
|||||||
{if $JAVASCRIPT}
|
{if $JAVASCRIPT}
|
||||||
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
|
<script language="JavaScript" src="{$js}{$JAVASCRIPT}"></script>
|
||||||
{/if}
|
{/if}
|
||||||
|
{if $USE_JQUERY}
|
||||||
|
{* JQuery *}
|
||||||
|
<script type="text/javascript" src="{$js}/jquery.min.js"></script>
|
||||||
|
{/if}
|
||||||
|
{if $USE_PROTOTYPE}
|
||||||
{* declare prototype everywhere *}
|
{* declare prototype everywhere *}
|
||||||
<script src="{$js}/scriptaculous/prototype.js" type="text/javascript"></script>
|
<script src="{$js}/scriptaculous/prototype.js" type="text/javascript"></script>
|
||||||
{if $USE_SCRIPTACULOUS}
|
{if $USE_SCRIPTACULOUS}
|
||||||
<script src="{$js}/scriptaculous/scriptaculous.js" type="text/javascript"></script>
|
<script src="{$js}/scriptaculous/scriptaculous.js" type="text/javascript"></script>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{if $JS_INCLUDE}
|
{if $JS_INCLUDE}
|
||||||
<script language="JavaScript" src="{$JS_INCLUDE}"></script>
|
<script language="JavaScript" src="{$JS_INCLUDE}"></script>
|
||||||
@@ -37,10 +43,16 @@
|
|||||||
{if $JS_SPECIAL_INCLUDE}
|
{if $JS_SPECIAL_INCLUDE}
|
||||||
<script language="JavaScript" src="{$JS_SPECIAL_INCLUDE}"></script>
|
<script language="JavaScript" src="{$JS_SPECIAL_INCLUDE}"></script>
|
||||||
{/if}
|
{/if}
|
||||||
{* for including datepickr *}
|
{* for including datepickr or flatpickr *}
|
||||||
{if $JS_DATEPICKR}
|
{if $JS_DATEPICKR}
|
||||||
<link rel=stylesheet type="text/css" href="{$js}/datepickr/datepickr.min.css">
|
<link rel=stylesheet type="text/css" href="{$js}/datepickr/datepickr.min.css">
|
||||||
<script language="JavaScript" src="{$js}/datepickr/datepickr.min.js"></script>
|
<script language="JavaScript" src="{$js}/datepickr/datepickr.min.js"></script>
|
||||||
|
<script language="JavaScript" src="{$js}/datepickr/datepickr.init.js"></script>
|
||||||
|
{/if}
|
||||||
|
{if $JS_FLATPICKR}
|
||||||
|
<link rel=stylesheet type="text/css" href="{$js}/flatpickr/flatpickr.min.css">
|
||||||
|
<script language="JavaScript" src="{$js}/flatpickr/flatpickr.min.js"></script>
|
||||||
|
<script language="JavaScript" src="{$js}/flatpickr/flatpickr.ja.js"></script>
|
||||||
{/if}
|
{/if}
|
||||||
{if $USE_OVERLIB}
|
{if $USE_OVERLIB}
|
||||||
{popup_init src="`$js`/overlib/overlib.js"}
|
{popup_init src="`$js`/overlib/overlib.js"}
|
||||||
|
|||||||
20
www/layout/admin/javascript/datepickr/datepickr.init.js
Executable file
20
www/layout/admin/javascript/datepickr/datepickr.init.js
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
/* only used for datepickr */
|
||||||
|
|
||||||
|
// METHOD: initDatepickr
|
||||||
|
// PARAMS: initial date ID (#)
|
||||||
|
// RETURN: true on ok, false on failure
|
||||||
|
// DESC : inits date pickr which translations for dates (week/month)
|
||||||
|
function initDatepickr(init_date)
|
||||||
|
{
|
||||||
|
if ($(init_date)) {
|
||||||
|
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
||||||
|
// dates in japanese
|
||||||
|
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
||||||
|
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
||||||
|
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
||||||
|
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -221,6 +221,38 @@ function getTimestamp()
|
|||||||
return date.getTime();
|
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
|
// METHOD: isObject
|
||||||
// PARAMS: possible object
|
// PARAMS: possible object
|
||||||
// RETURN: true/false if it is an object or not
|
// RETURN: true/false if it is an object or not
|
||||||
@@ -554,6 +586,8 @@ function phfo(tree)
|
|||||||
// *** DOM MANAGEMENT FUNCTIONS
|
// *** DOM MANAGEMENT FUNCTIONS
|
||||||
|
|
||||||
// BLOCK: html wrappers for quickly creating html data blocks
|
// BLOCK: html wrappers for quickly creating html data blocks
|
||||||
|
|
||||||
|
// NOTE : OLD FORMAT which misses multiple block set
|
||||||
// METHOD: html_options
|
// METHOD: html_options
|
||||||
// PARAMS: name/id, array for the options, selected item uid
|
// 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
|
// options_only [def false] if this is true, it will not print the select part
|
||||||
@@ -563,15 +597,40 @@ function phfo(tree)
|
|||||||
// DESC : creates an select/options drop down 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
|
// 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 = '')
|
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 content = [];
|
||||||
var element_select;
|
var element_select;
|
||||||
|
var select_options = {};
|
||||||
var element_option;
|
var element_option;
|
||||||
var data_list = []; // for sorted output
|
var data_list = []; // for sorted output
|
||||||
var value;
|
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
|
// 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);
|
// console.log('Call for %s, options: %s', name, options_only);
|
||||||
if (sort == 'keys') {
|
if (sort == 'keys') {
|
||||||
data_list = Object.keys(data).sort();
|
data_list = Object.keys(data).sort();
|
||||||
@@ -585,14 +644,18 @@ function html_options(name, data, selected = '', options_only = false, return_st
|
|||||||
// for (const [key, value] of Object.entries(data)) {
|
// for (const [key, value] of Object.entries(data)) {
|
||||||
for (const key of data_list) {
|
for (const key of data_list) {
|
||||||
value = data[key];
|
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
|
// basic options init
|
||||||
options = {
|
options = {
|
||||||
'label': value,
|
'label': value,
|
||||||
'value': key
|
'value': key
|
||||||
};
|
};
|
||||||
// add selected if matching
|
// 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 = '';
|
options.selected = '';
|
||||||
}
|
}
|
||||||
// create the element option
|
// create the element option
|
||||||
@@ -659,25 +722,6 @@ function html_options_refill(name, data, sort = '')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: initDatepickr
|
|
||||||
// PARAMS: initial date ID (#)
|
|
||||||
// RETURN: true on ok, false on failure
|
|
||||||
// DESC : inits date pickr which translations for dates (week/month)
|
|
||||||
function initDatepickr(init_date)
|
|
||||||
{
|
|
||||||
if (document.getElementById(init_date)) {
|
|
||||||
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
|
||||||
// dates in japanese
|
|
||||||
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
|
||||||
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
|
||||||
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
|
||||||
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// *** MASTER logout call
|
// *** MASTER logout call
|
||||||
// METHOD: loginLogout
|
// METHOD: loginLogout
|
||||||
// PARAMS: none
|
// PARAMS: none
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if (!DEBUG) {
|
|||||||
// METHOD: pop
|
// METHOD: pop
|
||||||
// PARAMS: url, window name, features
|
// PARAMS: url, window name, features
|
||||||
// RETURN: none
|
// RETURN: none
|
||||||
// DESC : opens a popup window with winNAme and given features (string)
|
// DESC : opens a popup window with winName and given features (string)
|
||||||
function pop(theURL, winName, features) {
|
function pop(theURL, winName, features) {
|
||||||
winName = window.open(theURL, winName, features);
|
winName = window.open(theURL, winName, features);
|
||||||
winName.focus();
|
winName.focus();
|
||||||
@@ -299,6 +299,38 @@ function getTimestamp()
|
|||||||
return date.getTime();
|
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
|
// METHOD: isObject
|
||||||
// PARAMS: possible object
|
// PARAMS: possible object
|
||||||
// RETURN: true/false if it is an object or not
|
// RETURN: true/false if it is an object or not
|
||||||
@@ -632,6 +664,8 @@ function phfo(tree)
|
|||||||
// *** DOM MANAGEMENT FUNCTIONS
|
// *** DOM MANAGEMENT FUNCTIONS
|
||||||
|
|
||||||
// BLOCK: html wrappers for quickly creating html data blocks
|
// BLOCK: html wrappers for quickly creating html data blocks
|
||||||
|
|
||||||
|
// NOTE : OLD FORMAT which misses multiple block set
|
||||||
// METHOD: html_options
|
// METHOD: html_options
|
||||||
// PARAMS: name/id, array for the options, selected item uid
|
// 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
|
// options_only [def false] if this is true, it will not print the select part
|
||||||
@@ -641,15 +675,40 @@ function phfo(tree)
|
|||||||
// DESC : creates an select/options drop down 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
|
// 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 = '')
|
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 content = [];
|
||||||
var element_select;
|
var element_select;
|
||||||
|
var select_options = {};
|
||||||
var element_option;
|
var element_option;
|
||||||
var data_list = []; // for sorted output
|
var data_list = []; // for sorted output
|
||||||
var value;
|
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
|
// 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);
|
// console.log('Call for %s, options: %s', name, options_only);
|
||||||
if (sort == 'keys') {
|
if (sort == 'keys') {
|
||||||
data_list = Object.keys(data).sort();
|
data_list = Object.keys(data).sort();
|
||||||
@@ -663,14 +722,18 @@ function html_options(name, data, selected = '', options_only = false, return_st
|
|||||||
// for (const [key, value] of Object.entries(data)) {
|
// for (const [key, value] of Object.entries(data)) {
|
||||||
for (const key of data_list) {
|
for (const key of data_list) {
|
||||||
value = data[key];
|
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
|
// basic options init
|
||||||
options = {
|
options = {
|
||||||
'label': value,
|
'label': value,
|
||||||
'value': key
|
'value': key
|
||||||
};
|
};
|
||||||
// add selected if matching
|
// 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 = '';
|
options.selected = '';
|
||||||
}
|
}
|
||||||
// create the element option
|
// create the element option
|
||||||
@@ -737,25 +800,6 @@ function html_options_refill(name, data, sort = '')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: initDatepickr
|
|
||||||
// PARAMS: initial date ID (#)
|
|
||||||
// RETURN: true on ok, false on failure
|
|
||||||
// DESC : inits date pickr which translations for dates (week/month)
|
|
||||||
function initDatepickr(init_date)
|
|
||||||
{
|
|
||||||
if ($(init_date)) {
|
|
||||||
datepickr('#' + init_date); // we need to add this so we have it initialized before we can actually change the definitions
|
|
||||||
// dates in japanese
|
|
||||||
datepickr.prototype.l10n.months.shorthand = [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')];
|
|
||||||
datepickr.prototype.l10n.months.longhand = [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')];
|
|
||||||
datepickr.prototype.l10n.weekdays.shorthand = [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')];
|
|
||||||
datepickr.prototype.l10n.weekdays.longhand = [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// *** MASTER logout call
|
// *** MASTER logout call
|
||||||
// METHOD: loginLogout
|
// METHOD: loginLogout
|
||||||
// PARAMS: none
|
// PARAMS: none
|
||||||
|
|||||||
66
www/layout/admin/javascript/flatpickr/flatpickr.ja.js
Normal file
66
www/layout/admin/javascript/flatpickr/flatpickr.ja.js
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||||
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||||
|
(global = global || self, factory(global.ja = {}));
|
||||||
|
}(this, function (exports) { 'use strict';
|
||||||
|
|
||||||
|
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
|
||||||
|
? window.flatpickr
|
||||||
|
: {
|
||||||
|
l10ns: {}
|
||||||
|
};
|
||||||
|
var Japanese = {
|
||||||
|
weekdays: {
|
||||||
|
shorthand: ["日", "月", "火", "水", "木", "金", "土"],
|
||||||
|
longhand: [
|
||||||
|
"日曜日",
|
||||||
|
"月曜日",
|
||||||
|
"火曜日",
|
||||||
|
"水曜日",
|
||||||
|
"木曜日",
|
||||||
|
"金曜日",
|
||||||
|
"土曜日",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
months: {
|
||||||
|
shorthand: [
|
||||||
|
"1月",
|
||||||
|
"2月",
|
||||||
|
"3月",
|
||||||
|
"4月",
|
||||||
|
"5月",
|
||||||
|
"6月",
|
||||||
|
"7月",
|
||||||
|
"8月",
|
||||||
|
"9月",
|
||||||
|
"10月",
|
||||||
|
"11月",
|
||||||
|
"12月",
|
||||||
|
],
|
||||||
|
longhand: [
|
||||||
|
"1月",
|
||||||
|
"2月",
|
||||||
|
"3月",
|
||||||
|
"4月",
|
||||||
|
"5月",
|
||||||
|
"6月",
|
||||||
|
"7月",
|
||||||
|
"8月",
|
||||||
|
"9月",
|
||||||
|
"10月",
|
||||||
|
"11月",
|
||||||
|
"12月",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
time_24hr: true,
|
||||||
|
rangeSeparator: ' から '
|
||||||
|
};
|
||||||
|
fp.l10ns.ja = Japanese;
|
||||||
|
var ja = fp.l10ns;
|
||||||
|
|
||||||
|
exports.Japanese = Japanese;
|
||||||
|
exports.default = ja;
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
}));
|
||||||
13
www/layout/admin/javascript/flatpickr/flatpickr.min.css
vendored
Normal file
13
www/layout/admin/javascript/flatpickr/flatpickr.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
www/layout/admin/javascript/flatpickr/flatpickr.min.js
vendored
Normal file
2
www/layout/admin/javascript/flatpickr/flatpickr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
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/
|
* https://jquery.com/
|
||||||
*
|
*
|
||||||
* Includes Sizzle.js
|
* Includes Sizzle.js
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
* Released under the MIT license
|
* Released under the MIT license
|
||||||
* https://jquery.org/license
|
* https://jquery.org/license
|
||||||
*
|
*
|
||||||
* Date: 2019-04-10T19:48Z
|
* Date: 2019-05-01T21:04Z
|
||||||
*/
|
*/
|
||||||
( function( global, factory ) {
|
( function( global, factory ) {
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ function toType( obj ) {
|
|||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
version = "3.4.0",
|
version = "3.4.1",
|
||||||
|
|
||||||
// Define a local copy of jQuery
|
// Define a local copy of jQuery
|
||||||
jQuery = function( selector, context ) {
|
jQuery = function( selector, context ) {
|
||||||
@@ -4498,8 +4498,12 @@ var documentElement = document.documentElement;
|
|||||||
},
|
},
|
||||||
composed = { composed: true };
|
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)
|
// 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 ) {
|
isAttached = function( elem ) {
|
||||||
return jQuery.contains( elem.ownerDocument, elem ) ||
|
return jQuery.contains( elem.ownerDocument, elem ) ||
|
||||||
elem.getRootNode( composed ) === elem.ownerDocument;
|
elem.getRootNode( composed ) === elem.ownerDocument;
|
||||||
@@ -5359,8 +5363,7 @@ jQuery.event = {
|
|||||||
|
|
||||||
// Claim the first handler
|
// Claim the first handler
|
||||||
if ( rcheckableType.test( el.type ) &&
|
if ( rcheckableType.test( el.type ) &&
|
||||||
el.click && nodeName( el, "input" ) &&
|
el.click && nodeName( el, "input" ) ) {
|
||||||
dataPriv.get( el, "click" ) === undefined ) {
|
|
||||||
|
|
||||||
// dataPriv.set( el, "click", ... )
|
// dataPriv.set( el, "click", ... )
|
||||||
leverageNative( el, "click", returnTrue );
|
leverageNative( el, "click", returnTrue );
|
||||||
@@ -5377,8 +5380,7 @@ jQuery.event = {
|
|||||||
|
|
||||||
// Force setup before triggering a click
|
// Force setup before triggering a click
|
||||||
if ( rcheckableType.test( el.type ) &&
|
if ( rcheckableType.test( el.type ) &&
|
||||||
el.click && nodeName( el, "input" ) &&
|
el.click && nodeName( el, "input" ) ) {
|
||||||
dataPriv.get( el, "click" ) === undefined ) {
|
|
||||||
|
|
||||||
leverageNative( el, "click" );
|
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
|
// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
|
||||||
if ( !expectSync ) {
|
if ( !expectSync ) {
|
||||||
jQuery.event.add( el, type, returnTrue );
|
if ( dataPriv.get( el, type ) === undefined ) {
|
||||||
|
jQuery.event.add( el, type, returnTrue );
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5434,9 +5438,13 @@ function leverageNative( el, type, expectSync ) {
|
|||||||
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
|
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
|
||||||
|
|
||||||
// Interrupt processing of the outer synthetic .trigger()ed event
|
// 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
|
// 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 );
|
saved = slice.call( arguments );
|
||||||
dataPriv.set( this, type, saved );
|
dataPriv.set( this, type, saved );
|
||||||
|
|
||||||
@@ -5449,14 +5457,14 @@ function leverageNative( el, type, expectSync ) {
|
|||||||
if ( saved !== result || notAsync ) {
|
if ( saved !== result || notAsync ) {
|
||||||
dataPriv.set( this, type, false );
|
dataPriv.set( this, type, false );
|
||||||
} else {
|
} else {
|
||||||
result = undefined;
|
result = {};
|
||||||
}
|
}
|
||||||
if ( saved !== result ) {
|
if ( saved !== result ) {
|
||||||
|
|
||||||
// Cancel the outer synthetic event
|
// Cancel the outer synthetic event
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return result;
|
return result.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is an inner synthetic event for an event with a bubbling surrogate
|
// 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
|
// If this is a native event triggered above, everything is now in order
|
||||||
// Fire an inner synthetic event with the original arguments
|
// Fire an inner synthetic event with the original arguments
|
||||||
} else if ( saved ) {
|
} else if ( saved.length ) {
|
||||||
|
|
||||||
// ...and capture the result
|
// ...and capture the result
|
||||||
dataPriv.set( this, type, jQuery.event.trigger(
|
dataPriv.set( this, type, {
|
||||||
|
value: jQuery.event.trigger(
|
||||||
|
|
||||||
// Support: IE <=9 - 11+
|
// Support: IE <=9 - 11+
|
||||||
// Extend with the prototype to reset the above stopImmediatePropagation()
|
// Extend with the prototype to reset the above stopImmediatePropagation()
|
||||||
jQuery.extend( saved.shift(), jQuery.Event.prototype ),
|
jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
|
||||||
saved,
|
saved.slice( 1 ),
|
||||||
this
|
this
|
||||||
) );
|
)
|
||||||
|
} );
|
||||||
|
|
||||||
// Abort handling of the native event
|
// Abort handling of the native event
|
||||||
event.stopImmediatePropagation();
|
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
|
||||||
@@ -276,7 +276,7 @@ class Basic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the regex for checking emails
|
// 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->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 is for error check parts in where the email regex failed
|
||||||
$this->email_regex_check = array (
|
$this->email_regex_check = array (
|
||||||
1 => "@(.*)@(.*)", // double @
|
1 => "@(.*)@(.*)", // double @
|
||||||
@@ -442,7 +442,7 @@ class Basic
|
|||||||
// on second call it sends the end time and then also prints the running time
|
// on second call it sends the end time and then also prints the running time
|
||||||
public function runningTime($simple = false)
|
public function runningTime($simple = false)
|
||||||
{
|
{
|
||||||
list($micro, $timestamp) = explode(" ", microtime());
|
list($micro, $timestamp) = explode(' ', microtime());
|
||||||
$string = '';
|
$string = '';
|
||||||
$running_time = '';
|
$running_time = '';
|
||||||
if (!$this->starttime) {
|
if (!$this->starttime) {
|
||||||
@@ -1088,6 +1088,84 @@ class Basic
|
|||||||
return false;
|
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
|
// METHOD: inArrayAny
|
||||||
// WAS : in_array_any
|
// WAS : in_array_any
|
||||||
// PARAMS: needle: array
|
// PARAMS: needle: array
|
||||||
@@ -1241,8 +1319,8 @@ class Basic
|
|||||||
// DESC : calculates the bytes based on a string with nnG, nnM, etc
|
// DESC : calculates the bytes based on a string with nnG, nnM, etc
|
||||||
public static function stringByteFormat($number)
|
public static function stringByteFormat($number)
|
||||||
{
|
{
|
||||||
$number = (int)trim($number);
|
|
||||||
$last = strtolower($number[strlen($number) - 1]);
|
$last = strtolower($number[strlen($number) - 1]);
|
||||||
|
$number = (int)trim($number);
|
||||||
switch ($last) {
|
switch ($last) {
|
||||||
case 't':
|
case 't':
|
||||||
$number *= 1024;
|
$number *= 1024;
|
||||||
@@ -1322,6 +1400,7 @@ class Basic
|
|||||||
if (preg_match("/(d|h|m|s|ms)/", $timestring)) {
|
if (preg_match("/(d|h|m|s|ms)/", $timestring)) {
|
||||||
// pos for preg match read + multiply factor
|
// pos for preg match read + multiply factor
|
||||||
$timegroups = array (2 => 86400, 4 => 3600, 6 => 60, 8 => 1);
|
$timegroups = array (2 => 86400, 4 => 3600, 6 => 60, 8 => 1);
|
||||||
|
$matches = array ();
|
||||||
// preg match: 0: full strsing
|
// preg match: 0: full strsing
|
||||||
// 2, 4, 6, 8 are the to need values
|
// 2, 4, 6, 8 are the to need values
|
||||||
preg_match("/^((\d+)d ?)?((\d+)h ?)?((\d+)m ?)?((\d+)s ?)?((\d+)ms)?$/", $timestring, $matches);
|
preg_match("/^((\d+)d ?)?((\d+)h ?)?((\d+)m ?)?((\d+)s ?)?((\d+)ms)?$/", $timestring, $matches);
|
||||||
@@ -1374,7 +1453,10 @@ class Basic
|
|||||||
if (!$hour || !$min) {
|
if (!$hour || !$min) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (($hour < 0 && $hour > 24) || ($min < 0 && $hour > 60) || ($sec && $sec < 0 && $sec > 60)) {
|
if (($hour < 0 || $hour > 24) ||
|
||||||
|
($min < 0 || $min > 60) ||
|
||||||
|
($sec && ($sec < 0 || $sec > 60))
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1446,6 +1528,42 @@ class Basic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: calcDaysInterval
|
||||||
|
// PARAMS: start date, end date
|
||||||
|
// RETURN: overall days, week days, weekend days as array 0...2 or named
|
||||||
|
// DESC : calculates the days between two dates
|
||||||
|
public static function calcDaysInterval($start_date, $end_date, $return_named = false)
|
||||||
|
{
|
||||||
|
// pos 0 all, pos 1 weekday, pos 2 weekend
|
||||||
|
$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;
|
||||||
|
|
||||||
|
$period = new \DatePeriod($start, new \DateInterval('P1D'), $end);
|
||||||
|
|
||||||
|
foreach ($period as $dt) {
|
||||||
|
$curr = $dt->format('D');
|
||||||
|
if ($curr == 'Sat' || $curr == 'Sun') {
|
||||||
|
$days[2] ++;
|
||||||
|
} else {
|
||||||
|
$days[1] ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($return_named === true) {
|
||||||
|
return array (
|
||||||
|
'overall' => $days[0],
|
||||||
|
'weekday' => $days[1],
|
||||||
|
'weekend' => $days[2]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return $days;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: createThumbnail
|
// METHOD: createThumbnail
|
||||||
// WAS : CreateThumbnail
|
// WAS : CreateThumbnail
|
||||||
// PARAMS: pic -> picture where from we create a thumbnail
|
// PARAMS: pic -> picture where from we create a thumbnail
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
$q_vars = '';
|
$q_vars = '';
|
||||||
$q_where = '';
|
$q_where = '';
|
||||||
foreach ($this->table_array as $column => $data_array) {
|
foreach ($this->table_array as $column => $data_array) {
|
||||||
/********************************* START FILE *************************************/
|
/********************************* START FILE *************************************/
|
||||||
// file upload
|
// file upload
|
||||||
if ($this->table_array[$column]['file']) {
|
if ($this->table_array[$column]['file']) {
|
||||||
// falls was im tmp drinnen, sprich ein upload, datei kopieren, Dateinamen in db schreiben
|
// falls was im tmp drinnen, sprich ein upload, datei kopieren, Dateinamen in db schreiben
|
||||||
@@ -381,7 +381,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
} // delete or upload
|
} // delete or upload
|
||||||
} // file IF
|
} // file IF
|
||||||
/********************************* END FILE **************************************/
|
/********************************* END FILE **************************************/
|
||||||
|
|
||||||
// do not write 'pk' (primary key) or 'view' values
|
// 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 (!$this->table_array[$column]['pk'] && $this->table_array[$column]['type'] != 'view' && strlen($column) > 0) {
|
||||||
@@ -425,15 +425,21 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
$q_data .= $_value;
|
$q_data .= $_value;
|
||||||
} else {
|
} else {
|
||||||
// normal string
|
// if the error check is json, we set field to null if NOT set
|
||||||
$q_data .= "'";
|
// else normal string write
|
||||||
// if add slashes do convert & add slashes else write AS is
|
if ($this->table_array[$column]['error_check'] == 'json' && !$this->table_array[$column]['value']) {
|
||||||
if ($addslashes) {
|
$q_data .= 'NULL';
|
||||||
$q_data .= $this->dbEscapeString($this->convertEntities($this->table_array[$column]['value']));
|
|
||||||
} else {
|
} 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 ...
|
} // while ...
|
||||||
|
|||||||
@@ -1259,9 +1259,10 @@ class IO extends \CoreLibs\Basic
|
|||||||
// WAS : db_fetch_array
|
// WAS : db_fetch_array
|
||||||
// PARAMS: cusors -> the cursor from db_exec or pg_query/pg_exec/mysql_query
|
// 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)
|
// 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
|
// RETURN: a mixed row
|
||||||
// DESC : executes a cursor and returns the data, if no more data 0 will be returned
|
// 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 ...
|
// return false if no query or cursor set ...
|
||||||
if (!$cursor) {
|
if (!$cursor) {
|
||||||
@@ -1272,15 +1273,21 @@ class IO extends \CoreLibs\Basic
|
|||||||
$this->__dbError();
|
$this->__dbError();
|
||||||
return false;
|
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
|
// METHOD: dbReturnRow
|
||||||
// WAS : db_return_row
|
// WAS : db_return_row
|
||||||
// PARAMS: query -> the query to be executed
|
// PARAMS: query -> the query to be executed
|
||||||
|
// assoc_only -> if true, only return assoc entry, else both (pgsql)
|
||||||
// RETURN: mixed db result
|
// RETURN: mixed db result
|
||||||
// DESC : returns the FIRST row of the given query
|
// DESC : returns the FIRST row of the given query
|
||||||
public function dbReturnRow($query)
|
public function dbReturnRow($query, $assoc_only = false)
|
||||||
{
|
{
|
||||||
if (!$query) {
|
if (!$query) {
|
||||||
$this->error_id = 11;
|
$this->error_id = 11;
|
||||||
@@ -1294,7 +1301,7 @@ class IO extends \CoreLibs\Basic
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$cursor = $this->dbExec($query);
|
$cursor = $this->dbExec($query);
|
||||||
$result = $this->dbFetchArray($cursor);
|
$result = $this->dbFetchArray($cursor, $assoc_only);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,6 +190,9 @@ class PgSQL
|
|||||||
// DESC : wrapper for pg_fetch_array
|
// DESC : wrapper for pg_fetch_array
|
||||||
public function __dbFetchArray($cursor, $result_type = '')
|
public function __dbFetchArray($cursor, $result_type = '')
|
||||||
{
|
{
|
||||||
|
if ($result_type == true) {
|
||||||
|
$result_type = PGSQL_ASSOC;
|
||||||
|
}
|
||||||
// result type is passed on as is [should be checked]
|
// result type is passed on as is [should be checked]
|
||||||
if ($result_type) {
|
if ($result_type) {
|
||||||
return pg_fetch_array($cursor, null, $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
|
// METHOD: __dbFetchAll
|
||||||
// WAS : _db_fetch_all
|
// WAS : _db_fetch_all
|
||||||
// PARAMS: cursor
|
// PARAMS: cursor
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class L10n extends \CoreLibs\Basic
|
|||||||
|
|
||||||
// override path check
|
// override path check
|
||||||
if (!is_dir($path)) {
|
if (!is_dir($path)) {
|
||||||
$path = INCLUDES.LANG.CONTENT_PATH;
|
$path = BASE.INCLUDES.LANG.CONTENT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mofile = $path.$this->lang.".mo";
|
$this->mofile = $path.$this->lang.".mo";
|
||||||
@@ -70,7 +70,7 @@ class L10n extends \CoreLibs\Basic
|
|||||||
|
|
||||||
// override path check
|
// override path check
|
||||||
if (!is_dir($path)) {
|
if (!is_dir($path)) {
|
||||||
$path = INCLUDES.LANG.CONTENT_PATH;
|
$path = BASE.INCLUDES.LANG.CONTENT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mofile = $path.$this->lang.".mo";
|
$this->mofile = $path.$this->lang.".mo";
|
||||||
|
|||||||
@@ -844,6 +844,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
//if ($value['mandatory'] && $value['error_check'])
|
//if ($value['mandatory'] && $value['error_check'])
|
||||||
// if error value set && somethign input, check if input okay
|
// if error value set && somethign input, check if input okay
|
||||||
if ($value['error_check'] && $this->table_array[$key]['value']) {
|
if ($value['error_check'] && $this->table_array[$key]['value']) {
|
||||||
|
$this->debug('ERROR CHECK', 'Key: '.$key.' => '.$value['error_check']);
|
||||||
// each error check can be a piped seperated value, lets split it
|
// each error check can be a piped seperated value, lets split it
|
||||||
// $this->debug('edit', $value['error_check']);
|
// $this->debug('edit', $value['error_check']);
|
||||||
foreach (explode('|', $value['error_check']) as $error_check) {
|
foreach (explode('|', $value['error_check']) as $error_check) {
|
||||||
@@ -918,6 +919,14 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
// error
|
// error
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'json':
|
||||||
|
// check if valid json
|
||||||
|
$json_out = json_decode($this->table_array[$key]['value'], true);
|
||||||
|
$this->debug('JSON ENCODE', 'LAST ERROR: '.json_last_error());
|
||||||
|
if (json_last_error()) {
|
||||||
|
$this->msg .= sprintf($this->l->__('Please enter a valid JSON string for the field <b>%s<b>: %s'), $this->table_array[$key]['output_name'], json_last_error_msg());
|
||||||
|
}
|
||||||
|
break;
|
||||||
} // switch
|
} // switch
|
||||||
} // for each error to check
|
} // for each error to check
|
||||||
} elseif ($value['mandatory'] &&
|
} elseif ($value['mandatory'] &&
|
||||||
@@ -1351,11 +1360,11 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
}
|
}
|
||||||
// set type and boundaries for insert/update
|
// set type and boundaries for insert/update
|
||||||
if ($data_array['pk_id'] && $_POST[$prfx.$el_name][$i]) {
|
if ($data_array['pk_id'] && $_POST[$prfx.$el_name][$i]) {
|
||||||
$q_begin[$i] = 'UPDATE $table_name SET ';
|
$q_begin[$i] = 'UPDATE '.$table_name.' SET ';
|
||||||
$q_end[$i] = ' WHERE $el_name = '.$_POST[$prfx.$el_name][$i];
|
$q_end[$i] = ' WHERE '.$el_name.' = '.$_POST[$prfx.$el_name][$i];
|
||||||
$type[$i] = 'update';
|
$type[$i] = 'update';
|
||||||
} elseif ($data_array['pk_id'] && !$_POST[$prfx.$el_name][$i]) {
|
} elseif ($data_array['pk_id'] && !$_POST[$prfx.$el_name][$i]) {
|
||||||
$q_begin[$i] = 'INSERT INTO $table_name (';
|
$q_begin[$i] = 'INSERT INTO '.$table_name.' (';
|
||||||
$q_middle[$i] = ') VALUES (';
|
$q_middle[$i] = ') VALUES (';
|
||||||
$q_end[$i] = ')';
|
$q_end[$i] = ')';
|
||||||
$type[$i] = 'insert';
|
$type[$i] = 'insert';
|
||||||
@@ -1585,7 +1594,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
if ($data_array['type'] == 'drop_down_db') {
|
if ($data_array['type'] == 'drop_down_db') {
|
||||||
$md_q = md5($data_array['query']);
|
$md_q = md5($data_array['query']);
|
||||||
while ($res = $this->dbReturn($data_array['query'])) {
|
while ($res = $this->dbReturn($data_array['query'])) {
|
||||||
$this->debug('edit', 'Q[$md_q] pos: '.$this->cursor_ext[$md_q]['pos'].' | want: '.$data_array['preset'].' | set: '.$data['preset'][$el_name]);
|
$this->debug('edit', 'Q['.$md_q.'] pos: '.$this->cursor_ext[$md_q]['pos'].' | want: '.$data_array['preset'].' | set: '.$data['preset'][$el_name]);
|
||||||
// first is default for this element
|
// first is default for this element
|
||||||
if (!$data['preset'][$el_name] && ($this->cursor_ext[$md_q]['pos'] == $data_array['preset'])) {
|
if (!$data['preset'][$el_name] && ($this->cursor_ext[$md_q]['pos'] == $data_array['preset'])) {
|
||||||
$data['preset'][$el_name] = $res[0];
|
$data['preset'][$el_name] = $res[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user