Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba89b188d9 | ||
|
|
d15618cde4 |
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
base_folder='/var/www/html/developers/clemens/core_data/php_libraries/trunk/www/';
|
BASE_FOLDER=$(dirname $(readlink -f $0))"/";
|
||||||
|
# Assume script is in 4dev/bin
|
||||||
|
base_folder="${BASE_FOLDER}../../www/";
|
||||||
|
|
||||||
# locale gettext po to mo translator master
|
# locale gettext po to mo translator master
|
||||||
for file in $(ls -1 ${base_folder}../4dev/locale/*.po); do
|
for file in $(ls -1 ${base_folder}../4dev/locale/*.po); do
|
||||||
|
|||||||
@@ -19,5 +19,4 @@ lib/CoreLibs/DB/Extended/ArrayIO.php
|
|||||||
lib/CoreLibs/Convert/MimeEncode.php
|
lib/CoreLibs/Convert/MimeEncode.php
|
||||||
lib/CoreLibs/Create/Email.php
|
lib/CoreLibs/Create/Email.php
|
||||||
lib/CoreLibs/Output/Form/Generate.php
|
lib/CoreLibs/Output/Form/Generate.php
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -457,6 +457,8 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$pathinfo = pathinfo($output_file);
|
$pathinfo = pathinfo($output_file);
|
||||||
if (!empty($pathinfo['dirname'])) {
|
if (!empty($pathinfo['dirname'])) {
|
||||||
$pathinfo['dirname'] .= DIRECTORY_SEPARATOR;
|
$pathinfo['dirname'] .= DIRECTORY_SEPARATOR;
|
||||||
|
} else {
|
||||||
|
$pathinfo['dirname'] = '';
|
||||||
}
|
}
|
||||||
if ($t_q) {
|
if ($t_q) {
|
||||||
$t_q .= ', ';
|
$t_q .= ', ';
|
||||||
|
|||||||
@@ -1329,11 +1329,12 @@ function createLoginRow(login_string, header_id = 'mainHeader') // eslint-disabl
|
|||||||
}
|
}
|
||||||
// clear out just in case for first entry
|
// clear out just in case for first entry
|
||||||
// fill with div name & login/logout button
|
// fill with div name & login/logout button
|
||||||
$('#loginRow').html(phfo(cel('div', '', login_string)));
|
$('#loginRow').html(phfo(cel('div', 'loginRow-name', login_string)));
|
||||||
|
$('#loginRow').append(phfo(cel('div', 'loginRow-info', '')));
|
||||||
$('#loginRow').append(phfo(
|
$('#loginRow').append(phfo(
|
||||||
aelx(
|
aelx(
|
||||||
// outer div
|
// outer div
|
||||||
cel('div'),
|
cel('div', 'loginRow-logout'),
|
||||||
// inner element
|
// inner element
|
||||||
cel('input', 'logout', '', [], {
|
cel('input', 'logout', '', [], {
|
||||||
value: __('Logout'),
|
value: __('Logout'),
|
||||||
@@ -1386,6 +1387,8 @@ function createNavMenu(nav_menu, header_id = 'mainHeader') // eslint-disable-lin
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#menuRow').html(content.join(''));
|
$('#menuRow').html(content.join(''));
|
||||||
|
} else {
|
||||||
|
$('#menuRow').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class Basic
|
|||||||
// logging interface, Debug\Logging class
|
// logging interface, Debug\Logging class
|
||||||
/** @var \CoreLibs\Debug\Logging */
|
/** @var \CoreLibs\Debug\Logging */
|
||||||
public $log;
|
public $log;
|
||||||
/** @var\CoreLibs\Create\Session */
|
/** @var \CoreLibs\Create\Session */
|
||||||
public $session;
|
public $session;
|
||||||
|
|
||||||
// email valid checks
|
// email valid checks
|
||||||
|
|||||||
@@ -312,16 +312,17 @@ class DateTime
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* plits & checks date, wrap around for check_date function
|
* compares two dates, tries to convert them via strtotime to timestamps
|
||||||
* returns int in:
|
* returns int/bool in:
|
||||||
* -1 if the first date is smaller the last
|
* -1 if the first date is smaller the last
|
||||||
* 0 if both are equal
|
* 0 if both are equal
|
||||||
* 1 if the first date is bigger than the last
|
* 1 if the first date is bigger than the last
|
||||||
* false (bool): error
|
* false if date validation/conversion failed
|
||||||
*
|
*
|
||||||
* @param string $start_date start date string in YYYY-MM-DD
|
* @param string $start_date start date string in YYYY-MM-DD
|
||||||
* @param string $end_date end date string in YYYY-MM-DD
|
* @param string $end_date end date string in YYYY-MM-DD
|
||||||
* @return int|bool false on error, or int -1/0/1 as difference
|
* @return int|bool false on error
|
||||||
|
* or int -1 (s<e)/0 (s=e)/1 (s>e) as difference
|
||||||
*/
|
*/
|
||||||
public static function compareDate($start_date, $end_date)
|
public static function compareDate($start_date, $end_date)
|
||||||
{
|
{
|
||||||
@@ -354,16 +355,17 @@ class DateTime
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* compares the two dates + times. if seconds missing in one set,
|
* compares the two dates + times. if seconds missing in one set,
|
||||||
* add :00, converts / to -
|
* adds :00, converts date + times via strtotime to timestamps
|
||||||
* returns int/bool in:
|
* returns int/bool in:
|
||||||
* -1 if the first date is smaller the last
|
* -1 if the first date is smaller the last
|
||||||
* 0 if both are equal
|
* 0 if both are equal
|
||||||
* 1 if the first date is bigger than the last
|
* 1 if the first date is bigger than the last
|
||||||
* false if no valid date/times chould be found
|
* false if date/times validation/conversion failed
|
||||||
*
|
*
|
||||||
* @param string $start_datetime start date/time in YYYY-MM-DD HH:mm:ss
|
* @param string $start_datetime start date/time in YYYY-MM-DD HH:mm:ss
|
||||||
* @param string $end_datetime end date/time in YYYY-MM-DD HH:mm:ss
|
* @param string $end_datetime end date/time in YYYY-MM-DD HH:mm:ss
|
||||||
* @return int|bool false for error or -1/0/1 as difference
|
* @return int|bool false for error
|
||||||
|
* or -1 (s<e)/0 (s=e)/1 (s>e) as difference
|
||||||
*/
|
*/
|
||||||
public static function compareDateTime($start_datetime, $end_datetime)
|
public static function compareDateTime($start_datetime, $end_datetime)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -779,7 +779,6 @@ class PgSQL implements \CoreLibs\DB\SQL\SqlInterface\SqlFunctions
|
|||||||
}
|
}
|
||||||
// get result
|
// get result
|
||||||
$db_schema = $this->__dbFetchArray($cursor, PGSQL_ASSOC);
|
$db_schema = $this->__dbFetchArray($cursor, PGSQL_ASSOC);
|
||||||
/** @phpstan-ignore-next-line Cannot access offset string on array|bool */
|
|
||||||
return $db_schema[$show_string] ?? '';
|
return $db_schema[$show_string] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,7 +805,6 @@ class PgSQL implements \CoreLibs\DB\SQL\SqlInterface\SqlFunctions
|
|||||||
}
|
}
|
||||||
// check if schema does not exists
|
// check if schema does not exists
|
||||||
$row = $this->__dbFetchArray($cursor, PGSQL_ASSOC);
|
$row = $this->__dbFetchArray($cursor, PGSQL_ASSOC);
|
||||||
/** @phpstan-ignore-next-line */
|
|
||||||
if (empty($row['exists']) || $row['exists'] == 'f') {
|
if (empty($row['exists']) || $row['exists'] == 'f') {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ class SmartyExtend extends \Smarty
|
|||||||
public $CSS_TEMPLATE_NAME;
|
public $CSS_TEMPLATE_NAME;
|
||||||
/** @var string|null */
|
/** @var string|null */
|
||||||
public $TEMPLATE_TRANSLATE;
|
public $TEMPLATE_TRANSLATE;
|
||||||
|
/** @var string|null */
|
||||||
|
public $JS_TRANSLATE;
|
||||||
// core group
|
// core group
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $JS_CORE_TEMPLATE_NAME;
|
public $JS_CORE_TEMPLATE_NAME;
|
||||||
@@ -317,14 +319,14 @@ class SmartyExtend extends \Smarty
|
|||||||
}
|
}
|
||||||
// javascript translate data as template for auto translate
|
// javascript translate data as template for auto translate
|
||||||
if (empty($this->TEMPLATE_TRANSLATE)) {
|
if (empty($this->TEMPLATE_TRANSLATE)) {
|
||||||
$this->TEMPLATE_TRANSLATE = 'jsTranslate_'
|
$this->TEMPLATE_TRANSLATE = 'jsTranslate-'
|
||||||
. $this->locale_set . '.' . $this->encoding
|
. $this->locale_set . '.' . $this->encoding
|
||||||
. '.tpl';
|
. '.tpl';
|
||||||
} else {
|
} else {
|
||||||
// we assume we have some fixed set
|
// we assume we have some fixed set
|
||||||
// we must add _<$this->lang>
|
// we must add _<locale>.<encoding>
|
||||||
// if .tpl, put before .tpl
|
// if .tpl, put before .tpl
|
||||||
// if not .tpl, add _<$this->lang>.tpl
|
// if not .tpl, add _<locale>.<encoding>.tpl
|
||||||
if (strpos($this->TEMPLATE_TRANSLATE, '.tpl')) {
|
if (strpos($this->TEMPLATE_TRANSLATE, '.tpl')) {
|
||||||
$this->TEMPLATE_TRANSLATE = str_replace(
|
$this->TEMPLATE_TRANSLATE = str_replace(
|
||||||
'.tpl',
|
'.tpl',
|
||||||
@@ -332,7 +334,7 @@ class SmartyExtend extends \Smarty
|
|||||||
$this->TEMPLATE_TRANSLATE
|
$this->TEMPLATE_TRANSLATE
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->TEMPLATE_TRANSLATE .= '_'
|
$this->TEMPLATE_TRANSLATE .= '-'
|
||||||
. $this->locale_set . '.' . $this->encoding
|
. $this->locale_set . '.' . $this->encoding
|
||||||
. '.tpl';
|
. '.tpl';
|
||||||
}
|
}
|
||||||
@@ -341,6 +343,31 @@ class SmartyExtend extends \Smarty
|
|||||||
if (!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->TEMPLATE_TRANSLATE)) {
|
if (!file_exists($this->getTemplateDir()[0] . DIRECTORY_SEPARATOR . $this->TEMPLATE_TRANSLATE)) {
|
||||||
$this->TEMPLATE_TRANSLATE = null;
|
$this->TEMPLATE_TRANSLATE = null;
|
||||||
}
|
}
|
||||||
|
if (empty($this->JS_TRANSLATE)) {
|
||||||
|
$this->JS_TRANSLATE = 'translate-'
|
||||||
|
. $this->locale_set . '.' . $this->encoding . '.js';
|
||||||
|
} else {
|
||||||
|
// we assume we have some fixed set
|
||||||
|
// we must add _<locale>.<encoding>
|
||||||
|
// if .js, put before .js
|
||||||
|
// if not .js, add _<locale>.<encoding>.js
|
||||||
|
if (strpos($this->JS_TRANSLATE, '.js')) {
|
||||||
|
$this->JS_TRANSLATE = str_replace(
|
||||||
|
'.js',
|
||||||
|
'-' . $this->locale_set . '.' . $this->encoding . '.js',
|
||||||
|
$this->JS_TRANSLATE
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->JS_TRANSLATE .= '-'
|
||||||
|
. $this->locale_set . '.' . $this->encoding
|
||||||
|
. '.js';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!file_exists($this->JAVASCRIPT . $this->JS_TRANSLATE)) {
|
||||||
|
$this->JS_TRANSLATE = null;
|
||||||
|
} else {
|
||||||
|
$this->JS_TRANSLATE = $this->JAVASCRIPT . $this->JS_TRANSLATE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -469,6 +496,7 @@ class SmartyExtend extends \Smarty
|
|||||||
$this->DATA['TEMPLATE_NAME'] = $this->TEMPLATE_NAME;
|
$this->DATA['TEMPLATE_NAME'] = $this->TEMPLATE_NAME;
|
||||||
$this->DATA['CONTENT_INCLUDE'] = $this->CONTENT_INCLUDE;
|
$this->DATA['CONTENT_INCLUDE'] = $this->CONTENT_INCLUDE;
|
||||||
$this->DATA['TEMPLATE_TRANSLATE'] = $this->TEMPLATE_TRANSLATE ?? null;
|
$this->DATA['TEMPLATE_TRANSLATE'] = $this->TEMPLATE_TRANSLATE ?? null;
|
||||||
|
$this->DATA['JS_TRANSLATE'] = $this->JS_TRANSLATE ?? null;
|
||||||
$this->DATA['PAGE_FILE_NAME'] = str_replace('.php', '', $this->page_name) . '.tpl';
|
$this->DATA['PAGE_FILE_NAME'] = str_replace('.php', '', $this->page_name) . '.tpl';
|
||||||
// render page
|
// render page
|
||||||
$this->renderSmarty();
|
$this->renderSmarty();
|
||||||
|
|||||||
Reference in New Issue
Block a user