Completed
Push — master ( 19a73f...703022 )
by Jean-Christophe
04:09
created

Semantic::htmlAccordionMenu()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Ajax;
4
5
use Ajax\common\BaseGui;
6
use Ajax\semantic\traits\SemanticComponentsTrait;
7
use Ajax\semantic\traits\SemanticHtmlElementsTrait;
8
use Ajax\semantic\traits\SemanticHtmlCollectionsTrait;
9
use Ajax\semantic\traits\SemanticHtmlModulesTrait;
10
use Ajax\semantic\traits\SemanticHtmlViewsTrait;
11
use Ajax\semantic\traits\SemanticWidgetsTrait;
12
13
class Semantic extends BaseGui {
14
	use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait,
15
	SemanticHtmlModulesTrait,SemanticHtmlViewsTrait,SemanticWidgetsTrait;
16
17
	private $language;
18
19
	public function __construct($autoCompile=true) {
20
		parent::__construct($autoCompile=true);
21
	}
22
23
24
	public function setLanguage($language){
25
		if($language!==$this->language){
26
			$file=\realpath(dirname(__FILE__)."/semantic/components/validation/languages/".$language.".js");
27
			if(\file_exists($file)){
28
				$script=\file_get_contents($file);
29
				$this->js->exec($script,true);
30
				$this->language=$language;
31
			}
32
		}
33
	}
34
}