This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Data.php
executable file
·191 lines (172 loc) · 4.28 KB
/
Data.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?php
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Sitemap
* @copyright Copyright (c) Mageplaza (http://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
namespace Mageplaza\Sitemap\Helper;
use Mageplaza\Seo\Helper\Data as AbstractHelper;
/**
* Class Config
* @package Mageplaza\Sitemap\Helper
*/
class Data extends AbstractHelper
{
const HTML_SITEMAP_CONFIGUARATION = 'html_sitemap/';
const XML_SITEMAP_CONFIGUARATION = 'xml_sitemap/';
/************************ HTML Sitemap Configuration *************************
* Is enable html site map
*
* @param null $storeId
*
* @return mixed
*/
public function isEnableHtmlSiteMap($storeId = null)
{
return $this->getHtmlSitemapConfig('enable', $storeId);
}
/**
* @param $code
* @param null $storeId
*
* @return array|bool|mixed
*/
public function getHtmlSitemapConfig($code, $storeId = null)
{
return $this->getConfigValue(self::CONFIG_MODULE_PATH . '/' . self::HTML_SITEMAP_CONFIGUARATION . $code, $storeId);
}
/**
* Is enable Category site map
* @return mixed
*/
public function isEnableCategorySitemap()
{
return $this->getHtmlSitemapConfig('category');
}
/**
* Is enable page site map
* @return mixed
*/
public function iisEnablePageSitemap()
{
return $this->getHtmlSitemapConfig('page');
}
/**
* Is enable product site map
* @return mixed
*/
public function isEnableProductSitemap()
{
return $this->getHtmlSitemapConfig('product');
}
/**
* Is enable add links site map
* @return mixed
*/
public function isEnableAddLinksSitemap()
{
return $this->getHtmlSitemapConfig('enable_add_links');
}
/**
* Get additional links
* @return mixed
*/
public function getAdditionalLinks()
{
return $this->getHtmlSitemapConfig('additional_links');
}
/**
* Is enable excludePage
* @return mixed
*/
public function isEnableExcludePage()
{
return $this->getHtmlSitemapConfig('exclude_page');
}
/**
* Get exclude page listing
* @return mixed
*/
public function getExcludePageListing()
{
return $this->getHtmlSitemapConfig('exclude_page_listing');
}
/**
* Get product limit
* @return mixed
*/
public function getProductLimit()
{
return $this->getHtmlSitemapConfig('product_limit');
}
/*********************** XML Sitemap Configuration *************************
*
* @param $code
* @param null $storeId
*
* @return mixed
*/
public function getXmlSitemapConfig($code, $storeId = null)
{
return $this->getConfigValue(self::CONFIG_MODULE_PATH . '/' . self::XML_SITEMAP_CONFIGUARATION . $code, $storeId);
}
/**
* @param null $storeId
*
* @return mixed
*/
public function isEnableHomepageOptimization($storeId = null)
{
return $this->getXmlSitemapConfig('homepage_optimization', $storeId);
}
/**
* @param null $storeId
*
* @return mixed
*/
public function isEnableAdditionalLinks($storeId = null)
{
return $this->getXmlSitemapConfig('enable_add_link', $storeId);
}
/**
* @param null $storeId
*
* @return array
*/
public function getXmlAdditionalLinks($storeId = null)
{
return explode("\n", $this->getXmlSitemapConfig('additional_links', $storeId));
}
/**
* @param null $storeId
*
* @return mixed
*/
public function getFrequency($storeId = null)
{
return $this->getXmlSitemapConfig('frequency', $storeId);
}
/**
* @param null $storeId
*
* @return mixed
*/
public function getPriority($storeId = null)
{
return $this->getXmlSitemapConfig('priority', $storeId);
}
}