/
Set.php
47 lines (41 loc) · 1.06 KB
/
Set.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
<?php
namespace Concrete\Core\StyleCustomizer;
class Set
{
protected $name;
protected $elements = array();
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
/** Returns the display name for this style set (localized and escaped accordingly to $format)
* @param string $format = 'html'
* Escape the result in html format (if $format is 'html').
* If $format is 'text' or any other value, the display name won't be escaped.
*
* @return string
*/
public function getDisplayName($format = 'html')
{
$value = tc('StyleSetName', $this->getName());
switch ($format) {
case 'html':
return h($value);
case 'text':
default:
return $value;
}
}
public function addStyle(\Concrete\Core\StyleCustomizer\Style\Style $style)
{
$this->styles[] = $style;
}
public function getStyles()
{
return $this->styles;
}
}