コード例 #1
0
ファイル: widgetsettings.php プロジェクト: q0821/esportshop
 protected function getInput()
 {
     $html = '';
     if ($this->form->getValue('params.provider_type') && $this->form->getValue('params.widget_type') != 'widget') {
         SCStringUtilities::loadLanguage('com_jfbconnect', JPATH_ADMINISTRATOR);
         JForm::addFieldPath(JPATH_ROOT . '/components/com_jfbconnect/libraries/provider/' . $this->form->getValue('params.provider_type') . '/widget');
         $xmlFile = JPATH_ROOT . '/components/com_jfbconnect/libraries/provider/' . $this->form->getValue('params.provider_type') . '/widget/' . $this->form->getValue('params.widget_type') . '.xml';
         if (JFile::exists($xmlFile)) {
             $options = array('control' => 'jform');
             $form = JForm::getInstance('com_jfbconnect_' . $this->form->getValue('params.widget_type'), $xmlFile, $options);
             $registry = $this->form->getValue('params');
             $settings = new JRegistry();
             $settings->set('params.widget_settings', $registry->widget_settings);
             $form->bind($settings);
             ob_start();
             foreach ($form->getFieldsets() as $fieldsets => $fieldset) {
                 foreach ($form->getFieldset($fieldset->name) as $field) {
                     $this->formShowField($field);
                 }
             }
             $html = ob_get_clean();
         }
     }
     return '<div id="widget_settings">' . $html . '</div>';
 }
コード例 #2
0
ファイル: buttonstype.php プロジェクト: q0821/esportshop
 public function getOptions()
 {
     SCStringUtilities::loadLanguage('com_jfbconnect', JPATH_ADMINISTRATOR);
     $options = array();
     $options[] = JHtml::_('select.option', 'default', JText::_('COM_JFBCONNECT_SOCIAL_LOGIN_BUTTON_TYPE_DEFAULT'), 'value', 'text');
     $options[] = JHtml::_('select.option', 'custom', JText::_('COM_JFBCONNECT_SOCIAL_LOGIN_BUTTON_TYPE_CUSTOM'), 'value', 'text');
     return $options;
 }
コード例 #3
0
ファイル: commentscount.php プロジェクト: q0821/esportshop
 protected function getTagHtml()
 {
     //Get the Comments Count string
     $tagString = '<div class="fb-comments-count"';
     $tagString .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-href');
     $tagString .= '></div>';
     SCStringUtilities::loadLanguage('com_jfbconnect');
     $tag = JText::sprintf('COM_JFBCONNECT_COMMENTS_COUNT', $tagString);
     return $tag;
 }
コード例 #4
0
ファイル: socialbuttons.php プロジェクト: q0821/esportshop
 protected function getInput()
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_jfbconnect/models/fields/providerloginbutton.php';
     $html = array();
     $data = $this->form->getValue($this->fieldname, $this->group, null);
     // Support for SCLogin module
     $loginbuttonstype = $this->form->getValue('loginbuttonstype', 'params', null);
     if (!$loginbuttonstype) {
         // Support for SCSocialWidget module
         $loginbuttonstype = $this->form->getValue('loginbuttonstype', 'params.widget_settings', 'default');
     }
     if ($loginbuttonstype == 'default') {
         $noticeStyle = 'style="display:block"';
         $buttonStyle = "display:none";
     } else {
         $noticeStyle = 'style="display:none"';
         $buttonStyle = "display:block";
     }
     jimport('sourcecoast.utilities');
     SCStringUtilities::loadLanguage('com_jfbconnect', JPATH_ADMINISTRATOR);
     $html[] = '<div class="fieldsocialbuttons">';
     JFactory::getDocument()->addStyleDeclaration('.fieldsocialbuttons label { display: inline; float:left; }
         .fieldsocialbuttons input[type="radio"] { margin: 0 8px; }
         label.providername { width:60px; }');
     $html[] = '<div style="clear:both"> </div>';
     $html[] = '<fieldset id="loginbutton_custom_notice" ' . $noticeStyle . '>' . JText::_('COM_JFBCONNECT_LOGIN_BUTTON_CUSTOM_INSTRUCTIONS') . '</fieldset>';
     $providerFound = false;
     foreach (JFBCFactory::getAllProviders() as $p) {
         if ($p->appId) {
             $providerFound = true;
             $value = is_array($data) && array_key_exists($p->systemName, $data) ? $data[$p->systemName] : 'icon_label.png';
             $field = '<field type="providerloginbutton"
                 label="Default Login Button"
                 provider="' . $p->systemName . '"
                             name="' . $p->systemName . '"
                             required="true"
                             style="' . $buttonStyle . '"
                             />';
             $element = new SimpleXMLElement($field);
             $node = new JFormFieldProviderloginbutton($this->form);
             $node->setup($element, $value, $this->group . '.' . $this->fieldname);
             $html[] = $node->getInput();
         }
     }
     if (!$providerFound) {
         $html[] = '<label>No social networks are enabled. Please use the JFBConnect configuration area to set your App IDs and Secret Keys</label>';
     }
     $html[] = '</div>';
     return implode($html);
 }
コード例 #5
0
ファイル: adminHelper.php プロジェクト: q0821/esportshop
 static function getAutotuneControlIconText()
 {
     SCStringUtilities::loadLanguage('com_jfbconnect');
     $autotuneModel = JModelLegacy::getInstance('AutoTune', 'JFBConnectModel');
     $upToDate = $autotuneModel->isUpToDate();
     if ($upToDate) {
         return JText::_('COM_JFBCONNECT_BUTTON_AUTOTUNE');
     } else {
         if (defined('SC16')) {
             return '<span>' . JText::_('COM_JFBCONNECT_BUTTON_AUTOTUNE_RECOMMENDED') . '<br/><span class="update-badge">!</span></span>';
         }
         //SC16
         if (defined('SC30')) {
             return '<span style="color:blue"><strong>' . JText::_('COM_JFBCONNECT_BUTTON_AUTOTUNE_RECOMMENDED') . '</strong></span>';
         }
         //SC30
     }
 }
コード例 #6
0
ファイル: view.html.php プロジェクト: q0821/esportshop
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     JPluginHelper::importPlugin('socialprofiles');
     $profilePlugins = $app->triggerEvent('socialProfilesGetPlugins');
     $this->assignRef('profilePlugins', $profilePlugins);
     foreach ($profilePlugins as $p) {
         $options = array();
         $options['control'] = "profiles_" . $p->getName();
         SCStringUtilities::loadLanguage('plg_socialprofiles_' . $p->getName(), JPATH_ADMINISTRATOR);
         $path = JPATH_SITE . '/plugins/socialprofiles/' . $p->getName();
         JForm::addFieldPath($path . '/fields/');
         $this->formLoad($p->getName(), $path . '/forms/config.xml', $options);
         $data = JFBCFactory::config()->get('profile_' . $p->getName());
         $reg = new JRegistry();
         $reg->loadString($data);
         $this->formBind($p->getName(), $reg);
     }
     parent::display($tpl);
 }
コード例 #7
0
ファイル: ajax.php プロジェクト: q0821/esportshop
 function scsocialwidget()
 {
     $input = JFactory::getApplication()->input;
     $provider = $input->get('provider');
     $widget = $input->get('name');
     // load the name form.xml file here
     SCStringUtilities::loadLanguage('com_jfbconnect', JPATH_ADMINISTRATOR);
     JForm::addFieldPath(JPATH_ROOT . '/components/com_jfbconnect/libraries/provider/' . $provider . '/widget');
     $xmlFile = JPATH_ROOT . '/components/com_jfbconnect/libraries/provider/' . $provider . '/widget/' . $widget . '.xml';
     if (JFile::exists($xmlFile)) {
         $options = array('control' => 'jform');
         $form = JForm::getInstance('com_jfbconnect_' . $widget, $xmlFile, $options);
         $registry = $this->getModuleSettings($input->getInt('id'));
         $form->bind($registry);
         foreach ($form->getFieldsets() as $fiedsets => $fieldset) {
             foreach ($form->getFieldset($fieldset->name) as $field) {
                 $this->formShowField($field);
             }
         }
     }
     exit;
 }
コード例 #8
0
 * @version         Release v6.4.2
 * @build-date      2015/08/24
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
if (!JFile::exists(JPATH_ROOT . '/components/com_jfbconnect/libraries/provider.php')) {
    echo "JFBConnect not found. Please reinstall.";
    return;
}
if (!class_exists('JFBCFactory')) {
    echo "JFBConnect not enabled. Please enable.";
    return;
}
jimport('sourcecoast.utilities');
SCStringUtilities::loadLanguage('com_jfbconnect');
$channels = $params->get('channel_id');
if (!is_array($channels)) {
    $channels = explode(',', $channels);
}
$options = new JRegistry();
$options->set('show_provider', $params->get('show_provider'));
$options->set('show_date', $params->get('show_date'));
$options->set('show_link', $params->get('show_link'));
$options->set('show_post', $params->get('show_post'));
$options->set('show_comments', $params->get('show_comments'));
$options->set('post_limit', $params->get('post_limit'));
$options->set('datetime_format', $params->get('datetime_format'));
//$options->set('datetime_format', JText::_('DATE_FORMAT_LC2'));
$stream = new JFBConnectStream($options, $channels);
$height = $params->get('height');
コード例 #9
0
ファイル: loginregister.php プロジェクト: q0821/esportshop
 private function sendNewUserEmails(&$user, $providerName)
 {
     $app = JFactory::getApplication();
     $sendEmail = true;
     $profileEmails = $app->triggerEvent('socialProfilesSendsNewUserEmails');
     foreach ($profileEmails as $pe) {
         if ($pe) {
             $sendEmail = false;
         }
     }
     if (!$sendEmail) {
         return;
     }
     $useractivation = $this->getActivationMode();
     $newEmail = $user->get('email');
     if (SCStringUtilities::endswith($newEmail, "@unknown.com")) {
         return;
     }
     // Compile the notification mail values.
     $config = JFactory::getConfig();
     $params = JComponentHelper::getParams('com_users');
     $language = JFactory::getLanguage();
     $language->load('com_users');
     SCStringUtilities::loadLanguage('com_jfbconnect');
     $data = $user->getProperties();
     $data['fromname'] = $config->get('fromname');
     $data['mailfrom'] = $config->get('mailfrom');
     $data['sitename'] = $config->get('sitename');
     $data['siteurl'] = JUri::base();
     $uri = JURI::getInstance();
     $base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
     $data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
     if (JFBCFactory::config()->get('registration_send_new_user_email') || $useractivation > 0) {
         $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
         // Handle account activation/confirmation emails.
         if ($useractivation == 2) {
             // Set the link to confirm the user email.
             if ($this->_newUserPassword == '') {
                 $emailBody = JText::sprintf('COM_JFBCONNECT_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPASSWORD', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $providerName);
             } else {
                 $emailBody = JText::sprintf('COM_JFBCONNECT_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $providerName, $data['username'], $this->_newUserPassword);
             }
         } else {
             if ($useractivation == 1) {
                 // Set the link to activate the user account.
                 if ($this->_newUserPassword == '') {
                     $emailBody = JText::sprintf('COM_JFBCONNECT_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPASSWORD', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $providerName);
                 } else {
                     $emailBody = JText::sprintf('COM_JFBCONNECT_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $providerName, $data['username'], $this->_newUserPassword);
                 }
             } else {
                 $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
                 if ($this->_newUserPassword == '') {
                     $emailBody = JText::sprintf('COM_JFBCONNECT_EMAIL_REGISTERED_BODY_NOPASSWORD', $data['name'], $data['sitename'], $data['siteurl'], $providerName);
                 } else {
                     $emailBody = JText::sprintf('COM_JFBCONNECT_EMAIL_REGISTERED_BODY', $data['name'], $data['sitename'], $data['siteurl'], $providerName, $data['username'], $this->_newUserPassword);
                 }
             }
         }
         // Send the registration email.
         $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);
     } else {
         $return = true;
     }
     if ($useractivation < 2 && $params->get('mail_to_admin') == 1) {
         $emailSubject = JText::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
         $emailBodyAdmin = JText::sprintf('COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY', $data['name'], $data['username'], $data['siteurl']);
         // get all admin users
         $query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE sendEmail=1';
         $db = JFactory::getDBO();
         $db->setQuery($query);
         $rows = $db->loadObjectList();
         // Send mail to all superadministrators id
         foreach ($rows as $row) {
             $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBodyAdmin);
             // Check for an error.
             if ($return !== true) {
                 $this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED'));
                 return false;
             }
         }
     }
     // Check for an error.
     if ($return !== true) {
         $this->setError(JText::_('COM_USERS_REGISTRATION_SEND_MAIL_FAILED'));
         // Send a system message to administrators receiving system mails
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->clear()->select($db->quoteName('id'))->from($db->quoteName('#__users'))->where($db->quoteName('block') . ' = ' . (int) 0)->where($db->quoteName('sendEmail') . ' = ' . (int) 1);
         $db->setQuery($query);
         try {
             $sendEmail = $db->loadColumn();
         } catch (RuntimeException $e) {
             $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
             return false;
         }
         if (count($sendEmail) > 0) {
             $jdate = new JDate();
             // Build the query to add the messages
             foreach ($sendEmail as $userid) {
                 $values = array($db->quote($userid), $db->quote($userid), $db->quote($jdate->toSql()), $db->quote(JText::_('COM_USERS_MAIL_SEND_FAILURE_SUBJECT')), $db->quote(JText::sprintf('COM_USERS_MAIL_SEND_FAILURE_BODY', $return, $data['username'])));
                 $query->clear()->insert($db->quoteName('#__messages'))->columns($db->quoteName(array('user_id_from', 'user_id_to', 'date_time', 'subject', 'message')))->values(implode(',', $values));
                 $db->setQuery($query);
                 try {
                     $db->execute();
                 } catch (RuntimeException $e) {
                     $this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
                     return false;
                 }
             }
         }
         return false;
     }
 }
コード例 #10
0
ファイル: jfbcsystem.php プロジェクト: q0821/esportshop
 public function onAfterDispatch()
 {
     $app = JFactory::getApplication();
     if (!$app->isAdmin()) {
         $providers = JFBCFactory::getAllProviders();
         foreach ($providers as $provider) {
             $provider->onAfterDispatch();
         }
         foreach ($this->metadataTagsToStrip as $metadataTag) {
             $this->replaceTagInMetadata($metadataTag);
         }
         $doc = JFactory::getDocument();
         if (JFBCFactory::config()->get('bootstrap_css')) {
             $doc->addStyleSheet(JURI::base(true) . '/media/sourcecoast/css/sc_bootstrap.css');
         }
         $doc->addStyleSheet(JURI::base(true) . '/media/sourcecoast/css/common.css');
         if ($doc->getType() == 'html') {
             $doc->addCustomTag('<SourceCoastProviderJSPlaceholder />');
             $doc->addCustomTag('<SourceCoastCSSPlaceholder />');
             if (JFBCFactory::config()->getSetting('jquery_load')) {
                 $doc->addScript(JURI::base(true) . '/media/sourcecoast/js/jq-bootstrap-1.8.3.js');
             }
         }
         //Add Login with FB button to com_users login view and mod_login
         $showLoginWithJoomla = JFBCFactory::config()->getSetting('show_login_with_joomla_reg');
         if ($showLoginWithJoomla != SC_VIEW_NONE) {
             SCStringUtilities::loadLanguage('com_jfbconnect');
             if (SCEasyTags::canExtendJoomlaForm("login", false, $showLoginWithJoomla)) {
                 $login = JFBCFactory::cache()->get('system.joomlaform.login');
                 if ($login === false) {
                     $login = JFBCFactory::provider('facebook')->getLoginButton(JText::_('COM_JFBCONNECT_LOGIN_WITH'));
                     JFBCFactory::cache()->store($login, 'system.joomlaform.login');
                 }
                 SCEasyTags::extendJoomlaUserForms($login, $showLoginWithJoomla);
             }
             if (SCEasyTags::canExtendJoomlaForm('registration', false, $showLoginWithJoomla)) {
                 $registration = JFBCFactory::cache()->get('system.joomlaform.registration');
                 if ($registration === false) {
                     $registration = JFBCFactory::provider('facebook')->getLoginButton(JText::_('COM_JFBCONNECT_REGISTER_WITH'));
                     JFBCFactory::cache()->store($registration, 'system.joomlaform.registration');
                 }
                 SCEasyTags::extendJoomlaUserForms($registration, $showLoginWithJoomla);
             }
         }
         // Add the Open Graph links to the user edit form.
         if ($this->showOpenGraphProfileLinks() && JFBCFactory::provider('facebook')->userIsConnected() && SCEasyTags::canExtendJoomlaForm('profile', true, SC_VIEW_BOTTOM)) {
             SCStringUtilities::loadLanguage('com_jfbconnect');
             $htmlTag = '<a href="' . JRoute::_('index.php?option=com_jfbconnect&view=opengraph&layout=activity') . '">' . JText::_('COM_JFBCONNECT_TIMELINE_ACTIVITY_LINK') . '</a>';
             $htmlTag .= '<br/><a href="' . JRoute::_('index.php?option=com_jfbconnect&view=opengraph&layout=settings') . '">' . JText::_('COM_JFBCONNECT_TIMELINE_CHANGESETTINGS') . '</a>';
             SCEasyTags::extendJoomlaUserForms($htmlTag, SC_VIEW_BOTTOM);
         }
         JPluginHelper::importPlugin('opengraph');
         $app->triggerEvent('onOpenGraphAfterDispatch');
         // Finally, load the Toolbar classes
         JFBCFactory::library('toolbar')->onAfterDispatch();
     }
 }
コード例 #11
0
ファイル: opengraphaction.php プロジェクト: q0821/esportshop
 function triggerAction($action, $url, $params = null, $uniqueKey = null)
 {
     if (!$params) {
         $params = array();
     }
     $return = new stdClass();
     $return->status = false;
     $return->message = "";
     SCStringUtilities::loadLanguage('com_jfbconnect');
     if (JFBCFactory::provider('facebook')->userIsConnected() && $action->enabledForUser()) {
         // Find the object definition for the passed in URL
         $app = JFactory::getApplication();
         JPluginHelper::importPlugin('opengraph');
         $pluginArgs = array($url);
         $objects = $app->triggerEvent('onOpenGraphFindObjectType', $pluginArgs);
         // Remove all null elements and get the first real object returned
         $objects = array_filter($objects);
         $object = array_shift($objects);
         if ($object && $action->isAssociatedTo($object)) {
             if (!$uniqueKey) {
                 $uniqueKey = $this->getUniqueKey($url);
             }
             if ($action->actionReady($uniqueKey)) {
                 // Always include the 'object' argument as some actions want the generic, others want the specific.
                 if (array_key_exists('explicitly_shared', $params)) {
                     if ($params['explicitly_shared'] == 'true') {
                         $params['fb:explicitly_shared'] = 'true';
                     }
                     unset($params['explicitly_shared']);
                 }
                 $args = $params;
                 $args['object'] = $url;
                 $args[strtolower($object->type)] = $url;
                 $actionPath = $action->getActionPath();
                 $response = JFBCFactory::provider('facebook')->api('/me/' . $actionPath, $args);
                 //$response['id'] = '12345';
                 $error = JFBCFactory::provider('facebook')->getLastError();
                 //$error = "";
                 if ($error) {
                     $return->status = false;
                     // Error / not posted
                     $return->response = $error;
                 } else {
                     $return->status = true;
                     // Posted, response is the action ID
                     $return->response = $response['id'];
                 }
                 $activityId = $this->storeActivity($action, $object, $uniqueKey, $url, $return->status, $return->response);
                 // Setup the return message, used for AJAX calls
                 if ($error) {
                     $return->message = $error;
                 } else {
                     $return->message = '<span class="ogMessage">' . JText::_("COM_JFBCONNECT_OPENGRAPH_ACTION_ADDED") . '</span>' . '<span class="ogOptions">' . '<a href="' . JRoute::_('index.php?option=com_jfbconnect&task=opengraph.undoAndDisableAction&action=' . $action->id . '&activity=' . $activityId . '&' . JSession::getFormToken() . '=1') . '" target="_blank">' . JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_DELETE_AND_DISABLE') . '</a>' . ' | <a href="' . JRoute::_('index.php?option=com_jfbconnect&view=opengraph') . '" target="_blank">' . JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_SEE_ALL') . '</a>' . '</span>';
                 }
             } else {
                 $return->message = JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_NOT_READY');
             }
         } else {
             $return->message = JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_NOT_ASSOCIATED');
         }
     } else {
         $return->message = JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_NOT_ENABLED');
     }
     return $return;
 }
コード例 #12
0
ファイル: facebook.php プロジェクト: q0821/esportshop
    public function onAfterRender()
    {
        $body = JResponse::getBody();
        // Add FB built-in and custom OG tag for namespace, if applicable
        $ogNamespaces = 'og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#';
        $appConfig = JFBCFactory::config()->get('autotune_app_config', array());
        if (array_key_exists('namespace', $appConfig)) {
            $appNamespace = $appConfig['namespace'];
            if ($appNamespace != '') {
                $ogNamespaces .= " " . $appNamespace . ': http://ogp.me/ns/fb/' . $appNamespace . '#';
            }
        }
        $body = str_ireplace("<html ", '<html prefix="' . $ogNamespaces . '" ', $body);
        // Should the modal popup be displayed?
        $showLoginModal = JFBCFactory::config()->get('facebook_login_show_modal');
        if ($showLoginModal) {
            jimport('sourcecoast.utilities');
            SCStringUtilities::loadLanguage('com_jfbconnect');
            $loginModalDiv = '<div id="jfbcLoginModal" class="sourcecoast modal" style="display:none"><div class="modal-body">' . JText::_('COM_JFBCONNECT_LOGIN_POPUP') . '</div></div>';
        } else {
            $loginModalDiv = "";
        }
        $body = str_ireplace("</body>", $loginModalDiv . "</body>", $body);
        $locale = $this->getLocale();
        // get Event Notification subscriptions
        $subs = "\nFB.Event.subscribe('comment.create', jfbc.social.facebook.comment.create);";
        $subs .= "\nFB.Event.subscribe('comment.remove', jfbc.social.facebook.comment.remove);";
        $subs .= "\nFB.Event.subscribe('edge.create', jfbc.social.facebook.like.create);";
        $subs .= "\nFB.Event.subscribe('edge.remove', jfbc.social.facebook.like.remove);";
        if (JFBCFactory::config()->get('social_notification_google_analytics')) {
            $subs .= "\njfbc.social.googleAnalytics.trackFacebook();";
        }
        $fbCanvas = JFBConnectProviderFacebookCanvas::getInstance();
        if ($fbCanvas->get('resizeEnabled', false)) {
            $resizeCode = "window.setTimeout(function() {\n" . "  FB.Canvas.setAutoGrow();\n" . "}, 250);";
        } else {
            $resizeCode = "";
        }
        if ($fbCanvas->get('canvasEnabled', false)) {
            $canvasCode = "jfbc.canvas.checkFrame();";
        } else {
            $canvasCode = "";
        }
        // Figure out if status:true should be set. When false, makes page load faster
        $user = JFactory::getUser();
        $guest = $user->guest;
        // Check cookie to make sure autologin hasn't already occurred once. If so, and we try again, there will be loops.
        $autoLoginPerformed = JRequest::getInt('jfbconnect_autologin_disable', 0, 'COOKIE');
        if (JFBCFactory::config()->get('facebook_auto_login') && $guest && !$autoLoginPerformed) {
            $status = 'status: true,';
            // get Event Notification subscriptions
            $subs .= "\nFB.Event.subscribe('auth.authResponseChange', function(response) {jfbc.login.facebook_onlogin();});";
        } else {
            $status = 'status: false,';
        }
        $debugEnabled = $this->configModel->get('facebook_display_errors');
        $script = $debugEnabled ? "sdk/debug.js" : "sdk.js";
        if ($this->appId) {
            $appIdCode = "appId: '" . $this->appId . "', ";
        } else {
            $appIdCode = "";
        }
        $forceParse = JFBCFactory::config()->get('social_tags_always_parse');
        $xfbml = $forceParse || $this->widgetRendered ? 'true' : 'false';
        $version = "version: 'v2.3',";
        $javascript = <<<EOT
<div id="fb-root"></div>
<script type="text/javascript">
  {$canvasCode}
  window.fbAsyncInit = function() {
    FB.init({{$version}{$appIdCode}{$status} cookie: true, xfbml: {$xfbml}});{$subs}{$resizeCode}
  };
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/{$locale}/{$script}";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>
EOT;
        if (preg_match('/\\<body[\\s\\S]*?\\>/i', $body, $matches)) {
            $newBody = str_replace($matches[0], $matches[0] . $javascript, $body);
            JResponse::setBody($newBody);
        }
    }
コード例 #13
0
ファイル: joomla.php プロジェクト: q0821/esportshop
 protected function getProfileFields()
 {
     $fields = array();
     if (JPluginHelper::isEnabled('user', 'profile')) {
         SCStringUtilities::loadLanguage('plg_user_profile', JPATH_ADMINISTRATOR);
         $form = JForm::getInstance('profile', JPATH_SITE . '/plugins/user/profile/profiles/profile.xml');
         $allFields = $form->getFieldset();
         foreach ($allFields as $f) {
             if ($f->name != 'profile[spacer]' && $f->fieldname != 'tos') {
                 $fields[] = (object) array('id' => $f->fieldname, "name" => $f->title);
             }
         }
     } else {
         $fields[] = (object) array('id' => 'xyz', 'name' => 'User - Profile plugin not enabled');
     }
     return $fields;
 }
コード例 #14
0
ファイル: provider.php プロジェクト: q0821/esportshop
 public function getLoginButtonWithImage($params, $loginClass, $loginID)
 {
     if (is_array($params)) {
         $reg = new JRegistry();
         $reg->loadArray($params);
         $params = $reg;
     } else {
         if (!$params) {
             $params = new JRegistry();
         }
     }
     $alignment = $params->get('alignment', 'left');
     $image = $params->get('image', JFBCFactory::config()->get($this->systemName . '_login_button', 'icon_label.png'));
     SCStringUtilities::loadLanguage('com_jfbconnect');
     $buttonAltTitle = JText::_('COM_JFBCONNECT_LOGIN_USING_' . strtoupper($this->name));
     return '<div class="social-login ' . $this->systemName . ' ' . $loginClass . ' pull-' . $alignment . '">
     <a id="' . $loginID . '" href="javascript:void(0)" onclick="jfbc.login.provider(\'' . $this->systemName . '\');">
         <img src="' . JURI::root(true) . '/media/sourcecoast/images/provider/' . $this->systemName . '/' . $image . '" alt="' . $buttonAltTitle . '" title="' . $buttonAltTitle . '"/></a>
         </div>';
 }
コード例 #15
0
ファイル: jfbconnect.php プロジェクト: q0821/esportshop
require_once JPATH_SITE . '/components/com_jfbconnect/libraries/factory.php';
$document = JFactory::getDocument();
$document->addStyleSheet("components/com_jfbconnect/assets/css/default.css");
$document->addStyleSheet(JURI::root() . "media/sourcecoast/css/sc_bootstrap.css");
$document->addStyleSheet(JURI::root() . "media/sourcecoast/css/common.css");
$document->addScript(JURI::root() . "media/sourcecoast/js/jq-bootstrap-1.8.3.js");
$document->addScript("components/com_jfbconnect/assets/jfbconnect-admin.js");
$document->addScript("components/com_jfbconnect/assets/js/jfbcadmin-template.js");
if (defined('SC16')) {
    $document->addScriptDeclaration('jfbcJQuery(document).ready(function ()
    {
        jfbcMakePrettyRadioButtons();
    })');
}
jimport('sourcecoast.utilities');
SCStringUtilities::loadLanguage('com_jfbconnect', JPATH_ADMINISTRATOR);
require_once JPATH_COMPONENT . '/controller.php';
$input = JFactory::getApplication()->input;
$task = $input->getCmd('task');
// Slowly update these 'old' admin views to the new style...
$oldStyle = array('ajax', 'autotune', 'canvas', 'config', 'notification', 'opengraph', 'profiles', 'request', 'social', 'usermap');
if (strpos($task, '.') === false && (in_array(JRequest::getCmd('controller', ''), $oldStyle) || in_array(JRequest::getCmd('view', ''), $oldStyle))) {
    // Old beatup way. Don't do this anymore
    $view = JRequest::getCmd('controller', '');
    if ($view == "") {
        $view = JRequest::getCmd('view', '');
    }
    if ($view != '' && $view != "jfbconnect") {
        require_once JPATH_COMPONENT . '/controllers/' . strtolower($view) . '.php';
        $controllerName = $view;
    } else {
コード例 #16
0
ファイル: openGraphPlugin.php プロジェクト: q0821/esportshop
 protected function setupTimedActions()
 {
     $doc = JFactory::getDocument();
     $actionAdded = false;
     foreach ($this->object->getAssociatedActions() as $action) {
         if ($action->params->get('og_auto_type') == "page_load" && $action->params->get('og_auto_timer') > 0) {
             $key = $this->getUniqueKey($this->getCurrentURL());
             $jq = JFBCFactory::config()->getSetting('jquery_load') ? 'jfbcJQuery' : 'jQuery';
             if ($action->actionReady($key)) {
                 $actionAdded = true;
                 // The space between { jfbc.opengraph is required. Otherwise, our system plugin will strip it thinking it's a {JFBCxyz} tag.
                 // Not the perfect solution, but it works..
                 $doc->addScriptDeclaration($jq . "(document).ready(function () {" . "setTimeout(function(){ jfbc.opengraph.triggerAction('" . $action->id . "','" . $this->getCurrentURL() . "');}, " . $action->params->get('og_auto_timer') * 1000 . ");" . "});");
             } else {
                 $data = $action->getLastPublished($key);
                 if ($data) {
                     SCStringUtilities::loadLanguage('com_jfbconnect');
                     $actionAdded = true;
                     $date = new JDate($data->created);
                     $doc->addScriptDeclaration($jq . "(document).ready(function () {" . "setTimeout(function(){jfbc.opengraph.actionPopup('<span class=\"ogMessage\">" . JText::sprintf("COM_JFBCONNECT_OPENGRAPH_ACTION_EXISTS", $date->format(JText::_('DATE_FORMAT_LC4'))) . "</span>" . '<span class="ogOptions"><a href="' . JRoute::_('index.php?option=com_jfbconnect&task=opengraph.userdelete&actionid=' . $data->id) . '" target="_blank">' . JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_DELETE') . '</a>' . ' | <a href="' . JRoute::_('index.php?option=com_jfbconnect&view=opengraph&layout=activity') . '" target="_blank">' . JText::_('COM_JFBCONNECT_OPENGRAPH_ACTION_SEE_ALL') . '</a></span>' . "')})" . "});");
                 }
             }
         }
     }
     if ($actionAdded) {
         // Include our CSS file for styling the popup
         JFBCFactory::addStylesheet('jfbconnect.css');
     }
 }
コード例 #17
0
ファイル: login.php プロジェクト: q0821/esportshop
 function __construct($className, $tagName, $id, $loginTextKey, $loginButtonClass, $logoutButtonId)
 {
     $this->className = $className;
     $this->tagName = strtolower($tagName);
     $this->loginButtonId = $id;
     $this->loginButtonClass = $loginButtonClass;
     $this->logoutButtonId = $logoutButtonId;
     SCStringUtilities::loadLanguage('com_jfbconnect');
     $this->loginButtonText = JText::_($loginTextKey);
     $this->examples = array('{' . $tagName . '}', '{' . $tagName . ' logout=true logout_url=http://www.sourcecoast.com}');
 }