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
latoilescoute-dev
scoodle
Commits
ea3e391b
Commit
ea3e391b
authored
Mar 19, 2018
by
Thomas Citharel
Browse files
Fix datepicker locale path
Closes #279 Signed-off-by:
Thomas Citharel
<
tcit@tcit.fr
>
parent
0e022f51
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/inc/smarty.php
View file @
ea3e391b
...
...
@@ -75,3 +75,30 @@ function smarty_modifier_addslashes_single_quote($string) {
function
smarty_modifier_html
(
$html
)
{
return
Utils
::
htmlEscape
(
$html
);
}
function
smarty_modifier_datepicker_path
(
$lang
)
{
$i
=
0
;
while
(
!
is_file
(
path_for_datepicker_locale
(
$lang
))
&&
$i
<
3
)
{
$lang_arr
=
explode
(
'-'
,
$lang
);
if
(
$lang_arr
&&
count
(
$lang_arr
)
>
1
)
{
$lang
=
$lang_arr
[
0
];
}
else
{
$lang
=
'en'
;
}
$i
+=
1
;
}
return
'js/locales/bootstrap-datepicker.'
.
$lang
.
'.js'
;
}
function
smarty_modifier_locale_2_lang
(
$locale
)
{
$lang_arr
=
explode
(
'-'
,
$locale
);
if
(
$lang_arr
&&
count
(
$lang_arr
)
>
1
)
{
return
$lang_arr
[
0
];
}
else
{
return
$locale
;
}
}
function
path_for_datepicker_locale
(
$lang
)
{
return
__DIR__
.
'/../../js/locales/bootstrap-datepicker.'
.
$lang
.
'.js'
;
}
tpl/page.tpl
View file @
ea3e391b
...
...
@@ -23,8 +23,8 @@
<script
type=
"text/javascript"
src=
"
{
'js/jquery-1.12.4.min.js'
|
resource
}
"
></script>
<script
type=
"text/javascript"
src=
"
{
'js/bootstrap.min.js'
|
resource
}
"
></script>
<script
type=
"text/javascript"
src=
"
{
'js/bootstrap-datepicker.js'
|
resource
}
"
></script>
{
if
"
en
"
!=
$locale
}
<script
type=
"text/javascript"
src=
"
{
"js/
locale
s/bootstrap-datepicker.$locale.js"
|
resource
}
"
></script>
{
if
'
en
'
!=
$locale
}
<script
type=
"text/javascript"
src=
"
{
$
locale
|
datepicker_path
|
resource
}
"
></script>
{/
if
}
<script
type=
"text/javascript"
src=
"
{
'js/core.js'
|
resource
}
"
></script>
...
...
tpl/part/description_markdown.tpl
View file @
ea3e391b
...
...
@@ -26,9 +26,9 @@
</p>
<p>
{__('Step 1', 'More informations here:')}
<a
href=
"http://
{
$locale
}
.wikipedia.org/wiki/Markdown"
>
http://
{
$locale
}
.wikipedia.org/wiki/Markdown
</a>
<a
href=
"http://
{
$locale
|
locale_2_lang
}
.wikipedia.org/wiki/Markdown"
>
http://
{
$locale
|
locale_2_lang
}
.wikipedia.org/wiki/Markdown
</a>
</p>
</div>
</div>
</div>
</div>
\ No newline at end of file
</div>
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