Made some changes to insure JCB is stable in PHP7, removed the related translations string from joomla_component view to speed up page load.
This commit is contained in:
@ -1591,7 +1591,7 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the Component xml manifest.
|
||||
**/
|
||||
@ -1600,12 +1600,12 @@ abstract class ComponentbuilderHelper
|
||||
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml";
|
||||
return simplexml_load_file($manifestUrl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Joomla version object
|
||||
**/
|
||||
protected static $JVersion;
|
||||
|
||||
|
||||
/**
|
||||
* set/get Joomla version
|
||||
**/
|
||||
@ -1772,7 +1772,7 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add to asset Table
|
||||
*/
|
||||
@ -1836,7 +1836,7 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the default asset Rules for a component/view.
|
||||
*/
|
||||
@ -2141,7 +2141,7 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the actions permissions
|
||||
**/
|
||||
@ -2333,7 +2333,14 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if have an json string
|
||||
*
|
||||
* @input string The json string to check
|
||||
*
|
||||
* @returns bool true on success
|
||||
**/
|
||||
public static function checkJson($string)
|
||||
{
|
||||
if (self::checkString($string))
|
||||
@ -2344,15 +2351,29 @@ abstract class ComponentbuilderHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if have an object with a length
|
||||
*
|
||||
* @input object The object to check
|
||||
*
|
||||
* @returns bool true on success
|
||||
**/
|
||||
public static function checkObject($object)
|
||||
{
|
||||
if (isset($object) && is_object($object) && count($object) > 0)
|
||||
if (isset($object) && is_object($object))
|
||||
{
|
||||
return true;
|
||||
return count((array)$object) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if have an array with a length
|
||||
*
|
||||
* @input array The array to check
|
||||
*
|
||||
* @returns bool true on success
|
||||
**/
|
||||
public static function checkArray($array, $removeEmptyString = false)
|
||||
{
|
||||
if (isset($array) && is_array($array) && count($array) > 0)
|
||||
@ -2374,6 +2395,13 @@ abstract class ComponentbuilderHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if have a string with a length
|
||||
*
|
||||
* @input string The string to check
|
||||
*
|
||||
* @returns bool true on success
|
||||
**/
|
||||
public static function checkString($string)
|
||||
{
|
||||
if (isset($string) && is_string($string) && strlen($string) > 0)
|
||||
@ -2382,7 +2410,7 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if we are connected
|
||||
* Thanks https://stackoverflow.com/a/4860432/1429677
|
||||
@ -2408,6 +2436,13 @@ abstract class ComponentbuilderHelper
|
||||
return $is_conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge an array of array's
|
||||
*
|
||||
* @input array The arrays you would like to merge
|
||||
*
|
||||
* @returns array on success
|
||||
**/
|
||||
public static function mergeArrays($arrays)
|
||||
{
|
||||
if(self::checkArray($arrays))
|
||||
@ -2431,6 +2466,13 @@ abstract class ComponentbuilderHelper
|
||||
return self::shorten($string, $length, $addTip);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorten a string
|
||||
*
|
||||
* @input string The you would like to shorten
|
||||
*
|
||||
* @returns string on success
|
||||
**/
|
||||
public static function shorten($string, $length = 40, $addTip = true)
|
||||
{
|
||||
if (self::checkString($string))
|
||||
@ -2465,6 +2507,13 @@ abstract class ComponentbuilderHelper
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Making strings safe (various ways)
|
||||
*
|
||||
* @input string The you would like to make safe
|
||||
*
|
||||
* @returns string on success
|
||||
**/
|
||||
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
|
||||
{
|
||||
if ($replaceNumbers === true)
|
||||
@ -2592,7 +2641,7 @@ abstract class ComponentbuilderHelper
|
||||
// return the string with no numbers remaining.
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert an integer into an English word string
|
||||
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
|
||||
|
Reference in New Issue
Block a user