fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`'); $bCompact = getParam('site_login_social_compact') == 'on'; $aTmplButtons = array(); foreach($aAuthTypes as $iKey => $aItems) { $sTitle = _t($aItems['Title']); $aTmplButtons[] = array( 'class' => ($bCompact ? 'sys-auth-compact bx-def-margin-sec-left-auto ' : '') . $aItems['Name'], 'href' => !empty($aItems['Link']) ? BX_DOL_URL_ROOT . $aItems['Link'] : 'javascript:void(0)', 'title_alt' => bx_html_attribute($sTitle), 'bx_if:show_onclick' => array( 'condition' => !empty($aItems['OnClick']), 'content' => array( 'onclick' => 'javascript:' . $aItems['OnClick'] ) ), 'bx_if:show_icon' => array( 'condition' => !empty($aItems['Icon']), 'content' => array( 'icon' => $aItems['Icon'] ) ), 'bx_if:show_title' => array( 'condition' => !$bCompact || empty($aItems['Icon']), 'content' => array( 'title' => $sTitle ) ) ); if ($aItems['Style'] != ""){ $aStyles = unserialize($aItems['Style']); foreach($aStyles as $sKey => $aValues) { BxDolTemplate::getInstance()->addCssStyle('.'. $aItems['Name'] .' ' . $sKey, $aValues); } } } if(empty($aTmplButtons) || !is_array($aTmplButtons)) return ''; $oTemplate = BxDolTemplate::getInstance(); $oTemplate->addCss(array('auth.css')); return $oTemplate->parseHtmlByName('auth.html', array( 'bx_repeat:buttons' => $aTmplButtons, 'class_container' => ($bCompact ? 'sys-auth-compact-container' : '') )); } /** * Display login form without join text * @see ::serviceLoginForm */ public function serviceLoginFormOnly ($sParams = '', $sForceRelocate = '') { if(strpos($sParams, 'no_join_text') === false) $sParams = ($sParams != '' ? ' ' : '') . 'no_join_text'; return $this->serviceLoginForm($sParams, $sForceRelocate); } /** * @page service Service Calls * @section bx_system_general System Services * @subsection bx_system_general-login Login * @subsubsection bx_system_general-login_form login_form * * @code bx_srv('system', 'login_form', ["no_auth_buttons"], 'TemplServiceLogin'); @endcode * @code {{~system:login_form:TemplServiceLogin["no_auth_buttons"]~}} @endcode * * Display login form * @param $sParams optional string with additional params: * - no_join_text * - no_auth_buttons * - ajax_form * @param $sForceRelocate optional URL to redirect to after login * * @see BxBaseServiceLogin::serviceLoginForm */ /** * @ref bx_system_general-login_form "login_form" */ public function serviceLoginForm ($sParams = '', $sForceRelocate = '') { if (isLogged() && 'login' == bx_get('i')) { header('Location: ' . BX_DOL_URL_ROOT); exit; } $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login'); $sCustomHtmlBefore = ''; $sCustomHtmlAfter = ''; bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => &$oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes)); if (isset($oForm->aInputs['relocate'])) { if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) $oForm->aInputs['relocate']['value'] = $sForceRelocate; elseif ('homepage' == $sForceRelocate) $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT; } $sFormCode = $oForm->getCode(); BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js')); $sJoinText = ''; if (strpos($sParams, 'no_join_text') === false) $sJoinText = '