-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlang.php
More file actions
29 lines (29 loc) · 781 Bytes
/
lang.php
File metadata and controls
29 lines (29 loc) · 781 Bytes
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
<?php
/**
* Created by PhpStorm.
* User: erik
* Date: 4/19/17
* Time: 8:50 AM
*/
$sep = new template('lang.sep');
$sep = $sep->parse();
$count = 0;
// väljastame kõik olemasolevad keeled
foreach ($siteLangs as $lang_id=>$lang_name){
$count++;
// paneme keele id järgi aktiivne element
if($lang_id == LANG_ID){
$item = new template('lang.active');
} else {
$item = new template('lang.item');
}
// koostame keele riba väljund
$link = $http->getLink(array('lang_id'=>$lang_id), array('act', 'page_id'), array('lang_id'));
$item->set('link', $link);
$item->set('name', tr($lang_name));
$main_tmpl->add('lang_bar', $item->parse());
if($count < count($siteLangs)){
$main_tmpl->add('lang_bar', $sep);
}
}
?>