Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
seo.php
1
<?php
2
namespace
Bitrix\Landing\Source
;
3
4
class
Seo
5
{
6
const
TITLE
=
'title'
;
7
const
BROWSER_TITLE
=
'browser_title'
;
8
const
KEYWORDS
=
'keywords'
;
9
const
DESCRIPTION
=
'description'
;
10
12
protected
$properties
= [];
13
14
public
function
__construct
()
15
{
16
17
}
18
23
public
function
setProperties
(array $values)
24
{
25
$values = array_filter($values, [__CLASS__,
'clearValues'
], ARRAY_FILTER_USE_BOTH);
26
if
(!empty($values))
27
{
28
$this->properties = array_merge($this->properties, $values);
29
}
30
}
31
37
public
function
setProperty
($name, $value)
38
{
39
$name = (string)$name;
40
if
($name !==
''
&& $value !==
null
)
41
{
42
$this->properties[$name] = $value;
43
}
44
}
45
49
public
function
getProperties
()
50
{
51
return
(!empty($this->properties) ? $this->properties :
null
);
52
}
53
58
public
function
getProperty
($name)
59
{
60
$name = (string)$name;
61
if
($name !==
''
)
62
{
63
return
(isset($this->properties[$name]) ? $this->properties[$name] :
null
);
64
}
65
return
null
;
66
}
67
71
public
function
clear
()
72
{
73
$this->
clearProperties
();
74
}
75
79
public
function
clearProperties
()
80
{
81
$this->properties = [];
82
}
83
88
public
function
clearProperty
($name)
89
{
90
$name = (string)$name;
91
if
($name !==
''
&& isset($this->properties[$name]))
92
{
93
unset($this->properties[$name]);
94
}
95
}
96
101
public
function
setTitle
($value)
102
{
103
if
(is_string($value))
104
{
105
$this->
setProperty
(self::TITLE, strip_tags(trim($value)));
106
}
107
}
108
113
public
function
setBrowserTitle
($value)
114
{
115
if
(is_string($value))
116
{
117
$this->
setProperty
(self::BROWSER_TITLE, strip_tags(trim($value)));
118
}
119
}
120
125
public
function
setKeywords
($value)
126
{
127
if
(is_array($value))
128
{
129
$value = array_filter($value, [__CLASS__,
'clearValues'
], ARRAY_FILTER_USE_BOTH);
130
$value = implode(
', '
, $value);
131
}
132
if
(is_string($value))
133
{
134
$this->
setProperty
(self::KEYWORDS, strip_tags(trim($value)));
135
}
136
}
137
142
public
function
setDescription
($value)
143
{
144
if
(is_string($value))
145
{
146
$this->
setProperty
(self::DESCRIPTION, strip_tags(trim($value)));
147
}
148
}
149
153
public
function
getTitle
()
154
{
155
return
$this->
getProperty
(self::TITLE);
156
}
157
161
public
function
getBrowserTitle
()
162
{
163
return
$this->
getProperty
(self::BROWSER_TITLE);
164
}
165
169
public
function
getKeywords
()
170
{
171
return
$this->
getProperty
(self::KEYWORDS);
172
}
173
177
public
function
getDescription
()
178
{
179
return
$this->
getProperty
(self::DESCRIPTION);
180
}
181
187
protected
static
function
clearValues
($value, $name)
188
{
189
return
((
string
)$name !==
''
&& $value !==
null
);
190
}
191
}
Bitrix\Landing\Landing\Seo
Definition
seo.php:7
Bitrix\Landing\Source\Seo\__construct
__construct()
Definition
seo.php:14
Bitrix\Landing\Source\Seo\clearValues
static clearValues($value, $name)
Definition
seo.php:187
Bitrix\Landing\Source\Seo\getDescription
getDescription()
Definition
seo.php:177
Bitrix\Landing\Source\Seo\setDescription
setDescription($value)
Definition
seo.php:142
Bitrix\Landing\Source\Seo\setBrowserTitle
setBrowserTitle($value)
Definition
seo.php:113
Bitrix\Landing\Source\Seo\clearProperties
clearProperties()
Definition
seo.php:79
Bitrix\Landing\Source\Seo\setTitle
setTitle($value)
Definition
seo.php:101
Bitrix\Landing\Source\Seo\getBrowserTitle
getBrowserTitle()
Definition
seo.php:161
Bitrix\Landing\Source\Seo\setProperties
setProperties(array $values)
Definition
seo.php:23
Bitrix\Landing\Source\Seo\getKeywords
getKeywords()
Definition
seo.php:169
Bitrix\Landing\Source\Seo\TITLE
const TITLE
Definition
seo.php:6
Bitrix\Landing\Source\Seo\$properties
$properties
Definition
seo.php:12
Bitrix\Landing\Source\Seo\getTitle
getTitle()
Definition
seo.php:153
Bitrix\Landing\Source\Seo\BROWSER_TITLE
const BROWSER_TITLE
Definition
seo.php:7
Bitrix\Landing\Source\Seo\getProperty
getProperty($name)
Definition
seo.php:58
Bitrix\Landing\Source\Seo\clear
clear()
Definition
seo.php:71
Bitrix\Landing\Source\Seo\KEYWORDS
const KEYWORDS
Definition
seo.php:8
Bitrix\Landing\Source\Seo\DESCRIPTION
const DESCRIPTION
Definition
seo.php:9
Bitrix\Landing\Source\Seo\getProperties
getProperties()
Definition
seo.php:49
Bitrix\Landing\Source\Seo\setKeywords
setKeywords($value)
Definition
seo.php:125
Bitrix\Landing\Source\Seo\setProperty
setProperty($name, $value)
Definition
seo.php:37
Bitrix\Landing\Source\Seo\clearProperty
clearProperty($name)
Definition
seo.php:88
Bitrix\Landing\Source
Definition
blockfilter.php:2
modules
landing
lib
source
seo.php
Создано системой
1.10.0