BxBaseStudioStore.php 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaView UNA Studio Representation classes
  7. * @ingroup UnaStudio
  8. * @{
  9. */
  10. class BxBaseStudioStore extends BxDolStudioStore
  11. {
  12. protected $iPerPageDefault = 24;
  13. function __construct($sPage = "")
  14. {
  15. parent::__construct($sPage);
  16. }
  17. function getPageCss()
  18. {
  19. return array_merge(parent::getPageCss(), array(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'fancybox/|jquery.fancybox.css', 'module.css', 'store.css', 'store-media-tablet.css', 'store-media-desktop.css'));
  20. }
  21. function getPageJs()
  22. {
  23. BxDolStudioTemplate::getInstance()->addJsTranslation(array('_adm_btn_queued_submit'));
  24. return array_merge(parent::getPageJs(), array('fancybox/jquery.fancybox.pack.js', 'store.js'));
  25. }
  26. function getPageJsObject()
  27. {
  28. return 'oBxDolStudioStore';
  29. }
  30. function getPageMenu($aMenu = array(), $aMarkers = array())
  31. {
  32. $sJsObject = $this->getPageJsObject();
  33. $oTemplate = BxDolStudioTemplate::getInstance();
  34. $aMenu = [];
  35. $aMenuItems = [
  36. 'goodies' => ['icon' => 'mi-str-home.svg'],
  37. 'latest' => ['icon' => 'mi-str-latest.svg'],
  38. 'featured' => ['icon' => 'mi-str-featured.svg'],
  39. 'popular' => ['icon' => 'mi-str-popular.svg'],
  40. 'categories' => ['icon' => 'mi-str-categories.svg'],
  41. 'search' => ['icon' => 'mi-str-search.svg'],
  42. 'purchases' => ['icon' => 'mi-str-purchases.svg'],
  43. 'updates' => ['icon' => 'mi-str-updates.svg'],
  44. 'checkout' => ['icon' => 'mi-str-checkout.svg'],
  45. 'downloaded' => ['icon' => 'mi-str-downloaded.svg']
  46. ];
  47. foreach($aMenuItems as $sMenuItem => $aItem)
  48. $aMenu[] = [
  49. 'name' => $sMenuItem,
  50. 'icon' => $aItem['icon'],
  51. 'icon_bg' => true,
  52. 'link' => $this->getBaseUrl($sMenuItem),
  53. 'title' => _t('_adm_lmi_cpt_' . $sMenuItem),
  54. 'selected' => $sMenuItem == $this->sPage
  55. ];
  56. $iCounter = BxDolStudioCart::getInstance()->getCount();
  57. $aMarkers = array(
  58. 'checkout_counter' => $oTemplate->parseHtmlByName('menu_side_counter.html', array(
  59. 'bx_if:hide_counter' => array(
  60. 'condition' => $iCounter <= 0,
  61. 'content' => array()
  62. ),
  63. 'counter' => $iCounter
  64. ))
  65. );
  66. return parent::getPageMenu($aMenu, $aMarkers);
  67. }
  68. function getPageCode($sPage = '', $bWrap = true)
  69. {
  70. $sResult = parent::getPageCode($sPage, $bWrap);
  71. if($sResult === false)
  72. return false;
  73. $sMethod = 'get' . ucfirst($this->sPage) . 'List';
  74. if(!method_exists($this, $sMethod))
  75. return '';
  76. return $this->$sMethod() . $sResult;
  77. }
  78. function getPageContent()
  79. {
  80. $sMethod = 'get' . ucfirst($this->sPage) . 'List';
  81. if(!method_exists($this, $sMethod))
  82. return '';
  83. return $this->$sMethod(false);
  84. }
  85. protected function getGoodiesList()
  86. {
  87. $sJsObject = $this->getPageJsObject();
  88. $oTemplate = BxDolStudioTemplate::getInstance();
  89. $mixedResult = $this->authorizeClient();
  90. if($mixedResult === true) {
  91. $aProducts = $this->loadGoodies();
  92. $sContent = "";
  93. $sContent .= $this->displayNonOwnerNotification();
  94. $sContent .= $this->getBlocksLine(array(
  95. array(
  96. 'caption' => '_adm_block_cpt_categories',
  97. 'actions' => array(),
  98. 'items' => $this->getCategoriesList(false)
  99. ),
  100. array(
  101. 'caption' => '_adm_block_cpt_tags',
  102. 'actions' => array(),
  103. 'items' => $this->getTagsList(false)
  104. )
  105. ));
  106. foreach($aProducts as $aBlock) {
  107. $aBlock['items'] = $oTemplate->parseHtmlByName('str_products.html', array(
  108. 'list' => $this->displayProducts($aBlock['items']),
  109. 'paginate' => ''
  110. ));
  111. $sContent .= $this->getBlockCode($aBlock);
  112. }
  113. }
  114. else
  115. $sContent = $this->getBlockCode(array(
  116. 'caption' => '_adm_block_cpt_goodies',
  117. 'items' => $mixedResult,
  118. ));
  119. return $oTemplate->parseHtmlByName('store.html', array(
  120. 'js_object' => $sJsObject,
  121. 'content' => $sContent
  122. ));
  123. }
  124. protected function getLatestList($bWrapInBlock = true)
  125. {
  126. return $this->getBrowsingList('latest', $bWrapInBlock);
  127. }
  128. protected function getFeaturedList($bWrapInBlock = true)
  129. {
  130. return $this->getBrowsingList('featured', $bWrapInBlock);
  131. }
  132. protected function getPopularList($bWrapInBlock = true)
  133. {
  134. return $this->getBrowsingList('popular', $bWrapInBlock);
  135. }
  136. protected function getBrowsingList($sType, $bWrapInBlock = true)
  137. {
  138. $sJsObject = $this->getPageJsObject();
  139. $oTemplate = BxDolStudioTemplate::getInstance();
  140. $mixedResult = $this->authorizeClient();
  141. if($mixedResult === true) {
  142. $iStart = (int)bx_get('str_start');
  143. $iPerPage = (int)bx_get('str_per_page');
  144. if(empty($iPerPage))
  145. $iPerPage = $this->iPerPageDefault;
  146. $aProducts = $this->{'load' . bx_gen_method_name($sType)}($iStart, $iPerPage + 1);
  147. $oPaginate = new BxTemplPaginate(array(
  148. 'start' => $iStart,
  149. 'per_page' => $iPerPage,
  150. 'on_change_page' => $sJsObject . ".changePagePaginate(this, '" . $sType . "', null, {start}, {per_page})"
  151. ));
  152. $oPaginate->setNumFromDataArray($aProducts);
  153. $sContent = $oTemplate->parseHtmlByName('str_products.html', array(
  154. 'list' => $this->displayProducts($aProducts),
  155. 'paginate' => $oPaginate->getSimplePaginate()
  156. ));
  157. }
  158. else
  159. $sContent = $mixedResult;
  160. if(!$bWrapInBlock)
  161. return $sContent;
  162. return $oTemplate->parseHtmlByName('store.html', array(
  163. 'js_object' => $sJsObject,
  164. 'content' => $this->getBlockCode(array(
  165. 'caption' => '_adm_block_cpt_' . $sType,
  166. 'items' => $sContent
  167. ))
  168. ));
  169. }
  170. protected function getCategoriesList($bWrapInBlock = true)
  171. {
  172. return $this->getLabelsList('categories', $bWrapInBlock);
  173. }
  174. protected function getCategoryList($bWrapInBlock = true)
  175. {
  176. $sKey = 'value';
  177. if(bx_get($sKey) === false)
  178. $sKey = 'str_value';
  179. $aValue = array();
  180. $aValue['value'] = (int)bx_get($sKey);
  181. if(bx_get('title') !== false)
  182. $aValue['title'] = bx_process_input(urldecode(bx_get('title')));
  183. return $this->getLabelList('category', $aValue, $bWrapInBlock);
  184. }
  185. protected function getTagsList($bWrapInBlock = true)
  186. {
  187. return $this->getLabelsList('tags', $bWrapInBlock);
  188. }
  189. protected function getTagList($bWrapInBlock = true)
  190. {
  191. $sKey = 'value';
  192. if(bx_get($sKey) === false)
  193. $sKey = 'str_value';
  194. return $this->getLabelList('tag', bx_process_input(bx_get($sKey)), $bWrapInBlock);
  195. }
  196. protected function getLabelsList($sType, $bWrapInBlock = true)
  197. {
  198. $mixedResult = $this->authorizeClient();
  199. if($mixedResult === true) {
  200. $aLabels = $this->{'load' . bx_gen_method_name($sType)}();
  201. $sContent = $this->{'display' . bx_gen_method_name($sType)}($aLabels);
  202. }
  203. else
  204. $sContent = $mixedResult;
  205. if(!$bWrapInBlock)
  206. return $sContent;
  207. return BxDolStudioTemplate::getInstance()->parseHtmlByName('store.html', array(
  208. 'js_object' => $this->getPageJsObject(),
  209. 'content' => $this->getBlockCode(array(
  210. 'caption' => '_adm_block_cpt_' . $sType,
  211. 'items' => $sContent
  212. ))
  213. ));
  214. }
  215. protected function getLabelList($sType, $mixedValue, $bWrapInBlock = true)
  216. {
  217. $sJsObject = $this->getPageJsObject();
  218. $oTemplate = BxDolStudioTemplate::getInstance();
  219. $iStart = (int)bx_get('str_start');
  220. $iPerPage = (int)bx_get('str_per_page');
  221. if(empty($iPerPage))
  222. $iPerPage = $this->iPerPageDefault;
  223. $bArray = is_array($mixedValue);
  224. $sValue = $bArray ? $mixedValue['value'] : $mixedValue;
  225. $sTitle = $bArray && !empty($mixedValue['title']) ? $mixedValue['title'] : $sValue;
  226. $sMethod = 'load' . bx_gen_method_name($sType);
  227. $aProducts = $this->$sMethod($sValue, $iStart, $iPerPage + 1);
  228. $oPaginate = new BxTemplPaginate(array(
  229. 'start' => $iStart,
  230. 'per_page' => $iPerPage,
  231. 'on_change_page' => $sJsObject . ".changePagePaginate(this, '" . $sType . "', '" . $sValue . "', {start}, {per_page})"
  232. ));
  233. $oPaginate->setNumFromDataArray($aProducts);
  234. $sContent = $oTemplate->parseHtmlByName('str_products.html', array(
  235. 'list' => $this->displayProducts($aProducts),
  236. 'paginate' => $oPaginate->getSimplePaginate()
  237. ));
  238. if(!$bWrapInBlock)
  239. return $sContent;
  240. return $oTemplate->parseHtmlByName('store.html', array(
  241. 'js_object' => $sJsObject,
  242. 'content' => $this->getBlockCode(array(
  243. 'caption' => array('_adm_block_cpt_' . $sType, $sTitle),
  244. 'items' => $sContent,
  245. ))
  246. ));
  247. }
  248. protected function getSearchList($bWrapInBlock = true)
  249. {
  250. $sJsObject = $this->getPageJsObject();
  251. $oTemplate = BxDolStudioTemplate::getInstance();
  252. $mixedResult = $this->authorizeClient();
  253. if($mixedResult === true) {
  254. //--- Search form
  255. $aForm = array(
  256. 'form_attrs' => array(
  257. 'id' => 'adm-str-search-form',
  258. 'name' => 'adm-str-search-form',
  259. 'action' => '',
  260. 'method' => 'post'
  261. ),
  262. 'params' => array(
  263. 'db' => array(
  264. 'table' => '',
  265. 'key' => '',
  266. 'uri' => '',
  267. 'uri_title' => '',
  268. 'submit_name' => 'search'
  269. ),
  270. ),
  271. 'inputs' => array(
  272. 'page' => array(
  273. 'type' => 'hidden',
  274. 'name' => 'page',
  275. 'value' => $this->sPage
  276. ),
  277. 'keyword' => array(
  278. 'type' => 'text',
  279. 'name' => 'keyword',
  280. 'caption' => '',
  281. 'value' => '',
  282. 'attrs' => array(
  283. 'placeholder' => bx_html_attribute(_t('_sys_search_placeholder'))
  284. ),
  285. 'db' => array (
  286. 'pass' => 'Xss',
  287. )
  288. ),
  289. 'search' => array(
  290. 'type' => 'submit',
  291. 'name' => 'search',
  292. 'value' => _t('_adm_btn_store_search'),
  293. )
  294. )
  295. );
  296. $oForm = new BxTemplStudioFormView($aForm);
  297. $oForm->initChecker();
  298. $sResults = '';
  299. if($oForm->isSubmittedAndValid()) {
  300. $sKeyword = $oForm->getCleanValue('keyword');
  301. $iStart = (int)bx_get('str_start');
  302. $iPerPage = (int)bx_get('str_per_page');
  303. if(empty($iPerPage))
  304. $iPerPage = 999;
  305. $aProducts = $this->loadSearch($sKeyword, $iStart, $iPerPage + 1);
  306. $sResults = empty($aProducts) || !is_array($aProducts) ? MsgBox(_t('_Empty')) : $oTemplate->parseHtmlByName('str_products.html', array(
  307. 'list' => $this->displayProducts($aProducts),
  308. 'paginate' => ''
  309. ));
  310. }
  311. $sContent = $oTemplate->parseHtmlByName('str_search.html', array(
  312. 'form' => $oForm->getCode(),
  313. 'bx_if:show_results' => array(
  314. 'condition' => !empty($sResults),
  315. 'content' => array(
  316. 'results' => $sResults
  317. )
  318. )
  319. ));
  320. }
  321. else
  322. $sContent = $mixedResult;
  323. if(!$bWrapInBlock)
  324. return $sContent;
  325. return $oTemplate->parseHtmlByName('store.html', array(
  326. 'js_object' => $sJsObject,
  327. 'content' => $this->getBlockCode(array(
  328. 'caption' => '_adm_block_cpt_search',
  329. 'items' => $sContent
  330. ))
  331. ));
  332. }
  333. protected function getPurchasesList()
  334. {
  335. $oTemplate = BxDolStudioTemplate::getInstance();
  336. $aProducts = $this->loadPurchases();
  337. return $oTemplate->parseHtmlByName('store.html', array(
  338. 'js_object' => $this->getPageJsObject(),
  339. 'content' => $this->getBlockCode(array(
  340. 'caption' => '_adm_block_cpt_purchases',
  341. 'items' => $oTemplate->parseHtmlByName('str_products.html', array(
  342. 'list' => $this->displayProducts($aProducts),
  343. 'paginate' => ''
  344. ))
  345. ))
  346. ));
  347. }
  348. protected function getUpdatesList()
  349. {
  350. $oTemplate = BxDolStudioTemplate::getInstance();
  351. $aUpdates = $this->loadUpdates();
  352. return $oTemplate->parseHtmlByName('store.html', array(
  353. 'js_object' => $this->getPageJsObject(),
  354. 'content' => $this->getBlockCode(array(
  355. 'caption' => '_adm_block_cpt_updates',
  356. 'items' => $oTemplate->parseHtmlByName('str_products.html', array(
  357. 'list' => $this->displayUpdates($aUpdates),
  358. 'paginate' => ''
  359. ))
  360. ))
  361. ));
  362. }
  363. protected function getCheckoutList()
  364. {
  365. $sJsObject = $this->getPageJsObject();
  366. $oTemplate = BxDolStudioTemplate::getInstance();
  367. //--- Empty cart by vendor if the payment was accepted.
  368. $mixedVendor = bx_get('vendor');
  369. $mixedProducts = bx_get('products');
  370. if($mixedVendor !== false && $mixedProducts !== false) {
  371. $oCart = BxDolStudioCart::getInstance();
  372. $aProducts = explode(',', base64_decode($mixedProducts));
  373. foreach($aProducts as $iId)
  374. $oCart->delete($mixedVendor, $iId);
  375. return $this->getMessage('_adm_block_cpt_checkout', '_adm_msg_modules_success_checkouted');
  376. }
  377. $aVendors = $this->loadCheckout();
  378. if(empty($aVendors))
  379. return $this->getMessage('_adm_block_cpt_checkout', '_Empty');
  380. $sContent = '';
  381. foreach($aVendors as $iVendor => $aInfo) {
  382. $fTotal = 0;
  383. $sVendor = $sCurrency = '';
  384. if(!empty($aInfo['products']) && is_array($aInfo['products']))
  385. foreach($aInfo['products'] as $aProduct) {
  386. $iCount = isset($aInfo['counts'][$aProduct['id']]) ? (int)$aInfo['counts'][$aProduct['id']] : 1;
  387. $fTotal += $iCount * $aProduct['price_single'];
  388. if($sVendor == '' && isset($aProduct['author_name']))
  389. $sVendor = $aProduct['author_name'];
  390. if($sCurrency == '' && isset($aProduct['author_currency_sign']))
  391. $sCurrency = $aProduct['author_currency_sign'];
  392. }
  393. $aMenu = array(
  394. array('id' => 'checkout-' . $iVendor, 'name' => 'checkout-' . $iVendor, 'link' => 'javascript:void(0)', 'onclick' => $sJsObject . ".checkoutCart(" . $iVendor . ", this);", 'target' => '_self', 'title' => '_adm_action_cpt_checkout', 'active' => 1),
  395. array('id' => 'delete-all-' . $iVendor, 'name' => 'delete-all-' . $iVendor, 'link' => 'javascript:void(0)', 'onclick' => $sJsObject . ".deleteAllFromCart(" . $iVendor . ", this)", 'target' => '_self', 'title' => '_adm_action_cpt_delete_all', 'active' => 1)
  396. );
  397. $oMenu = new BxTemplMenu(array('object'=> 'adm-std-checkout', 'template' => 'menu_buttons_hor.html', 'menu_items' => $aMenu));
  398. $sContent .= $this->getBlockCode(array(
  399. 'caption' => _t('_adm_block_cpt_checkout_by_vendor_csign', $sVendor, $sCurrency, $fTotal),
  400. 'items' => $oTemplate->parseHtmlByName('str_products.html', array(
  401. 'list' => $this->displayProducts($aInfo['products'], array('is_shopping_cart' => true, 'counts' => $aInfo['counts'])),
  402. 'paginate' => ''
  403. )),
  404. 'panel_bottom' => $oMenu->getCode()
  405. ));
  406. }
  407. return $oTemplate->parseHtmlByName('store.html', array(
  408. 'js_object' => $sJsObject,
  409. 'content' => $sContent
  410. ));
  411. }
  412. protected function getDownloadedList()
  413. {
  414. $sJsObject = $this->getPageJsObject();
  415. $oTemplate = BxDolStudioTemplate::getInstance();
  416. $sContent = $sModules = $sUpdates = "";
  417. $aProducts = $this->loadDownloaded();
  418. //--- Prepare modules.
  419. $bCacheImage = getParam('sys_template_cache_image_enable') == 'on';
  420. foreach($aProducts['modules'] as $aModule) {
  421. $sIcon = BxDolStudioUtils::getModuleIcon($aModule, 'store');
  422. $bIcon = ($bCacheImage && substr($sIcon, 0, 10) == 'data:image') || strpos($sIcon, '.') !== false;
  423. $bInstalled = $aModule['installed'];
  424. $bQueued = !$bInstalled && $this->oDb->isQueued('action', $aModule['dir']);
  425. $sModules .= $oTemplate->parseHtmlByName('str_product_v1.html', array(
  426. 'js_object' => $sJsObject,
  427. 'name' => $aModule['name'],
  428. 'bx_if:no_icon' => array (
  429. 'condition' => !$bIcon,
  430. 'content' => array(
  431. 'icon' => $sIcon
  432. ),
  433. ),
  434. 'bx_if:icon' => array (
  435. 'condition' => $bIcon,
  436. 'content' => array(
  437. 'icon_url' => $sIcon,
  438. ),
  439. ),
  440. 'title' => $aModule['title'],
  441. 'vendor' => strtolower($aModule['vendor']) == 'boonex' ? 'UNA INC' : $aModule['vendor'],
  442. 'version' => $aModule['version'],
  443. 'dir' => $aModule['dir'],
  444. 'bx_if:hide_install' => array(
  445. 'condition' => $bInstalled || $bQueued,
  446. 'content' => array()
  447. ),
  448. 'bx_if:hide_queued' => array(
  449. 'condition' => !$bQueued,
  450. 'content' => array()
  451. ),
  452. 'bx_if:hide_installed' => array(
  453. 'condition' => !$bInstalled || $bQueued,
  454. 'content' => array()
  455. )
  456. ));
  457. }
  458. //--- Prepare updates.
  459. foreach($aProducts['updates'] as $aUpdate) {
  460. $sIcon = BxDolStudioUtils::getModuleIcon(array('type' => $aUpdate['module_type'], 'name' => $aUpdate['module_name'], 'dir' => $aUpdate['module_dir']), 'store');
  461. $bIcon = ($bCacheImage && substr($sIcon, 0, 10) == 'data:image') || strpos($sIcon, '.') !== false;
  462. $sUpdates .= $oTemplate->parseHtmlByName('str_update_v1.html', array(
  463. 'js_object' => $sJsObject,
  464. 'name' => $aUpdate['module_name'],
  465. 'bx_if:no_icon' => array (
  466. 'condition' => !$bIcon,
  467. 'content' => array(
  468. 'icon' => $sIcon
  469. ),
  470. ),
  471. 'bx_if:icon' => array (
  472. 'condition' => $bIcon,
  473. 'content' => array(
  474. 'icon_url' => $sIcon,
  475. ),
  476. ),
  477. 'title' => $aUpdate['title'],
  478. 'vendor' => strtolower($aUpdate['vendor']) == 'boonex' ? 'UNA INC' : $aUpdate['vendor'],
  479. 'versions' => _t('_adm_str_txt_update_from_to', $aUpdate['version_from'], $aUpdate['version_to']),
  480. 'dir' => $aUpdate['dir']
  481. ));
  482. }
  483. if(!empty($sModules))
  484. $sContent .= $this->getBlockCode(array(
  485. 'type' => BX_DB_DEF,
  486. 'caption' => '_adm_block_cpt_downloaded_modules',
  487. 'items' => $oTemplate->parseHtmlByName('str_products.html', array(
  488. 'list' => $sModules,
  489. 'paginate' => ''
  490. )),
  491. ));
  492. if(!empty($sUpdates))
  493. $sContent .= $this->getBlockCode(array(
  494. 'type' => BX_DB_DEF,
  495. 'caption' => '_adm_block_cpt_downloaded_updates',
  496. 'items' => $oTemplate->parseHtmlByName('str_products.html', array(
  497. 'list' => $sUpdates,
  498. 'paginate' => ''
  499. )),
  500. ));
  501. return $oTemplate->parseHtmlByName('store.html', array(
  502. 'js_object' => $sJsObject,
  503. 'content' => $sContent
  504. ));
  505. }
  506. protected function getMessage($sCaption, $sContent, $aActions = array())
  507. {
  508. return BxDolStudioTemplate::getInstance()->parseHtmlByName('store.html', array(
  509. 'js_object' => $this->getPageJsObject(),
  510. 'content' => $this->getBlockCode(array(
  511. 'caption' => $sCaption,
  512. 'actions' => $aActions,
  513. 'items' => MsgBox(_t($sContent))
  514. ))
  515. ));
  516. }
  517. protected function getProduct($sModuleName)
  518. {
  519. $bShowRating = true;
  520. $sJsObject = $this->getPageJsObject();
  521. $oTemplate = BxDolStudioTemplate::getInstance();
  522. $aProduct = $this->loadProduct($sModuleName);
  523. if(empty($aProduct) || !is_array($aProduct))
  524. return array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => (!empty($aProduct) ? $aProduct : _t('_adm_str_err_no_product_info')));
  525. $aDownloaded = $this->getDownloadedModules(false);
  526. $bFree = (int)$aProduct['is_free'] == 1;
  527. $bPurchased = (int)$aProduct['is_purchased'] == 1;
  528. $bPurchaseSingle = !$bFree && !$bPurchased && (float)$aProduct['price_single'] != 0;
  529. $bInCart = $bPurchaseSingle && BxDolStudioCart::getInstance()->exists($aProduct['author_id'], $aProduct['id']);
  530. $bPurchaseRecurring = !$bFree && !$bPurchased && (float)$aProduct['price_recurring'] != 0;
  531. $bDownloadable = (int)$aProduct['is_file'] == 1;
  532. $bDownloaded = array_key_exists($sModuleName, $aDownloaded);
  533. $bDownload = ($bFree || $bPurchased) && $bDownloadable;
  534. $bDiscount = !empty($aProduct['discount_single']);
  535. $sVersion = $bDownloaded && version_compare(strtolower($aDownloaded[$sModuleName]['version']), strtolower($aProduct['version'])) != 0 ? _t('_adm_str_txt_pv_version_mask', $aDownloaded[$sModuleName]['version'], $aProduct['version']) : $aProduct['version'];
  536. $iScreenshots = 0;
  537. $aScreenshots = array();
  538. $bScreenshots = is_array($aProduct['screenshots']) && !empty($aProduct['screenshots']);
  539. if($bScreenshots) {
  540. $iScreenshots = count($aProduct['screenshots']);
  541. foreach($aProduct['screenshots'] as $aScreenshot)
  542. $aScreenshots[] = array(
  543. 'view_url' => $aProduct['url'],
  544. 'image_url' => $aScreenshot['big']
  545. );
  546. }
  547. $bTmplVarsRate = $bShowRating;
  548. if($bTmplVarsRate)
  549. $aTmplVarsRate = array(
  550. 'rate' => $this->getVoteStars($aProduct)
  551. );
  552. $aTmplVarsVotes = array();
  553. $bTmplVarsVotes = $bShowRating && (int)$aProduct['votes_cnt'] > 0;
  554. if($bTmplVarsVotes)
  555. $aTmplVarsVotes = array(
  556. 'count' => (int)$aProduct['votes_cnt']
  557. );
  558. $sContent = $oTemplate->parseHtmlByname('str_product_view.html', array(
  559. 'id' => $aProduct['id'],
  560. 'title' => $aProduct['title'],
  561. 'url' => $aProduct['url'],
  562. 'author_name' => $aProduct['author_name'],
  563. 'author_url' => $aProduct['author_url'],
  564. 'version' => $sVersion,
  565. 'bx_if:show_price_single' => array(
  566. 'condition' => $bFree || (float)$aProduct['price_single'] != 0,
  567. 'content' => array(
  568. 'price_single' => !$bFree ? _t('_adm_str_txt_price_single', $aProduct['author_currency_sign'], $aProduct['price_single']) : _t('_adm_str_txt_price_free'),
  569. 'bx_if:show_discount' => array(
  570. 'condition' => !$bFree && $bDiscount,
  571. 'content' => array(
  572. 'discount_single' => $bDiscount ? _t('_adm_str_txt_pv_discount_off_csign', $aProduct['discount_single']['percent'], $aProduct['author_currency_sign'], $aProduct['discount_single']['save']) : ''
  573. )
  574. )
  575. )
  576. ),
  577. 'bx_if:show_price_recurring' => array(
  578. 'condition' => (float)$aProduct['price_recurring'] != 0,
  579. 'content' => array(
  580. 'price_recurring' => _t('_adm_str_txt_price_recurring', $aProduct['author_currency_sign'], $aProduct['price_recurring'], _t('_adm_str_txt_per_' . $aProduct['duration_recurring']))
  581. )
  582. ),
  583. 'bx_if:show_rate' => array(
  584. 'condition' => $bTmplVarsRate,
  585. 'content' => $aTmplVarsRate
  586. ),
  587. 'bx_if:show_votes' => array(
  588. 'condition' => $bTmplVarsVotes,
  589. 'content' => $aTmplVarsVotes
  590. ),
  591. 'category' => $aProduct['category'],
  592. 'category_url' => $aProduct['category_url'],
  593. 'tags' => implode(', ', explode(',', $aProduct['tags'])),
  594. 'reviews' => _t('_adm_str_txt_pv_stats_reviews', $aProduct['reviews_cnt']),
  595. 'reviews_url' => $aProduct['reviews_url'],
  596. 'votes' => _t('_adm_str_txt_pv_stats_votes', $aProduct['votes_cnt']),
  597. 'views' => _t('_adm_str_txt_pv_stats_views', $aProduct['views_cnt']),
  598. 'created' => bx_time_js($aProduct['created']),
  599. 'updated' => bx_time_js($aProduct['updated']),
  600. 'description' => $aProduct['description'],
  601. 'bx_if:show_screenshots' => array(
  602. 'condition' => $bScreenshots,
  603. 'content' => array(
  604. 'width' => 222 * $iScreenshots - 20,
  605. 'bx_repeat:screenshots' => $aScreenshots
  606. )
  607. ),
  608. 'bx_if:show_purchase' => array(
  609. 'condition' => $bPurchaseSingle || $bPurchaseRecurring,
  610. 'content' => array(
  611. 'bx_if:show_purchase_single' => array(
  612. 'condition' => $bPurchaseSingle && !$bInCart,
  613. 'content' => array(
  614. 'js_object' => $sJsObject,
  615. 'id' => $aProduct['id'],
  616. 'vendor_id' => $aProduct['author_id'],
  617. 'price_single' => _t('_adm_str_txt_price_single', $aProduct['author_currency_sign'], $aProduct['price_single'])
  618. )
  619. ),
  620. 'bx_if:show_checkout_single' => array(
  621. 'condition' => $bPurchaseSingle,
  622. 'content' => array(
  623. 'js_object' => $sJsObject,
  624. 'id' => $aProduct['id'],
  625. 'vendor_id' => $aProduct['author_id'],
  626. 'bx_if:show_as_hidden' => array(
  627. 'condition' => !$bInCart,
  628. 'content' => array()
  629. )
  630. )
  631. ),
  632. 'bx_if:show_purchase_recurring' => array(
  633. 'condition' => $bPurchaseRecurring,
  634. 'content' => array(
  635. 'js_object' => $sJsObject,
  636. 'id' => $aProduct['id'],
  637. 'vendor_id' => $aProduct['author_id'],
  638. 'price_recurring' => _t('_adm_str_txt_price_recurring', $aProduct['author_currency_sign'], $aProduct['price_recurring'], _t('_adm_str_txt_per_' . $aProduct['duration_recurring']))
  639. )
  640. )
  641. )
  642. ),
  643. 'bx_if:show_download' => array(
  644. 'condition' => $bDownload && !$bDownloaded,
  645. 'content' => array(
  646. 'js_object' => $sJsObject,
  647. 'file_id' => $aProduct['file_id'],
  648. )
  649. ),
  650. 'bx_if:show_download_disabled' => array(
  651. 'condition' => $bDownload && $bDownloaded,
  652. 'content' => array()
  653. ),
  654. ));
  655. return [
  656. 'code' => BX_DOL_STUDIO_IU_RC_SUCCESS,
  657. 'message' => '',
  658. 'popup' => BxTemplStudioFunctions::getInstance()->popupBox('bx-std-str-popup-product', $aProduct['title'], $sContent, true),
  659. 'screenshots' => $iScreenshots
  660. ];
  661. }
  662. protected function getFile($iFileId)
  663. {
  664. $mixedResult = $this->loadFile($iFileId);
  665. if($mixedResult === true)
  666. return array('code' => BX_DOL_STUDIO_IU_RC_SUCCESS, 'message' => _t('_adm_str_msg_download_successfully'));
  667. if(is_string($mixedResult))
  668. return array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => (!empty($mixedResult) ? $mixedResult : _t('_adm_str_err_download_failed')));
  669. if(is_array($mixedResult))
  670. return array_merge(array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => _t('_adm_str_err_download_failed')), $mixedResult);
  671. }
  672. protected function getUpdate($sModuleName, $bApplyUpdate = false)
  673. {
  674. $aResult = array();
  675. $mixedResult = $this->loadUpdate($sModuleName, $bApplyUpdate);
  676. if($mixedResult === true)
  677. $aResult = array('code' => BX_DOL_STUDIO_IU_RC_SUCCESS, 'message' => _t('_adm_str_msg_download' . ($bApplyUpdate ? '_and_install' : '') . '_successfully'));
  678. else if(is_string($mixedResult))
  679. $aResult = array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => (!empty($mixedResult) ? $mixedResult : _t('_adm_str_err_download_failed')));
  680. else if(is_array($mixedResult))
  681. $aResult = array_merge(array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => _t('_adm_str_err_download_failed')), $mixedResult);
  682. $aResult['reload'] = 3000;
  683. return $aResult;
  684. }
  685. protected function displayProducts($mixedItems, $aParams = array())
  686. {
  687. $bShowRating = false;
  688. if(!is_array($mixedItems))
  689. return MsgBox($mixedItems);
  690. $sJsObject = $this->getPageJsObject();
  691. $oTemplate = BxDolStudioTemplate::getInstance();
  692. $aDownloaded = $this->getDownloadedModules();
  693. $bShoppingCart = isset($aParams['is_shopping_cart']) && $aParams['is_shopping_cart'];
  694. $sResult = '';
  695. foreach($mixedItems as $aItem) {
  696. $bFree = (int)$aItem['is_free'] == 1;
  697. $bPurchased = (int)$aItem['is_purchased'] == 1;
  698. $bPurchaseSingle = !$bShoppingCart && !$bFree && !$bPurchased && (float)$aItem['price_single'] != 0;
  699. $bInCart = $bPurchaseSingle && BxDolStudioCart::getInstance()->exists($aItem['author_id'], $aItem['id']);
  700. $bPurchaseRecurring = !$bShoppingCart && !$bFree && !$bPurchased && (float)$aItem['price_recurring'] != 0;
  701. $bDownloadable = (int)$aItem['is_file'] == 1;
  702. $bDownloaded = in_array($aItem['name'], $aDownloaded);
  703. $bDownload = !$bShoppingCart && ($bFree || $bPurchased) && $bDownloadable;
  704. $bQueued = $this->oDb->isQueued('download', $aItem['name']);
  705. $sPrice = !$bFree ? _t('_adm_str_txt_price_single', $aItem['author_currency_sign'], $aItem['price_single']) : _t('_adm_str_txt_price_free');
  706. $sDiscount = !$bFree && !empty($aItem['discount_single']) ? _t('_adm_str_txt_discount_csign', $aItem['author_currency_sign'], $aItem['discount_single']['price']) : '';
  707. $sIcon = !empty($aItem['thumbnail']['small']) ? $aItem['thumbnail']['small'] : BxDolStudioUtils::getIconDefault(BX_DOL_MODULE_TYPE_MODULE);
  708. $bIcon = strpos($sIcon, '.') !== false;
  709. $sImage = '';
  710. $bImage = $bImageRaw = false;
  711. if(empty($aItem['cover_raw'])) {
  712. if(!empty($aItem['cover']['medium']))
  713. $sImage = $aItem['cover']['medium'];
  714. else if(!empty($aItem['cover']['large']))
  715. $sImage = $aItem['cover']['large'];
  716. else if(!empty($aItem['cover']['big']))
  717. $sImage = $aItem['cover']['big'];
  718. $bImage = !empty($sImage) && strpos($sImage, '.') !== false;
  719. }
  720. else {
  721. $sImage = $aItem['cover_raw'];
  722. $bImageRaw = true;
  723. }
  724. $aTmplVarsRate = array();
  725. $bTmplVarsRate = $bShowRating && !$bShoppingCart;
  726. if($bTmplVarsRate)
  727. $aTmplVarsRate = array(
  728. 'rate' => $this->getVoteStars($aItem)
  729. );
  730. $aTmplVarsVotes = array();
  731. $bTmplVarsVotes = $bShowRating && !$bShoppingCart && (int)$aItem['votes_cnt'] > 0;
  732. if($bTmplVarsVotes)
  733. $aTmplVarsVotes = array(
  734. 'count' => (int)$aItem['votes_cnt']
  735. );
  736. $sResult .= $oTemplate->parseHtmlByName('str_product_v2.html', array(
  737. 'js_object' => $sJsObject,
  738. 'id' => $aItem['id'],
  739. 'name' => $aItem['name'],
  740. 'url' => $aItem['url'],
  741. 'description_plain_attr' => bx_html_attribute($aItem['description_plain']),
  742. 'bx_if:no_icon' => array (
  743. 'condition' => !$bIcon,
  744. 'content' => array(
  745. 'icon' => $sIcon
  746. ),
  747. ),
  748. 'bx_if:icon' => array (
  749. 'condition' => $bIcon,
  750. 'content' => array(
  751. 'icon_url' => $sIcon,
  752. ),
  753. ),
  754. 'bx_if:no_image' => array (
  755. 'condition' => !$bImage && !$bImageRaw,
  756. 'content' => array(
  757. 'description_plain' => $aItem['description_plain'],
  758. 'strecher' => mb_strlen($aItem['description_plain']) > 240 ? '' : str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', round((240 - mb_strlen($aItem['description_plain'])) / 6))
  759. ),
  760. ),
  761. 'bx_if:image' => array (
  762. 'condition' => $bImage,
  763. 'content' => array(
  764. 'image_url' => $sImage,
  765. 'strecher' => str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', 40)
  766. ),
  767. ),
  768. 'bx_if:image_raw' => array (
  769. 'condition' => $bImageRaw,
  770. 'content' => array(
  771. 'image_raw' => $sImage,
  772. ),
  773. ),
  774. 'title' => $aItem['title'],
  775. 'bx_if:show_vendor' => array(
  776. 'condition' => !$bShoppingCart,
  777. 'content' => array(
  778. 'vendor_name' => $aItem['author_name'],
  779. 'vendor_url' => $aItem['author_url'],
  780. 'bx_if:show_version' => array(
  781. 'condition' => !empty($aItem['file_version']),
  782. 'content' => array(
  783. 'version' => $aItem['file_version'],
  784. )
  785. ),
  786. )
  787. ),
  788. 'bx_if:show_count_price' => array(
  789. 'condition' => $bShoppingCart,
  790. 'content' => array(
  791. 'count' => isset($aParams['counts'][$aItem['id']]) ? (int)$aParams['counts'][$aItem['id']] : 1,
  792. 'price_single' => $sPrice,
  793. 'discount_single' => $sDiscount,
  794. )
  795. ),
  796. 'bx_if:show_rate' => array(
  797. 'condition' => $bTmplVarsRate,
  798. 'content' => $aTmplVarsRate
  799. ),
  800. 'bx_if:show_votes' => array(
  801. 'condition' => $bTmplVarsVotes,
  802. 'content' => $aTmplVarsVotes
  803. ),
  804. 'bx_if:show_purchase_single' => array(
  805. 'condition' => $bPurchaseSingle && !$bInCart,
  806. 'content' => array(
  807. 'js_object' => $sJsObject,
  808. 'id' => $aItem['id'],
  809. 'vendor_id' => $aItem['author_id'],
  810. 'price_single' => _t('_adm_str_txt_price_single', $aItem['author_currency_sign'], $aItem['price_single'])
  811. )
  812. ),
  813. 'bx_if:show_checkout_single' => array(
  814. 'condition' => $bPurchaseSingle,
  815. 'content' => array(
  816. 'js_object' => $sJsObject,
  817. 'id' => $aItem['id'],
  818. 'vendor_id' => $aItem['author_id'],
  819. 'bx_if:show_as_hidden' => array(
  820. 'condition' => !$bInCart,
  821. 'content' => array()
  822. )
  823. )
  824. ),
  825. 'bx_if:show_purchase_recurring' => array(
  826. 'condition' => $bPurchaseRecurring,
  827. 'content' => array(
  828. 'js_object' => $sJsObject,
  829. 'id' => $aItem['id'],
  830. 'vendor_id' => $aItem['author_id'],
  831. 'price_recurring' => _t('_adm_str_txt_price_recurring', $aItem['author_currency_sign'], $aItem['price_recurring'], _t('_adm_str_txt_per_' . $aItem['duration_recurring'] . '_short'))
  832. )
  833. ),
  834. 'bx_if:show_download' => array(
  835. 'condition' => $bDownload && !$bQueued && !$bDownloaded,
  836. 'content' => array(
  837. 'js_object' => $sJsObject,
  838. 'file_id' => $aItem['file_id']
  839. )
  840. ),
  841. 'bx_if:show_download_disabled' => array(
  842. 'condition' => $bDownload && !$bQueued && $bDownloaded,
  843. 'content' => array()
  844. ),
  845. 'bx_if:show_queued_disabled' => array(
  846. 'condition' => $bDownload && $bQueued && !$bDownloaded,
  847. 'content' => array()
  848. ),
  849. 'bx_if:show_delete' => array(
  850. 'condition' => $bShoppingCart,
  851. 'content' => array(
  852. 'js_object' => $sJsObject,
  853. 'id' => $aItem['id'],
  854. 'vendor_id' => $aItem['author_id']
  855. )
  856. )
  857. ));
  858. }
  859. return $sResult;
  860. }
  861. protected function displayUpdates($mixedItems, $aParams = array())
  862. {
  863. if(!is_array($mixedItems))
  864. return MsgBox($mixedItems);
  865. if(empty($mixedItems))
  866. return MsgBox(_t('_Empty'));
  867. $sJsObject = $this->getPageJsObject();
  868. $oTemplate = BxDolStudioTemplate::getInstance();
  869. $sResult = '';
  870. foreach($mixedItems as $aItem) {
  871. $bDownloadable = (int)$aItem['is_file'] == 1;
  872. $bQueued = $this->oDb->isQueued('download', $aItem['name']);
  873. $sIcon = !empty($aItem['thumbnail']['big']) ? $aItem['thumbnail']['big'] : BxDolStudioUtils::getIconDefault(BX_DOL_MODULE_TYPE_MODULE);
  874. $bIcon = strpos($sIcon, '.') !== false;
  875. $sImage = !empty($aItem['cover']['big']) ? $aItem['cover']['big'] : '';
  876. $bImage = strpos($sImage, '.') !== false;
  877. $sResult .= $oTemplate->parseHtmlByName('str_update_v2.html', array(
  878. 'js_object' => $sJsObject,
  879. 'id' => $aItem['id'],
  880. 'name' => $aItem['name'],
  881. 'url' => $aItem['url'],
  882. 'bx_if:no_icon' => array (
  883. 'condition' => !$bIcon,
  884. 'content' => array(
  885. 'icon' => $sIcon
  886. ),
  887. ),
  888. 'bx_if:icon' => array (
  889. 'condition' => $bIcon,
  890. 'content' => array(
  891. 'icon_url' => $sIcon,
  892. ),
  893. ),
  894. 'bx_if:no_image' => array (
  895. 'condition' => !$bImage,
  896. 'content' => array(
  897. 'note' => $aItem['description_plain'],
  898. 'strecher' => mb_strlen($aItem['description_plain']) > 240 ? '' : str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', round((240 - mb_strlen($aItem['description_plain'])) / 6))
  899. ),
  900. ),
  901. 'bx_if:image' => array (
  902. 'condition' => $bImage,
  903. 'content' => array(
  904. 'image_url' => $sImage,
  905. 'strecher' => str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', 40)
  906. ),
  907. ),
  908. 'title' => $aItem['title'],
  909. 'vendor' => $aItem['author_name'],
  910. 'versions' => _t('_adm_str_txt_update_from_to', $aItem['file_version'], $aItem['file_version_to']),
  911. 'bx_if:show_download' => array(
  912. 'condition' => $bDownloadable && !$bQueued,
  913. 'content' => array(
  914. 'caption' => _t('_adm_btn_install_submit'),
  915. 'on_click' => $sJsObject . ".getUpdateAndInstall('" . $aItem['name'] . "', this)"
  916. )
  917. ),
  918. 'bx_if:show_queued_disabled' => array(
  919. 'condition' => $bDownloadable && $bQueued,
  920. 'content' => array()
  921. )
  922. ));
  923. }
  924. return $sResult;
  925. }
  926. protected function displayCategories($aCategories)
  927. {
  928. foreach($aCategories['bx_repeat:cats'] as $iKey => $aItem)
  929. $aCategories['bx_repeat:cats'][$iKey]['url'] = $this->getBaseUrl(array('page' => 'category', 'value' => $aItem['value'], 'title' => urlencode($aItem['name'])));
  930. return BxDolStudioTemplate::getInstance()->parseHtmlByName('str_lbl_categories.html', $aCategories);
  931. }
  932. protected function displayTags($aTags)
  933. {
  934. foreach($aTags['bx_repeat:units'] as $iKey => $aItem)
  935. $aTags['bx_repeat:units'][$iKey]['href'] = $this->getBaseUrl(array('page' => 'tag', 'value' => $aItem['keyword']));
  936. return BxDolStudioTemplate::getInstance()->parseHtmlByName('str_lbl_tags.html', $aTags);
  937. }
  938. protected function displayNonOwnerNotification()
  939. {
  940. if(BxDolStudioOAuth::isAuthorizedOwner())
  941. return;
  942. $oSession = BxDolSession::getInstance();
  943. if($oSession->getValue($this->sSessionKeyNonOwnerNotified) === true)
  944. return;
  945. $oSession->setValue($this->sSessionKeyNonOwnerNotified, true);
  946. return $this->getJsResultBy(array(
  947. 'message' => '_adm_msg_oauth_non_owner_logged',
  948. 'translate' => array(BX_DOL_MARKET_URL_ROOT),
  949. 'on_page_load' => true
  950. ));
  951. }
  952. private function getDownloadedModules($bNamesOnly = true)
  953. {
  954. $aModules = BxDolStudioInstallerUtils::getInstance()->getModules(false);
  955. return $bNamesOnly ? array_keys($aModules) : $aModules;
  956. }
  957. private function getVoteStars($aItem)
  958. {
  959. $aTmplVarsStars = array();
  960. for($i = (int)$aItem['rate_min']; $i <= (int)$aItem['rate_max']; $i++)
  961. $aTmplVarsStars[] = array('value' => $i);
  962. return BxDolStudioTemplate::getInstance()->parseHtmlByName('str_vote_stars.html', array(
  963. 'id' => $aItem['id'],
  964. 'value' => (float)$aItem['rate'],
  965. 'bx_repeat:stars' => $aTmplVarsStars,
  966. 'bx_repeat:slider' => $aTmplVarsStars,
  967. ));
  968. }
  969. }
  970. /** @} */