本文整理汇总了PHP中Social::isActive方法的典型用法代码示例。如果您正苦于以下问题:PHP Social::isActive方法的具体用法?PHP Social::isActive怎么用?PHP Social::isActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Social
的用法示例。
在下文中一共展示了Social::isActive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: social_login
public function social_login()
{
$res = '';
$social = new Social();
if (!$social->enabled()) {
// we don't show the box if there is nothing enabled..
return $res;
}
$res .= '<div id="social_login">';
$res .= Form::openForm('social_form', Get::rel_path('lms') . '/index.php?modname=login&op=social') . '<span>' . Lang::t('_LOGIN_WITH', 'login') . ' </span>';
if ($social->isActive('facebook')) {
$res .= '<a href="index.php?modname=login&op=facebook_login">' . Get::img('social/facebook-24.png') . '</a>';
}
if ($social->isActive('twitter')) {
$res .= '<a href="index.php?modname=login&op=twitter_login">' . Get::img('social/twitter-24.png') . '</a>';
}
if ($social->isActive('linkedin')) {
$res .= '<a href="index.php?modname=login&op=linkedin_login">' . Get::img('social/linkedin-24.png') . '</a>';
}
if ($social->isActive('google')) {
$res .= '<a href="index.php?modname=login&op=google_login">' . Get::img('social/google-24.png') . '</a>';
}
$res .= Form::closeForm();
$res .= '</div>';
return $res;
}
示例2: homeUserProfile
function homeUserProfile($picture = false, $viewer = false, $intest = false)
{
$this->loadUserData($this->getViewer());
$acl_man =& Docebo::user()->getAclManager();
list($class_picture, $this->max_dim_avatar) = $this->getPhotoLimit($picture);
$html = '<div class="up_dashboard"><div class="content">';
$html .= '<p class="logo">' . ($this->user_info[ACL_INFO_AVATAR] != "" ? $this->getPASrc($this->user_info[ACL_INFO_AVATAR], $this->_lang->def('_AVATAR'), 'boxed') : '<img class="boxed" src="' . getPathImage() . 'standard/user.png" alt="' . $this->_lang->def('_NOAVATAR') . '" />') . '</p>';
$html .= '' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_USERNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_LASTNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_LASTNAME]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_FIRSTNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_FIRSTNAME]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_EMAIL') . '</b><br/> ' . ($this->user_info[ACL_INFO_EMAIL] !== false ? '<a href="mailto:' . $this->user_info[ACL_INFO_EMAIL] . '">' . $this->user_info[ACL_INFO_EMAIL] . '</a>' : $this->_lang->def('_HIDDEN')) . '</p>' . '<div class="nofloat"></div>';
$social = new Social();
if ($social->enabled()) {
if (!$social->allConnected()) {
$html .= '<b class="social-accounts-title">' . Lang::t('_CONNECT_YOUR_ACCOUNT_WITH', 'social') . '</b>';
$html .= '<ul class="social-accounts">';
if ($social->isActive('facebook') && !$social->connectedToUser('facebook')) {
$social = new Social();
$social->includeFacebookLib();
$client_id = Get::sett('social_fb_api');
$client_secret = Get::sett('social_fb_secret');
$redirect_uri = Get::sett('url') . 'index.php?modname=login&op=facebook_login';
$serviceFactory = new \OAuth\ServiceFactory();
$storage = new Session();
$credentials = new Credentials($client_id, $client_secret, $redirect_uri);
$facebookService = $serviceFactory->createService('facebook', $credentials, $storage, array());
//, 'userinfo_profile'
$loginUrl = $facebookService->getAuthorizationUri();
$html .= '<li><a href="' . $loginUrl . '" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_FACEBOOK', 'social') . '"><span>' . Get::img('social/facebook.png', Lang::t('_FACEBOOK', 'social')) . '</span></a></li>';
}
if ($social->isActive('twitter') && !$social->connectedToUser('twitter')) {
$html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&op=twitter_login&connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_TWITTER', 'social') . '"><span>' . Get::img('social/twitter.png', Lang::t('_TWITTER', 'social')) . '</span></a></li>';
}
if ($social->isActive('linkedin') && !$social->connectedToUser('linkedin')) {
$html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&op=linkedin_login&connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_LINKEDIN', 'social') . '"><span>' . Get::img('social/linkedin.png', Lang::t('_LINKEDIN', 'social')) . '</span></a></li>';
}
if ($social->isActive('google') && !$social->connectedToUser('google')) {
$html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&op=google_login&connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_GOOGLE', 'social') . '"><span>' . Get::img('social/google.png', $this->user_info[ACL_INFO_GOOGLE_ID]) . '</span></a></li>';
}
$html .= '</ul><br/>';
}
if ($social->someConnected()) {
$html .= '<b class="social-accounts-title">' . Lang::t('_CONNECTED_ACCOUNTS', 'social') . '</b>';
$html .= '<ul class="social-accounts">';
if ($social->connectedToUser('facebook')) {
$html .= '<li><a id="disconnect_facebook" href="index.php?r=SocialConnect/disconnect&network=facebook" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_FACEBOOK', 'social') . '"><span>' . Get::img('social/facebook.png', Lang::t('_FACEBOOK', 'social')) . '</span></a></li>';
}
if ($social->connectedToUser('twitter')) {
$html .= '<li><a id="disconnect_twitter" href="index.php?r=SocialConnect/disconnect&network=twitter" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_TWITTER', 'social') . '"><span>' . Get::img('social/twitter.png', Lang::t('_TWITTER', 'social')) . '</span></a></li>';
}
if ($social->connectedToUser('linkedin')) {
$html .= '<li><a id="disconnect_linkedin" href="index.php?r=SocialConnect/disconnect&network=linkedin" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_LINKEDIN', 'social') . '"><span>' . Get::img('social/linkedin.png', Lang::t('_LINKEDIN', 'social')) . '</span></a></li>';
}
if ($social->connectedToUser('google')) {
$html .= '<li><a id="disconnect_google" href="index.php?r=SocialConnect/disconnect&network=google" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_GOOGLE', 'social') . '"><span>' . Get::img('social/google.png', $this->user_info[ACL_INFO_GOOGLE_ID]) . '</span></a></li>';
}
$html .= '</ul>';
}
/* $html.=Util::widget('dialog', array(
'id' => 'confirm_disconnect',
'dynamicContent' => false,
'body'=>'mm',
'directSubmit'=>true,
'ajaxUrl' => '"ajax.adm_server.php?r=alms/enrollrules/add"',
'dynamicAjaxUrl' => true,
'callback' => 'function() {
this.destroy();
}',
'callEvents' => array(
array('caller' => 'disconnect_facebook', 'event' => 'click'),
array('caller' => 'disconnect_twitter', 'event' => 'click'),
array('caller' => 'disconnect_linkedin', 'event' => 'click'),
array('caller' => 'disconnect_google', 'event' => 'click'),
)
), true); */
}
$html .= '</div></div>';
// box carriera
require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php';
require_once $GLOBALS['where_lms'] . '/modules/course/course.php';
$ma = new Man_MiddleArea();
$access_career = $ma->currentCanAccessObj('career');
//if($this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) == 'alberto' && $access_career) {
if ($access_career) {
$url = $this->_url_man;
$course_stats = userCourseList($url, false, false);
//TODO: review this call . use course list to compute carreer
$base_url = 'index.php?r=' . _after_login_ . '&filter=';
$end = 0;
if (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0) {
$end = $course_stats['with_ustatus'][_CUS_END];
}
$html .= '<div class="inline_block">' . '<h2 class="heading">' . $this->_lang->def('_CAREER') . '</h2>' . '<div class="content">' . '<div class="course_stat">' . '<table summary="">' . '<tr><th scope="row">' . $this->_lang->def('_TOTAL_COURSE') . ' :</th><td>' . ($course_stats['total'] - $end) . '</td></tr>' . (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0 ? '<tr><th scope="row">' . $this->_lang->def('_COURSE_END') . ' :</th><td>' . $course_stats['with_ustatus'][_CUS_END] . '</td></tr>' : '') . (isset($course_stats['expiring']) && $course_stats['expiring'] != 0 ? '<tr><th scope="row">' . $this->_lang->def('_COURSE_EXPIRING') . ' :</th><td>' . $course_stats['expiring'] . '</td></tr>' : '');
if (count($course_stats['with_ulevel']) > 1) {
require_once $GLOBALS['where_lms'] . '/lib/lib.levels.php';
$lvl = CourseLevel::getLevels();
foreach ($course_stats['with_ulevel'] as $lvl_num => $quantity) {
$html .= '' . '<tr><th scope="row">' . str_replace('[level]', $lvl[$lvl_num], $this->_lang->def('_COURSE_AS')) . ' :</th><td>' . $quantity . '</td></tr>';
}
//end foreach
}
$query = "SELECT c.idMetaCertificate, m.idCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as c" . " JOIN " . $GLOBALS['prefix_lms'] . "_certificate_meta as m ON c.idMetaCertificate = m.idMetaCertificate" . " WHERE c.idUser = '" . getLogUserId() . "'" . " GROUP BY c.idMetaCertificate" . " ORDER BY m.title, m.description";
$result = sql_query($query);
//.........这里部分代码省略.........
示例3: Social
function _first_of_all($options, $platform)
{
$social = new Social();
$lang =& DoceboLanguage::createInstance('register', $platform);
$out = '';
if ($options['use_advanced_form'] == 'off') {
$out .= Form::getHidden('next_step', 'next_step', 'opt_in');
} else {
$out .= Form::getHidden('next_step', 'next_step', 'special_field');
}
$mand_sym = '<span class="mandatory">*</span>';
$out .= '<div class="reg_note">' . $lang->def('_REG_NOTE') . '</div>' . '<ul class="reg_instruction">' . '<li>' . str_replace('[mandatory]', $mand_sym, $lang->def('_REG_MANDATORY')) . '</li>';
if ($options['pass_min_char']) {
$out .= '<li>' . str_replace('[min_char]', $options['pass_min_char'], $lang->def('_REG_PASS_MIN_CHAR')) . '</li>';
}
if ($options['pass_alfanumeric'] == 'on') {
$out .= '<li>' . $lang->def('_REG_PASS_MUST_BE_ALPNUM') . '</li>';
}
//$out .= '<li>'.str_replace('[hour]', $options['hour_request_limit'], $lang->def('_REG_HOUR_REQUEST_LIMIT')).'</li>';
if ($options['privacy_policy'] == 'on') {
$out .= '<li>' . $lang->def('_REG_REMEMBER_PRIVACY') . '</li>';
}
$extra = '';
// facebook register:
if ($social->isActive('facebook')) {
require_once _lms_ . "/modules/login/facebook.php";
if (isset($_SESSION['fb_info']) && is_array($_SESSION['fb_info']) && !isset($_POST['register'])) {
setFbRegData($_SESSION['fb_info']);
$out .= '<li>' . $lang->def('_ACCOUNT_WILL_BE_CONNECTED_FB', 'login', 'cms') . '</li>';
} else {
$extra = getFbRegisterBox();
}
}
// ----
$out .= '</ul>' . $extra . Form::openElementSpace('reg_form');
$out .= Form::getTextfield($lang->def('_USERNAME') . ' ' . $mand_sym, 'register_userid', 'register[userid]', 255, isset($_POST['register']['userid']) ? stripslashes($_POST['register']['userid']) : '') . Form::getTextfield($lang->def('_EMAIL') . ' ' . $mand_sym, 'register_email', 'register[email]', 255, isset($_POST['register']['email']) ? stripslashes($_POST['register']['email']) : '') . Form::getTextfield($lang->def('_FIRSTNAME') . ($options['lastfirst_mandatory'] == 'on' ? ' ' . $mand_sym : ''), 'register_firstname', 'register[firstname]', 255, isset($_POST['register']['firstname']) ? stripslashes($_POST['register']['firstname']) : '') . Form::getTextfield($lang->def('_LASTNAME') . ($options['lastfirst_mandatory'] == 'on' ? ' ' . $mand_sym : ''), 'register_lastname', 'register[lastname]', 255, isset($_POST['register']['lastname']) ? stripslashes($_POST['register']['lastname']) : '');
if ($options['use_advanced_form'] == 'off') {
$extra_field = new FieldList();
$out .= $extra_field->playFieldsForUser(0, false, false);
}
$lang_sel = getLanguage();
$full_langs = array();
$langs = Docebo::langManager()->getAllLangCode();
$full_langs = array();
foreach ($langs as $v) {
$full_langs[$v] = $v;
}
$out .= Form::getHidden('sop', 'sop', 'changelang');
$out .= Form::getDropdown($lang->def('_LANGUAGE'), 'new_lang', 'new_lang', $full_langs, $lang_sel, '', '', ' onchange="submit();"');
$out .= Form::getPassword($lang->def('_PASSWORD') . ' ' . $mand_sym, 'register_pwd', 'register[pwd]', 255, $lang->def('_PASSWORD')) . Form::getPassword($lang->def('_RETYPE_PASSWORD') . ' ' . $mand_sym, 'register_pwd_retype', 'register[pwd_retype]', 255, $lang->def('_RETYPE_PASSWORD'));
$registration_code_type = Get::sett('registration_code_type', '0');
$code_is_mandatory = Get::sett('mandatory_code', 'off');
switch ($registration_code_type) {
case "0":
//nothin to do
break;
case "tree_course":
case "code_module":
case "tree_man":
// we must ask the user to insert a manual code
$out .= Form::getTextfield($lang->def('_CODE') . ($code_is_mandatory ? ' ' . $mand_sym : ''), 'reg_code', 'reg_code', 24, Get::req('reg_code', DOTY_MIXED, ''));
break;
case "tree_drop":
// we must show to the user a selection of code
$uma = new UsermanagementAdm();
$tree_names = $uma->getAllFolderNames(true);
$out .= Form::getDropdown($lang->def('_CODE') . ($code_is_mandatory ? ' ' . $mand_sym : ''), 'reg_code', 'reg_code', $tree_names, Get::req('reg_code', DOTY_MIXED, ''));
break;
}
$out .= '<div class="reg_title_privacy">' . $lang->def('_REG_PRIVACY_POLICY_TILTE') . '</div>' . '<div class="privacy_box">' . $lang->def('_REG_PRIVACY_POLICY') . '</div>';
if ($options['privacy_policy'] == 'on') {
$out .= Form::getCheckbox($lang->def('_REG_PRIVACY_ACCEPT'), 'register_privacy', 'register[privacy]', 'ok', isset($_POST['register']['privacy']));
}
if ($options['use_advanced_form'] == 'on') {
$acl_man =& Docebo::user()->getAclManager();
$groups =& $acl_man->getAllGroupsId(array('free', 'moderate'));
if (!empty($groups)) {
$tb = new Table(0, $lang->def('_SELECT_GROUP'), $lang->def('_SELECT_GROUP_SUMMARY'));
$type_h = array('image', 'nowrap', '');
$cont_h = array('<span class="access-only">' . $lang->def('_SUBSCRIBE') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($id, $info) = each($groups)) {
$cont = array(Form::getInputCheckbox('group_sel_' . $id, 'group_sel[]', $id, isset($_POST['group_sel'][$id]), ''), '<label for="group_sel_' . $id . '">' . $info['type_ico'] . ' ' . $info['groupid'] . '</label>', $info['description']);
$tb->addBody($cont);
}
$out .= $tb->getTable();
}
}
$out .= Form::closeElementSpace() . Form::openButtonSpace('reg_form_button') . Form::getButton('reg_button', 'reg_button', $lang->def('_REGISTER')) . Form::closeButtonSpace();
return $out;
}