<?php if (!Users\Social::getList(['where' => ['active', 1]])) { return false; } return ['name' => 'Социальные сети', 'fullWidget' => 'Users\\cabinet/socials'];
<?php $socials = Users\Social::getList(['where' => ['active', 1]]); foreach ($socials as $social) { $connect = false; foreach (Users\User::$cur->socials as $userSocial) { if ($userSocial->social_id == $social->id) { $connect = true; break; } } if ($connect) { echo "<a href = '/users/social/disconnect/{$social->code}'>Отключить {$social->name}</a><br />"; } else { echo "<a href = '/users/social/auth/{$social->code}'>Подключить {$social->name}</a><br />"; } }
<div class="users"> <div class="content"> <div class='row'> <div class = 'box col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1'> <h3>Регистрация</h3> <?php $socials = Users\Social::getList(['where' => ['active', 1]]); if ($socials) { ?> <div class="form-group"> <label>Регистрация через соц.сети</label><br /> <?php foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { echo "<a href = '/users/social/auth/{$social->code}'>{$social->name()}</a> "; } ?> </div> <?php } ?> <?php $form = new Ui\Form(); ?> <form action = '' method = 'POST' enctype="multipart/form-data" > <div class ='row'> <div class="col-sm-6"> <?php $form->input('email', 'user_mail', 'Электронная почта', ['required' => true]); ?> <?php $form->input('text', 'user_name', 'Ваше имя (не фио)');