UPGRADE NOTE: Do not edit or add to this file if you wish to upgrade AbanteCart to newer versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ if (! defined ( 'DIR_CORE' ) || !IS_ADMIN) { header ( 'Location: static_pages/' ); } class ControllerResponsesToolExtensionsStore extends AController { private $error = array(); public function main() { $href = '/mp_api2'; $GET = $this->request->get; // if set subfolder for request(seo requests) - concatenate it to url if(isset($GET['path'])){ $href.= $GET['path']; unset($GET['path']); } $unset = array('s', 'rt', 'token','path','store_id','store_ip','store_url','store_version','language_code'); foreach($unset as $key){ unset($GET[$key]); } $GET['store_id'] = UNIQUE_ID; $GET['store_ip'] = $_SERVER ['SERVER_ADDR']; $GET['store_url'] = HTTP_SERVER; $GET['store_version'] = VERSION; $GET['language_code'] = $this->request->cookie ['language']; // place your affiliate id here define('MP_AFFILIATE_ID',''); if(MP_AFFILIATE_ID){ $GET['aff_id'] = MP_AFFILIATE_ID; } $href .= '?'.http_build_query($GET); $connect = new AConnect(); $html = $connect->getResponse($href); if(!$html){ $this->loadLanguage('extension/extensions_store','silent'); $error = is_array($connect->error) ? $connect->error : array($connect->error); foreach($error as $err){ $this->log->write($err); } $html = '
'.$this->language->get('error_connect').'
'; } else { //then parse response // get base href and remove it from response preg_match('/\','',$html); // then replace relative url by absolute (css, js, img) $html = str_replace('html->getSecureUrl('tool/extensions_store','&path='.$ohref.(MP_AFFILIATE_ID ? '&aff_id='. MP_AFFILIATE_ID : '')).'"'; if( substr($ohref,0,4)=='http' || substr($ohref,0,1)=='#'){ $html = str_replace($replace, $link1, $html); } else { $html = str_replace($replace, $link2, $html); } } // construct action for search form $action = $this->html->getSecureUrl('tool/extensions_store', (MP_AFFILIATE_ID ? '&aff_id='. MP_AFFILIATE_ID : '')); $html = str_replace(' action="/',' action="'.$action,$html); $hidden = ''; $hidden .= ''; $hidden .= ''; $hidden .= ''; $hidden .= ''; $html = preg_replace('//', $hidden, $html); $html = $this->html->convertLinks( $html ); $html = str_replace('Store ID',' '.UNIQUE_ID.'',$html); } $this->response->setOutput($html); } } ?>