yaebal

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
die();
$arAuthServices = $arPost = array();
if(is_array($arParams["~AUTH_SERVICES"]))
{
$arAuthServices = $arParams["~AUTH_SERVICES"];
}
if(is_array($arParams["~POST"]))
{
$arPost = $arParams["~POST"];
}
$socOnclickPattern = '#onclick="([^"]+)"#Us';
$arOnclicks = array();
foreach($arAuthServices as $key => $service){
$matches = array();
preg_match($socOnclickPattern, $service["FORM_HTML"], $matches);
$onClickStr = $matches[ 1 ];
$arOnclicks[ strtolower($key) ] = str_replace(array('user_birthday,', 'user_birthday'), '', $onClickStr);
}
if(!empty($arOnclicks)){?>
<ul class="form_grid register_social">
<li class="form_row">
<div class="form_cell title_cell">Через социальные сети:</div>
<div class="form_cell">
<div class="social_style type-1">
<span class="b-share">
<?foreach($GLOBALS["arSocAuthServices"] as $service){
$onClickStr = $arOnclicks[ $service ];
if($onClickStr){
?>
<a href="javascript:void(0);" class="b-share__handle" onclick="<?=$onClickStr?>"><span class="b-share-icon b-share-icon_<?=$service?>"></span></a>
<?}?>
<?}?>
</span>
</div>
</div>
</li>
</ul>
<?}
?>