Skip to content

Commit

Permalink
Move JHelp to namespace (#14232)
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo authored and wilsonge committed Feb 26, 2017
1 parent f532fc4 commit 4ad4088
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 2 additions & 0 deletions libraries/classmap.php
Expand Up @@ -55,3 +55,5 @@
JLoader::registerAlias('JRules', '\\Joomla\\Cms\\Access\\Rules', '4.0');

JLoader::registerAlias('JAuthenticationHelper', '\\Joomla\\Cms\\Authentication\\AuthenticationHelper', '4.0');

JLoader::registerAlias('JHelp', '\\Joomla\\Cms\\Help\\Help', '4.0');
@@ -1,20 +1,21 @@
<?php
/**
* @package Joomla.Libraries
* @subpackage Help
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Cms\Help;

defined('JPATH_PLATFORM') or die;

/**
* Help system class
*
* @since 1.5
*/
class JHelp
class Help
{
/**
* Create a URL for a given help key reference
Expand All @@ -31,11 +32,11 @@ class JHelp
public static function createUrl($ref, $useComponent = false, $override = null, $component = null)
{
$local = false;
$app = JFactory::getApplication();
$app = \JFactory::getApplication();

if (is_null($component))
{
$component = JApplicationHelper::getComponentName();
$component = \JApplicationHelper::getComponentName();
}

// Determine the location of the help file. At this stage the URL
Expand All @@ -48,7 +49,7 @@ public static function createUrl($ref, $useComponent = false, $override = null,
else
{
// Get the user help URL.
$user = JFactory::getUser();
$user = \JFactory::getUser();
$url = $user->getParam('helpsite');

// If user hasn't specified a help URL, then get the global one.
Expand All @@ -61,7 +62,7 @@ public static function createUrl($ref, $useComponent = false, $override = null,
if ($useComponent)
{
// Look for help URL in component parameters.
$params = JComponentHelper::getParams($component);
$params = \JComponentHelper::getParams($component);
$url = $params->get('helpURL');

if ($url == '')
Expand Down Expand Up @@ -91,13 +92,13 @@ public static function createUrl($ref, $useComponent = false, $override = null,
/*
* Replace substitution codes in the URL.
*/
$lang = JFactory::getLanguage();
$version = new JVersion;
$lang = \JFactory::getLanguage();
$version = new \JVersion;
$jver = explode('.', $version->getShortVersion());
$jlang = explode('-', $lang->getTag());

$debug = $lang->setDebug(false);
$keyref = JText::_($ref);
$keyref = \JText::_($ref);
$lang->setDebug($debug);

// Replace substitution codes in help URL.
Expand Down

0 comments on commit 4ad4088

Please sign in to comment.