本文整理汇总了PHP中JURI::current方法的典型用法代码示例。如果您正苦于以下问题:PHP JURI::current方法的具体用法?PHP JURI::current怎么用?PHP JURI::current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JURI
的用法示例。
在下文中一共展示了JURI::current方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addSubmenu
/**
* Configure the Linkbar.
*/
public static function addSubmenu($vName = '')
{
//Process notifications. Adding this here, as it is only rendered when there is data to be rendered
//i.e avoids ajax and redirect requests, which we do not want to have such notifications added to.
if (file_exists(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_need_update')) {
JFactory::getApplication()->enqueueMessage(JText::_('COM_JHACKGUARD_PLUGIN_RULES_CACHE_REBUILD_NEEDED') . ' <a href="' . JURI::current() . '?option=com_jhackguard&view=filtermaintenance">' . JText::_('COM_JHACKGUARD_TITLE_FILTERMAINTENANCE') . '</a>', 'warning');
}
//Try to determine if an update was performed in the past 24 hours.
if (file_exists(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_updated_timestamp')) {
$rut = unserialize(file_get_contents(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_updated_timestamp'));
if (is_array($rut) and $rut['expires'] < time()) {
$rut = JhackguardHelper::checkForFilterUpdates();
}
} else {
$rut = JhackguardHelper::checkForFilterUpdates();
}
//Determine if we shuold display an update message.
if (is_array($rut)) {
if ($rut['success']) {
if ($rut['insert'] > 0 or $rut['update'] > 0) {
JFactory::getApplication()->enqueueMessage('An update to your filters is required. The following items are available: ' . $rut['insert'] . ' new and ' . $rut['update'] . ' updates. Please navigate to <a href="' . JURI::current() . '?option=com_jhackguard&view=filtermaintenance">Filter Maintenance</a> page and click on the \'Update Rules\' button, in order to fetch the latest security filters for your Joomla.', 'warning');
}
} else {
JFactory::getApplication()->enqueueMessage($rut['msg'], 'error');
}
}
JHtmlSidebar::addEntry(JText::_('COM_JHACKGUARD_TITLE_IPFILTERS'), 'index.php?option=com_jhackguard&view=ipfilters', $vName == 'ipfilters');
JHtmlSidebar::addEntry(JText::_('COM_JHACKGUARD_TITLE_INPUTFILTERS'), 'index.php?option=com_jhackguard&view=inputfilters', $vName == 'inputfilters');
JHtmlSidebar::addEntry(JText::_('COM_JHACKGUARD_TITLE_OUTPUTFILTERS'), 'index.php?option=com_jhackguard&view=outputfilters', $vName == 'outputfilters');
JHtmlSidebar::addEntry(JText::_('COM_JHACKGUARD_TITLE_FILTERMAINTENANCE'), 'index.php?option=com_jhackguard&view=filtermaintenance', $vName == 'filtermaintenance');
JHtmlSidebar::addEntry(JText::_('COM_JHACKGUARD_TITLE_LOGS'), 'index.php?option=com_jhackguard&view=logs', $vName == 'logs');
}
示例2: doSSOLogout
/**
* Method for logging out with Magento (Single Sign On)
*
* @param string $username
* @return bool|exit
*/
public static function doSSOLogout($username = null)
{
// Abort if the input is not valid
if (empty($username)) {
return false;
}
// Get system variables
$application = JFactory::getApplication();
$session = JFactory::getSession();
// Determine the application
$application_name = $application->isAdmin() ? 'admin' : 'frontend';
// Get the security token
$token = method_exists('JSession', 'getFormToken') ? JSession::getFormToken() : JUtility::getToken();
// Set the redirection URL
if ($application_name == 'admin') {
$redirect = JURI::current();
} else {
$redirect = MageBridgeUrlHelper::current();
}
// Construct the URL
$arguments = array('sso=logout', 'app=' . $application_name, 'redirect=' . base64_encode($redirect), 'userhash=' . MageBridgeEncryptionHelper::encrypt($username), 'token=' . $token);
$url = MageBridgeModelBridge::getInstance()->getMagentoBridgeUrl() . '?' . implode('&', $arguments);
// Redirect the browser to Magento
MageBridgeModelDebug::getInstance()->notice("SSO: Logout of '{$username}' from " . $application_name);
$application->redirect($url);
return true;
}
示例3: getContent
/**
* Generate content
* @param object The article object. Note $article->text is also available
* @param object The article params
* @param boolean Modules context
* @return string Returns html code or empty string.
*/
private function getContent(&$article, &$params, $moduleContext = false)
{
$doc = JFactory::getDocument();
/* @var $doc JDocumentHtml */
$doc->addStyleSheet(JURI::root() . "plugins/content/fastsocialshare/style/style.css");
$uriInstance = JURI::getInstance();
if (!$moduleContext) {
if (!class_exists('ContentHelperRoute')) {
include_once JPATH_SITE . '/components/com_content/helpers/route.php';
}
$url = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false);
$root = rtrim($uriInstance->getScheme() . '://' . $uriInstance->getHost(), '/');
$url = $root . $url;
$title = htmlentities($article->title, ENT_QUOTES, "UTF-8");
} else {
$url = JURI::current();
$title = htmlentities($doc->title, ENT_QUOTES, "UTF-8");
}
$html = $this->getFacebookLike($this->params, $url, $title);
$html .= $this->getFacebookShareMe($this->params, $url, $title);
$html .= $this->getTwitter($this->params, $url, $title);
$html .= $this->getGooglePlusOne($this->params, $url, $title);
$html .= $this->getLinkedIn($this->params, $url, $title);
$html .= $this->getPinterest($this->params, $url, $title);
return '<div class="fastsocialshare_container">' . $html . '<div class="fastsocialshare_clearer"></div></div>';
}
示例4: getRequestData
/**
* Method to get the meta-data
*
* @return array
*/
public function getRequestData()
{
// Compile the meta-data
if (empty($this->_meta_data) || !is_array($this->_meta_data)) {
$application = JFactory::getApplication();
$input = $application->input;
$user = JFactory::getUser();
$uri = JURI::getInstance();
$session = JFactory::getSession();
$config = JFactory::getConfig();
$storeHelper = MageBridgeStoreHelper::getInstance();
$bridge = MageBridgeModelBridge::getInstance();
$app_type = $storeHelper->getAppType();
$app_value = $storeHelper->getAppValue();
$arguments = array('api_session' => $bridge->getApiSession(), 'api_user' => MageBridgeEncryptionHelper::encrypt(MagebridgeModelConfig::load('api_user')), 'api_key' => MageBridgeEncryptionHelper::encrypt(MagebridgeModelConfig::load('api_key')), 'api_url' => JURI::root() . 'component/magebridge/?controller=jsonrpc&task=call', 'app' => $application->getClientId(), 'app_type' => $app_type, 'app_value' => $app_value, 'storeview' => MagebridgeModelConfig::load('storeview'), 'storegroup' => MagebridgeModelConfig::load('storegroup'), 'website' => MagebridgeModelConfig::load('website'), 'customer_group' => MagebridgeModelConfig::load('customer_group'), 'joomla_url' => $bridge->getJoomlaBridgeUrl(), 'joomla_sef_url' => $bridge->getJoomlaBridgeSefUrl(), 'joomla_sef_suffix' => (int) MageBridgeUrlHelper::hasUrlSuffix(), 'joomla_user_email' => $application->isSite() && !empty($user->email) ? $user->email : null, 'joomla_current_url' => $uri->current(), 'modify_url' => MagebridgeModelConfig::load('modify_url'), 'enforce_ssl' => MagebridgeModelConfig::load('enforce_ssl'), 'has_ssl' => (int) $uri->isSSL(), 'payment_urls' => MagebridgeModelConfig::load('payment_urls'), 'enable_messages' => MagebridgeModelConfig::load('enable_messages'), 'joomla_session' => session_id(), 'joomla_conf_caching' => $config->get('caching', 60), 'joomla_conf_lifetime' => $config->get('lifetime', 60) * 60, 'magento_session' => $bridge->getMageSession(), 'magento_persistent_session' => $bridge->getMagentoPersistentSession(), 'magento_user_allowed_save_cookie' => isset($_COOKIE['user_allowed_save_cookie']) ? $_COOKIE['user_allowed_save_cookie'] : null, 'request_uri' => MageBridgeUrlHelper::getRequest(), 'request_id' => md5(JURI::current() . serialize($input->get->getArray())), 'post' => !empty($_POST) ? $_POST : null, 'http_referer' => $bridge->getHttpReferer(), 'http_host' => $uri->toString(array('host')), 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'remote_addr' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 'supportkey' => MagebridgeModelConfig::load('supportkey'), 'debug' => (int) MageBridgeModelDebug::isDebug(), 'debug_level' => MagebridgeModelConfig::load('debug_level'), 'debug_display_errors' => MagebridgeModelConfig::load('debug_display_errors'), 'protocol' => MagebridgeModelConfig::load('protocol'), 'state' => 'initializing', 'ajax' => (int) $bridge->isAjax(), 'disable_css' => MageBridgeHelper::getDisableCss(), 'disable_js' => MageBridgeHelper::getDisableJs());
if (MageBridgeTemplateHelper::isMobile()) {
$arguments['theme'] = MagebridgeModelConfig::load('mobile_magento_theme');
} else {
$arguments['theme'] = MagebridgeModelConfig::load('magento_theme');
}
foreach ($arguments as $name => $value) {
if (is_string($value)) {
$arguments[$name] = MageBridgeEncryptionHelper::base64_encode($value);
}
}
$this->_meta_data = $arguments;
}
return $this->_meta_data;
}
示例5: toolbox_urls
/**
* Set URL for different theme settings
*
* $add_var contains the variable name and values that needs to be set. Format of this array is:
* $add_var = array( variable_name=> array( all variable possible values ) )
*
* $replace_vars contains all variables that need to be unset from the current URI. It can contain multiple variables
* $replace_vars = array( variable_name=> array( all variable possible values ) )
*
* Response is returned as array having the exact same order as the values array from $add_var.
*
* @param array $add_var
* @param array $replace_vars
* @return array
*/
function toolbox_urls($add_var, $replace_vars)
{
$jinput = JFactory::getApplication()->input;
$my_vars = $jinput->getArray($_GET);
$my_request = JURI::current();
$my_request = str_replace('&', '&', $my_request);
// clean link of unwanted variables
if (is_array($replace_vars)) {
foreach ($replace_vars as $var => $vals) {
$exp = '(&)?(\\?)?' . $var . '=(' . implode('|', $vals) . ')';
$my_request = preg_replace("#{$exp}#", '', $my_request);
}
}
$liant = strstr($my_request, '?') ? '&' : '?';
$response = array();
// determine the new variable
$var = array_keys($add_var);
$new_var = $var[0];
// check if variable is already set
if (array_key_exists($new_var, $my_vars)) {
$current_value = $my_vars[$new_var];
foreach ($add_var[$new_var] as $val) {
$response[$val] = $my_request . $liant . $new_var . '=' . $val;
}
} else {
foreach ($add_var[$new_var] as $var => $val) {
$response[$val] = $my_request . $liant . $new_var . '=' . $val;
}
}
return $response;
}
示例6: add
/**
* Adds the OpenGraph information on the page
*
* @param array $data - the array containing the open graph data
*
* @return void
*/
public static function add($data)
{
$document = JFactory::getDocument();
$document->addCustomTag('<meta property="og:url" content="' . JURI::current() . '" />');
if (isset($data['type'])) {
if ($data['type'] == 'place') {
if (isset($data['lat']) && isset($data['lng'])) {
$document->addCustomTag('<meta property="og:type" content="' . $data['type'] . '" />');
$document->addCustomTag('<meta property="place:location:latitude" content="' . $data['lat'] . '" />');
$document->addCustomTag('<meta property="place:location:longitude" content="' . $data['lng'] . '" />');
}
} else {
$document->addCustomTag('<meta property="og:type" content="' . $data['type'] . '" />');
}
}
if (isset($data['title'])) {
$document->addCustomTag('<meta property="og:title" content="' . self::escape(JHtmlString::truncate(strip_tags($data['title']), 150)) . '" />');
}
if (isset($data['description'])) {
$document->addCustomTag('<meta property="og:description" content="' . self::escape(JHtmlString::truncate(strip_tags($data['description'], 200))) . '" />');
}
if (isset($data['image']) && strlen($data['image'])) {
$document->addCustomTag('<meta property="og:image" content="' . $data['image'] . '" />');
}
}
示例7: onAfterInitialise
/**
* Event onAfterInitialise
*
* @access public
* @param null
* @return null
*/
public function onAfterInitialise()
{
// If this is the Administrator-application, or if debugging is set, do nothing
$application = JFactory::getApplication();
if ($application->isAdmin()) {
return;
}
// Disable browser-detection
$application->setDetectBrowser(false);
// Detect the language
$languageTag = JFactory::getLanguage()->getTag();
$languageInput = JRequest::getString('language');
// Get the bindings
$bindings = $this->getBindings();
// Check for the binding of the current language
if (!empty($languageInput)) {
if (isset($bindings[$languageTag])) {
$domain = $bindings[$languageTag];
if (stristr(JURI::current(), $domain) == false) {
// Add URL-elements to the domain
$domain = $this->getUrlFromDomain($domain);
// Replace the current domain with the new domain
$currentUrl = JURI::current();
$newUrl = str_replace(JURI::base(), $domain, $currentUrl);
// Strip out the sef-language-part
$languages = JLanguageHelper::getLanguages('sef');
foreach ($languages as $languageSef => $language) {
if ($language->lang_code == $languageTag) {
//$newUrl = str_replace('/'.$languageSef.'/', '/', $newUrl); // @todo: This d
break;
}
}
// Set the cookie
$conf = JFactory::getConfig();
$cookie_domain = $conf->get('config.cookie_domain', '');
$cookie_path = $conf->get('config.cookie_path', '/');
setcookie(JApplication::getHash('language'), $languageTag, time() + 365 * 86400, $cookie_path, $cookie_domain);
// Redirect
$application->redirect($newUrl);
$application->close();
}
}
} else {
// Check if the current default language is correct
foreach ($bindings as $languageCode => $domain) {
if (stristr(JURI::current(), $domain) == true) {
// Set the cookie
$conf = JFactory::getConfig();
$cookie_domain = $conf->get('config.cookie_domain', '');
$cookie_path = $conf->get('config.cookie_path', '/');
setcookie(JApplication::getHash('language'), $languageCode, time() + 365 * 86400, $cookie_path, $cookie_domain);
// Change the current default language
JRequest::setVar('language', $languageCode);
JFactory::getLanguage()->setDefault($languageCode);
JFactory::getLanguage()->setLanguage($languageCode);
break;
}
}
}
}
示例8: _typo
protected static function _typo($typo, $field, $value, &$config = array())
{
$app = JFactory::getApplication();
$html = $typo->get('html', '');
if (!(strpos($html, '<a href') !== false || strpos($html, '*link*') !== false || strpos($html, 'getLink') !== false)) {
$html = parent::g_hasLink($field, $typo, $html);
}
if ($html != '') {
$matches = '';
$search = '#\\*([a-zA-Z0-9_]*)\\*#U';
preg_match_all($search, $html, $matches);
if (count($matches[1])) {
foreach ($matches[1] as $target) {
if (isset($field->{$target})) {
if (is_array($field->{$target})) {
$html = str_replace('*' . $target . '*', isset($field->{$target}[0]) ? $field->{$target}[0] : '', $html);
} else {
$html = str_replace('*' . $target . '*', $field->{$target}, $html);
}
}
}
}
}
if ($html != '' && strpos($html, '$cck->get') !== false) {
$matches = '';
$search = '#\\$cck\\->get([a-zA-Z0-9_]*)\\( ?\'([a-zA-Z0-9_,]*)\' ?\\)(;)?#';
preg_match_all($search, $html, $matches);
if (count($matches[1])) {
parent::g_addProcess('beforeRenderContent', self::$type, $config, array('name' => $field->name, 'matches' => $matches));
}
}
if ($html != '' && strpos($html, '$uri->get') !== false) {
$matches = '';
$search = '#\\$uri\\->get([a-zA-Z]*)\\( ?\'?([a-zA-Z0-9_]*)\'? ?\\)(;)?#';
preg_match_all($search, $html, $matches);
if (count($matches[1])) {
foreach ($matches[1] as $k => $v) {
$variable = $matches[2][$k];
if ($v == 'Current') {
$request = $variable == 'true' ? JURI::getInstance()->toString() : JURI::current();
$html = str_replace($matches[0][$k], $request, $html);
} else {
$request = 'get' . $v;
$html = str_replace($matches[0][$k], $app->input->{$request}($variable, ''), $html);
}
}
}
}
if ($html != '' && strpos($html, 'J(') !== false) {
$matches = '';
$search = '#J\\((.*)\\)#U';
preg_match_all($search, $html, $matches);
if (count($matches[1])) {
foreach ($matches[1] as $text) {
$html = str_replace('J(' . $text . ')', JText::_('COM_CCK_' . str_replace(' ', '_', trim($text))), $html);
}
}
}
return $html;
}
示例9: display
/**
* Display the view
*
* @param string $tpl Template name
*
* @return void
*
* @throws Exception
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
if ($user->guest) {
error_log("Guest User - send him to login page.");
$message = "You must be logged in to submit a recipe.";
$url = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode(JURI::current()));
$app->redirect($url, $message);
}
$canEdit = $user->authorise('core.edit', 'com_akrecipes') || $user->authorise('core.create', 'com_akrecipes');
if (!$canEdit && $user->authorise('core.edit.own', 'com_akrecipes')) {
$canEdit = $user->id == $table->created_by;
}
$this->state = $this->get('State');
$this->item = $this->get('Data');
$this->params = $app->getParams('com_akrecipes');
$this->canSave = $this->get('CanSave');
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors));
}
if (!empty($this->item->access) && !in_array($this->item->access, $user->getAuthorisedViewLevels())) {
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
return false;
//throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
$this->_prepareDocument();
parent::display($tpl);
}
示例10: checkpassword
function checkpassword($view, $type)
{
$url = JURI::current();
$session =& JFactory::getSession();
$login = $session->get('com_wedding.' . $view . 'login', 0);
if (!$login) {
$juser =& JFactory::getUser();
$username = JRequest::getString('user', $juser->username);
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'general.php';
$profile_id = generalHelpers::getUserId($username);
if (is_null($profile_id)) {
$profile_id = $juser->id;
}
if ($profile_id != $juser->id) {
$url = 'index.php?option=com_wedding&view=' . $view;
$dbo =& JFactory::getDbo();
$query = "SELECT id FROM #__wedding_apps WHERE `url` = '{$url}'";
$dbo->setQuery($query);
$app_id = $dbo->loadResult();
$query = "SELECT `password` FROM #__wedding_userapps WHERE user_id = {$profile_id} AND app_id = {$app_id}";
$dbo->setQuery($query);
$password = $dbo->loadResult();
if (!empty($password)) {
$uri = JFactory::getURI();
$url = $uri->toString(array('path', 'query', 'fragment'));
$this->_view =& $this->getView('auth', $type);
$this->_view->addTemplatePath(JPATH_COMPONENT . DS . 'templates' . DS . 'default' . DS);
$this->_view->setLayout('auth.default');
$this->_view->display($view, $uri, $profile_id, $app_id);
exit;
}
}
}
return false;
}
示例11: sp_gplus_button_addon
function sp_gplus_button_addon($atts)
{
extract(spAddonAtts(array('size' => '', 'annotation' => '', 'width' => ''), $atts));
$doc = JFactory::getDocument();
$doc->addScript('https://apis.google.com/js/plusone.js');
$output = '<div class="g-plusone" data-href="' . JURI::current() . '" data-size="' . $size . '" data-annotation="' . $annotation . '"></div>';
return $output;
}
示例12: __construct
function __construct($module, $params)
{
jimport('joomla.filesystem.file');
// configuration array
$this->config = $params->toArray();
if ($this->config['fb_auto_url'] == 'true' && $this->config['fb_data_source'] != 'like_box') {
$this->config['fb_site'] = JURI::current();
}
}
示例13: _prepareDocument
protected function _prepareDocument()
{
$config = JFactory::getConfig();
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$menus = $app->getMenu();
$menu = $menus->getActive();
$title = '';
$menu = $menus->getActive();
//Title
if (isset($meta['title']) && $meta['title']) {
$title = $meta['title'];
} else {
if ($menu) {
if ($menu->params->get('page_title', '')) {
$title = $menu->params->get('page_title');
} else {
$title = $menu->title;
}
}
}
//Include Site title
$sitetitle = $title;
if ($config->get('sitename_pagetitles') == 2) {
$sitetitle = $title . ' | ' . $config->get('sitename');
} elseif ($config->get('sitename_pagetitles') == 1) {
$sitetitle = $config->get('sitename') . ' | ' . $title;
}
$doc->setTitle($sitetitle);
$doc->addCustomTag('<meta content="' . $title . '" property="og:title" />');
$this->document->addCustomTag('<meta content="website" property="og:type"/>');
$this->document->addCustomTag('<meta content="' . JURI::current() . '" property="og:url" />');
$og_title = $this->page->og_title;
if ($og_title) {
$this->document->addCustomTag('<meta content="' . $og_title . '" property="og:title" />');
}
$og_image = $this->page->og_image;
if ($og_image) {
$this->document->addCustomTag('<meta content="' . JURI::root() . $og_image . '" property="og:image" />');
}
$og_description = $this->page->og_description;
if ($og_description) {
$this->document->addCustomTag('<meta content="' . $og_description . '" property="og:description" />');
}
if ($menu) {
if ($menu->params->get('menu-meta_description')) {
$this->document->setDescription($menu->params->get('menu-meta_description'));
}
if ($menu->params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $menu->params->get('menu-meta_keywords'));
}
if ($menu->params->get('robots')) {
$this->document->setMetadata('robots', $menu->params->get('robots'));
}
}
}
示例14: display
public static function display($params)
{
$fbrender = $params->get('rendering', 'xfbml');
$fbhref = !$params->get("fb_url", '') ? JURI::current() : $params->get("fb_url", '');
$fbtrigger = $params->get("fbtrigger", 'X%');
$fbread_time = $params->get("fbread_time", "30");
$fbflike_action = $params->get("fbflike_action", "like");
$fbside = $params->get("fbside");
$fbnumposts = $params->get('fbnum_recommendations', '');
// Generate code
switch ($fbrender) {
case 'xfbml':
// XFBML
$html = '
<fb:recommendations-bar
href="' . $fbhref . '"
trigger="' . $fbtrigger . '"
read_time="' . $fbread_time . '"
action="' . $fbflike_action . '"
side="' . $fbside . '" ';
if ($params->get("fbdomain", '')) {
$html .= ' site="' . $params->get("fbdomain") . '"';
}
if ($params->get("fbnum_recommendations", 2)) {
$html .= ' num_recommendations="' . $params->get("fbnum_recommendations", 2) . '"';
}
if ($params->get("fbmax_age")) {
$html .= ' max_age="' . $params->get("fbmax_age") . '"';
}
$html .= '></fb:recommendations-bar>';
break;
default:
// HTML5
$html = '
<div
class="fb-recommendations-bar"
data-href="' . $fbhref . '"
data-trigger="' . $fbtrigger . '"
data-read-time="' . $fbread_time . '"
data-action="' . $fbflike_action . '"
data-side="' . $fbside . '"
';
if ($params->get("fbdomain")) {
$html .= ' data-site="' . $params->get("fbdomain", '') . '" ';
}
if ($params->get("fbnum_recommendations", 2)) {
$html .= ' data-num-recommendations="' . $params->get("fbnum_recommendations", 2) . '" ';
}
if ($params->get("fbmax_age")) {
$html .= ' data-max-age="' . $params->get("fbmax_age", 0) . '" ';
}
$html .= '></div>';
break;
}
return $html;
}
示例15: onBeforeCompileHead
function onBeforeCompileHead()
{
if (strpos(JURI::current(), "/administrator/") === FALSE) {
$embed = '<script data-cfasync="false" src="//fast.eager.io/{{.EmbedCode}}.js"></script>';
$head = JFactory::getDocument()->getHeadData();
array_push($head['custom'], $embed);
JFactory::getDocument()->setHeadData($head);
}
return true;
}