Improved the field builder around JCB, moved some xml function into the JCB helper class core

This commit is contained in:
Llewellyn van der Merwe 2018-04-08 08:12:18 +02:00
parent 6a77d71095
commit 10fdac5d60
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
38 changed files with 1123 additions and 472 deletions

View File

@ -126,11 +126,11 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 3rd April, 2018
+ *Last Build*: 8th April, 2018
+ *Version*: 2.7.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **188547**
+ *Line count*: **188942**
+ *Field count*: **1011**
+ *File count*: **1197**
+ *Folder count*: **193**

View File

@ -126,11 +126,11 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 3rd April, 2018
+ *Last Build*: 8th April, 2018
+ *Version*: 2.7.1
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **188547**
+ *Line count*: **188942**
+ *Field count*: **1011**
+ *File count*: **1197**
+ *Folder count*: **193**

View File

@ -110,6 +110,19 @@ abstract class ###Component###Helper
###SUBMENU###
}###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL###
/**
* Get a Variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
*
* @return mix string/int/float
*
*/
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
{
if(!$where)
@ -150,6 +163,20 @@ abstract class ###Component###Helper
return false;
}
/**
* Get array of variables
*
* @param string $table The table from which to get the variables
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
* @param bool $unique The switch to return a unique array
*
* @return array
*
*/
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true)
{
if(!$where)
@ -618,28 +645,141 @@ abstract class ###Component###Helper
return JAccess::getAssetRules(0);
}
/**
* xmlAppend
*
* @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
*
*/
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;
}
}
/**
* xmlComment
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
*/
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);
}
/**
* xmlAddAttributes
*
* @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
*
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
}
/**
* xmlAddOptions
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $options The options to apply to the XML element
*
* @return void
*
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
}
/**
* Render Bool Button
*
* @param array $args All the args for the button
* 0) name
* 1) additional (options class) // not used at this time
* 2) default
* 3) yes (name)
* 4) no (name)
*
* @return string The input html of the button
*
*/
public static function renderBoolButton()
{
$args = func_get_args();
// check if there is additional button class
$additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time
// start the xml
$buttonXML = new SimpleXMLElement('<field/>');
// 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
'class' => 'btn-group',
'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0);
// load the haskey attributes
self::xmlAddAttributes($buttonXML, $buttonAttributes);
// set the button options
$buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO');
// load the button options
self::xmlAddOptions($buttonXML, $buttonOptions);
// get the radio element
$button = JFormHelper::loadFieldType('radio');
// setup the properties
$name = self::htmlEscape($args[0]);
$additional = isset($args[1]) ? (string) $args[1] : '';
$value = $args[2];
$yes = isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES';
$no = isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO';
// prepare the xml
$element = new SimpleXMLElement('<field name="'.$name.'" type="radio" class="btn-group"><option '.$additional.' value="0">'.$no.'</option><option '.$additional.' value="1">'.$yes.'</option></field>');
// run
$button->setup($element, $value);
$button->setup($buttonXML, $buttonAttributes['default']);
return $button->input;
}
/**

View File

@ -291,30 +291,156 @@ abstract class ###Component###Helper
return JAccess::getAssetRules(0);
}
/**
* xmlAppend
*
* @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
*
*/
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;
}
}
/**
* xmlComment
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
*/
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);
}
/**
* xmlAddAttributes
*
* @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
*
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
}
/**
* xmlAddOptions
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $options The options to apply to the XML element
*
* @return void
*
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
}
/**
* Render Bool Button
*
* @param array $args All the args for the button
* 0) name
* 1) additional (options class) // not used at this time
* 2) default
* 3) yes (name)
* 4) no (name)
*
* @return string The input html of the button
*
*/
public static function renderBoolButton()
{
$args = func_get_args();
// check if there is additional button class
$additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time
// start the xml
$buttonXML = new SimpleXMLElement('<field/>');
// 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
'class' => 'btn-group',
'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0);
// load the haskey attributes
self::xmlAddAttributes($buttonXML, $buttonAttributes);
// set the button options
$buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO');
// load the button options
self::xmlAddOptions($buttonXML, $buttonOptions);
// get the radio element
$button = JFormHelper::loadFieldType('radio');
// setup the properties
$name = self::htmlEscape($args[0]);
$additional = isset($args[1]) ? (string) $args[1] : '';
$value = $args[2];
$yes = isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES';
$no = isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO';
// prepare the xml
$element = new SimpleXMLElement('<field name="'.$name.'" type="radio" class="btn-group"><option '.$additional.' value="0">'.$no.'</option><option '.$additional.' value="1">'.$yes.'</option></field>');
// run
$button->setup($element, $value);
$button->setup($buttonXML, $buttonAttributes['default']);
return $button->input;
}###HELPER_UIKIT### ###HELPER_CREATEUSER###
/**
* Get a variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
*
* @return mix string/int/float
*
*/
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
{
if(!$where)
@ -355,6 +481,20 @@ abstract class ###Component###Helper
return false;
}
/**
* Get array of variables
*
* @param string $table The table from which to get the variables
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
* @param bool $unique The switch to return a unique array
*
* @return array
*
*/
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true)
{
if(!$where)

View File

@ -250,7 +250,8 @@ class Get
'Joomla' . '.JText._(',
'JText:' . ':script(',
'JText:' . ':_(',
'JText:' . ':sprintf('
'JText:' . ':sprintf(',
'JustTEXT:' . ':_('
);
/**
@ -3591,11 +3592,17 @@ class Get
{
// insure string is not broken
$content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content);
// reset some buckets
$langHolders = array();
$langCheck = array();
$langOnly = array();
$jsTEXT = array();
$scTEXT = array();
// first get the Joomla .JText._()
if (in_array('Joomla' . '.JText._(', $langStringTargets))
{
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, "Joomla" . ".JText._('", "'");
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla.' . 'JText._("', '"');
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla' . '.JText._("', '"');
// combine into one array
$jsTEXT = ComponentbuilderHelper::mergeArrays($jsTEXT);
// we need to add a check to insure these JavaScript lang matchup
@ -3621,33 +3628,33 @@ class Get
$this->langMatch = ComponentbuilderHelper::mergeArrays(array($scTEXT, $this->langMatch));
}
}
// now do the little trick for JustTEXT: :_('Just uppercase text');
if (in_array('JustTEXT:' . ':_(', $langStringTargets))
{
$langOnly[] = ComponentbuilderHelper::getAllBetween($content, "JustTEXT:" . ":_('", "')");
$langOnly[] = ComponentbuilderHelper::getAllBetween($content, 'JustTEXT:' . ':_("', '")');
}
// set language data
foreach ($langStringTargets as $langStringTarget)
{
// need some special treatment here
if ($langStringTarget === 'Joomla' . '.JText._(' || $langStringTarget === 'JText:' . ':script(')
if ($langStringTarget === 'Joomla' . '.JText._(' ||
$langStringTarget === 'JText:' . ':script(' ||
$langStringTarget === 'JustTEXT:' . ':_(')
{
continue;
}
$langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget . "'", "'");
$langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget . '"', '"');
}
$langArray = ComponentbuilderHelper::mergeArrays($langCheck);
if (ComponentbuilderHelper::checkArray($langArray)) //<-- not really needed hmmm
// the normal loading of the language strings
$langCheck = ComponentbuilderHelper::mergeArrays($langCheck);
if (ComponentbuilderHelper::checkArray($langCheck)) //<-- not really needed hmmm
{
foreach ($langArray as $string)
foreach ($langCheck as $string)
{
// this is there to insure we dont break already added Language strings
if (ComponentbuilderHelper::safeString($string, 'U') === $string)
if ($keyLang = $this->setLang($string))
{
continue;
}
// only load if string is not already set
$keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U');
if (!isset($this->langContent[$this->lang][$keyLang]))
{
$this->langContent[$this->lang][$keyLang] = trim($string);
}
// load the language targets
foreach ($langStringTargets as $langStringTarget)
{
@ -3655,16 +3662,55 @@ class Get
$langHolders[$langStringTarget . '"' . $string . '"'] = $langStringTarget . '"' . $keyLang . '"';
}
}
}
}
// the uppercase loading only (for arrays and other tricks)
if (ComponentbuilderHelper::checkArray($langOnly))
{
$langOnly = ComponentbuilderHelper::mergeArrays($langOnly);
foreach ($langOnly as $string)
{
if ($keyLang = $this->setLang($string))
{
// load the language targets
$langHolders["JustTEXT:" . ":_('" . $string . "')"] = "'" . $keyLang . "'";
$langHolders['JustTEXT:' . ':_("' . $string . '")'] = '"' . $keyLang . '"';
}
}
}
// only continue if we have value to replace
if (isset($langHolders) && ComponentbuilderHelper::checkArray($langHolders))
if (ComponentbuilderHelper::checkArray($langHolders))
{
$content = $this->setPlaceholders($content, $langHolders);
}
}
}
return $content;
}
/**
* Set the language String
*
* @param string $string The plan text string (English)
*
* @return string The key language string (all uppercase)
*
*/
public function setLang($string)
{
// this is there to insure we dont break already added Language strings
if (ComponentbuilderHelper::safeString($string, 'U') === $string)
{
return false;
}
// only load if string is not already set
$keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U');
if (!isset($this->langContent[$this->lang][$keyLang]))
{
$this->langContent[$this->lang][$keyLang] = trim($string);
}
return $keyLang;
}
/**
* Set Data Selection of the dynamic get
*

View File

@ -1369,6 +1369,8 @@ class Structure extends Get
// set new file to object
$versionData->move->static->$key_pointer = new stdClass();
$versionData->move->static->$key_pointer->naam = $custom['file'];
// update the dynamic component name placholders in file names
$custom['path'] = $this->setPlaceholders($custom['path'], $this->placeholders);
// get the path info
$pathInfo = pathinfo($custom['path']);
if (isset($pathInfo['extension']) && $pathInfo['extension'])

View File

@ -755,8 +755,8 @@ class Fields extends Structure
$XML = new simpleXMLElement('<a/>');
$fieldSetXML = $XML->addChild('fieldset');
$fieldSetXML->addAttribute('name', 'details');
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Default Fields.");
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Id Field. Type: Text (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Default Fields.");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Id Field. Type: Text (joomla)");
// if id is not set
if (!isset($this->fieldsNames[$view_name_single]['id']))
{
@ -770,7 +770,7 @@ class Fields extends Structure
'default' => 0
);
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -787,9 +787,9 @@ class Fields extends Structure
'filter' => 'user_utc'
);
$attributes = array_merge($attributes, $readOnlyXML);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -803,9 +803,9 @@ class Fields extends Structure
'description' => $langView . '_CREATED_BY_DESC',
);
$attributes = array_merge($attributes, $readOnlyXML);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Created Field. Type: User (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Created Field. Type: User (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -818,9 +818,9 @@ class Fields extends Structure
'label' => 'JSTATUS'
);
$attributes = array_merge($attributes, $readOnlyXML);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Published Field. Type: List (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Published Field. Type: List (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
foreach (array('JPUBLISHED' => 1, 'JUNPUBLISHED' => 0, 'JARCHIVED' => 2, 'JTRASHED' => -2) as $text => $value)
@ -844,9 +844,9 @@ class Fields extends Structure
'format' => '%Y-%m-%d %H:%M:%S',
'filter' => 'user_utc'
);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -862,9 +862,9 @@ class Fields extends Structure
'readonly' => 'true',
'filter' => 'unset'
);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -880,9 +880,9 @@ class Fields extends Structure
'required' => "false"
);
$attributes = array_merge($attributes, $readOnlyXML);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -900,9 +900,9 @@ class Fields extends Structure
'required' => "false"
);
$attributes = array_merge($attributes, $readOnlyXML);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -919,9 +919,9 @@ class Fields extends Structure
'readonly' => "true",
'filter' => 'unset'
);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -937,34 +937,34 @@ class Fields extends Structure
'rows' => 3,
'cols' => 30
);
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
// metadesc
$attributes['name'] = 'metadesc';
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
$attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC';
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)");
$fieldXML = $fieldSetXML->addChild('field');
$this->xmlAddAttributes($fieldXML, $attributes);
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
$this->fieldCount++;
}
// load the dynamic fields now
if (count($dynamicFieldsXML))
{
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields.");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields.");
foreach ($dynamicFieldsXML as $dynamicfield)
{
$this->xmlAppend($fieldSetXML, $dynamicfield);
ComponentbuilderHelper::xmlAppend($fieldSetXML, $dynamicfield);
}
}
// check if metadata is added to this view
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
{
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields");
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields");
$fieldsXML = $fieldSetXML->addChild('fields');
$fieldsXML->addAttribute('name', 'metadata');
$fieldsXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
@ -972,7 +972,7 @@ class Fields extends Structure
$fieldsFieldSetXML->addAttribute('name', 'vdmmetadata');
$fieldsFieldSetXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
// robots
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
$robots = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'robots',
@ -980,7 +980,7 @@ class Fields extends Structure
'label' => 'JFIELD_METADATA_ROBOTS_LABEL',
'description' => 'JFIELD_METADATA_ROBOTS_DESC'
);
$this->xmlAddAttributes($robots, $attributes);
ComponentbuilderHelper::xmlAddAttributes($robots, $attributes);
// count the static field created
$this->fieldCount++;
$options = array(
@ -997,7 +997,7 @@ class Fields extends Structure
$option[] = $text;
}
// author
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
$author = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'author',
@ -1006,11 +1006,11 @@ class Fields extends Structure
'description' => 'JFIELD_METADATA_AUTHOR_DESC',
'size' => 20
);
$this->xmlAddAttributes($author, $attributes);
ComponentbuilderHelper::xmlAddAttributes($author, $attributes);
// count the static field created
$this->fieldCount++;
// rights
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
$rights = $fieldsFieldSetXML->addChild('field');
$attributes = array(
'name' => 'rights',
@ -1022,7 +1022,7 @@ class Fields extends Structure
'cols' => 30,
'rows' => 2
);
$this->xmlAddAttributes($rights, $attributes);
ComponentbuilderHelper::xmlAddAttributes($rights, $attributes);
// count the static field created
$this->fieldCount++;
}
@ -1581,7 +1581,7 @@ class Fields extends Structure
}
elseif ($property === 'option')
{
$this->xmlComment($field->fieldXML, $this->setLine(__LINE__) . " Option Set.");
ComponentbuilderHelper::xmlComment($field->fieldXML, $this->setLine(__LINE__) . " Option Set.");
if (strpos($value, ',') !== false)
{
// mulitpal options
@ -1644,7 +1644,7 @@ class Fields extends Structure
}
if (!$field->fieldXML->count())
{
$this->xmlComment($field->fieldXML, $this->setLine(__LINE__) . " No Manual Options Were Added In Field Settings.");
ComponentbuilderHelper::xmlComment($field->fieldXML, $this->setLine(__LINE__) . " No Manual Options Were Added In Field Settings.");
}
}
elseif ($setType === 'plain')
@ -1733,12 +1733,12 @@ class Fields extends Structure
if ($this->defaultField($r_typeName, 'option'))
{
// now add to the field set
$this->xmlAppend($fieldSetXML, $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
ComponentbuilderHelper::xmlAppend($fieldSetXML, $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
}
elseif ($this->defaultField($r_typeName, 'plain'))
{
// now add to the field set
$this->xmlAppend($fieldSetXML, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
ComponentbuilderHelper::xmlAppend($fieldSetXML, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
}
elseif (ComponentbuilderHelper::checkArray($r_fieldValues['custom']))
{
@ -1746,7 +1746,7 @@ class Fields extends Structure
$custom = $r_fieldValues['custom'];
unset($r_fieldValues['custom']);
// now add to the field set
$this->xmlAppend($fieldSetXML, $this->setField('custom', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
ComponentbuilderHelper::xmlAppend($fieldSetXML, $this->setField('custom', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
// set lang (just incase)
$r_listLangName = $langView . '_' . ComponentbuilderHelper::safeString($r_name, 'U');
// add to lang array
@ -1794,7 +1794,7 @@ class Fields extends Structure
'name' => 'list_' . $fieldAttributes['name'] . '_modal',
'repeat' => 'true'
);
$this->xmlAddAttributes($form, $attributes);
ComponentbuilderHelper::xmlAddAttributes($form, $attributes);
if (strpos($fieldAttributes['fields'], ',') !== false)
{
@ -1830,12 +1830,12 @@ class Fields extends Structure
if ($this->defaultField($r_typeName, 'option'))
{
// now add to the field set
$this->xmlAppend($form, $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
ComponentbuilderHelper::xmlAppend($form, $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
}
elseif ($this->defaultField($r_typeName, 'plain'))
{
// now add to the field set
$this->xmlAppend($form, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
ComponentbuilderHelper::xmlAppend($form, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
}
elseif (ComponentbuilderHelper::checkArray($r_fieldValues['custom']))
{
@ -1843,7 +1843,7 @@ class Fields extends Structure
$custom = $r_fieldValues['custom'];
unset($r_fieldValues['custom']);
// now add to the field set
$this->xmlAppend($form, $this->setField('custom', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
ComponentbuilderHelper::xmlAppend($form, $this->setField('custom', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray));
// set lang (just incase)
$r_listLangName = $langView . '_' . ComponentbuilderHelper::safeString($r_name, 'U');
// add to lang array
@ -3030,78 +3030,6 @@ class Fields extends Structure
return false;
}
/**
* xmlComment
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
*/
public 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);
}
/**
* xmlAddAttributes
*
* @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
*
*/
public function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
}
/**
* xmlAppend
*
* @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
*
*/
public function xmlAppend(&$xml, $node)
{
if (!$node)
{
// element was not returned
return;
}
switch (get_class($node))
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
$this->xmlComment($xml, $node->comment);
}
if (property_exists($node, 'fieldXML'))
{
$this->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;
}
}
/**
* xmlPrettyPrint
*

View File

@ -3183,6 +3183,19 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* Get a Variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
*
* @return mix string/int/float
*
*/
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = 'componentbuilder')
{
if(!$where)
@ -3223,6 +3236,20 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* Get array of variables
*
* @param string $table The table from which to get the variables
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
* @param bool $unique The switch to return a unique array
*
* @return array
*
*/
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = 'componentbuilder', $unique = true)
{
if(!$where)
@ -3691,28 +3718,141 @@ abstract class ComponentbuilderHelper
return JAccess::getAssetRules(0);
}
/**
* xmlAppend
*
* @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
*
*/
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;
}
}
/**
* xmlComment
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
*/
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);
}
/**
* xmlAddAttributes
*
* @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
*
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
}
/**
* xmlAddOptions
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $options The options to apply to the XML element
*
* @return void
*
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
}
/**
* Render Bool Button
*
* @param array $args All the args for the button
* 0) name
* 1) additional (options class) // not used at this time
* 2) default
* 3) yes (name)
* 4) no (name)
*
* @return string The input html of the button
*
*/
public static function renderBoolButton()
{
$args = func_get_args();
// check if there is additional button class
$additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time
// start the xml
$buttonXML = new SimpleXMLElement('<field/>');
// 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
'class' => 'btn-group',
'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0);
// load the haskey attributes
self::xmlAddAttributes($buttonXML, $buttonAttributes);
// set the button options
$buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO');
// load the button options
self::xmlAddOptions($buttonXML, $buttonOptions);
// get the radio element
$button = JFormHelper::loadFieldType('radio');
// setup the properties
$name = self::htmlEscape($args[0]);
$additional = isset($args[1]) ? (string) $args[1] : '';
$value = $args[2];
$yes = isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES';
$no = isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO';
// prepare the xml
$element = new SimpleXMLElement('<field name="'.$name.'" type="radio" class="btn-group"><option '.$additional.' value="0">'.$no.'</option><option '.$additional.' value="1">'.$yes.'</option></field>');
// run
$button->setup($element, $value);
$button->setup($buttonXML, $buttonAttributes['default']);
return $button->input;
}
/**

View File

@ -9,8 +9,9 @@ COM_COMPONENTBUILDER_ACTIVE_ONLY_FOUR_TEXT_FIELD="Active (only 4 text_field)"
COM_COMPONENTBUILDER_ADD_ACCESS="Add Access"
COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING="Add corresponding line numbers to the dynamic comments, so to see where in the compiler the lines of code was build. This will help if you need to get more technical with an issue on github, or even for your own debugging."
COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS="Add Custom Code Placeholders"
COM_COMPONENTBUILDER_ADD_KEY_HERE="add key here"
COM_COMPONENTBUILDER_ADD_MENU="Add Menu"
COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_LTSMALLGTIF_SETLTSMALLGT="Add to Backup Folder &amp; Sales Server &lt;small&gt;(if set)&lt;/small&gt;"
COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL="Add to Backup Folder &amp; Sales Server <small>(if set)</small>"
COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER="Add to Repository Folder"
COM_COMPONENTBUILDER_ADMINS_FIELDS="Admins Fields"
COM_COMPONENTBUILDER_ADMINS_FIELDS_ACCESS="Admins Fields Access"
@ -3229,7 +3230,7 @@ COM_COMPONENTBUILDER_DESCRIPTION="Description"
COM_COMPONENTBUILDER_DETAILS="Details"
COM_COMPONENTBUILDER_DIVERGED="Diverged"
COM_COMPONENTBUILDER_DIVERGED_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BDIVERGEDB_FROM_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_IN_THAT_IT_DOES_NOT_HAVE_THE_SAME_BCREATIONB_OR_BMODIFIED_DATEB="Diverged means your <b>local snippet</b> (with the same name, library and type) has a <b>diverged</b> from the community snippet (with the same name, library and type) in that it does not have the same <b>creation</b> or <b>modified date</b>."
COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL="Does this package require a key to install"
COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL="Does this package require a key to install."
COM_COMPONENTBUILDER_DOWNLOAD="download"
COM_COMPONENTBUILDER_DO_NOT_ADD="Do not add"
COM_COMPONENTBUILDER_DYNAMIC_GET="Dynamic Get"
@ -5350,6 +5351,7 @@ COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS="Order in list views"
COM_COMPONENTBUILDER_OUT_OF_DATE="Out of Date"
COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET="Owner details was set"
COM_COMPONENTBUILDER_OWNER_S="Owner: %s"
COM_COMPONENTBUILDER_PACKAGE="Package"
COM_COMPONENTBUILDER_PACKAGES_FROM_VAST_DEVELOPMENT_METHOD="Packages from Vast Development Method"
COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS="Package Owner Details"
COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND="Package owner details not found!"
@ -5370,7 +5372,6 @@ COM_COMPONENTBUILDER_PROPERTY="Property"
COM_COMPONENTBUILDER_PUBLIC_ACCESS="Public Access"
COM_COMPONENTBUILDER_PUBLISHED="Published"
COM_COMPONENTBUILDER_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_QUIET="Quiet"
COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT="Ready to compile a component"
COM_COMPONENTBUILDER_RELEASED_THIS="released this"
COM_COMPONENTBUILDER_RENAME="Rename"
@ -5387,9 +5388,9 @@ COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved."
COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another."
COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_AN_BACCESS_TOKENB_TO_GETBIBLE_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO="%s<br />You can add an <b>access token<b/> to getBible global options to make authenticated requests. An access token with only public access will do."
COM_COMPONENTBUILDER_SEARCHABLE="Searchable"
COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info"
COM_COMPONENTBUILDER_SELECT_AN_OPTION="Select an option"
COM_COMPONENTBUILDER_SELECT_A_SNIPPET="select a snippet"
COM_COMPONENTBUILDER_SELECT_IF_THE_IMPORT_SHOULD_BE_SHOWING_MORE_ELABORATE_OR_LESS_QUIET_INFORMATION_DURING_IMPORT="Select if the import should be showing more (elaborate) or less (quiet) information during import."
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile"
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_YOUR_WOULD_LIKE_TO_IMPORT="Select the component your would like to import."
COM_COMPONENTBUILDER_SELECT_THE_PACKAGE_TO_IMPORT="Select the package to import"
@ -5544,6 +5545,7 @@ COM_COMPONENTBUILDER_SHARE_SNIPPETS="Share Snippets"
COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER="Should the component be moved to your local repository folder?"
COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET="Should the zipped package of the component be moved to the local backup and remote sales server? This is only applicable if this component has those values set."
COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT="Should we be showing more elaborate information during import."
COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED="Should we force the update of all local data, even if it is newer then the data being imported."
COM_COMPONENTBUILDER_SHOW="Show"
COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB="Since the owner details are displayed during <b>import process</b> before adding the key, this way if the user/dev <b>does not</b> have the key they can see <b>where to get it</b>."

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADDFIELDS_DESCRIPTION"
icon="list"
maximum="800">
icon="list">
<form hidden="true" name="list_addfields_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addconditions_modal" repeat="true">
<!-- Target_field Field. Type: Targetfields. (custom) -->
<field

View File

@ -332,8 +332,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDPERMISSIONS_DESCRIPTION"
icon="list"
maximum="20">
icon="list">
<form hidden="true" name="list_addpermissions_modal" repeat="true">
<!-- Action Field. Type: List. (joomla) -->
<field
@ -435,8 +434,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDTABS_DESCRIPTION"
icon="list"
maximum="14">
icon="list">
<form hidden="true" name="list_addtabs_modal" repeat="true">
<!-- Name Field. Type: Text. (joomla) -->
<field
@ -494,8 +492,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDLINKED_VIEWS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addlinked_views_modal" repeat="true">
<!-- Adminview Field. Type: Adminviews. (custom) -->
<field
@ -659,8 +656,7 @@
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDTABLES_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_addtables_modal" repeat="true">
<!-- Table Field. Type: Dbtables. (custom) -->
<field
@ -1144,8 +1140,7 @@
label="COM_COMPONENTBUILDER_ADMIN_VIEW_CUSTOM_BUTTON_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="7">
icon="list">
<form hidden="true" name="list_custom_button_modal" repeat="true">
<!-- Icomoon Field. Type: List. (joomla) -->
<field
@ -1812,8 +1807,7 @@
label="COM_COMPONENTBUILDER_ADMIN_VIEW_AJAX_INPUT_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="150">
icon="list">
<form hidden="true" name="list_ajax_input_modal" repeat="true">
<!-- Value_name Field. Type: Text. (joomla) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_addadmin_views_modal" repeat="true">
<!-- Adminview Field. Type: Adminviews. (custom) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_CONFIG_ADDCONFIG_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addconfig_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field

View File

@ -104,8 +104,7 @@
label="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_ADDCUSTOMMENUS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_addcustommenus_modal" repeat="true">
<!-- Name Field. Type: Text. (joomla) -->
<field

View File

@ -104,8 +104,7 @@
label="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_addcustom_admin_views_modal" repeat="true">
<!-- Customadminview Field. Type: Customadminviews. (custom) -->
<field

View File

@ -105,7 +105,6 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="10"
filter="raw">
<form hidden="true" name="list_dashboard_tab_modal" repeat="true">
<!-- Name Field. Type: Text. (joomla) -->

View File

@ -107,8 +107,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ADDFOLDERSFULLPATH_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfoldersfullpath_modal" repeat="true">
<!-- Folderpath Field. Type: Text. (joomla) -->
<field
@ -161,8 +160,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ADDFILESFULLPATH_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfilesfullpath_modal" repeat="true">
<!-- Filepath Field. Type: Text. (joomla) -->
<field
@ -216,8 +214,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ADDFOLDERS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfolders_modal" repeat="true">
<!-- Folder Field. Type: Customfolderlist. (custom) -->
<field
@ -268,8 +265,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ADDFILES_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfiles_modal" repeat="true">
<!-- File Field. Type: Customfilelist. (custom) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_SQL_TWEAK_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_sql_tweak_modal" repeat="true">
<!-- Adminview Field. Type: Componentadminviews. (custom) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addsite_views_modal" repeat="true">
<!-- Siteview Field. Type: Siteviews. (custom) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_DESCRIPTION"
icon="list"
maximum="300">
icon="list">
<form hidden="true" name="list_version_update_modal" repeat="true">
<!-- Version Field. Type: Text. (joomla) -->
<field

View File

@ -200,8 +200,7 @@
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_AJAX_INPUT_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="150">
icon="list">
<form hidden="true" name="list_ajax_input_modal" repeat="true">
<!-- Value_name Field. Type: Text. (joomla) -->
<field
@ -612,8 +611,7 @@
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_BUTTON_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="7">
icon="list">
<form hidden="true" name="list_custom_button_modal" repeat="true">
<!-- Icomoon Field. Type: List. (joomla) -->
<field

View File

@ -389,8 +389,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_FILTER_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_filter_modal" repeat="true">
<!-- Filter_type Field. Type: List. (joomla) -->
<field
@ -517,8 +516,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_WHERE_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_where_modal" repeat="true">
<!-- Table_key Field. Type: Text. (joomla) -->
<field
@ -610,8 +608,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_ORDER_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_order_modal" repeat="true">
<!-- Table_key Field. Type: Text. (joomla) -->
<field
@ -667,8 +664,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_GLOBAL_DESCRIPTION"
icon="list"
maximum="200">
icon="list">
<form hidden="true" name="list_global_modal" repeat="true">
<!-- Name Field. Type: Text. (joomla) -->
<field
@ -843,8 +839,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_VIEW_TABLE_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_join_view_table_modal" repeat="true">
<!-- View_table Field. Type: Adminviews. (custom) -->
<field
@ -1112,8 +1107,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_join_db_table_modal" repeat="true">
<!-- Db_table Field. Type: Dbtables. (custom) -->
<field

View File

@ -109,8 +109,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_properties_modal" repeat="true">
<!-- Name Field. Type: Text. (joomla) -->
<field

View File

@ -204,6 +204,7 @@
required="true"
filter="url"
validated="url"
scheme="http,https"
message="COM_COMPONENTBUILDER_HELP_DOCUMENT_URL_MESSAGE"
hint="COM_COMPONENTBUILDER_HELP_DOCUMENT_URL_HINT"
/>

View File

@ -1041,8 +1041,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDCONTRIBUTORS_DESCRIPTION"
icon="list"
maximum="50">
icon="list">
<form hidden="true" name="list_addcontributors_modal" repeat="true">
<!-- Name Field. Type: Text. (joomla) -->
<field

View File

@ -119,8 +119,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_DESCRIPTION"
icon="list"
maximum="200">
icon="list">
<form hidden="true" name="list_translation_modal" repeat="true">
<!-- Translation Field. Type: Textarea. (joomla) -->
<field

View File

@ -199,8 +199,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_ADDCONDITIONS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addconditions_modal" repeat="true">
<!-- File Field. Type: Libraryfiles. (custom) -->
<field

View File

@ -105,8 +105,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_CONFIG_ADDCONFIG_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addconfig_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field

View File

@ -107,8 +107,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ADDFOLDERSFULLPATH_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfoldersfullpath_modal" repeat="true">
<!-- Folderpath Field. Type: Text. (joomla) -->
<field
@ -161,8 +160,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ADDFILESFULLPATH_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfilesfullpath_modal" repeat="true">
<!-- Filepath Field. Type: Text. (joomla) -->
<field
@ -216,8 +214,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ADDFOLDERS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfolders_modal" repeat="true">
<!-- Folder Field. Type: Customfolderlist. (custom) -->
<field
@ -268,8 +265,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ADDFILES_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addfiles_modal" repeat="true">
<!-- File Field. Type: Customfilelist. (custom) -->
<field
@ -321,8 +317,7 @@
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ADDURLS_DESCRIPTION"
icon="list"
maximum="500">
icon="list">
<form hidden="true" name="list_addurls_modal" repeat="true">
<!-- Url Field. Type: Url. (joomla) -->
<field

View File

@ -174,8 +174,7 @@
label="COM_COMPONENTBUILDER_SITE_VIEW_AJAX_INPUT_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="150">
icon="list">
<form hidden="true" name="list_ajax_input_modal" repeat="true">
<!-- Value_name Field. Type: Text. (joomla) -->
<field
@ -631,8 +630,7 @@
label="COM_COMPONENTBUILDER_SITE_VIEW_CUSTOM_BUTTON_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
icon="list"
maximum="7">
icon="list">
<form hidden="true" name="list_custom_button_modal" repeat="true">
<!-- Icomoon Field. Type: List. (joomla) -->
<field

View File

@ -113,6 +113,7 @@
required="true"
filter="url"
validated="url"
scheme="http,https"
message="COM_COMPONENTBUILDER_SNIPPET_URL_MESSAGE"
hint="COM_COMPONENTBUILDER_SNIPPET_URL_HINT"
/>

View File

@ -1527,7 +1527,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name
(32, '', 'Note: When using the file input type you should always add the attribute enctype=\"multipart/form-data\" to your form tag. Otherwise, the uploaded files will not be attached correctly.\r\n\r\nNote 2: You can put a soft limit file size by adding a hidden field with name=\"MAX_FILE_SIZE\" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.', 'File', '{\"properties0\":{\"name\":\"type\",\"example\":\"file\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be file.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfilevalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose an image from your computer with maximum 100KB\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value, but doesn\'t mean much for a file.\"},\"properties5\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the file box in characters.\"},\"properties6\":{\"name\":\"accept\",\"example\":\"image\\/*\",\"adjustable\":\"1\",\"description\":\"(optional) Tells the browser what <a href=\\\"http:\\/\\/www.w3schools.com\\/tags\\/att_input_accept.asp\\\" target=\\\"_blank\\\">MIME types<\\/a> your form will allow to be uploaded.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"labelclass\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) adds a CSS class for form field\'s label; for Joomla 2.5.4+\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) For Joomla form validating it to be filled in\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Whether to Joomla validate the field according to rules\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'Provides an input field for files', '', 1, 7, '', 3),
(33, '', 'The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.', 'menuitem', '{\"properties0\":{\"name\":\"type\",\"example\":\"menuitem\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be menuitem.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mymenuitem\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a menu item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default menu item. Note that this is the ItemID number of the menu item.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) determines whether all menu items are listed or only published menu items. If state is \'0\' then all menu items will be listed. If state is \'1\' then only published menu items will be listed.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"int\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'provides a drop down list of the available menu items from your Joomla site.', '', 1, 2, '', 4),
(34, '', 'Remember all views already have [accesslevel] added by default, only add this if you need more custom access selection! Provides a dropdown list of accesslevel options with the current option selected.', 'Accesslevel', '{\"properties0\":{\"name\":\"type\",\"example\":\"accesslevel\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be accesslevel\"},\"properties1\":{\"name\":\"name\",\"example\":\"accesstwo\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. \"},\"properties2\":{\"name\":\"label\",\"example\":\"Access Two\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select a access level to this concept.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the field required true if yes.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'List of accesslevels', '', 1, 1, '', 5),
(35, '', 'Provides a form with rows of fields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Subform', '{\"properties0\":{\"name\":\"type\",\"example\":\"subform\",\"description\":\"(mandatory) must be subform.\"},\"properties1\":{\"name\":\"name\",\"example\":\"options\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Option List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"layout\",\"example\":\"joomla.form.field.subform.repeatable-table\",\"adjustable\":\"1\",\"description\":\"(mandatory) The layout for the repeatable table.\"},\"properties4\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties5\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties6\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties7\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties8\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties9\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties10\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 9, '', 6);
(35, '', 'Provides a form with rows of fields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Subform', '{\"properties0\":{\"name\":\"type\",\"example\":\"subform\",\"description\":\"(mandatory) must be subform.\"},\"properties1\":{\"name\":\"name\",\"example\":\"options\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Option List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"layout\",\"example\":\"joomla.form.field.subform.repeatable-table\",\"adjustable\":\"1\",\"description\":\"(mandatory) The layout for the repeatable table.\"},\"properties4\":{\"name\":\"component\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) To change the component where it should search for layout\"},\"properties5\":{\"name\":\"client\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Function to initialise the application client<br \\/>Frontend: <code>site<\\/code> or <code>0<\\/code><br \\/>Backend: <code>admin<\\/code> or <code>1<\\/code>\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties7\":{\"name\":\"buttons\",\"example\":\"add,remove,move\",\"adjustable\":\"1\",\"description\":\"(optional) Which buttons to show if multiple mode is true.<br \\/>Options: <code>add,remove,move<\\/code>\"},\"properties8\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties9\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties10\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties11\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties12\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties13\":{\"name\":\"max\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties14\":{\"name\":\"min\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The minimum number of rows of fields required\"},\"properties15\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 12, '', 6);
--
-- Dumping data for table `#__componentbuilder_help_document`

View File

@ -106,7 +106,7 @@ jQuery(document).ready(function($) {
<div id="j-main-container">
<?php endif; ?>
<div id="form">
<div class="span6">
<div class="span4">
<h3><?php echo JText::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT'); ?></h3>
<form action="index.php?option=com_componentbuilder&view=compiler" method="post" name="compilerForm" id="compilerForm" class="form-validate" enctype="multipart/form-data">
<div>
@ -130,7 +130,7 @@ jQuery(document).ready(function($) {
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
<div class="span6">
<div class="span7">
<div id="component-details"><?php echo $selectNotice; ?></div>
<div id="noticeboard" class="well well-small">
<h2 class="module-title nav-header"><?php echo JText::_('COM_COMPONENTBUILDER_VDM_NOTICE_BOARD'); ?><span id="vdm-new-notice" style="display:none; color:red;"> (<?php echo JText::_('COM_COMPONENTBUILDER_NEW_NOTICE'); ?>)</span></h2>

View File

@ -81,60 +81,142 @@ class ComponentbuilderViewCompiler extends JViewLegacy
if(ComponentbuilderHelper::checkArray($this->Components)){
jimport('joomla.form.form');
$radio1 = JFormHelper::loadFieldType('radio',true);
// start building add to sales folder xml field
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_LTSMALLGTIF_SETLTSMALLGT').'" description="'.JText::_('COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET').'" name="backup" type="radio" class="btn-group btn-group-yesno" default="0">';
$xml .= '<option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$sales = new SimpleXMLElement($xml);
// set components to form
$radio1->setup($sales,0);
// start the form
$form = array();
$radio2 = JFormHelper::loadFieldType('radio',true);
// start building add to repository folder xml field
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER').'" description="'.JText::_('COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER').'" name="repository" type="radio" class="btn-group btn-group-yesno" default="1">';
$xml .= '<option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$repository = new SimpleXMLElement($xml);
// set components to form
$radio2->setup($repository,1);
// get the sales radio field
$sales = JFormHelper::loadFieldType('radio',true);
// start sales xml
$salesXML = new SimpleXMLElement('<field/>');
// sales attributes
$salesAttributes = array(
'type' => 'radio',
'name' => 'backup',
'label' => 'COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET',
'default' => '0');
// load the sales attributes
ComponentbuilderHelper::xmlAddAttributes($salesXML, $salesAttributes);
// set the sales options
$salesOptions = array(
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the sales options
ComponentbuilderHelper::xmlAddOptions($salesXML, $salesOptions);
// setup the sales radio field
$sales->setup($salesXML,0);
// add to form
$form[] = $sales;
$radio3 = JFormHelper::loadFieldType('radio',true);
// start building custom code placeholders
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS').'" description="'.JText::_('COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE').'" name="placeholders" type="radio" class="btn-group btn-group-yesno" default="2">';
$xml .= '<option value="2">'.JText::_('COM_COMPONENTBUILDER_GLOBAL').'</option> <option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$placeholder = new SimpleXMLElement($xml);
// set components to form
$radio3->setup($placeholder,2);
// get the repository radio field
$repository = JFormHelper::loadFieldType('radio',true);
// start repository xml
$repositoryXML = new SimpleXMLElement('<field/>');
// repository attributes
$repositoryAttributes = array(
'type' => 'radio',
'name' => 'repository',
'label' => 'COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER',
'default' => '1');
// load the repository attributes
ComponentbuilderHelper::xmlAddAttributes($repositoryXML, $repositoryAttributes);
// start the repository options
$repositoryOptions = array(
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the repository options
ComponentbuilderHelper::xmlAddOptions($repositoryXML, $repositoryOptions);
// setup the repository radio field
$repository->setup($repositoryXML,1);
// add to form
$form[] = $repository;
$radio4 = JFormHelper::loadFieldType('radio',true);
// add debug line numbers
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS').'" description="'.JText::_('COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING').'" name="debuglinenr" type="radio" class="btn-group btn-group-yesno" default="2">';
$xml .= '<option value="2">'.JText::_('COM_COMPONENTBUILDER_GLOBAL').'</option> <option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$debug_linenr = new SimpleXMLElement($xml);
// set components to form
$radio4->setup($debug_linenr,2);
// get the placeholders radio field
$placeholders = JFormHelper::loadFieldType('radio',true);
// start placeholders xml
$placeholdersXML = new SimpleXMLElement('<field/>');
// placeholders attributes
$placeholdersAttributes = array(
'type' => 'radio',
'name' => 'placeholders',
'label' => 'COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE',
'default' => '2');
// load the placeholders attributes
ComponentbuilderHelper::xmlAddAttributes($placeholdersXML, $placeholdersAttributes);
// start the placeholders options
$placeholdersOptions = array(
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the placeholders options
ComponentbuilderHelper::xmlAddOptions($placeholdersXML, $placeholdersOptions);
// setup the placeholders radio field
$placeholders->setup($placeholdersXML,2);
// add to form
$form[] = $placeholders;
$list = JFormHelper::loadFieldType('list',true);
// start building componet xml field
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_COMPONENTS').'" description="'.JText::_('COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE').'" name="component" type="list" class="btn-group" required="true">';
$xml .= '<option value="">'.JText::_('COM_COMPONENTBUILDER__SELECT_COMPONENT_').'</option>';
foreach($this->Components as $componet){
$xml .= '<option value="'.$componet->id.'">'.$this->escape($componet->name).'</option>';
// get the debuglinenr radio field
$debuglinenr = JFormHelper::loadFieldType('radio',true);
// start debuglinenr xml
$debuglinenrXML = new SimpleXMLElement('<field/>');
// debuglinenr attributes
$debuglinenrAttributes = array(
'type' => 'radio',
'name' => 'debuglinenr',
'label' => 'COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING',
'default' => '2');
// load the debuglinenr attributes
ComponentbuilderHelper::xmlAddAttributes($debuglinenrXML, $debuglinenrAttributes);
// start the debuglinenr options
$debuglinenrOptions = array(
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the debuglinenr options
ComponentbuilderHelper::xmlAddOptions($debuglinenrXML, $debuglinenrOptions);
// setup the debuglinenr radio field
$debuglinenr->setup($debuglinenrXML,2);
// add to form
$form[] = $debuglinenr;
// get the component list field
$component = JFormHelper::loadFieldType('list',true);
// start component xml
$componentXML = new SimpleXMLElement('<field/>');
// component attributes
$componentAttributes = array(
'type' => 'list',
'name' => 'component',
'label' => 'COM_COMPONENTBUILDER_COMPONENTS',
'class' => 'list_class',
'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE',
'required' => 'true');
// load the component attributes
ComponentbuilderHelper::xmlAddAttributes($componentXML, $componentAttributes);
// start the component options
$componentOptions = array();
$componentOptions[''] = 'COM_COMPONENTBUILDER__SELECT_COMPONENT_';
// load component options from array
foreach($this->Components as $componet)
{
$componentOptions[(int) $componet->id] = $this->escape($componet->name);
}
$xml .= "</field>";
// prepare the xml
$componets = new SimpleXMLElement($xml);
// set components to form
$list->setup($componets,0);
// load the component options
ComponentbuilderHelper::xmlAddOptions($componentXML, $componentOptions);
// setup the component radio field
$component->setup($componentXML,'');
// add to form
$form[] = $component;
return array($radio1,$radio2,$radio3,$radio4,$list);
// return the form array
return $form;
}
return false;
}

View File

@ -104,91 +104,160 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy
$form = array();
if ('smart_package' === $type)
{
$radio1 = JFormHelper::loadFieldType('radio',true);
// Switch to force local update
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE').'" description="'.JText::_('COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED').'" name="force_update" type="radio" class="btn-group btn-group-yesno" default="0" filter="INT">';
$xml .= '<option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$force = new SimpleXMLElement($xml);
// set components to form
$radio1->setup($force,0);
// get the force_update radio field
$force_update = JFormHelper::loadFieldType('radio',true);
// start force_update xml
$force_updateXML = new SimpleXMLElement('<field/>');
// force_update attributes
$force_updateAttributes = array(
'type' => 'radio',
'name' => 'backup',
'label' => 'COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED',
'default' => '0');
// load the force_update attributes
ComponentbuilderHelper::xmlAddAttributes($force_updateXML, $force_updateAttributes);
// set the force_update options
$force_updateOptions = array(
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the force_update options
ComponentbuilderHelper::xmlAddOptions($force_updateXML, $force_updateOptions);
// setup the force_update radio field
$force_update->setup($force_updateXML,0);
// add to form
$form[] = $radio1;
$form[] = $force_update;
$radio2 = JFormHelper::loadFieldType('radio',true);
// Switch to show more information about the import
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_QUIET').'" description="'.JText::_('COM_COMPONENTBUILDER_SELECT_IF_THE_IMPORT_SHOULD_BE_SHOWING_MORE_ELABORATE_OR_LESS_QUIET_INFORMATION_DURING_IMPORT').'" name="more_info" type="radio" class="btn-group btn-group-yesno" default="0" filter="INT">';
$xml .= '<option value="0">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="1">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$information = new SimpleXMLElement($xml);
// set information to form
$radio2->setup($information,0);
// get the more_info radio field
$more_info = JFormHelper::loadFieldType('radio',true);
// start more_info xml
$more_infoXML = new SimpleXMLElement('<field/>');
// more_info attributes
$more_infoAttributes = array(
'type' => 'radio',
'name' => 'backup',
'label' => 'COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT',
'default' => '0');
// load the more_info attributes
ComponentbuilderHelper::xmlAddAttributes($more_infoXML, $more_infoAttributes);
// set the more_info options
$more_infoOptions = array(
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the more_info options
ComponentbuilderHelper::xmlAddOptions($more_infoXML, $more_infoOptions);
// setup the more_info radio field
$more_info->setup($more_infoXML,0);
// add to form
$form[] = $radio2;
$form[] = $more_info;
if (!$this->packageInfo || (isset($this->packageInfo['getKeyFrom']) && ComponentbuilderHelper::checkArray($this->packageInfo['getKeyFrom'])))
{
// set required field
$required = 'required="true"';
$required = true;
// does the packages has info
if (!$this->packageInfo)
{
$radio2 = JFormHelper::loadFieldType('radio',true);
// has key
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_USE_KEY').'" description="'.JText::_('COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL').'" name="haskey" type="radio" class="btn-group btn-group-yesno" default="1" filter="INT">';
$xml .= '<option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$license = new SimpleXMLElement($xml);
// set components to form
$radio2->setup($license,1);
$required = ''; // change required field
// get the haskey radio field
$haskey = JFormHelper::loadFieldType('radio',true);
// start haskey xml
$haskeyXML = new SimpleXMLElement('<field/>');
// haskey attributes
$haskeyAttributes = array(
'type' => 'radio',
'name' => 'backup',
'label' => 'COM_COMPONENTBUILDER_USE_KEY',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL',
'default' => '1',
'filter' => 'INT');
// load the haskey attributes
ComponentbuilderHelper::xmlAddAttributes($haskeyXML, $haskeyAttributes);
// set the haskey options
$haskeyOptions = array(
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the haskey options
ComponentbuilderHelper::xmlAddOptions($haskeyXML, $haskeyOptions);
// setup the haskey radio field
$haskey->setup($haskeyXML,1);
// add to form
$form[] = $radio2;
$form[] = $haskey;
// now make required false
$required = false;
}
$text1 = JFormHelper::loadFieldType('text',true);
// add the key
$xml = '<field type="password" label="'.JText::_('COM_COMPONENTBUILDER_KEY').'" description="'.JText::_('COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE').'" name="sleutle" autocomplete="false" class="text_area" filter="STRING" hint="add key here" '.$required.' />';
// prepare the xml
$sleutle = new SimpleXMLElement($xml);
// set components to form
$text1->setup($sleutle,'');
// get the sleutle password field
$sleutle = JFormHelper::loadFieldType('password',true);
// start sleutle xml
$sleutleXML = new SimpleXMLElement('<field/>');
// sleutle attributes
$sleutleAttributes = array(
'type' => 'password',
'name' => 'backup',
'label' => 'COM_COMPONENTBUILDER_KEY',
'class' => 'text_area',
'description' => 'COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE',
'autocomplete' => 'false',
'filter' => 'STRING',
'hint' => 'COM_COMPONENTBUILDER_ADD_KEY_HERE');
// should this be required
if ($required)
{
$sleutleAttributes['required'] = 'true';
}
// load the sleutle attributes
ComponentbuilderHelper::xmlAddAttributes($sleutleXML, $sleutleAttributes);
// setup the sleutle password field
$sleutle->setup($sleutleXML,'');
// add to form
$form[] = $text1;
$form[] = $sleutle;
}
}
elseif ('vdm_package' === $type && $listObjects = ComponentbuilderHelper::getGithubRepoFileList('jcbGithubPackages', ComponentbuilderHelper::$jcbGithubPackagesUrl.ComponentbuilderHelper::$accessToken))
{
if (ComponentbuilderHelper::checkArray($listObjects))
{
// load the vdm packages if available
$list = JFormHelper::loadFieldType('list',true);
// get the vdm_package list field
$vdm_package = JFormHelper::loadFieldType('list',true);
// start vdm_package xml
$vdm_packageXML = new SimpleXMLElement('<field/>');
// vdm_package attributes
$vdm_packageAttributes = array(
'type' => 'list',
'name' => 'vdm_package',
'label' => 'COM_COMPONENTBUILDER_PACKAGE',
'class' => 'list_class',
'description' => 'COM_COMPONENTBUILDER_SELECT_THE_PACKAGE_TO_IMPORT');
// load the list
$load = false;
// start building componet xml field
$xml = '<field label="Package" description="'.JText::_('COM_COMPONENTBUILDER_SELECT_THE_PACKAGE_TO_IMPORT').'" name="vdm_package" type="list" class="list_class">';
$xml .= '<option value="">'.JText::_('COM_COMPONENTBUILDER__SELECT_PACKAGE_').'</option>';
// load the vdm_package attributes
ComponentbuilderHelper::xmlAddAttributes($vdm_packageXML, $vdm_packageAttributes);
// start the vdm_package options
$vdm_packageOptions = array();
$vdm_packageOptions[''] = 'COM_COMPONENTBUILDER__SELECT_PACKAGE_';
// load vdm_package options from array
foreach($listObjects as $listObject)
{
if (strpos($listObject->path, '.zip') !== false)
{
$xml .= '<option value="'.ComponentbuilderHelper::$jcbGithubPackageUrl.$listObject->path.'">'.$this->setPackageName($listObject->path).'</option>';
$vdm_packageOptions[ComponentbuilderHelper::$jcbGithubPackageUrl.$listObject->path] = $this->setPackageName($listObject->path);
$load = true;
}
}
$xml .= "</field>";
// only load if at least one item was found
if ($load)
{
// prepare the xml
$packages = new SimpleXMLElement($xml);
// set components to form
$list->setup($packages, '');
// set to form
$form[] = $list;
// load the vdm_package options
ComponentbuilderHelper::xmlAddOptions($vdm_packageXML, $vdm_packageOptions);
// setup the vdm_package radio field
$vdm_package->setup($vdm_packageXML,'');
// add to form
$form[] = $vdm_package;
}
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>3rd April, 2018</creationDate>
<creationDate>8th April, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://joomlacomponentbuilder.com</authorUrl>

View File

@ -2016,28 +2016,141 @@ abstract class ComponentbuilderHelper
return JAccess::getAssetRules(0);
}
/**
* xmlAppend
*
* @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
*
*/
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;
}
}
/**
* xmlComment
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
* @return null
*
*/
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);
}
/**
* xmlAddAttributes
*
* @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
*
*/
public static function xmlAddAttributes(&$xml, $attributes = array())
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
}
}
/**
* xmlAddOptions
*
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param array $options The options to apply to the XML element
*
* @return void
*
*/
public static function xmlAddOptions(&$xml, $options = array())
{
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption[] = $value;
}
}
/**
* Render Bool Button
*
* @param array $args All the args for the button
* 0) name
* 1) additional (options class) // not used at this time
* 2) default
* 3) yes (name)
* 4) no (name)
*
* @return string The input html of the button
*
*/
public static function renderBoolButton()
{
$args = func_get_args();
// check if there is additional button class
$additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time
// start the xml
$buttonXML = new SimpleXMLElement('<field/>');
// 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
'class' => 'btn-group',
'filter' => 'INT',
'default' => isset($args[2]) ? (int) $args[2] : 0);
// load the haskey attributes
self::xmlAddAttributes($buttonXML, $buttonAttributes);
// set the button options
$buttonOptions = array(
'1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES',
'0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO');
// load the button options
self::xmlAddOptions($buttonXML, $buttonOptions);
// get the radio element
$button = JFormHelper::loadFieldType('radio');
// setup the properties
$name = self::htmlEscape($args[0]);
$additional = isset($args[1]) ? (string) $args[1] : '';
$value = $args[2];
$yes = isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES';
$no = isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO';
// prepare the xml
$element = new SimpleXMLElement('<field name="'.$name.'" type="radio" class="btn-group"><option '.$additional.' value="0">'.$no.'</option><option '.$additional.' value="1">'.$yes.'</option></field>');
// run
$button->setup($element, $value);
$button->setup($buttonXML, $buttonAttributes['default']);
return $button->input;
}
/**
@ -2142,6 +2255,19 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* Get a variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
*
* @return mix string/int/float
*
*/
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = 'componentbuilder')
{
if(!$where)
@ -2182,6 +2308,20 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* Get array of variables
*
* @param string $table The table from which to get the variables
* @param string $where The value where
* @param string $whereString The target/field string where/name
* @param string $what The return field
* @param string $operator The operator between $whereString/field and $where/value
* @param string $main The component in which the table is found
* @param bool $unique The switch to return a unique array
*
* @return array
*
*/
public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = 'componentbuilder', $unique = true)
{
if(!$where)