Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 216091e

Browse files
committed
add style property in Semantic
1 parent 79b2527 commit 216091e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎Ajax/Semantic.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Semantic extends BaseGui {
1616

1717
private $language;
1818

19+
private $style;
20+
1921
public function __construct($autoCompile=true) {
2022
parent::__construct($autoCompile);
2123
}
@@ -31,4 +33,26 @@ public function setLanguage($language){
3133
}
3234
}
3335
}
36+
37+
public function compile($internal = false) {
38+
if($this->style!=null){
39+
parent::compile($internal);
40+
}else {
41+
if ($internal === false && $this->autoCompile === true)
42+
throw new \Exception("Impossible to compile if autoCompile is set to 'true'");
43+
$style=$this->style;
44+
foreach ($this->components as $component) {
45+
$component->addToProperty("class", $style);
46+
$component->compile();
47+
}
48+
}
49+
}
50+
51+
public function setStyle($style='inverted'){
52+
$this->style=$style;
53+
}
54+
55+
public function getStyle(){
56+
return $this->style;
57+
}
3458
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /