Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.24 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:noNamespaceSchemaLocation="urn:gene:bluefoot:etc/bluefoot/pagebuilder.xsd">
  4. <content_blocks>
  5. <templates>
  6. <template name="zimmermann_image"
  7. file="Tryzens_Extendbluefoot::image.phtml"/>
  8. </templates>
  9. <renderers>
  10. <renderer name="zimmermann_image_renderer"
  11. class="TryzensExtendbluefootBlockImageBlock"/>
  12. </renderers>
  13. </content_blocks>
  14. </config>
  15.  
  16. <?php
  17.  
  18. namespace TryzensExtendbluefootSetup;
  19.  
  20. use GeneBlueFootApiContentBlockGroupRepositoryInterface;
  21. use GeneBlueFootApiDataContentBlockGroupInterface;
  22. use GeneBlueFootApiDataContentBlockGroupInterfaceFactory;
  23. use GeneBlueFootModelInstallerFile as InstallerFile;
  24. use MagentoFrameworkFilesystemIoFile as IoFile;
  25. use MagentoFrameworkModuleDirReader;
  26. use MagentoFrameworkSetupInstallDataInterface;
  27. use MagentoFrameworkSetupModuleContextInterface;
  28. use MagentoFrameworkSetupModuleDataSetupInterface;
  29.  
  30. /**
  31. * Class to install data for list builder BlueFoot block
  32. */
  33. class InstallData implements InstallDataInterface
  34. {
  35. /**
  36. * @var ContentBlockGroupInterfaceFactory
  37. */
  38. protected $contentBlockGroupInterfaceFactory;
  39.  
  40. /**
  41. * @var ContentBlockGroupRepositoryInterface
  42. */
  43. protected $contentBlockGroupRepository;
  44.  
  45. /**
  46. * @var Reader
  47. */
  48. protected $moduleReader;
  49.  
  50. /**
  51. * @var IoFile
  52. */
  53. protected $ioFile;
  54.  
  55. /**
  56. * @var InstallerFile
  57. */
  58. protected $fileInstaller;
  59.  
  60. /**
  61. * InstallData constructor.
  62. *
  63. * @param ContentBlockGroupInterfaceFactory $contentBlockGroupInterfaceFactory
  64. * @param ContentBlockGroupRepositoryInterface $contentBlockGroupRepositoryInterface
  65. * @param Reader $moduleReader
  66. * @param IoFile $ioFile
  67. * @param InstallerFile $fileInstaller
  68. */
  69. public function __construct(
  70. ContentBlockGroupInterfaceFactory $contentBlockGroupInterfaceFactory,
  71. ContentBlockGroupRepositoryInterface $contentBlockGroupRepositoryInterface,
  72. Reader $moduleReader,
  73. IoFile $ioFile,
  74. InstallerFile $fileInstaller
  75. ) {
  76. $this->contentBlockGroupInterfaceFactory = $contentBlockGroupInterfaceFactory;
  77. $this->contentBlockGroupRepository = $contentBlockGroupRepositoryInterface;
  78. $this->moduleReader = $moduleReader;
  79. $this->ioFile = $ioFile;
  80. $this->fileInstaller = $fileInstaller;
  81. }
  82.  
  83. /**
  84. * Installs data for a module
  85. *
  86. * @param ModuleDataSetupInterface $setup
  87. * @param ModuleContextInterface $context
  88. */
  89. public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
  90. {
  91. $setup->startSetup();
  92. $this->addContentBlockGroup();
  93. $this->installData($setup);
  94. $setup->endSetup();
  95. }
  96.  
  97. /**
  98. * Add zimmermann content block group (menu section)
  99. */
  100. protected function addContentBlockGroup()
  101. {
  102. /** @var ContentBlockGroupInterface $group */
  103. $group = $this->contentBlockGroupInterfaceFactory->create();
  104. $group->setCode('zimmermann')
  105. ->setName('Zimmermann')
  106. ->setIcon('<i class="fa fa-picture-o"></i>')
  107. ->setSortOrder('55');
  108. $this->contentBlockGroupRepository->save($group);
  109. }
  110.  
  111. /**
  112. * Install list page builder blocks and attributes from specified JSON file
  113. *
  114. * @param ModuleDataSetupInterface $setup
  115. */
  116. protected function installData(ModuleDataSetupInterface $setup)
  117. {
  118. $file = $this->moduleReader->getModuleDir(false, 'Tryzens_Extendbluefoot') . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'install-blocks-attributes.json';
  119.  
  120. if ($this->ioFile->fileExists($file)) {
  121. $this->fileInstaller->install($file, $setup);
  122. }
  123. }
  124. }
  125.  
  126. {
  127. "content_blocks": [
  128. {
  129. "identifier": "zimmermann_image",
  130. "name": "Image",
  131. "content_type": "block",
  132. "description": "Image builder",
  133. "url_key_prefix": null,
  134. "preview_field": null,
  135. "renderer": "zimmermann_image_renderer",
  136. "item_view_template": "zimmermann_image",
  137. "list_template": null,
  138. "list_item_template": null,
  139. "item_layout_update_xml": null,
  140. "list_layout_update_xml": null,
  141. "singular_name": "Image",
  142. "plural_name": null,
  143. "include_in_sitemap": "0",
  144. "searchable": "0",
  145. "icon_class": "fa fa-picture-o",
  146. "color": "#5284bd",
  147. "show_in_page_builder": "1",
  148. "sort_order": "100",
  149. "group": "zimmermann",
  150. "attribute_data": {
  151. "attributes": [
  152. "z_title",
  153. "z_image",
  154. "z_mobile_image",
  155. "z_alt_tag",
  156. "z_destination_image",
  157. "z_text_one",
  158. "z_text_one_mobile",
  159. "z_text_one_link",
  160. "z_text_two",
  161. "z_text_two_mobile",
  162. "z_text_two_link",
  163. "z_view_more_text",
  164. "z_view_more_link"
  165. ],
  166. "groups": [
  167. {
  168. "attribute_group_name": "Options",
  169. "sort_order": "10",
  170. "default_id": "0",
  171. "attributes": [
  172. {
  173. "attribute_code": "z_title",
  174. "sort_order": "10"
  175. },
  176. {
  177. "attribute_code": "z_image",
  178. "sort_order": "20"
  179. },
  180. {
  181. "attribute_code": "z_mobile_image",
  182. "sort_order": "30"
  183. },
  184. {
  185. "attribute_code": "z_alt_tag",
  186. "sort_order": "40"
  187. },
  188. {
  189. "attribute_code": "z_destination_image",
  190. "sort_order": "50"
  191. },
  192. {
  193. "attribute_code": "z_text_one",
  194. "sort_order": "60"
  195. },
  196. {
  197. "attribute_code": "z_text_one_mobile",
  198. "sort_order": "70"
  199. },
  200. {
  201. "attribute_code": "z_text_one_link",
  202. "sort_order": "80"
  203. },
  204. {
  205. "attribute_code": "z_text_two",
  206. "sort_order": "90"
  207. },
  208. {
  209. "attribute_code": "z_text_two_mobile",
  210. "sort_order": "100"
  211. },
  212. {
  213. "attribute_code": "z_text_two_link",
  214. "sort_order": "110"
  215. },
  216. {
  217. "attribute_code": "z_view_more_text",
  218. "sort_order": "120"
  219. },
  220. {
  221. "attribute_code": "z_view_more_link",
  222. "sort_order": "130"
  223. }
  224. ]
  225. }
  226. ]
  227. }
  228. }
  229. ],
  230. "attributes": [
  231. {
  232. "attribute_code": "z_title",
  233. "attribute_model": null,
  234. "backend_model": null,
  235. "backend_type": "varchar",
  236. "backend_table": null,
  237. "frontend_model": null,
  238. "frontend_input": "text",
  239. "frontend_label": ["Image Title"],
  240. "frontend_class": null,
  241. "source_model": null,
  242. "is_required": "0",
  243. "is_user_defined": "1",
  244. "is_unique": "0",
  245. "note": null,
  246. "is_global": "0",
  247. "is_wysiwyg_enabled": "0",
  248. "is_visible": "1",
  249. "content_scope": "0",
  250. "frontend_input_renderer": null,
  251. "widget": null,
  252. "data_model": null,
  253. "template": null,
  254. "list_template": null,
  255. "additional_data": [],
  256. "entity_allowed_block_type": false
  257. },
  258. {
  259. "attribute_code": "z_image",
  260. "attribute_model": null,
  261. "backend_model": "gene_bluefoot/attribute_backend_image",
  262. "backend_type": "text",
  263. "backend_table": null,
  264. "frontend_model": null,
  265. "frontend_input": "image",
  266. "frontend_label": ["Desktop Image"],
  267. "frontend_class": null,
  268. "source_model": null,
  269. "is_required": "0",
  270. "is_user_defined": "1",
  271. "is_unique": "0",
  272. "note": null,
  273. "is_global": "0",
  274. "is_wysiwyg_enabled": "0",
  275. "is_visible": "1",
  276. "content_scope": "0",
  277. "frontend_input_renderer": null,
  278. "widget": null,
  279. "data_model": null,
  280. "template": null,
  281. "list_template": null,
  282. "additional_data": [],
  283. "entity_allowed_block_type": false
  284. },
  285. {
  286. "attribute_code": "z_mobile_image",
  287. "attribute_model": null,
  288. "backend_model": "gene_bluefoot/attribute_backend_image",
  289. "backend_type": "text",
  290. "backend_table": null,
  291. "frontend_model": null,
  292. "frontend_input": "image",
  293. "frontend_label": ["Mobile Image"],
  294. "frontend_class": null,
  295. "source_model": null,
  296. "is_required": "0",
  297. "is_user_defined": "1",
  298. "is_unique": "0",
  299. "note": null,
  300. "is_global": "0",
  301. "is_wysiwyg_enabled": "0",
  302. "is_visible": "1",
  303. "content_scope": "0",
  304. "frontend_input_renderer": null,
  305. "widget": null,
  306. "data_model": null,
  307. "template": null,
  308. "list_template": null,
  309. "additional_data": [],
  310. "entity_allowed_block_type": false
  311. },
  312. {
  313. "attribute_code": "z_alt_tag",
  314. "attribute_model": null,
  315. "backend_model": null,
  316. "backend_type": "varchar",
  317. "backend_table": null,
  318. "frontend_model": null,
  319. "frontend_input": "text",
  320. "frontend_label": ["Image Alt"],
  321. "frontend_class": null,
  322. "source_model": null,
  323. "is_required": "0",
  324. "is_user_defined": "1",
  325. "is_unique": "0",
  326. "note": null,
  327. "is_global": "0",
  328. "is_wysiwyg_enabled": "0",
  329. "is_visible": "1",
  330. "content_scope": "0",
  331. "frontend_input_renderer": null,
  332. "widget": null,
  333. "data_model": null,
  334. "template": null,
  335. "list_template": null,
  336. "additional_data": [],
  337. "entity_allowed_block_type": false
  338. },
  339. {
  340. "attribute_code": "z_destination_image",
  341. "attribute_model": null,
  342. "backend_model": null,
  343. "backend_type": "varchar",
  344. "backend_table": null,
  345. "frontend_model": null,
  346. "frontend_input": "text",
  347. "frontend_label": ["Destination Image Link"],
  348. "frontend_class": null,
  349. "source_model": null,
  350. "is_required": "0",
  351. "is_user_defined": "1",
  352. "is_unique": "0",
  353. "note": null,
  354. "is_global": "0",
  355. "is_wysiwyg_enabled": "0",
  356. "is_visible": "1",
  357. "content_scope": "0",
  358. "frontend_input_renderer": null,
  359. "widget": null,
  360. "data_model": null,
  361. "template": null,
  362. "list_template": null,
  363. "additional_data": [],
  364. "entity_allowed_block_type": false
  365. },
  366. {
  367. "attribute_code": "z_text_one",
  368. "attribute_model": null,
  369. "backend_model": null,
  370. "backend_type": "varchar",
  371. "backend_table": null,
  372. "frontend_model": null,
  373. "frontend_input": "text",
  374. "frontend_label": ["Text1"],
  375. "frontend_class": null,
  376. "source_model": null,
  377. "is_required": "0",
  378. "is_user_defined": "1",
  379. "is_unique": "0",
  380. "note": null,
  381. "is_global": "0",
  382. "is_wysiwyg_enabled": "0",
  383. "is_visible": "1",
  384. "content_scope": "0",
  385. "frontend_input_renderer": null,
  386. "widget": null,
  387. "data_model": null,
  388. "template": null,
  389. "list_template": null,
  390. "additional_data": [],
  391. "entity_allowed_block_type": false
  392. },
  393. {
  394. "attribute_code": "z_text_one_mobile",
  395. "attribute_model": null,
  396. "backend_model": null,
  397. "backend_type": "varchar",
  398. "backend_table": null,
  399. "frontend_model": null,
  400. "frontend_input": "text",
  401. "frontend_label": ["Text1 Mobile"],
  402. "frontend_class": null,
  403. "source_model": null,
  404. "is_required": "0",
  405. "is_user_defined": "1",
  406. "is_unique": "0",
  407. "note": null,
  408. "is_global": "0",
  409. "is_wysiwyg_enabled": "0",
  410. "is_visible": "1",
  411. "content_scope": "0",
  412. "frontend_input_renderer": null,
  413. "widget": null,
  414. "data_model": null,
  415. "template": null,
  416. "list_template": null,
  417. "additional_data": [],
  418. "entity_allowed_block_type": false
  419. },
  420. {
  421. "attribute_code": "z_text_one_link",
  422. "attribute_model": null,
  423. "backend_model": null,
  424. "backend_type": "varchar",
  425. "backend_table": null,
  426. "frontend_model": null,
  427. "frontend_input": "text",
  428. "frontend_label": ["Text1 Link"],
  429. "frontend_class": null,
  430. "source_model": null,
  431. "is_required": "0",
  432. "is_user_defined": "1",
  433. "is_unique": "0",
  434. "note": null,
  435. "is_global": "0",
  436. "is_wysiwyg_enabled": "0",
  437. "is_visible": "1",
  438. "content_scope": "0",
  439. "frontend_input_renderer": null,
  440. "widget": null,
  441. "data_model": null,
  442. "template": null,
  443. "list_template": null,
  444. "additional_data": [],
  445. "entity_allowed_block_type": false
  446. },
  447. {
  448. "attribute_code": "z_text_two",
  449. "attribute_model": null,
  450. "backend_model": null,
  451. "backend_type": "varchar",
  452. "backend_table": null,
  453. "frontend_model": null,
  454. "frontend_input": "text",
  455. "frontend_label": ["Text2"],
  456. "frontend_class": null,
  457. "source_model": null,
  458. "is_required": "0",
  459. "is_user_defined": "1",
  460. "is_unique": "0",
  461. "note": null,
  462. "is_global": "0",
  463. "is_wysiwyg_enabled": "0",
  464. "is_visible": "1",
  465. "content_scope": "0",
  466. "frontend_input_renderer": null,
  467. "widget": null,
  468. "data_model": null,
  469. "template": null,
  470. "list_template": null,
  471. "additional_data": [],
  472. "entity_allowed_block_type": false
  473. },
  474. {
  475. "attribute_code": "z_text_two_mobile",
  476. "attribute_model": null,
  477. "backend_model": null,
  478. "backend_type": "varchar",
  479. "backend_table": null,
  480. "frontend_model": null,
  481. "frontend_input": "text",
  482. "frontend_label": ["Text2 Mobile"],
  483. "frontend_class": null,
  484. "source_model": null,
  485. "is_required": "0",
  486. "is_user_defined": "1",
  487. "is_unique": "0",
  488. "note": null,
  489. "is_global": "0",
  490. "is_wysiwyg_enabled": "0",
  491. "is_visible": "1",
  492. "content_scope": "0",
  493. "frontend_input_renderer": null,
  494. "widget": null,
  495. "data_model": null,
  496. "template": null,
  497. "list_template": null,
  498. "additional_data": [],
  499. "entity_allowed_block_type": false
  500. },
  501. {
  502. "attribute_code": "z_text_two_link",
  503. "attribute_model": null,
  504. "backend_model": null,
  505. "backend_type": "varchar",
  506. "backend_table": null,
  507. "frontend_model": null,
  508. "frontend_input": "text",
  509. "frontend_label": ["Text2 Link"],
  510. "frontend_class": null,
  511. "source_model": null,
  512. "is_required": "0",
  513. "is_user_defined": "1",
  514. "is_unique": "0",
  515. "note": null,
  516. "is_global": "0",
  517. "is_wysiwyg_enabled": "0",
  518. "is_visible": "1",
  519. "content_scope": "0",
  520. "frontend_input_renderer": null,
  521. "widget": null,
  522. "data_model": null,
  523. "template": null,
  524. "list_template": null,
  525. "additional_data": [],
  526. "entity_allowed_block_type": false
  527. },
  528. {
  529. "attribute_code": "z_view_more_text",
  530. "attribute_model": null,
  531. "backend_model": null,
  532. "backend_type": "varchar",
  533. "backend_table": null,
  534. "frontend_model": null,
  535. "frontend_input": "text",
  536. "frontend_label": ["View More Text"],
  537. "frontend_class": null,
  538. "source_model": null,
  539. "is_required": "0",
  540. "is_user_defined": "1",
  541. "is_unique": "0",
  542. "note": null,
  543. "is_global": "0",
  544. "is_wysiwyg_enabled": "0",
  545. "is_visible": "1",
  546. "content_scope": "0",
  547. "frontend_input_renderer": null,
  548. "widget": null,
  549. "data_model": null,
  550. "template": null,
  551. "list_template": null,
  552. "additional_data": [],
  553. "entity_allowed_block_type": false
  554. },
  555. {
  556. "attribute_code": "z_view_more_link",
  557. "attribute_model": null,
  558. "backend_model": null,
  559. "backend_type": "varchar",
  560. "backend_table": null,
  561. "frontend_model": null,
  562. "frontend_input": "text",
  563. "frontend_label": ["View More Link"],
  564. "frontend_class": null,
  565. "source_model": null,
  566. "is_required": "0",
  567. "is_user_defined": "1",
  568. "is_unique": "0",
  569. "note": null,
  570. "is_global": "0",
  571. "is_wysiwyg_enabled": "0",
  572. "is_visible": "1",
  573. "content_scope": "0",
  574. "frontend_input_renderer": null,
  575. "widget": null,
  576. "data_model": null,
  577. "template": null,
  578. "list_template": null,
  579. "additional_data": [],
  580. "entity_allowed_block_type": false
  581. }
  582. ]
  583. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement