当前位置: 首页>>代码示例>>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;未经允许,请勿转载。