Skip to content

Commit 600584d

Browse files
authored
Merge pull request #15 from mooore-digital/feature/modulize-blog
Feature/modulize blog
2 parents 48f9faf + ec7801c commit 600584d

File tree

4 files changed

+35
-98
lines changed

4 files changed

+35
-98
lines changed

Api/Data/SiteInterface.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface SiteInterface extends ExtensibleDataInterface
1717
const API_PASSWORD = 'api_password';
1818
const REPLACE_MEDIA_URLS = 'replace_media_urls';
1919
const ENABLE_BLOG = 'enable_blog';
20+
const ENABLE_BLOG_CATEGORIES = 'enable_blog_categories';
2021
const BLOG_PREFIX = 'blog_prefix';
2122
const BLOG_STORES = 'blog_stores';
2223

@@ -137,6 +138,19 @@ public function getEnableBlog(): ?bool;
137138
*/
138139
public function setEnableBlog(?bool $enableBlog);
139140

141+
/**
142+
* Get enable_blog_catgories
143+
* @return bool
144+
*/
145+
public function getEnableBlogCategories(): ?bool;
146+
147+
/**
148+
* Set enable_blog
149+
* @param bool $enableBlogCategories
150+
* @return SiteInterface
151+
*/
152+
public function setEnableBlogCategories(?bool $enableBlogCategories): SiteInterface;
153+
140154
/**
141155
* Get blog_prefix
142156
* @return string

Model/Data/Site.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,26 @@ public function setEnableBlog($enableBlog)
181181
return $this->setData(self::ENABLE_BLOG, $enableBlog);
182182
}
183183

184+
/**
185+
* Get enable_blog_catgories
186+
* @return bool
187+
*/
188+
public function getEnableBlogCategories(): ?bool
189+
{
190+
return (bool) $this->_get(self::ENABLE_BLOG_CATEGORIES);
191+
}
192+
193+
/**
194+
* Set enable_blog
195+
* @param bool $enableBlogCategories
196+
* @return SiteInterface
197+
*/
198+
public function setEnableBlogCategories(?bool $enableBlogCategories): SiteInterface
199+
{
200+
return $this->setData(self::ENABLE_BLOG_CATEGORIES, $enableBlogCategories);
201+
}
202+
203+
184204
/**
185205
* Get blog_prefix
186206
* @return string

etc/db_schema.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<column length="255" name="api_password" nullable="true" xsi:type="varchar"/>
1616
<column default="0" name="replace_media_urls" nullable="false" xsi:type="boolean"/>
1717
<column default="0" name="enable_blog" nullable="false" xsi:type="boolean"/>
18+
<column default="0" name="enable_blog_categories" nullable="false" xsi:type="boolean"/>
1819
<column length="255" name="blog_prefix" nullable="true" xsi:type="varchar"/>
1920
<column length="255" name="blog_stores" nullable="false" xsi:type="varchar"/>
2021
</table>

view/adminhtml/ui_component/mooore_wordpressintegration_site_form.xml

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -158,102 +158,4 @@
158158
</formElements>
159159
</field>
160160
</fieldset>
161-
<fieldset name="blog">
162-
<settings>
163-
<label>Blog</label>
164-
</settings>
165-
<field formElement="checkbox" name="enable_blog" sortOrder="10">
166-
<argument name="data" xsi:type="array">
167-
<item name="config" xsi:type="array">
168-
<item name="source" xsi:type="string">Site</item>
169-
<item name="default" xsi:type="number">0</item>
170-
</item>
171-
</argument>
172-
<settings>
173-
<dataType>boolean</dataType>
174-
<label translate="true">Enable Blog</label>
175-
<dataScope>enable_blog</dataScope>
176-
<validation>
177-
<rule name="required-entry" xsi:type="boolean">false</rule>
178-
</validation>
179-
<switcherConfig>
180-
<enabled>true</enabled>
181-
<rules>
182-
<rule name="0">
183-
<value>0</value>
184-
<actions>
185-
<action name="0">
186-
<target>mooore_wordpressintegration_site_form.mooore_wordpressintegration_site_form.blog.blog_prefix</target>
187-
<callback>hide</callback>
188-
</action>
189-
<action name="1">
190-
<target>mooore_wordpressintegration_site_form.mooore_wordpressintegration_site_form.blog.blog_stores</target>
191-
<callback>hide</callback>
192-
</action>
193-
</actions>
194-
</rule>
195-
<rule name="1">
196-
<value>1</value>
197-
<actions>
198-
<action name="0">
199-
<target>mooore_wordpressintegration_site_form.mooore_wordpressintegration_site_form.blog.blog_prefix</target>
200-
<callback>show</callback>
201-
</action>
202-
<action name="1">
203-
<target>mooore_wordpressintegration_site_form.mooore_wordpressintegration_site_form.blog.blog_stores</target>
204-
<callback>show</callback>
205-
</action>
206-
</actions>
207-
</rule>
208-
</rules>
209-
</switcherConfig>
210-
</settings>
211-
<formElements>
212-
<checkbox>
213-
<settings>
214-
<valueMap>
215-
<map name="false" xsi:type="number">0</map>
216-
<map name="true" xsi:type="number">1</map>
217-
</valueMap>
218-
<prefer>toggle</prefer>
219-
</settings>
220-
</checkbox>
221-
</formElements>
222-
</field>
223-
<field formElement="input" name="blog_prefix" sortOrder="20">
224-
<argument name="data" xsi:type="array">
225-
<item name="config" xsi:type="array">
226-
<item name="source" xsi:type="string">Site</item>
227-
</item>
228-
</argument>
229-
<settings>
230-
<dataType>text</dataType>
231-
<label translate="true">Blog Route Prefix</label>
232-
<dataScope>blog_prefix</dataScope>
233-
<notice translate="true">Allows you to set a default blog prefix, for example "/blog", leave this field empty to disable this feature.</notice>
234-
<validation>
235-
<rule name="required-entry" xsi:type="boolean">false</rule>
236-
</validation>
237-
</settings>
238-
</field>
239-
<field name="blog_stores" sortOrder="30">
240-
<argument name="data" xsi:type="array">
241-
<item name="options" xsi:type="object">Magento\Cms\Ui\Component\Listing\Column\Cms\Options</item>
242-
<item name="config" xsi:type="array">
243-
<item name="dataType" xsi:type="string">int</item>
244-
<item name="label" xsi:type="string" translate="true">Store View</item>
245-
<item name="formElement" xsi:type="string">multiselect</item>
246-
<item name="source" xsi:type="string">page</item>
247-
<item name="dataScope" xsi:type="string">blog_stores</item>
248-
<item name="default" xsi:type="string">0</item>
249-
<item name="validation" xsi:type="array">
250-
<item name="required-entry" xsi:type="boolean">true</item>
251-
</item>
252-
</item>
253-
</argument>
254-
<settings>
255-
<notice translate="true">Select which stores you want this blog site to be enabled.</notice>
256-
</settings>
257-
</field>
258-
</fieldset>
259161
</form>

0 commit comments

Comments
 (0)