From 952f47eff535d53192d9c2c2109814338f49025e Mon Sep 17 00:00:00 2001 From: Llewellyn Date: Fri, 23 Aug 2024 17:23:44 +0000 Subject: [PATCH] Create Custom --- .../item.json | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 src/dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a/item.json diff --git a/src/dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a/item.json b/src/dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a/item.json new file mode 100644 index 0000000..fe5c07c --- /dev/null +++ b/src/dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a/item.json @@ -0,0 +1,178 @@ +{ + "name": "Custom", + "short_description": "provides a drop down list of items entries.", + "description": "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.", + "properties": { + "properties0": { + "name": "type", + "example": "subjects", + "mandatory": "1", + "description": "(mandatory) can be anything, just not the same as any other default Joomla field type. You can also not use the \"_\" (underscore) or \"-\" (hyphen) in the type name, and no spaces." + }, + "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'." + }, + "properties24": { + "name": "layout", + "example": "joomla.form.field.list-fancy-select", + "adjustable": "1", + "description": "(optional) New layout field added in Joomla 4" + }, + "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. https:\/\/joomla.stackexchange.com\/a\/17682\/2166" + }, + "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": "\/\/ 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", + "description": "The php for the getOptions method." + } + }, + "has_defaults": "0", + "datatype": "", + "datalenght": "", + "datalenght_other": "", + "datadefault": "", + "datadefault_other": "", + "indexes": "0", + "null_switch": "NOT NULL", + "store": "0", + "guid": "dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a" +} \ No newline at end of file