Skip to content

Commit

Permalink
using namespaced String class throughout code
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Dec 15, 2015
1 parent efcfee4 commit a126151
Show file tree
Hide file tree
Showing 233 changed files with 1,286 additions and 1,108 deletions.
6 changes: 4 additions & 2 deletions administrator/components/com_fabrik/classes/34/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

defined('JPATH_PLATFORM') or die;

use Joomla\String\String;

/**
* Abstract Form Field class for the Joomla Platform.
*
Expand Down Expand Up @@ -339,11 +341,11 @@ public function __construct($form = null)

if ($parts[0] == 'J')
{
$this->type = JString::ucfirst($parts[count($parts) - 1], '_');
$this->type = String::ucfirst($parts[count($parts) - 1], '_');
}
else
{
$this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
$this->type = String::ucfirst($parts[0], '_') . String::ucfirst($parts[count($parts) - 1], '_');
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_fabrik/classes/renderer/xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

/**
* Not used i think!
*
Expand Down Expand Up @@ -76,7 +78,7 @@ public function render()

foreach ($collection as $key => $val)
{
if (substr($key, 0, 1) !== '_' && JString::substr($key, 0, 6) !== 'fabrik' && $key !== 'slug')
if (substr($key, 0, 1) !== '_' && String::substr($key, 0, 6) !== 'fabrik' && $key !== 'slug')
{
$xml .= "\t\t<$key>" . htmlspecialchars($val, ENT_COMPAT, 'UTF-8') . "</$key>\n";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

$db = JFactory::getDbo();

// Load front end language file as well
Expand All @@ -23,7 +25,7 @@
$app = JFactory::getApplication();
$input = $app->input;
$option = $input->get('option');
$shortName = JString::substr($option, 4);
$shortName = String::substr($option, 4);
$query->select('id')->from('#__fabrik_packages')
->where('(component_name = ' . $db->quote($option) . ' OR component_name = ' . $db->quote($shortName) . ') AND external_ref <> ""')
->order('version DESC');
Expand Down Expand Up @@ -62,7 +64,7 @@
$controller = '';
}

$classname = 'FabrikController' . JString::ucfirst($controller);
$classname = 'FabrikController' . String::ucfirst($controller);

$config = array();
$config['base_path'] = JPATH_SITE . '/components/com_fabrik/';
Expand All @@ -77,7 +79,7 @@
{
$controller = explode('.', $input->getCmd('task'));
$controller = array_shift($controller);
$classname = 'FabrikController' . JString::ucfirst($controller);
$classname = 'FabrikController' . String::ucfirst($controller);
$path = JPATH_SITE . '/components/com_fabrik/controllers/' . $controller . '.php';

if (JFile::exists($path))
Expand All @@ -97,7 +99,7 @@
}
else
{
$classname = 'FabrikController' . JString::ucfirst($controller);
$classname = 'FabrikController' . String::ucfirst($controller);
$controller = new $classname($config);
$task = $input->getCmd('task');
}
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_fabrik/controllers/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

require_once 'fabcontrollerform.php';

/**
Expand Down Expand Up @@ -61,7 +63,7 @@ protected function addElements($model, $headings)
{
$element->id = 0;
$element->name = FabrikString::dbFieldName($elname);
$element->label = JString::strtolower($elname);
$element->label = String::strtolower($elname);
$element->plugin = $plugins[$c];
$element->group_id = $groupId;
$element->eval = 0;
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_fabrik/controllers/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

jimport('joomla.application.component.controller');

require_once 'fabcontrollerform.php';
Expand Down Expand Up @@ -57,7 +59,7 @@ public function pluginAjax()

if (substr($method, 0, 2) !== 'on')
{
$method = 'on' . JString::ucfirst($method);
$method = 'on' . String::ucfirst($method);
}

$dispatcher = JDispatcher::getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

jimport('joomla.application.component.controller');

require_once 'fabcontrollerform.php';
Expand Down Expand Up @@ -50,7 +52,7 @@ public function pluginAjax()

if (substr($method, 0, 2) !== 'on')
{
$method = 'on' . JString::ucfirst($method);
$method = 'on' . String::ucfirst($method);
}

$dispatcher = JDispatcher::getInstance();
Expand Down
6 changes: 4 additions & 2 deletions administrator/components/com_fabrik/fabrik.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_fabrik'))
{
Expand Down Expand Up @@ -39,7 +41,7 @@
// Check for plugin views (e.g. list email plugin's "email form"
$cName = $input->getCmd('controller');

if (JString::strpos($cName, '.') != false)
if (String::strpos($cName, '.') != false)
{
list($type, $name) = explode('.', $cName);

Expand All @@ -55,7 +57,7 @@
require_once $path;
$controller = $type . $name;

$classname = 'FabrikController' . JString::ucfirst($controller);
$classname = 'FabrikController' . String::ucfirst($controller);
$controller = new $classname;

// Add in plugin view
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_fabrik/fabrik.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extension client="site" method="upgrade" type="component" version="3">
<name>com_fabrik</name>
<creationDate>November 2015</creationDate>
<creationDate>December 2015</creationDate>
<author>Rob Clayburn</author>
<copyright>Copyright (C) 2005-2015 fabrikar.com - All rights reserved.</copyright>
<license>GNU/GPL http://www.gnu.org/copyleft/gpl.html</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.pollen-8.co.uk</authorUrl>
<version>3.3.4</version>
<version>3.4</version>
<description>COM_FABRIK_XML_DESCRIPTION</description>

<scriptfile>com_fabrik.manifest.class.php</scriptfile>
Expand Down
6 changes: 4 additions & 2 deletions administrator/components/com_fabrik/helpers/fabrik.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

/**
* Fabrik Component Helper
*
Expand Down Expand Up @@ -43,7 +45,7 @@ public static function prepareSaveDate(&$strdate)
}
else
{
if (JString::strlen(trim($strdate)) <= 10)
if (String::strlen(trim($strdate)) <= 10)
{
$strdate .= ' 00:00:00';
}
Expand Down Expand Up @@ -167,7 +169,7 @@ public static function filterText($text)

// Each group the user is in could have different filtering properties.
$filterData = $filters->$groupId;
$filterType = JString::strtoupper($filterData->filter_type);
$filterType = String::strtoupper($filterData->filter_type);

if ($filterType == 'NH')
{
Expand Down
12 changes: 7 additions & 5 deletions administrator/components/com_fabrik/models/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

jimport('joomla.application.component.modeladmin');

require_once 'fabmodeladmin.php';
Expand Down Expand Up @@ -435,7 +437,7 @@ public function validate($form, $data, $group = null)
}
}
// Strip <p> tag from label
$data['label'] = JString::str_ireplace(array('<p>', '</p>'), '', $data['label']);
$data['label'] = String::str_ireplace(array('<p>', '</p>'), '', $data['label']);

return count($this->getErrors()) == 0 ? $data : false;
}
Expand Down Expand Up @@ -897,7 +899,7 @@ private function updateIndexes(&$elementModel, &$listModel, &$row)
$fieldType = $elementModel->getFieldDescription();

// Int elements can't have a index size attribute
$size = JString::stristr($fieldType, 'int') || $fieldType == 'DATETIME' ? '' : '10';
$size = String::stristr($fieldType, 'int') || $fieldType == 'DATETIME' ? '' : '10';

if ($elementModel->getParams()->get('can_order'))
{
Expand Down Expand Up @@ -1325,10 +1327,10 @@ private function getValidations($elementModel, $usedPlugins = array())
{
if ($usedPlugin !== '')
{
$class = 'plgFabrik_Validationrule' . JString::ucfirst($usedPlugin);
$class = 'plgFabrik_Validationrule' . String::ucfirst($usedPlugin);
$conf = array();
$conf['name'] = JString::strtolower($usedPlugin);
$conf['type'] = JString::strtolower('fabrik_Validationrule');
$conf['name'] = String::strtolower($usedPlugin);
$conf['type'] = String::strtolower('fabrik_Validationrule');
$plugIn = new $class($dispatcher, $conf);
$oPlugin = JPluginHelper::getPlugin('fabrik_validationrule', $usedPlugin);
$plugIn->elementModel = $elementModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

require_once JPATH_ADMINISTRATOR . '/components/com_fabrik/helpers/element.php';

/**
Expand Down Expand Up @@ -42,7 +44,7 @@ class JFormFieldUploadsize extends JFormField
protected function _return_bytes($val)
{
$val = trim($val);
$last = JString::strtolower(JString::substr($val, -1));
$last = String::strtolower(String::substr($val, -1));

if ($last == 'g')
{
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_fabrik/models/package.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

require_once 'fabmodeladmin.php';

/**
Expand Down Expand Up @@ -230,7 +232,7 @@ public function save($data)

foreach ($blocks as $type => $values)
{
$tbl = JString::ucfirst($type);
$tbl = String::ucfirst($type);

foreach ($values as $id)
{
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_fabrik/pkg_fabrik.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<extension type="package" version="3" method="upgrade">
<name>Fabrik Package</name>
<packagename>fabrik</packagename>
<version>3.3.4</version>
<version>3.4</version>
<url>http://www.fabrikar.com</url>
<creationDate>November 2015</creationDate>
<creationDate>December 2015</creationDate>
<copyright>Copyright (C) 2005-2015 fabrikar.com - All rights reserved.</copyright>
<author>Fabrik</author>
<packager>Rob Clayburn</packager>
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_fabrik/pkg_fabrik_sink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<extension type="package" version="3">
<name>Fabrik Package</name>
<packagename>fabrik</packagename>
<version>3.3.4</version>
<version>3.4</version>
<url>http://www.joomla.org</url>
<packager>Rob Clayburn</packager>
<packagerurl>http://www.fabrikar.com</packagerurl>
<creationDate>November 2015</creationDate>
<creationDate>December 2015</creationDate>
<copyright>Copyright (C) 2005-2015 fabrikar.com - All rights reserved.</copyright>
<description>Fabrik Free Package</description>
<update>http://fabrikar.com/update/packages/free</update>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

FabrikHelperHTML::formvalidation();
$db = FabrikWorker::getDbo(true);
?>
Expand All @@ -22,7 +24,7 @@
<?php echo JText::sprintf('COM_FABRIK_UPDATE_ELEMENT_NAME', $this->oldName, $db->qn($this->item->name)); ?>
</li>
<?php endif; ?>
<?php if (JString::strtolower($this->origDesc) !== JString::strtolower($this->newDesc)) :?>
<?php if (String::strtolower($this->origDesc) !== String::strtolower($this->newDesc)) :?>
<li style="padding-left:30px">
<?php echo JText::sprintf('COM_FABRIK_UPDATE_ELEMENT_STRUCTURE', $this->oldName, $this->origDesc, $this->newDesc); ?>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

jimport('joomla.application.component.view');

/**
Expand Down Expand Up @@ -91,7 +93,7 @@ public function sendMail(&$email)
{
foreach ($badStrings as $v2)
{
if (JString::strpos($v, $v2) !== false)
if (String::strpos($v, $v2) !== false)
{
throw new RuntimeException(FText::_('JERROR_ALERTNOAUTHOR'), 500);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

$app = JFactory::getApplication();
$input = $app->input;
$jform = $input->get('jform', array(), 'array');
Expand Down Expand Up @@ -43,7 +45,7 @@
$heading = trim($this->newHeadings[$i]);
$sample = '';
foreach ($this->headings as $sKey => $sVal) :
if(JString::strtolower($heading) == JString::strtolower($sVal)) :
if(String::strtolower($heading) == String::strtolower($sVal)) :
$sample = $this->sample[$sKey];
endif;
endforeach;
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_fabrik/views/list/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

use Joomla\String\String;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHTML::stylesheet('administrator/components/com_fabrik/views/fabrikadmin.css');
JHtml::_('behavior.tooltip');
Expand Down Expand Up @@ -80,7 +82,7 @@
<?php foreach ($panel['fieldset'] as $fieldset) :
foreach ($this->form->getFieldset($fieldset) as $field) :?>
<li>
<?php if (JString::strtolower($field->type) != 'hidden') {
<?php if (String::strtolower($field->type) != 'hidden') {
echo $field->label;
} ?>
<?php echo $field->input; ?>
Expand Down
4 changes: 2 additions & 2 deletions administrator/modules/mod_fabrik_form/mod_fabrik_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension client="administrator" method="upgrade" type="module" version="3">
<name>mod_fabrik_form</name>
<author>Rob Clayburn</author>
<creationDate>November 2015</creationDate>
<creationDate>December 2015</creationDate>
<copyright>Copyright (C) 2005-2015 fabrikar.com - All rights reserved.</copyright>
<license>GNU/GPL http://www.gnu.org/copyleft/gpl.html</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.fabrikar.com</authorUrl>
<version>3.3.4</version>
<version>3.4</version>
<description>MOD_FABRIK_FORM_XML_DESCRIPTION</description>
<files>
<filename module="mod_fabrik_form">mod_fabrik_form.php</filename>
Expand Down
Loading

0 comments on commit a126151

Please sign in to comment.