Beispiel #1
0
 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();
     }
 }