default.php
4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* @package Joomla.Site
* @subpackage mod_languages
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('stylesheet', 'mod_languages/template.css', array('version' => 'auto', 'relative' => true));
if ($params->get('dropdown', 0) && !$params->get('dropdownimage', 1))
{
JHtml::_('formbehavior.chosen');
}
?>
<div class="mod-languages<?php echo $moduleclass_sfx; ?>">
<?php if ($headerText) : ?>
<div class="pretext"><p><?php echo $headerText; ?></p></div>
<?php endif; ?>
<?php if ($params->get('dropdown', 0) && !$params->get('dropdownimage', 1)) : ?>
<form name="lang" method="post" action="<?php echo htmlspecialchars_decode(htmlspecialchars(JUri::current(), ENT_COMPAT, 'UTF-8'), ENT_NOQUOTES); ?>">
<select class="inputbox advancedSelect" onchange="document.location.replace(this.value);" >
<?php foreach ($list as $language) : ?>
<option dir=<?php echo $language->rtl ? '"rtl"' : '"ltr"'; ?> value="<?php echo htmlspecialchars_decode(htmlspecialchars($language->link, ENT_QUOTES, 'UTF-8'), ENT_NOQUOTES); ?>" <?php echo $language->active ? 'selected="selected"' : ''; ?>>
<?php echo $language->title_native; ?></option>
<?php endforeach; ?>
</select>
</form>
<?php elseif ($params->get('dropdown', 0) && $params->get('dropdownimage', 1)) : ?>
<div class="btn-group">
<?php foreach ($list as $language) : ?>
<?php if ($language->active) : ?>
<a href="#" data-toggle="dropdown" class="btn dropdown-toggle">
<span class="caret"></span>
<?php if ($language->image) : ?>
<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', '', null, true); ?>
<?php endif; ?>
<?php echo $language->title_native; ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
<ul class="<?php echo $params->get('lineheight', 0) ? 'lang-block' : 'lang-inline'; ?> dropdown-menu" dir="<?php echo JFactory::getLanguage()->isRtl() ? 'rtl' : 'ltr'; ?>">
<?php foreach ($list as $language) : ?>
<?php if (!$language->active) : ?>
<li>
<a href="<?php echo htmlspecialchars_decode(htmlspecialchars($language->link, ENT_QUOTES, 'UTF-8'), ENT_NOQUOTES); ?>">
<?php if ($language->image) : ?>
<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', '', null, true); ?>
<?php endif; ?>
<?php echo $language->title_native; ?>
</a>
</li>
<?php elseif ($params->get('show_active', 1)) : ?>
<?php $base = JUri::getInstance(); ?>
<li class="lang-active">
<a href="<?php echo htmlspecialchars_decode(htmlspecialchars($base, ENT_QUOTES, 'UTF-8'), ENT_NOQUOTES); ?>">
<?php if ($language->image) : ?>
<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', '', null, true); ?>
<?php endif; ?>
<?php echo $language->title_native; ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php else : ?>
<ul class="<?php echo $params->get('inline', 1) ? 'lang-inline' : 'lang-block'; ?>" dir="<?php echo JFactory::getLanguage()->isRtl() ? 'rtl' : 'ltr'; ?>">
<?php foreach ($list as $language) : ?>
<?php if (!$language->active) : ?>
<li>
<a href="<?php echo htmlspecialchars_decode(htmlspecialchars($language->link, ENT_QUOTES, 'UTF-8'), ENT_NOQUOTES); ?>">
<?php if ($params->get('image', 1)) : ?>
<?php if ($language->image) : ?>
<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', $language->title_native, array('title' => $language->title_native), true); ?>
<?php else : ?>
<span class="label"><?php echo strtoupper($language->sef); ?></span>
<?php endif; ?>
<?php else : ?>
<?php echo $params->get('full_name', 1) ? $language->title_native : strtoupper($language->sef); ?>
<?php endif; ?>
</a>
</li>
<?php elseif ($params->get('show_active', 1)) : ?>
<?php $base = JUri::getInstance(); ?>
<li class="lang-active">
<a href="<?php echo htmlspecialchars_decode(htmlspecialchars($base, ENT_QUOTES, 'UTF-8'), ENT_NOQUOTES); ?>">
<?php if ($params->get('image', 1)) : ?>
<?php if ($language->image) : ?>
<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', $language->title_native, array('title' => $language->title_native), true); ?>
<?php else : ?>
<span class="label"><?php echo strtoupper($language->sef); ?></span>
<?php endif; ?>
<?php else : ?>
<?php echo $params->get('full_name', 1) ? $language->title_native : strtoupper($language->sef); ?>
<?php endif; ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if ($footerText) : ?>
<div class="posttext"><p><?php echo $footerText; ?></p></div>
<?php endif; ?>
</div>