|
|
@@ -7,6 +7,8 @@
|
|
|
* @{
|
|
|
*/
|
|
|
|
|
|
+bx_import('BxDolStudioInstallerUtils');
|
|
|
+
|
|
|
define('BX_DOL_STUDIO_STR_TYPE_DEFAULT', 'downloaded');
|
|
|
|
|
|
class BxDolStudioStore extends BxTemplStudioPage
|
|
|
@@ -17,7 +19,7 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
protected $iClient;
|
|
|
protected $sClientKey;
|
|
|
|
|
|
- protected $aAlias;
|
|
|
+ protected $sPublicDataUrl;
|
|
|
protected $bAuthAccessUpdates;
|
|
|
|
|
|
function __construct($sPage = "")
|
|
|
@@ -26,13 +28,7 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
|
|
|
$this->oDb = new BxDolStudioStoreQuery();
|
|
|
|
|
|
- $this->aAlias = array(
|
|
|
- 'tag' => array(
|
|
|
- 'modules' => 'extensions',
|
|
|
- 'languages' => 'translations'
|
|
|
- ),
|
|
|
- 'category' => array()
|
|
|
- );
|
|
|
+ $this->sPublicDataUrl = BX_DOL_UNA_URL_MARKET;
|
|
|
$this->bAuthAccessUpdates = false;
|
|
|
|
|
|
$this->sPage = BX_DOL_STUDIO_STR_TYPE_DEFAULT;
|
|
|
@@ -174,17 +170,17 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
'actions' => array(
|
|
|
array('name' => 'featured', 'caption' => '_adm_action_cpt_see_all_featured', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".changePage('featured', this)")
|
|
|
),
|
|
|
- 'items' => $oJson->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_featured', array('start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
+ 'items' => $oJson->load($this->sPublicDataUrl . 'json_browse_featured', array('start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
);
|
|
|
|
|
|
|
|
|
// Load modules
|
|
|
$aProducts[] = array(
|
|
|
- 'caption' => '_adm_block_cpt_last_modules',
|
|
|
+ 'caption' => '_adm_block_cpt_last_extensions',
|
|
|
'actions' => array(
|
|
|
- array('name' => 'modules', 'caption' => '_adm_action_cpt_see_all_modules', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".changePage('modules', this)")
|
|
|
+ array('name' => 'modules', 'caption' => '_adm_action_cpt_see_all_extensions', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".changePage('extensions', this)")
|
|
|
),
|
|
|
- 'items' => $oJson->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_by_tag', array('value' => 'extensions', 'start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
+ 'items' => $oJson->load($this->sPublicDataUrl . 'json_browse_by_category', array('value' => 'extensions', 'start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
);
|
|
|
|
|
|
// Load templates
|
|
|
@@ -193,16 +189,16 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
'actions' => array(
|
|
|
array('name' => 'templates', 'caption' => '_adm_action_cpt_see_all_templates', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".changePage('templates', this)")
|
|
|
),
|
|
|
- 'items' => $oJson->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_by_tag', array('value' => 'templates', 'start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
+ 'items' => $oJson->load($this->sPublicDataUrl . 'json_browse_by_category', array('value' => 'templates', 'start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
);
|
|
|
|
|
|
// Load languages
|
|
|
$aProducts[] = array(
|
|
|
- 'caption' => '_adm_block_cpt_last_languages',
|
|
|
+ 'caption' => '_adm_block_cpt_last_translations',
|
|
|
'actions' => array(
|
|
|
- array('name' => 'languages', 'caption' => '_adm_action_cpt_see_all_languages', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".changePage('languages', this)")
|
|
|
+ array('name' => 'languages', 'caption' => '_adm_action_cpt_see_all_translations', 'url' => 'javascript:void(0)', 'onclick' => $sJsObject . ".changePage('translations', this)")
|
|
|
),
|
|
|
- 'items' => $oJson->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_by_tag', array('value' => 'translations', 'start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
+ 'items' => $oJson->load($this->sPublicDataUrl . 'json_browse_by_category', array('value' => 'translations', 'start' => 0, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey))
|
|
|
);
|
|
|
|
|
|
return $aProducts;
|
|
|
@@ -210,12 +206,17 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
|
|
|
protected function loadFeatured($iStart, $iPerPage)
|
|
|
{
|
|
|
- return BxDolStudioJson::getInstance()->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_featured', array('start' => $iStart, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
+ return BxDolStudioJson::getInstance()->load($this->sPublicDataUrl . 'json_browse_featured', array('start' => $iStart, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function loadCategory($sCategory, $iStart, $iPerPage)
|
|
|
+ {
|
|
|
+ return BxDolStudioJson::getInstance()->load($this->sPublicDataUrl . 'json_browse_by_category', array('value' => $sCategory, 'start' => $iStart, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
}
|
|
|
|
|
|
protected function loadTag($sTag, $iStart, $iPerPage)
|
|
|
{
|
|
|
- return BxDolStudioJson::getInstance()->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_by_tag', array('value' => $this->aliasToNameTag($sTag), 'start' => $iStart, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
+ return BxDolStudioJson::getInstance()->load($this->sPublicDataUrl . 'json_browse_by_tag', array('value' => $sTag, 'start' => $iStart, 'per_page' => $iPerPage, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
}
|
|
|
|
|
|
protected function loadPurchases()
|
|
|
@@ -242,7 +243,7 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
$aCounts[$aItem['item_id']] = $aItem['item_count'];
|
|
|
}
|
|
|
|
|
|
- $aProducts = $oJson->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_selected', array('products' => base64_encode(serialize($aIds))));
|
|
|
+ $aProducts = $oJson->load($this->sPublicDataUrl . 'json_browse_selected', array('products' => base64_encode(serialize($aIds))));
|
|
|
if(!empty($aProducts))
|
|
|
$aResult[$sVendor] = array(
|
|
|
'ids' => $aIds,
|
|
|
@@ -268,7 +269,7 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
{
|
|
|
$oJson = BxDolStudioJson::getInstance();
|
|
|
|
|
|
- return $oJson->load(BX_DOL_UNITY_URL_MARKET . 'json_get_product_by_name', array('value' => $sModuleName, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
+ return $oJson->load($this->sPublicDataUrl . 'json_get_product_by_name', array('value' => $sModuleName, 'client' => $this->iClient, 'key' => $this->sClientKey));
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -300,22 +301,7 @@ class BxDolStudioStore extends BxTemplStudioPage
|
|
|
$aIds[] = $aItem['item_id'];
|
|
|
|
|
|
$sSid = bx_site_hash();
|
|
|
- return BX_DOL_UNITY_URL_MARKET . 'purchase/' . $sVendor . '?sid=' . $sSid . '&products=' . base64_encode(implode(',', $aIds));
|
|
|
- }
|
|
|
-
|
|
|
- private function aliasToNameTag($sAlias)
|
|
|
- {
|
|
|
- return $this->aliasToName('tag', $sAlias);
|
|
|
- }
|
|
|
-
|
|
|
- private function aliasToNameCategory($sAlias)
|
|
|
- {
|
|
|
- return $this->aliasToName('category', $sAlias);
|
|
|
- }
|
|
|
-
|
|
|
- private function aliasToName($sType, $sAlias)
|
|
|
- {
|
|
|
- return isset($this->aAlias[$sType][$sAlias]) ? $this->aAlias[$sType][$sAlias] : $sAlias;
|
|
|
+ return $this->sPublicDataUrl . 'purchase/' . $sVendor . '?sid=' . $sSid . '&products=' . base64_encode(implode(',', $aIds));
|
|
|
}
|
|
|
}
|
|
|
|