當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JFBCFactory::config方法代碼示例

本文整理匯總了PHP中JFBCFactory::config方法的典型用法代碼示例。如果您正苦於以下問題:PHP JFBCFactory::config方法的具體用法?PHP JFBCFactory::config怎麽用?PHP JFBCFactory::config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JFBCFactory的用法示例。


在下文中一共展示了JFBCFactory::config方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onAfterDispatch

 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');
         }
     }
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:25,代碼來源:toolbar.php

示例2: setupAuthentication

 function setupAuthentication()
 {
     $options = new JRegistry();
     $options->set('authurl', 'https://api.instagram.com/oauth/authorize');
     $options->set('tokenurl', 'https://api.instagram.com/oauth/access_token');
     $options->set('authmethod', 'get');
     $headers = array();
     $headers['Content-Type'] = 'application/json';
     $options->set('headers', $headers);
     $options->set('scope', '');
     $this->client = new JFBConnectAuthenticationOauth2($options);
     $token = JFactory::getApplication()->getUserState('com_jfbconnect.' . strtolower($this->name) . '.token', null);
     if ($token) {
         $token = (array) json_decode($token);
         $this->client->setToken($token);
     }
     $this->client->initialize($this);
     // Need to override the callback URL to force http or https
     $origRedirect = $this->client->getOption('redirecturi');
     if (JFBCFactory::config()->get('instagram_callback_ssl')) {
         $redirect = str_replace('http://', 'https://', $origRedirect);
     } else {
         $redirect = str_replace('https://', 'http://', $origRedirect);
     }
     $this->client->setOption('redirecturi', $redirect);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:26,代碼來源:instagram.php

示例3: display

 function display($tpl = null)
 {
     $model = JFBCFactory::config();
     $jfbcLibrary = JFBCFactory::provider('facebook');
     require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
     JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_templates/models');
     $templatesModel = JModelLegacy::getInstance('Styles', 'TemplatesModel');
     $allTemplates = $templatesModel->getItems();
     $templates = array();
     foreach ($allTemplates as $template) {
         if ($template->client_id == 0) {
             // Make it the same as J15 so we can use the same selectlist
             $template->directory = $template->id;
             $template->name = $template->title;
             $templates[] = $template;
         }
     }
     // Add the "Don't Override" option to set no special template
     $defaultTemplate = new stdClass();
     $defaultTemplate->directory = -1;
     $defaultTemplate->name = JText::_('COM_JFBCONNECT_CANVAS_DISPLAY_TEMPLATE_DEFAULT');
     array_unshift($templates, $defaultTemplate);
     require_once JPATH_ADMINISTRATOR . '/components/com_jfbconnect/controllers/canvas.php';
     $canvasProperties = JFBConnectControllerCanvas::setupCanvasProperties();
     $canvasTabTemplate = $model->getSetting('canvas_tab_template', -1);
     $canvasCanvasTemplate = $model->getSetting('canvas_canvas_template', -1);
     $this->assignRef('canvasProperties', $canvasProperties);
     $this->assignRef('canvasTabTemplate', $canvasTabTemplate);
     $this->assignRef('canvasCanvasTemplate', $canvasCanvasTemplate);
     $this->assignRef('templates', $templates);
     $this->assignRef('model', $model);
     $this->assignRef('jfbcLibrary', $jfbcLibrary);
     $this->addToolbar();
     parent::display($tpl);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:35,代碼來源:view.html.php

示例4: apply

 function apply()
 {
     $app = JFactory::getApplication();
     $configs = JRequest::get('POST');
     $model = JFBCFactory::config();
     JPluginHelper::importPlugin('socialprofiles');
     $profilePlugins = $app->triggerEvent('socialProfilesGetPlugins');
     foreach ($profilePlugins as $plugin) {
         $pluginName = $plugin->getName();
         $settings = new JRegistry();
         $search = "profiles_" . $pluginName . "_";
         $stdFields = JRequest::getVar('profiles_' . $pluginName);
         $settings->loadArray($stdFields);
         foreach ($configs as $key => $value) {
             $pos = strpos($key, $search);
             if ($pos === 0) {
                 $key = str_replace($search, "", $key);
                 if (strpos($key, "field_map") != false) {
                     $key = str_replace("_field_map", ".", $key);
                     $settings->set('field_map.' . $key, $value);
                 }
             }
         }
         $model->update("profile_" . $pluginName, $settings->toString());
     }
     JFBCFactory::log(JText::_('COM_JFBCONNECT_MSG_SETTINGS_UPDATED'));
     $this->display();
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:28,代碼來源:profiles.php

示例5: fetchStatus

 public function fetchStatus($providerUserId)
 {
     $status = "";
     $url = 'https://api.vk.com/method/wall.get';
     $url .= '?owner_id=' . $providerUserId;
     $url .= '&count=10&extended=0&filter=owner';
     try {
         $data = $this->provider->client->query($url);
         if ($data->code == 200) {
             $posts = json_decode($data->body, true);
             foreach ($posts['response'] as $post) {
                 if (is_array($post)) {
                     if ($post['post_type'] == 'post' && $post['text'] !== "") {
                         $status = $post['text'];
                         break;
                     }
                 }
             }
         }
     } catch (Exception $e) {
         if (JFBCFactory::config()->get('facebook_display_errors')) {
             JFBCFactory::log($e->getMessage());
         }
     }
     return $status;
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:26,代碼來源:vk.php

示例6: apply

 function apply()
 {
     $configs = JRequest::get('POST', 4);
     JFBCFactory::config()->saveSettings($configs);
     JFBCFactory::log(JText::_('COM_JFBCONNECT_MSG_SETTINGS_UPDATED'));
     $this->display();
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:7,代碼來源:config.php

示例7: ajaxAction

 public function ajaxAction()
 {
     JSession::checkToken('get') or die;
     $actionId = JRequest::getInt('action');
     $href = JRequest::getVar('href');
     $href = urldecode($href);
     $params = JRequest::getVar('params');
     if (is_array($params)) {
         foreach ($params as $key => $value) {
             $params[$key] = rawurldecode($value);
         }
     } else {
         $params = array();
     }
     JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_jfbconnect/models');
     $jfbcOgActionModel = JModelLegacy::getInstance('OpenGraphAction', 'JFBConnectModel');
     $action = $jfbcOgActionModel->getAction($actionId);
     $response = $jfbcOgActionModel->triggerAction($action, $href, $params);
     if ($response->status) {
         echo $response->message;
     } else {
         if (JFBCFactory::config()->getSetting('facebook_display_errors') && $response->message != "") {
             echo "Error: " . $response->message;
         }
     }
     exit;
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:27,代碼來源:opengraph.php

示例8: __construct

 public function __construct($options = array())
 {
     $this->debug = intval(JFBCFactory::config()->get('facebook_display_errors'));
     $this->text_file = isset($options['text_file']) ? $options['text_file'] : $this->text_file;
     if ($this->debug) {
         JLog::addLogger(array('text_file' => $this->text_file), JLog::ALL, 'jfbconnect');
     }
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:8,代碼來源:debug.php

示例9: __construct

 public function __construct()
 {
     $this->cache = JFactory::getCache('com_jfbconnect', '');
     // Only enable caching if Debug Mode is off
     $debug = JFBCFactory::config()->get('facebook_display_errors');
     $cacheTimeout = JFBCFactory::config()->get('cache_duration');
     $this->cache->setCaching(!$debug && $cacheTimeout != 0);
     $this->cache->setLifeTime($cacheTimeout);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:9,代碼來源:cache.php

示例10: formBind

 public function formBind($name, $data = null)
 {
     if (!isset($this->forms[$name])) {
         return false;
     }
     if (!$data) {
         $data = JFBCFactory::config()->getSettings();
     }
     $this->forms[$name]->bind($data);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:10,代碼來源:views.php

示例11: checkAutotune

 private function checkAutotune()
 {
     // Saving an object or action
     $appConfig = JFBCFactory::config()->getSetting('autotune_app_config', array());
     $namespace = $appConfig['namespace'];
     if ($namespace == '') {
         return false;
     } else {
         return true;
     }
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:11,代碼來源:channel.php

示例12: getKeys

 public function getKeys()
 {
     $app = JFactory::getApplication();
     $jfb_params = JFBCFactory::config()->getSettings();
     $result = array();
     $result['fb_app_id'] = $jfb_params->get('facebook_app_id');
     $result['fb_app_key'] = $jfb_params->get('facebook_secret_key');
     $result['g_app_id'] = $jfb_params->get('google_app_id');
     $result['g_app_key'] = $jfb_params->get('google_secret_key');
     return $result;
 }
開發者ID:yalive,項目名稱:com_api-plugins,代碼行數:11,代碼來源:sociallogin.php

示例13: sendEmail

 private function sendEmail($subject, $body)
 {
     $toname = JFBCFactory::config()->getSetting('social_notification_email_address');
     $toname = explode(',', $toname);
     // Don't send emails to no one :)
     if ($toname[0] == "") {
         return;
     }
     $app = JFactory::getApplication();
     $sitename = $app->getCfg('sitename');
     $mailfrom = $app->getCfg('mailfrom');
     $fromname = $app->getCfg('fromname');
     $subject = $subject . " - " . $sitename;
     JFactory::getMailer()->sendMail($mailfrom, $fromname, $toname, $subject, $body);
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:15,代碼來源:social.php

示例14: fetchProfile

 public function fetchProfile($userId, $fields)
 {
     $profile = new JFBConnectProfileDataWindowsLive();
     $url = 'https://apis.live.net/v5.0/' . $userId;
     try {
         $jdata = $this->provider->client->query($url);
         if ($jdata->code == 200) {
             $data = json_decode($jdata->body, true);
             $profile->loadObject($data);
         }
     } catch (Exception $e) {
         if (JFBCFactory::config()->get('facebook_display_errors')) {
             JFBCFactory::log($e->getMessage());
         }
     }
     return $profile;
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:17,代碼來源:windowslive.php

示例15: getRedirect

 function getRedirect()
 {
     $query = "SELECT r.destination_url rDestinationUrl, breakout_canvas FROM #__jfbconnect_request r INNER JOIN #__jfbconnect_notification n ON r.id = n.jfbc_request_id " . " WHERE n.fb_request_id IN (" . implode(', ', $this->_fbRequestIds) . ") ORDER BY n.created DESC LIMIT 1";
     $this->_db->setQuery($query);
     $data = $this->_db->loadObject();
     $redirectInfo = new stdClass();
     // Get Autotune settings to see if Canvas is enabled and if we should even check/use the breakout_canvas setting
     $autotune = JFBCFactory::config()->getSetting('autotune_app_config', null);
     if (empty($autotune)) {
         return null;
     }
     $appConfig = new JRegistry();
     $appConfig->loadArray($autotune);
     $canvasEnabled = $appConfig->get('canvas_url', null) != null && $appConfig->get('secure_canvas_url', null) != null ? true : false;
     $redirectInfo->breakout_canvas = $canvasEnabled && $data->breakout_canvas;
     $redirectInfo->destination_url = $data->rDestinationUrl;
     return $redirectInfo;
 }
開發者ID:q0821,項目名稱:esportshop,代碼行數:18,代碼來源:notification.php


注:本文中的JFBCFactory::config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。