Skip to content

Commit

Permalink
More work on namespacing helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Sep 20, 2017
1 parent fe2edc1 commit b9a386f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ plugins/*
!plugins/system/
plugins/system/*
!plugins/system/fabrik
!plugins/search/*
!plugins/search/
plugins/search/*
!plugins/search/fabrik
plugins/fabrik_list/download/libs
!plugins/system/fabrik/
!plugins/fabrik_element/
!plugins/fabrik_form/
plugins/fabrik_form/php/scripts/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
*/

namespace Fabrik\Helpers;

// No direct access
defined('_JEXEC') or die('Restricted access');

use \stdClass;

/**
* Google Map class
*
Expand All @@ -19,7 +23,7 @@
* @since 3.0
*/

class FabGoogleMapHelper
class Googlemap
{
/**
* Set the google map style
Expand Down Expand Up @@ -53,18 +57,18 @@ public static function styleJs($params)

for ($i = 0; $i < count($features); $i ++)
{
$feature = FArrayHelper::getValue($features, $i);
$element = FArrayHelper::getValue($elements, $i);
$feature = ArrayHelper::getValue($features, $i);
$element = ArrayHelper::getValue($elements, $i);
$key = $feature . '|' . $element;

if (!array_key_exists($key, $stylers))
{
$stylers[$key] = array();
}

$aStyle = new stdClass;
$styleKey = FArrayHelper::getValue($styleKeys, $i);
$styleValue = FArrayHelper::getValue($styleValues, $i);
$aStyle = new \stdClass;
$styleKey = ArrayHelper::getValue($styleKeys, $i);
$styleValue = ArrayHelper::getValue($styleValues, $i);

if ($styleKey && $styleValue)
{
Expand All @@ -77,7 +81,7 @@ public static function styleJs($params)

foreach ($stylers as $styleKey => $styler)
{
$o = new stdClass;
$o = new \stdClass;
$bits = explode('|', $styleKey);

if ( $bits[0] !== 'all')
Expand Down
2 changes: 2 additions & 0 deletions libraries/fabrik/fabrik/Helpers/arrayhelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use \stdClass;

/**
* Array helper class
*
Expand Down
1 change: 1 addition & 0 deletions libraries/fabrik/fabrik/Helpers/stringhelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;
use \stdClass;

/**
* String helpers
Expand Down
5 changes: 3 additions & 2 deletions plugins/fabrik_element/googlemap/googlemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
defined('_JEXEC') or die('Restricted access');

use Joomla\Utilities\ArrayHelper;
use Fabrik\Helpers\Googlemap;

require_once JPATH_SITE . '/components/com_fabrik/models/element.php';
require_once JPATH_SITE . '/components/com_fabrik/helpers/googlemap.php';


/**
* Plugin element to render a Google map
Expand Down Expand Up @@ -332,7 +333,7 @@ public function elementJavascript($repeatCounter)
|| $geocode_on_load == 3
);
$opts->auto_center = (bool) $params->get('fb_gm_auto_center', false);
$opts->styles = FabGoogleMapHelper::styleJs($params);
$opts->styles = Googlemap::styleJs($params);

if ($opts->geocode == '2')
{
Expand Down

0 comments on commit b9a386f

Please sign in to comment.