diff --git a/README.md b/README.md index e9bffa865..efb41000d 100644 --- a/README.md +++ b/README.md @@ -125,12 +125,12 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 22nd May, 2018 ++ *Last Build*: 24th May, 2018 + *Version*: 2.7.11 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **185406** -+ *Field count*: **1052** ++ *Line count*: **185617** ++ *Field count*: **1053** + *File count*: **1236** + *Folder count*: **197** diff --git a/admin/README.txt b/admin/README.txt index e9bffa865..efb41000d 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -125,12 +125,12 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 22nd May, 2018 ++ *Last Build*: 24th May, 2018 + *Version*: 2.7.11 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **185406** -+ *Field count*: **1052** ++ *Line count*: **185617** ++ *Field count*: **1053** + *File count*: **1236** + *Folder count*: **197** diff --git a/admin/assets/css/admin_fields_relations.css b/admin/assets/css/admin_fields_relations.css index e7aab2271..00d61bc96 100644 --- a/admin/assets/css/admin_fields_relations.css +++ b/admin/assets/css/admin_fields_relations.css @@ -10,4 +10,7 @@ /* CSS Document */ - + +.codefield { +width: 500px; +} diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 3a217365a..9d871d3b7 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -53,6 +53,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('checkRuleName', 'ajax'); $this->registerTask('fieldOptions', 'ajax'); $this->registerTask('getFieldPropertyDesc', 'ajax'); + $this->registerTask('getCodeGlueOptions', 'ajax'); $this->registerTask('snippetDetails', 'ajax'); $this->registerTask('setSnippetGithub', 'ajax'); $this->registerTask('getSnippets', 'ajax'); @@ -1032,6 +1033,47 @@ class ComponentbuilderControllerAjax extends JControllerLegacy } } break; + case 'getCodeGlueOptions': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $listfieldValue = $jinput->get('listfield', NULL, 'INT'); + $joinfieldsValue = $jinput->get('joinfields', NULL, 'STRING'); + $typeValue = $jinput->get('type', NULL, 'INT'); + $areaValue = $jinput->get('area', NULL, 'INT'); + if($listfieldValue && $joinfieldsValue && $typeValue && $areaValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'snippetDetails': try { diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 7f1be8813..6b781bd40 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -677,5 +677,4 @@ class Compiler extends Infusion // any help to improve this is welcome... } - } diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index c3038dcd2..15f865e55 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -487,6 +487,20 @@ class Get */ public $catOtherName = array(); + /** + * The field relations values + * + * @var array + */ + public $fieldRelations = array(); + + /** + * The list join fields + * + * @var array + */ + public $listJoinBuilder = array(); + /** * The linked admin view tabs * @@ -1340,18 +1354,21 @@ class Get 'b.addfields', 'b.id', 'c.addconditions', - 'c.id' + 'c.id', + 'r.addrelations' ), array( 'addfields', 'addfields_id', 'addconditions', - 'addconditions_id' + 'addconditions_id', + 'addrelations' ) ) ); $query->from('#__componentbuilder_admin_view AS a'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.admin_view') . ')'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_conditions', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.admin_view') . ')'); + $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_relations', 'r') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('r.admin_view') . ')'); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Reset the query using our newly populated query object. @@ -1624,7 +1641,7 @@ class Get $conditionValue['match_type'] = $type; $conditionValue['match_xml'] = $fieldValue['settings']->xml; // if custom field load field being extended - if (!ComponentbuilderHelper::typeField($type)) + if (!ComponentbuilderHelper::fieldCheck($type)) { $conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'extends="', '"'); } @@ -1642,6 +1659,35 @@ class Get } } unset($view->addconditions); + + // prep the buckets + $this->fieldRelations[$name_list] = array(); + $this->listJoinBuilder[$name_list] = array(); + // set the relations + $view->addrelations = (isset($view->addrelations) && ComponentbuilderHelper::checkJson($view->addrelations)) ? json_decode($view->addrelations, true) : null; + if (ComponentbuilderHelper::checkArray($view->addrelations)) + { + foreach ($view->addrelations as $nr => $relationsValue) + { + // only add if list view field is selected and joind fields are set + if (isset($relationsValue['listfield']) && + is_numeric($relationsValue['listfield']) && + $relationsValue['listfield'] > 0 && + isset($relationsValue['joinfields']) && + ComponentbuilderHelper::checkArray($relationsValue['joinfields'])) + { + // load the field relations + $this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = $relationsValue; + // load the list joints + foreach ($relationsValue['joinfields'] as $join) + { + $this->listJoinBuilder[$name_list][(int) $join] = (int) $join; + } + } + } + } + unset($view->addrelations); + // set linked views $this->linkedAdminViews[$name_single] = null; $view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null; diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index b7202fd9a..5db5e2fc4 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -1075,7 +1075,7 @@ class Fields extends Structure // set the array of field names $this->setFieldsNames($view_name_single, $fieldAttributes['name']); - if ($this->defaultField($typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($typeName, 'option')) { //reset options array $optionArray = array(); @@ -1087,7 +1087,7 @@ class Fields extends Structure $this->setBuilders($langLabel, $langView, $view_name_single, $view_name_list, $name, $view, $field, $typeName, $multiple, false, $optionArray); } } - elseif ($this->defaultField($typeName, 'plain')) + elseif (ComponentbuilderHelper::fieldCheck($typeName, 'plain')) { if ($build) { @@ -1097,7 +1097,7 @@ class Fields extends Structure // now add to the field set $dynamicField = $this->setField('plain', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); } - elseif ($this->defaultField($typeName, 'spacer')) + elseif (ComponentbuilderHelper::fieldCheck($typeName, 'spacer')) { if ($build) { @@ -1117,7 +1117,7 @@ class Fields extends Structure // now add to the field set $dynamicField = $this->setField('spacer', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); } - elseif ($this->defaultField($typeName, 'special')) + elseif (ComponentbuilderHelper::fieldCheck($typeName, 'special')) { // set the repeatable field or subform field if ($typeName === 'repeatable' || $typeName === 'subform') @@ -1378,12 +1378,12 @@ class Fields extends Structure { //reset options array $r_optionArray = array(); - if ($this->defaultField($r_typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($r_typeName, 'option')) { // now add to the field set $field .= $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray, null, $r_taber); } - elseif ($this->defaultField($r_typeName, 'plain')) + elseif (ComponentbuilderHelper::fieldCheck($r_typeName, 'plain')) { // now add to the field set $field .= $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray, null, $r_taber); @@ -1465,12 +1465,12 @@ class Fields extends Structure { //reset options array $r_optionArray = array(); - if ($this->defaultField($r_typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($r_typeName, 'option')) { // now add to the field set $field .= $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray, null, $r_taber); } - elseif ($this->defaultField($r_typeName, 'plain')) + elseif (ComponentbuilderHelper::fieldCheck($r_typeName, 'plain')) { // now add to the field set $field .= $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray, null, $r_taber); @@ -1715,12 +1715,12 @@ class Fields extends Structure { //reset options array $r_optionArray = array(); - if ($this->defaultField($r_typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($r_typeName, 'option')) { // now add to the field set 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')) + elseif (ComponentbuilderHelper::fieldCheck($r_typeName, 'plain')) { // now add to the field set ComponentbuilderHelper::xmlAppend($fieldSetXML, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray)); @@ -1812,12 +1812,12 @@ class Fields extends Structure { //reset options array $r_optionArray = array(); - if ($this->defaultField($r_typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($r_typeName, 'option')) { // now add to the field set 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')) + elseif (ComponentbuilderHelper::fieldCheck($r_typeName, 'plain')) { // now add to the field set ComponentbuilderHelper::xmlAppend($form, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray)); @@ -2049,7 +2049,7 @@ class Fields extends Structure $fieldAttributes = array(); $setCustom = false; // setup joomla default fields - if (!$this->defaultField($typeName)) + if (!ComponentbuilderHelper::fieldCheck($typeName)) { $fieldAttributes['custom'] = array(); $setCustom = true; @@ -2399,6 +2399,10 @@ class Fields extends Structure $this->dbKeys[$view_name_single][] = $name; } } + // set list switch + $listSwitch = (isset($field['list']) && $field['list'] == 1); + // set list join + $listJoin = (isset($this->listJoinBuilder[$view_name_list][(int) $field['field']])); // add history to this view if (isset($view['history']) && $view['history']) { @@ -2443,22 +2447,44 @@ class Fields extends Structure } } // build the list values - if ((isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform') + if (($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform') { // load to list builder - $this->listBuilder[$view_name_list][] = array( - 'type' => $typeName, - 'code' => $name, - 'lang' => $listLangName, - 'title' => (isset($field['title']) && $field['title']) ? true : false, - 'alias' => (isset($field['alias']) && $field['alias']) ? true : false, - 'link' => (isset($field['link']) && $field['link']) ? true : false, - 'sort' => (isset($field['sort']) && $field['sort']) ? true : false, - 'custom' => $custom, - 'multiple' => $multiple, - 'options' => $options); - - $this->customBuilderList[$view_name_list][] = $name; + if ($listSwitch) + { + $this->listBuilder[$view_name_list][] = array( + 'id' => (int) $field['field'], + 'type' => $typeName, + 'code' => $name, + 'lang' => $listLangName, + 'title' => (isset($field['title']) && $field['title']) ? true : false, + 'alias' => (isset($field['alias']) && $field['alias']) ? true : false, + 'link' => (isset($field['link']) && $field['link']) ? true : false, + 'sort' => (isset($field['sort']) && $field['sort']) ? true : false, + 'custom' => $custom, + 'multiple' => $multiple, + 'options' => $options); + } + // load the list join builder + elseif ($listJoin) + { + $this->listJoinBuilder[$view_name_list][(int) $field['field']] = array( + 'type' => $typeName, + 'code' => $name, + 'lang' => $listLangName, + 'title' => (isset($field['title']) && $field['title']) ? true : false, + 'alias' => (isset($field['alias']) && $field['alias']) ? true : false, + 'link' => (isset($field['link']) && $field['link']) ? true : false, + 'sort' => (isset($field['sort']) && $field['sort']) ? true : false, + 'custom' => $custom, + 'multiple' => $multiple, + 'options' => $options); + } + // build custom builder list + if ($listSwitch || $listJoin) + { + $this->customBuilderList[$view_name_list][] = $name; + } } // set the hidden field of this view if ($typeName === 'hidden') @@ -2601,7 +2627,7 @@ class Fields extends Structure } // load the json list display fix - if ((isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform') + if (($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform') { if (ComponentbuilderHelper::checkArray($options)) { @@ -2636,12 +2662,12 @@ class Fields extends Structure // check if field should be added to uikit $this->buildSiteFieldData($view_name_single, $name, 'uikit', $typeName); // load the selection translation fix - if (ComponentbuilderHelper::checkArray($options) && (isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform') + if (ComponentbuilderHelper::checkArray($options) && ($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform') { $this->selectionTranslationFixBuilder[$view_name_list][$name] = $options; } // build the sort values - if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1) && (isset($field['list']) && $field['list'] == 1) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) + if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1) && ($listSwitch || $listJoin) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) { $this->sortBuilder[$view_name_list][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'options' => $options); } @@ -2652,7 +2678,7 @@ class Fields extends Structure $this->searchBuilder[$view_name_list][] = array('type' => $typeName, 'code' => $name, 'custom' => $custom, 'list' => $_list); } // build the filter values - if ($dbSwitch && (isset($field['filter']) && $field['filter'] == 1) && (isset($field['list']) && $field['list'] == 1) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) + if ($dbSwitch && (isset($field['filter']) && $field['filter'] == 1) && ($listSwitch || $listJoin) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) { $this->filterBuilder[$view_name_list][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'database' => $view_name_single, 'function' => ComponentbuilderHelper::safeString($name, 'F'), 'custom' => $custom, 'options' => $options); } @@ -2993,58 +3019,6 @@ class Fields extends Structure return ''; } - /** - * default Fields - * - * @param string $type The field type - * @param boolean $option The field grouping - * - * @return boolean if the field was found - * - */ - public function defaultField($type, $option = 'default') - { - // list of default fields - // https://docs.joomla.org/Form_field - $defaults = array( - 'default' => array( - 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', - 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', - 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', - 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', - 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', - 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', - 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', - 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' - ), - 'plain' => array( - 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', - 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', - 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', - 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', - 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', - 'sessionhandler', 'tag', 'tel', 'text', 'textarea', - 'timezone', 'url', 'user', 'usergroup' - ), - 'spacer' => array( - 'note', 'spacer' - ), - 'option' => array( - 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' - ), - 'special' => array( - 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', - 'repeatable', 'templatestyle', 'subform' - ) - ); - - if (in_array($type, $defaults[$option])) - { - return true; - } - return false; - } - /** * xmlPrettyPrint * diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index e07c234aa..f5dba4840 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -6327,6 +6327,7 @@ class Interpretation extends Fields $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; // setup correct core target $coreLoad = false; + $core = null; if (isset($this->permissionCore[$viewName_single])) { $core = $this->permissionCore[$viewName_single]; @@ -6409,199 +6410,44 @@ class Interpretation extends Fields // start adding the dynamic foreach ($this->listBuilder[$viewName_list] as $item) { - $checkoutTriger = false; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && isset($item['custom']['table']) && ComponentbuilderHelper::checkString($item['custom']['table'])) + // set some defaults + $customAdminViewButtons = ''; + // set the item default class + $itemClass = 'hidden-phone'; + // get list item code + $itemCode = $this->getListItemCode($item, $viewName_list, $doNotEscape); + // is this a linked item + if ($item['link'] || (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user')) { - $item['id'] = $item['code']; - if (!$item['multiple']) - { - $item['code'] = $item['code'] . '_' . $item['custom']['text']; - } - } - // check if translated value is used - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) - { - $itemCode = '' . $item['code'] . '); ?>'; - } - elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['text'] === 'user') - { - $itemCode = '' . $item['code'] . ')->name; ?>'; - } - elseif ($doNotEscape) - { - if (in_array($item['code'], $this->doNotEscape[$viewName_list])) - { - $itemCode = '' . $item['code'] . '; ?>'; - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } + // set some defaults + $checkoutTriger = false; + // set the item default class + $itemClass = 'nowrap'; + // get list item link + $itemLink = $this->getListItemLink($item, $checkoutTriger, $viewName_single, $viewName_list); + // get list item link autority + $itemLinkAutority = $this->getListItemLinkAutority($item, $viewName_single, $viewName_list, $coreLoad, $core); + // set item row + $itemRow = $this->getListItemLinkRow($itemCode, $itemLink, $itemLinkAutority, $viewName_list, $checkoutTriger); } else { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; + // set item row + $itemRow = PHP_EOL . "\t\t\t"; } - if ($item['link']) + // check if buttons was aready added + if ($firstTimeBeingAdded) // TODO we must improve this to allow more items to be targeted instead of just the first item :) { - // allways rest custom links - $customAdminView = ''; - // if to be linked - if ($item['type'] === 'category' && !$item['title']) - { - $otherViews = $this->catCodeBuilder[$viewName_single]['views']; - // category and linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - else - { - $add = true; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title']) - { - // link to that item instead - $link = 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id'] . '; ?>&ref=' . $viewName_list; - - $coreLoadLink = false; - if (isset($this->permissionCore[$item['custom']['view']])) - { - $coreLink = $this->permissionCore[$item['custom']['view']]; - $coreLoadLink = true; - } - // check if the item has permissions. - if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) - { - $accessCheck = "\$this->user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - else - { - $accessCheck = "\$this->user->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - } - elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - - $add = false; - } - else - { - // start building the links - $link = '&id=id; ?>'; - // check if custom links should be added to this list views - if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) - { - // make sure the custom links are only added once - $firstTimeBeingAdded = false; - // start building the links - $customAdminView = PHP_EOL . "\t\t\t" . '
'; - foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) - { - $customAdminView .= PHP_EOL . "\t\t\tget('" . $customLinkView['link'] . ".access')): ?>"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; - $customAdminView .= PHP_EOL . "\t\t\t"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; - $customAdminView .= PHP_EOL . "\t\t\t"; - } - $customAdminView .= PHP_EOL . "\t\t\t" . '
'; - } - // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) - { - // set permissions. - $accessCheck = "\$canDo->get('" . $core['core.edit'] . "')"; - } - else - { - // set permissions. - $accessCheck = "\$canDo->get('core.edit')"; - } - // triger the checked out script to be added - $checkoutTriger = true; - } - - if ($add) - { - // set as linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '
' . PHP_EOL . "\t\t\t\t\t" . '' . $itemCode . ''; - if ($checkoutTriger) - { - $body .= PHP_EOL . "\t\t\t\t\tchecked_out): ?>"; - $body .= PHP_EOL . "\t\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - } - $body .= PHP_EOL . "\t\t\t\t" . '
'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '
' . $itemCode . '
'; - $body .= PHP_EOL . "\t\t\t"; - $body .= $customAdminView; - $body .= PHP_EOL . "\t\t"; - } - } - } - else - { - if ($item['type'] === 'category') - { - $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, 'hidden-phone') . "\">"; - $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t"; - } - elseif (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user') - { - // custom user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user') - { - // user name only - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t"; - } - else - { - // normal not linked - $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, 'hidden-phone') . "\">"; - $body .= PHP_EOL . "\t\t\t" . $itemCode; - $body .= PHP_EOL . "\t\t"; - } + // get custom admin view buttons + $customAdminViewButtons = $this->getCustomAdminViewButtons($item, $viewName_single, $viewName_list, $coreLoad); + // make sure the custom admin view buttons are only added once + $firstTimeBeingAdded = false; } + // add row to body + $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, $itemClass) . "\">"; + $body .= $itemRow; + $body .= $customAdminViewButtons; + $body .= PHP_EOL . "\t\t"; } // add the defaults if (!isset($this->fieldsNames[$viewName_single]['published'])) @@ -6644,6 +6490,192 @@ class Interpretation extends Fields return ''; } + protected function getListItemLinkRow($itemCode, $itemLink, $itemLinkAutority, $viewName_list, $checkoutTriger, $class = true) + { + // add class + $tab = ''; + if ($class) + { + $link .= PHP_EOL . "\t\t\t" . '
'; + $tab = "\t"; + } + // the link logic + $link .= PHP_EOL . $tab . "\t\t\t"; + $link .= PHP_EOL . $tab . "\t\t\t\t" . ''; + if ($checkoutTriger) + { + $link .= PHP_EOL . $tab . "\t\t\t\tchecked_out): ?>"; + $link .= PHP_EOL . $tab . "\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; + $link .= PHP_EOL . $tab . "\t\t\t\t"; + } + $link .= PHP_EOL . $tab . "\t\t\t"; + $link .= PHP_EOL . $tab . "\t\t\t\t"; + $link .= PHP_EOL . $tab . "\t\t\t"; + // add class + if ($class) + { + $link .= PHP_EOL . "\t\t\t
"; + } + // return the link logic + return $link; + } + + protected function getCustomAdminViewButtons($viewName_list, $ref = '') + { + $customAdminViewButton = ''; + // check if custom links should be added to this list views + if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list])) + { + // start building the links + $customAdminViewButton .= PHP_EOL . "\t\t\t" . '
'; + foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) + { + $customAdminViewButton .= PHP_EOL . "\t\t\tget('" . $customLinkView['link'] . ".access')): ?>"; + $customAdminViewButton .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; + $customAdminViewButton .= PHP_EOL . "\t\t\t"; + $customAdminViewButton .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; + $customAdminViewButton .= PHP_EOL . "\t\t\t"; + } + $customAdminViewButton .= PHP_EOL . "\t\t\t" . '
'; + } + return $customAdminViewButton; + } + + protected function getListItemCode(&$item, $viewName_list, $doNotEscape, $escape = '$this->escape') + { + // first update the code id needed + if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && isset($item['custom']['table']) && ComponentbuilderHelper::checkString($item['custom']['table'])) + { + $item['id_code'] = $item['code']; + if (!$item['multiple']) + { + $item['code'] = $item['code'] . '_' . $item['custom']['text']; + } + } + // check if category + if ($item['type'] === 'category' && !$item['title']) + { + return $escape . '($item->category_title)'; + } + // check if user + elseif ($item['type'] === 'user') + { + return 'JFactory::getUser((int)$item->' . $item['code'] . ')->name'; + } + // check if custom user + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && isset($item['id_code'])) + { + return 'JFactory::getUser((int)$item->' . $item['id_code'] . ')->name'; + } + // check if translated value is used + elseif (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) + { + return 'JText:' . ':_($item->' . $item['code'] . ')'; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['text'] === 'user') + { + return 'JFactory::getUser((int)$item->' . $item['code'] . ')->name'; + } + elseif ($doNotEscape) + { + if (in_array($item['code'], $this->doNotEscape[$viewName_list])) + { + return '$item->' . $item['code']; + } + } + // default + return $escape . '($item->' . $item['code'] . ')'; + } + + protected function getListItemLink($item, &$checkoutTriger, $viewName_single, $viewName_list, $ref = null) + { + // set referal if not set + $referal = ''; + if (!$ref) + { + $ref = '&ref=' . $viewName_list; + } + // in linked tab/view so must add ref to default + else + { + $referal = $ref; + } + // if to be linked + if ($item['type'] === 'category' && !$item['title']) + { + // get the other view + $otherViews = $this->catCodeBuilder[$viewName_single]['views']; + // return the link to category + return 'index.php?option=com_categories&task=category.edit&id=' . $item['code'] . '; ?>&extension=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.' . $otherViews; + } + elseif ($item['type'] === 'user' && !$item['title']) + { + // return user link + return 'index.php?option=com_users&task=user.edit&id=' . $item['code'] . ' ?>'; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title'] && isset($item['id_code'])) + { + // link to that linked item + return 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id_code'] . '; ?>' . $ref; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title'] && isset($item['id_code'])) + { + // return user link + return 'index.php?option=com_users&task=user.edit&id=' . $item['id_code'] . ' ?>'; + } + // make sure to triger the checkout + $checkoutTriger = true; + // basic default item link + return '&id=id; ?>'.$referal; + } + + protected function getListItemLinkAutority($item, $viewName_single, $viewName_list, $coreLoad, $core, $user = '$this->user') + { + // if to be linked + if ($item['type'] === 'category' && !$item['title']) + { + // get the other view + $otherViews = $this->catCodeBuilder[$viewName_single]['views']; + // return the autority to category + return $user . "->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")"; + } + elseif ($item['type'] === 'user' && !$item['title']) + { + // return user autority + return $user . "->authorise('core.edit', 'com_users')"; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title'] && isset($item['id_code'])) + { + // link to that linked item + $coreLoadLink = false; + if (isset($this->permissionCore[$item['custom']['view']])) + { + $coreLink = $this->permissionCore[$item['custom']['view']]; + $coreLoadLink = true; + } + // check if the item has permissions. + if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) + { + return $user . "->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id_code'] . ")"; + } + // return default for this external item + return $user . "->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id_code'] . ")"; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title'] && isset($item['id_code'])) + { + // return user link + return $user . "->authorise('core.edit', 'com_users')"; + } + // check if the item has custom permissions. + elseif ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) + { + // set permissions. + return "\$canDo->get('" . $core['core.edit'] . "')"; + } + // set core permissions. + return "\$canDo->get('core.edit')"; + } + protected function setListFieldClass($name, $listViewName, $default = '') { return (isset($this->listFieldClass[$listViewName]) && isset($this->listFieldClass[$listViewName][$name])) ? $this->listFieldClass[$listViewName][$name] : $default; @@ -7548,6 +7580,7 @@ class Interpretation extends Fields $firstTimeBeingAdded = true; // setup correct core target $coreLoad = false; + $core = null; if (isset($this->permissionCore[$viewName_single])) { $core = $this->permissionCore[$viewName_single]; @@ -7572,212 +7605,44 @@ class Interpretation extends Fields // start adding the dynamic foreach ($this->listBuilder[$viewName_list] as $item) { + // set the ref + $ref = '&ref=' . $refview . '&refid='; + // set some defaults + $customAdminViewButtons = ''; + // get list item code + $itemCode = $this->getListItemCode($item, $viewName_list, $doNotEscape, '$displayData->escape'); + // is this a linked item + if (($item['link'] || (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user')) && (!isset($item['custom']) || !isset($item['custom']['view']) || $refview !== $item['custom']['view'])) + { + // set some defaults + $checkoutTriger = false; + // get list item link + $itemLink = $this->getListItemLink($item, $checkoutTriger, $viewName_single, $viewName_list, $ref); + // get list item link autority + $itemLinkAutority = $this->getListItemLinkAutority($item, $viewName_single, $viewName_list, $coreLoad, $core, '$user'); + // set item row + $itemRow = $this->getListItemLinkRow($itemCode, $itemLink, $itemLinkAutority, $viewName_list, $checkoutTriger, false); + } + else + { + // set item row + $itemRow = PHP_EOL . "\t\t\t"; + } + // check if buttons was aready added + if ($firstTimeBeingAdded) // TODO we must improve this to allow morw items to be targeted instead of just the first item :) + { + // get custom admin view buttons + $customAdminViewButtons = $this->getCustomAdminViewButtons($item, $viewName_single, $viewName_list, $coreLoad, $ref); + // make sure the custom admin view buttons are only added once + $firstTimeBeingAdded = false; + } + // add row to body + $body .= PHP_EOL . "\t\t"; + $body .= $itemRow; + $body .= $customAdminViewButtons; + $body .= PHP_EOL . "\t\t"; + // increment counter $counter++; - $checkoutTriger = false; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && isset($item['custom']['table']) && ComponentbuilderHelper::checkString($item['custom']['table'])) - { - $item['id'] = $item['code']; - if (!$item['multiple']) - { - $item['code'] = $item['code'] . '_' . $item['custom']['text']; - } - } - // check if translated vlaue is used - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) - { - $itemCode = '' . $item['code'] . '); ?>'; - } - elseif ($item['custom']['text'] === 'user') - { - $itemCode = '' . $item['code'] . ')->name; ?>'; - } - elseif ($doNotEscape) - { - if (in_array($item['code'], $this->doNotEscape[$viewName_list])) - { - $itemCode = '' . $item['code'] . '; ?>'; - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } - - if ($item['link']) - { - // allways rest custom links - $customAdminView = ''; - // if to be linked - if ($item['type'] === 'category' && !$item['title']) - { - $otherViews = $this->catCodeBuilder[$viewName_single]['views']; - // category and linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - else - { - $add = true; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title']) - { - if ($refview === $item['custom']['view']) - { - // normal not linked - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\t" . $itemCode; - $body .= PHP_EOL . "\t\t"; - - $add = false; - } - else - { - // link to that item instead - $link = 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id'] . '; ?>&ref=' . $refview . '&refid='; - - - $coreLoadLink = false; - if (isset($this->permissionCore[$item['custom']['view']])) - { - $coreLink = $this->permissionCore[$item['custom']['view']]; - $coreLoadLink = true; - } - // check if the item has permissions. - if ($coreLoadLink && isset($this->permissionBuilder[$coreLink['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) - { - $accessCheck = "\$user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - else - { - $accessCheck = "\$user->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - } - } - elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - - $add = false; - } - else - { - $link = '&id=id; ?>&ref=' . $refview . '&refid='; - // check if custom links should be added to this list views - if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) - { - // make sure the custom links are only added once - $firstTimeBeingAdded = false; - // start building the links - $customAdminView = PHP_EOL . "\t\t\t" . '
'; - foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) - { - $customAdminView .= PHP_EOL . "\t\t\tget('" . $customLinkView['link'] . ".access')): ?>"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; - $customAdminView .= PHP_EOL . "\t\t\t"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; - $customAdminView .= PHP_EOL . "\t\t\t"; - } - $customAdminView .= PHP_EOL . "\t\t\t" . '
'; - } - // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) - { - // set permissions. - $accessCheck = "\$canDo->get('" . $core['core.edit'] . "')"; - } - else - { - // set permissions. - $accessCheck = "\$canDo->get('core.edit')"; - } - // triger the checked out script to be added - $checkoutTriger = true; - } - - if ($add) - { - // set as linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '' . $itemCode . ''; - if ($checkoutTriger) - { - $body .= PHP_EOL . "\t\t\t\t\tchecked_out): ?>"; - $body .= PHP_EOL . "\t\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - } - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '
' . $itemCode . '
'; - $body .= PHP_EOL . "\t\t\t"; - $body .= $customAdminView; - $body .= PHP_EOL . "\t\t"; - } - } - } - else - { - if ($item['type'] === 'category') - { - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t"; - } - elseif (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user') - { - // custom user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user') - { - // user name only - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t"; - } - else - { - // normal not linked - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\t" . $itemCode; - $body .= PHP_EOL . "\t\t"; - } - } } $counter = $counter + 2; $data_value = (3 == $this->footableVersion) ? 'data-sort-value' : 'data-value'; @@ -9303,7 +9168,7 @@ class Interpretation extends Fields } // set target type $targetTypeSufix = ""; - if ($this->defaultField($target['type'], 'spacer')) + if (ComponentbuilderHelper::fieldCheck($target['type'], 'spacer')) { // target a class if this is a note or spacer $targetType = "."; @@ -9369,7 +9234,7 @@ class Interpretation extends Fields { case 1: // Is // only 4 list/radio/checkboxes - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9400,7 +9265,7 @@ class Interpretation extends Fields break; case 2: // Is Not // only 4 list/radio/checkboxes - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9431,7 +9296,7 @@ class Interpretation extends Fields break; case 3: // Any Selection // only 4 list/radio/checkboxes/dynamic_list - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9469,21 +9334,21 @@ class Interpretation extends Fields break; case 4: // Active (not empty) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { $string .= 'isSet(' . $value . ')'; } break; case 5: // Unactive (empty) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { $string .= '!isSet(' . $value . ')'; } break; case 6: // Key Word All (case-sensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9507,7 +9372,7 @@ class Interpretation extends Fields break; case 7: // Key Word Any (case-sensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9531,7 +9396,7 @@ class Interpretation extends Fields break; case 8: // Key Word All (case-insensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9556,7 +9421,7 @@ class Interpretation extends Fields break; case 9: // Key Word Any (case-insensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9581,7 +9446,7 @@ class Interpretation extends Fields break; case 10: // Min Length // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9598,7 +9463,7 @@ class Interpretation extends Fields break; case 11: // Max Length // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9615,7 +9480,7 @@ class Interpretation extends Fields break; case 12: // Exact Length // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9643,7 +9508,7 @@ class Interpretation extends Fields $buket = array(); if (ComponentbuilderHelper::checkString($options)) { - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { $optionsArray = array_map('trim', (array) explode(PHP_EOL, $options)); if (!ComponentbuilderHelper::checkArray($optionsArray)) @@ -9663,7 +9528,7 @@ class Interpretation extends Fields } } } - elseif (ComponentbuilderHelper::typeField($type, 'text')) + elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { // check to get the key words if set $keywords = ComponentbuilderHelper::getBetween($options, 'keywords="', '"'); @@ -9721,12 +9586,12 @@ class Interpretation extends Fields // this is only since 3.3.4 $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '_id").val();'; } - elseif ($type === 'list' || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + elseif ($type === 'list' || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();'; $isArray = true; } - elseif (ComponentbuilderHelper::typeField($type, 'text')) + elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();'; } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 4b2dcaaaf..96d83f264 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -1801,7 +1801,7 @@ abstract class ComponentbuilderHelper return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix))); } - public static function imageInfo($path,$request = 'type') + public static function imageInfo($path, $request = 'type') { // set image $image = JPATH_SITE.'/'.$path; @@ -1914,37 +1914,79 @@ abstract class ComponentbuilderHelper return array_unique($bucket); } - public static function typeField($type,$option = 'default') + + /** + * Field Grouping https://docs.joomla.org/Form_field + **/ + protected static $fieldGroups = array( + 'default' => array( + 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', + 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', + 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', + 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', + 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', + 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', + 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', + 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ), + 'plain' => array( + 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', + 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', + 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', + 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', + 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', + 'sessionhandler', 'tag', 'tel', 'text', 'textarea', + 'timezone', 'url', 'user', 'usergroup' + ), + 'text' => array( + 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' + ), + 'list' => array( + 'checkboxes','checkbox','list','radio' + ), + 'dynamic' => array( + 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' + ), + 'spacer' => array( + 'note', 'spacer' + ), + 'option' => array( + 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' + ), + 'special' => array( + 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', + 'repeatable', 'templatestyle', 'subform' + ) + ); + + /** + * Field Checker + * + * @param string $type The field type + * @param boolean $option The field grouping + * + * @return boolean if the field was found + */ + public static function fieldCheck($type, $option = 'default') { - // list of default fields - // https://docs.joomla.org/Form_field - $fields = array( - 'default' => array( - 'accesslevel','cachehandler','calendar','captcha','category','checkbox', - 'checkboxes','color','combo','componentlayout','contentlanguage','editor', - 'chromestyle','contenttype','databaseconnection','editors','email','file', - 'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite', - 'imagelist','integer','language','list','media','menu','note','password', - 'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag', - 'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag', - 'templatestyle','text','textarea','timezone','url','user','usergroup' - ), - 'text' => array( - 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' - ), - 'list' => array( - 'checkboxes','checkbox','list','radio' - ), - 'dynamic' => array( - 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' - ) - ); - - if (in_array($type,$fields[$option])) + // now check + if (isset(self::$fieldGroups[$option]) && in_array($type, self::$fieldGroups[$option])) { return true; } - return false; + return false; + } + + /** + * get the spacer IDs + * + * @return array ids of the spacer field types + */ + public static function getSpacerIds() + { + // get the database object to use quote + $db = JFactory::getDbo(); + return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id'); } /** diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index ec882ac9e..d0662faaf 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -11,6 +11,7 @@ COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_T 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_MORE_FIELDS_TO_THIS_ADMIN_VIEW="Add more fields to this admin view" COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL="Add to Backup Folder & Sales Server (if set)" COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER="Add to Repository Folder" COM_COMPONENTBUILDER_ADD_YOUR_OWN_JCB_PACKAGES_TO_THE_COMMUNITY_A_S_GITHUBA_REPOSITORYBR_WATCH_THIS_A_S_TUTORIALA_TO_SEE_HOW="Add your own JCB packages to the community gitHub repository.
Watch this tutorial to see how!" @@ -253,12 +254,13 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_LABEL="Relations" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW="Admin View" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL="View" -COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE="Concatenate" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_AREA_LABEL="Area" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE_RAQUO_GLUE="Concatenate » Glue" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_DESC="The user that created this Admin Fields Relations." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_LABEL="Created By" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_DESC="The date this Admin Fields Relations was created." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_LABEL="Created Date" -COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_CODE="Custom Code" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_RAQUO_CODE="Custom » Code" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT="Editing the Admin Fields Relations" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Relations has the same alias." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID="Id" @@ -269,12 +271,14 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOIN_TYPE_LABEL="Join Type" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD="Listfield" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_DESCRIPTION="Select the target list field." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_LABEL="List Field" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL="Model" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_DESC="The last user that modified this Admin Fields Relations." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_DESC="The date this Admin Fields Relations was modified." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_LABEL="Modified Date" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW="A New Admin Fields Relations" -COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_DESCRIPTION="

Here you are able to combine/join multiple fields into one for display in the list view of the admin area.

You are able to add calculations, or even model the values into one result.

" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_DESCRIPTION="

Here you are able to combine/join multiple fields into one for display in the list view of the admin area.

+

You are able to add calculations, or even model the values into one result.

" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_LABEL="Relations Implementation" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION="Permissions" @@ -287,6 +291,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_LABEL="Set" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS="Status" COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_DESC="A count of the number of times this Admin Fields Relations has been revised." COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VIEW="View" COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_IN_TAB="Right in Tab" COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_OF_TABS="Right of Tabs" COM_COMPONENTBUILDER_ADMIN_FIELDS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields to customise the alias." diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index 6ea1e51c7..29a9ee253 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -68,14 +68,14 @@ $can = ComponentbuilderHelper::getActions('field'); $canDo = ComponentbuilderHelper::getActions('field',$item,'fields'); ?> - + get('field.edit')): ?> escape($item->name); ?> - checked_out): ?> - name, $item->checked_out_time, 'fields.', $canCheckin); ?> - + checked_out): ?> + name, $item->checked_out_time, 'fields.', $canCheckin); ?> + -
escape($item->name); ?>
+ escape($item->name); ?> @@ -93,7 +93,7 @@ $can = ComponentbuilderHelper::getActions('field'); store); ?> - + authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?> escape($item->category_title); ?> diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index c607d032e..1ebc0da63 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -59,14 +59,14 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components'); ?> - + get('joomla_component.edit')): ?> escape($item->system_name); ?> - checked_out): ?> - name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> - + checked_out): ?> + name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> + -
escape($item->system_name); ?>
+ escape($item->system_name); ?> diff --git a/admin/models/admin_fields_relations.php b/admin/models/admin_fields_relations.php index df334222b..5fa4f3dca 100644 --- a/admin/models/admin_fields_relations.php +++ b/admin/models/admin_fields_relations.php @@ -87,26 +87,6 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin $addrelations = new Registry; $addrelations->loadString($item->addrelations); $item->addrelations = $addrelations->toArray(); - } - - // check what type of conditions array we have here (should be subform... but just incase) - // This could happen due to huge data sets - if (isset($item->addconditions) && isset($item->addconditions['target_field'])) - { - $bucket = array(); - foreach($item->addconditions as $option => $values) - { - foreach($values as $nr => $value) - { - $bucket['addconditions'.$nr][$option] = $value; - } - } - $item->addconditions = $bucket; - // update the fields - $conditionsUpdate = new stdClass(); - $conditionsUpdate->id = (int) $item->id; - $conditionsUpdate->addconditions = json_encode($bucket); - $this->_db->updateObject('#__componentbuilder_admin_fields_conditions', $conditionsUpdate, 'id'); } if (!empty($item->id)) diff --git a/admin/models/ajax.php b/admin/models/ajax.php index ba5222381..756b22c5a 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -1092,7 +1092,7 @@ class ComponentbuilderModelAjax extends JModelList { $result = $this->_db->loadObject(); $result->name = strtolower($result->name); - if (ComponentbuilderHelper::typeField($result->name,'list')) + if (ComponentbuilderHelper::fieldCheck($result->name,'list')) { // load the values form params $xml = json_decode($result->xml); @@ -1136,15 +1136,15 @@ class ComponentbuilderModelAjax extends JModelList // return found field options return $optionSet; } - elseif (ComponentbuilderHelper::typeField($result->name,'text')) + elseif (ComponentbuilderHelper::fieldCheck($result->name,'text')) { return "keywords=\"\"\nlength=\"\""; } - elseif (ComponentbuilderHelper::typeField($result->name,'dynamic')) + elseif (ComponentbuilderHelper::fieldCheck($result->name,'dynamic')) { return 'dynamic_list'; } - elseif (ComponentbuilderHelper::typeField($result->name)) + elseif (ComponentbuilderHelper::fieldCheck($result->name)) { return 'match field type not supported. Select another!'; } @@ -2567,6 +2567,52 @@ class ComponentbuilderModelAjax extends JModelList return $xml; } + // Used in admin_fields_relations + public function getCodeGlueOptions($listfield, $joinfields, $type, $area) + { + // CONCATENATE GLUE + if ($type == 1) + { + // MODEL + if ($area == 1) + { + return ', '; + } + // VIEW + elseif ($area == 2) + { + return '
'; + } + } + // CUSTOM CODE + elseif ($type == 2) + { + // build fields array + $fields = array_map( function ($id) { + return (int) $id; + }, (array) explode(',', $joinfields)); + // add the list field to array + array_unshift($fields, (int) $listfield); + // get field names + $names = array_map( function ($id) { + return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name'); + }, $fields); + // create note + $note = "// ". implode('; ', $names); + // MODEL + if ($area == 1) + { + return $note . PHP_EOL . PHP_EOL . '$item->[' . implode("] . ', ' . \$item->[", $fields) . '];'; + } + // VIEW + elseif ($area == 2) + { + return '$this->escape($item->[' . implode("]) . '
' . \$this->escape(\$item->[", $fields). ']);' . PHP_EOL . PHP_EOL . $note; + } + } + return false; + } + // Used in get_snippets public function getSnippets($libraries) diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index 6deff2c59..f48a537db 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -123,6 +123,8 @@ class ComponentbuilderModelDynamic_gets extends JModelList $item->main_source = $this->selectionTranslation($item->main_source, 'main_source'); // convert gettype $item->gettype = $this->selectionTranslation($item->gettype, 'gettype'); + // convert addcalculation + $item->addcalculation = $this->selectionTranslation($item->addcalculation, 'addcalculation'); } } @@ -168,6 +170,19 @@ class ComponentbuilderModelDynamic_gets extends JModelList return $gettypeArray[$value]; } } + // Array of addcalculation language strings + if ($name === 'addcalculation') + { + $addcalculationArray = array( + 1 => 'COM_COMPONENTBUILDER_DYNAMIC_GET_YES', + 0 => 'COM_COMPONENTBUILDER_DYNAMIC_GET_NO' + ); + // Now check if value is found in this array + if (isset($addcalculationArray[$value]) && ComponentbuilderHelper::checkString($addcalculationArray[$value])) + { + return $addcalculationArray[$value]; + } + } return $value; } @@ -190,6 +205,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList // From the componentbuilder_item table $query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a')); + // From the componentbuilder_admin_view table. + $query->select($db->quoteName('h.system_name','view_table_main_system_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'h') . ' ON (' . $db->quoteName('a.view_table_main') . ' = ' . $db->quoteName('h.id') . ')'); + // Filter by published state $published = $this->getState('filter.published'); if (is_numeric($published)) diff --git a/admin/models/fields/aliasbuilder.php b/admin/models/fields/aliasbuilder.php index 3c50d6b29..b5ca7834d 100644 --- a/admin/models/fields/aliasbuilder.php +++ b/admin/models/fields/aliasbuilder.php @@ -64,28 +64,36 @@ class JFormFieldAliasbuilder extends JFormFieldList } } } - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.name','b.name'),array('id','name','type'))); - $query->from($db->quoteName('#__componentbuilder_field', 'a')); - $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'b') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('b.id') . ')'); - $query->where($db->quoteName('a.published') . ' >= 1'); // filter by fields linked if (ComponentbuilderHelper::checkArray($fieldIds)) { + // get list of field types that does not work in list views (note, spacer) + $spacers = ComponentbuilderHelper::getSpacerIds(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name','b.name'),array('id','name','type'))); + $query->from($db->quoteName('#__componentbuilder_field', 'a')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'b') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('b.id') . ')'); + $query->where($db->quoteName('a.published') . ' >= 1'); // only load these fields $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')'); - } - $query->order('a.name ASC'); - $db->setQuery((string)$query); - $items = $db->loadObjectList(); - $options = array(); - if ($items) - { - foreach($items as $item) + // none of these field types + if (ComponentbuilderHelper::checkArray($spacers)) { - $options[] = JHtml::_('select.option', $item->id, $item->name . ' [' . $item->type . ']'); + $query->where($db->quoteName('a.fieldtype') . ' NOT IN (' . implode(',', $spacers) . ')'); + } + $query->order('a.name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->name . ' [' . $item->type . ']'); + } + return $options; } } - return $options; + return array(JHtml::_('select.option', '', JText::_('COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW'))); } } diff --git a/admin/models/fields/joinfields.php b/admin/models/fields/joinfields.php index 69e2531c9..fc7adabf6 100644 --- a/admin/models/fields/joinfields.php +++ b/admin/models/fields/joinfields.php @@ -76,12 +76,20 @@ class JFormFieldJoinfields extends JFormFieldList // filter by fields linked if (ComponentbuilderHelper::checkArray($fieldIds)) { + // get list of field types that does not work in list views (note, spacer) + $spacers = ComponentbuilderHelper::getSpacerIds(); $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.name'),array('id','name'))); + $query->select($db->quoteName(array('a.id','a.name','t.name'),array('id','name','type'))); $query->from($db->quoteName('#__componentbuilder_field', 'a')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 't') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('t.id') . ')'); $query->where($db->quoteName('a.published') . ' >= 1'); // only load these fields $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')'); + // none of these field types + if (ComponentbuilderHelper::checkArray($spacers)) + { + $query->where($db->quoteName('a.fieldtype') . ' NOT IN (' . implode(',', $spacers) . ')'); + } $query->order('a.name ASC'); $db->setQuery((string)$query); $items = $db->loadObjectList(); @@ -90,12 +98,12 @@ class JFormFieldJoinfields extends JFormFieldList { foreach($items as $item) { - $options[] = JHtml::_('select.option', $item->id, $item->name); + $options[] = JHtml::_('select.option', $item->id, $item->name . ' [' . $item->type . ']'); } } return $options; } } - return false; + return array(JHtml::_('select.option', '', JText::_('COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW'))); } } diff --git a/admin/models/forms/admin_fields_relations.js b/admin/models/forms/admin_fields_relations.js index 4b31cfb80..c0d8be38e 100644 --- a/admin/models/forms/admin_fields_relations.js +++ b/admin/models/forms/admin_fields_relations.js @@ -11,10 +11,33 @@ -function getFieldSelectOptions_server(fieldId){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json"; - if(token.length > 0 && fieldId > 0){ - var request = 'token='+token+'&id='+fieldId; +// little script to set the value +function getCodeGlueOptions(field) { + // get the ID + var id = jQuery(field).attr('id'); + var target = id.split('__'); + //set the subID + var subID = target[0]+'__'+target[1]; + // get listfield value + var listfield = jQuery('#'+subID+'__listfield').val(); + // get joinfields values + var joinfields = jQuery('#'+subID+'__joinfields').val(); + // get type value + var type = jQuery('#'+subID+'__join_type').val(); + // get area value + var area = jQuery('#'+subID+'__area').val(); + // get codeGlueOptions + getCodeGlueOptions_server(listfield, joinfields, type, area).done(function(result) { + if(result){ + jQuery('#'+subID+'__set').val(result); + } + }); +} + +function getCodeGlueOptions_server(listfield, joinfields, type, area){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getCodeGlueOptions&format=json"; + if(token.length > 0 && listfield > 0 && joinfields.length >= 1 && type > 0 && area > 0) { + var request = 'token='+token+'&listfield='+listfield+'&type='+type+'&area='+area+'&joinfields='+joinfields; } return jQuery.ajax({ type: 'GET', @@ -25,20 +48,4 @@ function getFieldSelectOptions_server(fieldId){ }); } -function getFieldSelectOptions(fieldKey){ - // first check if the field is set - if(jQuery("#jform_addconditions__addconditions"+fieldKey+"__match_field").length) { - var fieldId = jQuery("#jform_addconditions__addconditions"+fieldKey+"__match_field option:selected").val(); - getFieldSelectOptions_server(fieldId).done(function(result) { - if(result){ - jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__match_options').val(result); - } - else - { - jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__match_options').val(''); - } - }); - } -} - diff --git a/admin/models/forms/admin_fields_relations.xml b/admin/models/forms/admin_fields_relations.xml index 64c8c7433..abb39f67d 100644 --- a/admin/models/forms/admin_fields_relations.xml +++ b/admin/models/forms/admin_fields_relations.xml @@ -116,6 +116,7 @@ class="fieldMedium" multiple="false" required="false" + onchange="getCodeGlueOptions(this)" button="false" /> @@ -127,8 +128,26 @@ class="fieldMedium" multiple="true" required="false" + onchange="getCodeGlueOptions(this)" button="false" /> + + + + + + + default="1" + onchange="getCodeGlueOptions(this)"> + COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE_RAQUO_GLUE + COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_RAQUO_CODE - + diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index c7e43921c..414d1f251 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1525,7 +1525,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name (3, '', 'The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Checkbox', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkbox\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkbox\"},\"properties1\":{\"name\":\"name\",\"example\":\"show_title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Show title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"value\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) is the value of the parameter if this checkbox is set (usually 1).\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value (usually 0 or 1).\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Show the title of the item\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (JavaScript use)\"}}', 'provides a single checkbox to be checked or unchecked', '', 1, 4, '', ''), (4, '', 'The checkboxes form field type provides a set of checkboxes. Note: unlike most standard form field types, such as textfield or checkbox, this field is not an \"out of the box\" solution. It will create checkboxes for you, and submit their values in form of ', 'Checkboxes', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkboxes\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"anch|Anchovies,chor|Chorizo,on|Onions,mush|Mushrooms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"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 label.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides unlimited checkboxes that can be used for multi-select.', '', 1, 2, '', ''), (5, '', 'Provides a color picker. Enter the color as #ff00ff or pick it from the palet.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) provides a color when not set.\"},\"properties3\":{\"name\":\"label\",\"example\":\"Background\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Select the background color here.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a color picker when clicking the input box.', '', 1, 2, '', ''), -(6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"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\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"$db = JFactory::getDBO();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties24\":{\"name\":\"type_php_2\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties25\":{\"name\":\"type_php_3\",\"example\":\"$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties26\":{\"name\":\"type_php_4\",\"example\":\"$query->from($db->quoteName(\'###TABLE###\', \'a\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties27\":{\"name\":\"type_php_5\",\"example\":\"$query->where($db->quoteName(\'a.published\') . \' = 1\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties28\":{\"name\":\"type_php_6\",\"example\":\"$query->order(\'a.###TEXT### ASC\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties29\":{\"name\":\"type_php_7\",\"example\":\"$db->setQuery((string)$query);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties30\":{\"name\":\"type_php_8\",\"example\":\"$items = $db->loadObjectList();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties31\":{\"name\":\"type_php_9\",\"example\":\"$options = array();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties32\":{\"name\":\"type_php_10\",\"example\":\"if ($items)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties33\":{\"name\":\"type_php_11\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties34\":{\"name\":\"type_php_12\",\"example\":\"\\\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties35\":{\"name\":\"type_php_13\",\"example\":\"\\\\tforeach($items as $item)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties36\":{\"name\":\"type_php_14\",\"example\":\"\\\\t{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties37\":{\"name\":\"type_php_15\",\"example\":\"\\\\t\\\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties38\":{\"name\":\"type_php_16\",\"example\":\"\\\\t}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties39\":{\"name\":\"type_php_17\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties40\":{\"name\":\"type_php_18\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties41\":{\"name\":\"type_php_19\",\"example\":\"return $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 9, '', ''), +(6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"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\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"$db = JFactory::getDBO();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties24\":{\"name\":\"type_php_2\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties25\":{\"name\":\"type_php_3\",\"example\":\"$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties26\":{\"name\":\"type_php_4\",\"example\":\"$query->from($db->quoteName(\'###TABLE###\', \'a\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties27\":{\"name\":\"type_php_5\",\"example\":\"$query->where($db->quoteName(\'a.published\') . \' = 1\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties28\":{\"name\":\"type_php_6\",\"example\":\"$query->order(\'a.###TEXT### ASC\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties29\":{\"name\":\"type_php_7\",\"example\":\"$db->setQuery((string)$query);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties30\":{\"name\":\"type_php_8\",\"example\":\"$items = $db->loadObjectList();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties31\":{\"name\":\"type_php_9\",\"example\":\"$options = array();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties32\":{\"name\":\"type_php_10\",\"example\":\"if ($items)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties33\":{\"name\":\"type_php_11\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties34\":{\"name\":\"type_php_12\",\"example\":\"\\\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties35\":{\"name\":\"type_php_13\",\"example\":\"\\\\tforeach($items as $item)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties36\":{\"name\":\"type_php_14\",\"example\":\"\\\\t{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties37\":{\"name\":\"type_php_15\",\"example\":\"\\\\t\\\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties38\":{\"name\":\"type_php_16\",\"example\":\"\\\\t}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties39\":{\"name\":\"type_php_17\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties40\":{\"name\":\"type_php_18\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties41\":{\"name\":\"type_php_19\",\"example\":\"return $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 10, '', ''), (7, '', 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"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.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ set the groups array\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_php_2\",\"example\":\"$groups = JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties21\":{\"name\":\"type_php_3\",\"example\":\"return $groups;\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\/\\/ To ensure that there is only one record per user\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties23\":{\"name\":\"type_phpx_2\",\"example\":\"\\/\\/ Get a db connection.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties24\":{\"name\":\"type_phpx_3\",\"example\":\"$db = JFactory::getDbo();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties25\":{\"name\":\"type_phpx_4\",\"example\":\"\\/\\/ Create a new query object.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties26\":{\"name\":\"type_phpx_5\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties27\":{\"name\":\"type_phpx_6\",\"example\":\"\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties28\":{\"name\":\"type_phpx_7\",\"example\":\"$query->select($db->quoteName(\'###CODE###\'));\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties29\":{\"name\":\"type_phpx_8\",\"example\":\"$query->from($db->quoteName(\'#__###component###_###view###\'));\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties30\":{\"name\":\"type_phpx_9\",\"example\":\"$db->setQuery($query);\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties31\":{\"name\":\"type_phpx_10\",\"example\":\"$db->execute();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties32\":{\"name\":\"type_phpx_11\",\"example\":\"$found = $db->getNumRows();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties33\":{\"name\":\"type_phpx_12\",\"example\":\"if ($found)\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties34\":{\"name\":\"type_phpx_13\",\"example\":\"{\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties35\":{\"name\":\"type_phpx_14\",\"example\":\"\\\\t\\/\\/ return all users already used\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties36\":{\"name\":\"type_phpx_15\",\"example\":\"\\\\treturn array_unique($db->loadColumn());\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties37\":{\"name\":\"type_phpx_16\",\"example\":\"}\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties38\":{\"name\":\"type_phpx_17\",\"example\":\"return null;\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 2, '', ''), (8, '', 'The Editor field type provides a WYSIWYG editor.', 'Editor', '{\"properties0\":{\"name\":\"type\",\"example\":\"editor\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editor.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextblock\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Test Field\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties16\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties4\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties5\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties6\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties7\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties8\":{\"name\":\"buttons\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.\"},\"properties9\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties10\":{\"name\":\"editor\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties11\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties15\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides an editor area field.', '', 1, 5, '', ''), (9, '', 'The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). If the parameter has a saved value this is entered i', 'Hidden', '{\"properties0\":{\"name\":\"type\",\"example\":\"hidden\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be hidden.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mysecretvariable\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the data which needs to be collected.\"},\"properties5\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties4\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"}}', 'provides a hidden field for saving a form field whose value cannot be altered directly by a user.', '', 1, 2, '', ''), @@ -1675,7 +1675,8 @@ INSERT INTO `#__componentbuilder_admin_fields_conditions` (`id`, `addconditions` -- INSERT INTO `#__componentbuilder_admin_fields_relations` (`id`, `addrelations`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES -(1, '{\"addrelations0\":{\"listfield\":\"201\",\"joinfields\":[\"279\"],\"join_type\":\"1\",\"set\":\" \"}}', 14, 1, '2018-05-22 01:20:34', '2018-05-22 01:37:07', 2, '', 1); +(1, '', 14, 1, '2018-05-22 01:20:34', '2018-05-23 03:37:27', 9, '', 1), +(2, '{\"addrelations0\":{\"listfield\":\"199\",\"joinfields\":[\"351\",\"343\"],\"area\":\"1\",\"join_type\":\"2\",\"set\":\"\\/\\/ [199]=> Name; [351]=> DB Table (main); [343]=> View Table (main)\\r\\n\\r\\n$item->[199] . \', \' . $item->[351] . \', \' . $item->[343];\"},\"addrelations2\":{\"listfield\":\"342\",\"joinfields\":[\"531\"],\"area\":\"1\",\"join_type\":\"1\",\"set\":\", \"}}', 22, 1, '2018-05-23 03:38:52', '2018-05-23 03:46:56', 3, '', 2); -- -- Dumping data for table `#__componentbuilder_component_admin_views` diff --git a/admin/views/admin_fields_relations/tmpl/edit.php b/admin/views/admin_fields_relations/tmpl/edit.php index 03871fadc..ae64ff6ba 100644 --- a/admin/views/admin_fields_relations/tmpl/edit.php +++ b/admin/views/admin_fields_relations/tmpl/edit.php @@ -100,32 +100,4 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder'); - - - + diff --git a/admin/views/admin_views/tmpl/default_body.php b/admin/views/admin_views/tmpl/default_body.php index 6c4017f8a..fb821e443 100644 --- a/admin/views/admin_views/tmpl/default_body.php +++ b/admin/views/admin_views/tmpl/default_body.php @@ -61,28 +61,28 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view. - get('admin_view.edit')): ?> -
+
+ get('admin_view.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admin_views.', $canCheckin); ?> -
- -
escape($item->system_name); ?>
- + + escape($item->system_name); ?> + +
-
- get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?> - - - get('admin_view.edit') && $admin_relation_id = ComponentbuilderHelper::getVar('admin_fields_relations', $item->id, 'admin_view', 'id')): ?> - - - get('admin_view.edit') && $admin_condition_id = ComponentbuilderHelper::getVar('admin_fields_conditions', $item->id, 'admin_view', 'id')): ?> - - -
+
+ get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?> + + + get('admin_view.edit') && $admin_relation_id = ComponentbuilderHelper::getVar('admin_fields_relations', $item->id, 'admin_view', 'id')): ?> + + + get('admin_view.edit') && $admin_condition_id = ComponentbuilderHelper::getVar('admin_fields_conditions', $item->id, 'admin_view', 'id')): ?> + + +
diff --git a/admin/views/admins_fields/tmpl/default_body.php b/admin/views/admins_fields/tmpl/default_body.php index 7f2192afc..bb188db2f 100644 --- a/admin/views/admins_fields/tmpl/default_body.php +++ b/admin/views/admins_fields/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fie - get('admin_fields.edit')): ?> -
+
+ get('admin_fields.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admins_fields.', $canCheckin); ?> -
- -
escape($item->admin_view_system_name); ?>
- + + escape($item->admin_view_system_name); ?> + +
get('admin_fields.edit.state')) : ?> diff --git a/admin/views/admins_fields_conditions/tmpl/default_body.php b/admin/views/admins_fields_conditions/tmpl/default_body.php index 53a80f3a8..1c07fa01d 100644 --- a/admin/views/admins_fields_conditions/tmpl/default_body.php +++ b/admin/views/admins_fields_conditions/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&tas - get('admin_fields_conditions.edit')): ?> -
+
+ get('admin_fields_conditions.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admins_fields_conditions.', $canCheckin); ?> -
- -
escape($item->admin_view_system_name); ?>
- + + escape($item->admin_view_system_name); ?> + +
get('admin_fields_conditions.edit.state')) : ?> diff --git a/admin/views/admins_fields_relations/tmpl/default_body.php b/admin/views/admins_fields_relations/tmpl/default_body.php index 2cfc53c2d..064f68df9 100644 --- a/admin/views/admins_fields_relations/tmpl/default_body.php +++ b/admin/views/admins_fields_relations/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task - get('admin_fields_relations.edit')): ?> -
+
+ get('admin_fields_relations.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?> -
- -
escape($item->admin_view_system_name); ?>
- + + escape($item->admin_view_system_name); ?> + +
get('admin_fields_relations.edit.state')) : ?> diff --git a/admin/views/components_admin_views/tmpl/default_body.php b/admin/views/components_admin_views/tmpl/default_body.php index 234268503..f137f3620 100644 --- a/admin/views/components_admin_views/tmpl/default_body.php +++ b/admin/views/components_admin_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_admin_views&task= - get('component_admin_views.edit')): ?> -
+
+ get('component_admin_views.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_admin_views.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_admin_views.edit.state')) : ?> diff --git a/admin/views/components_config/tmpl/default_body.php b/admin/views/components_config/tmpl/default_body.php index cab3c9d11..671159739 100644 --- a/admin/views/components_config/tmpl/default_body.php +++ b/admin/views/components_config/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_config&task=compo - get('component_config.edit')): ?> -
+
+ get('component_config.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_config.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_config.edit.state')) : ?> diff --git a/admin/views/components_custom_admin_menus/tmpl/default_body.php b/admin/views/components_custom_admin_menus/tmpl/default_body.php index b79861a29..f125f448c 100644 --- a/admin/views/components_custom_admin_menus/tmpl/default_body.php +++ b/admin/views/components_custom_admin_menus/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_custom_admin_menu - get('component_custom_admin_menus.edit')): ?> -
+
+ get('component_custom_admin_menus.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_custom_admin_menus.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_custom_admin_menus.edit.state')) : ?> diff --git a/admin/views/components_custom_admin_views/tmpl/default_body.php b/admin/views/components_custom_admin_views/tmpl/default_body.php index de47e1a18..5d8a10ef2 100644 --- a/admin/views/components_custom_admin_views/tmpl/default_body.php +++ b/admin/views/components_custom_admin_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_custom_admin_view - get('component_custom_admin_views.edit')): ?> -
+
+ get('component_custom_admin_views.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_custom_admin_views.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_custom_admin_views.edit.state')) : ?> diff --git a/admin/views/components_dashboard/tmpl/default_body.php b/admin/views/components_dashboard/tmpl/default_body.php index 57e663948..2fde248dc 100644 --- a/admin/views/components_dashboard/tmpl/default_body.php +++ b/admin/views/components_dashboard/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_dashboard&task=co - get('component_dashboard.edit')): ?> -
+
+ get('component_dashboard.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_dashboard.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_dashboard.edit.state')) : ?> diff --git a/admin/views/components_files_folders/tmpl/default_body.php b/admin/views/components_files_folders/tmpl/default_body.php index f2e11c0d1..33f6fdea7 100644 --- a/admin/views/components_files_folders/tmpl/default_body.php +++ b/admin/views/components_files_folders/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_files_folders&tas - get('component_files_folders.edit')): ?> -
+
+ get('component_files_folders.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_files_folders.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_files_folders.edit.state')) : ?> diff --git a/admin/views/components_mysql_tweaks/tmpl/default_body.php b/admin/views/components_mysql_tweaks/tmpl/default_body.php index 6725ef4da..1de70134e 100644 --- a/admin/views/components_mysql_tweaks/tmpl/default_body.php +++ b/admin/views/components_mysql_tweaks/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_mysql_tweaks&task - get('component_mysql_tweaks.edit')): ?> -
+
+ get('component_mysql_tweaks.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_mysql_tweaks.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_mysql_tweaks.edit.state')) : ?> diff --git a/admin/views/components_site_views/tmpl/default_body.php b/admin/views/components_site_views/tmpl/default_body.php index 7ec42568a..d685036d3 100644 --- a/admin/views/components_site_views/tmpl/default_body.php +++ b/admin/views/components_site_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_site_views&task=c - get('component_site_views.edit')): ?> -
+
+ get('component_site_views.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_site_views.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_site_views.edit.state')) : ?> diff --git a/admin/views/components_updates/tmpl/default_body.php b/admin/views/components_updates/tmpl/default_body.php index 5851317de..f5c4dfc62 100644 --- a/admin/views/components_updates/tmpl/default_body.php +++ b/admin/views/components_updates/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_updates&task=comp - get('component_updates.edit')): ?> -
+
+ get('component_updates.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_updates.', $canCheckin); ?> -
- -
escape($item->joomla_component_system_name); ?>
- + + escape($item->joomla_component_system_name); ?> + +
get('component_updates.edit.state')) : ?> diff --git a/admin/views/custom_admin_views/tmpl/default_body.php b/admin/views/custom_admin_views/tmpl/default_body.php index 1629a69d7..448cea272 100644 --- a/admin/views/custom_admin_views/tmpl/default_body.php +++ b/admin/views/custom_admin_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=cust - get('core.edit')): ?> -
+
+ get('core.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'custom_admin_views.', $canCheckin); ?> -
- -
escape($item->system_name); ?>
- + + escape($item->system_name); ?> + +
escape($item->name); ?> diff --git a/admin/views/custom_codes/tmpl/default_body.php b/admin/views/custom_codes/tmpl/default_body.php index 398bf89f9..95432ff54 100644 --- a/admin/views/custom_codes/tmpl/default_body.php +++ b/admin/views/custom_codes/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=custom_codes&task=custom_cod - get('custom_code.edit')): ?> -
+
+ get('custom_code.edit')): ?> escape($item->component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'custom_codes.', $canCheckin); ?> -
- -
escape($item->component_system_name); ?>
- + + escape($item->component_system_name); ?> + +
escape($item->path); ?> diff --git a/admin/views/dynamic_gets/tmpl/default_body.php b/admin/views/dynamic_gets/tmpl/default_body.php index fa17d0c4b..33a0e6e25 100644 --- a/admin/views/dynamic_gets/tmpl/default_body.php +++ b/admin/views/dynamic_gets/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge - get('dynamic_get.edit')): ?> -
+
+ get('dynamic_get.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'dynamic_gets.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
main_source); ?> diff --git a/admin/views/fields/tmpl/default_body.php b/admin/views/fields/tmpl/default_body.php index d3a5dac8f..845379c85 100644 --- a/admin/views/fields/tmpl/default_body.php +++ b/admin/views/fields/tmpl/default_body.php @@ -61,25 +61,25 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; - get('field.edit')): ?> -
+
+ get('field.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'fields.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
- user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int)$item->fieldtype)): ?> -
+
+ user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int)$item->fieldtype)): ?> escape($item->fieldtype_name); ?> -
- -
escape($item->fieldtype_name); ?>
- + + escape($item->fieldtype_name); ?> + +
datatype); ?> @@ -94,11 +94,13 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; store); ?> - user->authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?> - escape($item->category_title); ?> - - escape($item->category_title); ?> - +
+ user->authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?> + escape($item->category_title); ?> + + escape($item->category_title); ?> + +
get('field.edit.state')) : ?> diff --git a/admin/views/fieldtypes/tmpl/default_body.php b/admin/views/fieldtypes/tmpl/default_body.php index ef5a9621d..99cae6879 100644 --- a/admin/views/fieldtypes/tmpl/default_body.php +++ b/admin/views/fieldtypes/tmpl/default_body.php @@ -61,26 +61,28 @@ $edit = "index.php?option=com_componentbuilder&view=fieldtypes&task=fieldtype.ed - get('fieldtype.edit')): ?> -
+
+ get('fieldtype.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'fieldtypes.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->short_description); ?> - user->authorise('core.edit', 'com_componentbuilder.fieldtypes.category.' . (int)$item->catid)): ?> - escape($item->category_title); ?> - - escape($item->category_title); ?> - +
+ user->authorise('core.edit', 'com_componentbuilder.fieldtypes.category.' . (int)$item->catid)): ?> + escape($item->category_title); ?> + + escape($item->category_title); ?> + +
get('fieldtype.edit.state')) : ?> diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index b6e8c6fce..bd58d0227 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc - get('help_document.edit')): ?> -
+
+ get('help_document.edit')): ?> escape($item->title); ?> checked_out): ?> name, $item->checked_out_time, 'help_documents.', $canCheckin); ?> -
- -
escape($item->title); ?>
- + + escape($item->title); ?> + +
type); ?> diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php index fb9b793ee..be3bb4e9f 100644 --- a/admin/views/joomla_components/tmpl/default_body.php +++ b/admin/views/joomla_components/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml - get('joomla_component.edit')): ?> -
+
+ get('joomla_component.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> -
- -
escape($item->system_name); ?>
- + + escape($item->system_name); ?> + +
get('component_admin_views.edit') && $component_admin_views_id = ComponentbuilderHelper::getVar('component_admin_views', $item->id, 'joomla_component', 'id')): ?> diff --git a/admin/views/language_translations/tmpl/default_body.php b/admin/views/language_translations/tmpl/default_body.php index f313574a4..88ee31c82 100644 --- a/admin/views/language_translations/tmpl/default_body.php +++ b/admin/views/language_translations/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l - get('language_translation.edit')): ?> -
+
+ get('language_translation.edit')): ?> source; ?> checked_out): ?> name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> -
- -
source; ?>
- + + source; ?> + +
get('language_translation.edit.state')) : ?> diff --git a/admin/views/languages/tmpl/default_body.php b/admin/views/languages/tmpl/default_body.php index 2d239bc76..1121fb452 100644 --- a/admin/views/languages/tmpl/default_body.php +++ b/admin/views/languages/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=languages&task=language.edit - get('language.edit')): ?> -
+
+ get('language.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'languages.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->langtag); ?> diff --git a/admin/views/layouts/tmpl/default_body.php b/admin/views/layouts/tmpl/default_body.php index 6307e4a63..03034c310 100644 --- a/admin/views/layouts/tmpl/default_body.php +++ b/admin/views/layouts/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit"; - get('core.edit')): ?> -
+
+ get('core.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'layouts.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->alias); ?> @@ -79,13 +79,13 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit"; escape($item->description); ?> - user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?> -
+
+ user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?> escape($item->dynamic_get_name); ?> -
- -
escape($item->dynamic_get_name); ?>
- + + escape($item->dynamic_get_name); ?> + +
get('core.edit.state')) : ?> diff --git a/admin/views/libraries/tmpl/default_body.php b/admin/views/libraries/tmpl/default_body.php index 958ea2e00..718c67fca 100644 --- a/admin/views/libraries/tmpl/default_body.php +++ b/admin/views/libraries/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit" - get('library.edit')): ?> -
+
+ get('library.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'libraries.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
get('library_config.edit') && $library_config_id = ComponentbuilderHelper::getVar('library_config', $item->id, 'library', 'id')): ?> diff --git a/admin/views/libraries_config/tmpl/default_body.php b/admin/views/libraries_config/tmpl/default_body.php index b763c7b42..029f0ab58 100644 --- a/admin/views/libraries_config/tmpl/default_body.php +++ b/admin/views/libraries_config/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=libraries_config&task=librar - get('library_config.edit')): ?> -
+
+ get('library_config.edit')): ?> escape($item->library_name); ?> checked_out): ?> name, $item->checked_out_time, 'libraries_config.', $canCheckin); ?> -
- -
escape($item->library_name); ?>
- + + escape($item->library_name); ?> + +
get('library_config.edit.state')) : ?> diff --git a/admin/views/libraries_files_folders_urls/tmpl/default_body.php b/admin/views/libraries_files_folders_urls/tmpl/default_body.php index 9ff09d78e..768a56cea 100644 --- a/admin/views/libraries_files_folders_urls/tmpl/default_body.php +++ b/admin/views/libraries_files_folders_urls/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=libraries_files_folders_urls - get('library_files_folders_urls.edit')): ?> -
+
+ get('library_files_folders_urls.edit')): ?> escape($item->library_name); ?> checked_out): ?> name, $item->checked_out_time, 'libraries_files_folders_urls.', $canCheckin); ?> -
- -
escape($item->library_name); ?>
- + + escape($item->library_name); ?> + +
get('library_files_folders_urls.edit.state')) : ?> diff --git a/admin/views/servers/tmpl/default_body.php b/admin/views/servers/tmpl/default_body.php index b46f01e2b..dde9be73a 100644 --- a/admin/views/servers/tmpl/default_body.php +++ b/admin/views/servers/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=servers&task=server.edit"; - get('server.edit')): ?> -
+
+ get('server.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'servers.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
protocol); ?> diff --git a/admin/views/site_views/tmpl/default_body.php b/admin/views/site_views/tmpl/default_body.php index 2c94920ab..a65ea1d2a 100644 --- a/admin/views/site_views/tmpl/default_body.php +++ b/admin/views/site_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.ed - get('core.edit')): ?> -
+
+ get('core.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'site_views.', $canCheckin); ?> -
- -
escape($item->system_name); ?>
- + + escape($item->system_name); ?> + +
escape($item->name); ?> diff --git a/admin/views/snippet_types/tmpl/default_body.php b/admin/views/snippet_types/tmpl/default_body.php index 22286faf2..4f6d3b05e 100644 --- a/admin/views/snippet_types/tmpl/default_body.php +++ b/admin/views/snippet_types/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=snippet_types&task=snippet_t - get('snippet_type.edit')): ?> -
+
+ get('snippet_type.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'snippet_types.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->description); ?> diff --git a/admin/views/snippets/tmpl/default_body.php b/admin/views/snippets/tmpl/default_body.php index d5db9329f..66fda6474 100644 --- a/admin/views/snippets/tmpl/default_body.php +++ b/admin/views/snippets/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.edit"; - get('core.edit')): ?> -
+
+ get('core.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'snippets.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->url); ?> @@ -82,13 +82,13 @@ $edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.edit"; escape($item->heading); ?> - user->authorise('library.edit', 'com_componentbuilder.library.' . (int)$item->library)): ?> -
+
+ user->authorise('library.edit', 'com_componentbuilder.library.' . (int)$item->library)): ?> escape($item->library_name); ?> -
- -
escape($item->library_name); ?>
- + + escape($item->library_name); ?> + +
get('core.edit.state')) : ?> diff --git a/admin/views/templates/tmpl/default_body.php b/admin/views/templates/tmpl/default_body.php index 15d683a48..27d094405 100644 --- a/admin/views/templates/tmpl/default_body.php +++ b/admin/views/templates/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=templates&task=template.edit - get('core.edit')): ?> -
+
+ get('core.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'templates.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->alias); ?> diff --git a/admin/views/validation_rules/tmpl/default_body.php b/admin/views/validation_rules/tmpl/default_body.php index da1ddb72a..09fc10a4e 100644 --- a/admin/views/validation_rules/tmpl/default_body.php +++ b/admin/views/validation_rules/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=validation_rules&task=valida - get('validation_rule.edit')): ?> -
+
+ get('validation_rule.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'validation_rules.', $canCheckin); ?> -
- -
escape($item->name); ?>
- + + escape($item->name); ?> + +
escape($item->short_description); ?> diff --git a/componentbuilder.xml b/componentbuilder.xml index 79b0655ef..b585936a3 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 22nd May, 2018 + 24th May, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 92d7b475a..3fae249af 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -1801,7 +1801,7 @@ abstract class ComponentbuilderHelper return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix))); } - public static function imageInfo($path,$request = 'type') + public static function imageInfo($path, $request = 'type') { // set image $image = JPATH_SITE.'/'.$path; @@ -1914,37 +1914,79 @@ abstract class ComponentbuilderHelper return array_unique($bucket); } - public static function typeField($type,$option = 'default') + + /** + * Field Grouping https://docs.joomla.org/Form_field + **/ + protected static $fieldGroups = array( + 'default' => array( + 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', + 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', + 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', + 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', + 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', + 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', + 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', + 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ), + 'plain' => array( + 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', + 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', + 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', + 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', + 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', + 'sessionhandler', 'tag', 'tel', 'text', 'textarea', + 'timezone', 'url', 'user', 'usergroup' + ), + 'text' => array( + 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' + ), + 'list' => array( + 'checkboxes','checkbox','list','radio' + ), + 'dynamic' => array( + 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' + ), + 'spacer' => array( + 'note', 'spacer' + ), + 'option' => array( + 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' + ), + 'special' => array( + 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', + 'repeatable', 'templatestyle', 'subform' + ) + ); + + /** + * Field Checker + * + * @param string $type The field type + * @param boolean $option The field grouping + * + * @return boolean if the field was found + */ + public static function fieldCheck($type, $option = 'default') { - // list of default fields - // https://docs.joomla.org/Form_field - $fields = array( - 'default' => array( - 'accesslevel','cachehandler','calendar','captcha','category','checkbox', - 'checkboxes','color','combo','componentlayout','contentlanguage','editor', - 'chromestyle','contenttype','databaseconnection','editors','email','file', - 'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite', - 'imagelist','integer','language','list','media','menu','note','password', - 'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag', - 'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag', - 'templatestyle','text','textarea','timezone','url','user','usergroup' - ), - 'text' => array( - 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' - ), - 'list' => array( - 'checkboxes','checkbox','list','radio' - ), - 'dynamic' => array( - 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' - ) - ); - - if (in_array($type,$fields[$option])) + // now check + if (isset(self::$fieldGroups[$option]) && in_array($type, self::$fieldGroups[$option])) { return true; } - return false; + return false; + } + + /** + * get the spacer IDs + * + * @return array ids of the spacer field types + */ + public static function getSpacerIds() + { + // get the database object to use quote + $db = JFactory::getDbo(); + return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id'); } /** diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini index 7bb8db707..dd72dabba 100644 --- a/site/language/en-GB/en-GB.com_componentbuilder.ini +++ b/site/language/en-GB/en-GB.com_componentbuilder.ini @@ -22,6 +22,9 @@ COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="
License
%s
" COM_COMPONENTBUILDER_DTOWNERDTDDSDD="
Owner
%s
" COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="
Website
%s
" COM_COMPONENTBUILDER_EDIT_S="Edit %s" +COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS="Edit the admin fields" +COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS="Edit the admin fields conditions" +COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_RELATIONS="Edit the admin fields relations" COM_COMPONENTBUILDER_EMAIL_S="Email: %s" COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND="Email with the new key was send" COM_COMPONENTBUILDER_EMCOMPANYEM_BSB="Company: %s" @@ -68,8 +71,19 @@ COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_L COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The %s file could not be moved to %s path on %s server." COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The %s file could not be moved to %s server." COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info!" +COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views" +COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config" +COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS="The component custom admin menus" +COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS="The component custom admin views" +COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD="The component dashboard" +COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS="The component files & folders" +COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS="The component mysql tweaks" +COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views" +COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates" COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for %s could not be made. Please check your signature details!" COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for %s was not well formed, please check your signature details!" +COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS="The library config fields" +COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS="The library files, folders & URLs" COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to %s has failed, please check that your details are correct!" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: %s" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"