3namespace Bitrix\Seo\Marketing;
6use Bitrix\Seo\Retargeting\AuthAdapter;
27 return Loader::includeModule(
'seo') && Loader::includeModule(
'socialservices');
37 self::$isQueueUsed =
true;
58 return $account->getRegionsList();
69 return static::getServiceProviders($types);
89 self::$errors =
array();
99 return count(self::$errors) > 0;
110 static::getService()->getAuthAdapter(
$type)->removeAuth();
120 if (!static::canUse())
125 return static::getService()->getTypes();
136 $typeList = static::getServiceTypes();
138 $providers =
array();
139 foreach ($typeList as
$type)
141 if ($types && !in_array(
$type, $types))
153 $canUserMultiClients = $authAdapter->canUseMultipleClients();
157 'HAS_AUTH' => $authAdapter->hasAuth(),
158 'AUTH_URL' => $authAdapter->getAuthUrl(),
159 'PROFILE' => $authAdapter->getToken() ? $account->getProfileCached() :
false,
160 'IS_SUPPORT_ACCOUNT' =>
true,
161 'ENGINE_CODE' => $service::getEngineCode(
$type)
163 if ($canUserMultiClients)
165 $providers[
$type][
'CLIENTS'] = static::getClientsProfiles($authAdapter);
166 if (empty($providers[
$type][
'CLIENTS']))
168 $providers[
$type][
'HAS_AUTH'] =
false;
173 if ($providers[
$type][
'HAS_AUTH'] && empty($providers[
$type][
'PROFILE']))
175 static::removeAuth(
$type);
176 if (!$canUserMultiClients)
178 $providers[
$type][
'HAS_AUTH'] =
false;
194 return array_values(array_filter(array_map(
function ($item) use (
$type) {
196 $service->setClientId($item[
'proxy_client_id']);
203 $account->getRequest()->setAuthAdapter($authAdapter);
205 $profile = $account->getProfileCached();
226 if (!static::canUse())
233 $account = static::getService()->getAccount(
$type);
234 $accountsResult = $account->getList();
235 if ($accountsResult->isSuccess())
237 while ($accountData = $accountsResult->fetch())
239 if ($accountData[
'ID'])
243 'id' => $accountData[
'ID'],
244 'name' => $accountData[
'NAME'] ? $accountData[
'NAME'] : $accountData[
'ID'],
245 'currency' => $accountData[
'CURRENCY'],
252 self::$errors = $accountsResult->getErrorMessages();
266 if (!static::canUse())
273 $account = static::getService()->getAccount(
$type);
274 $accountsResult = $account->getInstagramList();
275 if ($accountsResult->isSuccess())
277 while ($accountData = $accountsResult->fetch())
279 if ($accountData[
'ID'])
282 'id' => $accountData[
'ID'],
283 'name' => $accountData[
'NAME'] ? $accountData[
'NAME'] : $accountData[
'ID'],
284 'page_id' => $accountData[
'PAGE_ID'] ? $accountData[
'PAGE_ID'] : $accountData[
'ID'],
285 'actor_id' => $accountData[
'IG_ID']
292 self::$errors = $accountsResult->getErrorMessages();
308 if (!static::canUse())
313 return static::getService()->getPostList(
$type,
$params);
324 if (!static::canUse())
329 return static::getService()->getAudienceList(
$type, $accountId);
340 if (!static::canUse())
345 return static::getService()->getCampaignList(
$type, $accountId);
356 if (!static::canUse())
361 return static::getService()->getAdSetList(
$type, $accountId);
375 if (!static::canUse())
379 return static::getService()->createCampaign(
$type,
$data);
393 if (!static::canUse())
397 return static::getService()->createAudience(
$type,
$data);
409 if (!static::canUse())
413 return static::getService()->getAds(
$type, $adsId);
425 if (!static::canUse())
429 return static::getService()->searchTargetingData(
$type,
$params);
static getClientsProfiles(AuthAdapter $authAdapter)
static getProviders(array $types=null)
static getAdSetList($type, $accountId)
static getInstagramAccounts($type)
static getAccounts($type)
static getAds($type, $adsId)
static createAudience($type, $data)
static getAudiences($type, $accountId)
static createCampaign($type, $data)
static getCampaignList($type, $accountId)
static getPostList($type, $params)
static getServiceProviders(array $types=null)
static searchTargetingData($type, $params)
static getAuthAdapter($type)
setService(IService $service)
getAuthorizedClientsList()
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']