Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Dirk Dankhoff
ISPConfig 3
Commits
e83dd14b
Commit
e83dd14b
authored
Aug 05, 2011
by
tbrehm
Browse files
- Improved lng function ai app.inc.php
- Fixed date handling functions in remoting library.
parent
031054bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/lib/app.inc.php
View file @
e83dd14b
...
...
@@ -158,11 +158,12 @@ class app {
/** Translates strings in current language */
public
function
lng
(
$text
)
{
if
(
$this
->
_language_inc
!=
1
)
{
$language
=
(
isset
(
$_SESSION
[
's'
][
'language'
]))
?
$_SESSION
[
's'
][
'language'
]
:
$conf
[
'language'
];
//* loading global Wordbook
$this
->
load_language_file
(
'
/
lib/lang/'
.
$
_SESSION
[
's'
][
'
language
'
]
.
'.lng'
);
$this
->
load_language_file
(
'lib/lang/'
.
$language
.
'.lng'
);
//* Load module wordbook, if it exists
if
(
isset
(
$_SESSION
[
's'
][
'module'
][
'name'
])
&&
isset
(
$_SESSION
[
's'
][
'language'
])
)
{
$lng_file
=
'
/
web/'
.
$_SESSION
[
's'
][
'module'
][
'name'
]
.
'/lib/lang/'
.
$
_SESSION
[
's'
][
'
language
'
]
.
'.lng'
;
if
(
isset
(
$_SESSION
[
's'
][
'module'
][
'name'
]))
{
$lng_file
=
'web/'
.
$_SESSION
[
's'
][
'module'
][
'name'
]
.
'/lib/lang/'
.
$language
.
'.lng'
;
if
(
!
file_exists
(
ISPC_ROOT_PATH
.
'/'
.
$lng_file
))
$lng_file
=
'/web/'
.
$_SESSION
[
's'
][
'module'
][
'name'
]
.
'/lib/lang/en.lng'
;
$this
->
load_language_file
(
$lng_file
);
}
...
...
interface/lib/classes/remoting_lib.inc.php
View file @
e83dd14b
...
...
@@ -325,10 +325,18 @@ class remoting_lib {
break
;
case
'DATE'
:
if
(
$record
[
$key
]
!=
''
&&
$record
[
$key
]
!=
'0000-00-00'
)
{
list
(
$tag
,
$monat
,
$jahr
)
=
explode
(
'.'
,
$record
[
$key
]);
$new_record
[
$key
]
=
$jahr
.
'-'
.
$monat
.
'-'
.
$tag
;
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
if
(
function_exists
(
'date_parse_from_format'
))
{
$date_parts
=
date_parse_from_format
(
$this
->
dateformat
,
$record
[
$key
]);
//list($tag,$monat,$jahr) = explode('.',$record[$key]);
$new_record
[
$key
]
=
$date_parts
[
'year'
]
.
'-'
.
$date_parts
[
'month'
]
.
'-'
.
$date_parts
[
'day'
];
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
}
else
{
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
$tmp
=
strtotime
(
$record
[
$key
]);
$new_record
[
$key
]
=
date
(
'Y-m-d'
,
$tmp
);
}
}
else
{
$new_record
[
$key
]
=
'0000-00-00'
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment