Update Custom

This commit is contained in:
Llewellyn 2024-09-10 01:09:57 +00:00
parent a0a9b27f1b
commit 21119f94fe

View File

@ -44,121 +44,127 @@
"adjustable": "1",
"description": "(optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'."
},
"properties24": {
"properties6": {
"name": "layout",
"example": "joomla.form.field.list-fancy-select",
"adjustable": "1",
"description": "(optional) New layout field added in Joomla 4"
},
"properties6": {
"properties7": {
"name": "multiple",
"example": "false",
"adjustable": "1",
"description": "(optional) is whether multiple items can be selected at the same time (true or false)."
},
"properties7": {
"properties8": {
"name": "default",
"example": "0",
"adjustable": "1",
"description": "(optional) (not translatable) is the default value."
},
"properties8": {
"properties9": {
"name": "required",
"example": "",
"adjustable": "1",
"description": "(optional) The field must be filled before submitting the form."
},
"properties9": {
"properties10": {
"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": {
"properties11": {
"name": "readonly",
"example": "",
"adjustable": "1",
"description": "(optional) The field cannot be changed and will automatically inherit the default value"
},
"properties11": {
"properties12": {
"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": {
"properties13": {
"name": "showon",
"example": "",
"adjustable": "1",
"description": "(optional) show this field on the bases of the value in another field. https:\/\/joomla.stackexchange.com\/a\/17682\/2166"
},
"properties13": {
"properties14": {
"name": "onchange",
"example": "",
"adjustable": "1",
"description": "(optional) HTML equivalent attribute (javascript use)"
},
"properties14": {
"properties15": {
"name": "extends",
"example": "list",
"adjustable": "1",
"mandatory": "1",
"description": "The JFormField sub class that should be extended. The options are ('list','radio','checkboxes')"
},
"properties15": {
"properties16": {
"name": "button",
"example": "true",
"adjustable": "1",
"description": "(optional) to add new button next to field in edit view"
},
"properties16": {
"properties17": {
"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": {
"properties18": {
"name": "component",
"example": "com_###component###",
"mandatory": "1",
"description": "(mandatory) The name of the component where this table is found. Must be com_users"
},
"properties18": {
"properties25": {
"name": "entity",
"example": "[[[view]]]",
"adjustable": "1",
"description": "(optional) The area\/entity this custom field is loaded. This value can be used in the field custom code."
},
"properties19": {
"name": "view",
"example": "subject",
"adjustable": "1",
"mandatory": "1",
"description": "(mandatory) The single view name if the place this field is added."
},
"properties19": {
"properties20": {
"name": "views",
"example": "subjects",
"adjustable": "1",
"mandatory": "1",
"description": "(mandatory) The list view name if the place this field is added."
},
"properties20": {
"properties21": {
"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": {
"properties22": {
"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": {
"properties23": {
"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": {
"properties24": {
"name": "type_php_1",
"example": "\/\/ Get the user object.\r\n\t\t$user = Factory::getUser();\r\n\t\t\/\/ Get the databse object.\r\n\t\t$db = Factory::getDBO();\r\n\t\t$query = $db->getQuery(true);\r\n\t\t$query->select($db->quoteName(array('a.###ID###','a.###TEXT###'),array('###ID###','###CODE_TEXT###')));\r\n\t\t$query->from($db->quoteName('###TABLE###', 'a'));\r\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\r\n\t\t$query->order('a.###TEXT### ASC');\r\n\t\t\/\/ Implement View Level Access (if set in table)\r\n\t\tif (!$user->authorise('core.options', '[[[com_component]]]'))\r\n\t\t{\r\n\t\t\t$columns = $db->getTableColumns('###TABLE###');\r\n\t\t\tif(isset($columns['access']))\r\n\t\t\t{\r\n\t\t\t\t$groups = implode(',', $user->getAuthorisedViewLevels());\r\n\t\t\t\t$query->where('a.access IN (' . $groups . ')');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$db->setQuery((string)$query);\r\n\t\t$items = $db->loadObjectList();\r\n\t\t$options = [];\r\n\t\tif ($items)\r\n\t\t{\r\n\t\t\tif ($this->multiple === false)\r\n\t\t\t{\r\n\t\t\t\t$options[] = Html::_('select.option', '', Text::_('Select an option'));\r\n\t\t\t}\r\n\t\t\tforeach($items as $item)\r\n\t\t\t{\r\n\t\t\t\t$options[] = Html::_('select.option', $item->###ID###, $item->###CODE_TEXT###);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $options;",
"adjustable": "1",