Beispiel #1
0
 function display($tpl = null)
 {
     $actionModel = $this->getModel('OpenGraphAction', 'JFBConnectModel');
     $activityModel = $this->getModel('OpenGraphActivity', 'JFBConnectModel');
     $objectModel = $this->getModel('OpenGraphObject', 'JFBConnectModel');
     $user = JFactory::getUser();
     if ($this->getLayout() == 'activity') {
         $activityModel->setUserId($user->get('id'));
         $rows = $activityModel->getActivityForUser();
         $this->rows = $rows;
         $this->actionModel = $actionModel;
         $this->objectModel = $objectModel;
         $pagination = $activityModel->getPagination();
         $this->pagination = $pagination;
     } else {
         if ($this->getLayout() == 'settings') {
             $user = JFactory::getUser();
             $userModel = JFBConnectModelUserMap::getUser($user->get('id'), 'facebook');
             $userData = $userModel->getData();
             $actionsDisabled = $userData->params->get('og_actions_disabled');
             $this->actionsDisabled = $actionsDisabled;
             $actionModel = $this->getModel('OpenGraphAction', 'JFBConnectModel');
             $actions = $actionModel->getActions(true);
             $editableActions = array();
             foreach ($actions as $action) {
                 if ($action->can_disable) {
                     $editableActions[] = $action;
                 }
             }
             $this->actions = $editableActions;
         }
     }
     JFBCFactory::addStylesheet('jfbconnect.css');
     parent::display($tpl);
 }
Beispiel #2
0
 public function onAfterDispatch()
 {
     if ($this->enabled) {
         $path = JPATH_SITE . '/components/com_jfbconnect/libraries/toolbar/button/';
         $files = JFolder::files($path, '\\.php$');
         // Probably need to add some way to order these things..
         foreach ($files as $f) {
             $class = 'JFBConnectToolbarButton' . ucfirst(str_replace('.php', '', $f));
             if (class_exists($class)) {
                 $obj = new $class();
                 $this->buttons[$obj->order] = $obj;
             }
         }
         ksort($this->buttons);
         $doc = JFactory::getDocument();
         JFBCFactory::addStylesheet('jfbconnect.css');
         if (JFBCFactory::config()->get('facebook_display_errors')) {
             //                $doc->addScript('media/sourcecoast/js/jquery-ui.js');
             $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.css');
         } else {
             //                $doc->addScript('media/sourcecoast/js/jquery-ui.min.js');
             $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.min.css');
         }
     }
 }
Beispiel #3
0
 function display($tpl = null)
 {
     $user = JFactory::getUser();
     $providers = JFBCFactory::getAllProviders();
     $providerData = array();
     foreach ($providers as $provider) {
         if ($provider->appId && $provider->secretKey) {
             $userModel = JFBConnectModelUserMap::getUser($user->get('id'), $provider->systemName);
             $userData = $userModel->getData();
             $providerInfo = new stdClass();
             $providerInfo->profileUrl = $userData->params->get('data.profile_url');
             if (empty($providerInfo->profileUrl)) {
                 //JOOMLA 2.5
                 $providerInfo->profileUrl = $userData->params->get('profile_url');
             }
             $providerInfo->isMapped = $userData->provider != null;
             $providerInfo->name = $provider->name;
             $providerInfo->provider = $provider;
             $providerInfo->systemName = $provider->systemName;
             $providerData[$provider->name] = $providerInfo;
         }
     }
     $this->providerData = $providerData;
     JFBCFactory::addStylesheet('jfbconnect.css');
     parent::display($tpl);
 }
Beispiel #4
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tag = '<script type="IN/Share"';
     $tag .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-url');
     $tag .= $this->getField('showzero', 'show_zero', 'boolean', 'false', 'data-showzero');
     if ($this->fields->exists('layout')) {
         $tag .= SCEasyTags::getShareButtonLayout('linkedin', $this->fields->get('layout'), '"');
     } else {
         $tag .= $this->getField('counter', null, null, '', 'data-counter');
     }
     $tag .= ' data-onsuccess="jfbc.social.linkedin.share"';
     $tag .= '></script>';
     return $tag;
 }
Beispiel #5
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tag = '<div class="fb-like"';
     $tag .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-href');
     $tag .= $this->getField('show_faces', null, 'boolean', 'true', 'data-show-faces');
     $tag .= $this->getField('share', 'show_send_button', 'boolean', 'true', 'data-share');
     $tag .= $this->getField('layout', null, null, '', 'data-layout');
     $tag .= $this->getField('width', null, null, '', 'data-width');
     $tag .= $this->getField('action', null, null, '', 'data-action');
     $tag .= $this->getField('colorscheme', null, null, '', 'data-colorscheme');
     $tag .= $this->getField('ref', null, null, '', 'data-ref');
     $tag .= $this->getField('kid_directed_site', null, 'boolean', 'false', 'data-kid-directed-site');
     $tag .= '></div>';
     return $tag;
 }
Beispiel #6
0
 public function render()
 {
     $class[] = "sourcecoast facebook";
     $class[] = $this->systemName;
     //Facebook javascript is added automatically
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tag = $this->getTagHtml();
     if ($tag) {
         $this->provider->widgetRendered = true;
         if ($this->className) {
             $class[] = $this->className;
         }
         $classString = implode(' ', $class);
         $tag = '<div class="' . $classString . '">' . $tag . '</div>';
     }
     return $tag;
 }
Beispiel #7
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tag = '<div class="g-plusone"';
     if ($this->fields->exists('layout')) {
         $tag .= SCEasyTags::getShareButtonLayout('google', $this->fields->get('layout'), '"');
     } else {
         $tag .= $this->getField('size', null, null, '', 'data-size');
         $tag .= $this->getField('annotation', null, null, '', 'data-annotation');
     }
     $tag .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-href');
     $tag .= $this->getField('width', null, null, '', 'data-width');
     $tag .= $this->getField('align', null, null, '', 'data-align');
     $tag .= $this->getField('expandTo', null, null, '', 'expandTo');
     $tag .= $this->getField('recommendations', null, 'boolean', 'true', 'data-recommendations');
     $tag .= ' data-callback="plusone_callback"';
     $tag .= '></div>';
     return $tag;
 }
Beispiel #8
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tagButtonText = '<a href="http://twitter.com/share" class="twitter-share-button" ';
     $tagButtonText .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-url');
     if ($this->fields->exists('layout')) {
         $tagButtonText .= SCEasyTags::getShareButtonLayout('twitter', $this->fields->get('layout'), '"');
     } else {
         $tagButtonText .= $this->getField('data-count', 'data_count', null, '', 'data-count');
     }
     $tagButtonText .= $this->getField('via', null, null, '', 'data-via');
     $tagButtonText .= $this->getField('text', null, null, '', 'data-text');
     $tagButtonText .= $this->getField('related', null, null, '', 'data-related');
     $tagButtonText .= $this->getField('lang', null, null, '', 'data-lang');
     $tagButtonText .= $this->getField('counturl', null, null, '', 'data-counturl');
     $tagButtonText .= $this->getField('hashtags', null, null, '', 'data-hashtags');
     $tagButtonText .= $this->getField('size', null, null, '', 'data-size');
     $tagButtonText .= $this->getField('dnt', null, 'boolean', 'false', 'data-dnt');
     $tagButtonText .= '>Tweet</a>';
     return $tagButtonText;
 }
Beispiel #9
0
 protected function getTagHtml()
 {
     $actionID = $this->getParamValue('id');
     if ($actionID) {
         JFBCFactory::addStylesheet('jquery-ui/jquery-ui-autocomplete.css');
         $actionText = $this->getParamValue('text');
         $triggeredText = $this->getParamValue('inactive');
         $actionImage = $this->getParamValue('active_image');
         $triggeredImage = $this->getParamValue('inactive_image');
         if ($triggeredImage) {
             $triggeredText = '<img src="' . $triggeredImage . '"' . ($triggeredText ? ' alt="' . $triggeredText . '"' : '') . '/>';
         }
         if ($actionImage) {
             $actionText = '<img src="' . $actionImage . '"' . ($actionText ? ' alt="' . $actionText . '"' : '') . '/>';
         }
         $jfbcOgActionModel = JModelLegacy::getInstance('OpenGraphAction', 'JFBConnectModel');
         $action = $jfbcOgActionModel->getAction($actionID);
         // Build up the Javascript params list
         $caps = array();
         $capabilities = $action->params->get('og_capabilities');
         if ($capabilities) {
             foreach ($capabilities as $cap => $enable) {
                 $caps[] = $cap;
             }
         }
         // Add an href parameter to the tag eventually as well and use that instead of this
         $uri = JURI::getInstance();
         $url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query'));
         if ($action->actionReady($jfbcOgActionModel->getUniqueKey($url))) {
             $tagText = '<button id="share-button" class="btn" onclick=\'jfbc.share.display_modal(' . $actionID . ', ' . json_encode($caps) . ');\' type="button">' . $actionText . '</button>';
         } else {
             $tagText = '<button id="share-button" class="btn disabled" type="button">' . $triggeredText . '</button>';
         }
     } else {
         $tagText = "JFBCAction ID not found!";
     }
     return $tagText;
 }
Beispiel #10
0
echo $layout . ' ' . $orientation;
?>
">
    <?php 
if ($linkedinEnable) {
    echo '{JLinkedShare' . $href . ' layout=' . $layout . ' showzero=' . $linkedinShowZero . $renderKeyString . '}';
}
if ($twitterEnable) {
    echo '{SCTwitterShare' . $href . ' layout=' . $layout . $renderKeyString . '}';
}
if ($googleEnable) {
    echo '{SCGooglePlusOne' . $href . ' layout=' . $layout . ' width=' . $googleWidth . $renderKeyString . '}';
}
if ($facebookEnable) {
    if (!$facebookShareEnable) {
        JFBCFactory::addStylesheet('jfbconnect.css');
        //Use Like IFrame for height and width to not resize dynamically/cause flashing.
        //However, Share button will not display in this mode
        echo '<div class="jfbclike"><iframe src="//www.facebook.com/plugins/like.php?href=' . $url . '&amp;width=' . $facebookWidth . '&amp;height=' . $facebookHeight . '&amp;colorscheme=' . $facebookColorScheme . '&amp;layout=' . $layout . '&amp;action=' . $facebookVerb . '&amp;show_faces=' . $facebookShowFacesValue . '&amp;kid_directed_site=' . $facebookKidDirectedSiteValue . '&amp;appId=' . $fbAppId . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' . $facebookWidth . '; height:' . $facebookHeight . ';" allowTransparency="true"></iframe></div>';
    } else {
        echo '{JFBCLike' . $href . ' layout=' . $layout . ' show_faces=' . $facebookShowFacesValue . ' share=' . $facebookShowShareButtonValue . ' width=' . $facebookWidth . ' height=' . $facebookHeight . ' action=' . $facebookVerb . ' colorScheme=' . $facebookColorScheme . ' ref=' . $facebookRef . $renderKeyString . '}';
    }
} else {
    if ($facebookShareEnable) {
        if ($layout == 'standard' || $layout == 'button') {
            $style = 'button';
        } else {
            if ($layout == 'box_count') {
                $style = 'box_count';
            } else {
                $style = 'button_count';
Beispiel #11
0
 public function onBeforeRender()
 {
     if (!JFactory::getApplication()->isAdmin() && JFactory::getDocument()->getType() == 'html') {
         if (JFactory::getUser()->authorise('jfbconnect.opengraph.debug', 'com_jfbconnect') && JFBCFactory::config()->get('facebook_display_errors')) {
             JFBCFactory::addStylesheet('jfbconnect.css');
         }
     }
 }
Beispiel #12
0
 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');
     }
 }