forked from giterlizzi/dokuwiki-template-bootstrap3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tpl_translation.php
executable file
·38 lines (31 loc) · 1.35 KB
/
tpl_translation.php
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
<?php
/**
* DokuWiki Bootstrap3 Template: Translation Plugin
*
* @link http://dokuwiki.org/template:bootstrap3
* @author Giuseppe Di Terlizzi <[email protected]>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
if (bootstrap3_conf('showTranslation') && $translation = plugin_load('helper','translation')) {
if ($translation->istranslatable($INFO['id'])) {
$translation->checkage();
list($lc, $idpart) = $translation->getTransParts($INFO['id']);
$trans_items = '';
$trans_label = $translation->getLang('translations');
foreach ($translation->translations as $trans) {
$trans_items .= str_replace(array('<div class="li">', '</div>'), '', $translation->getTransItem($trans, $idpart));
}
?>
<ul class="nav navbar-nav" id="dw__translation">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="<?php echo $trans_label ?>">
<i class="fa fa-fw fa-flag"></i> <span class="hidden-lg hidden-md hidden-sm"><?php echo $trans_label ?></span><span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-header hidden-xs hidden-sm"><i class="fa fa-fw fa-flag"></i> <?php echo $trans_label ?></li>
<?php echo $trans_items ?>
</ul>
</ul>
<?php } } ?>