Update master #1

Merged
root merged 49 commits from joomla/Component-Builder:master into master 2024-02-06 12:33:45 +00:00
632 changed files with 30604 additions and 16888 deletions
Showing only changes of commit e99899f6f1 - Show all commits

View File

@ -1,15 +1,25 @@
# v3.1.19
# v3.1.26
- We fixed #972 so that custom code (in the header) will be added after the power namespaces
- We added a message to show when a server move failed
- We fixed the BaseConfig to not use '_' as separator
- We fixed the footable loading issue
- We removed the need for passing placeholders by reference
- We added the option to generate a CHANGELOG
- We fixed the server class to load new client if server details changed.
- We fixed the readme placeholder issue #978.
- We fixed the empty server url issue #978.
- Fixed Package import to now use the phplibsec version 3
- Fixed changelog direction so newest changes is listed at top of the file.
- Finished the init function of super powers.
- Adds rest function inside super power.
- Adds super powers to all templates.
- Updates many helper class methods to now use the utility classes.
- Adds the `spl_autoload_register` method to the component entry file (as-well).
- Moved most methods from the compiler fields class to powers. #955
- Refactored many new builder classes from the registry class.
- Converted the Content class to two builder classes.
- Adds option to add additional templates to a module.
- Resolves #1002 by adding STRING instead of WORD.
- Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof
- Changed all CSS and JS to use `JHtml::_(` instead of `$this->document->` in compiler code.
- Adds option to turn jQuery off if UIKIT 3 is added.
- Adds option to auto write injection boilerplate code in Powers area.
- Adds option to auto write service provider boilerplate code in the Powers area.
- Improved the `getDynamicContent` method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead.
- Major stability improvements all over the new powers complier classes.
- New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB.
- Remember to update all plug-ins with this version update (use the package).
# v3.1.24
@ -24,4 +34,17 @@
- Adds Superpower Key (SPK) replacement feature
- Adds Superpower search (GREP) feature
- Adds Power Insert/Update Classes
- Fix #995 that all update sites are using the correct URL
- Fix #995 that all update sites are using the correct URL
# v3.1.19
- We fixed #972 so that custom code (in the header) will be added after the power namespaces
- We added a message to show when a server move failed
- We fixed the BaseConfig to not use '_' as separator
- We fixed the footable loading issue
- We removed the need for passing placeholders by reference
- We added the option to generate a CHANGELOG
- We fixed the server class to load new client if server details changed.
- We fixed the readme placeholder issue #978.
- We fixed the empty server url issue #978.
- Fixed Package import to now use the phplibsec version 3

View File

@ -9,7 +9,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 save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.24) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.26) 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)
@ -144,17 +144,17 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 22nd May, 2023
+ *Version*: 3.1.24
+ *Last Build*: 18th October, 2023
+ *Version*: 3.1.26
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **559431**
+ *Field count*: **2041**
+ *File count*: **3934**
+ *Folder count*: **432**
+ *Line count*: **634483**
+ *Field count*: **2045**
+ *File count*: **4750**
+ *Folder count*: **449**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Contributors

View File

@ -9,7 +9,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 save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.24) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.26) 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)
@ -144,17 +144,17 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 22nd May, 2023
+ *Version*: 3.1.24
+ *Last Build*: 18th October, 2023
+ *Version*: 3.1.26
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **559431**
+ *Field count*: **2041**
+ *File count*: **3934**
+ *Folder count*: **432**
+ *Line count*: **634483**
+ *Field count*: **2045**
+ *File count*: **4750**
+ *Folder count*: **449**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Contributors

View File

@ -486,7 +486,6 @@
<action name="power.init" title="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC" />
<action name="power.reset" title="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC" />
<action name="power.run_expansion" title="COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS_DESC" />
<action name="power.sync" title="COM_COMPONENTBUILDER_POWER_SYNC_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_SYNC_BUTTON_ACCESS_DESC" />
<action name="power.access" title="COM_COMPONENTBUILDER_POWERS_ACCESS" description="COM_COMPONENTBUILDER_POWERS_ACCESS_DESC" />
<action name="power.batch" title="COM_COMPONENTBUILDER_POWERS_BATCH_USE" description="COM_COMPONENTBUILDER_POWERS_BATCH_USE_DESC" />
<action name="power.create" title="COM_COMPONENTBUILDER_POWERS_CREATE" description="COM_COMPONENTBUILDER_POWERS_CREATE_DESC" />

View File

@ -47,4 +47,4 @@ class ###Component###Controller###Views### extends AdminController
{
return parent::getModel($name, $prefix, $config);
}###CONTROLLEREXIMPORTMETHOD######CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER######ADMIN_CUSTOM_BUTTONS_CONTROLLER_LIST###
}
}

View File

@ -26,14 +26,14 @@ abstract class ###Component###Helper
{
/**
* Composer Switch
*
*
* @var array
*/
protected static $composer = array();
/**
* The Main Active Language
*
*
* @var string
*/
public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
@ -47,7 +47,7 @@ abstract class ###Component###Helper
if (!isset(self::$composer[$target]))
{
// get the function name
$functionName = self::safeString('compose' . $target);
$functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target);
// check if method exist
if (method_exists(__CLASS__, $functionName))
{
@ -69,7 +69,7 @@ abstract class ###Component###Helper
/**
* Joomla version object
*/
*/
protected static $JVersion;
/**
@ -78,7 +78,7 @@ abstract class ###Component###Helper
public static function jVersion()
{
// check if set
if (!self::checkObject(self::$JVersion))
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
{
self::$JVersion = new JVersion();
}
@ -116,8 +116,8 @@ abstract class ###Component###Helper
$link_front = '';
$link_back = '';
}
$contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr));
$contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back;
$contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
$contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
}
}
return $contributors;
@ -135,7 +135,7 @@ abstract class ###Component###Helper
}###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL###
/**
* Get a Variable
* Get a Variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
@ -145,46 +145,18 @@ abstract class ###Component###Helper
* @param string $main The component in which the table is found
*
* @return mix string/int/float
*
* @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...);
*/
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
{
if(!$where)
{
$where = JFactory::getUser()->id;
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
}
elseif (is_string($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
}
else
{
return false;
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadResult();
}
return false;
return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(
$table,
$where,
$whereString,
$what,
$operator,
$main
);
}
/**
@ -199,110 +171,38 @@ abstract class ###Component###Helper
* @param bool $unique The switch to return a unique array
*
* @return array
*
* @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...);
*/
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true)
{
if(!$where)
{
$where = JFactory::getUser()->id;
}
if (!self::checkArray($where) && $where > 0)
{
$where = array($where);
}
if (self::checkArray($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (self::checkString($main))
{
$main = '_'.ltrim($main, '_');
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#_'.$main.'_'.$table));
}
// add strings to array search
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
{
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
}
else
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
if ($unique)
{
return array_unique($db->loadColumn());
}
return $db->loadColumn();
}
}
return false;
return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(
$table,
$where,
$whereString,
$what,
$operator,
$main,
$unique
);
}
/**
* Convert a json object to a string
*
* @input string $value The json string to convert
*
* @returns a string
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...);
*/
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{
// do some table foot work
$external = false;
if (strpos($table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', $table);
}
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON
if (self::checkArray($result))
{
if (self::checkString($table))
{
$names = array();
foreach ($result as $val)
{
if ($external)
{
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $_name;
}
}
else
{
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $_name;
}
}
}
if (self::checkArray($names))
{
return (string) implode($sperator,$names);
}
}
return (string) implode($sperator,$result);
}
return (string) json_decode($value);
}
return $value;
return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(
$value,
$sperator,
$table,
$id,
$name
);
}
public static function isPublished($id,$type)
@ -355,12 +255,12 @@ abstract class ###Component###Helper
* @param object $user The user whose permissions we are loading
*
* @return object The JObject of permission/authorised actions
*
*
*/
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
{
// load the user if not given
if (!self::checkObject($user))
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
{
// get the user object
$user = JFactory::getUser();
@ -368,10 +268,10 @@ abstract class ###Component###Helper
// load the JObject
$result = new JObject;
// make view name safe (just incase)
$view = self::safeString($view);
if (self::checkString($views))
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
{
$views = self::safeString($views);
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
}
// get all actions from component
$actions = JAccess::getActionsFromFile(
@ -384,9 +284,9 @@ abstract class ###Component###Helper
return $result;
}
// get created by if not found
if (self::checkObject($record) && !isset($record->created_by) && isset($record->id))
if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id))
{
$record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component);
$record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component);
}
// set actions only set in component settings
$componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export');
@ -395,12 +295,12 @@ abstract class ###Component###Helper
if ($target)
{
// convert to an array
if (self::checkString($target))
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target))
{
$target = array($target);
}
// check if we are good to go
if (self::checkArray($target))
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target))
{
$checkTarget = true;
}
@ -421,7 +321,7 @@ abstract class ###Component###Helper
// set area
$area = 'comp';
// check if the record has an ID and the action is item related (not a component action)
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) &&
if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) &&
(strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false))
{
// we are in item
@ -454,7 +354,7 @@ abstract class ###Component###Helper
}
}
}
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0)
{
// we are in item
$area = 'category';
@ -526,7 +426,7 @@ abstract class ###Component###Helper
* @param array $targets The array of target actions
*
* @return boolean true if action should be filtered out
*
*
*/
protected static function filterActions(&$view, &$action, &$targets)
{
@ -548,13 +448,13 @@ abstract class ###Component###Helper
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array())
{
// fix the name
$name = self::safeString($name);
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
// full path to models
$fullPathModels = $path . '/models';
// load the model file
JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
// make sure the table path is loaded
if (!isset($config['table_path']) || !self::checkString($config['table_path']))
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
{
// This is the JCB default path to tables in Joomla 3.x
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
@ -597,7 +497,7 @@ abstract class ###Component###Helper
{
$parent = JTable::getInstance('Asset');
$parent->loadByName('com_###component###');
$parentId = $parent->id;
$name = 'com_###component###.'.$table.'.'.$id;
$title = '';
@ -717,35 +617,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/
public static function xmlAppend(&$xml, $node)
{
if (!$node)
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
}
/**
@ -754,16 +631,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/
public static function xmlComment(&$xml, $comment)
{
$domXML = dom_import_simplexml($xml);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
}
/**
@ -773,14 +646,11 @@ abstract class ###Component###Helper
* @param array $attributes The attributes to apply to the XML element
*
* @return null
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
/**
@ -790,16 +660,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return void
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
/**
@ -810,28 +675,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/
public static function getFieldObject(&$attributes, $default = '', $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
}
/**
@ -841,27 +689,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/
public static function getFieldXML(&$attributes, $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
}
/**
@ -885,17 +717,17 @@ abstract class ###Component###Helper
// button attributes
$buttonAttributes = array(
'type' => 'radio',
'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button',
'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway
'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button',
'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway
'class' => 'btn-group',
'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0);
// set the button options
$buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO');
'1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES',
'0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO');
// return the input
return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input;
}
/**
@ -904,15 +736,11 @@ abstract class ###Component###Helper
* @input string The json string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
*/
public static function checkJson($string)
{
if (self::checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
}
/**
@ -921,14 +749,11 @@ abstract class ###Component###Helper
* @input object The object to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
*/
public static function checkObject($object)
{
if (isset($object) && is_object($object))
{
return count((array)$object) > 0;
}
return false;
return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
}
/**
@ -937,26 +762,11 @@ abstract class ###Component###Helper
* @input array The array to check
*
* @returns bool/int number of items in array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
*/
public static 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 self::checkArray($array, false);
}
return $nr;
}
return false;
return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
}
/**
@ -965,14 +775,11 @@ abstract class ###Component###Helper
* @input string The string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
*/
public static function checkString($string)
{
if (isset($string) && is_string($string) && strlen($string) > 0)
{
return true;
}
return false;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
}
/**
@ -984,7 +791,7 @@ abstract class ###Component###Helper
public static function isConnected()
{
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80);
$connected = @fsockopen("www.example.com", 80);
// website, port (try 80 or 443)
if ($connected)
{
@ -1006,22 +813,11 @@ abstract class ###Component###Helper
* @input array The arrays you would like to merge
*
* @returns array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
*/
public static function mergeArrays($arrays)
{
if(self::checkArray($arrays))
{
$arrayBuket = array();
foreach ($arrays as $array)
{
if (self::checkArray($array))
{
$arrayBuket = array_merge($arrayBuket, $array);
}
}
return $arrayBuket;
}
return false;
return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
}
// typo sorry!
@ -1036,39 +832,11 @@ abstract class ###Component###Helper
* @input string The you would like to shorten
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...);
*/
public static function shorten($string, $length = 40, $addTip = true)
{
if (self::checkString($string))
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
for (; $last_word < $words_count; ++$last_word)
{
$word_length += strlen($words[$last_word]);
if ($word_length > $length)
{
break;
}
}
$newString = implode(array_slice($words, 0, $last_word));
$final = strlen($newString);
if ($initial != $final && $addTip)
{
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
}
elseif ($initial != $final && !$addTip)
{
return trim($newString).'...';
}
}
return $string;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip);
}
/**
@ -1077,157 +845,61 @@ abstract class ###Component###Helper
* @input string The you would like to make safe
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...);
*/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
if ($replaceNumbers === true)
{
// remove all numbers and replace with english text version (works well only up to millions)
$string = self::replaceNumbers($string);
}
// 0nly continue if we have a string
if (self::checkString($string))
{
// create file name without the extention that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', $string);
}
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
// Transliterate string
$string = self::transliterate($string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}
// not a string
return '';
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(
$string,
$type,
$spacer,
$replaceNumbers,
$keepOnlyCharacters
);
}
/**
* Convert none English strings to code usable string
*
* @input an string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
*/
public static function transliterate($string)
{
// set tag only once
if (!self::checkString(self::$langTag))
{
// get global value
self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
}
// Transliterate on the language requested
$lang = Language::getInstance(self::$langTag);
return $lang->transliterate($string);
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
}
/**
* make sure a string is HTML save
*
* @input an html string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...);
*/
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{
if (self::checkString($var))
{
$filter = new JFilterInput();
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
if ($shorten)
{
return self::shorten($string,$length);
}
return $string;
}
else
{
return '';
}
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(
$var,
$charset,
$shorten,
$length
);
}###HELPER_LICENSE_LOCK###
/**
* Convert all int in a string to an English word string
*
* @input an string with numbers
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
*/
public static function replaceNumbers($string)
{
// set numbers array
$numbers = array();
// first get all numbers
preg_match_all('!\d+!', $string, $numbers);
// check if we have any numbers
if (isset($numbers[0]) && self::checkArray($numbers[0]))
{
foreach ($numbers[0] as $number)
{
$searchReplace[$number] = self::numberToString((int)$number);
}
// now replace numbers in string
$string = str_replace(array_keys($searchReplace), array_values($searchReplace),$string);
// check if we missed any, strange if we did.
return self::replaceNumbers($string);
}
// return the string with no numbers remaining.
return $string;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
}
/**
@ -1236,107 +908,21 @@ abstract class ###Component###Helper
*
* @input an int
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/
public static function numberToString($x)
{
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
"eight", "nine", "ten", "eleven", "twelve", "thirteen",
"fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
"nineteen", "twenty", 30 => "thirty", 40 => "forty",
50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
90 => "ninety" );
if(!is_numeric($x))
{
$w = $x;
}
elseif(fmod($x, 1) != 0)
{
$w = $x;
}
else
{
if($x < 0)
{
$w = 'minus ';
$x = -$x;
}
else
{
$w = '';
// ... now $x is a non-negative integer.
}
if($x < 21) // 0 to 20
{
$w .= $nwords[$x];
}
elseif($x < 100) // 21 to 99
{
$w .= $nwords[10 * floor($x/10)];
$r = fmod($x, 10);
if($r > 0)
{
$w .= ' '. $nwords[$r];
}
}
elseif($x < 1000) // 100 to 999
{
$w .= $nwords[floor($x/100)] .' hundred';
$r = fmod($x, 100);
if($r > 0)
{
$w .= ' and '. self::numberToString($r);
}
}
elseif($x < 1000000) // 1000 to 999999
{
$w .= self::numberToString(floor($x/1000)) .' thousand';
$r = fmod($x, 1000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
else // millions
{
$w .= self::numberToString(floor($x/1000000)) .' million';
$r = fmod($x, 1000000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
}
return $w;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
}
/**
* Random Key
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
*/
public static function randomkey($size)
{
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
$key = array();
$bagsize = strlen($bag) - 1;
for ($i = 0; $i < $size; $i++)
{
$get = rand(0, $bagsize);
$key[] = $bag[$get];
}
return implode($key);
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
}###GET_CRYPT_KEY###
}

View File

@ -26,14 +26,14 @@ abstract class ###Component###Helper
{
/**
* Composer Switch
*
*
* @var array
*/
protected static $composer = array();
/**
* The Main Active Language
*
*
* @var string
*/
public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
@ -47,7 +47,7 @@ abstract class ###Component###Helper
if (!isset(self::$composer[$target]))
{
// get the function name
$functionName = self::safeString('compose' . $target);
$functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target);
// check if method exist
if (method_exists(__CLASS__, $functionName))
{
@ -59,54 +59,22 @@ abstract class ###Component###Helper
}
/**
* Convert it into a string
* Convert a json object to a string
*
* @input string $value The json string to convert
*
* @returns a string
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...);
*/
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
{
// do some table foot work
$external = false;
if (strpos($table, '#__') !== false)
{
$external = true;
$table = str_replace('#__', '', $table);
}
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON
if (self::checkArray($result))
{
if (self::checkString($table))
{
$names = array();
foreach ($result as $val)
{
if ($external)
{
if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
{
$names[] = $_name;
}
}
else
{
if ($_name = self::getVar($table, $val, $id, $name))
{
$names[] = $_name;
}
}
}
if (self::checkArray($names))
{
return (string) implode($sperator,$names);
}
}
return (string) implode($sperator,$result);
}
return (string) json_decode($value);
}
return $value;
return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(
$value,
$sperator,
$table,
$id,
$name
);
}
/**
@ -120,7 +88,7 @@ abstract class ###Component###Helper
/**
* Joomla version object
*/
*/
protected static $JVersion;
/**
@ -129,7 +97,7 @@ abstract class ###Component###Helper
public static function jVersion()
{
// check if set
if (!self::checkObject(self::$JVersion))
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
{
self::$JVersion = new JVersion();
}
@ -167,8 +135,8 @@ abstract class ###Component###Helper
$link_front = '';
$link_back = '';
}
$contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr));
$contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back;
$contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
$contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
}
}
return $contributors;
@ -180,13 +148,13 @@ abstract class ###Component###Helper
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array())
{
// fix the name
$name = self::safeString($name);
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
// full path to models
$fullPathModels = $path . '/models';
// load the model file
JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
// make sure the table path is loaded
if (!isset($config['table_path']) || !self::checkString($config['table_path']))
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
{
// This is the JCB default path to tables in Joomla 3.x
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
@ -229,7 +197,7 @@ abstract class ###Component###Helper
{
$parent = JTable::getInstance('Asset');
$parent->loadByName('com_###component###');
$parentId = $parent->id;
$name = 'com_###component###.'.$table.'.'.$id;
$title = '';
@ -349,35 +317,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/
public static function xmlAppend(&$xml, $node)
{
if (!$node)
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
}
/**
@ -386,16 +331,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/
public static function xmlComment(&$xml, $comment)
{
$domXML = dom_import_simplexml($xml);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
}
/**
@ -405,14 +346,11 @@ abstract class ###Component###Helper
* @param array $attributes The attributes to apply to the XML element
*
* @return null
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
/**
@ -422,16 +360,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return void
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
/**
@ -442,28 +375,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/
public static function getFieldObject(&$attributes, $default = '', $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
}
/**
@ -473,27 +389,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/
public static function getFieldXML(&$attributes, $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
}
/**
@ -517,21 +417,21 @@ abstract class ###Component###Helper
// button attributes
$buttonAttributes = array(
'type' => 'radio',
'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button',
'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway
'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button',
'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway
'class' => 'btn-group',
'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0);
// set the button options
$buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO');
'1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES',
'0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO');
// return the input
return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input;
}###HELPER_UIKIT######HELPER_CREATEUSER###
/**
* Get a variable
* Get a variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
@ -541,46 +441,18 @@ abstract class ###Component###Helper
* @param string $main The component in which the table is found
*
* @return mix string/int/float
*
* @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...);
*/
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
{
if(!$where)
{
$where = JFactory::getUser()->id;
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
}
elseif (is_string($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
}
else
{
return false;
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadResult();
}
return false;
return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(
$table,
$where,
$whereString,
$what,
$operator,
$main
);
}
/**
@ -595,63 +467,20 @@ abstract class ###Component###Helper
* @param bool $unique The switch to return a unique array
*
* @return array
*
* @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...);
*/
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true)
{
if(!$where)
{
$where = JFactory::getUser()->id;
}
if (!self::checkArray($where) && $where > 0)
{
$where = array($where);
}
if (self::checkArray($where))
{
// prep main <-- why? well if $main='' is empty then $table can be categories or users
if (self::checkString($main))
{
$main = '_'.ltrim($main, '_');
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#_'.$main.'_'.$table));
}
// add strings to array search
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
{
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
}
else
{
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
if ($unique)
{
return array_unique($db->loadColumn());
}
return $db->loadColumn();
}
}
return false;
}
return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(
$table,
$where,
$whereString,
$what,
$operator,
$main,
$unique
);
}
public static function isPublished($id,$type)
{
@ -703,12 +532,12 @@ abstract class ###Component###Helper
* @param object $user The user whose permissions we are loading
*
* @return object The JObject of permission/authorised actions
*
*
*/
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
{
// load the user if not given
if (!self::checkObject($user))
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
{
// get the user object
$user = JFactory::getUser();
@ -716,10 +545,10 @@ abstract class ###Component###Helper
// load the JObject
$result = new JObject;
// make view name safe (just incase)
$view = self::safeString($view);
if (self::checkString($views))
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
{
$views = self::safeString($views);
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
}
// get all actions from component
$actions = JAccess::getActionsFromFile(
@ -732,9 +561,9 @@ abstract class ###Component###Helper
return $result;
}
// get created by if not found
if (self::checkObject($record) && !isset($record->created_by) && isset($record->id))
if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id))
{
$record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component);
$record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component);
}
// set actions only set in component settings
$componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export');
@ -743,12 +572,12 @@ abstract class ###Component###Helper
if ($target)
{
// convert to an array
if (self::checkString($target))
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target))
{
$target = array($target);
}
// check if we are good to go
if (self::checkArray($target))
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target))
{
$checkTarget = true;
}
@ -769,7 +598,7 @@ abstract class ###Component###Helper
// set area
$area = 'comp';
// check if the record has an ID and the action is item related (not a component action)
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) &&
if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) &&
(strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false))
{
// we are in item
@ -802,7 +631,7 @@ abstract class ###Component###Helper
}
}
}
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0)
{
// we are in item
$area = 'category';
@ -874,7 +703,7 @@ abstract class ###Component###Helper
* @param array $targets The array of target actions
*
* @return boolean true if action should be filtered out
*
*
*/
protected static function filterActions(&$view, &$action, &$targets)
{
@ -896,15 +725,11 @@ abstract class ###Component###Helper
* @input string The json string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
*/
public static function checkJson($string)
{
if (self::checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
}
/**
@ -913,14 +738,11 @@ abstract class ###Component###Helper
* @input object The object to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
*/
public static function checkObject($object)
{
if (isset($object) && is_object($object))
{
return count((array)$object) > 0;
}
return false;
return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
}
/**
@ -929,26 +751,11 @@ abstract class ###Component###Helper
* @input array The array to check
*
* @returns bool/int number of items in array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
*/
public static 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 self::checkArray($array, false);
}
return $nr;
}
return false;
return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
}
/**
@ -957,14 +764,11 @@ abstract class ###Component###Helper
* @input string The string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
*/
public static function checkString($string)
{
if (isset($string) && is_string($string) && strlen($string) > 0)
{
return true;
}
return false;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
}
/**
@ -976,7 +780,7 @@ abstract class ###Component###Helper
public static function isConnected()
{
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80);
$connected = @fsockopen("www.example.com", 80);
// website, port (try 80 or 443)
if ($connected)
{
@ -998,22 +802,11 @@ abstract class ###Component###Helper
* @input array The arrays you would like to merge
*
* @returns array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
*/
public static function mergeArrays($arrays)
{
if(self::checkArray($arrays))
{
$arrayBuket = array();
foreach ($arrays as $array)
{
if (self::checkArray($array))
{
$arrayBuket = array_merge($arrayBuket, $array);
}
}
return $arrayBuket;
}
return false;
return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
}
// typo sorry!
@ -1028,39 +821,11 @@ abstract class ###Component###Helper
* @input string The you would like to shorten
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...);
*/
public static function shorten($string, $length = 40, $addTip = true)
{
if (self::checkString($string))
{
$initial = strlen($string);
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count((array)$words);
$word_length = 0;
$last_word = 0;
for (; $last_word < $words_count; ++$last_word)
{
$word_length += strlen($words[$last_word]);
if ($word_length > $length)
{
break;
}
}
$newString = implode(array_slice($words, 0, $last_word));
$final = strlen($newString);
if ($initial != $final && $addTip)
{
$title = self::shorten($string, 400 , false);
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
}
elseif ($initial != $final && !$addTip)
{
return trim($newString).'...';
}
}
return $string;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip);
}
/**
@ -1069,157 +834,61 @@ abstract class ###Component###Helper
* @input string The you would like to make safe
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...);
*/
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true)
{
if ($replaceNumbers === true)
{
// remove all numbers and replace with english text version (works well only up to millions)
$string = self::replaceNumbers($string);
}
// 0nly continue if we have a string
if (self::checkString($string))
{
// create file name without the extention that is safe
if ($type === 'filename')
{
// make sure VDM is not in the string
$string = str_replace('VDM', 'vDm', $string);
// Remove anything which isn't a word, whitespace, number
// or any of the following caracters -_()
// If you don't need to handle multi-byte characters
// you can use preg_replace rather than mb_ereg_replace
// Thanks @Łukasz Rysiak!
// $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
$string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
// http://stackoverflow.com/a/2021729/1429677
return preg_replace('/\s+/', ' ', $string);
}
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
// Transliterate string
$string = self::transliterate($string);
// remove all and keep only characters
if ($keepOnlyCharacters)
{
$string = preg_replace("/[^A-Za-z ]/", '', $string);
}
// keep both numbers and characters
else
{
$string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
}
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}
// not a string
return '';
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(
$string,
$type,
$spacer,
$replaceNumbers,
$keepOnlyCharacters
);
}
/**
* Convert none English strings to code usable string
*
* @input an string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
*/
public static function transliterate($string)
{
// set tag only once
if (!self::checkString(self::$langTag))
{
// get global value
self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
}
// Transliterate on the language requested
$lang = Language::getInstance(self::$langTag);
return $lang->transliterate($string);
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
}
/**
* make sure a string is HTML save
*
* @input an html string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...);
*/
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
{
if (self::checkString($var))
{
$filter = new JFilterInput();
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
if ($shorten)
{
return self::shorten($string,$length);
}
return $string;
}
else
{
return '';
}
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(
$var,
$charset,
$shorten,
$length
);
}###HELPER_SITE_LICENSE_LOCK###
/**
* Convert all int in a string to an English word string
*
* @input an string with numbers
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
*/
public static function replaceNumbers($string)
{
// set numbers array
$numbers = array();
// first get all numbers
preg_match_all('!\d+!', $string, $numbers);
// check if we have any numbers
if (isset($numbers[0]) && self::checkArray($numbers[0]))
{
foreach ($numbers[0] as $number)
{
$searchReplace[$number] = self::numberToString((int)$number);
}
// now replace numbers in string
$string = str_replace(array_keys($searchReplace), array_values($searchReplace),$string);
// check if we missed any, strange if we did.
return self::replaceNumbers($string);
}
// return the string with no numbers remaining.
return $string;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
}
/**
@ -1228,107 +897,21 @@ abstract class ###Component###Helper
*
* @input an int
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/
public static function numberToString($x)
{
$nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
"eight", "nine", "ten", "eleven", "twelve", "thirteen",
"fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
"nineteen", "twenty", 30 => "thirty", 40 => "forty",
50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
90 => "ninety" );
if(!is_numeric($x))
{
$w = $x;
}
elseif(fmod($x, 1) != 0)
{
$w = $x;
}
else
{
if($x < 0)
{
$w = 'minus ';
$x = -$x;
}
else
{
$w = '';
// ... now $x is a non-negative integer.
}
if($x < 21) // 0 to 20
{
$w .= $nwords[$x];
}
elseif($x < 100) // 21 to 99
{
$w .= $nwords[10 * floor($x/10)];
$r = fmod($x, 10);
if($r > 0)
{
$w .= ' '. $nwords[$r];
}
}
elseif($x < 1000) // 100 to 999
{
$w .= $nwords[floor($x/100)] .' hundred';
$r = fmod($x, 100);
if($r > 0)
{
$w .= ' and '. self::numberToString($r);
}
}
elseif($x < 1000000) // 1000 to 999999
{
$w .= self::numberToString(floor($x/1000)) .' thousand';
$r = fmod($x, 1000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
else // millions
{
$w .= self::numberToString(floor($x/1000000)) .' million';
$r = fmod($x, 1000000);
if($r > 0)
{
$w .= ' ';
if($r < 100)
{
$w .= 'and ';
}
$w .= self::numberToString($r);
}
}
}
return $w;
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
}
/**
* Random Key
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
*/
public static function randomkey($size)
{
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
$key = array();
$bagsize = strlen($bag) - 1;
for ($i = 0; $i < $size; $i++)
{
$get = rand(0, $bagsize);
$key[] = $bag[$get];
}
return implode($key);
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
}###GET_CRYPT_KEY###
}

View File

@ -43,7 +43,7 @@ class ###Component###View###SView### extends HtmlView
protected function setDocument()
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
}
/**

View File

@ -43,7 +43,7 @@ class ###Component###View###SViews### extends HtmlView
protected function setDocument()
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sviews###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
}
/**

View File

@ -41,7 +41,7 @@ class ###Component###View###SViews### extends HtmlView
protected function _prepareDocument()
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
}
/**

View File

@ -41,7 +41,7 @@ class ###Component###View###SView### extends HtmlView
protected function _prepareDocument()
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
}
/**

View File

@ -551,35 +551,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/
public static function xmlAppend(&$xml, $node)
{
if (!$node)
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
}
/**
@ -588,16 +565,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/
public static function xmlComment(&$xml, $comment)
{
$domXML = dom_import_simplexml($xml);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
}
/**
@ -607,14 +580,11 @@ abstract class ###Component###Helper
* @param array $attributes The attributes to apply to the XML element
*
* @return null
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
/**
@ -624,16 +594,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return void
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
/**
@ -644,28 +609,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/
public static function getFieldObject(&$attributes, $default = '', $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
}
/**
@ -675,27 +623,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/
public static function getFieldXML(&$attributes, $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
}
/**

View File

@ -303,35 +303,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/
public static function xmlAppend(&$xml, $node)
{
if (!$node)
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
self::xmlAppend($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
$domXML = dom_import_simplexml($xml);
$domNode = dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = simplexml_import_dom($domXML);
break;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
}
/**
@ -340,16 +317,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/
public static function xmlComment(&$xml, $comment)
{
$domXML = dom_import_simplexml($xml);
$domComment = new DOMComment($comment);
$nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
$domXML->appendChild($nodeTarget);
$xml = simplexml_import_dom($domXML);
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
}
/**
@ -358,15 +331,12 @@ abstract class ###Component###Helper
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $attributes The attributes to apply to the XML element
*
* @return null
*
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
/**
@ -376,16 +346,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return void
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
/**
@ -396,28 +361,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/
public static function getFieldObject(&$attributes, $default = '', $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes) && isset($attributes['type']))
{
// make sure the form helper class is loaded
if (!method_exists('JFormHelper', 'loadFieldType'))
{
jimport('joomla.form.form');
}
// get field type
$field = JFormHelper::loadFieldType($attributes['type'], true);
// get field xml
$XML = self::getFieldXML($attributes, $options);
// setup the field
$field->setup($XML, $default);
// return the field object
return $field;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
}
/**
@ -427,27 +375,11 @@ abstract class ###Component###Helper
* @param array $options The options to apply to the XML element
*
* @return object
*
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/
public static function getFieldXML(&$attributes, $options = null)
{
// make sure we have attributes and a type value
if (self::checkArray($attributes))
{
// start field xml
$XML = new SimpleXMLElement('<field/>');
// load the attributes
self::xmlAddAttributes($XML, $attributes);
// check if we have options
if (self::checkArray($options))
{
// load the options
self::xmlAddOptions($XML, $options);
}
// return the field xml
return $XML;
}
return false;
return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
}
/**

View File

@ -15,7 +15,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
###ADMIN_COMPONENT_HEADER###

View File

@ -15,7 +15,7 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
###SITE_COMPONENT_HEADER###

View File

@ -0,0 +1,10 @@
/**
* @package getBible.net
*
* @created ###CREATIONDATE###
* @author ###AUTHOR### <###AUTHORWEBSITE###>
* @git Get Bible <https://git.vdm.dev/getBible>
* @github Get Bible <https://github.com/getBible>
* @copyright ###COPYRIGHT###
* @license ###LICENSE###
*/

View File

@ -12,6 +12,61 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// add the autoloader for the composer classes
$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php';
if (file_exists($composer_autoloader))
{
require_once $composer_autoloader;
}
// register this component namespace
spl_autoload_register(function ($class) {
// project-specific base directories and namespace prefix
$search = [
'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai',
'libraries/jcb_powers/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea',
'libraries/jcb_powers/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF',
'libraries/jcb_powers/VDM.Joomla' => 'VDM\\Joomla',
'libraries/jcb_powers/VDM.Minify' => 'VDM\\Minify',
'libraries/jcb_powers/VDM.Psr' => 'VDM\\Psr'
];
// Start the search and load if found
$found = false;
$found_base_dir = "";
$found_len = 0;
foreach ($search as $base_dir => $prefix)
{
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) === 0)
{
// we have a match so load the values
$found = true;
$found_base_dir = $base_dir;
$found_len = $len;
// done here
break;
}
}
// check if we found a match
if (!$found)
{
// not found so move to the next registered autoloader
return;
}
// get the relative class name
$relative_class = substr($class, $found_len);
// replace the namespace prefix with the base directory, replace namespace
// separators with directory separators in the relative class name, append
// with .php
$file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php';
// if the file exists, require it
if (file_exists($file))
{
require $file;
}
});
// Access check.

View File

@ -289,6 +289,18 @@
name="uikit_config"
label="COM_COMPONENTBUILDER_CONFIG_UIKIT_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_UIKIT_DESC">
<field name="add_jquery_framework"
type="radio"
label="COM_COMPONENTBUILDER_CONFIG_JQUERY_LOAD_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_JQUERY_LOAD_DESC"
class="btn-group btn-group-yesno"
default="">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_CONFIG_JQUERY_REMOVE</option>"
<option value="1">
COM_COMPONENTBUILDER_CONFIG_JQUERY_LOAD</option>"
</field>
<field name="uikit_load"
type="radio"
label="COM_COMPONENTBUILDER_CONFIG_UIKIT_LOAD_LABEL"

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('admin_custom_tabs.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController
// Access check.
$access = ($user->authorise('admin_custom_tabs.access', 'com_componentbuilder.admin_custom_tabs.' . (int) $recordId) && $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'));
$access = ($user->authorise('admin_custom_tabs.access', 'com_componentbuilder.admin_custom_tabs.' . (int) $recordId) && $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('admin_fields.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController
// Access check.
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $recordId) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $recordId) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('admin_fields_conditions.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController
// Access check.
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $recordId) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $recordId) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('admin_fields_relations.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController
// Access check.
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerAdmin_view extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('admin_view.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerAdmin_view extends FormController
// Access check.
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $recordId) && $user->authorise('admin_view.access', 'com_componentbuilder'));
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $recordId) && $user->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Admin_views Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerAdmin_views extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -147,4 +148,4 @@ class ComponentbuilderControllerAdmin_views extends AdminController
return false;
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_custom_tabs extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_fields extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_fields_conditions extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerAdmins_fields_relations extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerClass_extendings extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_extends extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('class_extends.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerClass_extends extends FormController
// Access check.
$access = ($user->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $recordId) && $user->authorise('class_extends.access', 'com_componentbuilder'));
$access = ($user->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $recordId) && $user->authorise('class_extends.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_method extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('class_method.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerClass_method extends FormController
// Access check.
$access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $recordId) && $user->authorise('class_method.access', 'com_componentbuilder'));
$access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $recordId) && $user->authorise('class_method.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -106,4 +106,4 @@ class ComponentbuilderControllerClass_methods extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error');
return;
}
}
}

View File

@ -106,4 +106,4 @@ class ComponentbuilderControllerClass_properties extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error');
return;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerClass_property extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('class_property.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerClass_property extends FormController
// Access check.
$access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $recordId) && $user->authorise('class_property.access', 'com_componentbuilder'));
$access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $recordId) && $user->authorise('class_property.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -15,6 +15,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Compiler Admin Controller
@ -125,9 +127,9 @@ class ComponentbuilderControllerCompiler extends AdminController
$url = JURI::root() . substr($model->compiler->filepath['component'], $pos + 1);
}
// check if we have plugins
$add_plugin_install = ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins'], true);
$add_plugin_install = UtilitiesArrayHelper::check($model->compiler->filepath['plugins'], true);
// check if we have modules
$add_module_install = ComponentbuilderHelper::checkArray($model->compiler->filepath['modules'], true);
$add_module_install = UtilitiesArrayHelper::check($model->compiler->filepath['modules'], true);
// if a multi install we set another kind of header
if ($add_plugin_install || $add_module_install)
{
@ -225,7 +227,7 @@ class ComponentbuilderControllerCompiler extends AdminController
$message[] = '<br /><small>Hey! you can also download these zip files right now!</small><br />';
$message[] = '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download Component</a>&nbsp;&nbsp;';
// load the module download URL's
if (isset($module_urls) && ComponentbuilderHelper::checkArray($module_urls))
if (isset($module_urls) && UtilitiesArrayHelper::check($module_urls))
{
foreach ($module_urls as $module_id => $module_url)
{
@ -234,7 +236,7 @@ class ComponentbuilderControllerCompiler extends AdminController
}
}
// load the plugin download URL's
if (isset($plugin_urls) && ComponentbuilderHelper::checkArray($plugin_urls))
if (isset($plugin_urls) && UtilitiesArrayHelper::check($plugin_urls))
{
foreach ($plugin_urls as $plugin_id => $plugin_url)
{
@ -259,7 +261,7 @@ class ComponentbuilderControllerCompiler extends AdminController
$app->setUserState('com_componentbuilder.success_message',
CFactory::_('Placeholder')->update(
implode(PHP_EOL, $message),
CFactory::_('Content')->active
CFactory::_('Compiler.Builder.Content.One')->allActive()
)
);
// set redirect
@ -318,9 +320,9 @@ class ComponentbuilderControllerCompiler extends AdminController
$fileNames = array();
$fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null);
// check if we have modules
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) ));
$fileNames = UtilitiesArrayHelper::merge(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) ));
// check if we have plugins
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) ));
$fileNames = UtilitiesArrayHelper::merge(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) ));
// wipe out the user c-m-p since we are done with them all
$app->setUserState('com_componentbuilder.component_folder_name', '');
@ -341,12 +343,12 @@ class ComponentbuilderControllerCompiler extends AdminController
}
}
// catch errors
if (ComponentbuilderHelper::checkArray($_message['error']))
if (UtilitiesArrayHelper::check($_message['error']))
{
$app->enqueueMessage(implode('<br />', $_message['error']), 'Error');
}
// build success message
if (ComponentbuilderHelper::checkArray($_message['success']))
if (UtilitiesArrayHelper::check($_message['success']))
{
$this->setRedirect($redirect_url, implode('<br />', $_message['success']), 'message');
return true;
@ -534,7 +536,7 @@ class ComponentbuilderControllerCompiler extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -615,7 +617,7 @@ class ComponentbuilderControllerCompiler extends AdminController
// run translator via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.translator');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_admin_views.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController
// Access check.
$access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $recordId) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
$access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $recordId) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_config extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_config.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_config extends FormController
// Access check.
$access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $recordId) && $user->authorise('component_config.access', 'com_componentbuilder'));
$access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $recordId) && $user->authorise('component_config.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_custom_admin_menus.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl
// Access check.
$access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $recordId) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
$access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $recordId) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_custom_admin_views.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl
// Access check.
$access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $recordId) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
$access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $recordId) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_dashboard.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController
// Access check.
$access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $recordId) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
$access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $recordId) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_files_folders.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController
// Access check.
$access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $recordId) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
$access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $recordId) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_modules extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_modules.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_modules extends FormController
// Access check.
$access = ($user->authorise('component_modules.access', 'com_componentbuilder.component_modules.' . (int) $recordId) && $user->authorise('component_modules.access', 'com_componentbuilder'));
$access = ($user->authorise('component_modules.access', 'com_componentbuilder.component_modules.' . (int) $recordId) && $user->authorise('component_modules.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_mysql_tweaks.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController
// Access check.
$access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $recordId) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
$access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $recordId) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_placeholders.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController
// Access check.
$access = ($user->authorise('component_placeholders.access', 'com_componentbuilder.component_placeholders.' . (int) $recordId) && $user->authorise('component_placeholders.access', 'com_componentbuilder'));
$access = ($user->authorise('component_placeholders.access', 'com_componentbuilder.component_placeholders.' . (int) $recordId) && $user->authorise('component_placeholders.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_plugins.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController
// Access check.
$access = ($user->authorise('component_plugins.access', 'com_componentbuilder.component_plugins.' . (int) $recordId) && $user->authorise('component_plugins.access', 'com_componentbuilder'));
$access = ($user->authorise('component_plugins.access', 'com_componentbuilder.component_plugins.' . (int) $recordId) && $user->authorise('component_plugins.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_site_views.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController
// Access check.
$access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $recordId) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
$access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $recordId) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Component_updates Form Controller
@ -62,7 +64,7 @@ class ComponentbuilderControllerComponent_updates extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('component_updates.create', $this->option);
}
@ -85,7 +87,7 @@ class ComponentbuilderControllerComponent_updates extends FormController
// Access check.
$access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $recordId) && $user->authorise('component_updates.access', 'com_componentbuilder'));
$access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $recordId) && $user->authorise('component_updates.access', 'com_componentbuilder'));
if (!$access)
{
return false;
@ -332,9 +334,9 @@ class ComponentbuilderControllerComponent_updates extends FormController
$objectUpdate = new stdClass();
$objectUpdate->id = (int) $validData['joomla_component'];
if (ComponentbuilderHelper::checkArray($version_update)
if (UtilitiesArrayHelper::check($version_update)
&& ($component_version = end($version_update)['version'])
&& ComponentbuilderHelper::checkString($component_version))
&& StringHelper::check($component_version))
{
$objectUpdate->component_version = $component_version;
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_admin_views extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_config extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_custom_admin_menus extends AdminContr
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_custom_admin_views extends AdminContr
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_dashboard extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_files_folders extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_modules extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_mysql_tweaks extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_placeholders extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_plugins extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_site_views extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerComponents_updates extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return parent::allowAdd($data);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController
// Access check.
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $recordId) && $user->authorise('custom_admin_view.access', 'com_componentbuilder'));
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $recordId) && $user->authorise('custom_admin_view.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -115,4 +115,4 @@ class ComponentbuilderControllerCustom_admin_views extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerCustom_code extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('custom_code.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerCustom_code extends FormController
// Access check.
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $recordId) && $user->authorise('custom_code.access', 'com_componentbuilder'));
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $recordId) && $user->authorise('custom_code.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Custom_codes Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerCustom_codes extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -147,4 +148,4 @@ class ComponentbuilderControllerCustom_codes extends AdminController
return false;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerDynamic_get extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('dynamic_get.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerDynamic_get extends FormController
// Access check.
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $recordId) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $recordId) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Dynamic_gets Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerDynamic_gets extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -147,4 +148,4 @@ class ComponentbuilderControllerDynamic_gets extends AdminController
return false;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerField extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('field.create', $this->option);
}

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Fields Admin Controller
@ -131,7 +132,7 @@ class ComponentbuilderControllerFields extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -147,4 +148,4 @@ class ComponentbuilderControllerFields extends AdminController
return false;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerFieldtype extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('fieldtype.create', $this->option);
}

View File

@ -106,4 +106,4 @@ class ComponentbuilderControllerFieldtypes extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error');
return;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerHelp_document extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('help_document.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerHelp_document extends FormController
// Access check.
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_componentbuilder'));
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -106,4 +106,4 @@ class ComponentbuilderControllerHelp_documents extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error');
return;
}
}
}

View File

@ -87,7 +87,7 @@ class ComponentbuilderControllerJoomla_component extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_component.create', $this->option);
}
@ -110,7 +110,7 @@ class ComponentbuilderControllerJoomla_component extends FormController
// Access check.
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $recordId) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $recordId) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -18,6 +18,7 @@ use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\ArrayHelper as JCBArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Language\Text;
use VDM\Joomla\Utilities\ObjectHelper;
/**
* Joomla_components Admin Controller
@ -135,7 +136,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -294,7 +295,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
public function backup()
{
// get params first
if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params))
if (!isset($this->params) || !ObjectHelper::check($this->params))
{
$this->params = JComponentHelper::getParams('com_componentbuilder');
}
@ -314,54 +315,54 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// manual backup message
$backupNotice = array();
// get the data to export
if (ComponentbuilderHelper::checkArray($pks) && $model->getSmartExport($pks))
if (JCBArrayHelper::check($pks) && $model->getSmartExport($pks))
{
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY');
$backupNoticeStatus = 'Success';
// set the key string
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32)
if (StringHelper::check($model->key) && strlen($model->key) == 32)
{
$textNotice = array();
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key);
// set the package owner info
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
if ((isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner'])))
{
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
$ownerDetails .= '<ul>';
if (isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company']))
if (isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner']))
if (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['website']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['website']))
if (isset($model->info['getKeyFrom']['website']) && StringHelper::check($model->info['getKeyFrom']['website']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['email']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['email']))
if (isset($model->info['getKeyFrom']['email']) && StringHelper::check($model->info['getKeyFrom']['email']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['license']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['license']))
if (isset($model->info['getKeyFrom']['license']) && StringHelper::check($model->info['getKeyFrom']['license']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']);
}
// add value only if set
if (isset($model->info['getKeyFrom']['copyright']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['copyright']))
if (isset($model->info['getKeyFrom']['copyright']) && StringHelper::check($model->info['getKeyFrom']['copyright']))
{
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>';
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']);
@ -417,12 +418,12 @@ class ComponentbuilderControllerJoomla_components extends AdminController
{
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR');
$backupNoticeStatus = 'Error';
if (componentbuilderHelper::checkString($model->packagePath))
if (StringHelper::check($model->packagePath))
{
// clear all if not successful
ComponentbuilderHelper::removeFolder($model->packagePath);
}
if (componentbuilderHelper::checkString($model->zipPath))
if (StringHelper::check($model->zipPath))
{
// clear all if not successful
JFile::delete($model->zipPath);
@ -509,4 +510,4 @@ class ComponentbuilderControllerJoomla_components extends AdminController
return JFactory::getUser();
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_module extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_module.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_module extends FormController
// Access check.
$access = ($user->authorise('joomla_module.access', 'com_componentbuilder.joomla_module.' . (int) $recordId) && $user->authorise('joomla_module.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_module.access', 'com_componentbuilder.joomla_module.' . (int) $recordId) && $user->authorise('joomla_module.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_module_files_folders_urls.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon
// Access check.
$access = ($user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder.joomla_module_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder.joomla_module_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Joomla_module_updates Form Controller
@ -62,7 +64,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_module_updates.create', $this->option);
}
@ -85,7 +87,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
// Access check.
$access = ($user->authorise('joomla_module_updates.access', 'com_componentbuilder.joomla_module_updates.' . (int) $recordId) && $user->authorise('joomla_module_updates.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_module_updates.access', 'com_componentbuilder.joomla_module_updates.' . (int) $recordId) && $user->authorise('joomla_module_updates.access', 'com_componentbuilder'));
if (!$access)
{
return false;
@ -323,9 +325,9 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController
{
$objectUpdate = new stdClass();
$objectUpdate->id = (int) $validData['joomla_plugin'];
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update'])
if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
&& ($plugin_version = end($validData['version_update'])['version'])
&& ComponentbuilderHelper::checkString($plugin_version))
&& StringHelper::check($plugin_version))
{
$objectUpdate->plugin_version = $plugin_version;
}

View File

@ -115,4 +115,4 @@ class ComponentbuilderControllerJoomla_modules extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_modules_files_folders_urls extends AdminC
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_modules_updates extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_plugin.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController
// Access check.
$access = ($user->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $recordId) && $user->authorise('joomla_plugin.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $recordId) && $user->authorise('joomla_plugin.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_plugin_files_folders_urls.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon
// Access check.
$access = ($user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder.joomla_plugin_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder.joomla_plugin_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return parent::allowAdd($data);
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_plugin_groups extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Joomla_plugin_updates Form Controller
@ -62,7 +64,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('joomla_plugin_updates.create', $this->option);
}
@ -85,7 +87,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
// Access check.
$access = ($user->authorise('joomla_plugin_updates.access', 'com_componentbuilder.joomla_plugin_updates.' . (int) $recordId) && $user->authorise('joomla_plugin_updates.access', 'com_componentbuilder'));
$access = ($user->authorise('joomla_plugin_updates.access', 'com_componentbuilder.joomla_plugin_updates.' . (int) $recordId) && $user->authorise('joomla_plugin_updates.access', 'com_componentbuilder'));
if (!$access)
{
return false;
@ -323,9 +325,9 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController
{
$objectUpdate = new stdClass();
$objectUpdate->id = (int) $validData['joomla_plugin'];
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update'])
if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update'])
&& ($plugin_version = end($validData['version_update'])['version'])
&& ComponentbuilderHelper::checkString($plugin_version))
&& StringHelper::check($plugin_version))
{
$objectUpdate->plugin_version = $plugin_version;
}

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Joomla_plugins Admin Controller
@ -68,7 +69,7 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController
// run expansion via API
$result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand');
// is there a message returned
if (!is_numeric($result) && ComponentbuilderHelper::checkString($result))
if (!is_numeric($result) && StringHelper::check($result))
{
$this->setRedirect($redirect_url, $result);
return true;
@ -136,4 +137,4 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false));
return;
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_plugins_files_folders_urls extends AdminC
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerJoomla_plugins_updates extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLanguage extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('language.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerLanguage extends FormController
// Access check.
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $recordId) && $user->authorise('language.access', 'com_componentbuilder'));
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $recordId) && $user->authorise('language.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('language_translation.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController
// Access check.
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder'));
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -106,4 +106,4 @@ class ComponentbuilderControllerLanguage_translations extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error');
return;
}
}
}

View File

@ -133,4 +133,4 @@ class ComponentbuilderControllerLanguages extends AdminController
$this->setRedirect($redirect_url);
return false;
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLayout extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return parent::allowAdd($data);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerLayout extends FormController
// Access check.
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $recordId) && $user->authorise('layout.access', 'com_componentbuilder'));
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $recordId) && $user->authorise('layout.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -115,4 +115,4 @@ class ComponentbuilderControllerLayouts extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
}
}

View File

@ -52,4 +52,4 @@ class ComponentbuilderControllerLibraries extends AdminController
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
return;
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerLibraries_config extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -43,4 +43,4 @@ class ComponentbuilderControllerLibraries_files_folders_urls extends AdminContro
{
return parent::getModel($name, $prefix, $config);
}
}
}

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('library.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerLibrary extends FormController
// Access check.
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $recordId) && $user->authorise('library.access', 'com_componentbuilder'));
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $recordId) && $user->authorise('library.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary_config extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('library_config.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerLibrary_config extends FormController
// Access check.
$access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $recordId) && $user->authorise('library_config.access', 'com_componentbuilder'));
$access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $recordId) && $user->authorise('library_config.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('library_files_folders_urls.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle
// Access check.
$access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $recordId) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
$access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $recordId) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
if (!$access)
{
return false;

View File

@ -62,7 +62,7 @@ class ComponentbuilderControllerPlaceholder extends FormController
return false;
}
// In the absense of better information, revert to the component permissions.
// In the absence of better information, revert to the component permissions.
return $user->authorise('placeholder.create', $this->option);
}
@ -85,7 +85,7 @@ class ComponentbuilderControllerPlaceholder extends FormController
// Access check.
$access = ($user->authorise('placeholder.access', 'com_componentbuilder.placeholder.' . (int) $recordId) && $user->authorise('placeholder.access', 'com_componentbuilder'));
$access = ($user->authorise('placeholder.access', 'com_componentbuilder.placeholder.' . (int) $recordId) && $user->authorise('placeholder.access', 'com_componentbuilder'));
if (!$access)
{
return false;

Some files were not shown because too many files have changed in this diff Show More