AntonLV 9 лет назад
Родитель
Сommit
73a1c21af7
53 измененных файлов с 2691 добавлено и 0 удалено
  1. 8 0
      inc/utils.inc.php
  2. 205 0
      modules/boonex/russian/data/langs/bx_shopify/ru.xml
  3. 21 0
      modules/boonex/shopify/classes/BxShopifyAlertsResponse.php
  4. 24 0
      modules/boonex/shopify/classes/BxShopifyCmtsSearchResult.php
  5. 173 0
      modules/boonex/shopify/classes/BxShopifyConfig.php
  6. 59 0
      modules/boonex/shopify/classes/BxShopifyDb.php
  7. 24 0
      modules/boonex/shopify/classes/BxShopifyFormEntry.php
  8. 30 0
      modules/boonex/shopify/classes/BxShopifyFormSettings.php
  9. 23 0
      modules/boonex/shopify/classes/BxShopifyFormsEntryHelper.php
  10. 21 0
      modules/boonex/shopify/classes/BxShopifyGridAdministration.php
  11. 21 0
      modules/boonex/shopify/classes/BxShopifyGridCommon.php
  12. 24 0
      modules/boonex/shopify/classes/BxShopifyMenu.php
  13. 25 0
      modules/boonex/shopify/classes/BxShopifyMenuManageTools.php
  14. 60 0
      modules/boonex/shopify/classes/BxShopifyMenuSubmenu.php
  15. 36 0
      modules/boonex/shopify/classes/BxShopifyMenuView.php
  16. 131 0
      modules/boonex/shopify/classes/BxShopifyModule.php
  17. 24 0
      modules/boonex/shopify/classes/BxShopifyPageAuthor.php
  18. 24 0
      modules/boonex/shopify/classes/BxShopifyPageBrowse.php
  19. 43 0
      modules/boonex/shopify/classes/BxShopifyPageEntry.php
  20. 145 0
      modules/boonex/shopify/classes/BxShopifySearchResult.php
  21. 109 0
      modules/boonex/shopify/classes/BxShopifyTemplate.php
  22. 124 0
      modules/boonex/shopify/install/config.php
  23. 20 0
      modules/boonex/shopify/install/installer.php
  24. 205 0
      modules/boonex/shopify/install/langs/en.xml
  25. 51 0
      modules/boonex/shopify/install/sql/disable.sql
  26. 348 0
      modules/boonex/shopify/install/sql/enable.sql
  27. 256 0
      modules/boonex/shopify/install/sql/install.sql
  28. 45 0
      modules/boonex/shopify/install/sql/uninstall.sql
  29. 51 0
      modules/boonex/shopify/js/manage_tools.js
  30. 168 0
      modules/boonex/shopify/js/shop.js
  31. 18 0
      modules/boonex/shopify/request.php
  32. 8 0
      modules/boonex/shopify/template/attachments.html
  33. 3 0
      modules/boonex/shopify/template/author.html
  34. 1 0
      modules/boonex/shopify/template/author_link.html
  35. 3 0
      modules/boonex/shopify/template/css/forms.css
  36. 14 0
      modules/boonex/shopify/template/css/main.css
  37. 1 0
      modules/boonex/shopify/template/css/manage_tools.css
  38. 5 0
      modules/boonex/shopify/template/css/unit.css
  39. 3 0
      modules/boonex/shopify/template/entry-all-actions.html
  40. 3 0
      modules/boonex/shopify/template/entry-buy.html
  41. 3 0
      modules/boonex/shopify/template/entry-location.html
  42. 1 0
      modules/boonex/shopify/template/entry-share.html
  43. 10 0
      modules/boonex/shopify/template/entry-text.html
  44. 3 0
      modules/boonex/shopify/template/form_ghost_template.html
  45. 31 0
      modules/boonex/shopify/template/images/icons/std-icon.svg
  46. 1 0
      modules/boonex/shopify/template/title_link.html
  47. 25 0
      modules/boonex/shopify/template/unit.html
  48. 20 0
      modules/boonex/shopify/template/unit_full.html
  49. 3 0
      modules/boonex/shopify/template/unit_full_private.html
  50. 28 0
      modules/boonex/shopify/template/unit_gallery.html
  51. 3 0
      modules/boonex/shopify/template/unit_gallery_private.html
  52. 3 0
      modules/boonex/shopify/template/unit_live_search.html
  53. 3 0
      modules/boonex/shopify/template/unit_private.html

+ 8 - 0
inc/utils.inc.php

@@ -1517,4 +1517,12 @@ function bx_linkify_html($sHtmlOrig, $sAttrs = '')
     return mb_substr($s, 54, -6); // strip added tags
 }
 
+/**
+ * Returns current site protocol http:// or https://
+ */
+function bx_proto()
+{
+    return 0 === strncmp('https', BX_DOL_URL_ROOT, 5) ? 'https' : 'http';
+}
+
 /** @} */

+ 205 - 0
modules/boonex/russian/data/langs/bx_shopify/ru.xml

@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="ru" flag="ru" title="Russian">
+
+	<string name="_bx_shopify"><![CDATA[Shopify]]></string>
+	<string name="_bx_shopify_cmts"><![CDATA[Shopify - Обзоры]]></string>
+
+    <string name="_bx_shopify_option_per_page_browse"><![CDATA[Количество элементов на странице]]></string>
+    <string name="_bx_shopify_option_per_page_profile"><![CDATA[Количество элементов на странице профайла]]></string>
+	<string name="_bx_shopify_option_rss_num"><![CDATA[Количество элементов в ленте RSS]]></string>
+	<string name="_bx_shopify_option_searchable_fields"><![CDATA[Поля для поиска]]></string>
+
+	<string name="_bx_shopify_form_entry"><![CDATA[Товары]]></string>
+	<string name="_bx_shopify_form_entry_display_add"><![CDATA[Добавить товар]]></string>
+	<string name="_bx_shopify_form_entry_display_edit"><![CDATA[Редактировать товар]]></string>
+	<string name="_bx_shopify_form_entry_display_delete"><![CDATA[Удалить товар]]></string>
+	<string name="_bx_shopify_form_entry_display_view"><![CDATA[Просмотреть товар]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+	<string name="_bx_shopify_form_entry_input_do_submit"><![CDATA[Выполнить]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_do_publish"><![CDATA[Опубликовать]]></string>
+	<string name="_bx_shopify_form_entry_input_do_publish"><![CDATA[Опубликовать]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_code"><![CDATA[ID Продукта]]></string>
+    <string name="_bx_shopify_form_entry_input_code"><![CDATA[ID Продукта]]></string>
+    <string name="_bx_shopify_form_entry_input_code_inf"><![CDATA[ID Продукта Вы можете получить из URL продукта, когда просматриваете продукт в секции Продукты в Панели администрирования вашего Shopify магазина.]]></string>
+    <string name="_bx_shopify_form_entry_input_code_err"><![CDATA[ID Продукта обязателен. Пожалуйста, заполните это поле.]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_title"><![CDATA[Заголовок]]></string>
+	<string name="_bx_shopify_form_entry_input_title"><![CDATA[Заголовок]]></string>
+	<string name="_bx_shopify_form_entry_input_title_err"><![CDATA[Заголовок обязателен. Пожалуйста, заполните это поле]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_cat"><![CDATA[Категория]]></string>
+	<string name="_bx_shopify_form_entry_input_cat"><![CDATA[Категория]]></string>
+	<string name="_bx_shopify_form_entry_input_cat_err"><![CDATA[Нужно обязательно выбрать категорию]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_delete_confirm"><![CDATA[Удалить подтверждение]]></string>
+	<string name="_bx_shopify_form_entry_input_delete_confirm"><![CDATA[Я уверен(а), что хочу удалить этот товар]]></string>
+	<string name="_bx_shopify_form_entry_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено]]></string>
+	<string name="_bx_shopify_form_entry_input_delete_confirm_error"><![CDATA[Пожалуйста, отметьте этот флажок, если действительно хотите удалить товар]]></string>
+    <string name="_bx_shopify_form_entry_input_sys_allow_view_to"><![CDATA[Видимость]]></string>
+    <string name="_bx_shopify_form_entry_input_allow_view_to"><![CDATA[Видимость]]></string>
+    <string name="_bx_shopify_form_entry_input_picture_use_as_thumb"><![CDATA[Изображение обложки]]></string>
+    <string name="_bx_shopify_form_entry_input_sys_date_added"><![CDATA[Создано]]></string>
+    <string name="_bx_shopify_form_entry_input_date_added"><![CDATA[Создано]]></string>
+    <string name="_bx_shopify_form_entry_input_sys_date_changed"><![CDATA[Обновлено]]></string>
+    <string name="_bx_shopify_form_entry_input_date_changed"><![CDATA[Обновлено]]></string>
+
+    <string name="_bx_shopify_form_settings"><![CDATA[Настройки]]></string>
+    <string name="_bx_shopify_form_settings_display_edit"><![CDATA[Редактировать настройки]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_api_key"><![CDATA[API Ключ]]></string>
+    <string name="_bx_shopify_form_settings_input_api_key"><![CDATA[API Ключ (Маркер доступа)]]></string>
+    <string name="_bx_shopify_form_settings_input_api_key_err"><![CDATA[Поле API Ключ не может быть пустым]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_domain"><![CDATA[Домен]]></string>
+    <string name="_bx_shopify_form_settings_input_domain"><![CDATA[Домен]]></string>
+    <string name="_bx_shopify_form_settings_input_domain_err"><![CDATA[Поле Домен не может быть пустым]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_app_id"><![CDATA[App ID]]></string>
+    <string name="_bx_shopify_form_settings_input_app_id"><![CDATA[App ID]]></string>
+    <string name="_bx_shopify_form_settings_input_app_id_err"><![CDATA[Поле App ID не может быть пустым]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_do_submit"><![CDATA[Выполнить]]></string>
+    <string name="_bx_shopify_form_settings_input_do_submit"><![CDATA[Выполнить]]></string>
+
+	<string name="_bx_shopify_acl_action_create_entry"><![CDATA[Создать товар]]></string>
+	<string name="_bx_shopify_acl_action_delete_entry"><![CDATA[Удалить товар]]></string>
+	<string name="_bx_shopify_acl_action_view_entry"><![CDATA[Просмотреть товар]]></string>
+	<string name="_bx_shopify_acl_action_set_thumb"><![CDATA[Назначить значок товара]]></string>
+	<string name="_bx_shopify_acl_action_edit_any_entry"><![CDATA[Редактировать любой товар]]></string>
+
+	<string name="_bx_shopify_page_title_sys_create_entry"><![CDATA[Новый товар]]></string>
+	<string name="_bx_shopify_page_title_create_entry"><![CDATA[Новый товар]]></string>
+	<string name="_bx_shopify_page_block_title_create_entry"><![CDATA[Новый товар]]></string>
+	<string name="_bx_shopify_page_title_sys_edit_entry"><![CDATA[Редактировать товар]]></string>
+	<string name="_bx_shopify_page_title_edit_entry"><![CDATA[Редактировать товар]]></string>
+	<string name="_bx_shopify_page_block_title_edit_entry"><![CDATA[Редактировать товар]]></string>
+    <string name="_bx_shopify_page_title_sys_delete_entry"><![CDATA[Удалить товар]]></string>
+    <string name="_bx_shopify_page_title_delete_entry"><![CDATA[Удалить товар]]></string>
+    <string name="_bx_shopify_page_block_title_delete_entry"><![CDATA[Удалить товар]]></string>
+	<string name="_bx_shopify_page_title_sys_view_entry"><![CDATA[Просмотреть товар]]></string>
+	<string name="_bx_shopify_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_shopify_page_block_title_entry_text"><![CDATA[Текст товара]]></string>
+	<string name="_bx_shopify_page_title_browse"><![CDATA[Товары]]></string>
+	<string name="_bx_shopify_page_title_search_results"><![CDATA[Товары, соответствующие "{0}"]]></string>
+	<string name="_bx_shopify_page_title_browse_by_author"><![CDATA[Товары {display_name}]]></string>
+	<string name="_bx_shopify_page_title_browse_featured"><![CDATA[Продвинутые Товары]]></string>
+    <string name="_bx_shopify_page_title_browse_recent"><![CDATA[Недавние Товары]]></string>
+    <string name="_bx_shopify_page_title_browse_popular"><![CDATA[Популярные Товары]]></string>
+    <string name="_bx_shopify_page_title_browse_updated"><![CDATA[Обновлённые Товары]]></string>
+    <string name="_bx_shopify_page_title_sys_home"><![CDATA[Shopify - Домой]]></string>
+    <string name="_bx_shopify_page_title_home"><![CDATA[Товары]]></string>
+    <string name="_bx_shopify_page_block_title_featured_entries_view_extended"><![CDATA[Продвинутые]]></string>
+    <string name="_bx_shopify_page_block_title_recent_entries"><![CDATA[Новые Товары (Галерея)]]></string>
+    <string name="_bx_shopify_page_block_title_recent_entries_view_extended"><![CDATA[Новые Товары]]></string>
+    <string name="_bx_shopify_page_block_title_recent_entries_view_full"><![CDATA[Недавние Товары (Полный просмотр)]]></string>
+    <string name="_bx_shopify_page_block_title_entry_social_sharing"><![CDATA[Поделиться]]></string>
+    <string name="_bx_shopify_page_block_title_entry_author"><![CDATA[Автор]]></string>
+    <string name="_bx_shopify_page_block_title_entry_actions"><![CDATA[Действия]]></string>
+    <string name="_bx_shopify_page_block_title_entry_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_shopify_page_block_title_entry_comments_link"><![CDATA[Комментарии к <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_shopify_page_block_title_entry_location"><![CDATA[Расположение]]></string>
+    <string name="_bx_shopify_page_block_title_entry_attachments"><![CDATA[Прикрепления]]></string>
+    <string name="_bx_shopify_page_block_title_entry_all_actions"><![CDATA[Все Действия]]></string>
+    <string name="_bx_shopify_page_title_sys_entries_popular"><![CDATA[Популярные Товары]]></string>
+    <string name="_bx_shopify_page_title_entries_popular"><![CDATA[Популярные Товары]]></string>
+    <string name="_bx_shopify_page_title_sys_entries_updated"><![CDATA[Обновленные Товары]]></string>
+    <string name="_bx_shopify_page_title_entries_updated"><![CDATA[Обновленные Товары]]></string>
+    <string name="_bx_shopify_page_block_title_popular_entries"><![CDATA[Популярные Товары]]></string>
+    <string name="_bx_shopify_page_block_title_popular_entries_view_extended"><![CDATA[Популярные Товары (Дополнительный просмотр)]]></string>
+    <string name="_bx_shopify_page_block_title_popular_entries_view_full"><![CDATA[Популярные Товары (Полный просмотр)]]></string>
+    <string name="_bx_shopify_page_block_title_updated_entries"><![CDATA[Обновленные Товары]]></string>
+    <string name="_bx_shopify_page_title_sys_view_entry_comments"><![CDATA[Комментарии товаркту]]></string>
+    <string name="_bx_shopify_page_title_view_entry_comments"><![CDATA[Комментарии к {title}]]></string>
+    <string name="_bx_shopify_page_title_sys_entries_of_author"><![CDATA[Товары автора]]></string>
+    <string name="_bx_shopify_page_title_entries_of_author"><![CDATA[{display_name} - Товары]]></string>
+    <string name="_bx_shopify_page_block_title_favorites_of_author"><![CDATA[<a href="{profile_link}">{display_name}</a> - Избранное]]></string>   
+    <string name="_bx_shopify_page_block_title_sys_favorites_of_author"><![CDATA[Избранное автора]]></string>
+    <string name="_bx_shopify_page_block_title_entries_of_author"><![CDATA[<a href="{profile_link}">{display_name}</a> - Товары]]></string>   
+    <string name="_bx_shopify_page_block_title_sys_entries_of_author"><![CDATA[Товары автора]]></string>   
+    <string name="_bx_shopify_page_block_title_entries_actions"><![CDATA[Товары - Действия]]></string>
+    <string name="_bx_shopify_page_block_title_browse_cmts"><![CDATA[Товары - Комментарии]]></string>
+	<string name="_bx_shopify_page_title_sys_manage"><![CDATA[Управление собственными товарами]]></string>
+	<string name="_bx_shopify_page_title_sys_manage_administration"><![CDATA[Управление всеми товарами]]></string>
+	<string name="_bx_shopify_page_title_manage"><![CDATA[Управление товарами]]></string>
+	<string name="_bx_shopify_page_block_title_system_manage"><![CDATA[Управление собственными товарами]]></string>
+	<string name="_bx_shopify_page_block_title_system_manage_administration"><![CDATA[Управление всеми товарами]]></string>
+	<string name="_bx_shopify_page_block_title_manage"><![CDATA[Управление товарами]]></string>    
+	<string name="_bx_shopify_page_block_title_popular_keywords"><![CDATA[Популярные Хэштеги]]></string>
+    <string name="_bx_shopify_page_block_title_cats"><![CDATA[Категории]]></string>
+    <string name="_bx_shopify_page_block_title_entry_info"><![CDATA[Инфо]]></string>
+    <string name="_bx_shopify_page_block_title_my_entries"><![CDATA[Мои товары]]></string>
+    <string name="_bx_shopify_page_title_sys_settings"><![CDATA[Настройки]]></string>
+    <string name="_bx_shopify_page_title_settings"><![CDATA[Настройки]]></string>
+    <string name="_bx_shopify_page_block_title_system_settings"><![CDATA[Настройки]]></string>
+    <string name="_bx_shopify_page_block_title_settings"><![CDATA[Настройки]]></string>
+
+    <string name="_bx_shopify_menu_set_title_view_entry"><![CDATA[Действия с товаром]]></string>
+    <string name="_bx_shopify_menu_title_view_entry"><![CDATA[Действия с товаром]]></string>
+    <string name="_bx_shopify_menu_title_submenu"><![CDATA[Товары - Подменю]]></string>
+    <string name="_bx_shopify_menu_set_title_submenu"><![CDATA[Товары - Подменю]]></string>
+    <string name="_bx_shopify_menu_item_title_system_create_entry"><![CDATA[Новый товар]]></string>
+    <string name="_bx_shopify_menu_item_title_create_entry"><![CDATA[Новый товар]]></string>
+    <string name="_bx_shopify_menu_item_title_system_edit_entry"><![CDATA[Редактировать товар]]></string>
+    <string name="_bx_shopify_menu_item_title_edit_entry"><![CDATA[Редактировать товар]]></string>
+    <string name="_bx_shopify_menu_item_title_system_delete_entry"><![CDATA[Удалить товар]]></string>
+    <string name="_bx_shopify_menu_item_title_delete_entry"><![CDATA[Удалить товар]]></string>
+    <string name="_bx_shopify_menu_item_title_system_view_entry"><![CDATA[Просмотреть товар]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_home"><![CDATA[Магазин]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_home"><![CDATA[Магазин]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_public"><![CDATA[Новые товары]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_public"><![CDATA[Новые товары]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_manage"><![CDATA[Управление товарами]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_manage"><![CDATA[Управление товарами]]></string>
+    <string name="_bx_shopify_menu_item_title_system_settings"><![CDATA[Настройки]]></string>
+    <string name="_bx_shopify_menu_item_title_settings"><![CDATA[Настройки]]></string>
+    <string name="_bx_shopify_menu_item_title_system_dashboard"><![CDATA[Панель]]></string>
+    <string name="_bx_shopify_menu_item_title_dashboard"><![CDATA[Панель]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_popular"><![CDATA[Популярные товары]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_popular"><![CDATA[Популярные товары]]></string>
+    <string name="_bx_shopify_menu_title_view_entry_submenu"><![CDATA[Просмотреть товар - Подменю]]></string>
+    <string name="_bx_shopify_menu_set_title_view_entry_submenu"><![CDATA[Просмотреть товар - Подменю]]></string>
+    <string name="_bx_shopify_menu_item_title_view_entry_submenu_entry"><![CDATA[Товар]]></string>
+    <string name="_bx_shopify_menu_item_title_view_entry_submenu_comments"><![CDATA[Комментарии]]></string>
+    <string name="_bx_shopify_menu_item_title_system_view_entry_comments"><![CDATA[Комментарии к товару]]></string>
+    <string name="_bx_shopify_menu_item_title_system_view_entries_author"><![CDATA[Товары]]></string>
+    <string name="_bx_shopify_menu_item_title_view_entries_author"><![CDATA[Товары]]></string>
+    <string name="_bx_shopify_menu_title_entries_my"><![CDATA[Мои Товары - Меню действий]]></string>
+    <string name="_bx_shopify_menu_set_title_entries_my"><![CDATA[Мои Товары - Меню]]></string>
+	<string name="_bx_shopify_menu_item_title_system_manage_my_entries"><![CDATA[Мои товары]]></string>
+    <string name="_bx_shopify_menu_item_title_manage_my_entries"><![CDATA[{addon} товаров]]></string>
+    <string name="_bx_shopify_menu_set_title_manage_tools"><![CDATA[Управление Подменю инструментов]]></string>
+    <string name="_bx_shopify_menu_title_manage_tools"><![CDATA[Управление Подменю инструментов]]></string>
+    <string name="_bx_shopify_menu_item_title_system_manage_account"><![CDATA[Управление аккаунтом]]></string>
+    <string name="_bx_shopify_menu_item_title_manage_account"><![CDATA[Управление аккаунтом]]></string>
+	<string name="_bx_shopify_menu_item_title_system_admt_entries"><![CDATA[Товары]]></string>
+	<string name="_bx_shopify_menu_item_title_admt_entries"><![CDATA[Товары - {addon} спрятано]]></string>
+	<string name="_bx_shopify_menu_item_title_manage_my"><![CDATA[Мои Товары]]></string>
+	<string name="_bx_shopify_menu_item_title_manage_all"><![CDATA[Все Товары]]></string>
+	<string name="_bx_shopify_menu_item_title_buy_for"><![CDATA[Купить за {price}]]></string>
+
+	<string name="_bx_shopify_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
+	<string name="_bx_shopify_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>
+	<string name="_bx_shopify_grid_filter_item_title_adm_hidden"><![CDATA[Спрятанные]]></string>
+	<string name="_bx_shopify_grid_column_title_adm_active"><![CDATA[Активные]]></string>
+    <string name="_bx_shopify_grid_column_title_adm_title"><![CDATA[Заголовок]]></string>
+    <string name="_bx_shopify_grid_column_title_adm_added"><![CDATA[Добавленные]]></string>
+    <string name="_bx_shopify_grid_column_title_adm_author"><![CDATA[Автор]]></string>
+    <string name="_bx_shopify_grid_action_title_adm_edit"><![CDATA[Редактировать]]></string>
+    <string name="_bx_shopify_grid_action_title_adm_delete"><![CDATA[Удалить]]></string>
+    <string name="_bx_shopify_grid_action_title_adm_more_actions"><![CDATA[Дополнительные действия]]></string>
+    <string name="_bx_shopify_grid_action_err_delete"><![CDATA[Невозможно удалить выбранный(ные) товар(ы).]]></string>
+    <string name="_bx_shopify_grid_txt_account_manager"><![CDATA[Перенаправить в Управление аккаунтом.]]></string>
+
+    <string name="_bx_shopify_pre_lists_cats"><![CDATA[Категории товаров]]></string>
+    <string name="_bx_shopify_cat_automotive_and_industrial"><![CDATA[Автомобили и Техника]]></string>
+    <string name="_bx_shopify_cat_beauty_health_food"><![CDATA[Красота, Здоровье и Еда]]></string>
+    <string name="_bx_shopify_cat_books"><![CDATA[Книги]]></string>
+    <string name="_bx_shopify_cat_clothing_shoes_jewelry"><![CDATA[Одежда, Обувь и Украшения]]></string>
+    <string name="_bx_shopify_cat_electronics_and_computers"><![CDATA[Электроника и Компьютеры]]></string>
+    <string name="_bx_shopify_cat_handmade"><![CDATA[Ручная Работа]]></string>
+    <string name="_bx_shopify_cat_home_garden_tools"><![CDATA[Дом, Сад и Инструменты]]></string>
+    <string name="_bx_shopify_cat_movies_music_games"><![CDATA[Фильмы, Музыка и Игры]]></string>
+    <string name="_bx_shopify_cat_sports_and_outdoors"><![CDATA[Спорт и Активный Отдых]]></string>
+    <string name="_bx_shopify_cat_toys_kids_baby"><![CDATA[Игрушки, Дети и Младенцы]]></string>
+
+    <string name="_bx_shopify_err_not_configured"><![CDATA[Сначала вам необходимо настроить магазин. <a href="{0}">Нажмите здесь</a>.]]></string>
+
+    <string name="_bx_shopify_txt_all_entries_by"><![CDATA[<a href="{0}">Все товары от {1} ({2})</a>]]></string>
+    <string name="_bx_shopify_txt_sample_single"><![CDATA[товар]]></string>
+    <string name="_bx_shopify_txt_sample_single_with_article"><![CDATA[товар]]></string>
+    <string name="_bx_shopify_txt_sample_comment_single"><![CDATA[комментарии к товару]]></string>
+    <string name="_bx_shopify_txt_sample_vote_single"><![CDATA[голос за товар]]></string>
+</resources>

+ 21 - 0
modules/boonex/shopify/classes/BxShopifyAlertsResponse.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxShopifyAlertsResponse extends BxBaseModTextAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/shopify/classes/BxShopifyCmtsSearchResult.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxShopifyCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+    	$this->sModule = 'bx_shopify';
+
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent['title'] = _t('_bx_shopify_page_block_title_browse_cmts');
+    }
+}
+
+/** @} */

+ 173 - 0
modules/boonex/shopify/classes/BxShopifyConfig.php

@@ -0,0 +1,173 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxShopifyConfig extends BxBaseModTextConfig
+{
+    protected $_aHtmlIds;
+
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'edit-shopify-entry' => 'checkAllowedEdit',
+            'delete-shopify-entry' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'shopping-cart col-green1',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'entries',
+        	'TABLE_SETTINGS' => $aModule['db_prefix'] . 'settings',
+        	'TABLE_ENTRIES_FULLTEXT' => 'title_text',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+        	'FIELD_CODE' => 'code',
+            'FIELD_TITLE' => 'title',
+            'FIELD_TEXT' => 'text',
+            'FIELD_TEXT_ID' => 'shopify-entry-text',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => '',
+            'FIELD_THUMB' => '',
+            'FIELD_COMMENTS' => 'comments',
+	        'FIELD_STATUS' => 'status',
+        	'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-shopify-entry',
+            'URI_AUTHOR_ENTRIES' => 'shopify-author',
+            'URI_ADD_ENTRY' => 'create-shopify-entry',
+        	'URI_EDIT_ENTRY' => 'edit-shopify-entry',
+        	'URI_MANAGE_COMMON' => 'shopify-manage',
+
+            'URL_HOME' => 'page.php?i=shopify-home',
+            'URL_POPULAR' => 'page.php?i=shopify-popular',
+            'URL_UPDATED' => 'page.php?i=shopify-updated',
+        	'URL_MANAGE_COMMON' => 'page.php?i=shopify-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=shopify-administration',
+        	'URL_SETTINGS' => 'page.php?i=shopify-settings',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_shopify_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_shopify_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_shopify_rss_num',
+        	'PARAM_SEARCHABLE_FIELDS' => 'bx_shopify_searchable_fields',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_shopify_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_shopify_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_shopify_gallery',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(),
+        	'OBJECT_REPORTS' => 'bx_shopify',
+            'OBJECT_VIEWS' => 'bx_shopify',
+            'OBJECT_VOTES' => 'bx_shopify',
+        	'OBJECT_FAVORITES' => 'bx_shopify',
+            'OBJECT_FEATURED' => 'bx_shopify',
+            'OBJECT_METATAGS' => 'bx_shopify',
+            'OBJECT_COMMENTS' => 'bx_shopify',
+            'OBJECT_PRIVACY_VIEW' => 'bx_shopify_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_shopify',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_shopify_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_shopify_entry_add',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_shopify_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_shopify_entry_delete',
+        	'OBJECT_FORM_SETTINGS' => 'bx_shopify_settings',
+        	'OBJECT_FORM_SETTINGS_DISPLAY_EDIT' => 'bx_shopify_settings_edit',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_shopify_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_shopify_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_shopify_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_shopify_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'shopify-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_shopify_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_shopify_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_shopify_common',
+            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_shopify_my' => array (
+                    'create-shopify-entry' => 'checkAllowedAdd',
+                ),
+                'bx_shopify_view' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_shopify_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_shopify_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_shopify_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_shopify_txt_sample_vote_single',
+            	'grid_action_err_delete' => '_bx_shopify_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_shopify_grid_txt_account_manager',
+				'filter_item_active' => '_bx_shopify_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_shopify_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_shopify_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_shopify_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_shopify_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_shopify_txt_all_entries_by',
+                'txt_all_entries_by_author' => '_bx_shopify_page_title_browse_by_author',
+            	'txt_pict_use_as_thumb' => '_bx_shopify_form_entry_input_picture_use_as_thumb'
+            ),
+        );
+
+        $this->_aJsClasses = array(
+            'shop' => 'BxShopifyShop', 
+        	'manage_tools' => 'BxShopifyManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'shop' => 'oBxShopifyShop{profile_id}',
+        	'manage_tools' => 'oBxShopifyManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+
+        $sHtmlPrefix = str_replace('_', '-', $this->_sName);
+        $this->_aHtmlIds = array(
+        	'entry_buy' => $sHtmlPrefix . '-entry-buy',
+        	'entry_content' => $sHtmlPrefix . '-entry-content',
+        	'entry_attachments' => $sHtmlPrefix . '-entry-attachments',
+            'entry_attachment_sample' => $sHtmlPrefix . '-entry-attachment-sample',
+
+            'unit' => $sHtmlPrefix . '-unit-',
+        );
+    }
+
+	public function getHtmlIds($sKey = '')
+    {
+        if(empty($sKey))
+            return $this->_aHtmlIds;
+
+        return isset($this->_aHtmlIds[$sKey]) ? $this->_aHtmlIds[$sKey] : '';
+    }
+
+    public function getJsObjectShop($iProfileId)
+    {
+        return bx_replace_markers($this->getJsObject('shop'), array(
+            'profile_id' => $iProfileId
+        ));
+    }
+}
+
+/** @} */

+ 59 - 0
modules/boonex/shopify/classes/BxShopifyDb.php

@@ -0,0 +1,59 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxShopifyDb extends BxBaseModTextDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function getSettings($aParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+    	$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
+        $sWhereClause = $sOrderByClause = "";
+
+        $sSelectClause = "*";
+        switch($aParams['type']) {
+            case 'id':
+                $aMethod['name'] = 'getRow';
+                $aMethod['params'][1] = array(
+                	'id' => $aParams['id']
+                );
+
+                $sWhereClause .= " AND `id`=:id";
+                break;
+
+            case 'author':
+                $aMethod['name'] = 'getRow';
+                $aMethod['params'][1] = array(
+                	'author' => $aParams['author']
+                );
+
+                $sWhereClause .= " AND `author`=:author";
+                break;
+
+            case 'all':
+            	break;
+        }
+
+        $aMethod['params'][0] = "SELECT " . $sSelectClause . " FROM `" . $CNF['TABLE_SETTINGS'] . "` WHERE 1 " . $sWhereClause;
+
+        return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/shopify/classes/BxShopifyFormEntry.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxShopifyFormEntry extends BxBaseModTextFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct($aInfo, $oTemplate);
+    }
+}
+
+/** @} */

+ 30 - 0
modules/boonex/shopify/classes/BxShopifyFormSettings.php

@@ -0,0 +1,30 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Edit settings form
+ */
+class BxShopifyFormSettings extends BxTemplFormView
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->_sModule = 'bx_shopify';
+
+        parent::__construct($aInfo, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/shopify/classes/BxShopifyFormsEntryHelper.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry forms helper functions
+ */
+class BxShopifyFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/shopify/classes/BxShopifyGridAdministration.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxShopifyGridAdministration extends BxBaseModTextGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_shopify';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/shopify/classes/BxShopifyGridCommon.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxShopifyGridCommon extends BxBaseModTextGridCommon
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_shopify';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/shopify/classes/BxShopifyMenu.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxShopifyMenu extends BxBaseModTextMenu
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/shopify/classes/BxShopifyMenuManageTools.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Shopify manage tools' menu.
+ */
+class BxShopifyMenuManageTools extends BxBaseModTextMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 60 - 0
modules/boonex/shopify/classes/BxShopifyMenuSubmenu.php

@@ -0,0 +1,60 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Shopify Submenu' menu.
+ */
+class BxShopifyMenuSubmenu extends BxTemplMenu
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+
+        $this->_sModule = 'bx_shopify';
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        $aSettings = $this->_oModule->getSettings();
+        if(!empty($aSettings))
+            $this->addMarkers(array(
+    			'domain' => $aSettings['domain']
+    		));
+    }
+
+	/**
+     * Check if menu items is visible.
+     * @param $a menu item array
+     * @return boolean
+     */
+    protected function _isVisible ($a)
+    {
+        if(!parent::_isVisible($a))
+            return false;
+
+        $sCheckFuncName = '';
+        $aCheckFuncParams = array();
+        switch ($a['name']) {
+        	case 'shopify-dashboard':
+                $sCheckFuncName = 'isAllowedViewDashboard';
+				$aCheckFuncParams = array();
+                break;
+        }
+
+        if(!$sCheckFuncName || !method_exists($this->_oModule, $sCheckFuncName))
+            return true;
+
+        return call_user_func_array(array($this->_oModule, $sCheckFuncName), $aCheckFuncParams) === true;
+    }
+}
+
+/** @} */

+ 36 - 0
modules/boonex/shopify/classes/BxShopifyMenuView.php

@@ -0,0 +1,36 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxShopifyMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_shopify';
+
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    public function getCode ()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sResult = parent::getCode();
+        if($this->_sObject != $CNF['OBJECT_MENU_ACTIONS_VIEW_ENTRY'])
+            return $sResult;
+
+        return $this->_oModule->_oTemplate->entryBuy($this->_aContentInfo) . $sResult;
+    }
+}
+
+/** @} */

+ 131 - 0
modules/boonex/shopify/classes/BxShopifyModule.php

@@ -0,0 +1,131 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+define('BX_SHOPIFY_MODE_TEST', 'test');
+define('BX_SHOPIFY_MODE_LIVE', 'live');
+
+/**
+ * Shopify module
+ */
+class BxShopifyModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    public function getSettings($iProfileId = 0)
+    {
+        if(empty($iProfileId))
+            $iProfileId = bx_get_logged_profile_id();
+
+        $aSettings = $this->_oDb->getSettings(array('type' => 'author', 'author' => $iProfileId));
+        if(empty($aSettings) || !is_array($aSettings))
+            return array();
+
+        return $aSettings;
+    }
+
+    public function serviceInclude($iProfileId = 0)
+    {
+        $this->serviceIncludeCssJs();
+        return $this->serviceIncludeCode($iProfileId);
+    }
+
+    public function serviceIncludeCssJs()
+    {
+        $this->_oTemplate->getIncludeCssJs();
+    }
+
+    public function serviceIncludeCode($iProfileId = 0)
+    {
+        $iProfileId = !empty($iProfileId) ? $iProfileId : $this->_iProfileId;
+        if(empty($iProfileId))
+            return '';
+
+        $aSettings = $this->getSettings($iProfileId);
+        if(empty($aSettings))
+            return '';
+
+        return $this->_oTemplate->getIncludeCode($iProfileId, $aSettings);
+    }
+    
+
+    public function serviceEntityCreate ()
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+    	$aSettings = $this->_oDb->getSettings(array('type' => 'author', 'author' => $this->_iProfileId));
+        if(empty($aSettings) || !is_array($aSettings))
+    		return MsgBox(_t('_bx_shopify_err_not_configured', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_SETTINGS'])));
+
+    	return parent::serviceEntityCreate();
+    }
+
+    public function serviceSettings()
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!$this->_iProfileId)
+            return MsgBox(_t('_Access denied'));
+
+        $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_SETTINGS'], $CNF['OBJECT_FORM_SETTINGS_DISPLAY_EDIT'], $this->_oTemplate);
+        if(!$oForm)
+            return MsgBox(_t('_sys_txt_error_occured'));       
+
+        $aSettings = $this->_oDb->getSettings(array('type' => 'author', 'author' => $this->_iProfileId));
+        $bSettings = !empty($aSettings) && is_array($aSettings);
+
+        $oForm->initChecker($aSettings);
+        if(!$oForm->isSubmittedAndValid())
+            return $oForm->getCode();
+
+        if(!$bSettings) {
+            $aValsToAdd = array('author' => $this->_iProfileId);
+            $iSettings = $oForm->insert($aValsToAdd);
+            if(!$iSettings) {
+                if(!$oForm->isValid())
+                    return $oForm->getCode();
+                else
+                    return MsgBox(_t('_sys_txt_error_entry_creation'));
+            }
+        }
+        else {
+            if(!$oForm->update($aSettings['id'])) {
+                if(!$oForm->isValid())
+                    return $oForm->getCode();
+                else
+                    return MsgBox(_t('_sys_txt_error_entry_update'));
+            }
+        }
+
+        return array(
+        	'content' => $oForm->getCode()
+        );
+    }
+
+    // ====== PERMISSION METHODS
+    public function isAllowedViewDashboard()
+    {
+        $aSettings = $this->getSettings();
+        if(empty($aSettings))
+            return false;
+
+        return true;
+    }
+
+    public function checkAllowedSetThumb()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/shopify/classes/BxShopifyPageAuthor.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Profile's entries page.
+ */
+class BxShopifyPageAuthor extends BxBaseModTextPageAuthor
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 24 - 0
modules/boonex/shopify/classes/BxShopifyPageBrowse.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxShopifyPageBrowse extends BxBaseModTextPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 43 - 0
modules/boonex/shopify/classes/BxShopifyPageEntry.php

@@ -0,0 +1,43 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry create/edit pages
+ */
+class BxShopifyPageEntry extends BxBaseModTextPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    public function getCode()
+    {
+        if(!$this->_aContentInfo) {
+            $this->_oTemplate->displayPageNotFound();
+            exit;
+        }
+
+        $iProfileId = $this->_aContentInfo[$this->_oModule->_oConfig->CNF['FIELD_AUTHOR']];
+        return $this->_oModule->serviceInclude($iProfileId) . parent::getCode();
+    }
+
+    protected function _setSubmenu($aParams)
+    {
+    	parent::_setSubmenu(array_merge($aParams, array(
+    		'title' => '',
+    		'icon' => ''
+    	)));
+    }
+}
+
+/** @} */

+ 145 - 0
modules/boonex/shopify/classes/BxShopifySearchResult.php

@@ -0,0 +1,145 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxShopifySearchResult extends BxBaseModTextSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent = array(
+            'name' => 'bx_shopify',
+            'module_name' => 'bx_shopify',
+            'object_metatags' => 'bx_shopify',
+            'title' => _t('_bx_shopify_page_title_browse'),
+            'table' => 'bx_shopify_entries',
+            'ownFields' => array('id', 'code', 'title', 'author', 'added'),
+            'searchFields' => array(),
+            'restriction' => array(
+                'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>'),
+        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+            ),
+            'paginate' => array('perPage' => getParam('bx_shopify_per_page_browse'), 'start' => 0),
+            'sorting' => 'last',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'title',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'text',
+                ),
+            ),
+            'ident' => 'id',
+        );
+
+        $this->sFilterName = 'bx_shopify_filter';
+        $this->oModule = $this->getMain();
+        $this->aCurrent['searchFields'] = explode(',', getParam($this->oModule->_oConfig->CNF['PARAM_SEARCHABLE_FIELDS']));
+
+        $oProfileAuthor = null;
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        switch ($sMode) {
+            case 'author':
+                if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'favorite':
+                if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'public':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_shopify_page_title_browse_recent');
+                $this->aCurrent['rss']['link'] = 'modules/?r=shopify/rss/' . $sMode;
+                break;
+
+            case 'featured':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_shopify_page_title_browse_featured');
+                $this->aCurrent['restriction']['featured']['value'] = '0';
+                $this->aCurrent['rss']['link'] = 'modules/?r=shopify/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'featured';
+                break;
+
+            case 'popular':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
+                $this->aCurrent['title'] = _t('_bx_shopify_page_title_browse_popular');
+                $this->aCurrent['rss']['link'] = 'modules/?r=shopify/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'popular';
+                break;
+
+            case 'updated':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
+                $this->aCurrent['title'] = _t('_bx_shopify_page_title_browse_updated');
+                $this->aCurrent['rss']['link'] = 'modules/?r=shopify/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'updated';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_shopify');
+                $this->aCurrent['paginate']['perPage'] = 3;
+                unset($this->aCurrent['rss']);
+                break;
+
+            default:
+                $sMode = '';
+                $this->isError = true;
+        }
+
+        $this->processReplaceableMarkers($oProfileAuthor);
+
+        $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
+    }
+
+    function displayResultBlock()
+    {
+        $this->oModule->serviceIncludeCssJs();
+
+        return parent::displayResultBlock();
+    }
+
+    function getAlterOrder()
+    {
+        $aSql = array();
+        switch ($this->aCurrent['sorting']) {
+            case 'last':
+                $aSql['order'] = ' ORDER BY `bx_shopify_entries`.`added` DESC';
+                break;
+            case 'featured':
+                $aSql['order'] = ' ORDER BY `bx_shopify_entries`.`featured` DESC';
+                break;
+            case 'updated':
+                $aSql['order'] = ' ORDER BY `bx_shopify_entries`.`changed` DESC';
+                break;
+            case 'popular':
+                $aSql['order'] = ' ORDER BY `bx_shopify_entries`.`views` DESC';
+                break;
+        }
+        return $aSql;
+    }
+}
+
+/** @} */

+ 109 - 0
modules/boonex/shopify/classes/BxShopifyTemplate.php

@@ -0,0 +1,109 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxShopifyTemplate extends BxBaseModTextTemplate
+{
+    /**
+     * Constructor
+     */
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_shopify';
+        parent::__construct($oConfig, $oDb);
+    }
+
+    public function getIncludeCssJs()
+    {
+        $this->addCss(array(
+            'unit.css'
+        ));
+
+        $sProto = bx_proto();
+        $this->addJs(array(
+            $sProto . '://sdks.shopifycdn.com/js-buy-sdk/v0/latest/shopify-buy.umd.polyfilled.min.js',
+            'shop.js'
+        ));
+    }
+
+    public function getIncludeCode($iProfileId, $aSettings)
+    {
+        if(empty($aSettings))
+            return '';
+
+        $sCode = $this->getJsCode('shop', array(
+            'sAPIKey' => $aSettings['api_key'],
+            'sDomain' => $aSettings['domain'],
+            'sAppId' => $aSettings['app_id'],
+        ));
+
+        return bx_replace_markers($sCode, array(
+            'profile_id' => $iProfileId
+        ));
+    }
+
+    public function entryBuy($aData)
+    {
+        return $this->parseHtmlByName('entry-buy.html', array(
+        	'html_id' => $this->_oConfig->getHtmlIds('entry_buy')
+        ));
+    }
+
+    public function entryText ($aData, $sTemplateName = 'entry-text.html')
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        return $this->parseHtmlByName($sTemplateName, array(
+            'js_object' => $this->_oConfig->getJsObjectShop($aData[$CNF['FIELD_AUTHOR']]),
+            'html_id' => $this->_oConfig->getHtmlIds('entry_content'),
+            'entry_title' => $this->getTitle($aData),
+            'entry_code' => $aData[$CNF['FIELD_CODE']]
+        ));
+    }
+
+    public function entryAttachments ($aData)
+    {
+        $sPopupId = 'bx-messages-atachment-popup-{id}';
+        return $this->parseHtmlByName('attachments.html', array(
+            'html_id' => $this->_oConfig->getHtmlIds('entry_attachments'),
+            'html_id_sample' => $this->_oConfig->getHtmlIds('entry_attachment_sample'),
+        	'popup_id' => $sPopupId,
+            'popup' => BxTemplFunctions::getInstance()->transBox($sPopupId, '<img class="bx-spf-attachment-popup-img" src="{url}" />', true, true),
+        ));
+    }
+
+    public function getJsCode($sType, $aParams = array(), $bWrap = true)
+    {
+        $aParams = array_merge(array(
+            'aHtmlIds' => $this->_oConfig->getHtmlIds()
+        ), $aParams);
+
+        return parent::getJsCode($sType, $aParams, $bWrap);
+    }
+
+    protected function getUnit($aData, $aParams = array())
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        $iProfileId = $aData[$CNF['FIELD_AUTHOR']];
+        $sCode = $aData[$CNF['FIELD_CODE']];
+        return array_merge(parent::getUnit($aData, $aParams), array(
+            'js_object' => $this->_oConfig->getJsObjectShop($iProfileId),
+            'js_content' => $this->_oModule->serviceIncludeCode($iProfileId),
+        	'class' => $this->_oConfig->getHtmlIds('unit') . $sCode,
+            'entry_code' => $sCode,
+        ));
+    }
+}
+
+/** @} */

+ 124 - 0
modules/boonex/shopify/install/config.php

@@ -0,0 +1,124 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_shopify',
+    'title' => 'Shopify',
+    'note' => 'Shopify shopping module.',
+    'version' => '9.0.0.DEV',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/shopify/',
+    'home_uri' => 'shopify',
+
+    'db_prefix' => 'bx_shopify_',
+    'class_prefix' => 'BxShopify',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Shopify',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_view_submenu'
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_shopify_files'
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_shopify_preview',
+        'bx_shopify_gallery',
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    	'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable_success' => array(
+        'process_menu_triggers' => 1,
+        'process_page_triggers' => 1,
+    	'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+    	'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+    	'register_transcoders' => 1,
+    	'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relations' => array(
+    	'bx_timeline',
+    	'bx_notifications'
+    ),
+
+);
+
+/** @} */

+ 20 - 0
modules/boonex/shopify/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxShopifyInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 205 - 0
modules/boonex/shopify/install/langs/en.xml

@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_shopify"><![CDATA[Shopify]]></string>
+	<string name="_bx_shopify_cmts"><![CDATA[Shopify's Reviews]]></string>
+
+	<string name="_bx_shopify_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_shopify_option_per_page_profile"><![CDATA[Number of items per page on profile/group page]]></string>
+	<string name="_bx_shopify_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+	<string name="_bx_shopify_option_searchable_fields"><![CDATA[Searchable fields]]></string>
+
+	<string name="_bx_shopify_form_entry"><![CDATA[Goods]]></string>
+	<string name="_bx_shopify_form_entry_display_add"><![CDATA[Add Goods]]></string>
+	<string name="_bx_shopify_form_entry_display_edit"><![CDATA[Edit Goods]]></string>
+	<string name="_bx_shopify_form_entry_display_delete"><![CDATA[Delete Goods]]></string>
+	<string name="_bx_shopify_form_entry_display_view"><![CDATA[View Goods]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_shopify_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_shopify_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_code"><![CDATA[Product ID]]></string>
+    <string name="_bx_shopify_form_entry_input_code"><![CDATA[Product ID]]></string>
+    <string name="_bx_shopify_form_entry_input_code_inf"><![CDATA[The Product ID can be taken from product's URL when you are viewing the product in Products section of your Shopify dashboard.]]></string>
+    <string name="_bx_shopify_form_entry_input_code_err"><![CDATA[Product ID is essential. Please, fill in this field.]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_title"><![CDATA[Title]]></string>
+	<string name="_bx_shopify_form_entry_input_title"><![CDATA[Title]]></string>
+	<string name="_bx_shopify_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+	<string name="_bx_shopify_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_shopify_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+	<string name="_bx_shopify_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_shopify_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this product]]></string>
+	<string name="_bx_shopify_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_shopify_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the product]]></string>
+    <string name="_bx_shopify_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_shopify_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_shopify_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
+    <string name="_bx_shopify_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_shopify_form_entry_input_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_shopify_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_shopify_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+
+    <string name="_bx_shopify_form_settings"><![CDATA[Settings]]></string>
+    <string name="_bx_shopify_form_settings_display_edit"><![CDATA[Edit Settings]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_api_key"><![CDATA[API Key]]></string>
+    <string name="_bx_shopify_form_settings_input_api_key"><![CDATA[API Key (Access Token)]]></string>
+    <string name="_bx_shopify_form_settings_input_api_key_err"><![CDATA[API Key field can't be empty]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_domain"><![CDATA[Domain]]></string>
+    <string name="_bx_shopify_form_settings_input_domain"><![CDATA[Domain]]></string>
+    <string name="_bx_shopify_form_settings_input_domain_err"><![CDATA[Domain field can't be empty]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_app_id"><![CDATA[App ID]]></string>
+    <string name="_bx_shopify_form_settings_input_app_id"><![CDATA[App ID]]></string>
+    <string name="_bx_shopify_form_settings_input_app_id_err"><![CDATA[App ID field can't be empty]]></string>
+    <string name="_bx_shopify_form_settings_input_sys_do_submit"><![CDATA[Submit]]></string>
+    <string name="_bx_shopify_form_settings_input_do_submit"><![CDATA[Submit]]></string>
+
+	<string name="_bx_shopify_acl_action_create_entry"><![CDATA[Create Goods]]></string>
+	<string name="_bx_shopify_acl_action_delete_entry"><![CDATA[Delete Goods]]></string>
+	<string name="_bx_shopify_acl_action_view_entry"><![CDATA[View Goods]]></string>
+	<string name="_bx_shopify_acl_action_set_thumb"><![CDATA[Set Goods Thumbnail]]></string>
+	<string name="_bx_shopify_acl_action_edit_any_entry"><![CDATA[Edit Any Goods]]></string>
+
+	<string name="_bx_shopify_page_title_sys_create_entry"><![CDATA[New Goods]]></string>
+	<string name="_bx_shopify_page_title_create_entry"><![CDATA[New Item]]></string>
+	<string name="_bx_shopify_page_block_title_create_entry"><![CDATA[New Item]]></string>
+	<string name="_bx_shopify_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_shopify_page_title_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_shopify_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_shopify_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_shopify_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_shopify_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+	<string name="_bx_shopify_page_title_sys_view_entry"><![CDATA[View Goods]]></string>
+	<string name="_bx_shopify_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_shopify_page_block_title_entry_text"><![CDATA[Item Text]]></string>
+	<string name="_bx_shopify_page_title_browse"><![CDATA[Goods]]></string>
+	<string name="_bx_shopify_page_title_search_results"><![CDATA[Goods matching "{0}"]]></string>
+	<string name="_bx_shopify_page_title_browse_by_author"><![CDATA[Goods of {display_name}]]></string>
+	<string name="_bx_shopify_page_title_browse_featured"><![CDATA[Featured]]></string>
+    <string name="_bx_shopify_page_title_browse_recent"><![CDATA[Latest]]></string>
+    <string name="_bx_shopify_page_title_browse_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_shopify_page_title_browse_updated"><![CDATA[Updated Goods]]></string>
+    <string name="_bx_shopify_page_title_sys_home"><![CDATA[Goods Home]]></string>
+    <string name="_bx_shopify_page_title_home"><![CDATA[Goods]]></string>
+    <string name="_bx_shopify_page_block_title_featured_entries_view_extended"><![CDATA[Featured]]></string>
+    <string name="_bx_shopify_page_block_title_recent_entries"><![CDATA[Latest (Gallery View)]]></string>
+    <string name="_bx_shopify_page_block_title_recent_entries_view_extended"><![CDATA[Latest]]></string>
+    <string name="_bx_shopify_page_block_title_recent_entries_view_full"><![CDATA[Latest (Full View)]]></string>
+    <string name="_bx_shopify_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_shopify_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_shopify_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_shopify_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_shopify_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_shopify_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_shopify_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_shopify_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_shopify_page_title_sys_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_shopify_page_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_shopify_page_title_sys_entries_updated"><![CDATA[Updated Goods]]></string>
+    <string name="_bx_shopify_page_title_entries_updated"><![CDATA[Updated Goods]]></string>
+    <string name="_bx_shopify_page_block_title_popular_entries"><![CDATA[Popular]]></string>
+    <string name="_bx_shopify_page_block_title_popular_entries_view_extended"><![CDATA[Popular (Extended View)]]></string>
+    <string name="_bx_shopify_page_block_title_popular_entries_view_full"><![CDATA[Popular (Full View)]]></string>
+    <string name="_bx_shopify_page_block_title_updated_entries"><![CDATA[Updated Goods]]></string>
+    <string name="_bx_shopify_page_title_sys_view_entry_comments"><![CDATA[Goods Comments]]></string>
+    <string name="_bx_shopify_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_shopify_page_title_sys_entries_of_author"><![CDATA[Goods of author]]></string>
+    <string name="_bx_shopify_page_title_entries_of_author"><![CDATA[Goods by {display_name}]]></string>
+    <string name="_bx_shopify_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_shopify_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string>
+    <string name="_bx_shopify_page_block_title_entries_of_author"><![CDATA[Goods by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_shopify_page_block_title_sys_entries_of_author"><![CDATA[Goods of author]]></string>   
+    <string name="_bx_shopify_page_block_title_entries_actions"><![CDATA[Goods actions]]></string>
+    <string name="_bx_shopify_page_block_title_browse_cmts"><![CDATA[Goods' Comments]]></string>
+	<string name="_bx_shopify_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_shopify_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_shopify_page_title_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_shopify_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_shopify_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_shopify_page_block_title_manage"><![CDATA[Manage]]></string>    
+	<string name="_bx_shopify_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
+	<string name="_bx_shopify_page_block_title_cats"><![CDATA[Categories]]></string>
+	<string name="_bx_shopify_page_block_title_entry_info"><![CDATA[Info]]></string>
+	<string name="_bx_shopify_page_block_title_my_entries"><![CDATA[My Goods]]></string>
+    <string name="_bx_shopify_page_title_sys_settings"><![CDATA[Settings]]></string>
+    <string name="_bx_shopify_page_title_settings"><![CDATA[Settings]]></string>
+    <string name="_bx_shopify_page_block_title_system_settings"><![CDATA[Settings]]></string>
+    <string name="_bx_shopify_page_block_title_settings"><![CDATA[Settings]]></string>
+
+    <string name="_bx_shopify_menu_set_title_view_entry"><![CDATA[Goods Actions]]></string>
+    <string name="_bx_shopify_menu_title_view_entry"><![CDATA[Goods Actions]]></string>
+    <string name="_bx_shopify_menu_title_submenu"><![CDATA[Goods Submenu]]></string>
+    <string name="_bx_shopify_menu_set_title_submenu"><![CDATA[Goods Submenu]]></string>
+    <string name="_bx_shopify_menu_item_title_system_create_entry"><![CDATA[New Goods]]></string>
+    <string name="_bx_shopify_menu_item_title_create_entry"><![CDATA[New Goods]]></string>
+    <string name="_bx_shopify_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_shopify_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_shopify_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_shopify_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_shopify_menu_item_title_system_view_entry"><![CDATA[View Goods]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_home"><![CDATA[Shop]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_home"><![CDATA[Shop]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_shopify_menu_item_title_system_settings"><![CDATA[Settings]]></string>
+    <string name="_bx_shopify_menu_item_title_settings"><![CDATA[Settings]]></string>
+    <string name="_bx_shopify_menu_item_title_system_dashboard"><![CDATA[Dashboard]]></string>
+    <string name="_bx_shopify_menu_item_title_dashboard"><![CDATA[Dashboard]]></string>
+    <string name="_bx_shopify_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_shopify_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_shopify_menu_title_view_entry_submenu"><![CDATA[View Goods Submenu]]></string>
+    <string name="_bx_shopify_menu_set_title_view_entry_submenu"><![CDATA[View Goods Submenu]]></string>
+    <string name="_bx_shopify_menu_item_title_view_entry_submenu_entry"><![CDATA[Item]]></string>
+    <string name="_bx_shopify_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_shopify_menu_item_title_system_view_entry_comments"><![CDATA[Goods Comments]]></string>
+    <string name="_bx_shopify_menu_item_title_system_view_entries_author"><![CDATA[Goods]]></string>
+    <string name="_bx_shopify_menu_item_title_view_entries_author"><![CDATA[Goods]]></string>
+    <string name="_bx_shopify_menu_title_entries_my"><![CDATA[My Goods Action Menu]]></string>
+    <string name="_bx_shopify_menu_set_title_entries_my"><![CDATA[My Goods Menu]]></string>
+	<string name="_bx_shopify_menu_item_title_system_manage_my_entries"><![CDATA[My goods]]></string>
+    <string name="_bx_shopify_menu_item_title_manage_my_entries"><![CDATA[{addon} goods]]></string>
+    <string name="_bx_shopify_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_shopify_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_shopify_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_shopify_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
+	<string name="_bx_shopify_menu_item_title_system_admt_entries"><![CDATA[Goods]]></string>
+	<string name="_bx_shopify_menu_item_title_admt_entries"><![CDATA[Goods - {addon} hidden]]></string>
+	<string name="_bx_shopify_menu_item_title_manage_my"><![CDATA[My Goods]]></string>
+	<string name="_bx_shopify_menu_item_title_manage_all"><![CDATA[All Goods]]></string>
+	<string name="_bx_shopify_menu_item_title_buy_for"><![CDATA[Buy for {price}]]></string>
+
+	<string name="_bx_shopify_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_shopify_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_shopify_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+	<string name="_bx_shopify_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_shopify_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_shopify_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_shopify_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_shopify_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_shopify_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_shopify_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_shopify_grid_action_err_delete"><![CDATA[Cannot delete the selected product(s).]]></string>
+    <string name="_bx_shopify_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_shopify_pre_lists_cats"><![CDATA[Goods categories]]></string>
+    <string name="_bx_shopify_cat_automotive_and_industrial"><![CDATA[Automotive & Industrial]]></string>
+    <string name="_bx_shopify_cat_beauty_health_food"><![CDATA[Beauty, Health & Food]]></string>
+    <string name="_bx_shopify_cat_books"><![CDATA[Books]]></string>
+    <string name="_bx_shopify_cat_clothing_shoes_jewelry"><![CDATA[Clothing, Shoes & Jewelry]]></string>
+    <string name="_bx_shopify_cat_electronics_and_computers"><![CDATA[Electronics & Computers]]></string>
+    <string name="_bx_shopify_cat_handmade"><![CDATA[Handmade]]></string>
+    <string name="_bx_shopify_cat_home_garden_tools"><![CDATA[Home, Garden & Tools]]></string>
+    <string name="_bx_shopify_cat_movies_music_games"><![CDATA[Movies, Music & Games]]></string>
+    <string name="_bx_shopify_cat_sports_and_outdoors"><![CDATA[Sports & Outdoors]]></string>
+    <string name="_bx_shopify_cat_toys_kids_baby"><![CDATA[Toys, Kids & Baby]]></string>
+
+    <string name="_bx_shopify_err_not_configured"><![CDATA[You need to configure shop settings first. <a href="{0}">Click here</a>.]]></string>
+
+    <string name="_bx_shopify_txt_all_entries_by"><![CDATA[<a href="{0}">All Goods by {1} ({2})</a>]]></string>
+    <string name="_bx_shopify_txt_sample_single"><![CDATA[shop item]]></string>
+    <string name="_bx_shopify_txt_sample_single_with_article"><![CDATA[a shop item]]></string>
+    <string name="_bx_shopify_txt_sample_comment_single"><![CDATA[shop item's comment]]></string>
+    <string name="_bx_shopify_txt_sample_vote_single"><![CDATA[shop item's vote]]></string>
+</resources>

+ 51 - 0
modules/boonex/shopify/install/sql/disable.sql

@@ -0,0 +1,51 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_shopify' LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_shopify' OR `object` IN('bx_shopify_create_entry', 'bx_shopify_edit_entry', 'bx_shopify_delete_entry', 'bx_shopify_view_entry', 'bx_shopify_view_entry_comments', 'bx_shopify_home', 'bx_shopify_popular', 'bx_shopify_updated', 'bx_shopify_author');
+
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_shopify' OR `set_name` IN('bx_shopify_view', 'bx_shopify_submenu', 'bx_shopify_view_submenu', 'bx_shopify_my');
+
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_shopify_allow_view_to';
+
+
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_shopify';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_shopify';
+
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_shopify', 'bx_shopify_cmts');
+
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_shopify';
+
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_shopify_cats';
+
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_shopify_administration', 'bx_shopify_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_shopify_administration', 'bx_shopify_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_shopify_administration', 'bx_shopify_common');
+
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_shopify' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;

+ 348 - 0
modules/boonex/shopify/install/sql/enable.sql

@@ -0,0 +1,348 @@
+
+-- SETTINGS
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_shopify', '_bx_shopify', 'bx_shopify@modules/boonex/shopify/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_shopify', '_bx_shopify', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_shopify_per_page_browse', '12', @iCategId, '_bx_shopify_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_shopify_per_page_profile', '3', @iCategId, '_bx_shopify_option_per_page_profile', 'digit', '', '', '', 12),
+('bx_shopify_rss_num', '10', @iCategId, '_bx_shopify_option_rss_num', 'digit', '', '', '', 20),
+('bx_shopify_searchable_fields', 'title', @iCategId, '_bx_shopify_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:21:"get_searchable_fields";}', 30);
+
+-- PAGE: create entry
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_create_entry', '_bx_shopify_page_title_sys_create_entry', '_bx_shopify_page_title_create_entry', 'bx_shopify', 5, 2147483647, 1, 'create-shopify-entry', 'page.php?i=create-shopify-entry', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_shopify_create_entry', 1, 'bx_shopify', '_bx_shopify_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+-- PAGE: edit entry
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_edit_entry', '_bx_shopify_page_title_sys_edit_entry', '_bx_shopify_page_title_edit_entry', 'bx_shopify', 5, 2147483647, 1, 'edit-shopify-entry', '', '', '', '', 0, 1, 0, 'BxShopifyPageEntry', 'modules/boonex/shopify/classes/BxShopifyPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_shopify_edit_entry', 1, 'bx_shopify', '_bx_shopify_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+-- PAGE: delete entry
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_delete_entry', '_bx_shopify_page_title_sys_delete_entry', '_bx_shopify_page_title_delete_entry', 'bx_shopify', 5, 2147483647, 1, 'delete-shopify-entry', '', '', '', '', 0, 1, 0, 'BxShopifyPageEntry', 'modules/boonex/shopify/classes/BxShopifyPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_shopify_delete_entry', 1, 'bx_shopify', '_bx_shopify_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
+
+-- PAGE: view entry
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_view_entry', '_bx_shopify_page_title_sys_view_entry', '_bx_shopify_page_title_view_entry', 'bx_shopify', 10, 2147483647, 1, 'view-shopify-entry', '', '', '', '', 0, 1, 0, 'BxShopifyPageEntry', 'modules/boonex/shopify/classes/BxShopifyPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_shopify_view_entry', 1, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:17:"entity_text_block";}', 0, 0, 1, 0),
+('bx_shopify_view_entry', 1, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:18:"entity_attachments";}', 0, 0, 1, 1),
+('bx_shopify_view_entry', 2, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"entity_author";}', 0, 0, 1, 0),
+('bx_shopify_view_entry', 3, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:11:"entity_info";}', 0, 0, 1, 1),
+('bx_shopify_view_entry', 3, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:15:"entity_location";}', 0, 0, 0, 2),
+('bx_shopify_view_entry', 4, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:18:"entity_all_actions";}', 0, 0, 1, 0),
+('bx_shopify_view_entry', 4, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:14:"entity_actions";}', 0, 0, 0, 1),
+('bx_shopify_view_entry', 4, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:21:"entity_social_sharing";}', 0, 0, 0, 2),
+('bx_shopify_view_entry', 4, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:15:"entity_comments";}', 0, 0, 1, 3),
+('bx_shopify_view_entry', 4, 'bx_shopify', '', '_bx_shopify_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:13:"locations_map";s:6:"params";a:2:{i:0;s:10:"bx_shopify";i:1;s:4:"{id}";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 0, 1, 4);
+
+-- PAGE: view entry comments
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_view_entry_comments', '_bx_shopify_page_title_sys_view_entry_comments', '_bx_shopify_page_title_view_entry_comments', 'bx_shopify', 5, 2147483647, 1, 'view-shopify-entry-comments', '', '', '', '', 0, 1, 0, 'BxShopifyPageEntry', 'modules/boonex/shopify/classes/BxShopifyPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_shopify_view_entry_comments', 1, 'bx_shopify', '_bx_shopify_page_block_title_entry_comments', '_bx_shopify_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:15:"entity_comments";}', 0, 0, 1);
+
+-- PAGE: popular entries
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_popular', '_bx_shopify_page_title_sys_entries_popular', '_bx_shopify_page_title_entries_popular', 'bx_shopify', 5, 2147483647, 1, 'shopify-popular', 'page.php?i=shopify-popular', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_shopify_popular', 1, 'bx_shopify', '_bx_shopify_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+-- PAGE: recently updated entries
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_updated', '_bx_shopify_page_title_sys_entries_updated', '_bx_shopify_page_title_entries_updated', 'bx_shopify', 5, 2147483647, 1, 'shopify-updated', 'page.php?i=shopify-updated', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_shopify_updated', 1, 'bx_shopify', '_bx_shopify_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:14:"browse_updated";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+-- PAGE: entries of author
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_author', 'shopify-author', '_bx_shopify_page_title_sys_entries_of_author', '_bx_shopify_page_title_entries_of_author', 'bx_shopify', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxShopifyPageAuthor', 'modules/boonex/shopify/classes/BxShopifyPageAuthor.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_shopify_author', 1, 'bx_shopify', '', '_bx_shopify_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:18:"my_entries_actions";}', 0, 0, 1, 1),
+('bx_shopify_author', 1, 'bx_shopify', '_bx_shopify_page_block_title_sys_favorites_of_author', '_bx_shopify_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:15:"browse_favorite";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_shopify_author', 1, 'bx_shopify', '_bx_shopify_page_block_title_sys_entries_of_author', '_bx_shopify_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"browse_author";}', 0, 0, 1, 3);
+
+-- PAGE: module home
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_home', 'shopify-home', '_bx_shopify_page_title_sys_home', '_bx_shopify_page_title_home', 'bx_shopify', 2, 2147483647, 1, 'page.php?i=shopify-home', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_shopify_home', 1, 'bx_shopify', '', '_bx_shopify_page_block_title_featured_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:15:"browse_featured";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_shopify_home', 1, 'bx_shopify', '', '_bx_shopify_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 1),
+('bx_shopify_home', 2, 'bx_shopify', '', '_bx_shopify_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"keywords_cloud";s:6:"params";a:2:{i:0;s:10:"bx_shopify";i:1;s:10:"bx_shopify";}s:5:"class";s:20:"TemplServiceMetatags";}', 0, 1, 1, 0),
+('bx_shopify_home', 2, 'bx_shopify', '', '_bx_shopify_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:15:"categories_list";s:6:"params";a:2:{i:0;s:15:"bx_shopify_cats";i:1;a:1:{s:10:"show_empty";b:1;}}s:5:"class";s:20:"TemplServiceCategory";}', 0, 1, 1, 1);
+
+-- PAGE: module manage own
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_manage', '_bx_shopify_page_title_sys_manage', '_bx_shopify_page_title_manage', 'bx_shopify', 5, 2147483647, 1, 'shopify-manage', 'page.php?i=shopify-manage', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_shopify_manage', 1, 'bx_shopify', '_bx_shopify_page_block_title_system_manage', '_bx_shopify_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:12:"manage_tools";}}', 0, 1, 0);
+
+-- PAGE: module manage all
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_administration', '_bx_shopify_page_title_sys_manage_administration', '_bx_shopify_page_title_manage', 'bx_shopify', 5, 192, 1, 'shopify-administration', 'page.php?i=shopify-administration', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_shopify_administration', 1, 'bx_shopify', '_bx_shopify_page_block_title_system_manage_administration', '_bx_shopify_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:12:"manage_tools";s:6:"params";a:1:{i:0;s:14:"administration";}}', 0, 1, 0);
+
+-- PAGE: module settings
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_settings', '_bx_shopify_page_title_sys_settings', '_bx_shopify_page_title_settings', 'bx_shopify', 5, 2147483647, 1, 'shopify-settings', 'page.php?i=shopify-settings', '', '', '', 0, 1, 0, 'BxShopifyPageBrowse', 'modules/boonex/shopify/classes/BxShopifyPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_shopify_settings', 1, 'bx_shopify', '_bx_shopify_page_block_title_system_settings', '_bx_shopify_page_block_title_settings', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:8:"settings";}}', 0, 1, 0);
+
+-- PAGE: add block to homepage
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('sys_home', 1, 'bx_shopify', '_bx_shopify_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"browse_public";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
+SET @iPBCellProfile = 3;
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_shopify', '_bx_shopify_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"browse_author";s:6:"params";a:2:{i:0;s:12:"{profile_id}";i:1;a:1:{s:8:"per_page";s:27:"bx_shopify_per_page_profile";}}}', 0, 0, 0);
+
+-- PAGE: service blocks
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, 'bx_shopify', '_bx_shopify_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"browse_public";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1),
+
+('', 0, 'bx_shopify', '_bx_shopify_page_block_title_recent_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2),
+('', 0, 'bx_shopify', '_bx_shopify_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 3),
+('', 0, 'bx_shopify', '_bx_shopify_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 4);
+
+
+-- MENU: add to site menu
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_shopify', 'shopify-home', '_bx_shopify_menu_item_title_system_entries_home', '_bx_shopify_menu_item_title_entries_home', 'page.php?i=shopify-home', '', '', 'shopping-cart col-green1', 'bx_shopify_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to homepage menu
+SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_homepage', 'bx_shopify', 'shopify-home', '_bx_shopify_menu_item_title_system_entries_home', '_bx_shopify_menu_item_title_entries_home', 'page.php?i=shopify-home', '', '', 'shopping-cart col-green1', 'bx_shopify_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_shopify', 'create-shopify-entry', '_bx_shopify_menu_item_title_system_create_entry', '_bx_shopify_menu_item_title_create_entry', 'page.php?i=create-shopify-entry', '', '', 'shopping-cart col-green1', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+-- MENU: actions menu for view entry 
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_view', '_bx_shopify_menu_title_view_entry', 'bx_shopify_view', 'bx_shopify', 9, 0, 1, 'BxShopifyMenuView', 'modules/boonex/shopify/classes/BxShopifyMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_shopify_view', 'bx_shopify', '_bx_shopify_menu_set_title_view_entry', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_shopify_view', 'bx_shopify', 'edit-shopify-entry', '_bx_shopify_menu_item_title_system_edit_entry', '_bx_shopify_menu_item_title_edit_entry', 'page.php?i=edit-shopify-entry&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
+('bx_shopify_view', 'bx_shopify', 'delete-shopify-entry', '_bx_shopify_menu_item_title_system_delete_entry', '_bx_shopify_menu_item_title_delete_entry', 'page.php?i=delete-shopify-entry&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
+
+-- MENU: actions menu for my entries
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_my', '_bx_shopify_menu_title_entries_my', 'bx_shopify_my', 'bx_shopify', 9, 0, 1, 'BxShopifyMenu', 'modules/boonex/shopify/classes/BxShopifyMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_shopify_my', 'bx_shopify', '_bx_shopify_menu_set_title_entries_my', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_shopify_my', 'bx_shopify', 'create-shopify-entry', '_bx_shopify_menu_item_title_system_create_entry', '_bx_shopify_menu_item_title_create_entry', 'page.php?i=create-shopify-entry', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+-- MENU: module sub-menu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_submenu', '_bx_shopify_menu_title_submenu', 'bx_shopify_submenu', 'bx_shopify', 8, 0, 1, 'BxShopifyMenuSubmenu', 'modules/boonex/shopify/classes/BxShopifyMenuSubmenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_shopify_submenu', 'bx_shopify', '_bx_shopify_menu_set_title_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_shopify_submenu', 'bx_shopify', 'shopify-home', '_bx_shopify_menu_item_title_system_entries_public', '_bx_shopify_menu_item_title_entries_public', 'page.php?i=shopify-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_shopify_submenu', 'bx_shopify', 'shopify-popular', '_bx_shopify_menu_item_title_system_entries_popular', '_bx_shopify_menu_item_title_entries_popular', 'page.php?i=shopify-popular', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_shopify_submenu', 'bx_shopify', 'shopify-manage', '_bx_shopify_menu_item_title_system_entries_manage', '_bx_shopify_menu_item_title_entries_manage', 'page.php?i=shopify-manage', '', '', '', '', 2147483646, 1, 1, 3),
+('bx_shopify_submenu', 'bx_shopify', 'shopify-settings', '_bx_shopify_menu_item_title_system_settings', '_bx_shopify_menu_item_title_settings', 'page.php?i=shopify-settings', '', '', '', '', 2147483646, 1, 1, 4),
+('bx_shopify_submenu', 'bx_shopify', 'shopify-dashboard', '_bx_shopify_menu_item_title_system_dashboard', '_bx_shopify_menu_item_title_dashboard', 'https://{domain}/admin', '', '_blank', '', '', 2147483646, 1, 1, 5);
+
+-- MENU: sub-menu for view entry
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_view_submenu', '_bx_shopify_menu_title_view_entry_submenu', 'bx_shopify_view_submenu', 'bx_shopify', 8, 0, 0, 'BxShopifyMenuView', 'modules/boonex/shopify/classes/BxShopifyMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_shopify_view_submenu', 'bx_shopify', '_bx_shopify_menu_set_title_view_entry_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_shopify_view_submenu', 'bx_shopify', 'view-shopify-entry', '_bx_shopify_menu_item_title_system_view_entry', '_bx_shopify_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-shopify-entry&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
+('bx_shopify_view_submenu', 'bx_shopify', 'view-shopify-entry-comments', '_bx_shopify_menu_item_title_system_view_entry_comments', '_bx_shopify_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-shopify-entry-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_shopify', 'profile-stats-manage-shopify', '_bx_shopify_menu_item_title_system_manage_my_entries', '_bx_shopify_menu_item_title_manage_my_entries', 'page.php?i=shopify-manage', '', '_self', 'shopping-cart col-green1', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify_menu_manage_tools', '_bx_shopify_menu_title_manage_tools', 'bx_shopify_menu_manage_tools', 'bx_shopify', 6, 0, 1, 'BxShopifyMenuManageTools', 'modules/boonex/shopify/classes/BxShopifyMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_shopify_menu_manage_tools', 'bx_shopify', '_bx_shopify_menu_set_title_manage_tools', 0);
+
+--INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+--('bx_shopify_menu_manage_tools', 'bx_shopify', 'delete-with-content', '_bx_shopify_menu_item_title_system_delete_with_content', '_bx_shopify_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 128, 1, 0, 0);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_shopify', 'shopify-administration', '_bx_shopify_menu_item_title_system_admt_entries', '_bx_shopify_menu_item_title_admt_entries', 'page.php?i=shopify-administration', '', '_self', '', 'a:2:{s:6:"module";s:10:"bx_shopify";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_shopify', 'shopify-author', '_bx_shopify_menu_item_title_system_view_entries_author', '_bx_shopify_menu_item_title_view_entries_author', 'page.php?i=shopify-author&profile_id={profile_id}', '', '', 'shopping-cart col-green1', '', 2147483647, 1, 0, 0);
+
+
+-- PRIVACY 
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_shopify_allow_view_to', 'bx_shopify', 'view', '_bx_shopify_form_entry_input_allow_view_to', '3', 'bx_shopify_entries', 'id', 'author', '', '');
+
+
+-- ACL
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_shopify', 'create entry', NULL, '_bx_shopify_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_shopify', 'delete entry', NULL, '_bx_shopify_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_shopify', 'view entry', NULL, '_bx_shopify_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_shopify', 'set thumb', NULL, '_bx_shopify_acl_action_set_thumb', '', 1, 3);
+SET @iIdActionSetThumb = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_shopify', 'edit any entry', NULL, '_bx_shopify_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- entry create
+(@iStandard, @iIdActionEntryCreate),
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iStandard, @iIdActionEntryDelete),
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView),
+
+-- set entry thumb
+(@iStandard, @iIdActionSetThumb),
+(@iModerator, @iIdActionSetThumb),
+(@iAdministrator, @iIdActionSetThumb),
+(@iPremium, @iIdActionSetThumb),
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny);
+
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_shopify', '_bx_shopify', @iSearchOrder + 1, 'BxShopifySearchResult', 'modules/boonex/shopify/classes/BxShopifySearchResult.php'),
+('bx_shopify_cmts', '_bx_shopify_cmts', @iSearchOrder + 2, 'BxShopifyCmtsSearchResult', 'modules/boonex/shopify/classes/BxShopifyCmtsSearchResult.php');
+
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_shopify', 'bx_shopify_meta_keywords', 'bx_shopify_meta_locations', '', '', '');
+
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_shopify_cats', 'bx_shopify', 'bx_shopify', 'bx_shopify_cats', 'bx_shopify_entries', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_shopify_entries`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+
+-- GRIDS: moderation tools
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_shopify_administration', 'Sql', 'SELECT * FROM `bx_shopify_entries` WHERE 1 ', 'bx_shopify_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxShopifyGridAdministration', 'modules/boonex/shopify/classes/BxShopifyGridAdministration.php'),
+('bx_shopify_common', 'Sql', 'SELECT * FROM `bx_shopify_entries` WHERE 1 ', 'bx_shopify_entries', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 2147483647, 'BxShopifyGridCommon', 'modules/boonex/shopify/classes/BxShopifyGridCommon.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_shopify_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_shopify_administration', 'switcher', '_bx_shopify_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_shopify_administration', 'title', '_bx_shopify_grid_column_title_adm_title', '25%', 0, '', '', 3),
+('bx_shopify_administration', 'added', '_bx_shopify_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_shopify_administration', 'author', '_bx_shopify_grid_column_title_adm_author', '25%', 0, '25', '', 5),
+('bx_shopify_administration', 'actions', '', '20%', 0, '', '', 6),
+
+('bx_shopify_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_shopify_common', 'switcher', '_bx_shopify_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_shopify_common', 'title', '_bx_shopify_grid_column_title_adm_title', '40%', 0, '', '', 3),
+('bx_shopify_common', 'added', '_bx_shopify_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_shopify_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_shopify_administration', 'bulk', 'delete', '_bx_shopify_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_shopify_administration', 'single', 'edit', '_bx_shopify_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_shopify_administration', 'single', 'delete', '_bx_shopify_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_shopify_administration', 'single', 'settings', '_bx_shopify_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+
+('bx_shopify_common', 'bulk', 'delete', '_bx_shopify_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_shopify_common', 'single', 'edit', '_bx_shopify_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_shopify_common', 'single', 'delete', '_bx_shopify_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_shopify_common', 'single', 'settings', '_bx_shopify_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
+
+
+-- ALERTS
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_shopify', 'BxShopifyAlertsResponse', 'modules/boonex/shopify/classes/BxShopifyAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('profile', 'delete', @iHandler);

+ 256 - 0
modules/boonex/shopify/install/sql/install.sql

@@ -0,0 +1,256 @@
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+
+-- TABLE: entries
+CREATE TABLE IF NOT EXISTS `bx_shopify_entries` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `code` varchar(16) NOT NULL default '',
+  `cat` int(11) NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `featured` int(11) NOT NULL default '0',
+  `allow_view_to` int(11) NOT NULL DEFAULT '3',
+  `status` enum('active','hidden') NOT NULL DEFAULT 'active',
+  `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `title_text` (`title`)
+);
+
+-- TABLE: settings
+CREATE TABLE IF NOT EXISTS `bx_shopify_settings` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `api_key` varchar(255) NOT NULL,
+  `domain` varchar(255) NOT NULL,
+  `app_id` tinyint(4) unsigned NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `author` (`author`)
+);
+
+-- TABLE: comments
+CREATE TABLE IF NOT EXISTS `bx_shopify_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+CREATE TABLE IF NOT EXISTS `bx_shopify_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_shopify_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: views
+CREATE TABLE IF NOT EXISTS `bx_shopify_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+CREATE TABLE IF NOT EXISTS `bx_shopify_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_shopify_meta_locations` (
+  `object_id` int(10) unsigned NOT NULL,
+  `lat` double NOT NULL,
+  `lng` double NOT NULL,
+  `country` varchar(2) NOT NULL,
+  `state` varchar(255) NOT NULL,
+  `city` varchar(255) NOT NULL,
+  `zip` varchar(255) NOT NULL,
+  `street` varchar(255) NOT NULL,
+  `street_number` varchar(255) NOT NULL,
+  PRIMARY KEY (`object_id`),
+  KEY `country_state_city` (`country`,`state`(8),`city`(8))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: reports
+CREATE TABLE IF NOT EXISTS `bx_shopify_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_shopify_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: favorites
+CREATE TABLE IF NOT EXISTS `bx_shopify_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- FORMS
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_shopify', 'bx_shopify', '_bx_shopify_form_entry', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_shopify_entries', 'id', '', '', 'do_submit', '', 0, 1, 'BxShopifyFormEntry', 'modules/boonex/shopify/classes/BxShopifyFormEntry.php'),
+('bx_shopify_settings', 'bx_shopify', '_bx_shopify_form_settings', '', 'a:1:{s:7:"enctype";s:19:"multipart/form-data";}', 'bx_shopify_settings', 'id', '', '', 'do_submit', '', 0, 1, 'BxShopifyFormSettings', 'modules/boonex/shopify/classes/BxShopifyFormSettings.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_shopify', 'bx_shopify_entry_add', 'bx_shopify', 0, '_bx_shopify_form_entry_display_add'),
+('bx_shopify', 'bx_shopify_entry_delete', 'bx_shopify', 0, '_bx_shopify_form_entry_display_delete'),
+('bx_shopify', 'bx_shopify_entry_edit', 'bx_shopify', 0, '_bx_shopify_form_entry_display_edit'),
+('bx_shopify', 'bx_shopify_entry_view', 'bx_shopify', 1, '_bx_shopify_form_entry_display_view'),
+
+('bx_shopify_settings', 'bx_shopify_settings_edit', 'bx_shopify', 0, '_bx_shopify_form_settings_display_edit');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_shopify', 'bx_shopify', 'allow_view_to', '', '', 0, 'custom', '_bx_shopify_form_entry_input_sys_allow_view_to', '_bx_shopify_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_shopify', 'bx_shopify', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_shopify_form_entry_input_sys_delete_confirm', '_bx_shopify_form_entry_input_delete_confirm', '_bx_shopify_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'do_publish', '_bx_shopify_form_entry_input_do_publish', '', 0, 'submit', '_bx_shopify_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'do_submit', '_bx_shopify_form_entry_input_do_submit', '', 0, 'submit', '_bx_shopify_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'location', '', '', 0, 'location', '_sys_form_input_sys_location', '_sys_form_input_location', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'title', '', '', 0, 'text', '_bx_shopify_form_entry_input_sys_title', '_bx_shopify_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'code', '', '', 0, 'text', '_bx_shopify_form_entry_input_sys_code', '_bx_shopify_form_entry_input_code', '_bx_shopify_form_entry_input_code_inf', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_entry_input_code_err', 'Xss', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'cat', '', '#!bx_shopify_cats', 0, 'select', '_bx_shopify_form_entry_input_sys_cat', '_bx_shopify_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'added', '', '', 0, 'datetime', '_bx_shopify_form_entry_input_sys_date_added', '_bx_shopify_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_shopify', 'bx_shopify', 'changed', '', '', 0, 'datetime', '_bx_shopify_form_entry_input_sys_date_changed', '_bx_shopify_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+
+('bx_shopify_settings', 'bx_shopify', 'api_key', '', '', 0, 'text', '_bx_shopify_form_settings_input_sys_api_key', '_bx_shopify_form_settings_input_api_key', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_settings_input_api_key_err', 'Xss', '', 1, 0),
+('bx_shopify_settings', 'bx_shopify', 'domain', '', '', 0, 'text', '_bx_shopify_form_settings_input_sys_domain', '_bx_shopify_form_settings_input_domain', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_settings_input_domain_err', 'Xss', '', 1, 0),
+('bx_shopify_settings', 'bx_shopify', 'app_id', '', '', 0, 'text', '_bx_shopify_form_settings_input_sys_app_id', '_bx_shopify_form_settings_input_app_id', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_shopify_form_settings_input_app_id_err', 'Int', '', 1, 0),
+('bx_shopify_settings', 'bx_shopify', 'do_submit', '_bx_shopify_form_settings_input_do_submit', '', 0, 'submit', '_bx_shopify_form_settings_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_shopify_entry_add', 'code', 2147483647, 1, 1),
+('bx_shopify_entry_add', 'title', 2147483647, 1, 2),
+('bx_shopify_entry_add', 'cat', 2147483647, 1, 3),
+('bx_shopify_entry_add', 'allow_view_to', 2147483647, 1, 4),
+('bx_shopify_entry_add', 'location', 2147483647, 1, 5),
+('bx_shopify_entry_add', 'do_publish', 2147483647, 1, 6),
+
+('bx_shopify_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_shopify_entry_delete', 'do_submit', 2147483647, 1, 2),
+
+('bx_shopify_entry_edit', 'code', 2147483647, 1, 1),
+('bx_shopify_entry_edit', 'title', 2147483647, 1, 2),
+('bx_shopify_entry_edit', 'cat', 2147483647, 1, 3),
+('bx_shopify_entry_edit', 'allow_view_to', 2147483647, 1, 4),
+('bx_shopify_entry_edit', 'location', 2147483647, 1, 5),
+('bx_shopify_entry_edit', 'do_submit', 2147483647, 1, 6),
+
+('bx_shopify_entry_view', 'cat', 2147483647, 1, 1),
+('bx_shopify_entry_view', 'added', 2147483647, 1, 2),
+('bx_shopify_entry_view', 'changed', 2147483647, 1, 3),
+
+('bx_shopify_entry_view_full', 'cat', 2147483647, 1, 1),
+('bx_shopify_entry_view_full', 'added', 2147483647, 1, 2),
+('bx_shopify_entry_view_full', 'changed', 2147483647, 1, 3),
+
+('bx_shopify_settings_edit', 'mode', 2147483647, 1, 1),
+('bx_shopify_settings_edit', 'api_key', 2147483647, 1, 2),
+('bx_shopify_settings_edit', 'domain', 2147483647, 1, 3),
+('bx_shopify_settings_edit', 'app_id', 2147483647, 1, 4),
+('bx_shopify_settings_edit', 'do_submit', 2147483647, 1, 5);
+
+
+-- PRE-VALUES
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`, `extendable`) VALUES
+('bx_shopify_cats', '_bx_shopify_pre_lists_cats', 'bx_shopify', '0', '1');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_shopify_cats', '', 0, '_sys_please_select', ''),
+('bx_shopify_cats', '1', 1, '_bx_shopify_cat_automotive_and_industrial', ''),
+('bx_shopify_cats', '2', 2, '_bx_shopify_cat_beauty_health_food', ''),
+('bx_shopify_cats', '3', 3, '_bx_shopify_cat_books', ''),
+('bx_shopify_cats', '4', 4, '_bx_shopify_cat_clothing_shoes_jewelry', ''),
+('bx_shopify_cats', '5', 5, '_bx_shopify_cat_electronics_and_computers', ''),
+('bx_shopify_cats', '6', 6, '_bx_shopify_cat_handmade', ''),
+('bx_shopify_cats', '7', 7, '_bx_shopify_cat_home_garden_tools', ''),
+('bx_shopify_cats', '8', 8, '_bx_shopify_cat_movies_music_games', ''),
+('bx_shopify_cats', '9', 9, '_bx_shopify_cat_sports_and_outdoors', ''),
+('bx_shopify_cats', '10', 10, '_bx_shopify_cat_toys_kids_baby', '');
+
+
+-- COMMENTS
+INSERT INTO `sys_objects_cmts` (`Name`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_shopify', 'bx_shopify_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-shopify-entry&id={object_id}', '', 'bx_shopify_entries', 'id', 'author', 'title', 'comments', '', '');
+
+
+-- VOTES
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_shopify', 'bx_shopify_votes', 'bx_shopify_votes_track', '604800', '1', '1', '0', '1', 'bx_shopify_entries', 'id', 'author', 'rate', 'votes', '', '');
+
+
+-- REPORTS
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_shopify', 'bx_shopify_reports', 'bx_shopify_reports_track', '1', 'page.php?i=view-shopify-entry&id={object_id}', 'bx_shopify_entries', 'id', 'author', 'reports', '', '');
+
+
+-- VIEWS
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_shopify', 'bx_shopify_views_track', '86400', '1', 'bx_shopify_entries', 'id', 'author', 'views', '', '');
+
+
+-- FAFORITES
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_shopify', 'bx_shopify_favorites_track', '1', '1', '1', 'page.php?i=view-shopify-entry&id={object_id}', 'bx_shopify_entries', 'id', 'author', 'favorites', '', '');
+
+
+-- FEATURED
+INSERT INTO `sys_objects_feature` (`name`, `is_on`, `is_undo`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_flag`, `class_name`, `class_file`) VALUES 
+('bx_shopify', '1', '1', 'page.php?i=view-shopify-entry&id={object_id}', 'bx_shopify_entries', 'id', 'author', 'featured', '', '');
+
+
+-- STUDIO: page & widget
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_shopify', '_bx_shopify', '_bx_shopify', 'bx_shopify@modules/boonex/shopify/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_shopify', '{url_studio}module.php?name=bx_shopify', '', 'bx_shopify@modules/boonex/shopify/|std-icon.svg', '_bx_shopify', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));

+ 45 - 0
modules/boonex/shopify/install/sql/uninstall.sql

@@ -0,0 +1,45 @@
+
+-- TABLES
+DROP TABLE IF EXISTS `bx_shopify_entries`, `bx_shopify_settings`, `bx_shopify_cmts`, `bx_shopify_votes`, `bx_shopify_votes_track`, `bx_shopify_views_track`, `bx_shopify_meta_keywords`, `bx_shopify_meta_locations`, `bx_shopify_reports`, `bx_shopify_reports_track`, `bx_shopify_favorites_track`;
+
+
+-- FORMS
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_shopify_entry_add', 'bx_shopify_entry_edit', 'bx_shopify_entry_view', 'bx_shopify_entry_view_full', 'bx_shopify_entry_delete', 'bx_shopify_settings_edit');
+
+
+-- PRE-VALUES
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_shopify';
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_shopify_cats');
+
+
+-- COMMENTS
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_shopify';
+
+
+-- VOTES
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_shopify';
+
+
+-- REPORTS
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_shopify';
+
+
+-- VIEWS
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_shopify';
+
+
+-- FAFORITES
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_shopify';
+
+
+-- FEATURED
+DELETE FROM `sys_objects_feature` WHERE `name` = 'bx_shopify';
+
+
+-- STUDIO: page & widget
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_shopify';

+ 51 - 0
modules/boonex/shopify/js/manage_tools.js

@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxShopifyManageTools(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxShopifyManageTools' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxShopifyManageTools.prototype.onChangeFilter = function(oFilter) {
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	glGrids[this._sObjNameGrid].setFilter(sValueFilter1 + this._sParamsDivider + sValueSearch, true);
+};
+
+BxShopifyManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
+	if($(oButton).hasClass('bx-btn-disabled'))
+		return false;
+
+	bx_menu_popup(sMenuObject, oButton, {}, {
+		content_id: $(oButton).attr('bx_grid_action_data')
+	});
+};
+
+BxShopifyManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 168 - 0
modules/boonex/shopify/js/shop.js

@@ -0,0 +1,168 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxShopifyShop(oOptions) {
+	this._sAPIKey = oOptions.sAPIKey;
+	this._sDomain = oOptions.sDomain;
+	this._sAppId = oOptions.sAppId;
+
+	this._sActionsUrl = oOptions.sActionUrl;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxShopifyShop' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+
+    this._sClassCover = 'bx-cover-wrapper';
+    this._sClassLoading = 'bx-spf-loading';
+    this._sClassLoaded = 'bx-spf-loaded';
+
+    this._oShopClient = ShopifyBuy.buildClient({
+	  accessToken: this._sAPIKey,
+	  domain: this._sDomain,
+	  appId: this._sAppId
+	});
+}
+
+BxShopifyShop.prototype.getUnit = function(iProduct) {
+	var $this = this;
+
+	var oUnit = $('.' + this._aHtmlIds['unit'] + iProduct + ':not(.' + this._sClassLoading + ', .' + this._sClassLoaded + '):first');
+	if(!oUnit.length)
+		return;
+
+	bx_loading(oUnit.addClass(this._sClassLoading), true);
+	this.fetchProduct(iProduct, function (oProduct) {
+		$this.onGetUnit(oProduct);
+	});
+};
+
+BxShopifyShop.prototype.onGetUnit = function(oProduct) {
+	if(!oProduct)
+		return;
+
+	var oUnit = $('.' + this._aHtmlIds['unit'] + oProduct.id + '.' + this._sClassLoading + ':first');
+	if(!oUnit.length)
+		return;
+
+	//--- Fetch product main image.
+	if(oProduct.selectedVariantImage.src) {
+		//--- for Extended view 
+		oUnit.find('.bx-spf-unit-cover img').attr('src', oProduct.selectedVariantImage.src).parents('.bx-spf-unit-cover:first').show();
+
+		//--- for Gallery view
+		oUnit.find('.bx-spf-unit-thumb').css('background-image', 'url(' + oProduct.selectedVariantImage.src + ')');
+	}
+
+	//--- Fetch product description.
+	oUnit.find('.bx-spf-unit-summary').html(oProduct.description);
+
+	//--- Fetch price.
+	if(oProduct.selectedVariant.formattedPrice) {
+		var oBuy = oUnit.find('.bx-shopify-buy');
+		var sBuyContent = oBuy.html();
+		oBuy.html(sBuyContent.replace('{price}', oProduct.selectedVariant.formattedPrice));
+		oBuy.attr('href', oProduct.selectedVariant.checkoutUrl(1));
+		oBuy.show();
+	}
+
+	bx_loading(oUnit.removeClass(this._sClassLoading).addClass(this._sClassLoaded), false);
+};
+
+BxShopifyShop.prototype.getEntry = function(iProduct) {
+	var $this = this;
+
+	bx_loading($('.' + this._sClassCover), true);
+
+	this.fetchProduct(iProduct, function (oProduct) {
+		$this.onGetEntry(oProduct);
+	});
+};
+
+BxShopifyShop.prototype.onGetEntry = function(oProduct) {
+	if(!oProduct)
+		return;
+
+	//--- Fetch product main image.
+	var iCoverImageId = oProduct.selectedVariantImage.id;
+	$('.' + this._sClassCover).css('background-image', 'url(' + oProduct.selectedVariantImage.src + ')');
+
+	//--- Fetch product description.
+	$('#' + this._aHtmlIds['entry_content']).find('.bx-spf-text').html(oProduct.description);
+
+	//--- Fetch product images.
+	var oSample = $('#' + this._aHtmlIds['entry_attachment_sample']);
+	var oContainer = $('#' + this._aHtmlIds['entry_attachments']);
+	oProduct.images.map(function(oImage) {
+		if(oImage.id == iCoverImageId)
+			return;
+
+		var oAttachment = oSample.clone().removeAttr('id').removeClass('bx-spf-attachment-sample');
+
+		var oLink = oAttachment.find('.bx-spf-attachment-link');
+		var sLinkOnClick = oLink.attr('onclick');
+		oLink.attr('onclick', sLinkOnClick.replace('{id}', oImage.id).replace('{url}', oImage.src));
+		oLink.find('.bx-spf-attachment-img').attr('src', oImage.src);
+
+		var oPopup = oAttachment.find('.bx-popup-wrapper');
+		var sPopupId = oPopup.attr('id');
+		oPopup.attr('id', sPopupId.replace('{id}', oImage.id));
+		oPopup.find('.bx-spf-attachment-popup-img').attr('src', oImage.src);
+
+		oContainer.prepend(oAttachment);
+	});
+	oSample.remove();
+
+	bx_center_content('.bx-base-text-attachments', '.bx-base-text-attachment', true);
+
+	//--- Fetch price.
+	var oBuy = $('#' + this._aHtmlIds['entry_buy']);
+	var sBuyContent = oBuy.html();
+	oBuy.html(sBuyContent.replace('{price}', oProduct.selectedVariant.formattedPrice));
+	oBuy.attr('href', oProduct.selectedVariant.checkoutUrl(1));
+	oBuy.show();
+
+	bx_loading($('.' + this._sClassCover), false);
+};
+
+BxShopifyShop.prototype.fetchProduct = function(iProduct, onComplete) {
+	var $this = this;
+
+	this._oShopClient.fetchProduct(iProduct).then(function(oProduct) {
+		if(typeof(onComplete) == 'function')
+			onComplete(oProduct);
+        else 
+        	$this.onFetchProduct(oProduct);
+	});
+};
+
+BxShopifyShop.prototype.fetchCollection = function(iCollection, onComplete) {
+	var $this = this;
+
+	this._oShopClient.fetchQueryProducts({collection_id: iCollection}).then(function(oProducts) {
+		if(typeof(onComplete) == 'function')
+			onComplete(oProduct);
+        else 
+        	$this.onFetchCollection(oProducts);
+	});
+};
+
+BxShopifyShop.prototype.onFetchProduct = function(oProduct) {
+	//--- Some default action can be put here.
+};
+
+BxShopifyShop.prototype.onFetchCollection = function(oProducts) {
+	//--- Some default action can be put here.
+};
+
+/** @} */

+ 18 - 0
modules/boonex/shopify/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Shopify Shopify
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 8 - 0
modules/boonex/shopify/template/attachments.html

@@ -0,0 +1,8 @@
+<div id="__html_id__" class="bx-base-text-attachments bx-clearfix">
+    <div id="__html_id_sample__" class="bx-base-text-attachment bx-spf-attachment-sample bx-def-box bx-def-color-bg-box bx-def-gal-img-size" style="float:left;">
+		<a class="bx-spf-attachment-link" href="javascript:void(0);" onclick="$('#__popup_id__').dolPopupImage('{url}', $(this).parent())">
+		    <img class="bx-spf-attachment-img bx-def-gal-img-size" src="" />
+		</a>
+		__popup__
+    </div>
+</div>

+ 3 - 0
modules/boonex/shopify/template/author.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/author.html />
+

+ 1 - 0
modules/boonex/shopify/template/author_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/author_link.html />

+ 3 - 0
modules/boonex/shopify/template/css/forms.css

@@ -0,0 +1,3 @@
+
+@import url(../../../../base/text/template/css/forms.css);
+

+ 14 - 0
modules/boonex/shopify/template/css/main.css

@@ -0,0 +1,14 @@
+@import url(../../../../base/text/template/css/main.css);
+
+/*--- Cover ---*/
+.bx_shopify_cover .bx-cover-actions .bx-menu-btns-hor,
+.bx_shopify_cover .bx-cover-actions .bx-btn.bx-shopify-buy {
+	display: inline-block;
+	float: none;
+	vertical-align: top;
+}
+
+/*--- Attachment ---*/
+.bx-spf-attachment-sample {
+	display: none;
+}

+ 1 - 0
modules/boonex/shopify/template/css/manage_tools.css

@@ -0,0 +1 @@
+@import url(../../../../base/general/template/css/manage_tools.css);

+ 5 - 0
modules/boonex/shopify/template/css/unit.css

@@ -0,0 +1,5 @@
+.bx-spf-unit-actions .bx-btn {
+	display: inline-block;
+    float: none;
+    vertical-align: top;
+}

+ 3 - 0
modules/boonex/shopify/template/entry-all-actions.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/entry-all-actions.html />
+

+ 3 - 0
modules/boonex/shopify/template/entry-buy.html

@@ -0,0 +1,3 @@
+<a id="__html_id__" class="bx-btn bx-shopify-buy bx-def-margin-thd-topbottom bx-def-margin-right" href="" style="display:none">
+    <bx_text:_bx_shopify_menu_item_title_buy_for />
+</a>

+ 3 - 0
modules/boonex/shopify/template/entry-location.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/general/template/entry-location.html />
+

+ 1 - 0
modules/boonex/shopify/template/entry-share.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/entry-share.html />

+ 10 - 0
modules/boonex/shopify/template/entry-text.html

@@ -0,0 +1,10 @@
+<div id="__html_id__" class="bx-base-text-entity-content bx-def-constraint-list bx-def-constraint-pre bx-def-constraint-object bx-def-constraint-iframe bx-def-constraint-img">
+    <h1>__entry_title__</h1>
+    <div class="bx-spf-text"></div>
+    <div class="bx-spf-images"></div>
+    <script type="text/javascript">
+    $(document).ready(function() {
+        __js_object__.getEntry(__entry_code__);
+    });
+    </script>
+</div>

+ 3 - 0
modules/boonex/shopify/template/form_ghost_template.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/form_ghost_template.html />
+

+ 31 - 0
modules/boonex/shopify/template/images/icons/std-icon.svg

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="606px" height="606px" viewBox="0 0 606 606" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 43.1 (39012) - http://www.bohemiancoding.com/sketch -->
+    <title>shopify</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
+            <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="0%"></stop>
+            <stop stop-color="#000000" stop-opacity="0.2" offset="100%"></stop>
+        </linearGradient>
+    </defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="shopify" transform="translate(3.000000, 3.000000)">
+            <g id="Squircle2-Copy-6" fill-rule="nonzero">
+                <g id="Shape">
+                    <g id="path-2-link" fill="#FFFFFF">
+                        <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 Z" id="path-2"></path>
+                    </g>
+                    <g id="path-2-link" stroke="#000000" stroke-width="4.04" fill="url(#linearGradient-1)">
+                        <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 Z" id="path-2"></path>
+                    </g>
+                </g>
+            </g>
+            <g id="shopify-logo-default-cmyk" opacity="0.9" transform="translate(122.000000, 100.000000)">
+                <path d="M164.0704,14.592 C166.288,14.592 168.5216,15.344 170.6592,16.816 C154.1952,24.5632 136.5472,44.0768 129.0944,83.0432 C118.2016,86.416 107.5552,89.712 97.712,92.7616 C106.4416,63.04 127.1712,14.592 164.0704,14.592 Z M179.3344,29.04 C182.4928,36.9568 184.5472,48.3168 184.5472,63.648 C184.5472,64.432 184.5408,65.1488 184.5344,65.8752 C172.0288,69.7472 158.448,73.952 144.832,78.1696 C152.4768,48.6656 166.8064,34.416 179.3344,29.04 Z M217.232,55.7568 C211.5264,57.5232 205.04,59.5296 198.0096,61.7056 C198.016,60.352 198.0192,59.0176 198.0192,57.5616 C198.0192,44.8576 196.2592,34.6304 193.4272,26.5216 C204.7936,27.9488 212.3616,40.8768 217.232,55.7568 Z M309.4944,78.3712 C309.2192,76.368 307.4656,75.2608 306.016,75.1392 C304.5696,75.0176 273.952,72.7488 273.952,72.7488 C273.952,72.7488 252.688,51.6384 250.3552,49.3024 C248.0192,46.9696 243.4592,47.6768 241.6896,48.1984 C241.4272,48.2752 237.0432,49.6288 229.7888,51.872 C222.6848,31.4336 210.1504,12.6496 188.096,12.6496 C187.488,12.6496 186.8608,12.6752 186.2304,12.7104 C179.9616,4.416 172.192,0.8128 165.4816,0.8128 C114.1088,0.8128 89.5648,65.0336 81.8688,97.6704 C61.9072,103.856 47.7248,108.2528 45.9136,108.8224 C34.768,112.3168 34.4192,112.6688 32.9568,123.168 C31.8528,131.1168 2.6976,356.5888 2.6976,356.5888 L229.8816,399.1552 L352.9792,372.5248 C352.9792,372.5248 309.7664,80.3744 309.4944,78.3712 L309.4944,78.3712 Z" id="Fill-3" fill="#8DB849"></path>
+                <path d="M306.016,75.1392 C304.5696,75.0176 273.952,72.7488 273.952,72.7488 C273.952,72.7488 252.688,51.6384 250.3552,49.3056 C249.4816,48.432 248.304,47.9872 247.072,47.7952 L229.8944,399.152 L352.9792,372.5248 C352.9792,372.5248 309.7664,80.3776 309.4944,78.3712 C309.2192,76.368 307.4656,75.2608 306.016,75.1392" id="Fill-4" fill="#5A863D"></path>
+                <path d="M188.096,143.1552 L172.9184,188.304 C172.9184,188.304 159.6192,181.2064 143.3184,181.2064 C119.4208,181.2064 118.2176,196.2048 118.2176,199.984 C118.2176,220.6048 171.968,228.5056 171.968,276.8064 C171.968,314.8064 147.8688,339.2768 115.3696,339.2768 C76.368,339.2768 56.4288,315.0048 56.4288,315.0048 L66.8704,280.5056 C66.8704,280.5056 87.3696,298.1056 104.6688,298.1056 C115.968,298.1056 120.5696,289.2064 120.5696,282.704 C120.5696,255.8048 76.4704,254.6048 76.4704,210.4064 C76.4704,173.2064 103.168,137.2064 157.0688,137.2064 C177.8368,137.2064 188.096,143.1552 188.096,143.1552" id="Fill-5" fill="#FFFFFF"></path>
+            </g>
+        </g>
+    </g>
+</svg>

+ 1 - 0
modules/boonex/shopify/template/title_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/title_link.html />

+ 25 - 0
modules/boonex/shopify/template/unit.html

@@ -0,0 +1,25 @@
+<div class="bx-base-text-unit bx-base-text-unit-ext __class__ bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-margin-bottom">
+	<div class="bx-base-text-unit-cover bx-spf-unit-cover" style="display:none">
+	    <img class="bx-base-text-unit-cover bx-def-round-corners" src="" />
+	</div>
+    <div class="bx-base-text-unit-text bx-spf-unit-text bx-def-padding bx-def-box-sizing">
+        <h2><a href="__content_url__">__title__</a></h2>
+        <div class="bx-base-text-unit-info bx-def-margin-sec-top bx-def-font-small">
+            <span class="bx-def-font-grayed">__entry_posting_date__</span>
+            <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
+            <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
+        </div>
+        <div class="bx-base-text-unit-summary bx-spf-unit-summary bx-def-margin-sec-top bx-clearfix"></div>
+        <div class="bx-base-text-unit-actions bx-spf-unit-actions">
+            <a class="bx-btn bx-shopify-buy bx-def-margin-sec-top" href="" style="display:none">
+			    <bx_text:_bx_shopify_menu_item_title_buy_for />
+			</a>
+        </div>
+    </div>
+    <script type="text/javascript">
+    $(document).ready(function() {
+        __js_object__.getUnit(__entry_code__);
+    });
+    </script>
+</div>
+__js_content__

+ 20 - 0
modules/boonex/shopify/template/unit_full.html

@@ -0,0 +1,20 @@
+<div class="bx-base-text-unit bx-base-text-unit-ext __class__ bx-def-margin-bottom">
+    <h1 class="bx-def-padding-sec-top"><a href="__content_url__">__title__</a></h1>
+    <div class="bx-base-text-unit-info bx-def-margin-sec-top">
+        <span class="bx-def-font-grayed">__entry_posting_date__</span>
+        <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
+        <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
+    </div>
+    <div class="bx-base-text-unit-summary bx-spf-unit-summary bx-def-margin-sec-top bx-def-margin-sec-bottom bx-clearfix"></div> 
+    <div class="bx-base-text-unit-actions bx-spf-unit-actions">
+        <a class="bx-btn bx-shopify-buy" href="" style="display:none">
+            <bx_text:_bx_shopify_menu_item_title_buy_for />
+        </a>
+    </div>
+    <script type="text/javascript">
+    $(document).ready(function() {
+        __js_object__.getUnit(__entry_code__);
+    });
+    </script>
+</div>
+__js_content__

+ 3 - 0
modules/boonex/shopify/template/unit_full_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_full_private.html />
+

+ 28 - 0
modules/boonex/shopify/template/unit_gallery.html

@@ -0,0 +1,28 @@
+<div class="bx-base-text-unit bx-base-text-unit-gallery __class__ bx-def-gal-unit-size bx-def-padding-sec bx-def-margin-sec-bottom">
+    <div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-box-sizing">
+        <div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-font-align-center bx-def-box-sizing">
+            <h2><a href="__content_url__">__title__</a></h2>
+            <div class="bx-base-text-unit-info">
+                <span class="bx-def-font-grayed">__entry_posting_date__</span>
+                <span class="bx-base-text-unit-info-div bx-def-font-grayed">&#183;</span>
+                <a class="bx-base-text-unit-author" href="__author_url__">__author__</a>
+            </div>
+        </div>
+        <a href="__content_url__" title="__summary_attr__">
+            <div class="bx-base-text-unit-thumb bx-spf-unit-thumb bx-def-gal-div-size bx-def-round-corners bx-def-font-middle" style="background-image:url(__gallery_url__)">
+                <div class="bx-base-text-unit-strecher">__strecher__</div>
+            </div>
+        </a>
+        <div class="bx-base-text-unit-actions bx-spf-unit-actions">
+            <a class="bx-btn bx-shopify-buy bx-def-margin-sec-topbottom" href="" style="display:none">
+                <bx_text:_bx_shopify_menu_item_title_buy_for />
+            </a>
+        </div> 
+    </div>
+    <script type="text/javascript">
+    $(document).ready(function() {
+        __js_object__.getUnit(__entry_code__);
+    });
+    </script>
+</div>
+__js_content__

+ 3 - 0
modules/boonex/shopify/template/unit_gallery_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_gallery_private.html />
+

+ 3 - 0
modules/boonex/shopify/template/unit_live_search.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_live_search.html />
+

+ 3 - 0
modules/boonex/shopify/template/unit_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_private.html />
+