-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helpers.php
50 lines (34 loc) · 1.13 KB
/
Helpers.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
39
40
41
42
43
44
45
46
47
48
49
50
<?php namespace components\language; if(!defined('TX')) die('No direct access.');
class Helpers extends \dependencies\BaseComponent
{
protected
$permissions = array(
'get_languages' => 0
);
public function create_language_tabs($options = null)
{
$options = Data($options);
$ret = '<ul class="language-tabs clearfix">';
$languages = $this->helper('get_languages', $options);
if($languages->size() > 1){
$languages->each(function($row)use($options, &$ret){
$ret .=
'<li id="tabber-'.$row->id.'"><a href="#tab-'.$row->id.'">'.
//($row->image_id->is_set() ? '<img class="label-language-flag" src="'.url('section=media/image&resize=0/16&id='.$row->image_id).'" />' : '').
($options->display_as->check('empty') ? $row->{$options->display_as} : $row->title).
'</a></li>';
});
}
$ret .= '</ul>';
return $ret;
}
public function get_languages($options = null)
{
$options =
Data($options);
return
$this
->table('Languages')
->execute();
}
}