BxBaseStudioStore.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <?php
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinView Dolphin Studio Representation classes
  7. * @ingroup DolphinStudio
  8. * @{
  9. */
  10. defined('BX_DOL') or die('hack attempt');
  11. bx_import('BxDolStudioStore');
  12. bx_import('BxTemplStudioFunctions');
  13. class BxBaseStudioStore extends BxDolStudioStore {
  14. protected $iPerPageDefault = 24;
  15. function BxBaseStudioStore($sPage = "") {
  16. parent::BxDolStudioStore($sPage);
  17. }
  18. function getPageCss() {
  19. return array_merge(parent::getPageCss(), array('store.css'));
  20. }
  21. function getPageJs() {
  22. return array_merge(parent::getPageJs(), array('jquery.migrate.js', 'jquery.fancybox.js', 'store.js'));
  23. }
  24. function getPageJsObject() {
  25. return 'oBxDolStudioStore';
  26. }
  27. function getPageMenu($aMenu = array(), $aMarkers = array()) {
  28. $sJsObject = $this->getPageJsObject();
  29. $oTemplate = BxDolStudioTemplate::getInstance();
  30. $aMenu = array();
  31. $aMenuItems = array('goodies', 'featured', 'purchases', 'updates', 'checkout', 'downloaded');
  32. foreach($aMenuItems as $sMenuItem)
  33. $aMenu[] = array(
  34. 'name' => $sMenuItem,
  35. 'icon' => 'mi-str-' . $sMenuItem . '.png',
  36. 'link' => BX_DOL_URL_STUDIO . 'store.php?page=' . $sMenuItem,
  37. 'title' => _t('_adm_lmi_cpt_' . $sMenuItem),
  38. 'selected' => $sMenuItem == $this->sPage
  39. );
  40. bx_import('BxDolStudioCart');
  41. $iCounter = BxDolStudioCart::getInstance()->getCount();
  42. $aMarkers = array(
  43. 'checkout_counter' => $oTemplate->parseHtmlByName('menu_side_counter.html', array(
  44. 'bx_if:hide_counter' => array(
  45. 'condition' => $iCounter <= 0,
  46. 'content' => array()
  47. ),
  48. 'counter' => $iCounter
  49. ))
  50. );
  51. return parent::getPageMenu($aMenu, $aMarkers);
  52. }
  53. function getPageCode($bHidden = false) {
  54. $sMethod = 'get' . ucfirst($this->sPage) . 'List';
  55. if(!method_exists($this, $sMethod))
  56. return '';
  57. return $this->$sMethod();
  58. }
  59. function getPageContent() {
  60. $sMethod = 'get' . ucfirst($this->sPage) . 'List';
  61. if(!method_exists($this, $sMethod))
  62. return '';
  63. return $this->$sMethod(false);
  64. }
  65. protected function getGoodiesList() {
  66. $sJsObject = $this->getPageJsObject();
  67. $oTemplate = BxDolStudioTemplate::getInstance();
  68. $aProducts = $this->loadGoodies();
  69. $aTmplVars = array(
  70. 'js_object' => $sJsObject,
  71. 'bx_repeat:blocks' => array()
  72. );
  73. $sActions = "";
  74. foreach($aProducts as $aBlock) {
  75. $sItems = $this->displayProducts($aBlock['items']);
  76. $aTmplVars['bx_repeat:blocks'][] = array(
  77. 'caption' => $this->getBlockCaption($aBlock),
  78. 'items' => $sItems
  79. );
  80. }
  81. return $oTemplate->parseHtmlByName('store.html', $aTmplVars);
  82. }
  83. protected function getFeaturedList($bWrapInBlock = true) {
  84. $sJsObject = $this->getPageJsObject();
  85. $oTemplate = BxDolStudioTemplate::getInstance();
  86. $iStart = (int)bx_get('str_start');
  87. $iPerPage = (int)bx_get('str_per_page');
  88. if(empty($iPerPage))
  89. $iPerPage = $this->iPerPageDefault;
  90. $aProducts = $this->loadFeatured($iStart, $iPerPage + 1);
  91. bx_import('BxTemplPaginate');
  92. $oPaginate = new BxTemplPaginate(array(
  93. 'start' => $iStart,
  94. 'per_page' => $iPerPage,
  95. 'on_change_page' => $sJsObject . ".changePagePaginate(this, 'featured', {start}, {per_page})"
  96. ));
  97. $oPaginate->setNumFromDataArray($aProducts);
  98. $sContent = $oTemplate->parseHtmlByName('str_products.html', array(
  99. 'list' => $this->displayProducts($aProducts),
  100. 'paginate' => $oPaginate->getSimplePaginate()
  101. ));
  102. if(!$bWrapInBlock)
  103. return $sContent;
  104. return $oTemplate->parseHtmlByName('store.html', array(
  105. 'js_object' => $sJsObject,
  106. 'bx_repeat:blocks' => array(
  107. array(
  108. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_featured'), 'actions' => array())),
  109. 'items' => $sContent
  110. )
  111. )
  112. ));
  113. }
  114. protected function getModulesList($bWrapInBlock = true) {
  115. return $this->getTag('modules', $bWrapInBlock);
  116. }
  117. protected function getTemplatesList($bWrapInBlock = true) {
  118. return $this->getTag('templates', $bWrapInBlock);
  119. }
  120. protected function getLanguagesList($bWrapInBlock = true) {
  121. return $this->getTag('languages', $bWrapInBlock);
  122. }
  123. protected function getTag($sTag, $bWrapInBlock = true) {
  124. $sJsObject = $this->getPageJsObject();
  125. $oTemplate = BxDolStudioTemplate::getInstance();
  126. $iStart = (int)bx_get('str_start');
  127. $iPerPage = (int)bx_get('str_per_page');
  128. if(empty($iPerPage))
  129. $iPerPage = $this->iPerPageDefault;
  130. $aProducts = $this->loadTag($sTag, $iStart, $iPerPage + 1);
  131. bx_import('BxTemplPaginate');
  132. $oPaginate = new BxTemplPaginate(array(
  133. 'start' => $iStart,
  134. 'per_page' => $iPerPage,
  135. 'on_change_page' => $sJsObject . ".changePagePaginate(this, '" . $sTag . "', {start}, {per_page})"
  136. ));
  137. $oPaginate->setNumFromDataArray($aProducts);
  138. $sContent = $oTemplate->parseHtmlByName('str_products.html', array(
  139. 'list' => $this->displayProducts($aProducts),
  140. 'paginate' => $oPaginate->getSimplePaginate()
  141. ));
  142. if(!$bWrapInBlock)
  143. return $sContent;
  144. return $oTemplate->parseHtmlByName('store.html', array(
  145. 'js_object' => $sJsObject,
  146. 'bx_repeat:blocks' => array(
  147. array(
  148. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_' . $sTag), 'actions' => array())),
  149. 'items' => $sContent
  150. )
  151. )
  152. ));
  153. }
  154. protected function getPurchasesList() {
  155. $sJsObject = $this->getPageJsObject();
  156. $oTemplate = BxDolStudioTemplate::getInstance();
  157. $aProducts = $this->loadPurchases();
  158. $aTmplVars = array(
  159. 'js_object' => $sJsObject,
  160. 'bx_repeat:blocks' => array(
  161. array(
  162. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_purchases'), 'actions' => array())),
  163. 'items' => $this->displayProducts($aProducts)
  164. )
  165. )
  166. );
  167. return $oTemplate->parseHtmlByName('store.html', $aTmplVars);
  168. }
  169. protected function getUpdatesList() {
  170. $sJsObject = $this->getPageJsObject();
  171. $oTemplate = BxDolStudioTemplate::getInstance();
  172. $aUpdates = $this->loadUpdates();
  173. $aTmplVars = array(
  174. 'js_object' => $sJsObject,
  175. 'bx_repeat:blocks' => array(
  176. array(
  177. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_updates'), 'actions' => array())),
  178. 'items' => $this->displayUpdates($aUpdates)
  179. )
  180. )
  181. );
  182. return $oTemplate->parseHtmlByName('store.html', $aTmplVars);
  183. }
  184. protected function getCheckoutList() {
  185. $sJsObject = $this->getPageJsObject();
  186. $oTemplate = BxDolStudioTemplate::getInstance();
  187. //--- Empty cart by vendor if the payment was accepted.
  188. $mixedVendor = bx_get('vendor');
  189. $mixedProducts = bx_get('products');
  190. if($mixedVendor !== false && $mixedProducts !== false) {
  191. bx_import('BxDolStudioCart');
  192. $oCart = BxDolStudioCart::getInstance();
  193. $aProducts = explode(',', base64_decode($mixedProducts));
  194. foreach($aProducts as $iId)
  195. $oCart->delete($mixedVendor, $iId);
  196. return $this->getMessage('_adm_block_cpt_checkout', '_adm_msg_modules_success_checkouted');
  197. }
  198. $aVendors = $this->loadCheckout();
  199. $aTmplVarsBlocks = array();
  200. foreach($aVendors as $sName => $aInfo) {
  201. $fTotal = 0;
  202. $sCurrency = '';
  203. foreach($aInfo['products'] as $aProduct) {
  204. $iCount = isset($aInfo['counts'][$aProduct['id']]) ? (int)$aInfo['counts'][$aProduct['id']] : 1;
  205. $fTotal += $iCount * $aProduct['price'];
  206. if($sCurrency == '' && isset($aProduct['currency_sign']))
  207. $sCurrency = $aProduct['currency_sign'];
  208. }
  209. $aActions = array(
  210. array('name' => 'checkout-' . $sName, 'caption' => '_adm_action_cpt_checkout', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".checkoutCart('" . $sName . "', this);"),
  211. array('name' => 'delete-all-' . $sName, 'caption' => '_adm_action_cpt_delete_all', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".deleteAllFromCart('" . $sName . "', this)")
  212. );
  213. $aTmplVarsBlocks[] = array(
  214. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_checkout_by_vendor_csign', $sName, $sCurrency, $fTotal), 'actions' => $aActions)),
  215. 'items' => $this->displayProducts($aInfo['products'], array('is_shopping_cart' => true, 'counts' => $aInfo['counts']))
  216. );
  217. }
  218. if(empty($aTmplVarsBlocks))
  219. return $this->getMessage('_adm_block_cpt_checkout', '_Empty');
  220. return $oTemplate->parseHtmlByName('store.html', array(
  221. 'js_object' => $sJsObject,
  222. 'bx_repeat:blocks' => $aTmplVarsBlocks
  223. ));
  224. }
  225. protected function getDownloadedList() {
  226. $sJsObject = $this->getPageJsObject();
  227. $oTemplate = BxDolStudioTemplate::getInstance();
  228. $sModules = $sUpdates = "";
  229. $aProducts = $this->loadDownloaded();
  230. //--- Prepare modules.
  231. foreach($aProducts['modules'] as $aModule) {
  232. $sIcon = $oTemplate->getIconUrl($aModule['name'] . '@modules/' . $aModule['dir'] . '|std-si.png');
  233. if(empty($sIcon))
  234. $sIcon = $oTemplate->getIconUrl('pi-str-dump.png');
  235. $sModules .= $oTemplate->parseHtmlByName('str_product_v1.html', array(
  236. 'js_object' => $sJsObject,
  237. 'url' => $aModule['link_market'],
  238. 'icon' => $sIcon,
  239. 'title' => $aModule['title'],
  240. 'vendor' => $aModule['vendor'],
  241. 'version' => $aModule['version'],
  242. 'dir' => $aModule['dir'],
  243. 'bx_if:hide_install' => array(
  244. 'condition' => $aModule['installed'],
  245. 'content' => array()
  246. ),
  247. 'bx_if:hide_installed' => array(
  248. 'condition' => !$aModule['installed'],
  249. 'content' => array()
  250. )
  251. ));
  252. }
  253. //--- Prepare updates.
  254. foreach($aProducts['updates'] as $aUpdate) {
  255. $sIcon = $oTemplate->getIconUrl($aUpdate['module_name'] . '@modules/' . $aUpdate['module_dir'] . '|std-si.png');
  256. if(empty($sIcon))
  257. $sIcon = $oTemplate->getIconUrl('pi-str-dump.png');
  258. $sUpdates .= $oTemplate->parseHtmlByName('str_update_v1.html', array(
  259. 'js_object' => $sJsObject,
  260. 'url' => $aUpdate['module_link_market'],
  261. 'icon' => $sIcon,
  262. 'title' => $aUpdate['title'],
  263. 'vendor' => $aUpdate['vendor'],
  264. 'versions' => _t('_adm_str_txt_update_from_to', $aUpdate['version_from'], $aUpdate['version_to']),
  265. 'dir' => $aUpdate['dir']
  266. ));
  267. }
  268. $aTmplVars = array(
  269. 'js_object' => $sJsObject,
  270. 'bx_repeat:blocks' => array(
  271. array(
  272. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_downloaded_modules'), 'actions' => array())),
  273. 'items' => $sModules
  274. )
  275. )
  276. );
  277. if(!empty($sUpdates))
  278. $aTmplVars['bx_repeat:blocks'][] = array(
  279. 'caption' => $this->getBlockCaption(array('caption' => _t('_adm_block_cpt_downloaded_updates'), 'actions' => array())),
  280. 'items' => $sUpdates
  281. );
  282. return $oTemplate->parseHtmlByName('store.html', $aTmplVars);
  283. }
  284. protected function getMessage($sCaption, $sContent, $aActions = array()) {
  285. $sJsObject = $this->getPageJsObject();
  286. $oTemplate = BxDolStudioTemplate::getInstance();
  287. return $oTemplate->parseHtmlByName('store.html', array(
  288. 'js_object' => $sJsObject,
  289. 'bx_repeat:blocks' => array(
  290. array(
  291. 'caption' => $this->getBlockCaption(array('caption' => _t($sCaption), 'actions' => $aActions)),
  292. 'items' => MsgBox(_t($sContent))
  293. )
  294. )
  295. ));
  296. }
  297. protected function getProduct($iId) {
  298. $sJsObject = $this->getPageJsObject();
  299. $oTemplate = BxDolStudioTemplate::getInstance();
  300. $aProduct = $this->loadProduct($iId);
  301. if(!is_array($aProduct))
  302. return array('code' => 1, 'message' => (!empty($aProduct) ? $aProduct : _t('_adm_str_err_no_product_info')));
  303. $bFree = (int)$aProduct['is_free'] == 1;
  304. $bPurchased = (int)$aProduct['is_purchased'] == 1;
  305. $bDownloadable = (int)$aProduct['is_file'] == 1;
  306. $bDiscount = !empty($aProduct['discount']);
  307. $bScreenshots = is_array($aProduct['screenshots']) && !empty($aProduct['screenshots']);
  308. $iScreenshots = 0;
  309. $aScreenshots = array();
  310. if($bScreenshots) {
  311. $iScreenshots = count($aProduct['screenshots']);
  312. foreach($aProduct['screenshots'] as $aScreenshot)
  313. $aScreenshots[] = array(
  314. 'view_url' => $aProduct['url'],
  315. 'image_url' => $aScreenshot['big']
  316. );
  317. }
  318. $sContent = $oTemplate->parseHtmlByname('str_product_view.html', array(
  319. 'id' => $aProduct['id'],
  320. 'title' => $aProduct['title'],
  321. 'url' => $aProduct['url'],
  322. 'author_name' => $aProduct['author_name'],
  323. 'author_url' => $aProduct['author_url'],
  324. 'version' => $aProduct['version'],
  325. 'price' => !$bFree ? _t('_adm_str_txt_price_csign', $aProduct['author_currency_sign'], $aProduct['price']) : _t('_adm_str_txt_price_free'),
  326. 'bx_if:show_discount' => array(
  327. 'condition' => !$bFree && $bDiscount,
  328. 'content' => array(
  329. 'discount' => $bDiscount ? _t('_adm_str_txt_pv_discount_off_csign', $aProduct['discount']['percent'], $aProduct['author_currency_sign'], $aProduct['discount']['save']) : ''
  330. )
  331. ),
  332. 'category' => $aProduct['category'],
  333. 'category_url' => $aProduct['category_url'],
  334. 'tags' => implode(', ', explode(',', $aProduct['tags'])),
  335. 'reviews' => _t('_adm_str_txt_pv_stats_reviews', $aProduct['reviews_cnt']),
  336. 'reviews_url' => $aProduct['reviews_url'],
  337. 'likes' => _t('_adm_str_txt_pv_stats_likes', $aProduct['likes_cnt']),
  338. 'views' => _t('_adm_str_txt_pv_stats_views', $aProduct['views_cnt']),
  339. 'created' => $aProduct['created'],
  340. 'updated' => $aProduct['updated'],
  341. 'description' => $aProduct['description'],
  342. 'bx_if:show_screenshots' => array(
  343. 'condition' => $bScreenshots,
  344. 'content' => array(
  345. 'width' => 222 * $iScreenshots - 20,
  346. 'bx_repeat:screenshots' => $aScreenshots
  347. )
  348. ),
  349. 'bx_if:show_purchase' => array(
  350. 'condition' => !$bFree && !$bPurchased,
  351. 'content' => array(
  352. 'js_object' => $sJsObject,
  353. 'id' => $aProduct['id'],
  354. 'vendor' => $aProduct['author_name'],
  355. )
  356. ),
  357. 'bx_if:show_download' => array(
  358. 'condition' => ($bFree || $bPurchased) && $bDownloadable,
  359. 'content' => array(
  360. 'js_object' => $sJsObject,
  361. 'id' => $aProduct['id'],
  362. 'file_id' => $aProduct['file_id'],
  363. )
  364. )
  365. ));
  366. return array('code' => 0, 'message' => '', 'popup' => PopupBox('bx-std-str-popup-product', $aProduct['title'], $sContent, true), 'screenshots' => $iScreenshots);
  367. }
  368. /*
  369. * NOTE. Is needed for download popup selector. Isn't used for now.
  370. */
  371. protected function getFiles($iId, $sType) {
  372. $sJsObject = $this->getPageJsObject();
  373. $oTemplate = BxDolStudioTemplate::getInstance();
  374. $aFiles = $this->loadFiles($iId, $sType);
  375. if(!is_array($aFiles))
  376. return array('code' => 1, 'message' => (!empty($aFiles) ? $aFiles : _t('_adm_str_err_no_files')));
  377. $aTmplVarsFiles = array();
  378. foreach($aFiles as $aFile)
  379. $aTmplVarsFiles[] = array(
  380. 'js_object' => $sJsObject,
  381. 'product_id' => $iId,
  382. 'id' => $aFile['id'],
  383. 'title' => $aFile['name'],
  384. 'version' => empty($aFile['version_to']) ? $aFile['version'] : _t('_adm_str_txt_update_from_to', $aFile['version'], $aFile['version_to']),
  385. );
  386. $sContent = $oTemplate->parseHtmlByName('str_files.html', array(
  387. 'bx_repeat:files' => $aTmplVarsFiles
  388. ));
  389. return array('code' => 0, 'message' => $sContent);
  390. }
  391. protected function getFile($iId) {
  392. $mixedResult = $this->loadFile($iId);
  393. if($mixedResult !== true)
  394. return array('code' => 1, 'message' => (!empty($mixedResult) ? $mixedResult : _t('_adm_str_err_download_failed')));
  395. return array('code' => 0, 'message' => _t('_adm_str_msg_download_successfully'));
  396. }
  397. protected function displayProducts($aItems, $aParams = array()) {
  398. if(!is_array($aItems))
  399. return $aItems;
  400. $sJsObject = $this->getPageJsObject();
  401. $oTemplate = BxDolStudioTemplate::getInstance();
  402. $bShoppingCart = isset($aParams['is_shopping_cart']) && $aParams['is_shopping_cart'];
  403. $sResult = '';
  404. foreach($aItems as $aItem) {
  405. $bFree = (int)$aItem['is_free'] == 1;
  406. $bPurchased = (int)$aItem['is_purchased'] == 1;
  407. $bDownloadable = (int)$aItem['is_file'] == 1;
  408. $sPrice = !$bFree ? _t('_adm_str_txt_price_csign', $aItem['currency_sign'], $aItem['price']) : _t('_adm_str_txt_price_free');
  409. $sDiscount = !$bFree && !empty($aItem['discount']) ? _t('_adm_str_txt_discount_csign', $aItem['currency_sign'], $aItem['discount']['price']) : '';
  410. $sResult .= $oTemplate->parseHtmlByName('str_product_v2.html', array(
  411. 'js_object' => $sJsObject,
  412. 'id' => $aItem['id'],
  413. 'url' => $aItem['url'],
  414. 'icon' => !empty($aItem['thumbnail']['medium']) ? $aItem['thumbnail']['medium'] : $oTemplate->getIconUrl('pi-str-dump.png'),
  415. 'title' => $aItem['title'],
  416. 'bx_if:show_vendor_price' => array(
  417. 'condition' => !$bShoppingCart,
  418. 'content' => array(
  419. 'vendor' => $aItem['author'],
  420. 'price' => $sPrice,
  421. 'discount' => $sDiscount,
  422. )
  423. ),
  424. 'bx_if:show_count_price' => array(
  425. 'condition' => $bShoppingCart,
  426. 'content' => array(
  427. 'count' => isset($aParams['counts'][$aItem['id']]) ? (int)$aParams['counts'][$aItem['id']] : 1,
  428. 'price' => $sPrice,
  429. 'discount' => $sDiscount,
  430. )
  431. ),
  432. 'bx_if:show_purchase' => array(
  433. 'condition' => !$bShoppingCart && !$bFree && !$bPurchased,
  434. 'content' => array(
  435. 'js_object' => $sJsObject,
  436. 'id' => $aItem['id'],
  437. 'vendor' => $aItem['author']
  438. )
  439. ),
  440. 'bx_if:show_download' => array(
  441. 'condition' => !$bShoppingCart && ($bFree || $bPurchased) && $bDownloadable,
  442. 'content' => array(
  443. 'js_object' => $sJsObject,
  444. 'id' => $aItem['id'],
  445. 'file_id' => $aItem['file_id'],
  446. )
  447. ),
  448. 'bx_if:show_delete' => array(
  449. 'condition' => $bShoppingCart,
  450. 'content' => array(
  451. 'js_object' => $sJsObject,
  452. 'id' => $aItem['id'],
  453. 'vendor' => $aItem['author']
  454. )
  455. )
  456. ));
  457. }
  458. return $sResult;
  459. }
  460. protected function displayUpdates($aItems, $aParams = array()) {
  461. if(!is_array($aItems))
  462. return $aItems;
  463. $sJsObject = $this->getPageJsObject();
  464. $oTemplate = BxDolStudioTemplate::getInstance();
  465. $sResult = '';
  466. foreach($aItems as $aItem) {
  467. $bDownloadable = (int)$aItem['is_file'] == 1;
  468. $sResult .= $oTemplate->parseHtmlByName('str_update_v2.html', array(
  469. 'js_object' => $sJsObject,
  470. 'id' => $aItem['id'],
  471. 'url' => $aItem['url'],
  472. 'icon' => !empty($aItem['thumbnail']['medium']) ? $aItem['thumbnail']['medium'] : $oTemplate->getIconUrl('pi-str-dump.png'),
  473. 'title' => $aItem['title'],
  474. 'vendor' => $aItem['author'],
  475. 'versions' => _t('_adm_str_txt_update_from_to', $aItem['file_version'], $aItem['file_version_to']),
  476. 'bx_if:show_download' => array(
  477. 'condition' => $bDownloadable,
  478. 'content' => array(
  479. 'js_object' => $sJsObject,
  480. 'id' => $aItem['id'],
  481. 'file_id' => $aItem['file_id'],
  482. )
  483. )
  484. ));
  485. }
  486. return $sResult;
  487. }
  488. }
  489. /** @} */