Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
80708df7
Commit
80708df7
authored
Oct 05, 2006
by
Penny Leach
Browse files
fixing bugs in get_string
parent
145541d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
80708df7
...
...
@@ -93,12 +93,11 @@ function get_string($identifier,$section) {
}
// Define the locations of language strings for this section
$libroot
=
get_config
(
'libroot'
);
$docroot
=
get_config
(
'docroot'
);
$locations
=
array
();
if
(
$section
==
'mahara'
||
$section
!=
'langconfig'
)
{
$locations
[]
=
$
lib
root
.
'lang/'
;
$locations
[]
=
$
doc
root
.
'lang/'
;
}
else
{
$extras
=
array
(
'artefacts'
,
'auth'
);
// more later..
foreach
(
$extras
as
$tocheck
)
{
...
...
@@ -113,7 +112,7 @@ function get_string($identifier,$section) {
foreach
(
$locations
as
$location
)
{
//if local directory not found, or particular string does not exist in local direcotry
$langfile
=
$location
.
$lang
.
'/'
.
$section
.
'.php'
;
if
(
file_exists
(
$langfile
))
{
if
(
is_readable
(
$langfile
))
{
if
(
$result
=
get_string_from_file
(
$identifier
,
$langfile
))
{
return
format_langstring
(
$result
,
$variables
);
}
...
...
@@ -130,10 +129,10 @@ function get_string($identifier,$section) {
foreach
(
$locations
as
$location
)
{
$langfile
=
$location
.
$lang
.
'/langconfig.php'
;
if
(
file_exists
(
$langfile
))
{
if
(
is_readable
(
$langfile
))
{
if
(
$parentlang
=
get_string_from_file
(
'parentlanguage'
,
$langfile
))
{
$langfile
=
$location
.
$parentlang
.
'/'
.
$section
.
'.php'
;
if
(
file_exists
(
$langfile
))
{
if
(
is_readable
(
$langfile
))
{
if
(
$result
=
get_string_from_file
(
$identifier
,
$langfile
))
{
return
format_langstring
(
$result
,
$variables
);
}
...
...
@@ -146,7 +145,7 @@ function get_string($identifier,$section) {
foreach
(
$locations
as
$location
)
{
//if local_en not found, or string not found in local_en
$langfile
=
$location
.
'en.utf8/'
.
$module
.
'.php'
;
if
(
file_exists
(
$langfile
))
{
if
(
is_readable
(
$langfile
))
{
if
(
$result
=
get_string_from_file
(
$identifier
,
$langfile
))
{
return
format_langstring
(
$result
,
$variables
);
}
...
...
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