Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
691aa81981
|
|||
bb73fe044e
|
|||
5f1d17bfb3
|
|||
eda4d594d6
|
|||
3a2b8497e3
|
|||
2564b75e5d
|
|||
f314464575 | |||
477609886a | |||
e83319635a | |||
b078d7f01f | |||
f309e2e727 | |||
ddd940e968 | |||
c006572674 |
14
README.md
14
README.md
@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
|||||||
|
|
||||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
|
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
|
||||||
|
|
||||||
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.13) with **ALL** its features and **ALL** concepts totally open-source and free!
|
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.11.2) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||||
|
|
||||||
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||||
|
|
||||||
@ -144,14 +144,14 @@ TODO
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 3rd April, 2020
|
+ *Last Build*: 25th May, 2020
|
||||||
+ *Version*: 2.10.13
|
+ *Version*: 2.11.2
|
||||||
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
|
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
|
||||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
+ *Line count*: **280662**
|
+ *Line count*: **282168**
|
||||||
+ *Field count*: **1514**
|
+ *Field count*: **1522**
|
||||||
+ *File count*: **1771**
|
+ *File count*: **1783**
|
||||||
+ *Folder count*: **287**
|
+ *Folder count*: **295**
|
||||||
|
|
||||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
||||||
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||||
|
@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
|||||||
|
|
||||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
|
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
|
||||||
|
|
||||||
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.13) with **ALL** its features and **ALL** concepts totally open-source and free!
|
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.11.2) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||||
|
|
||||||
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||||
|
|
||||||
@ -144,14 +144,14 @@ TODO
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 3rd April, 2020
|
+ *Last Build*: 25th May, 2020
|
||||||
+ *Version*: 2.10.13
|
+ *Version*: 2.11.2
|
||||||
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
|
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
|
||||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
+ *Line count*: **280662**
|
+ *Line count*: **282168**
|
||||||
+ *Field count*: **1514**
|
+ *Field count*: **1522**
|
||||||
+ *File count*: **1771**
|
+ *File count*: **1783**
|
||||||
+ *Folder count*: **287**
|
+ *Folder count*: **295**
|
||||||
|
|
||||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
||||||
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.fieldMedium { width: 120px; }
|
.fieldMedium { width: 120px; }
|
||||||
|
.fieldLarge { width: 320px; }
|
||||||
.fieldMid { width: 80px; }
|
.fieldMid { width: 80px; }
|
||||||
.fieldFull { width: 100%; }
|
.fieldFull { width: 100%; }
|
||||||
.fieldSmall { width: 60px; }
|
.fieldSmall { width: 60px; }
|
||||||
|
@ -19,13 +19,20 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
|
|
||||||
use Joomla\CMS\Language\Language;
|
use Joomla\CMS\Language\Language;
|
||||||
use Joomla\String\StringHelper;
|
use Joomla\String\StringHelper;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;###ADMIN_HELPER_CLASS_HEADER###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### component helper.
|
* ###Component### component helper.
|
||||||
*/
|
*/
|
||||||
abstract class ###Component###Helper
|
abstract class ###Component###Helper
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Composer Switch
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected static $composer = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Main Active Language
|
* The Main Active Language
|
||||||
*
|
*
|
||||||
@ -34,8 +41,28 @@ abstract class ###Component###Helper
|
|||||||
public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the Component xml manifest.
|
* Load the Composer Vendors
|
||||||
**/
|
*/
|
||||||
|
public static function composerAutoload($target)
|
||||||
|
{
|
||||||
|
// insure we load the composer vendor only once
|
||||||
|
if (!isset(self::$composer[$target]))
|
||||||
|
{
|
||||||
|
// get the function name
|
||||||
|
$functionName = self::safeString('compose' . $target);
|
||||||
|
// check if method exist
|
||||||
|
if (method_exists(__CLASS__, $functionName))
|
||||||
|
{
|
||||||
|
return self::{$functionName}();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return self::$composer[$target];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the Component xml manifest.
|
||||||
|
*/
|
||||||
public static function manifest()
|
public static function manifest()
|
||||||
{
|
{
|
||||||
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
||||||
@ -43,13 +70,13 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla version object
|
* Joomla version object
|
||||||
**/
|
*/
|
||||||
protected static $JVersion;
|
protected static $JVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set/get Joomla version
|
* set/get Joomla version
|
||||||
**/
|
*/
|
||||||
public static function jVersion()
|
public static function jVersion()
|
||||||
{
|
{
|
||||||
// check if set
|
// check if set
|
||||||
@ -61,8 +88,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the Contributors details.
|
* Load the Contributors details.
|
||||||
**/
|
*/
|
||||||
public static function getContributors()
|
public static function getContributors()
|
||||||
{
|
{
|
||||||
// get params
|
// get params
|
||||||
@ -99,8 +126,8 @@ abstract class ###Component###Helper
|
|||||||
}###HELP###
|
}###HELP###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the Linkbar.
|
* Configure the Linkbar.
|
||||||
**/
|
*/
|
||||||
public static function addSubmenu($submenu)
|
public static function addSubmenu($submenu)
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
@ -320,18 +347,18 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the action permissions
|
* Get the action permissions
|
||||||
*
|
*
|
||||||
* @param string $view The related view name
|
* @param string $view The related view name
|
||||||
* @param int $record The item to act upon
|
* @param int $record The item to act upon
|
||||||
* @param string $views The related list view name
|
* @param string $views The related list view name
|
||||||
* @param mixed $target Only get this permission (like edit, create, delete)
|
* @param mixed $target Only get this permission (like edit, create, delete)
|
||||||
* @param string $component The target component
|
* @param string $component The target component
|
||||||
* @param object $user The user whose permissions we are loading
|
* @param object $user The user whose permissions we are loading
|
||||||
*
|
*
|
||||||
* @return object The JObject of permission/authorised actions
|
* @return object The JObject of permission/authorised actions
|
||||||
*
|
*
|
||||||
**/
|
*/
|
||||||
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
||||||
{
|
{
|
||||||
// load the user if not given
|
// load the user if not given
|
||||||
@ -495,14 +522,14 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the action permissions
|
* Filter the action permissions
|
||||||
*
|
*
|
||||||
* @param string $action The action to check
|
* @param string $action The action to check
|
||||||
* @param array $targets The array of target actions
|
* @param array $targets The array of target actions
|
||||||
*
|
*
|
||||||
* @return boolean true if action should be filtered out
|
* @return boolean true if action should be filtered out
|
||||||
*
|
*
|
||||||
**/
|
*/
|
||||||
protected static function filterActions(&$view, &$action, &$targets)
|
protected static function filterActions(&$view, &$action, &$targets)
|
||||||
{
|
{
|
||||||
foreach ($targets as $target)
|
foreach ($targets as $target)
|
||||||
@ -518,8 +545,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get any component's model
|
* Get any component's model
|
||||||
**/
|
*/
|
||||||
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array())
|
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array())
|
||||||
{
|
{
|
||||||
// fix the name
|
// fix the name
|
||||||
@ -566,8 +593,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to asset Table
|
* Add to asset Table
|
||||||
*/
|
*/
|
||||||
public static function setAsset($id, $table, $inherit = true)
|
public static function setAsset($id, $table, $inherit = true)
|
||||||
{
|
{
|
||||||
$parent = JTable::getInstance('Asset');
|
$parent = JTable::getInstance('Asset');
|
||||||
@ -874,12 +901,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have an json string
|
* Check if have an json string
|
||||||
*
|
*
|
||||||
* @input string The json string to check
|
* @input string The json string to check
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function checkJson($string)
|
public static function checkJson($string)
|
||||||
{
|
{
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
@ -891,12 +918,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have an object with a length
|
* Check if have an object with a length
|
||||||
*
|
*
|
||||||
* @input object The object to check
|
* @input object The object to check
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function checkObject($object)
|
public static function checkObject($object)
|
||||||
{
|
{
|
||||||
if (isset($object) && is_object($object))
|
if (isset($object) && is_object($object))
|
||||||
@ -907,12 +934,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have an array with a length
|
* Check if have an array with a length
|
||||||
*
|
*
|
||||||
* @input array The array to check
|
* @input array The array to check
|
||||||
*
|
*
|
||||||
* @returns bool/int number of items in array on success
|
* @returns bool/int number of items in array on success
|
||||||
**/
|
*/
|
||||||
public static function checkArray($array, $removeEmptyString = false)
|
public static function checkArray($array, $removeEmptyString = false)
|
||||||
{
|
{
|
||||||
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
|
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
|
||||||
@ -935,12 +962,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have a string with a length
|
* Check if have a string with a length
|
||||||
*
|
*
|
||||||
* @input string The string to check
|
* @input string The string to check
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function checkString($string)
|
public static function checkString($string)
|
||||||
{
|
{
|
||||||
if (isset($string) && is_string($string) && strlen($string) > 0)
|
if (isset($string) && is_string($string) && strlen($string) > 0)
|
||||||
@ -951,11 +978,11 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we are connected
|
* Check if we are connected
|
||||||
* Thanks https://stackoverflow.com/a/4860432/1429677
|
* Thanks https://stackoverflow.com/a/4860432/1429677
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function isConnected()
|
public static function isConnected()
|
||||||
{
|
{
|
||||||
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
|
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
|
||||||
@ -976,12 +1003,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge an array of array's
|
* Merge an array of array's
|
||||||
*
|
*
|
||||||
* @input array The arrays you would like to merge
|
* @input array The arrays you would like to merge
|
||||||
*
|
*
|
||||||
* @returns array on success
|
* @returns array on success
|
||||||
**/
|
*/
|
||||||
public static function mergeArrays($arrays)
|
public static function mergeArrays($arrays)
|
||||||
{
|
{
|
||||||
if(self::checkArray($arrays))
|
if(self::checkArray($arrays))
|
||||||
@ -1006,12 +1033,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shorten a string
|
* Shorten a string
|
||||||
*
|
*
|
||||||
* @input string The you would like to shorten
|
* @input string The you would like to shorten
|
||||||
*
|
*
|
||||||
* @returns string on success
|
* @returns string on success
|
||||||
**/
|
*/
|
||||||
public static function shorten($string, $length = 40, $addTip = true)
|
public static function shorten($string, $length = 40, $addTip = true)
|
||||||
{
|
{
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
@ -1047,12 +1074,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Making strings safe (various ways)
|
* Making strings safe (various ways)
|
||||||
*
|
*
|
||||||
* @input string The you would like to make safe
|
* @input string The you would like to make safe
|
||||||
*
|
*
|
||||||
* @returns string on success
|
* @returns string on success
|
||||||
**/
|
*/
|
||||||
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
|
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
|
||||||
{
|
{
|
||||||
if ($replaceNumbers === true)
|
if ($replaceNumbers === true)
|
||||||
@ -1206,12 +1233,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an integer into an English word string
|
* Convert an integer into an English word string
|
||||||
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
|
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
|
||||||
*
|
*
|
||||||
* @input an int
|
* @input an int
|
||||||
* @returns a string
|
* @returns a string
|
||||||
**/
|
*/
|
||||||
public static function numberToString($x)
|
public static function numberToString($x)
|
||||||
{
|
{
|
||||||
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
|
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
|
||||||
@ -1297,10 +1324,10 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Random Key
|
* Random Key
|
||||||
*
|
*
|
||||||
* @returns a string
|
* @returns a string
|
||||||
**/
|
*/
|
||||||
public static function randomkey($size)
|
public static function randomkey($size)
|
||||||
{
|
{
|
||||||
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
|
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
|
||||||
|
@ -19,13 +19,20 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
|
|
||||||
use Joomla\CMS\Language\Language;
|
use Joomla\CMS\Language\Language;
|
||||||
use Joomla\String\StringHelper;
|
use Joomla\String\StringHelper;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;###SITE_HELPER_CLASS_HEADER###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### component helper
|
* ###Component### component helper
|
||||||
*/
|
*/
|
||||||
abstract class ###Component###Helper
|
abstract class ###Component###Helper
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Composer Switch
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected static $composer = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Main Active Language
|
* The Main Active Language
|
||||||
*
|
*
|
||||||
@ -33,6 +40,29 @@ abstract class ###Component###Helper
|
|||||||
*/
|
*/
|
||||||
public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the Composer Vendors
|
||||||
|
*/
|
||||||
|
public static function composerAutoload($target)
|
||||||
|
{
|
||||||
|
// insure we load the composer vendor only once
|
||||||
|
if (!isset(self::$composer[$target]))
|
||||||
|
{
|
||||||
|
// get the function name
|
||||||
|
$functionName = self::safeString('compose' . $target);
|
||||||
|
// check if method exist
|
||||||
|
if (method_exists(__CLASS__, $functionName))
|
||||||
|
{
|
||||||
|
return self::{$functionName}();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return self::$composer[$target];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert it into a string
|
||||||
|
*/
|
||||||
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
|
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
|
||||||
{
|
{
|
||||||
// do some table foot work
|
// do some table foot work
|
||||||
@ -82,8 +112,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the Component xml manifest.
|
* Load the Component xml manifest.
|
||||||
**/
|
*/
|
||||||
public static function manifest()
|
public static function manifest()
|
||||||
{
|
{
|
||||||
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
||||||
@ -91,13 +121,13 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla version object
|
* Joomla version object
|
||||||
**/
|
*/
|
||||||
protected static $JVersion;
|
protected static $JVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set/get Joomla version
|
* set/get Joomla version
|
||||||
**/
|
*/
|
||||||
public static function jVersion()
|
public static function jVersion()
|
||||||
{
|
{
|
||||||
// check if set
|
// check if set
|
||||||
@ -109,8 +139,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the Contributors details.
|
* Load the Contributors details.
|
||||||
**/
|
*/
|
||||||
public static function getContributors()
|
public static function getContributors()
|
||||||
{
|
{
|
||||||
// get params
|
// get params
|
||||||
@ -147,8 +177,8 @@ abstract class ###Component###Helper
|
|||||||
}###HELP_SITE###
|
}###HELP_SITE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get any component's model
|
* Get any component's model
|
||||||
**/
|
*/
|
||||||
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array())
|
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array())
|
||||||
{
|
{
|
||||||
// fix the name
|
// fix the name
|
||||||
@ -195,8 +225,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to asset Table
|
* Add to asset Table
|
||||||
*/
|
*/
|
||||||
public static function setAsset($id, $table, $inherit = true)
|
public static function setAsset($id, $table, $inherit = true)
|
||||||
{
|
{
|
||||||
$parent = JTable::getInstance('Asset');
|
$parent = JTable::getInstance('Asset');
|
||||||
@ -665,18 +695,18 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the action permissions
|
* Get the action permissions
|
||||||
*
|
*
|
||||||
* @param string $view The related view name
|
* @param string $view The related view name
|
||||||
* @param int $record The item to act upon
|
* @param int $record The item to act upon
|
||||||
* @param string $views The related list view name
|
* @param string $views The related list view name
|
||||||
* @param mixed $target Only get this permission (like edit, create, delete)
|
* @param mixed $target Only get this permission (like edit, create, delete)
|
||||||
* @param string $component The target component
|
* @param string $component The target component
|
||||||
* @param object $user The user whose permissions we are loading
|
* @param object $user The user whose permissions we are loading
|
||||||
*
|
*
|
||||||
* @return object The JObject of permission/authorised actions
|
* @return object The JObject of permission/authorised actions
|
||||||
*
|
*
|
||||||
**/
|
*/
|
||||||
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
||||||
{
|
{
|
||||||
// load the user if not given
|
// load the user if not given
|
||||||
@ -840,14 +870,14 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the action permissions
|
* Filter the action permissions
|
||||||
*
|
*
|
||||||
* @param string $action The action to check
|
* @param string $action The action to check
|
||||||
* @param array $targets The array of target actions
|
* @param array $targets The array of target actions
|
||||||
*
|
*
|
||||||
* @return boolean true if action should be filtered out
|
* @return boolean true if action should be filtered out
|
||||||
*
|
*
|
||||||
**/
|
*/
|
||||||
protected static function filterActions(&$view, &$action, &$targets)
|
protected static function filterActions(&$view, &$action, &$targets)
|
||||||
{
|
{
|
||||||
foreach ($targets as $target)
|
foreach ($targets as $target)
|
||||||
@ -863,12 +893,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have an json string
|
* Check if have an json string
|
||||||
*
|
*
|
||||||
* @input string The json string to check
|
* @input string The json string to check
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function checkJson($string)
|
public static function checkJson($string)
|
||||||
{
|
{
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
@ -880,12 +910,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have an object with a length
|
* Check if have an object with a length
|
||||||
*
|
*
|
||||||
* @input object The object to check
|
* @input object The object to check
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function checkObject($object)
|
public static function checkObject($object)
|
||||||
{
|
{
|
||||||
if (isset($object) && is_object($object))
|
if (isset($object) && is_object($object))
|
||||||
@ -896,12 +926,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have an array with a length
|
* Check if have an array with a length
|
||||||
*
|
*
|
||||||
* @input array The array to check
|
* @input array The array to check
|
||||||
*
|
*
|
||||||
* @returns bool/int number of items in array on success
|
* @returns bool/int number of items in array on success
|
||||||
**/
|
*/
|
||||||
public static function checkArray($array, $removeEmptyString = false)
|
public static function checkArray($array, $removeEmptyString = false)
|
||||||
{
|
{
|
||||||
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
|
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
|
||||||
@ -924,12 +954,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if have a string with a length
|
* Check if have a string with a length
|
||||||
*
|
*
|
||||||
* @input string The string to check
|
* @input string The string to check
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function checkString($string)
|
public static function checkString($string)
|
||||||
{
|
{
|
||||||
if (isset($string) && is_string($string) && strlen($string) > 0)
|
if (isset($string) && is_string($string) && strlen($string) > 0)
|
||||||
@ -940,11 +970,11 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we are connected
|
* Check if we are connected
|
||||||
* Thanks https://stackoverflow.com/a/4860432/1429677
|
* Thanks https://stackoverflow.com/a/4860432/1429677
|
||||||
*
|
*
|
||||||
* @returns bool true on success
|
* @returns bool true on success
|
||||||
**/
|
*/
|
||||||
public static function isConnected()
|
public static function isConnected()
|
||||||
{
|
{
|
||||||
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
|
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
|
||||||
@ -965,12 +995,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge an array of array's
|
* Merge an array of array's
|
||||||
*
|
*
|
||||||
* @input array The arrays you would like to merge
|
* @input array The arrays you would like to merge
|
||||||
*
|
*
|
||||||
* @returns array on success
|
* @returns array on success
|
||||||
**/
|
*/
|
||||||
public static function mergeArrays($arrays)
|
public static function mergeArrays($arrays)
|
||||||
{
|
{
|
||||||
if(self::checkArray($arrays))
|
if(self::checkArray($arrays))
|
||||||
@ -995,12 +1025,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shorten a string
|
* Shorten a string
|
||||||
*
|
*
|
||||||
* @input string The you would like to shorten
|
* @input string The you would like to shorten
|
||||||
*
|
*
|
||||||
* @returns string on success
|
* @returns string on success
|
||||||
**/
|
*/
|
||||||
public static function shorten($string, $length = 40, $addTip = true)
|
public static function shorten($string, $length = 40, $addTip = true)
|
||||||
{
|
{
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
@ -1036,12 +1066,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Making strings safe (various ways)
|
* Making strings safe (various ways)
|
||||||
*
|
*
|
||||||
* @input string The you would like to make safe
|
* @input string The you would like to make safe
|
||||||
*
|
*
|
||||||
* @returns string on success
|
* @returns string on success
|
||||||
**/
|
*/
|
||||||
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
|
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
|
||||||
{
|
{
|
||||||
if ($replaceNumbers === true)
|
if ($replaceNumbers === true)
|
||||||
@ -1195,12 +1225,12 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an integer into an English word string
|
* Convert an integer into an English word string
|
||||||
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
|
* Thanks to Tom Nicholson <http://php.net/manual/en/function.strval.php#41988>
|
||||||
*
|
*
|
||||||
* @input an int
|
* @input an int
|
||||||
* @returns a string
|
* @returns a string
|
||||||
**/
|
*/
|
||||||
public static function numberToString($x)
|
public static function numberToString($x)
|
||||||
{
|
{
|
||||||
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
|
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
|
||||||
@ -1286,10 +1316,10 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Random Key
|
* Random Key
|
||||||
*
|
*
|
||||||
* @returns a string
|
* @returns a string
|
||||||
**/
|
*/
|
||||||
public static function randomkey($size)
|
public static function randomkey($size)
|
||||||
{
|
{
|
||||||
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
|
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Views### Controller
|
* ###Views### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###SViews### Controller
|
* ###SViews### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###View### Controller
|
* ###View### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###SView### Controller
|
* ###Component### ###SView### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###View### Controller
|
* ###View### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General Controller of ###Component### component
|
* General Controller of ###Component### component
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Ajax Controller
|
* ###Component### Ajax Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Ajax Controller
|
* ###Component### Ajax Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Help Controller
|
* ###Component### Help Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Help Controller
|
* ###Component### Help Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Component Controller
|
* ###Component### Component Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###SView### Controller
|
* ###Component### ###SView### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Import Controller
|
* ###Component### Import Controller
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###View### Controller
|
* ###Component### ###View### Controller
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
|
use Joomla\String\StringHelper;
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###View### Model
|
* ###Component### ###View### Model
|
||||||
@ -303,7 +305,7 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
{
|
{
|
||||||
// Sanitize ids.
|
// Sanitize ids.
|
||||||
$pks = array_unique($pks);
|
$pks = array_unique($pks);
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
|
|
||||||
// Remove any values of zero.
|
// Remove any values of zero.
|
||||||
if (array_search(0, $pks, true))
|
if (array_search(0, $pks, true))
|
||||||
@ -344,7 +346,7 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
|
|
||||||
if (!empty($commands['move_copy']))
|
if (!empty($commands['move_copy']))
|
||||||
{
|
{
|
||||||
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
|
$cmd = ArrayHelper::getValue($commands, 'move_copy', 'c');
|
||||||
|
|
||||||
if ($cmd == 'c')
|
if ($cmd == 'c')
|
||||||
{
|
{
|
||||||
@ -424,7 +426,7 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to generate a uniqe value.
|
* Method to generate a unique value.
|
||||||
*
|
*
|
||||||
* @param string $field name.
|
* @param string $field name.
|
||||||
* @param string $value data.
|
* @param string $value data.
|
||||||
@ -433,15 +435,15 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
protected function generateUniqe($field,$value)
|
protected function generateUnique($field,$value)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set field value uniqe
|
// set field value unique
|
||||||
$table = $this->getTable();
|
$table = $this->getTable();
|
||||||
|
|
||||||
while ($table->load(array($field => $value)))
|
while ($table->load(array($field => $value)))
|
||||||
{
|
{
|
||||||
$value = JString::increment($value);
|
$value = StringHelper::increment($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -18,6 +18,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
|
use Joomla\String\StringHelper;
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###View### Model
|
* ###Component### ###View### Model
|
||||||
@ -303,7 +305,7 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
{
|
{
|
||||||
// Sanitize ids.
|
// Sanitize ids.
|
||||||
$pks = array_unique($pks);
|
$pks = array_unique($pks);
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
|
|
||||||
// Remove any values of zero.
|
// Remove any values of zero.
|
||||||
if (array_search(0, $pks, true))
|
if (array_search(0, $pks, true))
|
||||||
@ -344,7 +346,7 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
|
|
||||||
if (!empty($commands['move_copy']))
|
if (!empty($commands['move_copy']))
|
||||||
{
|
{
|
||||||
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
|
$cmd = ArrayHelper::getValue($commands, 'move_copy', 'c');
|
||||||
|
|
||||||
if ($cmd == 'c')
|
if ($cmd == 'c')
|
||||||
{
|
{
|
||||||
@ -424,7 +426,7 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to generate a uniqe value.
|
* Method to generate a unique value.
|
||||||
*
|
*
|
||||||
* @param string $field name.
|
* @param string $field name.
|
||||||
* @param string $value data.
|
* @param string $value data.
|
||||||
@ -433,15 +435,15 @@ class ###Component###Model###View### extends JModelAdmin
|
|||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
protected function generateUniqe($field,$value)
|
protected function generateUnique($field,$value)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set field value uniqe
|
// set field value unique
|
||||||
$table = $this->getTable();
|
$table = $this->getTable();
|
||||||
|
|
||||||
while ($table->load(array($field => $value)))
|
while ($table->load(array($field => $value)))
|
||||||
{
|
{
|
||||||
$value = JString::increment($value);
|
$value = StringHelper::increment($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###SView### Model
|
* ###Component### ###SView### Model
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###SView### Model
|
* ###Component### ###SView### Model
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Import Model
|
* ###Component### Import Model
|
||||||
*/
|
*/
|
||||||
@ -360,29 +363,7 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
$check['type'] = $this->getType;
|
$check['type'] = $this->getType;
|
||||||
|
|
||||||
return $check;
|
return $check;
|
||||||
}
|
}###IMPORT_EXT_METHOD###
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the extension
|
|
||||||
*
|
|
||||||
* @param string $file Name of the uploaded file
|
|
||||||
*
|
|
||||||
* @return boolean True on success
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
protected function checkExtension($file)
|
|
||||||
{
|
|
||||||
// check the extention
|
|
||||||
switch(strtolower(pathinfo($file, PATHINFO_EXTENSION)))
|
|
||||||
{
|
|
||||||
case 'xls':
|
|
||||||
case 'ods':
|
|
||||||
case 'csv':
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up temporary uploaded spreadsheet
|
* Clean up temporary uploaded spreadsheet
|
||||||
@ -409,262 +390,7 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
// It might also be just a base filename
|
// It might also be just a base filename
|
||||||
JFile::delete(JPath::clean($package));
|
JFile::delete(JPath::clean($package));
|
||||||
}
|
}
|
||||||
}
|
}###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD###
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the data from the spreadsheet to the database
|
|
||||||
*
|
|
||||||
* @param string $package Paths to the uploaded package file
|
|
||||||
*
|
|
||||||
* @return boolean false on failure
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
protected function setData($package,$table,$target_headers)
|
|
||||||
{
|
|
||||||
if (###Component###Helper::checkArray($target_headers))
|
|
||||||
{
|
|
||||||
// make sure the file is loaded
|
|
||||||
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
|
|
||||||
$jinput = JFactory::getApplication()->input;
|
|
||||||
foreach($target_headers as $header)
|
|
||||||
{
|
|
||||||
$data['target_headers'][$header] = $jinput->getString($header, null);
|
|
||||||
}
|
|
||||||
// set the data
|
|
||||||
if(isset($package['dir']))
|
|
||||||
{
|
|
||||||
$inputFileType = PHPExcel_IOFactory::identify($package['dir']);
|
|
||||||
$excelReader = PHPExcel_IOFactory::createReader($inputFileType);
|
|
||||||
$excelReader->setReadDataOnly(true);
|
|
||||||
$excelObj = $excelReader->load($package['dir']);
|
|
||||||
$data['array'] = $excelObj->getActiveSheet()->toArray(null, true,true,true);
|
|
||||||
$excelObj->disconnectWorksheets();
|
|
||||||
unset($excelObj);
|
|
||||||
return $this->save($data,$table);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save the data from the file to the database
|
|
||||||
*
|
|
||||||
* @param string $package Paths to the uploaded package file
|
|
||||||
*
|
|
||||||
* @return boolean false on failure
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
protected function save($data,$table)
|
|
||||||
{
|
|
||||||
// import the data if there is any
|
|
||||||
if(###Component###Helper::checkArray($data['array']))
|
|
||||||
{
|
|
||||||
// get user object
|
|
||||||
$user = JFactory::getUser();
|
|
||||||
// remove header if it has headers
|
|
||||||
$id_key = $data['target_headers']['id'];
|
|
||||||
$published_key = $data['target_headers']['published'];
|
|
||||||
$ordering_key = $data['target_headers']['ordering'];
|
|
||||||
// get the first array set
|
|
||||||
$firstSet = reset($data['array']);
|
|
||||||
|
|
||||||
// check if first array is a header array and remove if true
|
|
||||||
if($firstSet[$id_key] == 'id' || $firstSet[$published_key] == 'published' || $firstSet[$ordering_key] == 'ordering')
|
|
||||||
{
|
|
||||||
array_shift($data['array']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure there is still values in array and that it was not only headers
|
|
||||||
if(###Component###Helper::checkArray($data['array']) && $user->authorise($table.'.import', 'com_###component###') && $user->authorise('core.import', 'com_###component###'))
|
|
||||||
{
|
|
||||||
// set target.
|
|
||||||
$target = array_flip($data['target_headers']);
|
|
||||||
// Get a db connection.
|
|
||||||
$db = JFactory::getDbo();
|
|
||||||
// set some defaults
|
|
||||||
$todayDate = JFactory::getDate()->toSql();
|
|
||||||
// get global action permissions
|
|
||||||
$canDo = ###Component###Helper::getActions($table);
|
|
||||||
$canEdit = $canDo->get('core.edit');
|
|
||||||
$canState = $canDo->get('core.edit.state');
|
|
||||||
$canCreate = $canDo->get('core.create');
|
|
||||||
$hasAlias = $this->getAliasesUsed($table);
|
|
||||||
// prosses the data
|
|
||||||
foreach($data['array'] as $row)
|
|
||||||
{
|
|
||||||
$found = false;
|
|
||||||
if (isset($row[$id_key]) && is_numeric($row[$id_key]) && $row[$id_key] > 0)
|
|
||||||
{
|
|
||||||
// raw items import & update!
|
|
||||||
$query = $db->getQuery(true);
|
|
||||||
$query
|
|
||||||
->select('version')
|
|
||||||
->from($db->quoteName('#__###component###_'.$table))
|
|
||||||
->where($db->quoteName('id') . ' = '. $db->quote($row[$id_key]));
|
|
||||||
// Reset the query using our newly populated query object.
|
|
||||||
$db->setQuery($query);
|
|
||||||
$db->execute();
|
|
||||||
$found = $db->getNumRows();
|
|
||||||
}
|
|
||||||
|
|
||||||
if($found && $canEdit)
|
|
||||||
{
|
|
||||||
// update item
|
|
||||||
$id = $row[$id_key];
|
|
||||||
$version = $db->loadResult();
|
|
||||||
// reset all buckets
|
|
||||||
$query = $db->getQuery(true);
|
|
||||||
$fields = array();
|
|
||||||
// Fields to update.
|
|
||||||
foreach($row as $key => $cell)
|
|
||||||
{
|
|
||||||
// ignore column
|
|
||||||
if ('IGNORE' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// update modified
|
|
||||||
if ('modified_by' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// update modified
|
|
||||||
if ('modified' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// update version
|
|
||||||
if ('version' == $target[$key])
|
|
||||||
{
|
|
||||||
$cell = (int) $version + 1;
|
|
||||||
}
|
|
||||||
// verify publish authority
|
|
||||||
if ('published' == $target[$key] && !$canState)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// set to update array
|
|
||||||
if(in_array($key, $data['target_headers']) && is_numeric($cell))
|
|
||||||
{
|
|
||||||
$fields[] = $db->quoteName($target[$key]) . ' = ' . $cell;
|
|
||||||
}
|
|
||||||
elseif(in_array($key, $data['target_headers']) && is_string($cell))
|
|
||||||
{
|
|
||||||
$fields[] = $db->quoteName($target[$key]) . ' = ' . $db->quote($cell);
|
|
||||||
}
|
|
||||||
elseif(in_array($key, $data['target_headers']) && is_null($cell))
|
|
||||||
{
|
|
||||||
// if import data is null then set empty
|
|
||||||
$fields[] = $db->quoteName($target[$key]) . " = ''";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// load the defaults
|
|
||||||
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
|
|
||||||
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
|
|
||||||
// Conditions for which records should be updated.
|
|
||||||
$conditions = array(
|
|
||||||
$db->quoteName('id') . ' = ' . $id
|
|
||||||
);
|
|
||||||
|
|
||||||
$query->update($db->quoteName('#__###component###_'.$table))->set($fields)->where($conditions);
|
|
||||||
$db->setQuery($query);
|
|
||||||
$db->execute();
|
|
||||||
}
|
|
||||||
elseif ($canCreate)
|
|
||||||
{
|
|
||||||
// insert item
|
|
||||||
$query = $db->getQuery(true);
|
|
||||||
// reset all buckets
|
|
||||||
$columns = array();
|
|
||||||
$values = array();
|
|
||||||
$version = false;
|
|
||||||
// Insert columns. Insert values.
|
|
||||||
foreach($row as $key => $cell)
|
|
||||||
{
|
|
||||||
// ignore column
|
|
||||||
if ('IGNORE' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// remove id
|
|
||||||
if ('id' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// update created
|
|
||||||
if ('created_by' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// update created
|
|
||||||
if ('created' == $target[$key])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// Make sure the alias is incremented
|
|
||||||
if ('alias' == $target[$key])
|
|
||||||
{
|
|
||||||
$cell = $this->getAlias($cell,$table);
|
|
||||||
}
|
|
||||||
// update version
|
|
||||||
if ('version' == $target[$key])
|
|
||||||
{
|
|
||||||
$cell = 1;
|
|
||||||
$version = true;
|
|
||||||
}
|
|
||||||
// set to insert array
|
|
||||||
if(in_array($key, $data['target_headers']) && is_numeric($cell))
|
|
||||||
{
|
|
||||||
$columns[] = $target[$key];
|
|
||||||
$values[] = $cell;
|
|
||||||
}
|
|
||||||
elseif(in_array($key, $data['target_headers']) && is_string($cell))
|
|
||||||
{
|
|
||||||
$columns[] = $target[$key];
|
|
||||||
$values[] = $db->quote($cell);
|
|
||||||
}
|
|
||||||
elseif(in_array($key, $data['target_headers']) && is_null($cell))
|
|
||||||
{
|
|
||||||
// if import data is null then set empty
|
|
||||||
$columns[] = $target[$key];
|
|
||||||
$values[] = "''";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// load the defaults
|
|
||||||
$columns[] = 'created_by';
|
|
||||||
$values[] = $db->quote($user->id);
|
|
||||||
$columns[] = 'created';
|
|
||||||
$values[] = $db->quote($todayDate);
|
|
||||||
if (!$version)
|
|
||||||
{
|
|
||||||
$columns[] = 'version';
|
|
||||||
$values[] = 1;
|
|
||||||
}
|
|
||||||
// Prepare the insert query.
|
|
||||||
$query
|
|
||||||
->insert($db->quoteName('#__###component###_'.$table))
|
|
||||||
->columns($db->quoteName($columns))
|
|
||||||
->values(implode(',', $values));
|
|
||||||
// Set the query using our newly populated query object and execute it.
|
|
||||||
$db->setQuery($query);
|
|
||||||
$done = $db->execute();
|
|
||||||
if ($done)
|
|
||||||
{
|
|
||||||
$aId = $db->insertid();
|
|
||||||
// make sure the access of asset is set
|
|
||||||
###Component###Helper::setAsset($aId,$table);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getAlias($name,$type = false)
|
protected function getAlias($name,$type = false)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###View### Model
|
* ###Component### ###View### Model
|
||||||
*/
|
*/
|
||||||
@ -251,7 +254,7 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
|
|
||||||
return $check;
|
return $check;
|
||||||
}
|
}
|
||||||
###IMPORT_EXT_METHOD_CUSTOM###
|
###IMPORT_EXT_METHOD###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up temporary uploaded spreadsheet
|
* Clean up temporary uploaded spreadsheet
|
||||||
@ -279,8 +282,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
JFile::delete(JPath::clean($package));
|
JFile::delete(JPath::clean($package));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
###IMPORT_SETDATE_METHOD_CUSTOM###
|
###IMPORT_SETDATA_METHOD###
|
||||||
###IMPORT_SAVE_METHOD_CUSTOM###
|
###IMPORT_SAVE_METHOD###
|
||||||
|
|
||||||
protected function getAlias($name,$type = false)
|
protected function getAlias($name,$type = false)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Views### Model
|
* ###Views### Model
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Ajax Model
|
* ###Component### Ajax Model
|
||||||
*/
|
*/
|
||||||
|
@ -17,7 +17,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
jimport('joomla.application.component.helper');
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Ajax Model
|
* ###Component### Ajax Model
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Model for ###SViews###
|
* ###Component### Model for ###SViews###
|
||||||
*/
|
*/
|
||||||
|
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Model for ###SViews###
|
* ###Component### Model for ###SViews###
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
|
use Joomla\String\StringHelper;
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Views### Table class
|
* ###Views### Table class
|
||||||
@ -142,7 +144,7 @@ class ###Component###Table###View### extends JTable
|
|||||||
|
|
||||||
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||||
{
|
{
|
||||||
$this->alias = JString::increment($this->alias, 'dash');
|
$this->alias = StringHelper::increment($this->alias, 'dash');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +159,7 @@ class ###Component###Table###View### extends JTable
|
|||||||
$bad_characters = array("\n", "\r", "\"", "<", ">");
|
$bad_characters = array("\n", "\r", "\"", "<", ">");
|
||||||
|
|
||||||
// Remove bad characters.
|
// Remove bad characters.
|
||||||
$after_clean = JString::str_ireplace($bad_characters, "", $this->metakey);
|
$after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey);
|
||||||
|
|
||||||
// Create array using commas as delimiter.
|
// Create array using commas as delimiter.
|
||||||
$keys = explode(',', $after_clean);
|
$keys = explode(',', $after_clean);
|
||||||
@ -181,7 +183,7 @@ class ###Component###Table###View### extends JTable
|
|||||||
{
|
{
|
||||||
// Only process if not empty
|
// Only process if not empty
|
||||||
$bad_characters = array("\"", "<", ">");
|
$bad_characters = array("\"", "<", ">");
|
||||||
$this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc);
|
$this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we don't have any access rules set at this point just use an empty JAccessRules class
|
// If we don't have any access rules set at this point just use an empty JAccessRules class
|
||||||
@ -220,7 +222,7 @@ class ###Component###Table###View### extends JTable
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
if ($db->loadRowList())
|
if ($db->loadRowList())
|
||||||
{
|
{
|
||||||
// asset alread set so use saved rules
|
// asset already set so use saved rules
|
||||||
$assetId = (int) $db->loadResult();
|
$assetId = (int) $db->loadResult();
|
||||||
return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,7 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
* Setting the toolbar
|
* Setting the toolbar
|
||||||
*/
|
*/
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{###HIDEMAINMENU###
|
||||||
// hide the main menu
|
|
||||||
$this->app->input->set('hidemainmenu', true);
|
|
||||||
// set the title
|
// set the title
|
||||||
if (isset($this->item->name) && $this->item->name)
|
if (isset($this->item->name) && $this->item->name)
|
||||||
{
|
{
|
||||||
@ -62,11 +60,7 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
$title = JText::_('COM_###COMPONENT###_###SVIEW###');
|
$title = JText::_('COM_###COMPONENT###_###SVIEW###');
|
||||||
}
|
}
|
||||||
// add title to the page
|
// add title to the page
|
||||||
JToolbarHelper::title($title,'###ICOMOON###');
|
JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
||||||
// add the back button
|
|
||||||
// JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
|
|
||||||
// add cpanel button
|
|
||||||
JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
|
@ -38,9 +38,7 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
$this->items = $this->get('Items');
|
$this->items = $this->get('Items');
|
||||||
$this->pagination = $this->get('Pagination');
|
$this->pagination = $this->get('Pagination');
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD###
|
||||||
$this->listOrder = $this->escape($this->state->get('list.ordering'));
|
|
||||||
$this->listDirn = $this->escape($this->state->get('list.direction'));
|
|
||||||
$this->saveOrder = $this->listOrder == 'ordering';
|
$this->saveOrder = $this->listOrder == 'ordering';
|
||||||
// set the return here value
|
// set the return here value
|
||||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||||
|
@ -48,15 +48,9 @@ class ###Component###View###SViews### extends JViewLegacy
|
|||||||
* Setting the toolbar
|
* Setting the toolbar
|
||||||
*/
|
*/
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{###HIDEMAINMENU###
|
||||||
// hide the main menu
|
|
||||||
$this->app->input->set('hidemainmenu', true);
|
|
||||||
// add title to the page
|
// add title to the page
|
||||||
JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');
|
JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
||||||
// add the back button
|
|
||||||
// JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
|
|
||||||
// add cpanel button
|
|
||||||
JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
|
@ -96,6 +96,14 @@ class com_###component###InstallerScript
|
|||||||
if ($type === 'install')
|
if ($type === 'install')
|
||||||
{###PREINSTALLSCRIPT###
|
{###PREINSTALLSCRIPT###
|
||||||
}
|
}
|
||||||
|
// check if the PHPExcel stuff is still around
|
||||||
|
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php'))
|
||||||
|
{
|
||||||
|
// We need to remove this old PHPExcel folder
|
||||||
|
$this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel');
|
||||||
|
// We need to remove this old PHPExcel file
|
||||||
|
JFile::delete(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php');
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,5 +128,106 @@ class com_###component###InstallerScript
|
|||||||
{###POSTUPDATESCRIPT###
|
{###POSTUPDATESCRIPT###
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove folders with files
|
||||||
|
*
|
||||||
|
* @param string $dir The path to folder to remove
|
||||||
|
* @param boolean $ignore The folders and files to ignore and not remove
|
||||||
|
*
|
||||||
|
* @return boolean True in all is removed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function removeFolder($dir, $ignore = false)
|
||||||
|
{
|
||||||
|
if (JFolder::exists($dir))
|
||||||
|
{
|
||||||
|
$it = new RecursiveDirectoryIterator($dir);
|
||||||
|
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||||
|
// remove ending /
|
||||||
|
$dir = rtrim($dir, '/');
|
||||||
|
// now loop the files & folders
|
||||||
|
foreach ($it as $file)
|
||||||
|
{
|
||||||
|
if ('.' === $file->getBasename() || '..' === $file->getBasename()) continue;
|
||||||
|
// set file dir
|
||||||
|
$file_dir = $file->getPathname();
|
||||||
|
// check if this is a dir or a file
|
||||||
|
if ($file->isDir())
|
||||||
|
{
|
||||||
|
$keeper = false;
|
||||||
|
if ($this->checkArray($ignore))
|
||||||
|
{
|
||||||
|
foreach ($ignore as $keep)
|
||||||
|
{
|
||||||
|
if (strpos($file_dir, $dir.'/'.$keep) !== false)
|
||||||
|
{
|
||||||
|
$keeper = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($keeper)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
JFolder::delete($file_dir);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$keeper = false;
|
||||||
|
if ($this->checkArray($ignore))
|
||||||
|
{
|
||||||
|
foreach ($ignore as $keep)
|
||||||
|
{
|
||||||
|
if (strpos($file_dir, $dir.'/'.$keep) !== false)
|
||||||
|
{
|
||||||
|
$keeper = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($keeper)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
JFile::delete($file_dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// delete the root folder if not ignore found
|
||||||
|
if (!$this->checkArray($ignore))
|
||||||
|
{
|
||||||
|
return JFolder::delete($dir);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if have an array with a length
|
||||||
|
*
|
||||||
|
* @input array The array to check
|
||||||
|
*
|
||||||
|
* @returns bool/int number of items in array on success
|
||||||
|
*/
|
||||||
|
protected function checkArray($array, $removeEmptyString = false)
|
||||||
|
{
|
||||||
|
if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
|
||||||
|
{
|
||||||
|
// also make sure the empty strings are removed
|
||||||
|
if ($removeEmptyString)
|
||||||
|
{
|
||||||
|
foreach ($array as $key => $string)
|
||||||
|
{
|
||||||
|
if (empty($string))
|
||||||
|
{
|
||||||
|
unset($array[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->checkArray($array, false);
|
||||||
|
}
|
||||||
|
return $nr;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}###MOVEFOLDERSMETHOD###
|
}###MOVEFOLDERSMETHOD###
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General Controller of Componentbuilder component
|
* General Controller of Componentbuilder component
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin_custom_tabs Controller
|
* Admin_custom_tabs Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin_fields Controller
|
* Admin_fields Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin_fields_conditions Controller
|
* Admin_fields_conditions Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin_fields_relations Controller
|
* Admin_fields_relations Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin_view Controller
|
* Admin_view Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin_views Controller
|
* Admin_views Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerAdmin_views extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Admin_views');
|
$model = $this->getModel('Admin_views');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admins_custom_tabs Controller
|
* Admins_custom_tabs Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admins_fields Controller
|
* Admins_fields Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admins_fields_conditions Controller
|
* Admins_fields_conditions Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admins_fields_relations Controller
|
* Admins_fields_relations Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Componentbuilder Ajax Controller
|
* Componentbuilder Ajax Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class_extendings Controller
|
* Class_extendings Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class_extends Controller
|
* Class_extends Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class_method Controller
|
* Class_method Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class_methods Controller
|
* Class_methods Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerClass_methods extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Class_methods');
|
$model = $this->getModel('Class_methods');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class_properties Controller
|
* Class_properties Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerClass_properties extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Class_properties');
|
$model = $this->getModel('Class_properties');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class_property Controller
|
* Class_property Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiler Controller
|
* Compiler Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_admin_views Controller
|
* Component_admin_views Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_config Controller
|
* Component_config Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_custom_admin_menus Controller
|
* Component_custom_admin_menus Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_custom_admin_views Controller
|
* Component_custom_admin_views Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_dashboard Controller
|
* Component_dashboard Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_files_folders Controller
|
* Component_files_folders Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_modules Controller
|
* Component_modules Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_mysql_tweaks Controller
|
* Component_mysql_tweaks Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_placeholders Controller
|
* Component_placeholders Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_plugins Controller
|
* Component_plugins Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_site_views Controller
|
* Component_site_views Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component_updates Controller
|
* Component_updates Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_admin_views Controller
|
* Components_admin_views Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_config Controller
|
* Components_config Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_custom_admin_menus Controller
|
* Components_custom_admin_menus Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_custom_admin_views Controller
|
* Components_custom_admin_views Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_dashboard Controller
|
* Components_dashboard Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_files_folders Controller
|
* Components_files_folders Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_modules Controller
|
* Components_modules Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_mysql_tweaks Controller
|
* Components_mysql_tweaks Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_placeholders Controller
|
* Components_placeholders Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_plugins Controller
|
* Components_plugins Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_site_views Controller
|
* Components_site_views Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Components_updates Controller
|
* Components_updates Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom_admin_view Controller
|
* Custom_admin_view Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom_admin_views Controller
|
* Custom_admin_views Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerCustom_admin_views extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Custom_admin_views');
|
$model = $this->getModel('Custom_admin_views');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom_code Controller
|
* Custom_code Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom_codes Controller
|
* Custom_codes Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerCustom_codes extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Custom_codes');
|
$model = $this->getModel('Custom_codes');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic_get Controller
|
* Dynamic_get Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic_gets Controller
|
* Dynamic_gets Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerDynamic_gets extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Dynamic_gets');
|
$model = $this->getModel('Dynamic_gets');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field Controller
|
* Field Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fields Controller
|
* Fields Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerFields extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Fields');
|
$model = $this->getModel('Fields');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fieldtype Controller
|
* Fieldtype Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fieldtypes Controller
|
* Fieldtypes Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerFieldtypes extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Fieldtypes');
|
$model = $this->getModel('Fieldtypes');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get_snippets Controller
|
* Get_snippets Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Componentbuilder Help Controller
|
* Componentbuilder Help Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Help_document Controller
|
* Help_document Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Help_documents Controller
|
* Help_documents Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerHelp_documents extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Help_documents');
|
$model = $this->getModel('Help_documents');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Componentbuilder Import Controller
|
* Componentbuilder Import Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Componentbuilder Import_joomla_components Controller
|
* Componentbuilder Import_joomla_components Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Componentbuilder Import_language_translations Controller
|
* Componentbuilder Import_language_translations Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla_component Controller
|
* Joomla_component Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla_components Controller
|
* Joomla_components Controller
|
||||||
*/
|
*/
|
||||||
@ -53,7 +55,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
|
|||||||
$input = JFactory::getApplication()->input;
|
$input = JFactory::getApplication()->input;
|
||||||
$pks = $input->post->get('cid', array(), 'array');
|
$pks = $input->post->get('cid', array(), 'array');
|
||||||
// Sanitize the input
|
// Sanitize the input
|
||||||
JArrayHelper::toInteger($pks);
|
ArrayHelper::toInteger($pks);
|
||||||
// Get the model
|
// Get the model
|
||||||
$model = $this->getModel('Joomla_components');
|
$model = $this->getModel('Joomla_components');
|
||||||
// get the data to export
|
// get the data to export
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla_module Controller
|
* Joomla_module Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla_module_files_folders_urls Controller
|
* Joomla_module_files_folders_urls Controller
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joomla_module_updates Controller
|
* Joomla_module_updates Controller
|
||||||
*/
|
*/
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user